/* GOdex design system.
   1 tokens · 2 base · 3 header & menus · 4 shared components · 5 list pages · 6 home ·
   7 detail · 8 phones · 9 motion
   Surfaces are flat: thin borders and rules instead of shadows; colour comes from the brand teal
   and from Pokémon types, never from gradients. Figures use Space Grotesk with tabular digits. */

/* ── 1 tokens ─────────────────────────────────────────────────────────────── */
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 400 700;
  /* optional: no late swap, so text never jumps (CLS); preloaded, so it is usually in time */
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* brand */
  --brand: #087f85;          /* links, active states: 4.9:1 on white */
  --brand-ink: #06676c;      /* hover, text on tints */
  --brand-soft: #e4f3f2;     /* tinted surfaces */
  --on-brand: #ffffff;
  --navy: #142536;
  --accent: #62d5cf;         /* focus rings and marks only, never text */
  /* surfaces and text */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --text: #18212b;
  --muted: #56616d;          /* 5.9:1 on --bg */
  --faint: #7b8591;
  --line: #e1e5ea;
  --line-strong: #c6cdd5;
  --meter: var(--navy);
  /* type */
  --font-body: "Noto Sans TC", "PingFang TC", "Hiragino Sans", "Microsoft JhengHei", system-ui, sans-serif;
  --font-display: "Space Grotesk", "Noto Sans TC", "PingFang TC", "Hiragino Sans", "Microsoft JhengHei", system-ui, sans-serif;
  --fs-xs: .75rem; --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.2rem; --fs-xl: 1.6rem;
  /* space: 4px steps */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* shape */
  --r1: 3px; --r2: 6px; --r3: 10px;
  --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --pin-top: 57px;           /* height of the pinned site header (detail.js keeps it in sync) */
  --pop-shadow: 0 10px 30px rgb(20 37 54 / 16%); /* only for things floating over the page */
  color-scheme: light;
  font-family: var(--font-body);
}
/* Night: chosen with the header toggle (data-theme, from theme.js), else the system setting. */
:root[data-theme="dark"] {
  --brand: #5cc8c3; --brand-ink: #8fdcd8; --brand-soft: #11292b; --on-brand: #062a2c; --navy: #0b1520;
  --bg: #0e141b; --surface: #151d26; --surface-2: #1c2631; --text: #e6ebf0; --muted: #a0abb6; --faint: #75808c;
  --line: #25303b; --line-strong: #36434f; --meter: #d5dde5; --pop-shadow: 0 10px 30px rgb(0 0 0 / 45%);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --brand: #5cc8c3; --brand-ink: #8fdcd8; --brand-soft: #11292b; --on-brand: #062a2c; --navy: #0b1520;
    --bg: #0e141b; --surface: #151d26; --surface-2: #1c2631; --text: #e6ebf0; --muted: #a0abb6; --faint: #75808c;
    --line: #25303b; --line-strong: #36434f; --meter: #d5dde5; --pop-shadow: 0 10px 30px rgb(0 0 0 / 45%);
    color-scheme: dark;
  }
}

/* ── 2 base ───────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-weight: 800; }
h2 { font-size: var(--fs-lg); font-weight: 800; }
h3 { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); margin-top: 1.2em; }
img { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-xs); }
.num, .card__no, .card__cp b { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.loading, .empty { padding: 40px 0; text-align: center; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
sup { color: var(--brand); font-weight: 700; }

/* ── 3 header & menus ─────────────────────────────────────────────────────── */
.hubs-bar { background: var(--navy); color: #c9d4e0; font-size: var(--fs-xs); }
.hubs-bar__inner { max-width: 1200px; margin: 0 auto; padding: 5px var(--gutter); display: flex; align-items: center; gap: 16px; }
.hubs-bar a { color: inherit; white-space: nowrap; }
.hubs-bar a:hover, .hubs-bar a:focus-visible { color: #fff; }
.hubs-bar__home { font-weight: 700; color: #fff !important; flex: none; }
.hubs-bar__links { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; }
.hubs-bar__links::-webkit-scrollbar { display: none; }

.site-head { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-head__inner { max-width: 1200px; margin: 0 auto; padding: 8px var(--gutter); display: flex; align-items: center; gap: var(--s4); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { color: var(--text); }
.brand__mark { width: 36px; height: 36px; flex: none; transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.brand:hover .brand__mark { transform: rotate(-18deg); }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -.03em; }
.brand__tag { white-space: nowrap; margin-top: 3px; font-size: .66rem; font-weight: 500; letter-spacing: .08em; color: var(--muted); }
.site-head__tools { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--r2);
  background: none; color: var(--text); cursor: pointer; }
.icon-btn:hover, details[open] > .icon-btn { background: var(--surface-2); color: var(--text); }
.icon-btn svg, .theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--r2);
  background: none; color: var(--text); cursor: pointer; }
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle__moon { fill: currentColor !important; stroke: none !important; }
:root:not([data-theme]) .theme-toggle, :root[data-theme="dark"] .theme-toggle__moon, :root[data-theme="light"] .theme-toggle__sun { display: none; }

/* Dropdowns are <details data-menu> (menus.js); the default disclosure marker is hidden. */
details[data-menu] > summary { list-style: none; cursor: pointer; }
details[data-menu] > summary::-webkit-details-marker { display: none; }
.lang-switch { position: relative; font-size: var(--fs-sm); }
.lang-switch__current { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border-radius: var(--r2); white-space: nowrap; }
.lang-switch__current:hover, .lang-switch[open] .lang-switch__current { background: var(--surface-2); }
.lang-switch__icon, .caret { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lang-switch[open] .caret { transform: rotate(180deg); }
.lang-switch__list { position: absolute; right: 0; top: calc(100% + 4px); min-width: 160px; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); box-shadow: var(--pop-shadow); z-index: 30; }
.lang-switch__list a { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: var(--r1); color: var(--text); }
.lang-switch__list a:hover { background: var(--surface-2); }
.lang-switch__list [aria-current] { font-weight: 700; color: var(--brand); }
.lang-switch__list [aria-current]::after { content: "✓"; }

/* Wide screens: the navigation sits in the header row. Its dropdown panels span the header
   (positioned on .site-head, outside the sideways-scrolling row, so they are never clipped). */
.site-nav { min-width: 0; }
.site-nav__inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.site-nav__inner::-webkit-scrollbar { display: none; }
.site-nav__link, .site-nav__menu > summary { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; color: var(--text);
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; border-radius: var(--r2); }
.site-nav__menu > summary::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg); opacity: .55; }
.site-nav__menu[open] > summary::after { transform: translateY(1px) rotate(225deg); }
.site-nav__link:hover, .site-nav__menu > summary:hover, .site-nav__menu[open] > summary { background: var(--surface-2); color: var(--text); }
.site-nav__link[aria-current="page"] { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
.site-nav__panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line-strong);
  box-shadow: var(--pop-shadow); }
