/* PalToolkit v2 — "night expedition" dark gaming design system. Global tokens live here; tools.css builds on them.
   Dark by default; a light theme is opt-in through the header toggle ([data-theme="light"], set by /js/boot.js). */

@font-face { font-family: "Inter"; src: url("/fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-600.woff2") format("woff2"); font-weight: 500 800; font-style: normal; font-display: swap; }
/* metric-matched fallback keeps layout shift near zero while the web font swaps in */
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("Helvetica"), local("Liberation Sans"); size-adjust: 107%; ascent-override: 90%; descent-override: 22%; }

:root {
  color-scheme: dark;
  /* surfaces: deep night-blue, raised panels a step lighter */
  --paper: #0a0f1e;
  --paper-2: #121a30;
  --card: #111a2e;
  --card-2: #182340;
  --card-hi: #1e2b4d;
  --ink: #e9eefb;
  --ink-2: #b0bad6;
  --ink-3: #8e99bb;
  --line: #243157;
  --line-2: #33436f;
  /* brand: aurora mint + ember orange (ours; not the competitor's yellow) */
  --accent: #3fe0c0;
  --accent-ink: #6ff0d5;
  --accent-soft: #10362f;
  --accent-contrast: #04211b;
  --ember: #ff9f5a;
  --ember-soft: #3a2413;
  --violet: #b69cff;
  --warn: #ffb08a;
  --focus: #6ff0d5;
  --glow: 0 0 0 1px rgba(63, 224, 192, .35), 0 6px 24px rgba(63, 224, 192, .12);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .28);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --gap: 16px;
  --maxw: 1180px;
  --font-sans: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-sans);
  --font-system: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* element palette (text colour passes AA on its own soft background and on --card) */
  --el-neutral: #d3d0c8; --el-neutral-bg: #2a2a2e;
  --el-fire: #ff9a74;    --el-fire-bg: #3b1d15;
  --el-water: #7cc0ff;   --el-water-bg: #132a45;
  --el-grass: #9fdc6c;   --el-grass-bg: #1c3016;
  --el-electric: #ffd65a; --el-electric-bg: #352b0f;
  --el-ice: #86e3f2;     --el-ice-bg: #12323b;
  --el-ground: #e5b67e;  --el-ground-bg: #35271a;
  --el-dark: #cfa8ff;    --el-dark-bg: #2b1f42;
  --el-dragon: #ff9cc0;  --el-dragon-bg: #3d1a2b;

  /* tier colours */
  --tier-s: #ff7a6b; --tier-a: #ffb45a; --tier-b: #ffe06b; --tier-c: #7ee08c; --tier-d: #8fb3ff;
  --tier-ink: #120b06;
}

:root[data-theme="light"] {
  color-scheme: light;
  --paper: #f3f5fb;
  --paper-2: #e7ebf5;
  --card: #ffffff;
  --card-2: #f1f4fa;
  --card-hi: #e6ecf8;
  --ink: #111830;
  --ink-2: #445070;
  --ink-3: #56607e;
  --line: #d6dcea;
  --line-2: #bcc5da;
  --accent: #0d7f6d;
  --accent-ink: #0a6a5b;
  --accent-soft: #d6f3ec;
  --accent-contrast: #ffffff;
  --ember: #b4521a;
  --ember-soft: #fbe6d6;
  --violet: #5b3fc4;
  --warn: #9a3412;
  --focus: #0a6a5b;
  --glow: 0 0 0 1px rgba(13, 127, 109, .4), 0 6px 18px rgba(13, 127, 109, .12);
  --shadow: 0 1px 2px rgba(17, 24, 48, .06), 0 4px 14px rgba(17, 24, 48, .06);
  --el-neutral: #4f4d48; --el-neutral-bg: #ebe9e4;
  --el-fire: #a8330b;    --el-fire-bg: #fbe3d6;
  --el-water: #0b5f99;   --el-water-bg: #dcecf8;
  --el-grass: #3b650b;   --el-grass-bg: #e3f0d2;
  --el-electric: #7a5000; --el-electric-bg: #fbefc6;
  --el-ice: #0b6175;     --el-ice-bg: #d9f1f6;
  --el-ground: #74440f;  --el-ground-bg: #f1e4d2;
  --el-dark: #5b2a86;    --el-dark-bg: #ebe0f5;
  --el-dragon: #9f1239;  --el-dragon-bg: #fbe0e7;
  --tier-s: #d8453a; --tier-a: #e07b12; --tier-b: #d9ad0d; --tier-c: #3f9a4c; --tier-d: #4d72c9;
  --tier-ink: #ffffff;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(1200px 480px at 50% -220px, rgba(63, 224, 192, .10), transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 400 16px/1.6 var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] body { background-image: none; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.2; letter-spacing: -.015em; margin: 1.5em 0 .5em; }
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); margin: .2em 0 .35em; letter-spacing: -.025em; }
h2 { font-size: clamp(1.2rem, 3.2vw, 1.45rem); }
h3 { font-size: 1.05rem; font-weight: 700; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin: .2em 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
code, kbd { font-family: var(--font-mono); font-size: .9em; background: var(--card-2); padding: .1em .35em; border-radius: 5px; }
small, .small { font-size: .875rem; }
.muted { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--accent-contrast); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 50; font-weight: 700; }
.skip:focus { top: 8px; }

