/* Design tokens — DESIGN.md (white gallery style) */
:root {
  --color-gallery-white: #ffffff;
  --color-studio-mist: #f5f5f7;
  --color-paper-frost: #fafafc;
  --color-hairline-silver: #d6d6d6;
  --color-control-gray: #e6e6e8;
  --color-ink: #1d1d1f;
  --color-slate: #707070;
  --color-steel: #86868b;
  --color-apple-blue: #0066cc;
  --color-pricing-blue: #0071e3;
  --color-launch-orange: #b64400;

  --font-display: "SF Pro Display", Inter, "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", Arial, sans-serif;
  --font-text: "SF Pro Text", Inter, "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", Arial, sans-serif;

  --section-gap: 90px;
  --card-padding: 28px;
  --element-gap: 20px;

  --radius-cards: 28px;
  --radius-images: 28px;
  --radius-pills: 36px;
  --radius-navigation: 20px;
  --radius-inputs: 980px;
  --radius-buttons: 9999px;

  --shadow-subtle: rgb(230, 230, 232) 0 0 0 1px;
  --shadow-subtle-2: rgb(134, 134, 139) 0 0 0 1px;

  --content: 1120px;
  --wide: 1360px;

  /* 面・コントロール（ライト） */
  --surface: #ffffff;
  --on-ink: #ffffff;
  --ink-strong: #000000;
  --nav-bg: rgba(250, 250, 252, .8);
  --lnav-bg: rgba(255, 255, 255, .8);
  --nav-text: rgba(0, 0, 0, .8);
  --control-track: rgba(210, 210, 215, .64);
  --control-track-hover: rgba(210, 210, 215, .9);
  --control-glyph: rgba(0, 0, 0, .56);
  --backdrop: rgba(245, 245, 247, .82);
  --fav: #e0245e;
  /* グラフ（validate_palette.js 合格済み: light） */
  --chart-1: #0071e3;
  --chart-2: #d97a00;
  color-scheme: light;
}

/* ダークモード：OS設定に従う（手動で light を選んだ場合を除く）＋手動で dark を選んだ場合 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-gallery-white: #000000;
    --color-studio-mist: #161617;
    --color-paper-frost: #1d1d1f;
    --color-hairline-silver: #424245;
    --color-control-gray: #2c2c2e;
    --color-ink: #f5f5f7;
    --color-slate: #a1a1a6;
    --color-steel: #86868b;
    --color-apple-blue: #2997ff;
    --color-launch-orange: #ff9f40;
    --shadow-subtle: rgb(66, 66, 69) 0 0 0 1px;
    --surface: #1d1d1f;
    --on-ink: #1d1d1f;
    --ink-strong: #ffffff;
    --nav-bg: rgba(22, 22, 23, .8);
    --lnav-bg: rgba(0, 0, 0, .72);
    --nav-text: rgba(255, 255, 255, .8);
    --control-track: rgba(118, 118, 128, .32);
    --control-track-hover: rgba(118, 118, 128, .5);
    --control-glyph: rgba(255, 255, 255, .72);
    --backdrop: rgba(0, 0, 0, .72);
    --fav: #ff4f80;
    --chart-1: #2997ff;
    --chart-2: #c97a1e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --color-gallery-white: #000000;
  --color-studio-mist: #161617;
  --color-paper-frost: #1d1d1f;
  --color-hairline-silver: #424245;
  --color-control-gray: #2c2c2e;
  --color-ink: #f5f5f7;
  --color-slate: #a1a1a6;
  --color-steel: #86868b;
  --color-apple-blue: #2997ff;
  --color-launch-orange: #ff9f40;
  --shadow-subtle: rgb(66, 66, 69) 0 0 0 1px;
  --surface: #1d1d1f;
  --on-ink: #1d1d1f;
  --ink-strong: #ffffff;
  --nav-bg: rgba(22, 22, 23, .8);
  --lnav-bg: rgba(0, 0, 0, .72);
  --nav-text: rgba(255, 255, 255, .8);
  --control-track: rgba(118, 118, 128, .32);
  --control-track-hover: rgba(118, 118, 128, .5);
  --control-glyph: rgba(255, 255, 255, .72);
  --backdrop: rgba(0, 0, 0, .72);
  --fav: #ff4f80;
  --chart-1: #2997ff;
  --chart-2: #c97a1e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-gallery-white);
  color: var(--color-ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.374px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-apple-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--color-pricing-blue); outline-offset: 2px; }

/* ---------- Global navigation ---------- */
.gnav {
  height: 44px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.gnav-inner {
  max-width: var(--content); height: 100%; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.gnav a {
  color: var(--nav-text); font-size: 12px; line-height: 1; letter-spacing: -0.12px;
  white-space: nowrap;
}
.gnav a:hover { color: var(--color-ink); text-decoration: none; }
.gnav a.active { color: var(--color-ink); font-weight: 600; }
.lang-switch {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--nav-text); font-size: 12px; line-height: 1; letter-spacing: -0.12px; white-space: nowrap;
}
.lang-switch:hover { color: var(--color-ink); }
.gnav-spacer { display: none; }
.nowrap { white-space: nowrap; }

/* ---------- Bottom tab bar (mobile only) ---------- */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  grid-template-columns: repeat(5, 1fr);
  padding: 0 4px env(safe-area-inset-bottom);
  background: var(--lnav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--color-hairline-silver);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 56px; color: var(--color-steel); font-size: 10px; line-height: 1.1; letter-spacing: -0.1px;
  text-align: center; -webkit-tap-highlight-color: transparent;
}
.tabbar a:hover { text-decoration: none; }
.tabbar a.active { color: var(--color-apple-blue); font-weight: 600; }
.tabbar svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar a > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.tab-icon { position: relative; display: inline-flex; }
.tab-icon .nav-badge { position: absolute; top: -4px; right: -10px; margin: 0; }