.site-nav__panel > .site-nav__grid { max-width: 1200px; margin: var(--s4) auto; display: grid; width: calc(100% - 2 * var(--gutter)); }
.site-nav__grid--gens { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.site-nav__grid--types { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.site-nav__gen, .site-nav__type { padding: 10px 12px; background: var(--surface); color: var(--text); font-weight: 600; font-size: var(--fs-sm); }
.site-nav__gen { display: flex; flex-direction: column; }
.site-nav__gen small { font-family: var(--font-display); color: var(--muted); font-weight: 500; font-size: var(--fs-xs); }
.site-nav__type { display: flex; align-items: center; gap: 8px; }
.site-nav__type::before, .m-menu__type::before { content: ""; width: 8px; height: 8px; border-radius: 1px; background: var(--t); flex: none; }
.site-nav__gen:hover, .site-nav__type:hover { background: var(--surface-2); color: var(--text); }
.site-nav__gen[aria-current], .site-nav__type[aria-current] { box-shadow: inset 3px 0 0 var(--brand); }

/* Phones: one menu button holds the navigation and the Pokemon Hubs guides. */
.m-menu { display: none; }
.m-menu__panel { position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100dvh - 56px); overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s3) var(--gutter) calc(var(--s5) + env(safe-area-inset-bottom)); background: var(--surface);
  border-bottom: 1px solid var(--line-strong); box-shadow: var(--pop-shadow); }
