/* Japanese fonts without a 600 face would otherwise fall to Bold and read heavier than intended. */
@font-face {
  font-family: "Kureka JP";
  font-weight: 400;
  src: local("HiraginoSans-W3"), local("Hiragino Sans W3"), local("NotoSansCJKjp-Regular"), local("Noto Sans CJK JP Regular"), local("NotoSansJP-Regular"), local("YuGothicUI-Regular"), local("Yu Gothic UI"), local("Meiryo");
}

@font-face {
  font-family: "Kureka JP";
  font-weight: 600;
  src: local("HiraginoSans-W6"), local("Hiragino Sans W6"), local("NotoSansCJKjp-Medium"), local("Noto Sans CJK JP Medium"), local("NotoSansJP-Medium"), local("YuGothicUI-Semibold"), local("Yu Gothic UI Semibold"), local("Meiryo-Bold"), local("Meiryo Bold");
}

:root {
  --key: #16bc94;
  --key-hover: #14a985;
  /* White on the green fill. Contrast on --key is about 2.4:1. */
  --on-key: #fff;
  /* --key is 2.43:1 on white; text, outlines and line icons on the page use --link (5.30:1 on white, 4.87:1 on --main). */
  --link: #0b7a5f;
  --main: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --pill: #e8e8ed;
  --header-h: 56px;
  --sidebar: 272px;
  --font: "Kureka JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", Meiryo, "Yu Gothic UI", "Helvetica Neue", Arial, sans-serif;

  --t-display: 600 38px/1.1 var(--font);
  --t-title1: 600 30px/1.125 var(--font);
  --t-title2: 600 26px/1.143 var(--font);
  --t-title3: 600 22px/1.167 var(--font);
  --t-headline: 600 19px/1.238 var(--font);
  --t-body: 400 13px/1.7 var(--font);
  --t-body-strong: 600 13px/1.7 var(--font);
  --t-callout: 400 12px/1.43 var(--font);
  --t-callout-strong: 600 12px/1.43 var(--font);
  --t-footnote: 400 10px/1.33 var(--font);
  --t-footnote-strong: 600 10px/1.33 var(--font);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font: var(--t-body);
  color: var(--text);
  background: #fff;
  line-break: strict;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

h1, h2 {
  text-wrap: balance;
  word-break: auto-phrase;
}

body.filters-open,
body.modal-open { overflow: hidden; }

button, input, select { font: inherit; color: inherit; }

a { color: var(--link); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stage-bar {
  margin: 0;
  padding: 4px 16px;
  background: #fff4ce;
  color: var(--text);
  font: var(--t-footnote);
  text-align: center;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 420px) 1fr;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
  padding: 12px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header.header-simple { grid-template-columns: 1fr auto; }

.site-header:not(.header-simple) .search { grid-column: 2; }

.wordmark {
  display: inline-flex;
  align-self: center;
  justify-self: start;
}

.wordmark img {
  display: block;
  width: auto;
  height: 28px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  background: var(--main);
  border-radius: 999px;
}

.search svg { flex: 0 0 auto; color: var(--muted); }

.search input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font: var(--t-callout);
}

.search input::placeholder { color: var(--muted); }

.home-page .intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 440px);
  grid-template-areas: "copy art";
  align-items: center;
  column-gap: 32px;
  min-width: 0;
  padding: 34px 48px 42px;
  background-color: #eef8f3;
  background-image:
    radial-gradient(ellipse 58% 110% at 92% 30%, rgba(255, 255, 255, 0.96), transparent 58%),
    linear-gradient(128deg, transparent 8%, rgba(255, 255, 255, 0.72) 34%, transparent 52%),
    linear-gradient(152deg, transparent 42%, rgba(255, 255, 255, 0.55) 58%, transparent 74%),
    linear-gradient(105deg, #e4f4ec 0%, #f7fcf9 40%, #e7f5ee 100%);
}

.home-page .intro-copy { grid-area: copy; min-width: 0; }

.home-page .intro-art {
  grid-area: art;
  min-width: 0;
  justify-self: end;
}

.home-page .intro-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: #0e8f6e;
  font: 600 12px/1.4 var(--font);
  letter-spacing: 0.16em;
}

.home-page .intro-rule {
  display: inline-block;
  width: 36px;
  height: 2px;
  flex: 0 0 auto;
  border-radius: 1px;
  background: currentColor;
}

.home-page .intro-title {
  margin: 0;
  color: var(--text);
  font: 600 42px/1.25 var(--font);
  line-break: strict;
  word-break: keep-all;
}