/* ---------- Footer links ---------- */
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-hairline-silver); }
.footer-links a { color: var(--color-ink); }
.footer-links a:hover { color: var(--color-apple-blue); }

/* ---------- Local navigation ---------- */
.lnav {
  position: sticky; top: 0; z-index: 30;
  background: var(--lnav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-hairline-silver);
}
.lnav-inner {
  max-width: var(--content); margin: 0 auto; padding: 0 22px; min-height: 52px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.lnav-title {
  font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.21;
  letter-spacing: 0.228px; color: var(--color-ink); white-space: nowrap;
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.lnav-title:hover { text-decoration: none; }
.lnav-actions { display: flex; align-items: center; gap: 10px; }

/* Controls */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: var(--radius-buttons); padding: 6px 14px;
  font-size: 12px; line-height: 16px; letter-spacing: -0.12px;
  cursor: pointer; white-space: nowrap; border: 0;
}
.pill:hover { text-decoration: none; }
.pill-outline { background: transparent; color: var(--color-ink); box-shadow: var(--shadow-subtle-2); }
.pill-outline:hover { background: var(--color-studio-mist); }
.pill-outline[aria-pressed="true"] { background: var(--color-ink); color: var(--on-ink); box-shadow: none; }
.pill-blue { background: var(--color-pricing-blue); color: #fff; }
.pill-blue:hover { background: #0077ed; }

.search {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 14px; border-radius: var(--radius-inputs);
  background: var(--color-studio-mist); color: var(--color-steel);
  width: 240px;
}
.search:focus-within { background: var(--surface); box-shadow: var(--shadow-subtle-2); }
.search input {
  border: 0; outline: 0; background: transparent; width: 100%;
  font-family: var(--font-text); font-size: 13px; color: var(--color-ink);
}
.search input::placeholder { color: var(--color-steel); }
.search-lg { height: 44px; width: min(420px, 100%); padding: 0 20px; }
.search-lg input { font-size: 15px; }

/* ---------- Typography helpers ---------- */
.kicker {
  font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1;
  letter-spacing: 0.231px; margin: 0 0 16px;
}
.display {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(40px, 7vw, 80px); line-height: 1.05; letter-spacing: -0.015em;
  margin: 0;
}
.lead { font-size: 21px; line-height: 1.38; color: var(--color-ink); margin: 20px 0 0; letter-spacing: 0.012em; }
.label-new { color: var(--color-launch-orange); font-size: 12px; font-weight: 600; line-height: 16px; letter-spacing: -0.12px; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--wide); margin: 0 auto; padding: 64px 22px 0; text-align: center;
}
.hero .lead { color: var(--color-slate); max-width: 640px; margin-left: auto; margin-right: auto; }
.hero-cta { display: flex; gap: 24px; justify-content: center; margin-top: 24px; font-size: 17px; }
.hero-cta a::after { content: " ›"; }
.hero-stage { position: relative; margin-top: 48px; }
.hero-stage button {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
}
.hero-stage img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-images);
  background: var(--color-studio-mist);
}
.callout {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 20px;
  background: var(--surface); border-radius: var(--radius-cards);
  padding: 12px 12px 12px 24px; max-width: calc(100% - 40px); text-align: left;
}
.callout-text { min-width: 0; }
.callout-title {
  font-size: 14px; font-weight: 600; line-height: 1.29; letter-spacing: -0.224px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.callout-sub { font-size: 12px; color: var(--color-slate); line-height: 1.33; letter-spacing: -0.12px; }

.stats {
  display: flex; justify-content: center; gap: 64px; margin: 64px auto 0; padding: 0 22px;
}
.stat { text-align: center; }
.stat b {
  display: block; font-family: var(--font-display); font-size: 48px; font-weight: 600; line-height: 1.08;
  letter-spacing: -0.01em;
}
.stat span { font-size: 14px; color: var(--color-slate); }

/* ---------- Artist hero (filtered) ---------- */
.artist-hero {
  max-width: var(--content); margin: 0 auto; padding: 64px 22px 24px;
}
.artist-hero .back { font-size: 14px; display: inline-block; margin-bottom: 28px; }
.artist-hero .back::before { content: "‹ "; }
.artist-hero .meta { color: var(--color-slate); font-size: 17px; margin-top: 16px; }
.artist-hero .actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* ---------- Anchor navigation ---------- */
.anchors {
  max-width: var(--content); margin: 0 auto; padding: 0 22px;
  display: flex; justify-content: safe center; gap: 24px; flex-wrap: nowrap;
  overflow-x: auto; scrollbar-width: none;
}
.anchors::-webkit-scrollbar { display: none; }
.anchors button {
  background: none; border: 0; padding: 28px 0; cursor: pointer; white-space: nowrap; flex: none;
  font-size: 17px; font-weight: 500; line-height: 25px; letter-spacing: -0.374px;
  color: var(--color-slate);
}
.anchors button:hover { color: var(--color-ink); }
.anchors button[aria-current="true"] { color: var(--color-ink); }
.anchors button .n { font-size: 12px; font-weight: 400; margin-left: 4px; color: var(--color-steel); }

/* ---------- Filters (faction / hull type) ---------- */
.filters {
  max-width: var(--content); margin: -8px auto 0; padding: 0 22px 24px;
  display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap;
}
.select { position: relative; display: inline-flex; }
.select::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
  pointer-events: none; color: var(--color-steel);
}
.select select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  font: inherit; font-size: 12px; line-height: 16px; letter-spacing: -0.12px; color: var(--color-ink);
  background: transparent; border: 0; box-shadow: var(--shadow-subtle-2);
  border-radius: var(--radius-buttons); padding: 7px 34px 7px 14px;
}
.select select:hover { background: var(--color-studio-mist); }
.select.on select { background: var(--color-ink); color: var(--on-ink); box-shadow: none; }
.select.on::after { color: var(--on-ink); }
.link-btn { background: none; border: 0; cursor: pointer; color: var(--color-apple-blue); font-size: 12px; padding: 4px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Character page: illustrators who drew her ---------- */
.drawers { margin-top: 40px; }
.drawers h2 {
  font-family: var(--font-display); font-size: 17px; font-weight: 600; margin: 0 0 12px;
}
.drawers ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.drawers li {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-studio-mist); border-radius: var(--radius-buttons); padding: 4px 4px 4px 14px;
  font-size: 14px;
}
.drawers li > span { color: var(--color-slate); font-size: 12px; }
.drawers li:not(:has(.x-btn)) { padding-right: 14px; }
.drawers h2 span { font-family: var(--font-text); font-size: 12px; font-weight: 400; color: var(--color-slate); margin-left: 8px; }
.designs li.plain { color: var(--color-slate); padding: 4px 14px; }
.drawers .x-btn { width: 26px; height: 26px; }
.drawers .x-btn svg { width: 12px; height: 12px; }