.m-menu__head { margin: var(--s4) 0 var(--s2); font-size: var(--fs-xs); font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.m-menu__row, .m-menu__hubs { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.m-menu__row > a, .m-menu__hubs > a { flex: 1 1 40%; padding: 12px; background: var(--surface); color: var(--text); font-weight: 600; font-size: var(--fs-sm); }
.m-menu__gens, .m-menu__types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.m-menu__gen, .m-menu__type { display: flex; padding: 10px; min-height: 44px; background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: 600; }
.m-menu__gen { flex-direction: column; line-height: 1.3; }
.m-menu__gen small { font-family: var(--font-display); font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.m-menu__type { align-items: center; gap: 8px; }
.m-menu a[aria-current] { color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }

.hubs-foot { border-top: 1px solid var(--line); padding-top: var(--s4); margin-bottom: var(--s3); color: var(--text); }
.hubs-foot p { margin: 0 0 6px; }
.hubs-foot__links a { white-space: nowrap; }
.site-foot { color: var(--muted); font-size: var(--fs-xs); padding-top: var(--s6); padding-bottom: calc(var(--s7) + env(safe-area-inset-bottom)); }

/* ── 4 shared components ──────────────────────────────────────────────────── */
/* Hairline grids: one rule between cells, none around empty cells in the last row. */
.grid, .gen-cards, .rank-list, .site-nav__grid, .m-menu__gens, .m-menu__types {
  gap: 0; background: none; border: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.grid > *, .gen-cards > *, .rank-list > *, .site-nav__grid > *, .m-menu__gens > *, .m-menu__types > * {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
/* Type tag: tinted with the type colour and a solid swatch; text stays readable on every type. */
.types { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin: 4px 0; }
.types--wrap { justify-content: flex-start; gap: 6px; }
.type { --t: #888; display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; border-radius: var(--r1);
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.5; white-space: nowrap;
  color: color-mix(in oklab, var(--t) 52%, #000); background: color-mix(in oklab, var(--t) 15%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--t) 38%, transparent); }
.type::before { content: ""; width: 7px; height: 7px; border-radius: 1px; background: var(--t); flex: none; }
:root[data-theme="dark"] .type { color: color-mix(in oklab, var(--t) 45%, #fff); background: color-mix(in oklab, var(--t) 22%, var(--surface)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .type { color: color-mix(in oklab, var(--t) 45%, #fff); background: color-mix(in oklab, var(--t) 22%, var(--surface)); } }
.type small { font-family: var(--font-display); font-weight: 600; }
a.type:hover { border-color: var(--t); color: inherit; }
.tag { display: inline-block; font-size: .66rem; line-height: 1.5; color: var(--muted); border: 1px solid var(--line-strong); border-radius: var(--r1);
  padding: 0 5px; vertical-align: middle; font-weight: 600; font-family: var(--font-body); letter-spacing: 0; }

.btn { display: inline-block; font: inherit; font-weight: 700; color: var(--on-brand); background: var(--brand); border: 0; border-radius: var(--r2);
  padding: 10px 20px; cursor: pointer; }
.btn:hover { background: var(--brand-ink); color: var(--on-brand); }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: var(--fs-xs); border-bottom-color: var(--line-strong); white-space: nowrap; }
.table td.num, .table th.num { text-align: right; }
.table td.num, .table--moves td:nth-child(n+3), .table--narrow td { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table--narrow { max-width: 360px; }
.table--cp td.num { white-space: nowrap; }
.table--cp td.muted { font-size: var(--fs-xs); white-space: nowrap; }

/* Meter: a base stat on the shared 0–500 scale; the gaps mark every 100. */
.meters { display: grid; gap: 6px; }
.meter { display: grid; grid-template-columns: 4.2em minmax(0, 1fr) 3em; align-items: center; gap: 10px; }
:lang(en) .meter, :lang(ja) .meter { grid-template-columns: 5.2em minmax(0, 1fr) 3em; }
.meter__label { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.meter__track { position: relative; height: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.meter__track::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 100%); background: var(--meter); }
.meter__track::after { content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(20% - 2px), var(--surface) calc(20% - 2px) 20%); }
.meter__value { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 700; text-align: right; }
.meter__rank { grid-column: 2 / -1; margin-top: -4px; font-size: var(--fs-xs); color: var(--muted); }
.meters__scale { margin: 6px 0 0; font-size: var(--fs-xs); color: var(--faint); }

/* Relative strength in the counters table: the same flat fill. */
.bar { height: 8px; background: var(--surface-2); }
.bar i { display: block; height: 100%; background: var(--meter); }

/* Segmented switch (normal / shiny). */
.toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r2); overflow: hidden; background: var(--surface); }
.toggle button { font: inherit; font-size: var(--fs-xs); font-weight: 600; border: 0; background: none; color: var(--muted); padding: 6px 12px; min-height: 32px; cursor: pointer; }
.toggle button + button { border-left: 1px solid var(--line-strong); }
.toggle button.is-on { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .toggle button.is-on { background: var(--text); color: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .toggle button.is-on { background: var(--text); color: var(--bg); } }

details summary { cursor: pointer; font-weight: 600; margin: 6px 0; }
details summary h2 { display: inline; }

/* ── 5 list pages ─────────────────────────────────────────────────────────── */
.hero { padding: var(--s6) 0 var(--s2); }
.hero h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.hero p { color: var(--muted); margin: 0; max-width: 70ch; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: var(--s4) 0 10px; align-items: center; }
.filters input[type=search], .filters select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r2); padding: 10px 12px; min-height: 44px; }
.filters input[type=search]:focus, .filters select:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.filters input[type=search] { flex: 1 1 280px; min-width: 0; }
.check { display: flex; gap: 6px; align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { font: inherit; flex: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: var(--r2);
  padding: 6px 12px; min-height: 36px; cursor: pointer; display: flex; gap: 6px; align-items: center; font-size: var(--fs-sm); }
.chip small { font-family: var(--font-display); color: var(--muted); font-size: .7rem; }
.chip:hover { border-color: var(--text); color: var(--text); }
.chip.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.is-on small { color: rgb(255 255 255 / 75%); }
:root[data-theme="dark"] .chip.is-on { background: var(--text); border-color: var(--text); color: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .chip.is-on { background: var(--text); border-color: var(--text); color: var(--bg); } }
.cat-nav { margin-top: 4px; }
.chip--type::before { content: ""; width: 8px; height: 8px; border-radius: 1px; background: var(--t); flex: none; }
.chip--type.is-on { background: color-mix(in oklab, var(--t) 18%, var(--surface)); border-color: var(--t); color: var(--text); font-weight: 700; }
.count { color: var(--muted); font-size: var(--fs-sm); margin: 8px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 10px 12px;
  background: var(--surface); color: var(--text); transition: background-color .12s ease; }
.card:hover { background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); color: var(--text); }
.card__no { position: absolute; top: 8px; left: 10px; font-size: var(--fs-xs); color: var(--muted); }
.card .tag { position: absolute; top: 8px; right: 8px; }
.card__zh { font-size: var(--fs-md); }
.card__en { font-size: var(--fs-xs); color: var(--muted); }
.card__cp { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }
.card__cp b { color: var(--text); font-size: .95rem; }
.grid > .empty { grid-column: 1 / -1; background: var(--surface); margin: 0; }
.more { height: 1px; }
.sprite { image-rendering: auto; object-fit: contain; }
.sprite--empty { background: var(--surface-2); border-radius: 50%; }

/* ── 6 home ───────────────────────────────────────────────────────────────── */
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px 40px; align-items: center;
  margin: var(--s5) 0 0; padding: 32px 36px; border-radius: var(--r3); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent); }
.home-hero h1 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); letter-spacing: -.01em; margin: 0 0 6px; }
.home-hero__intro { margin: 0 0 22px; color: var(--muted); }
.finder { position: relative; max-width: 620px; }
.finder__label { display: block; margin-bottom: 8px; font-size: var(--fs-sm); font-weight: 700; color: var(--brand-ink); }
.finder__box { display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 14px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r2); }
.finder__box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.finder__icon { flex: none; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.finder input { flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; color: var(--text); background: none; border: 0; padding: 10px 4px; outline: none; }
.finder input::-webkit-search-cancel-button { cursor: pointer; }
.finder__go { flex: none; font: inherit; font-weight: 700; color: var(--on-brand); background: var(--brand); border: 0;
  border-radius: var(--r1); padding: 10px 18px; min-height: 44px; cursor: pointer; }
.finder__go:hover { background: var(--brand-ink); }
.finder__list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; margin: 0; padding: 4px; list-style: none;
  max-height: min(420px, 60vh); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2);
  box-shadow: var(--pop-shadow); }