.home-page .intro-lead {
  margin: 22px 0 0;
  color: #4e4e53;
  font: 400 15px/1.75 var(--font);
  line-break: strict;
  word-break: keep-all;
}

.home-page .intro-art img {
  display: block;
  width: min(440px, 100%);
  height: auto;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  background: var(--main);
  padding: 40px 24px 48px;
}

.sheet-bar { display: none; }

.sheet-bottom { display: none; }

.filters-title {
  margin: 0;
  font: var(--t-body-strong);
}

.home-page .filter-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 8px;
}

.home-page .filter-box-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.home-page .filter-box-bar .clear {
  margin: 0 0 0 auto;
  color: var(--link);
}

.group { margin-bottom: 24px; }

.group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--muted);
  font: var(--t-footnote-strong);
}

.home-page .group-label svg {
  flex: 0 0 auto;
  color: currentColor;
}

.pills { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }

.pill {
  border: 0;
  background: var(--pill);
  color: var(--text);
  border-radius: 999px;
  min-height: 32px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 14px;
  font: var(--t-callout);
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pill.is-on {
  background: var(--key);
  color: var(--on-key);
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font: var(--t-footnote);
}

.more { margin-top: 8px; }

.more summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--link);
  font: var(--t-callout-strong);
  cursor: pointer;
}

.more summary::-webkit-details-marker { display: none; }
.more summary::marker { content: ""; }

.more[open] summary { margin-bottom: 8px; }

.clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--link);
  font: var(--t-callout);
  cursor: pointer;
}

.main {
  min-width: 0;
  background: var(--main);
  padding: 56px 40px 96px;
}

.list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 48px;
}

.list-head:has(+ .condition-strip) { margin-bottom: 16px; }

.condition-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-width: 0;
  margin: 0 0 32px;
}

.condition-note {
  flex: 1 0 100%;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font: var(--t-footnote);
}

.condition-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.condition-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
}

.condition-label {
  color: var(--muted);
  font: var(--t-footnote-strong);
}

.condition-value {
  min-width: 0;
  overflow-wrap: anywhere;
  font: var(--t-callout);
}

.list-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

h1 {
  margin: 0;
  font: var(--t-title1);
  letter-spacing: 0.004em;
}

.count {
  color: var(--muted);
  font: var(--t-body);
}

.filter-launcher { display: none; }

.grid {
  display: grid;
  min-width: 0;
  /* About 136px each so 1100px fits five columns; never a seventh. */
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 24px 16px;
  max-width: calc(6 * 168px + 5 * 16px);
}

@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.tile {
  display: block;
  min-width: 0;
  text-align: center;
  color: inherit;
  text-decoration: none;
}