/* ---------- Band (Studio Mist) ---------- */
.band { background: var(--color-studio-mist); padding: var(--section-gap) 0; }
.band-inner { max-width: var(--wide); margin: 0 auto; padding: 0 22px; }

.group + .group { margin-top: var(--section-gap); }
.group-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  margin: 0 0 28px;
}
.group-head h2 {
  font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1; margin: 0;
}
.group-head span { color: var(--color-slate); font-size: 17px; }

.grid {
  display: grid; gap: var(--element-gap);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Feature media card */
.card {
  background: var(--surface); border-radius: var(--radius-cards); overflow: hidden;
  display: flex; flex-direction: column;
}
.card-media {
  display: block; width: 100%; padding: 0; border: 0; background: var(--color-control-gray); color: inherit;
  cursor: zoom-in; overflow: hidden; aspect-ratio: 16 / 9;
}
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.card-media:hover img { transform: scale(1.03); }
.card-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-chars {
  font-family: var(--font-display); font-size: 15px; font-weight: 600; line-height: 1.33;
  letter-spacing: -0.2px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; min-height: calc(2 * 1.33em);
}
.card-artist-wrap { overflow: hidden; }
.card-artist { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.card-chars a { color: var(--color-ink); }
.card-chars a:hover { color: var(--color-apple-blue); text-decoration: none; }
.card-foot {
  margin-top: auto; padding-top: 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 14px; line-height: 1.29; letter-spacing: -0.224px;
}
.card-artist { color: var(--color-apple-blue); }
.card-artist::after { content: " ›"; }
.card-artist-wrap { min-width: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.card-tail { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.card-foot { align-items: center; }

/* X icon button */
.x-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-ink); color: var(--on-ink);
  transition: background .2s;
}
.x-btn:hover { background: var(--ink-strong); text-decoration: none; }
.x-btn svg { width: 14px; height: 14px; }
.pill-x { background: var(--color-ink); color: var(--on-ink); gap: 6px; }
.pill-x:hover { background: var(--ink-strong); }
.pill-x svg { width: 12px; height: 12px; }

/* 画像検索による推定ラベル（DESIGN.md: 色付きピルを使わず素のテキスト） */
.est { color: var(--color-launch-orange); font-size: 12px; font-weight: 600; line-height: 16px; letter-spacing: -0.12px; cursor: help; }
.muted { color: var(--color-steel); }
.card-note { font-size: 12px; color: var(--color-slate); }

.empty { text-align: center; color: var(--color-slate); padding: 64px 0; }

/* ---------- Page hero (artists / about) ---------- */
.page-hero { max-width: var(--content); margin: 0 auto; padding: 80px 22px 64px; text-align: center; }
.page-hero .lead { color: var(--color-slate); }
.page-hero-controls {
  display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 40px;
}

.segmented {
  display: inline-flex; padding: 3px; border-radius: var(--radius-pills);
  background: var(--control-track);
}
.segmented button {
  border: 0; background: transparent; padding: 7px 16px; border-radius: var(--radius-pills);
  font-size: 12px; line-height: 16px; color: var(--control-glyph); cursor: pointer;
}
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--color-ink); }