.finder__opt { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 10px; align-items: center;
  padding: 6px 10px; border-radius: var(--r1); color: var(--text); }
.finder__list [aria-selected="true"] .finder__opt { background: var(--surface-2); }
.finder__name { display: flex; flex-direction: column; font-weight: 700; line-height: 1.25; overflow: hidden; }
.finder__name small { font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.finder__opt .types { margin: 0; flex-wrap: nowrap; }
.finder__no { font-family: var(--font-display); color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.finder__status { margin: 10px 2px 0; min-height: 1.4em; font-size: var(--fs-sm); color: var(--muted); }
.finder__status:not(.is-visible) { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; overflow: hidden; clip-path: inset(50%); }
.picks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 0; }
.picks__label { font-size: var(--fs-xs); color: var(--muted); margin-right: 4px; }
.pick { padding: 4px 10px; border-radius: var(--r1); background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); font-size: var(--fs-sm); }
.pick:hover { border-color: var(--brand); color: var(--brand-ink); }

/* Today's spotlight: the encounter screen, CP on top, the dotted arc over the Pokémon. */
.spot { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--text); border-radius: var(--r3); padding: 8px 0; }
.spot:hover { color: var(--text); }
.spot__label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; color: var(--brand-ink); }
.spot__event { padding: 1px 7px; border-radius: var(--r1); background: var(--brand-ink); color: var(--surface); letter-spacing: .02em; white-space: nowrap; }
.spot__cp { margin-top: 2px; line-height: 1; }
.spot__cp small { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.spot__cp b { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.spot__stage { position: relative; width: 250px; height: 168px; margin-top: 4px; display: grid; place-items: end center; }
.spot__stage::before { content: ""; position: absolute; bottom: 6px; width: 170px; height: 30px; border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 16%, transparent); }
.spot__arc { position: absolute; top: 0; left: 0; width: 250px; height: auto; overflow: visible; }
.spot__track, .spot__fill { fill: none; stroke-linecap: round; }
.spot__track { stroke: color-mix(in srgb, var(--brand-ink) 30%, transparent); stroke-width: 3; stroke-dasharray: 0 2.4; }
.spot__fill { stroke: var(--brand-ink); stroke-width: 4.5; animation: cp-arc .9s cubic-bezier(.2, .8, .2, 1) both; }
.spot__dot { fill: var(--surface); stroke: var(--brand-ink); stroke-width: 3; animation: cp-dot .3s .75s both; transform-box: fill-box; transform-origin: center; }
@keyframes cp-arc { from { stroke-dashoffset: var(--f); } }
@keyframes cp-dot { from { opacity: 0; transform: scale(.4); } }
.spot .sprite { position: relative; margin-bottom: 10px; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.spot:hover .sprite { transform: translateY(-4px); }
.spot__name { margin-top: 2px; font-size: 1.25rem; font-weight: 800; font-family: var(--font-display); }
.spot__alt { font-size: var(--fs-xs); color: var(--muted); }
.spot .types { margin-top: 6px; }

.home-sec { margin-top: var(--s6); }
.home-sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: var(--s3);
  padding-top: var(--s3); border-top: 1px solid var(--line); }
.home-sec__head h2 { margin: 0; }
.type-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.type-tile { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 20px; border-radius: var(--r2);
  color: var(--text); background: color-mix(in oklab, var(--t) 10%, var(--surface)); border: 1px solid color-mix(in oklab, var(--t) 30%, transparent); }
/* The bar shows how many entries the type has, against the most common type. */
.type-tile::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 9px; height: 3px;
  background: linear-gradient(90deg, var(--t) calc(var(--n) * 100%), color-mix(in srgb, var(--t) 18%, transparent) 0); }