/* ---------------------------------------------------------------- layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.wrap-narrow { max-width: 960px; }
main { display: block; padding: 4px 0 48px; min-height: 60vh; }
.grid { display: grid; gap: var(--gap); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wrap { padding: 0 24px; }
}
.cols { display: grid; gap: 20px; }
@media (min-width: 980px) { .cols { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } .cols > aside { position: sticky; top: 76px; } }

/* ---------------------------------------------------------------- header / nav */
.site-head { position: sticky; top: 0; z-index: 30; background: rgba(10, 15, 30, .88); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--line); }
:root[data-theme="light"] .site-head { background: rgba(255, 255, 255, .9); }
.site-head .wrap { display: flex; align-items: center; gap: 10px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 1.15rem/1 var(--font-sans); color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand b { color: var(--accent-ink); font-weight: 800; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-size: .95rem; font-weight: 600; }
.site-nav a:hover { color: var(--ink); background: var(--card-2); }
.site-nav a[aria-current="page"] { color: var(--accent-contrast); background: var(--accent); }
/* grouped menus (Breeding, Calculators, Database, Map): <details> dropdowns, plain links inside */
.nav-g { position: relative; }
.nav-g summary { display: flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px 0 12px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: .95rem; font-weight: 600; cursor: pointer; list-style: none; user-select: none; }
.nav-g summary::-webkit-details-marker { display: none; }
.nav-g summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); opacity: .7; }
.nav-g details[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.nav-g summary:hover, .nav-g details[open] summary { color: var(--ink); background: var(--card-2); }
.nav-g summary.cur { color: var(--accent-ink); }
.site-nav .nav-g ul { display: block; position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 220px; padding: 6px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.site-nav .nav-g a { min-height: 40px; white-space: nowrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--card); color: var(--ink); cursor: pointer; flex: none; padding: 0; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.nav-btn { display: none; margin-left: auto; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }
/* phones: with JS the nav collapses behind a menu button; without JS it wraps under the brand */
@media (max-width: 899px) {
  .site-head .wrap { flex-wrap: wrap; }
  .site-nav { order: 5; width: 100%; margin: 0; padding: 0 0 10px; }
  .site-nav ul { flex-wrap: wrap; }
  .js .nav-btn { display: inline-flex; }
  .js .site-nav { display: none; }
  .js .site-head.open .site-nav { display: block; }
  .js .site-head.open .site-nav ul { flex-direction: column; gap: 2px; }
  .js .site-head.open .site-nav a { min-height: 44px; font-size: 1rem; }
  .nav-g summary { min-height: 44px; font-size: 1rem; }
  .site-nav .nav-g ul { position: static; min-width: 0; margin: 2px 0 6px 12px; padding: 2px 0 2px 8px; background: none; border: 0; border-left: 2px solid var(--line-2); border-radius: 0; box-shadow: none; }
}

/* ---------------------------------------------------------------- footer */
.site-foot { border-top: 1px solid var(--line); background: var(--paper-2); color: var(--ink-2); font-size: .9rem; padding: 32px 0 40px; margin-top: 24px; }
.site-foot .cols-f { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-foot .cols-f > div:first-child { grid-column: 1 / -1; }
@media (min-width: 760px) { .site-foot .cols-f { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; } .site-foot .cols-f > div:first-child { grid-column: auto; } }
.site-foot h2 { font: 700 .75rem/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 0 0 8px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin: 0; }
.site-foot a { color: var(--ink); text-decoration: none; display: inline-block; padding: 4px 0; }
.site-foot a:hover { color: var(--accent-ink); text-decoration: underline; }
.site-foot .fine { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--ink-3); }
.site-foot .fine p { margin: 0 0 .4em; }

/* ---------------------------------------------------------------- page furniture */
.crumbs { font-size: .85rem; color: var(--ink-3); margin: 16px 0 6px; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 4px; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }
.eyebrow { font: 700 .75rem/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: .12em; color: var(--accent-ink); margin: 18px 0 6px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.page-head h1 { margin-bottom: .1em; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 6px; font: 700 .75rem/1.3 var(--font-sans); letter-spacing: .02em; color: var(--accent-contrast); background: var(--accent); white-space: nowrap; }
.badge-ghost { color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line-2); }
.badge-ember { color: #1d0d02; background: var(--ember); }
.lead { font-size: 1.05rem; color: var(--ink-2); max-width: 70ch; }
.data-line { font-size: .8rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 16px; }
.data-line span::before { content: "•"; margin-right: 6px; color: var(--line-2); }
.data-line span:first-child::before { content: none; }

.answer {
  position: relative;
  background: linear-gradient(135deg, rgba(63, 224, 192, .09), rgba(182, 156, 255, .05) 60%, transparent), var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 14px 16px 14px 18px;
  margin: 8px 0 20px;
  max-width: 80ch;
}
.answer::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); }
.answer p { margin: 0; font-size: 1rem; }
.answer .label { display: block; font: 800 .7rem/1.2 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
@media (min-width: 720px) { .card { padding: 20px; } }
.card > h2:first-child, .card > h3:first-child, .card > .h2row:first-child h2 { margin-top: 0; }
.card + .card { margin-top: var(--gap); }
.card h2 { color: var(--ink); }
.section { margin: 20px 0; }
.section > h2 { margin-top: 0; }
/* section headings carry an anchor link (#id) like a wiki */
.h2row { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.h2row h2 { margin: 0; }
.anchor { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; color: var(--ink-3); text-decoration: none; font-weight: 700; font-size: .95rem; }
.anchor:hover { color: var(--accent-ink); background: var(--card-2); }
.sub { font: 800 .72rem/1.2 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 16px 0 8px; }

.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); list-style: none; padding: 0; margin: 0 0 1em; }
.tiles li { margin: 0; }
.tile { display: flex; align-items: center; gap: 10px; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; color: var(--ink); text-decoration: none; }
.tile:hover { border-color: var(--accent); box-shadow: var(--glow); }
.tile > span:last-child { min-width: 0; }
.tile strong { display: block; font-weight: 700; }
.tile small, .tile span.t2 { display: block; font-size: .82rem; color: var(--ink-2); }
.linklist { columns: 2 160px; column-gap: 24px; padding-left: 1.1em; }
.linklist li { break-inside: avoid; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-contrast); font-weight: 700; text-decoration: none; border: 0; cursor: pointer; font-size: .95rem; }
.btn:hover { filter: brightness(1.08); color: var(--accent-contrast); }
.btn-ghost { background: var(--card-2); color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); }

