/* Dungeon Dex. Mobile first; light/dark via tokens on :root (prefers-color-scheme, or the toggle's
   data-theme on <html>). No web fonts, no external anything. */

:root {
  --bg: #f6f4f1;
  --surface: #ffffff;
  --surface-2: #f0ece6;
  --text: #1d1b19;
  --muted: #5f5a54;
  --border: #ddd6cc;
  --accent: #c62f25;           /* Pokedex red: header band, active tab */
  --accent-ink: #ffffff;
  --link: #a8261c;
  --focus: #1a5fd0;
  --head-focus: #ffd23f;
  --ok-bg: #e3f3e5; --ok-fg: #1d5e26; --ok-line: #6fb57a;
  --info-bg: #e5eefb; --info-fg: #1c4c8f; --info-line: #7aa2df;
  --warn-bg: #fdf1d9; --warn-fg: #7a4a00; --warn-line: #e0a63a;
  --bad-bg: #fbe5e3; --bad-fg: #8f1d14; --bad-line: #e0786e;
  --ur-bg: #f1e8fb; --ur-fg: #5a2d91; --ur-line: #a77ad6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06);
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141312;
    --surface: #1d1c1a;
    --surface-2: #27251f;
    --text: #ece8e2;
    --muted: #aaa398;
    --border: #3a362f;
    --accent: #b8291f;
    --link: #ff8a7a;
    --focus: #7fb0ff;
    --ok-bg: #16301b; --ok-fg: #a6e0ae; --ok-line: #3f8a4a;
    --info-bg: #172a45; --info-fg: #aac8f5; --info-line: #3e6cb0;
    --warn-bg: #352710; --warn-fg: #f3cf8c; --warn-line: #a8771f;
    --bad-bg: #3a1714; --bad-fg: #ffb4ab; --bad-line: #a8443a;
    --ur-bg: #2a1d3d; --ur-fg: #d9c2ff; --ur-line: #7a52b0;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141312;
  --surface: #1d1c1a;
  --surface-2: #27251f;
  --text: #ece8e2;
  --muted: #aaa398;
  --border: #3a362f;
  --accent: #b8291f;
  --link: #ff8a7a;
  --focus: #7fb0ff;
  --ok-bg: #16301b; --ok-fg: #a6e0ae; --ok-line: #3f8a4a;
  --info-bg: #172a45; --info-fg: #aac8f5; --info-line: #3e6cb0;
  --warn-bg: #352710; --warn-fg: #f3cf8c; --warn-line: #a8771f;
  --bad-bg: #3a1714; --bad-fg: #ffb4ab; --bad-line: #a8443a;
  --ur-bg: #2a1d3d; --ur-fg: #d9c2ff; --ur-line: #7a52b0;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code { font: .85em/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2);
  padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
img.sprite { display: inline-block; vertical-align: middle; object-fit: contain; flex: none; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.top :focus-visible { outline-color: var(--head-focus); }
h1:focus, main:focus, [tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute !important; 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; z-index: 10; background: var(--surface); color: var(--text);
  padding: 8px 12px; border-radius: 6px; }
.skip:focus { top: 8px; }

/* ---------- header ---------- */

.top { background: var(--accent); color: var(--accent-ink); }
.bar, .search, .tabs { max-width: 980px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none;
  font-weight: 800; font-size: 1.35rem; letter-spacing: .01em; }
.ball { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #1d1b19; flex: none;
  background: linear-gradient(to bottom, #ef5350 0 45%, #1d1b19 45% 55%, #fff 55% 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); position: relative; }
.ball::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 9px; height: 9px;
  transform: translate(-50%, -50%); border-radius: 50%; background: #fff; border: 2px solid #1d1b19; }
.sitenav { display: flex; gap: 4px; margin-left: auto; font-weight: 600; font-size: .95rem; }
.sitenav a { color: inherit; text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.sitenav a:hover { background: rgba(0, 0, 0, .15); text-decoration: underline; }
.sitenav a, .brand-name { white-space: nowrap; }
/* Four links don't fit beside the brand on a narrow screen: the nav gets its own row under it. */
@media (max-width: 680px) { .bar { flex-wrap: wrap; row-gap: 2px; } .sitenav { order: 3; flex-basis: 100%; flex-wrap: wrap; margin-left: -10px; } }
@media (max-width: 480px) { .sitenav { gap: 0; font-size: .82rem; margin-left: -6px; } .sitenav a { padding: 8px 6px; } .brand { font-size: 1.2rem; gap: 8px; } }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .45); background: rgba(0, 0, 0, .12); color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(0, 0, 0, .22); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

.search { position: relative; padding-top: 10px; padding-bottom: 12px; }
.search-icon { position: absolute; left: 29px; top: 50%; transform: translateY(-40%); color: #6b645c; pointer-events: none; }
.search input {
  width: 100%; height: 46px; padding: 0 14px 0 40px; font: inherit; font-size: 1rem;
  border: 2px solid transparent; border-radius: 23px; background: #fff; color: #1d1b19;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.search input::placeholder { color: #6b645c; }
.search input:focus { outline: none; border-color: var(--head-focus); }
.search input:disabled { opacity: .85; }

.tabs { display: flex; gap: 4px; padding-bottom: 0; }
.tabs [role="tab"] {
  flex: 1 1 0; min-height: 44px; font: inherit; font-weight: 600; color: rgba(255, 255, 255, .9);
  background: transparent; border: 0; border-bottom: 4px solid transparent; cursor: pointer; padding: 6px 8px;
  border-radius: 8px 8px 0 0;
}
.tabs [role="tab"]:hover { background: rgba(0, 0, 0, .12); }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); background: var(--bg); border-bottom-color: var(--bg); }

/* Four tabs on a 320-420px phone: a smaller label and padding, so "Pokemon" never pushes the row wider. */
@media (max-width: 420px) {
  .tabs { gap: 2px; padding-left: 8px; padding-right: 8px; }
  .tabs [role="tab"] { padding: 6px 2px; font-size: .9rem; }
}
@media (min-width: 720px) {
  .top { position: sticky; top: 0; z-index: 5; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
  .tabs [role="tab"] { flex: 0 0 auto; min-width: 120px; }
}

/* ---------- layout ---------- */

main { display: block; max-width: 980px; margin: 0 auto; padding: 16px 16px 40px; min-height: 60vh; }
.foot { max-width: 980px; margin: 0 auto; padding: 16px 16px 32px; color: var(--muted); font-size: .85rem;
  border-top: 1px solid var(--border); }
.foot p { margin: 4px 0; }
.loading { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.block { margin-top: 28px; }
.block > h2, h2.sub, .block > details > summary > h2 { font-size: 1.15rem; padding-bottom: 6px; margin-bottom: 12px;
  border-bottom: 2px solid var(--border); }
.block > h2::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); margin-right: 8px; vertical-align: 2px; }
h3.sub { font-size: 1rem; margin: 18px 0 8px; }
h2.inline { display: inline; border: 0; }
.block > details > summary { cursor: pointer; }
.block > details > summary > h2 { display: inline; border: 0; }

.callout { padding: 10px 14px; border-radius: var(--radius); border-left: 5px solid; margin: 14px 0; }
.callout.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-line); }
.callout.info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-line); }
.callout.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
.callout.bad { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-line); }
.callout a { color: inherit; font-weight: 600; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain > li { padding: 6px 0; border-bottom: 1px solid var(--border); }
ul.plain > li:last-child { border-bottom: 0; }

/* ---------- chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.chip { display: inline-block; max-width: 100%; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  line-height: 1.6; border: 1px solid transparent; }
.chip.type { color: #fff; text-transform: uppercase; letter-spacing: .03em; font-size: .72rem; }
.type-normal { background: #6d6d63; } .type-fire { background: #c4321f; } .type-water { background: #2a6fd6; }
.type-electric { background: #f5c518; color: #1a1a1a !important; } .type-grass { background: #2e7d32; }
.type-ice { background: #7fd4e8; color: #1a1a1a !important; } .type-fighting { background: #b8460f; }
.type-poison { background: #8a3fb8; } .type-ground { background: #8a5a1c; } .type-flying { background: #4f6fc0; }
.type-psychic { background: #d6336c; } .type-bug { background: #6b7d12; } .type-rock { background: #7a6b30; }
.type-ghost { background: #5e4a8a; } .type-dragon { background: #4a46c8; } .type-dark { background: #4a3f3a; }
.type-steel { background: #4a7688; } .type-fairy { background: #c2459c; }
.type-stellar, .type-unknown, .type-shadow, .type-qmark { background: #555; }

.chip.status.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-line); }
.chip.status.info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-line); }
.chip.status.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
.chip.status.bad { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-line); }
.chip.badge { background: #2b2620; color: #ffd76a; border-color: #8a6d1f; }
.chip.badge-mythical { color: #f6b8ff; border-color: #8a4a96; }
.chip.badge-paradox { color: #9fe6ff; border-color: #3f7d96; }
.chip.badge-ultra_beast { color: #b8c4ff; border-color: #4a57a8; }
.chip.alpha { background: #3a1f12; color: #ffb07a; border-color: #a8582a; }
.chip.dim { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.chip.src { background: var(--surface-2); color: var(--text); border-color: var(--border); min-width: 70px; text-align: center; }

.form-tag { display: inline-block; max-width: 100%; font-size: .78rem; font-weight: 600; padding: 0 7px; border-radius: 6px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.where-note { display: inline-block; font-size: .78rem; font-weight: 700; padding: 0 7px; margin-left: 6px; border-radius: 6px;
  background: var(--warn-bg); color: var(--warn-fg); border: 1px solid var(--warn-line); }
.gap { display: inline-block; font-weight: 700; font-size: .85rem; padding: 2px 9px; border-radius: 6px;
  background: var(--bad-bg); color: var(--bad-fg); border: 1px dashed var(--bad-line); }

.rarity { display: inline-block; max-width: 100%; font-weight: 700; font-size: .8rem; padding: 1px 8px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); }
.rarity .odds { font-weight: 400; }
.r-uncommon { border-color: var(--ok-line); }
.r-rare { border-color: var(--info-line); }
.r-ultra-rare { border-color: #9a6ad6; }
.r-boss { border-color: #d0742d; }
.ctx, .lvl { font-size: .85rem; font-weight: 600; color: var(--muted); }
/* How easily you meet a mon, after its name in lists: green common ... purple ultra-rare, like /track. */
.meet { display: inline-block; vertical-align: 1px; margin-left: 6px; padding: 0 7px; border-radius: 6px; font-size: .75rem;
  font-weight: 700; white-space: nowrap; border: 1px solid; }
.m-common { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-line); }
.m-uncommon { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
.m-rare { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-line); }
.m-ultra-rare { background: var(--ur-bg); color: var(--ur-fg); border-color: var(--ur-line); }
.meet-also { font-size: .75rem; color: var(--muted); margin-left: 4px; }