.type-tile:hover { background: color-mix(in oklab, var(--t) 20%, var(--surface)); color: var(--text); }
.type-tile__name { font-weight: 800; }
.type-tile__count { font-family: var(--font-display); font-size: var(--fs-xs); color: var(--muted); }
@media (min-width: 900px) { .type-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.home-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 28px; }
/* Side by side, both columns end level: the heads match in height (the ranking's switch sits in its
   head) and the form cards stretch to the ranking's height. */
.home-split > .home-sec { display: flex; flex-direction: column; }
.home-split .home-sec__head { align-items: center; min-height: calc(35px + var(--s3)); }
.form-cards { display: grid; gap: 6px; }
.home-split .form-cards { flex: 1; grid-auto-rows: minmax(0, 1fr); }
.form-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--r2);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.form-card:hover { border-color: var(--brand); color: var(--text); }
.form-card__text { display: flex; flex-direction: column; }
.form-card__name { font-size: 1.1rem; font-weight: 800; }
.form-card__note { font-size: var(--fs-xs); color: var(--muted); }
.form-card__count { font-family: var(--font-display); font-size: var(--fs-xs); color: var(--brand-ink); font-weight: 700; margin-top: 4px; }
.form-card__mons { display: flex; flex: none; }
.form-card__mons .sprite { width: 56px; height: 56px; }
.form-card__mons .sprite + .sprite { margin-left: -16px; }
.home-sec--gens { margin-top: var(--s7); }
.home-sec__intro { margin: -4px 0 14px; color: var(--muted); font-size: var(--fs-sm); }
.gen-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.gen-card { display: flex; flex-direction: column; background: var(--surface); color: var(--text); }
.gen-card:hover { background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); color: var(--text); }
.gen-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 16px 18px 0; }
.gen-card__title { display: flex; align-items: baseline; gap: 10px; }
.gen-card__name { font-size: 1.3rem; font-weight: 800; }
.gen-card__gen { font-family: var(--font-display); font-size: var(--fs-xs); font-weight: 700; color: var(--brand-ink); }
.gen-card__count { font-family: var(--font-display); font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.gen-card__stage { display: flex; justify-content: center; align-items: flex-end; margin: 12px 18px 0; padding: 10px 8px 4px; border-bottom: 1px solid var(--line); }
.gen-card__stage .sprite { width: 72px; height: 72px; transition: transform .2s ease; }
.gen-card__stage .sprite + .sprite { margin-left: -10px; }
.gen-card__stage .sprite:nth-child(4) { width: 96px; height: 96px; margin-left: -2px; }
.gen-card:hover .gen-card__stage .sprite { transform: translateY(-2px); }
.gen-card__note { flex: 1; padding: 12px 18px 0; font-size: var(--fs-sm); line-height: 1.7; }
.gen-card__more { padding: 10px 18px 16px; font-size: var(--fs-sm); font-weight: 700; color: var(--brand); }
@media (min-width: 900px) { .gen-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rank-list { counter-reset: rank; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rank-list li { counter-increment: rank; }
.rank-list[hidden] { display: none; }
.rank-tabs { flex: none; }
.rank-card { position: relative; display: flex; flex-direction: column; align-items: center; padding: 10px 6px; height: 100%;
  background: var(--surface); color: var(--text); text-align: center; }
.rank-card:hover { background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); color: var(--text); }
.rank-card::before { content: counter(rank); position: absolute; top: 6px; left: 8px; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); color: var(--muted); }
.rank-list li:first-child .rank-card::before { color: var(--brand); }
.rank-card .sprite { width: 56px; height: 56px; }
.rank-card__name { font-size: var(--fs-xs); font-weight: 700; line-height: 1.3; }
.rank-card__cp { font-family: var(--font-display); font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-card__cp small { font-size: .66rem; color: var(--muted); }
@media (max-width: 860px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; }
  .home-split { grid-template-columns: minmax(0, 1fr); }
}

/* ── 7 detail ─────────────────────────────────────────────────────────────── */
.crumbs { font-size: var(--fs-xs); color: var(--muted); margin: var(--s4) 0 var(--s3); display: flex; flex-wrap: wrap; gap: 2px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }

/* Hero: tinted by the primary type, the second type marks the top edge and the dex numeral. */
.dex-hero { position: relative; margin-bottom: var(--s4); border-radius: var(--r3); overflow: hidden;
  background: color-mix(in oklab, var(--t1) 11%, var(--surface)); border: 1px solid color-mix(in oklab, var(--t1) 26%, var(--line)); }
.dex-hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px;
  background: linear-gradient(90deg, var(--t1) 0 68%, var(--t2) 68% 100%); }