/* ---------------------------------------------------------------- Pal art */
.pal-img { display: block; flex: none; border-radius: 50%; background: radial-gradient(circle at 50% 38%, var(--card-hi), var(--card-2) 70%); object-fit: contain; }
.pal-img.sq { border-radius: 12px; }
/* element ring on every portrait (first element; class er-<el> from build.py pal_img) */
.pal-img[class*="er-"] { box-shadow: 0 0 0 2px var(--ring, var(--line-2)); }
.er-neutral { --ring: var(--el-neutral); } .er-fire { --ring: var(--el-fire); } .er-water { --ring: var(--el-water); } .er-grass { --ring: var(--el-grass); } .er-electric { --ring: var(--el-electric); } .er-ice { --ring: var(--el-ice); } .er-ground { --ring: var(--el-ground); } .er-dark { --ring: var(--el-dark); } .er-dragon { --ring: var(--el-dragon); } 
.pal-ph { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--card-2); color: var(--ink-2); font-weight: 800; }
.pal-link { display: inline-flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; color: var(--ink); font-weight: 600; vertical-align: middle; }
.pal-link:hover span { color: var(--accent-ink); text-decoration: underline; }
.pal-link img { width: 28px; height: 28px; }
.ico { display: inline-block; vertical-align: -4px; flex: none; }