/* Artist cards */
.artist-grid {
  display: grid; gap: var(--element-gap);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.artist-card {
  background: var(--surface); border-radius: var(--radius-cards); overflow: hidden;
  display: flex; flex-direction: column; color: var(--color-ink);
}
.artist-card:hover .mosaic img { transform: scale(1.03); }
.artist-card .name a { color: var(--color-ink); }
.artist-card .name a:hover { color: var(--color-apple-blue); text-decoration: none; }
.mosaic {
  display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px;
  aspect-ratio: 16 / 9; background: var(--color-control-gray); overflow: hidden;
}
.mosaic > div { overflow: hidden; min-height: 0; }
.mosaic > div:first-child { grid-row: span 2; }
.mosaic.n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.mosaic.n1 > div:first-child { grid-row: auto; }
.mosaic.n2 > div:first-child { grid-row: auto; }
.mosaic.n2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.artist-card .body { padding: 20px 24px 24px; }
.artist-card .name {
  font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.19; margin: 0;
  overflow-wrap: anywhere;
}
.artist-card .sub { font-size: 14px; color: var(--color-slate); margin-top: 6px; }
.artist-card .links { display: flex; gap: 16px; margin-top: 12px; font-size: 14px; align-items: center; }
.artist-card .links .x-btn { margin-left: auto; }

/* ---------- Editorial (about) ---------- */
.editorial {
  max-width: 780px; margin: 0 auto; padding: 0 22px var(--section-gap);
  display: grid; gap: 48px;
}
.editorial h2 {
  font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.14; margin: 0 0 12px;
}
.editorial p { margin: 0; color: var(--color-ink); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.lb-backdrop {
  position: absolute; inset: 0; background: var(--backdrop);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.lb-panel {
  position: relative; width: min(1200px, 100%); max-height: 100%;
  background: var(--surface); border-radius: var(--radius-cards); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-subtle);
}
.lb-top { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.lb-pos { flex: 1; text-align: center; font-size: 12px; color: var(--color-slate); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--control-track); color: var(--control-glyph);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--control-track-hover); color: var(--color-ink); }
.lb-media { padding: 0 16px; min-height: 0; flex: 1; display: flex; justify-content: center; }
.lb-media img {
  max-width: 100%; max-height: calc(100vh - 280px); object-fit: contain;
  border-radius: 20px; background: var(--color-studio-mist);
}
.lb-info {
  padding: 24px 28px 28px; display: grid; gap: 16px;
  grid-template-columns: 1fr auto; align-items: end; overflow-y: auto;
}
.lb-info h3 {
  font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.17; margin: 0;
}
.lb-info h3 a { color: var(--color-ink); }
.lb-info h3 a:hover { color: var(--color-apple-blue); text-decoration: none; }
.lb-meta { font-size: 14px; color: var(--color-slate); margin-top: 8px; line-height: 1.43; }
.lb-meta a { white-space: nowrap; }
.lb-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lb-share { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.lb-share .pill svg { width: 12px; height: 12px; }
.lb-sources { grid-column: 1 / -1; display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; padding-top: 16px; border-top: 1px solid var(--color-control-gray); }
.lb-sources span { color: var(--color-slate); }

/* ---------- Footer ---------- */
.footer { background: var(--color-studio-mist); border-top: 1px solid var(--color-hairline-silver); }
.footer-inner {
  max-width: var(--content); margin: 0 auto; padding: 20px 22px 28px;
  font-size: 12px; line-height: 1.33; letter-spacing: -0.12px; color: var(--color-slate);
}
.footer-inner p { margin: 0 0 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 834px) {
  #randomBtn { display: none; }
  .stats { gap: 32px; }
  .stat b { font-size: 36px; }
  .lb-info { grid-template-columns: 1fr; }
  .lb-actions { justify-content: flex-start; }
}
@media (max-width: 600px) {
  :root { --section-gap: 64px; }
  /* スマホ：上部はロゴ・言語・テーマだけにして、メニューは下部固定のタブバーへ */
  .gnav { height: 40px; }
  .gnav-inner { gap: 4px; padding: 0 12px 0 16px; }
  .gnav .gnav-link { display: none; }
  .gnav-spacer { display: block; flex: 1; }
  .lang-switch { padding: 6px 4px; }
  .gnav-tools { gap: 8px; }
  .search-panel-inner { padding: 8px 16px; }
  .lnav-inner { min-height: 48px; }
  .lnav-actions { margin-left: auto; }
  .lnav-title { font-size: 17px; }
  .lnav-actions { display: none; }
  body { padding-bottom: calc(57px + env(safe-area-inset-bottom)); } /* タブバー 56px + 上罫線 1px */
  .tabbar { display: grid; }
  .lnav-inner { padding: 8px 16px; gap: 8px; }
  .hero { padding: 20px 16px 0; }
  .hero .kicker { font-size: 13px; margin-bottom: 6px; color: var(--color-slate); }
  .hero .display { font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; }
  .hero .lead, .hero .hero-cta, .hero .stats { display: none; }
  .hero-stage { margin: 16px -16px 0; }
  .hero-stage img { border-radius: 0; }
  .callout { position: static; transform: none; margin: 0; max-width: none; border-radius: 0; padding: 10px 12px 10px 16px; background: var(--surface); }
  .callout .pill-blue { display: none; }
  .stats { gap: 24px; }
  .stat b { font-size: 28px; }
  .anchors { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; gap: 20px; padding: 0 16px; }
  .anchors button { padding: 20px 0; white-space: nowrap; }
  /* 画像を主役に：スマホでは画像を画面幅いっぱいに、周りの余白を最小限に */
  .band { padding: 24px 0 40px; }
  .band-inner { padding: 0; }
  .group + .group { margin-top: 40px; }
  .group-head { padding: 0 16px; margin-bottom: 12px; }
  .group-head h2 { font-size: 28px; }
  .group-head span { font-size: 14px; }
  .grid { grid-template-columns: 1fr; gap: 8px; }
  .card { border-radius: 0; }
  .card-media:hover img { transform: none; }
  .card-body { padding: 10px 16px 12px; gap: 4px; }
  .card-chars { font-size: 14px; line-height: 1.36; }
  .card-foot { font-size: 13px; padding-top: 0; }
  .x-btn { width: 28px; height: 28px; }
  .x-btn svg { width: 13px; height: 13px; }
  .anchors button { padding: 14px 0; }
  .filters { margin-top: 0; padding: 0 16px 16px; justify-content: flex-start; }
  .artist-grid { gap: 8px; }
  .artist-card { border-radius: 0; }
  .artist-card .body { padding: 12px 16px 14px; }
  .artist-card .name { font-size: 17px; }
  .artist-hero { padding: 40px 16px 8px; }
  .page-hero { padding: 56px 16px 40px; }
  .lightbox { padding: 0; }
  .lb-panel { border-radius: 0; height: 100%; }
  .lb-media img { max-height: 50vh; border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .card-media img, .mosaic img { transition: none; }
}

/* =====================================================================
   追加機能: お気に入り / 版違い / 年表 / テーマ切替 / 統計
   ===================================================================== */

/* nav */
.nav-badge {
  display: inline-block; min-width: 16px; height: 16px; margin-left: 4px; padding: 0 4px;
  border-radius: 8px; background: var(--fav); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; font-weight: 600; vertical-align: 1px;
}
/* header tools: search icon / theme switch / language */
.gnav-tools { display: flex; align-items: center; gap: 12px; }
.icon-tool {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: transparent; color: var(--nav-text);
}
.icon-tool svg { width: 15px; height: 15px; }
.icon-tool:hover, .icon-tool[aria-expanded="true"] { background: var(--control-track); color: var(--color-ink); }
/* 検索語が残っているときは虫眼鏡に青い点を付ける */
.icon-tool { position: relative; }
.icon-tool.has-query::after {
  content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-pricing-blue); box-shadow: 0 0 0 1.5px var(--nav-bg);
}
/* 検索中チップ（押すと検索を解除） */
.search-chip-slot:empty { display: none; }
.search-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 280px;
  border: 0; cursor: pointer; border-radius: var(--radius-buttons); padding: 6px 10px 6px 14px;
  font-size: 12px; line-height: 16px; letter-spacing: -0.12px;
  background: var(--color-pricing-blue); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-chip:hover { background: #0077ed; }
.search-chip span { font-size: 14px; line-height: 1; opacity: .85; }

/* theme switch: 太陽と月のトグル */
.theme-switch {
  position: relative; width: 52px; height: 28px; padding: 0; border: 0; cursor: pointer;
  border-radius: var(--radius-buttons); background: var(--control-track); flex: none;
  transition: background .25s;
}
.theme-switch:hover { background: var(--control-track-hover); }
.ts-track { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 7px; }
.ts-icon { width: 12px; height: 12px; color: var(--control-glyph); opacity: .7; }
.ts-knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.ts-knob svg { width: 13px; height: 13px; }
.ts-knob .ts-sun { color: #e08a00; }
.ts-knob .ts-moon { color: #8e9bff; display: none; }
.theme-switch[aria-checked="true"] .ts-knob { transform: translateX(24px); }
.theme-switch[aria-checked="true"] .ts-knob .ts-sun { display: none; }
.theme-switch[aria-checked="true"] .ts-knob .ts-moon { display: block; }
@media (prefers-reduced-motion: reduce) { .ts-knob, .theme-switch { transition: none; } }

/* search panel (opened from the header icon) */
.search-panel { border-bottom: 1px solid var(--color-hairline-silver); }
.search-panel-inner {
  max-width: var(--content); margin: 0 auto; padding: 10px 22px;
  display: flex; align-items: center; gap: 12px;
}
.search-panel .search-lg { flex: 1; width: auto; max-width: none; background: var(--color-studio-mist); }
.search-panel .link-btn { font-size: 14px; white-space: nowrap; }

/* card overlay: favorite & variants */
.card-media-wrap { position: relative; }
.fav-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .38); color: #fff;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .15s, background .2s;
}
.fav-btn:hover { background: rgba(0, 0, 0, .55); }
.fav-btn:active { transform: scale(.9); }
.fav-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.fav-btn[aria-pressed="true"] { color: var(--fav); background: rgba(255, 255, 255, .92); }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }
.fav-pill { padding: 6px 12px; }
.fav-pill svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.fav-pill[aria-pressed="true"] { color: var(--fav); box-shadow: 0 0 0 1px var(--fav); }
.fav-pill[aria-pressed="true"] svg { fill: currentColor; }
/* カード上の版タブ（日本版 / 中国版 / 海外版） */
.card-variants {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-pills);
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.card-variants button {
  border: 0; cursor: pointer; padding: 5px 11px; border-radius: var(--radius-pills);
  font-size: 11px; line-height: 14px; font-weight: 500; background: transparent; color: rgba(255, 255, 255, .85);
}
.card-variants button:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.card-variants button[aria-pressed="true"] { background: rgba(255, 255, 255, .95); color: #1d1d1f; }
.card-date { color: var(--color-slate); font-size: 12px; white-space: nowrap; }

/* lightbox: versions (segmented) */
.lb-versions { display: flex; justify-content: center; margin-top: 12px; }
.lb-versions-inner {
  display: flex; gap: 2px; padding: 3px;
  background: var(--control-track); border-radius: var(--radius-pills);
}
.lb-versions-inner button {
  border: 0; cursor: pointer; padding: 6px 14px; border-radius: var(--radius-pills);
  font-size: 12px; line-height: 16px; background: transparent; color: var(--control-glyph);
}
.lb-versions-inner button[aria-pressed="true"] { background: var(--surface); color: var(--color-ink); }

/* gallery view toggle sits in the filter row */
.filters .segmented { margin-left: 8px; }

/* timeline */
.tl-year-start:not(:first-child) { margin-top: var(--section-gap); }
.tl-year-start .group-head { margin-bottom: 0; }
.feed-sentinel { height: 1px; }
.tl-month { margin-top: 28px; }
.tl-month h3 {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--font-display); font-size: 21px; font-weight: 600; margin: 0 0 16px;
  padding-bottom: 8px; border-bottom: 1px solid var(--color-hairline-silver);
}
.tl-month h3 span { font-family: var(--font-text); font-size: 12px; font-weight: 400; color: var(--color-slate); }
.tl-grid { display: grid; gap: var(--element-gap); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ---------- stats ---------- */
.kpis {
  max-width: var(--content); margin: 0 auto; padding: 0 22px 64px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center;
}
.kpis .stat b { font-size: 48px; }
.viz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--element-gap); }
.viz-card { background: var(--surface); border-radius: var(--radius-cards); padding: var(--card-padding); min-width: 0; }
.viz-card.wide { grid-column: 1 / -1; }
.viz-card h2 { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.17; margin: 0; }
.viz-sub { color: var(--color-slate); font-size: 14px; margin: 6px 0 20px; }

.viz-legend { display: flex; gap: 20px; font-size: 12px; color: var(--color-slate); margin-bottom: 12px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw-1 { background: var(--chart-1); }
.sw-2 { background: var(--chart-2); }

.columns {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; align-items: end;
  height: 260px; padding-top: 20px; border-bottom: 1px solid var(--color-hairline-silver);
}
.col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; cursor: default; }
.col-total { font-size: 12px; color: var(--color-slate); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.col-stack { width: min(48px, 70%); display: flex; flex-direction: column; gap: 2px; }
.seg { display: block; min-height: 2px; }
.seg:first-child { border-radius: 4px 4px 0 0; }
.seg-1 { background: var(--chart-1); }
.seg-2 { background: var(--chart-2); }
.col-label { position: absolute; bottom: -24px; font-size: 12px; color: var(--color-slate); white-space: nowrap; }
.col:hover .seg { filter: brightness(1.1); }
.columns + .viz-table { margin-top: 40px; }

.barlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.barlist li {
  display: grid; grid-template-columns: 22px minmax(90px, 38%) 1fr 32px; align-items: center; gap: 10px;
  font-size: 14px; min-height: 30px;
}
.bl-rank { color: var(--color-steel); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.bl-label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bl-label a:not(.x-btn) { color: var(--color-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-label a:not(.x-btn):hover { color: var(--color-apple-blue); }
.bl-label .x-btn { width: 22px; height: 22px; flex: none; }
.bl-label .x-btn svg { width: 10px; height: 10px; }
.bl-track { height: 10px; }
.bl-bar { display: block; height: 100%; background: var(--chart-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.bl-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--color-ink); }
.barlist li:hover .bl-bar { filter: brightness(1.1); }

.viz-table { margin-top: 16px; font-size: 14px; }
.viz-table summary { cursor: pointer; color: var(--color-apple-blue); font-size: 12px; }
.viz-table table { border-collapse: collapse; margin-top: 12px; width: 100%; max-width: 480px; }
.viz-table th, .viz-table td { text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--color-control-gray); font-variant-numeric: tabular-nums; }
.viz-table th:first-child, .viz-table td:first-child { text-align: left; }
.viz-table th { color: var(--color-slate); font-weight: 500; }

.viz-tip {
  position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none;
  background: var(--color-ink); color: var(--on-ink);
  font-size: 12px; line-height: 1.33; padding: 6px 10px; border-radius: 8px; white-space: nowrap;
}

@media (max-width: 834px) {
  .viz-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
}
@media (max-width: 600px) {
  .fav-btn { top: 8px; right: 8px; width: 34px; height: 34px; }
  .filters .segmented { margin-left: 0; }
  .tl-month { margin-top: 16px; }
  .tl-month h3 { padding: 0 16px 8px; font-size: 19px; }
  .tl-grid { grid-template-columns: 1fr; gap: 8px; }
  .kpis { padding: 0 16px 40px; }
  .kpis .stat b { font-size: 32px; }
  .viz-grid { gap: 8px; }
  .viz-card { border-radius: 0; padding: 20px 16px; }
  .columns { gap: 4px; height: 200px; }
  .col-label { font-size: 10px; }
  .barlist li { grid-template-columns: 18px minmax(80px, 42%) 1fr 28px; gap: 8px; font-size: 13px; }
}

/* ---------- キャラクター一覧 ---------- */
.char-grid {
  display: grid; gap: var(--element-gap);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.char-card {
  background: var(--surface); border-radius: var(--radius-cards); overflow: hidden;
  display: flex; flex-direction: column;
}
.char-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--color-control-gray); }
.char-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.char-card:hover .char-media img { transform: scale(1.03); }
.char-card .body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.char-card .name { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.24; margin: 0; overflow-wrap: anywhere; }
.char-card .name a { color: var(--color-ink); }
.char-card .name a:hover { color: var(--color-apple-blue); text-decoration: none; }
.char-card .sub { font-size: 12px; color: var(--color-slate); }
.char-card .meta {
  margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--color-slate);
  display: flex; justify-content: space-between; gap: 8px;
}
.char-card .count { color: var(--color-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .char-media img { transition: none; } }
@media (max-width: 600px) {
  .char-grid { grid-template-columns: repeat(2, 1fr); gap: 2px; }
  .char-card { border-radius: 0; }
  .char-card .body { padding: 10px 12px 12px; }
  .char-card .name { font-size: 15px; }
  .card-variants { top: 8px; left: 8px; }
  .card-variants button { padding: 5px 10px; }
  .page-hero-controls { gap: 10px; }
}