:root[data-theme="dark"] .dex-hero { background: color-mix(in oklab, var(--t1) 16%, var(--surface)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .dex-hero { background: color-mix(in oklab, var(--t1) 16%, var(--surface)); } }
.dex-pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 12px 16px 10px; font-size: var(--fs-sm);
  border-bottom: 1px solid color-mix(in oklab, var(--t1) 20%, var(--line)); }
.dex-pager a { color: var(--text); min-height: 24px; }
.dex-pager a:hover { color: var(--brand); }
.dex-pager .num { color: var(--muted); }
.dex-pager__up { color: var(--muted) !important; text-align: center; }
.dex-pager__next { text-align: right; }
.dex-hero__body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; }
.dex-hero__stage { position: relative; display: grid; place-items: center; min-height: 380px; padding: var(--s5) var(--s4) var(--s6); }
/* The national dex number, set huge behind the Pokémon: the page's typographic mark. */
.dex-hero__no { position: absolute; top: 8px; left: 16px; font-family: var(--font-display); font-weight: 700; line-height: 1;
  font-size: clamp(5rem, 15vw, 11rem); letter-spacing: -.05em; font-variant-numeric: tabular-nums; color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in oklab, var(--t2) 45%, transparent); user-select: none; pointer-events: none; }
.dex-art { position: relative; width: min(320px, 72vw); aspect-ratio: 1; }
.dex-art::before { content: ""; position: absolute; left: 14%; right: 14%; bottom: 2%; height: 12%; border-radius: 50%;
  background: color-mix(in oklab, var(--t1) 24%, transparent); }
.dex-art .sprite { position: relative; display: block; width: 100%; height: 100%; }
.dex-art.is-framed { overflow: hidden; }
.dex-art.is-framed .sprite { position: absolute; max-width: none; }
.dex-hero__stage .toggle { position: absolute; left: 16px; bottom: 16px; }
.dex-hero__info { padding: var(--s5) var(--s5) var(--s5) 0; }
.dex-hero__meta { margin: 0; font-size: var(--fs-sm); color: var(--muted); font-family: var(--font-display); }
.dex-hero h1 { margin: 2px 0 0; font-size: clamp(2rem, 4.2vw, 2.9rem); letter-spacing: -.02em; line-height: 1.1; }
.dex-hero h1 .tag { font-size: .7rem; position: relative; top: -.5em; }
.dex-hero__alt { margin: 2px 0 8px; color: var(--muted); font-family: var(--font-display); font-size: 1.05rem; }
.dex-hero .types { justify-content: flex-start; }
.dex-hero .type { font-size: var(--fs-sm); padding: 2px 10px 2px 8px; }
.cp-pair { display: flex; align-items: flex-end; gap: var(--s5); margin: var(--s4) 0 var(--s4); padding: var(--s3) 0; border-block: 1px solid color-mix(in oklab, var(--t1) 22%, var(--line)); }
.cp-pair div { display: flex; flex-direction: column; }
.cp-pair dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.cp-pair dd { margin: 0; font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.5rem; line-height: 1.1; color: var(--muted); }
.cp-pair__main dd { font-size: clamp(2.4rem, 5vw, 3.2rem); color: var(--text); letter-spacing: -.02em; }
.dex-forms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s4); }
.dex-forms__item { display: grid; place-items: center; width: 48px; height: 48px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); }
.dex-forms__item:hover { border-color: var(--text); }
.dex-forms__item[aria-current] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.dex-forms__item .sprite { width: 40px; height: 40px; }
.summary { grid-column: 1 / -1; margin: 0; padding: var(--s4) var(--s5) var(--s5); line-height: 1.85; font-size: .95rem; max-width: 80ch; }
.dex-hero > .summary { border-top: 1px solid color-mix(in oklab, var(--t1) 20%, var(--line)); max-width: none; }

/* Section links: pinned under the header, following the section being read (detail.js). */
.tabs { position: sticky; top: var(--pin-top); z-index: 10; display: flex; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)) var(--s2); padding: 0 var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; display: flex; align-items: center; min-height: 46px; padding: 0 14px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { color: var(--text); box-shadow: inset 0 -2px 0 var(--brand); }

.panel { padding: var(--s5) 0 var(--s3); border-top: 1px solid var(--line); scroll-margin-top: calc(var(--pin-top) + 56px); }
.tabs + .panel { border-top: 0; }
.panel > h2, .panel > details > summary > h2 { font-size: 1.3rem; }
.panel.error { border: 1px solid var(--brand); padding: var(--s3) var(--s4); }
.boot-error { margin-top: 24px; text-align: center; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: var(--s5) var(--s6); }
.two-col > * { min-width: 0; overflow-x: auto; } /* a wide table scrolls inside its column, never the page */
.meters--ranked { gap: 12px; align-content: start; }
.best { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; margin-bottom: 12px; background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--brand); }
.best strong { font-size: 1.15rem; }
.best .type { margin-right: 4px; }
.rank { margin-bottom: 12px; }
.faq__item + .faq__item { border-top: 1px solid var(--line); }
.faq__item h3 { font-size: var(--fs-md); color: var(--text); margin: 14px 0 4px; }
.faq__item p { margin: 0 0 14px; line-height: 1.8; max-width: 80ch; }