.face {
  --lift-shadow: 0 0 0 transparent;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.586 / 1;
  border-radius: 16px;
  box-shadow: var(--lift-shadow);
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@media (hover: hover) {
  .tile:hover .face {
    --lift-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
  }
}

.chip {
  position: absolute;
  top: 16%;
  left: 8%;
  width: 16%;
  aspect-ratio: 1.25 / 1;
  border-radius: 4px;
  background: linear-gradient(140deg, #f6e7b4 0%, #c6a15b 42%, #f8efc8 58%, #9a7436 100%);
}

.face-jcb { background: linear-gradient(160deg, #e7f2fb, #9ec4e8); }
.face-smbc { background: linear-gradient(160deg, #2f8f8c, #0e4f52); }
.face-diners { background: linear-gradient(160deg, #24365f, #10192e); }
.face-jal { background: linear-gradient(160deg, #2f9a62, #0f5a38); }
.face-ana { background: linear-gradient(160deg, #2a62b5, #0d3270); }
.face-epos { background: linear-gradient(160deg, #f3c2d1, #d47493); }
.face-luxury {
  background: #161616;
  box-shadow: inset 0 0 0 2px #c4a35a, var(--lift-shadow);
}
.face-business { background: linear-gradient(160deg, #8d8d92, #4a4a4e); }
/* normal (ノーマル): plain, neutral face for regular cards. A card with no face yet uses the same look. */
.face-normal,
.face-unset {
  background: linear-gradient(160deg, #f5f5f7, #e8e8ed);
  box-shadow: inset 0 0 0 1px #d2d2d7;
}

/* Card art from public/card-images/. The art draws its own border and stepped corners with transparency outside them,
   so it is not rounded off, and its shadow is a drop-shadow that follows that outline instead of the box. */
.face-image {
  border-radius: 0;
  background: none;
  box-shadow: none;
  filter: drop-shadow(0 0 0 transparent);
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), filter 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
@media (hover: hover) {
  .tile:hover .face-image { filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.12)); }
}
/* Pixel art: nearest-neighbor scaling keeps the outline and stepped corners crisp instead of blurring them. */
.face-image img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.face-landscape { aspect-ratio: 856 / 540; }
.face-portrait { aspect-ratio: 540 / 856; }
/* Upright, as tall as a landscape tile, so every row of the grid lines up. */
.tile .face-portrait { width: calc(100% * 540 / 856 * 540 / 856); margin: 0 auto; }

.tile-name {
  display: block;
  min-width: 0;
  margin-top: 12px;
  font: var(--t-body-strong);
  overflow-wrap: anywhere;
}

.tile-meta {
  display: grid;
  grid-template-rows: minmax(1.33em, auto) minmax(1.33em, auto);
  min-width: 0;
  margin-top: 2px;
  color: var(--muted);
  font: var(--t-footnote);
  font-variant-numeric: tabular-nums;
}
.tile-fee { grid-row: 1; }
.tile-rate { grid-row: 2; }
.tile-fee, .tile-rate { min-width: 0; overflow-wrap: anywhere; }

.tile:focus-visible .face,
.pill:focus-visible,
.clear:focus-visible,
.filter-launcher:focus-visible,
.official:focus-visible,
.modal-close:focus-visible,
.sheet-close:focus-visible,
.sheet-see:focus-visible,
.search input:focus-visible,
.back-link:focus-visible,
.page-link:focus-visible,
.contents-list a:focus-visible,
.list-neighbors a:focus-visible,
.fact-link:focus-visible,
.store-rest-toggle:focus-visible,
.gloss summary:focus-visible,
.wordmark:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.empty {
  margin: 48px 0 0;
  max-width: 28em;
}

.empty p { margin: 0 0 8px; }

.modal-root[hidden] { display: none; }

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 28px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
}

.modal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  padding-top: 64px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}

/* Only the body scrolls; the strip above it keeps the close button clear of the text. */
.modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 64px 64px;
}

.modal-close,
.sheet-close {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 48px;
  height: 48px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
}

.detail-top {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 44px;
  align-items: start;
}

.detail-top .card-art { padding-top: 56px; }

.card-art {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-art .official,
.card-art .issuer { margin-top: 16px; }

.card-tilt {
  width: min(280px, 100%);
  transform: rotate(-8deg);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.18));
}

/* A portrait card is as tall as a landscape one is wide. */
.card-tilt.is-portrait { width: min(177px, 63%); margin: 0 auto; }

.caption,
.confirmed {
  margin: 0;
  color: var(--muted);
  font: var(--t-footnote);
}

.caption { margin: 24px 0 0; text-align: center; }

.modal h2 {
  margin: 0 0 18px;
  font: var(--t-title2);
  letter-spacing: 0.007em;
}

.card-copy h1 {
  margin: 0 0 18px;
  font: var(--t-title2);
}

.b-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  table-layout: fixed;
}

.b-table th {
  width: 168px;
  text-align: left;
  vertical-align: top;
  background: var(--main);
  color: #4a4a4f;
  font: var(--t-callout);
  padding: 11px 14px;
  border-top: 1px solid #e8e8ed;
}

.b-table td {
  vertical-align: top;
  padding: 10px 16px;
  font: 400 14px/1.6 var(--font);
  font-variant-numeric: tabular-nums;
  border-top: 1px solid #e8e8ed;
  overflow-wrap: anywhere;
}

.b-table tr:first-child th,
.b-table tr:first-child td { border-top: 0; }

.b-table td.num { font-weight: 600; }
.b-table td.rate { font-weight: 600; color: var(--link); font-size: 16px; }

.v-item { display: inline; }
.v-line { display: block; }

.fact-note { display: block; margin-top: 2px; font: var(--t-footnote); color: var(--muted); word-break: auto-phrase; }

.gloss {
  min-height: 44px;
  min-width: 0;
  margin-top: 4px;
}

.gloss summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  color: var(--link);
  font: var(--t-callout);
}

.gloss p {
  min-width: 0;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  font: var(--t-footnote);
  color: var(--text);
}
.fact-link { color: var(--link); text-decoration: none; }
.fact-link:hover { text-decoration: underline; }

.fact-section { margin-top: 22px; }

.fact-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 8px;
  font: 600 15px/1.4 var(--font);
}

.fact-heading::before {
  content: "";
  width: 4px;
  height: 16px;
  background: var(--key);
  border-radius: 1px;
}

.modal .fact-section { margin-top: 22px; }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin-top: 24px;
}

.official-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.detail-more {
  margin-top: 56px;
}

.more-heading {
  margin: 56px 0 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--text);
  font: var(--t-headline);
}

.more-section { margin-top: 26px; }

.more-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font: 600 15px/1.4 var(--font);
}

.more-section-heading::before {
  content: "";
  width: 4px;
  height: 16px;
  background: var(--key);
  border-radius: 1px;
}

.page-only-tease .b-table {
  border-style: dashed;
  border-color: #9fd9c6;
}

.page-only-tease .b-table th { background: #f1faf7; }

.page-only-badge {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid var(--link);
  border-radius: 999px;
  color: var(--link);
  font: 600 10px/1 var(--font);
}

.page-only-tease .b-table td a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  font: 600 13px/1.4 var(--font);
  text-decoration: none;
}

.page-only-note {
  margin: 8px 0 0;
  color: var(--muted);
  font: 400 11px/1.5 var(--font);
}

.store-rest { min-width: 0; }

.store-rest-toggle {
  display: inline-flex;
  align-items: center;
  margin: 4px 0 16px;
  padding: 8px 0;
  color: var(--link);
  font: var(--t-callout);
  cursor: pointer;
  list-style: none;
}

.store-rest-toggle::-webkit-details-marker { display: none; }
.store-rest-toggle:hover { text-decoration: underline; }
.store-rest .store-rest-open { display: none; }
.store-rest[open] .store-rest-closed { display: none; }
.store-rest[open] .store-rest-open { display: inline; }

.page-link-wrap {
  margin: 0 0 24px;
}

.page-link {
  font: var(--t-body);
  text-decoration: none;
}

.page-link::after { content: " ›"; }
.page-link:hover { text-decoration: underline; }

.page-link-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font: var(--t-footnote);
}

.card-pagewrap {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 48px;
}

.card-side {
  position: sticky;
  top: 20px;
  align-self: start;
}

.page-contents,
.list-neighbors {
  min-width: 0;
  margin: 0 0 24px;
}

.contents-label {
  margin: 0 0 4px;
  font: 600 15px/1.4 var(--font);
}

.contents-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid #e8e8ed;
}

.contents-list a {
  display: block;
  padding: 3px 0 3px 12px;
  margin-left: -2px;
  border-left: 2px solid transparent;
}

.contents-list a.on {
  border-left-color: var(--key);
  color: var(--text);
  font-weight: 600;
}

.list-neighbors {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 24px 0 0;
}

.contents-list a,
.list-neighbors a {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  color: var(--link);
  text-decoration: none;
}

.contents-list a:hover,
.list-neighbors a:hover { text-decoration: underline; }

.official {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--key);
  color: var(--on-key);
  font: var(--t-callout);
  white-space: normal;
  max-width: 100%;
  text-decoration: none;
}

.official:hover { background: var(--key-hover); }

.issuer {
  margin: 0;
  color: var(--text);
  font: var(--t-body);
  text-align: left;
}

.back-link {
  justify-self: end;
  font: var(--t-callout);
  text-decoration: none;
}

.back-link:hover,
.clear:hover { text-decoration: underline; }

body.card-page { background: #fff; }

.card-layout {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 40px 96px;
}

.plain-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.plain-page h1 { font: var(--t-title1); margin-bottom: 16px; }

.plain-page p { margin: 0 0 16px; }

.doc-page {
  max-width: 692px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.doc-page h1 { margin: 0 0 16px; font: var(--t-title1); letter-spacing: 0.004em; }

.doc-lead { margin: 0 0 32px; color: var(--muted); }

.doc-page .facts { margin: 0 0 8px; border-top: 1px solid #e8e8ed; }

.doc-page .fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid #e8e8ed;
}

.doc-page .fact dt { flex: 0 0 auto; max-width: 50%; color: var(--muted); font: var(--t-callout); }
.doc-page .fact dd { margin: 0; color: var(--text); text-align: left; }

.doc-section { margin-top: 56px; }

.doc-section h2 { margin: 0 0 16px; font: var(--t-headline); letter-spacing: 0.011em; }

.doc-section p { margin: 0 0 16px; }

.doc-section ul { margin: 0 0 12px; padding-left: 1.2em; }

.doc-section li + li { margin-top: 6px; }

.doc-dates { margin-top: 24px; font: var(--t-callout); color: var(--muted); }

.site-footer {
  padding: 20px 28px 28px;
  background: var(--main);
  border-top: 1px solid var(--line);
  font: var(--t-footnote);
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.footer-links li + li::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.9em;
  margin: 0 10px;
  background: var(--line);
  vertical-align: -0.1em;
}

.footer-links a { color: #424245; text-decoration: none; }

.footer-links a:hover { text-decoration: underline; }

.footer-note,
.footer-copy { margin: 0 0 4px; }

@media (max-width: 800px) {
  .site-header:not(.header-simple) {
    grid-template-columns: 1fr;
    grid-template-areas:
      "mark"
      "search";
    gap: 10px 12px;
    padding: 12px 16px;
  }

  .site-header:not(.header-simple) .wordmark { grid-area: mark; }
  .site-header:not(.header-simple) .search { grid-area: search; max-width: none; }

  .home-page .intro {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "art"
      "copy";
    row-gap: 8px;
    margin-top: -10px;
    padding: 0 20px 36px;
  }

  .home-page .intro-art {
    justify-self: center;
    width: min(300px, 86%);
  }

  .home-page .intro-art img { width: 100%; }

  .home-page .intro-kicker { margin-bottom: 14px; letter-spacing: 0.12em; }

  .home-page .intro-title { font-size: 26px; line-height: 1.35; }

  .home-page .intro-lead { margin-top: 14px; font-size: 14px; }

  .header-simple { padding: 12px 16px; }

  .shell { display: block; min-width: 0; }

  .sidebar {
    display: none;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 30;
    overflow: hidden;
    padding: 0;
  }

  body.filters-open .sidebar { display: flex; }

  .sheet-bar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
  }

  .sheet-bar h2 { margin: 0; font: var(--t-title3); letter-spacing: 0.009em; }

  .home-page .filter-box {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin: 0 16px;
  }

  .home-page .filter-box-bar { display: none; }

  .sheet-bottom {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 16px;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.04);
  }

  .sheet-bottom .clear {
    flex: 0 0 auto;
    margin: 0;
    min-height: 48px;
    padding: 0 12px;
    font: var(--t-body-strong);
  }

  .sheet-see {
    flex: 1 1 auto;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--key);
    color: var(--on-key);
    font: 600 16px/1.2 var(--font);
    cursor: pointer;
  }

  .pill {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .sheet-close {
    color: var(--link);
    font: var(--t-body);
    min-height: 44px;
    padding: 0 4px;
  }

  .main { padding: 32px 20px 64px; }

  h1 { font: var(--t-title3); letter-spacing: 0.009em; }

  .count { font: var(--t-callout); }

  .filter-launcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--key);
    color: var(--on-key);
    font: var(--t-callout);
    cursor: pointer;
  }

  .list-head { align-items: flex-start; margin-bottom: 32px; }
  .list-title { flex-wrap: wrap; gap: 8px 12px; }


  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 12px; max-width: none; }

  .tile-name { margin-top: 12px; font: var(--t-callout-strong); }

  .modal-root { padding: 0; }
  .modal {
    width: 100%;
    min-width: 0;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
    padding-top: 64px;
  }

  .modal-close { top: 8px; right: 8px; }
  .modal-body { padding: 0 24px 32px; }
  .card-layout { padding: 28px 20px 64px; }
  .detail-top { display: block; gap: 16px; }
  .detail-top .card-art { padding-top: 0; }
  .card-copy h1 { font: var(--t-title3); letter-spacing: 0.009em; }

  .card-pagewrap { display: block; }
  .card-side { position: static; }
  .contents-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 14px;
    border-left: 0;
  }
  .contents-list a { padding: 0; border: 0; margin: 0; }
  .contents-list a.on { border: 0; font-weight: 600; }
  .list-neighbors {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 16px 0 28px;
  }

  .b-table th { width: 112px; padding: 10px 10px 10px 12px; }
  .b-table td { padding: 9px 12px; }

  .detail-more { margin-top: 40px; }
  .more-heading { margin-top: 0; }

  .caption { margin: 12px 0 16px; }

  .modal h2 { font: var(--t-title3); letter-spacing: 0.009em; }

  .modal-body,
  .card-layout,
  .detail-more,
  .b-table { min-width: 0; }

  .card-tilt {
    transform: none;
    width: min(216px, 62%);
    margin: 0 auto;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.16));
  }
  .card-tilt.is-portrait { width: min(136px, 39%); }

  .card-actions { flex-direction: column; align-items: stretch; }

  .official {
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    min-width: 0;
  }

  .confirmed { text-align: left; }

  .doc-page { padding: 32px 20px 56px; }
  .doc-page h1 { font: var(--t-title2); letter-spacing: 0.007em; }
  .doc-section { margin-top: 40px; }

  .site-footer { padding: 16px 16px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .card-tilt { transform: none; }
  .face { transition: none; }
  .tile:hover .face { transform: none; }
}