/* ---------- species / item / biome pages ---------- */

.hero { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.hero > img.sprite { width: 96px; height: 96px; background: var(--surface-2); border-radius: 50%; padding: 4px;
  image-rendering: pixelated; }
.hero.plain { display: block; }
.hero-text { min-width: 0; flex: 1; }
.hero h1 { font-size: 1.6rem; }
.hero .num { margin: 0; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.hero .chips { margin-top: 8px; }
.hero p { margin: 4px 0 0; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0 0; }
.facts div { display: flex; gap: 6px; align-items: baseline; }
.facts dt { color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; font-weight: 600; }
.facts.wide { margin-top: 14px; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; }
.facts.wide div { flex-wrap: wrap; }

.page.away .hero { border-style: dashed; background: var(--surface-2); }
/* "Not in our world" greys with token colours, not opacity: opacity would drop muted text below 4.5:1. */
.away img.sprite, img.sprite.away { filter: grayscale(1); opacity: .7; }

details.help { margin: 0 0 12px; font-size: .9rem; color: var(--muted); }
details.help summary, details.lazy summary { cursor: pointer; color: var(--link); font-weight: 600; width: fit-content; }
details.help ul { margin: 6px 0 0; padding-left: 20px; }

ul.spawns { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.spawn { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px;
  box-shadow: var(--shadow); }
.spawn.away { border-style: dashed; background: var(--surface-2); color: var(--muted); }
.spawn-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.spawn .where, .spawn .conds, .spawn .mults { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.spawn .where .chips { flex-basis: 100%; }
.spawn .label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  min-width: 52px; }
.away-note { margin: 6px 0 0; font-weight: 600; color: var(--warn-fg); }
.spawn .note, .herd { margin: 8px 0 0; font-size: .9rem; }
.chip.herd { background: var(--surface-2); color: var(--text); border-color: var(--border); }
details.lazy { flex-basis: 100%; }
details.lazy .lazy-body { margin-top: 6px; }
.away-list { margin-top: 6px; }

.cond { display: inline-block; font-size: .8rem; padding: 1px 8px; border-radius: 6px; background: var(--surface-2);
  border: 1px solid var(--border); }
.cond.neg { border-style: dashed; border-color: var(--bad-line); }
.mult { display: inline-block; font-size: .78rem; padding: 0 7px; border-radius: 6px; border: 1px solid var(--border); color: var(--muted); }
.mult.up { border-color: var(--ok-line); }

a.biome { display: inline-block; font-size: .85rem; padding: 1px 8px; border-radius: 6px; text-decoration: none;
  background: var(--surface-2); border: 1px solid var(--border); }
a.biome:hover { border-color: var(--link); }
.biome.away { color: var(--muted); border-style: dashed; text-decoration: line-through; text-decoration-thickness: 1px; }

ul.nearest { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
ul.nearest li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }

/* Tables scroll inside their own box on narrow screens; the page itself never scrolls sideways. */
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
tbody tr:last-child > * { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* At 360px the number columns must stay narrow so the Pokemon column keeps ~180px: headers and the
   small second lines (avg, Custap) may wrap; the main number never does. */
thead th.num, .num .avg { white-space: normal; }
@media (max-width: 480px) { th, td { padding: 7px 8px; } }
td.num strong { font-size: 1.02rem; }
.avg { display: block; font-size: .75rem; color: var(--muted); }
table.drops td:first-child { width: 100%; }
.summary { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
tr.away > td, ol.best li.away { color: var(--muted); }
tr.away > td { background: var(--surface-2); }
.avail { display: inline-block; font-size: .75rem; font-weight: 700; padding: 0 6px; margin-left: 4px; border-radius: 6px;
  color: var(--bad-fg); border: 1px dashed var(--bad-line); }
a.mon, span.mon { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
a.mon img.sprite { margin: -6px 0; }

.sources { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.source { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.source.broken, .source.unknown { border-style: dashed; background: var(--surface-2); }
.source.broken { color: var(--muted); }
.why { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
.why.bad { color: var(--bad-fg); }
ul.facts-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: .85rem; color: var(--muted); display: grid; gap: 2px; }
details.keys { margin-top: 6px; font-size: .85rem; }
details.keys summary, details.tagbiomes summary { cursor: pointer; color: var(--link); font-weight: 600; width: fit-content; }
details.keys ul.plain > li { padding: 3px 0; }
ul.plain > li.broken, ul.plain > li.inactive { color: var(--muted); }

/* Readable biome tags in evolution methods ("in Alola-flavoured biomes") and their lazy biome list */
.tagref { text-decoration: underline dotted; text-underline-offset: 3px; }
details.tagbiomes { display: block; margin-top: 4px; font-size: .85rem; }
.tag-biomes { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.tag-biomes .label { font-weight: 700; color: var(--text); }
.tag-biomes .chips { display: inline-flex; }
.reward { color: var(--ok-fg); }

/* evolution tree: each stage indented under the one it evolves from */
.evo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.evo-node { display: flex; }
.evo-mon { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; padding: 2px 10px 2px 2px;
  border-radius: 999px; text-decoration: none; background: var(--surface-2); border: 1px solid var(--border); }
.evo-mon.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
ul.evo-kids { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); margin-left: 20px; }
ul.evo-kids > li { padding-top: 8px; }
ul.evo-how { list-style: none; margin: 0 0 6px; padding: 0; font-size: .85rem; color: var(--muted); }
ul.evo-how li::before { content: "\2192\00a0"; color: var(--accent); font-weight: 700; }
ul.evo-how li.inactive { text-decoration: line-through; }
ul.evo-how li + li { margin-top: 4px; }

.form-section { border-top: 4px solid var(--border); padding-top: 4px; scroll-margin-top: 12px; }
.form-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.form-head img.sprite { background: var(--surface-2); border-radius: 50%; image-rendering: pixelated; }

/* ---------- lists ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 8px; }
.filters label { display: flex; flex-direction: column; font-size: .8rem; font-weight: 600; color: var(--muted); gap: 2px; flex: 1 1 140px; }
.filters select, .filters input { font: inherit; font-size: .95rem; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; min-height: 40px; max-width: 100%; }
.filters input::placeholder { color: var(--muted); }
.filters input[type="search"] { width: 100%; }
.count { margin: 4px 0 10px; font-size: .9rem; }

ul.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
a.row, a.result { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 52px; text-decoration: none;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
a.row:hover, a.result:hover { border-color: var(--link); }
a.row.away, a.result.away { border-style: dashed; background: var(--surface-2); color: var(--muted); }
.row-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.row-title { font-weight: 700; }
.row-title .num { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 2px; }
.row .chips { gap: 4px; }
@media (min-width: 640px) { ul.species-rows, ul.results, ul.biome-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { ul.species-rows { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

button.more { display: block; width: 100%; margin: 10px 0 0; min-height: 44px; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--link); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
button.more:hover { border-color: var(--link); }

/* Lost mob drops: one row per item, what used to drop it, and the best Pokemon now */
ul.lost-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lost-row { display: grid; gap: 6px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; }
@media (min-width: 640px) { .lost-row { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.lost-name { font-weight: 700; }
.lost-row.is-gap { border-color: var(--bad-line); border-style: dashed; }
.lost-row.is-gap .lost-name a { color: var(--bad-fg); }
ol.best { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
ol.best li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.lost-drops > p:first-of-type { margin-top: 0; }

/* Abilities: one card per ability (name, battle text, the /lead ability lines, who has it), the
   /lead list families and the /lead legendary aura with a type chip per boon */
ul.ab-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ab-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px;
  box-shadow: var(--shadow); }
.ab-name { font-size: 1.05rem; margin: 0 0 2px; }
.lead-line { margin: 4px 0 0; }
.lead-label { font-weight: 700; font-size: .85rem; color: var(--muted); }
.lead-line.legend .lead-label { color: var(--warn-fg); }
.lead-line.mons { font-size: .9rem; }
.lead-line a.mon { display: inline; }
.ab-lead .lead-line { margin-top: 8px; }
.fam-list > li { padding: 4px 0; }
.fam-ex { font-weight: 600; }
.fam-group h3.sub { margin-top: 14px; }
@media (min-width: 760px) {
  .fam-groups { columns: 2; column-gap: 28px; }
  .fam-group { break-inside: avoid; }
}
ul.aura { margin: 6px 0 0; padding-left: 20px; }
ul.aura > li { margin: 4px 0; }
ul.boons { list-style: none; margin: 8px 0 6px; padding: 0; display: grid; gap: 6px; }
@media (min-width: 640px) { ul.boons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; } }
ul.boons > li { display: flex; gap: 8px; align-items: baseline; }
ul.boons .chip { flex: none; min-width: 76px; text-align: center; }

ul.biome-spawns { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bs-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.bs-row.away { border-style: dashed; background: var(--surface-2); color: var(--muted); }
ul.bs-rules { list-style: none; margin: 4px 0 0; padding: 0; }
.bs-rule { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 4px 0; }
.bs-rule + .bs-rule { border-top: 1px dashed var(--border); }
.bs-rule.away { color: var(--muted); }
.bs-meta, .bs-rule .conds, .bs-rule .mults { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.bs-rule .conds, .bs-rule .mults { flex-basis: 100%; }
.bs-row details.lazy { margin-top: 2px; font-size: .9rem; }
.jump { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: .9rem; margin: 0 0 4px; }
.callout.small { font-size: .875rem; padding: 8px 12px; }

@media (min-width: 720px) {
  main { padding-top: 22px; }
  .form-section, #drops, [id^="ctx-"], #lead-aura, #all-abilities { scroll-margin-top: 150px; }      /* below the sticky header */
  .hero h1 { font-size: 2rem; }
}

@media (prefers-reduced-motion: no-preference) {
  a.row, a.result, a.biome, button.more { transition: border-color .12s ease; }
}

@media print {
  .top, .foot, button.more { display: none; }
  .spawn, .hero, table, .ab-row { box-shadow: none; }
}

.lang-btn { text-decoration: none; font-weight: 700; font-size: .8rem; color: inherit; }