.evo { overflow-x: auto; padding-bottom: 6px; }
.evo-node { display: flex; align-items: center; gap: 6px; }
.evo-children { display: flex; flex-direction: column; gap: 8px; }
.evo-children--many { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); flex: 1; }
.evo-branch { display: flex; align-items: center; gap: 6px; }
.evo-arrow { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: 1.2rem; min-width: 64px; text-align: center; }
.evo-arrow small { font-size: .7rem; line-height: 1.3; }
.minis { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mini { display: flex; flex-direction: column; align-items: center; width: 108px; padding: 8px 4px; border: 1px solid var(--line);
  border-radius: var(--r2); color: var(--text); font-size: var(--fs-xs); text-align: center; background: var(--surface); }
.mini span { font-family: var(--font-display); color: var(--muted); font-size: .7rem; }
.mini.is-current { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.mini:hover { border-color: var(--text); color: var(--text); }

.counter-opts { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 10px; font-size: var(--fs-sm); }
.counter-opts select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); padding: 6px 8px; min-height: 36px; }
.table--counters .num { text-align: right; }
.c-rank { color: var(--muted); width: 28px; font-family: var(--font-display); }
.c-mon { display: flex; align-items: center; gap: 8px; color: var(--text); }
.c-mon span { display: flex; flex-direction: column; line-height: 1.25; }
.c-mon small { color: var(--muted); font-size: var(--fs-xs); }
.c-mon .tag { align-self: flex-start; }
.c-moves span { display: flex; align-items: center; gap: 6px; white-space: nowrap; margin: 2px 0; }
.counter-table { overflow-x: auto; }
.c-score { min-width: 110px; }
.c-score small { color: var(--muted); font-size: var(--fs-xs); font-family: var(--font-display); }