/* stat grid (Pal hero) */
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
@media (min-width: 560px) { .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { .stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.stats-grid div { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; min-width: 0; }
.stats-grid dt { font: 700 .68rem/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.stats-grid dd { margin: 2px 0 0; font: 800 1.2rem/1.3 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--ink); }
.stats-grid .hl dd { color: var(--accent-ink); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
@media (min-width: 560px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.facts div { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.facts dt { font: 700 .68rem/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font: 700 1.05rem/1.35 var(--font-sans); font-variant-numeric: tabular-nums; }

/* Pal hero card */
.pal-hero { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; }
.pal-hero .pal-img { width: 96px; height: 96px; }
@media (min-width: 720px) { .pal-hero { grid-template-columns: 160px minmax(0, 1fr); gap: 22px; } .pal-hero .pal-img { width: 160px; height: 160px; } }
.pal-hero h1 { margin: 0; line-height: 1.08; overflow-wrap: anywhere; }
.pal-hero h1 .h1-k { display: block; margin-top: 4px; font-size: max(.4em, .95rem); font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.badge-no { font-variant-numeric: tabular-nums; color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line-2); }
.pal-hero .no { color: var(--ink-3); font-weight: 700; margin-left: 8px; font-size: 1.05rem; }
.pal-hero .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.pal-hero .line2 { font-size: .9rem; color: var(--ink-2); margin: 4px 0 0; }
.pal-hero .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pal-hero .actions .btn { min-height: 40px; padding: 0 14px; font-size: .9rem; }
.pal-hero .stats-grid { grid-column: 1 / -1; }
.g-m { color: #7cc0ff; font-weight: 700; } .g-f { color: #ff9cc0; font-weight: 700; }
:root[data-theme="light"] .g-m { color: #0b5f99; } :root[data-theme="light"] .g-f { color: #9f1239; }

/* ---------------------------------------------------------------- tables (scroll inside their card only) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
@media (min-width: 720px) { .card .table-wrap { margin: 0 -20px; padding: 0 20px; } }
table { border-collapse: collapse; width: 100%; font-size: .92rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-size: .82rem; color: var(--ink-3); padding: 0 0 8px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { font: 700 .7rem/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); border-bottom: 1px solid var(--line-2); white-space: nowrap; background: var(--card); }
tbody tr:hover { background: var(--card-2); }
td.r, th.r { text-align: right; }
td a { text-decoration: none; font-weight: 600; }
td a:hover { text-decoration: underline; }
.data-table td:first-child, .data-table th:first-child { padding-left: 0; }
th button.sort { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
th button.sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
th button.sort::after { content: "↕"; opacity: .45; font-size: .9em; }
th[aria-sort="ascending"] button.sort::after { content: "↑"; opacity: 1; color: var(--accent-ink); }
th[aria-sort="descending"] button.sort::after { content: "↓"; opacity: 1; color: var(--accent-ink); }
.table-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
input[type="search"], .input, select.input {
  min-width: 0; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--paper-2); color: var(--ink); font: inherit; font-size: 1rem;
}
input[type="search"]::placeholder { color: var(--ink-3); }
input[type="search"]:focus, .input:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
.table-tools input[type="search"] { flex: 1 1 220px; }

/* combos (Pal page): grouped parent list */
.combos { list-style: none; padding: 0; margin: 0; } /* no content-visibility: its placeholder height made later links "overlap" for target-size audits */
.combos li { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.combos li:last-child { border-bottom: 0; }
.combos .with { color: var(--ink-2); font-size: .92rem; line-height: 1.7; }
.combos .with a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--line-2); display: inline-block; white-space: nowrap; padding: 3px 0; line-height: 1.25; }
.combos .with { line-height: 2; }
.combos .with a:hover { color: var(--accent-ink); border-bottom-color: var(--accent); }
.combos .a { font-weight: 700; }
.combos .a a { color: var(--ink); text-decoration: none; }

/* pair rows (Pal page: easiest pairs) */
.pairs { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.pairs li { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pairs .op { color: var(--ink-3); font-weight: 800; }
.pairs .note { margin-left: auto; background: none; padding: 0; font-size: .78rem; color: var(--ember); font-weight: 700; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 8px; }
.chips li { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 10px; border-radius: var(--radius-sm); background: var(--card-2); color: var(--ink); font-size: .86rem; font-weight: 600; text-decoration: none; border: 1px solid var(--line); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip img { width: 22px; height: 22px; }
.chip.pal { padding-left: 4px; }
a.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip b { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.lvl { display: inline-block; min-width: 1.6em; text-align: center; font-weight: 800; color: var(--accent-ink); }

/* work pills (Pal hero, grids) */
.work { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.work li { margin: 0; }
.work a, .work span.w { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 10px 3px 6px; border-radius: var(--radius-sm); background: var(--card-2); border: 1px solid var(--line); color: var(--ink); font-size: .86rem; font-weight: 600; text-decoration: none; }
.work a:hover { border-color: var(--accent); }
.work b { color: var(--accent-ink); font-weight: 800; }

/* element badges: game icon (or our glyph) + name */
.el { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 4px; min-height: 26px; border-radius: 6px; font-size: .8rem; font-weight: 700; text-decoration: none; line-height: 1.5; white-space: nowrap; color: var(--el-neutral); background: var(--el-neutral-bg); }
.el svg { width: 14px; height: 14px; fill: currentColor; flex: none; margin-left: 3px; }
.el img { width: 18px; height: 18px; flex: none; }
.el-fire { color: var(--el-fire); background: var(--el-fire-bg); }
.el-water { color: var(--el-water); background: var(--el-water-bg); }
.el-grass { color: var(--el-grass); background: var(--el-grass-bg); }
.el-electric { color: var(--el-electric); background: var(--el-electric-bg); }
.el-ice { color: var(--el-ice); background: var(--el-ice-bg); }
.el-ground { color: var(--el-ground); background: var(--el-ground-bg); }
.el-dark { color: var(--el-dark); background: var(--el-dark-bg); }
.el-dragon { color: var(--el-dragon); background: var(--el-dragon-bg); }
a.el:hover { text-decoration: underline; }
.els { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.el-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; margin-left: 4px; }

/* ---------------------------------------------------------------- Pal grid (Pals hub) */
.filters { display: grid; gap: 12px; margin: 0 0 16px; }
.filters .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .row > input[type="search"] { flex: 1 1 240px; }
.fgroup { border: 0; margin: 0; padding: 0; min-width: 0; }
.fgroup legend { font: 800 .7rem/1.2 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; padding: 0; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 3px 12px 3px 6px; border-radius: var(--radius-pill); background: var(--card-2); border: 1px solid var(--line-2); color: var(--ink); font: 600 .86rem/1.2 var(--font-sans); cursor: pointer; }
.fchip:hover { border-color: var(--accent); }
.fchip[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.fchip img { width: 22px; height: 22px; }
.fchip.plain { padding: 3px 12px; }
.count { font-size: .9rem; color: var(--ink-2); margin: 0 0 10px; }
.pal-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
@media (min-width: 720px) { .pal-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.pal-grid > li { margin: 0; content-visibility: auto; contain-intrinsic-size: auto 132px; }
.pcard { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 10px; align-items: center; height: 100%; padding: 10px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; position: relative; }
.pcard:hover { border-color: var(--accent); box-shadow: var(--glow); }
.pcard .pal-img { width: 52px; height: 52px; }
.pcard .nm { display: block; font-weight: 800; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .no { display: flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--ink-3); font-weight: 700; }
.pcard .no img { width: 16px; height: 16px; }
.pcard .st { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .75rem; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }
.pcard .st b { color: var(--ink); font-weight: 800; }
.pcard .wk { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: .75rem; font-weight: 800; color: var(--accent-ink); }
.pcard .wk span { display: inline-flex; align-items: center; gap: 2px; }
.pcard .wk img { width: 18px; height: 18px; }
.pal-grid > li[hidden] { display: none; }

/* tiers */
.tier { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tier:last-child { border-bottom: 0; }
.tier-badge { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; font: 900 1.4rem/1 var(--font-sans); color: var(--tier-ink); background: var(--tier-d); }
.tier-s .tier-badge { background: var(--tier-s); }
.tier-a .tier-badge { background: var(--tier-a); }
.tier-b .tier-badge { background: var(--tier-b); }
.tier-c .tier-badge { background: var(--tier-c); }
.tier-row { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tier-row li { margin: 0; }
.tier-pal { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 76px; padding: 6px 4px; border-radius: var(--radius-sm); background: var(--card-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none; text-align: center; }
.tier-pal:hover { border-color: var(--accent); }
.tier-pal img { width: 48px; height: 48px; }
.tier-pal span { font-size: .72rem; font-weight: 700; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tier-pal b { font-size: .7rem; color: var(--accent-ink); font-weight: 800; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 2px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 32px 12px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 9px; font-size: 1.25rem; color: var(--accent-ink); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 0 12px; color: var(--ink-2); }
.faq details > div p:last-child { margin-bottom: 0; }

/* article (guides, rules) */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 1.8em; }
.prose img { height: auto; border-radius: var(--radius-sm); }
.prose blockquote { margin: 1em 0; padding: 8px 16px; border-left: 3px solid var(--accent); background: var(--card); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-2); }
.prose table { margin: 0 0 1em; }
.prose .table-wrap { margin: 0 0 1em; padding: 0; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 0 40px; margin: 0 0 14px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: .85rem; }
.toc { font-size: .92rem; margin: 0 0 20px; max-width: 74ch; }
.toc ol { padding-left: 1.2em; margin: 0; }
.sources { font-size: .88rem; color: var(--ink-2); }
.note { font-size: .9rem; color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }

/* ---------------------------------------------------------------- home: tool cards */
.intro-list { color: var(--ink-2); max-width: 78ch; margin: 0 0 12px; padding-left: 1.1em; }
.intro-list li { margin: .15em 0; }
#calc { min-height: 560px; margin: 8px 0 24px; font-family: var(--font-system); }
#calc *, .breed-widget .pa-calc, .breed-widget .pa-calc * { font-family: var(--font-system); }
#calc:empty { background: var(--card); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.breed-widget { min-height: 180px; min-width: 0; max-width: 100%; overflow-x: auto; }
.breed-widget:empty { background: var(--card); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.noscript { padding: 12px 16px; }
.row-viewer select { font: inherit; min-height: 44px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--paper-2); color: var(--ink); max-width: 100%; }
.row-viewer label { font-weight: 700; margin-right: 8px; }

/* ---------------------------------------------------------------- items + map */
.item-hero { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: start; }
.item-hero .item-img { width: 72px; height: 72px; border-radius: 10px; background: var(--card-2); object-fit: contain; }
.item-hero h1 { margin: 0 0 6px; }
.item-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.item-list > li { margin: 0; content-visibility: auto; contain-intrinsic-size: auto 60px; }
.item-list > li[hidden] { display: none; }
.icard { display: flex; align-items: center; gap: 10px; height: 100%; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.icard:hover { border-color: var(--accent); }
.icard img, .icard .ph { width: 40px; height: 40px; flex: none; border-radius: 8px; background: var(--card-2); }
.icard strong { display: block; font-weight: 700; line-height: 1.25; }
.icard small { display: block; color: var(--ink-3); font-size: .75rem; }
.mat { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 3px 10px 3px 4px; border-radius: var(--radius-sm); background: var(--card-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.mat img, .mat .ph { width: 28px; height: 28px; border-radius: 6px; }
.mat b { color: var(--accent-ink); }
a.mat:hover { border-color: var(--accent); }
.rar-common { color: var(--ink-2); } .rar-uncommon { color: #7ee08c; } .rar-rare { color: #7cc0ff; } .rar-epic { color: #cfa8ff; } .rar-legendary { color: #ffb45a; }
:root[data-theme="light"] .rar-uncommon { color: #2f7a3a; } :root[data-theme="light"] .rar-rare { color: #0b5f99; } :root[data-theme="light"] .rar-epic { color: #6b2fb3; } :root[data-theme="light"] .rar-legendary { color: #9a5200; }
.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); background: #081226; }
.map-wrap svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.map-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px 10px; font-size: .85rem; box-shadow: var(--shadow); max-width: 240px; }

/* 404 */
.nf { text-align: center; padding: 48px 0; }
.nf h1 { margin: 0 auto .3em; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .site-head, .site-foot, .theme-toggle, #calc, .breed-widget { display: none; } body { background: #fff; color: #000; } }

/* grid children must be allowed to shrink below their content width (no page-level horizontal scroll) */
.cols > *, .grid > *, main .wrap > * { min-width: 0; }
td.num, td.r { white-space: nowrap; }
main h1 { max-width: 30ch; }
/* long tables are rendered as 40-row chunks (build.py): off-screen chunks skip layout */
.tchunk { content-visibility: auto; contain-intrinsic-size: auto 1800px; }
.tchunk:first-child { content-visibility: visible; }
table.fixed { table-layout: fixed; }
table.fixed td, table.fixed th { overflow: hidden; text-overflow: ellipsis; }
thead.ghost th { height: 0; padding-top: 0; padding-bottom: 0; border: 0; line-height: 0; font-size: 0; overflow: hidden; }
td a { display: inline-block; min-height: 24px; line-height: 24px; }
td .pal-link { display: inline-flex; }

/* ---------------------------------------------------------------- v2 additions: js-only controls, spawns, map */
html:not(.js) .js-only { display: none; }
.spawns { display: grid; gap: 12px; }
.spawns:not(.two) .spawn-region { max-width: 560px; }
@media (min-width: 720px) { .spawns.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.spawn-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.spawn-list li { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .92rem; }
.mini-map { margin: 0; }
.mini-map figcaption { font-size: .78rem; color: var(--ink-3); margin-top: 6px; }
.mm, .map-in { position: relative; width: 100%; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line-2); background: #0c161e; }
.mm > img, .map-in > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mm > svg.ov, .map-in > svg.ov { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-tools { display: grid; gap: 10px; margin: 0 0 12px; }
.map-tools .row { display: flex; gap: 8px; align-items: center; }
.map-tools .row input { flex: 1 1 auto; }
.map-tools .icon-btn { font-size: 1.2rem; font-weight: 800; }
.layers > summary { list-style: none; cursor: pointer; display: inline-flex; }
.layers > summary::-webkit-details-marker { display: none; }
.layers[open] > summary { border-color: var(--accent); }
.layers .fchips { margin-top: 8px; }
.map-scroll { overflow: auto; border-radius: var(--radius); -webkit-overflow-scrolling: touch; max-height: 82vh; }
/* map.js pans/pinches itself: at 1x one finger still scrolls the page, zoomed in the map owns every gesture */
.js .map-scroll { touch-action: pan-y; }
.js .map-scroll.zoomed { touch-action: none; cursor: grab; overscroll-behavior: contain; }
.js .map-scroll.dragging { cursor: grabbing; user-select: none; }
.map-in img { -webkit-user-drag: none; user-select: none; }
.map-in { border-radius: var(--radius); }
.mk-layer { position: absolute; inset: 0; }
.pt { position: absolute; width: 12px; height: 12px; transform: translate(-50%, -50%) rotate(45deg); background: #3fe0c0; border: 2px solid #04211b; border-radius: 2px; z-index: 1; pointer-events: none; }
.pt[hidden] { display: none; }
.pt-sq { transform: translate(-50%, -50%); background: #cfa8ff; width: 10px; height: 10px; }
.pt-tri { transform: translate(-50%, -50%); background: #86e3f2; border: 0; width: 12px; height: 11px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.mk { position: absolute; transform: translate(-50%, -50%); display: block; text-decoration: none; z-index: 2; }
.mk[hidden] { display: none; }
.mk-i { display: block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ember); background: #0b1328; }
.mk-bounty .mk-i { border-color: #ff7a6b; }
.mk-h, .mk-t { display: grid; place-items: center; color: #fff; font-weight: 900; font-size: .9rem; }
.mk-t { border-color: var(--violet); color: var(--violet); width: 26px; height: 26px; }
.mk-pd .mk-i { width: 26px; height: 26px; border-color: #cfa8ff; }
img.mk-i { object-fit: cover; }
.mk b { position: absolute; right: -8px; bottom: -6px; min-width: 20px; padding: 0 3px; border-radius: 6px; background: var(--ember); color: #1d0d02; font-size: .62rem; font-weight: 900; text-align: center; line-height: 14px; }
.mk.hit .mk-i { box-shadow: 0 0 0 4px var(--accent), 0 0 16px var(--accent); }
.mk:hover, .mk:focus-visible { z-index: 5; }
.mk:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 50%; }
.map-pane[hidden] { display: none; }
/* phones at 1x: overlapping markers become one numbered button (map.js recluster) that zooms in */
.mk.in-cl { display: none; }
.js .mk-layer:not(.cl-ready) .mk { display: none; } /* until map.js has clustered: no layout or portrait loads for markers that end up grouped */
.mk-cl { position: absolute; transform: translate(-50%, -50%); z-index: 3; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid #0b1328; background: var(--ember); color: #1d0d02; font-size: .72rem; font-weight: 900; line-height: 1; display: grid; place-items: center; cursor: pointer; }
.mk-cl:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* /map/ lists: no style/layout work until map.js sees them near the viewport (.shown); the inline contain-intrinsic-size keeps the height */
.js .lazy-body:not(.shown) { content-visibility: hidden; }
.lazy-body .tchunk { content-visibility: visible; } /* the wrapper already skips the work; nested placeholders made rows overlap */
.ov g[hidden], .ov [hidden] { display: none; }
.map-tiles { position: absolute; inset: 0; pointer-events: none; }
.map-tiles[hidden] { display: none; }
.map-tiles img { position: absolute; display: block; max-width: none; }
.ext-layer { position: absolute; inset: 0; pointer-events: none; }
.ext-layer[hidden] { display: none; }
.ext-layer img { width: 100%; height: 100%; display: block; }

/* ---------------------------------------------------------------- pair cards: "A + B = child" with portraits */
.pc { margin: 0; padding: 10px 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; list-style: none; }
.pc-row { display: flex; align-items: flex-start; justify-content: center; gap: 4px 6px; }
.pc-f { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; flex: 0 1 96px; text-align: center; color: var(--ink); text-decoration: none; }
a.pc-f:hover .pc-n { color: var(--accent-ink); text-decoration: underline; }
.pc-f .pal-img { margin: 3px; }
.pc-n { font-weight: 700; font-size: .86rem; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; }
.pc-s { font-size: .72rem; color: var(--ink-3); }
.pc-op { align-self: center; margin-top: -18px; color: var(--ink-3); font-weight: 800; font-size: 1.2rem; flex: none; }
.pc-child .pc-n { color: var(--accent-ink); }
.pc-note { margin: 6px 0 0; text-align: center; font-size: .76rem; color: var(--ember); font-weight: 700; }
.pc--hero { padding: 14px 12px; background: linear-gradient(180deg, var(--card-hi), var(--card-2)); border-color: var(--line-2); }
.pc--hero .pc-n { font-size: .95rem; }
.pc--hero .pc-op { font-size: 1.5rem; }
.pc--hero + .pc--hero { margin-top: 8px; }
.pc-grid { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pc-grid > li { margin: 0; }
.pc-best { margin: 0 0 12px; }
.pc-best .pc-cta { display: flex; justify-content: center; margin-top: 10px; }

/* ---------------------------------------------------------------- Pal page v3: crumb row, jump bar, pager, bowls, work, passives */
.crumb-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; }
.crumb-meta { margin: 0 0 6px; font-size: .8rem; color: var(--ink-3); }
.jump { grid-column: 1 / -1; margin: 2px 0 0; overflow-x: auto; scrollbar-width: none; }
.jump ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.jump li { margin: 0; flex: none; }
.jump a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: var(--card-2); color: var(--ink-2); font-size: .85rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.jump a:hover { color: var(--accent-ink); border-color: var(--accent); }
.pal-pager { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .85rem; }
.pal-pager a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--ink); text-decoration: none; font-weight: 700; min-width: 0; }
.pal-pager a:hover .pg-n { color: var(--accent-ink); text-decoration: underline; }
.pal-pager .pal-img { width: 32px; height: 32px; }
.pg-i { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); white-space: nowrap; }
@media (max-width: 559px) { .pal-pager .pg-n { display: none; } }
.bowls { display: inline-flex; vertical-align: -2px; height: 12px; }
.bowls-f, .bowls-e { display: block; height: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1 5h10a5 5 0 0 1-10 0z' fill='%23ff9f5a'/%3E%3Cpath d='M3 3.5c.6-.8 1.8-.8 2.4 0M6.6 3.5c.6-.8 1.8-.8 2.4 0' stroke='%23ffd0a8' stroke-width='.9' fill='none'/%3E%3C/svg%3E") left/12px 12px repeat-x; }
.bowls-e { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 5.5h9a4.5 4.5 0 0 1-9 0z' fill='none' stroke='%2333436f' stroke-width='1'/%3E%3C/svg%3E"); }
.bowls-n { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.stats-grid dd .bowls { margin-top: 4px; }
.pal-hero .line2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pal-hero .lbl { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-right: 2px; }
.wks { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.wk { display: inline-flex; align-items: center; gap: 3px; min-height: 30px; padding: 2px 8px 2px 4px; border-radius: var(--radius-pill); background: var(--card-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .82rem; }
.wk:hover { border-color: var(--accent); }
.wk img { width: 22px; height: 22px; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plist li { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 10px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.plist a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; }
.plist a:hover strong { color: var(--accent-ink); text-decoration: underline; }
.rk { width: 12px; height: 12px; flex: none; }
abbr.cnt { text-decoration: underline dotted; cursor: help; }
.src-block { padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.src-block h2 { font-size: 1rem; margin: 0 0 4px; }
@media (max-width: 559px) {
  .pc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .pc-grid .pc { padding: 8px 4px; }
  .pc-grid .pc-n { font-size: .78rem; }
  .pc-grid .pc-note { font-size: .7rem; }
  .pal-hero .actions { margin-left: -110px; }
}

.eyebrow .eb-ico { display: inline-block; vertical-align: middle; margin: -4px 8px 0 0; }
.eyebrow .eb-ico.rk { width: 14px; height: 14px; }

/* header: search button (dialog styles live in search.css, loaded by search.mjs) + data version pill */
.search-btn { width: auto; gap: 8px; padding: 0 10px; color: var(--ink-2); }
.search-btn .search-hint { font-size: .88rem; font-weight: 600; }
.search-btn kbd { font: 600 .72rem var(--font-mono); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ink-3); }
.no-js .search-btn, html:not(.js) .search-btn { display: none; }
@media (max-width: 1099px) { .search-btn .search-hint, .search-btn kbd { display: none; } .search-btn { width: 40px; padding: 0; } }
.hdr-ver { font-size: .72rem; font-weight: 700; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: var(--radius-pill); padding: 2px 8px; text-decoration: none; white-space: nowrap; }
.hdr-ver:hover { color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 479px) { .hdr-ver { display: none; } }
.more-link { margin: 14px 0 0; }

/* map at 1x on phones: smaller boss markers, no level badges (they return when zoomed in) */
@media (max-width: 719px) {
  .map-scroll:not(.zoomed) .mk-i { width: 24px; height: 24px; border-width: 2px; font-size: .75rem; }
  .map-scroll:not(.zoomed) .mk-t { width: 24px; height: 24px; }
  .map-scroll:not(.zoomed) .mk b { display: none; }
  .map-scroll:not(.zoomed) .pt { width: 8px; height: 8px; border-width: 1.5px; }
}
/* egg hub on phones: element and size are already in the egg's name */
@media (max-width: 559px) { .egg-table th:nth-child(2), .egg-table td:nth-child(2), .egg-table th:nth-child(3), .egg-table td:nth-child(3) { display: none; } }

/* ---- 2026-10-07 launch UX pass ---------------------------------------------------------------- */
/* Touch screens: every tap target at least 44 x 44 px (header buttons, chips, pal links, footer and crumb links).
   Pure CSS, applied before first paint, so nothing shifts. Dense map pins are the exception (list + search below the map). */
@media (pointer: coarse), (max-width: 899px) {
  .icon-btn { width: 44px; height: 44px; }
  .search-btn { width: 44px; }
  .brand { min-height: 44px; }
  .anchor { width: 44px; height: 44px; margin: -8px -8px -8px 0; }
  .el, .wk, .fchip, .mat, .pal-link, .badge-link { min-height: 44px; }
  .site-foot a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
  .crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
  .crumbs { margin: 4px 0 0; }
  .site-nav a, .nav-g summary { min-height: 44px; }
  .site-foot a, .crumbs a { min-width: 44px; }
  .skip { min-height: 44px; display: inline-flex; align-items: center; }
  a.more, .jump a, .pal-pager a, .pal-hero .actions .btn, ul.work a, td .mat a { display: inline-flex; align-items: center; min-height: 44px; }
  details > summary { min-height: 44px; box-sizing: border-box; padding-top: 11px; }
  .pal-pager a { min-width: 44px; justify-content: center; }
  th .sort { min-height: 44px; }
}
/* Home on phones: the version badge already says "Updated for v1.0.5", so the data line goes and the calculator moves up */
@media (max-width: 559px) { .k-home .data-line { display: none; } }
/* "Which Pals breed X" on phones: one card per pair instead of a 7-column table that scrolls sideways */
@media (max-width: 639px) {
  .k-breed #combos .data-table, .k-breed #combos .data-table tbody { display: block; }
  .k-breed #combos .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .k-breed #combos .data-table caption { display: block; text-align: left; }
  .k-breed #combos .data-table tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
  .k-breed #combos .data-table td { display: block; padding: 0; border: 0; text-align: left; }
  .k-breed #combos .data-table td:nth-child(1) { grid-row: 1 / span 3; color: var(--ink-3); padding-top: 12px; }
  .k-breed #combos .data-table td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .k-breed #combos .data-table td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .k-breed #combos .data-table td:nth-child(4) { grid-column: 3; grid-row: 1; }
  .k-breed #combos .data-table td:nth-child(5) { grid-column: 3; grid-row: 2; }
  .k-breed #combos .data-table td:nth-child(6) { grid-column: 2 / -1; grid-row: 3; font-size: .8rem; color: var(--ink-2); text-align: left; }
  .k-breed #combos .data-table td:nth-child(6)::before { content: "Both by Lv "; }
  .k-breed #combos .data-table td:nth-child(7) { grid-column: 2 / -1; grid-row: 4; }
  .k-breed #combos .data-table td:nth-child(7):empty { display: none; }
  .k-breed #combos .table-wrap { overflow: visible; }
}

/* ---- motion layer (GEO-UX spec B, 2026-10-13): tokens, CSS-only micro-interactions, result reveal, skeleton.
   Nothing here moves layout (transform/opacity only) and nothing animates on page load above the fold except the
   calculator result reveal; prefers-reduced-motion zeroes every duration. Budget: this block stays under 4 KB. */
:root { --dur-fast: 120ms; --dur: 200ms; --dur-slow: 320ms; --ease: cubic-bezier(.2, .8, .2, 1); }
@view-transition { navigation: auto; }
.btn, .pa-btn, .icon-btn, .calc-tab, .chip, .tile, .pop, .hub, .pa-try-b, .pc-grid > li, .pal-grid > li > a, .item-list > li > a { transition: transform var(--dur-fast) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.btn:active, .pa-btn:active, .icon-btn:active, .calc-tab:active, .chip:active, .pa-try-b:active, .sort:active { transform: scale(.97); }
.tile:hover, .pop:hover, .hub:hover, .pc-grid > li:hover, .pal-grid > li > a:hover, .item-list > li > a:hover { transform: translateY(-2px); }
.pc-grid > li:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.pa-input:focus-visible, .pa-select:focus-visible, input:focus-visible, select:focus-visible { transition: outline-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
@keyframes ptk-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pa-result > *, .pc-top > *, .pa-reach > * { animation: ptk-reveal var(--dur-slow) var(--ease) both; }
.pc-list > li { animation: ptk-reveal var(--dur-slow) var(--ease) both; }
.pc-list > li:nth-child(2) { animation-delay: 35ms; } .pc-list > li:nth-child(3) { animation-delay: 70ms; } .pc-list > li:nth-child(4) { animation-delay: 105ms; }
.pc-list > li:nth-child(5) { animation-delay: 140ms; } .pc-list > li:nth-child(6) { animation-delay: 175ms; } .pc-list > li:nth-child(7) { animation-delay: 210ms; }
.pc-list > li:nth-child(n+8) { animation-delay: 245ms; }
@keyframes ptk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pa-skel { min-height: 112px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(90deg, var(--card-2) 25%, var(--card-hi) 50%, var(--card-2) 75%); background-size: 200% 100%; animation: ptk-shimmer 1.1s linear infinite; }
.calc-tab { position: relative; }
.calc-tab::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform var(--dur) var(--ease); }
.calc-tab[aria-current="page"]::after { transform: scaleX(1); }
/* sound toggle (sfx.js): speaker with waves when on, crossed when off */
.sfx-toggle .i-wave { display: none; } .sfx-toggle[aria-pressed="true"] .i-wave { display: block; } .sfx-toggle[aria-pressed="true"] .i-off { display: none; }
/* GEO blocks: USP list under the answer, calculator CTA on the breeding hub, guide link on Pal pages */
.usps { list-style: none; margin: -6px 0 14px; padding: 0; display: grid; gap: 4px 14px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); font-size: .88rem; color: var(--ink-2); }
.usps li { margin: 0; padding-left: 1.2em; text-indent: -1.2em; }
.usps li::before { content: "✓"; color: var(--accent-ink); font-weight: 700; margin-right: 6px; }
.calc-cta .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.guide-link { font-size: .9rem; margin: 0 0 10px; }
@media (prefers-reduced-motion: reduce) { :root { --dur-fast: 0ms; --dur: 0ms; --dur-slow: 0ms; } @view-transition { navigation: none; } .pa-skel { animation: none; } }