/* ── 8 tablets and phones ─────────────────────────────────────────────────── */
/* The header row fits the full navigation only from about 1024px (English labels are longest). */
@media (max-width: 1023px) {
  .site-nav { display: none; }
  .m-menu { display: block; }
}
@media (max-width: 899px) {
  .hubs-bar { display: none; }
  .dex-hero__body { grid-template-columns: minmax(0, 1fr); }
  .dex-hero__stage { min-height: 0; padding: var(--s4) var(--s4) var(--s5); }
  .dex-hero__info { padding: 0 var(--s4) var(--s4); }
  .dex-art { width: min(240px, 62vw); }
  .dex-hero__no { font-size: clamp(4.5rem, 26vw, 8rem); top: 6px; left: 12px; }
  .summary { padding: var(--s4); }
}
@media (max-width: 560px) {
  :root { --pin-top: 0px; }
  /* The header scrolls away on phones; only the section tabs stay pinned. */
  .site-head { position: relative; }
  .site-head__inner { padding-block: 6px; gap: var(--s2); }
  .brand { gap: 8px; min-width: 0; }
  .brand__mark { width: 32px; height: 32px; }
  .brand__name { font-size: 1.2rem; }
  .lang-switch__current { padding: 0 8px; }
  .lang-switch__current > span { display: none; }

  .hero { padding: var(--s4) 0 2px; }
  .hero h1 { font-size: 1.3rem; margin-bottom: 4px; }
  .hero p { font-size: var(--fs-sm); }
  .filters { gap: 8px; margin: 12px 0 8px; }
  .filters input[type=search] { flex: 1 1 100%; }
  .filters select { flex: 1 1 0; min-width: 0; padding: 9px 10px; }
  .check { flex-basis: 100%; font-size: var(--fs-xs); }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 calc(-1 * var(--gutter)); border-left: 0; }
  .grid > :nth-child(3n) { border-right: 0; }
  .card { padding: 22px 4px 8px; gap: 0; }
  .card .sprite { width: 64px; height: 64px; }
  .card__zh { font-size: .84rem; line-height: 1.3; text-align: center; }
  .card__en { font-size: .66rem; text-align: center; line-height: 1.3; }
  .card .types { gap: 3px; margin: 3px 0 0; }
  .card .type { font-size: .62rem; padding: 0 4px; gap: 3px; }
  .card .type::before { width: 5px; height: 5px; }
  .card__cp { font-size: .68rem; margin-top: 2px; }
  .card__cp b { font-size: .8rem; }
  .card__no { top: 5px; left: 7px; font-size: .68rem; }
  .card .tag { top: 5px; right: 5px; font-size: .58rem; padding: 0 3px; }

  .home-hero { margin-top: 12px; padding: 20px 16px 16px; gap: 16px; }
  .home-hero__intro { margin-bottom: 16px; font-size: var(--fs-sm); }
  .finder input { font-size: 1rem; }
  .finder__go { padding: 10px 14px; }
  .finder__opt { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .finder__opt .sprite { width: 36px; height: 36px; }
  .finder__no { display: none; }
  .picks { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
  .picks::-webkit-scrollbar { display: none; }
  .pick, .picks__label { flex: none; }
  .spot { display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 14px; align-items: center; justify-items: start;
    text-align: left; padding: 10px 14px; background: color-mix(in srgb, var(--surface) 60%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 14%, transparent); }
  .spot > * { grid-column: 2; }
  .spot__stage { grid-column: 1; grid-row: 1 / span 5; width: 150px; height: 104px; margin: 0; }
  .spot__arc { width: 150px; }
  .spot .sprite { width: 84px; height: 84px; margin-bottom: 6px; }
  .spot__stage::before { width: 104px; height: 20px; }
  .spot__cp b { font-size: 1.6rem; }
  .spot__name { font-size: 1.1rem; }
  .spot .types { justify-content: flex-start; }
  .form-card { padding: 12px 14px; }
  .form-card__mons .sprite { width: 44px; height: 44px; }
  .form-card__mons .sprite + .sprite { margin-left: -14px; }
  .home-sec { margin-top: var(--s5); }
  .home-sec--gens { margin-top: var(--s6); }
  .gen-cards { grid-template-columns: minmax(0, 1fr); }
  .gen-card__stage .sprite { width: 60px; height: 60px; }
  .gen-card__stage .sprite:nth-child(4) { width: 80px; height: 80px; }
  .type-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .type-tile { padding: 9px 10px 16px; }
  .type-tile::after { left: 10px; right: 10px; bottom: 7px; }
  .type-tile__name { font-size: .9rem; }
  /* Long rows scroll sideways on phones instead of stacking into a tall column. */
  .rank-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); border-left: 0; }
  .rank-list::-webkit-scrollbar { display: none; }
  .rank-list li { flex: 0 0 31%; scroll-snap-align: start; }

  /* Detail: the hero runs edge to edge; the art and the key numbers share the first screen. */
  .crumbs { margin: var(--s3) 0 var(--s2); }
  .dex-hero { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; border-inline: 0; }
  .dex-pager { padding: 10px var(--gutter) 8px; font-size: var(--fs-xs); }
  .dex-hero__stage { padding: var(--s3) var(--gutter) var(--s4); }
  .dex-art { width: min(210px, 58vw); }
  .dex-hero__stage .toggle { left: var(--gutter); bottom: 12px; }
  .dex-hero__info { padding: 0 var(--gutter) var(--s4); }
  .dex-hero h1 { font-size: 2rem; }
  .cp-pair { margin: var(--s3) 0; gap: var(--s4); }
  .cp-pair__main dd { font-size: 2.4rem; }
  .cp-pair dd { font-size: 1.25rem; }
  .summary { padding: var(--s4) var(--gutter); font-size: var(--fs-sm); line-height: 1.8; }
  .tabs a { padding: 0 12px; }
  .panel { padding-top: var(--s4); }

  .c-tdo, .table--counters th:first-child, .c-rank,
  .c-score, .table--counters th:last-child, .c-mon small { display: none; }
  .table--counters { font-size: var(--fs-xs); }
  .table--counters th, .table--counters td { padding: 8px 4px; }
  .c-mon { gap: 4px; }
  .c-mon .sprite { width: 32px; height: 32px; }
  .c-moves .type { padding: 0 5px; font-size: .66rem; }
  .table--moves th:nth-child(5), .table--moves td:nth-child(5) { display: none; }
  .evo-node, .evo-branch { flex-direction: column; align-items: center; }
  .evo-children { align-items: center; }
  .evo-node:has(> .evo-children--many) { align-items: stretch; }
  .evo-children--many { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .evo-arrow { flex-direction: row; gap: 6px; min-width: 0; padding: 2px 0; }
  .evo-arrow__icon { display: inline-block; transform: rotate(90deg); }
}
/* Narrow phones (320px): long move names wrap, the spotlight stacks, tables tighten. */
@media (max-width: 380px) {
  .brand__tag { display: none; }
  .c-moves span { white-space: normal; }
  .spot { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .spot > *, .spot__stage { grid-column: 1; grid-row: auto; }
  .spot__label, .spot .types { justify-content: center; }
  .table--moves { font-size: var(--fs-xs); }
  .table--moves th, .table--moves td { padding: 7px 3px; }
  .cp-pair__main dd { font-size: 2.1rem; }
}

/* ── 9 motion ─────────────────────────────────────────────────────────────── */
/* The art settles in on arrival; moving between Pokémon (prev / next, forms) morphs the hero. */
@keyframes art-in { from { transform: translateY(10px) scale(.96); } }
.dex-art .sprite { animation: art-in .5s cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .dex-art { view-transition-name: dex-art; }
  .dex-hero__no { view-transition-name: dex-no; }
  ::view-transition-group(*) { animation-duration: .28s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
