@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
}

/* ---------- Tokens (brand kit) ---------- */
:root {
  --bg: #f6f9ff;
  --surface: #ffffff;
  --navy: #0f172a;
  --ink: #0f172a;
  --slate: #334155;
  --muted: #5b6474;
  --line: #e2e8f0;
  --indigo: #6366f1;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --indigo-50: #eef0ff;
  --focus: #1d4ed8;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 14px rgba(30, 41, 99, 0.08);
  --shadow-lg: 0 12px 32px rgba(30, 41, 99, 0.12);
  --max: 1200px;

  --t-normal: #a8b0be;
  --t-fire: #ff7a45;
  --t-water: #3b82f6;
  --t-grass: #22c55e;
  --t-electric: #facc15;
  --t-ice: #60d5ff;
  --t-fighting: #ef4444;
  --t-poison: #a855f7;
  --t-ground: #d97706;
  --t-flying: #60a5fa;
  --t-psychic: #ec4899;
  --t-bug: #84cc16;
  --t-rock: #a3a3a3;
  --t-ghost: #8b5cf6;
  --t-dragon: #6366f1;
  --t-dark: #374151;
  --t-steel: #94a3b8;
  --t-fairy: #f472b6;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
img, svg { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.02em; color: var(--navy); }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.6rem); font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }

.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-link {
  position: absolute; left: 1rem; top: -100px; z-index: 200;
  padding: 0.6rem 1rem; background: var(--navy); color: #fff; border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { top: 1rem; color: #fff; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: clamp(16px, 3vw, 32px); }
.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--navy); text-decoration: none; flex: none; }
.brand:hover { color: var(--navy); }
.brand-logo { display: block; width: auto; height: 58px; }
.site-footer .brand-logo { height: 44px; }
@media (max-width: 820px) { .brand-logo { height: 42px; } }

.site-nav { margin-inline: auto; }
.site-nav ul { display: flex; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  position: relative; display: flex; align-items: center; min-height: 72px;
  padding: 0 0.95rem; color: var(--navy); font-weight: 600; font-size: 0.95rem; text-decoration: none;
}
.site-nav a:hover { color: var(--primary); }
.site-nav a[aria-current="page"] { color: var(--primary); }
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0.95rem; right: 0.95rem; bottom: 14px;
  height: 3px; border-radius: 3px; background: var(--indigo);
}
.header-pill {
  flex: none; display: inline-flex; flex-direction: column; justify-content: center;
  padding: 0.45rem 1rem; border-radius: 12px; background: var(--indigo-50);
  color: #3730a3; font-size: 0.78rem; font-weight: 600; line-height: 1.3;
}
.nav-toggle {
  display: none; margin-left: auto; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--navy); cursor: pointer;
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 1080px) { .header-pill { display: none; } }
@media (max-width: 820px) {
  .header-inner { min-height: 64px; flex-wrap: wrap; gap: 0.5rem; }
  .js .nav-toggle { display: inline-flex; }
  .site-nav { margin-inline: 0; width: 100%; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; padding-bottom: 0.75rem; }
  .site-nav ul { flex-wrap: wrap; }
  .js .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { min-height: 48px; padding: 0 0.75rem; border-radius: var(--r-sm); }
  .site-nav a[aria-current="page"] { background: var(--indigo-50); }
  .site-nav a[aria-current="page"]::after { display: none; }
}

/* ---------- Buttons, search ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.6rem 1.15rem; border-radius: 10px;
  border: 1.5px solid var(--primary); font: inherit; font-weight: 600; font-size: 0.95rem;
  text-decoration: none; cursor: pointer; background: var(--primary); color: #fff;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-outline { background: var(--surface); color: var(--primary); }
.btn-outline:hover { background: var(--indigo-50); color: var(--primary-hover); }
.btn .icon { width: 18px; height: 18px; }
.link-arrow { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 700; font-size: 0.92rem; color: var(--primary); text-decoration: none; }
.link-arrow .icon { width: 16px; height: 16px; }
.link-arrow:hover { text-decoration: underline; }

.searchbar {
  display: flex; align-items: center; gap: 0.5rem;
  max-width: 560px; margin-top: 1.75rem; padding: 0.4rem 0.4rem 0.4rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.searchbar .icon { width: 22px; height: 22px; color: var(--muted); }
.searchbar input {
  flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent;
  font: inherit; font-size: 1rem; color: var(--ink);
}
.searchbar input::placeholder { color: #6b7280; }
.searchbar input:focus { outline: none; }
.searchbar:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.searchbar .btn { min-height: 46px; padding-inline: 1.6rem; }
.search-hint { margin: 0.75rem 0 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(90deg, #ffffff 0%, #f8faff 38%, #e8efff 100%);
}
.hero-inner {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center; gap: 1rem; min-height: 460px; padding-block: 3rem 5.5rem;
}
.eyebrow {
  display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--slate); margin-bottom: 0.9rem;
}
.eyebrow ol { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.eyebrow li + li::before { content: "›"; margin-right: 0.5rem; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--primary); text-decoration: underline; }
.hero h1, .page-hero h1 {
  font-size: clamp(1.95rem, 5.2vw, 3.6rem); font-weight: 800; line-height: 1.04; letter-spacing: -0.035em; margin-bottom: 1rem;
}
.hero h1 .hl, .page-hero h1 .hl { display: block; color: var(--primary); }
.hero .lede, .page-hero .lede { font-size: 1.1rem; color: var(--slate); max-width: 34rem; margin: 0; }

.hero-art { position: relative; align-self: stretch; min-height: 320px; }
.hero-art .landscape { position: absolute; right: -4%; bottom: -2.5rem; width: min(640px, 112%); }
.hero-art .mascot {
  position: absolute; right: 2%; bottom: -3.2rem; width: min(250px, 46%);
  filter: drop-shadow(0 12px 18px rgba(30, 64, 175, 0.22));
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-block: 2rem 1rem; }
  .hero-art { min-height: min(82vw, 360px); }
  .hero-art .landscape { right: 50%; transform: translateX(50%); bottom: 0; width: min(440px, 100%); }
  .hero-art .mascot { right: 0; bottom: -0.5rem; width: min(150px, 38%); }
}

/* Quick tool cards overlapping the hero */
.quick-tools { position: relative; z-index: 2; margin-top: -3.25rem; }
.quick-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.9rem; list-style: none; margin: 0; padding: 0; }
.quick-card {
  position: relative; display: flex; align-items: center; gap: 0.8rem;
  height: 100%; padding: 0.9rem 0.8rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
}
.quick-card:hover { box-shadow: var(--shadow-lg); border-color: #c7d2fe; }
.quick-card a { color: var(--navy); font-weight: 700; font-size: 0.9rem; text-decoration: none; line-height: 1.25; }
.quick-card a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.quick-card p { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.icon-tile { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 11px; color: #fff; }
.tile-indigo { background: #6366f1; }
.tile-green { background: #16a34a; }
.tile-orange { background: #f97316; }
.tile-pink { background: #e63e7b; }
.tile-teal { background: #0d9488; }
@media (max-width: 1020px) { .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .quick-tools { margin-top: 0; } }
.quick-card .badge { width: 48px; height: 48px; }
.tool-card .badge { width: 64px; height: 64px; }
@media (max-width: 560px) {
  .quick-card .badge { width: 42px; height: 42px; }
  .searchbar .btn { padding-inline: 1rem; }
  .quick-grid { gap: 0.5rem; }
  .quick-card { flex-direction: column; text-align: center; padding: 0.8rem 0.4rem; gap: 0.45rem; }
  .quick-card a { font-size: 0.78rem; }
  .quick-card p { display: none; }
  .icon-tile { width: 40px; height: 40px; }
  .icon-tile .icon { width: 21px; height: 21px; }
}

/* ---------- Sections + cards ---------- */
.section { padding-block: clamp(1.75rem, 4vw, 2.5rem); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.9rem; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.section-head .link-arrow { margin-left: auto; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 1.25rem; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0; }
.tool-card { position: relative; display: flex; gap: 1rem; align-items: flex-start; height: 100%; }
.tool-card:hover { box-shadow: var(--shadow); border-color: #c7d2fe; }
.tool-card h3 { margin: 0.1rem 0 0.2rem; font-size: 1rem; }
.tool-card h3 a { color: var(--navy); text-decoration: none; }
.tool-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.tool-card p { font-size: 0.88rem; color: var(--muted); margin: 0 0 0.6rem; line-height: 1.45; }
.soft-tile { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; }
.soft-tile .icon { width: 34px; height: 34px; }
.soft-indigo { background: #eceeff; color: #5b5cf0; }
.soft-green { background: #e7f8ee; color: #16a34a; }
.soft-orange { background: #fff0e5; color: #ea6a12; }
.soft-blue { background: #e8f1ff; color: #2563eb; }

/* Type tiles (Explore by type) */
.type-tiles { display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); gap: 0.45rem; list-style: none; margin: 0; padding: 0; }
.type-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
  min-height: 72px; padding: 0.5rem 0.2rem; border-radius: 10px; text-decoration: none;
  background: color-mix(in srgb, var(--tc) 17%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--tc) 35%, #ffffff);
  color: var(--navy); font-size: 0.72rem; font-weight: 600;
}
.type-tile img { width: 32px; height: 32px; }
.type-tile:hover { color: var(--navy); background: color-mix(in srgb, var(--tc) 30%, #ffffff); }
.type-tile[data-type="dark"] { background: #3f4654; border-color: #3f4654; color: #fff; }
.type-tile[data-type="dark"]:hover { background: #2b303a; color: #fff; }
@media (max-width: 1100px) { .type-tiles { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
@media (max-width: 620px) { .type-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } .type-tile { font-size: 0.75rem; } }

[data-type="normal"] { --tc: var(--t-normal); }
[data-type="fire"] { --tc: var(--t-fire); }
[data-type="water"] { --tc: var(--t-water); }
[data-type="grass"] { --tc: var(--t-grass); }
[data-type="electric"] { --tc: var(--t-electric); }
[data-type="ice"] { --tc: var(--t-ice); }
[data-type="fighting"] { --tc: var(--t-fighting); }
[data-type="poison"] { --tc: var(--t-poison); }
[data-type="ground"] { --tc: var(--t-ground); }
[data-type="flying"] { --tc: var(--t-flying); }
[data-type="psychic"] { --tc: var(--t-psychic); }
[data-type="bug"] { --tc: var(--t-bug); }
[data-type="rock"] { --tc: var(--t-rock); }
[data-type="ghost"] { --tc: var(--t-ghost); }
[data-type="dragon"] { --tc: var(--t-dragon); }
[data-type="dark"] { --tc: var(--t-dark); }
[data-type="steel"] { --tc: var(--t-steel); }
[data-type="fairy"] { --tc: var(--t-fairy); }

/* Type chips (pills with icon) */
.type-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.22rem 0.7rem 0.22rem 0.28rem; border-radius: 999px;
  background: color-mix(in srgb, var(--tc) 16%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--tc) 30%, #ffffff);
  color: var(--navy); font-weight: 600; font-size: 0.82rem; line-height: 1.3; white-space: nowrap; text-decoration: none;
}
.type-chip img { width: 18px; height: 18px; }
.type-chip.lg { font-size: 0.95rem; padding: 0.35rem 0.95rem 0.35rem 0.35rem; }
.type-chip.lg img { width: 24px; height: 24px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }

/* Effect cards (2× / ½× / 0× / 1×) */
.effect-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin: 1rem 0; }
@media (max-width: 760px) { .effect-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .effect-grid { grid-template-columns: 1fr; } }
.effect { border-radius: var(--r); border: 1px solid var(--line); padding: 1rem; background: var(--surface); }
.effect-top { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.effect-badge { width: 44px; height: 44px; flex: none; }
.badge { flex: none; display: block; }
.effect-num { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.effect-label { display: block; font-size: 0.82rem; font-weight: 600; }
.effect p { margin: 0; font-size: 0.85rem; color: var(--slate); line-height: 1.45; }
.effect.x2 { background: #fff1f2; border-color: #fecdd3; }
.effect.x2 .effect-num, .effect.x2 .effect-label { color: #be123c; }
.effect.half { background: #eff6ff; border-color: #bfdbfe; }
.effect.half .effect-num, .effect.half .effect-label { color: #1d4ed8; }
.effect.zero { background: #f8fafc; border-color: #e2e8f0; }
.effect.zero .effect-num, .effect.zero .effect-label { color: #334155; }
.effect.x1 .effect-num, .effect.x1 .effect-label { color: #334155; }

.callout {
  display: flex; gap: 0.8rem; align-items: flex-start;
  background: var(--indigo-50); border: 1px solid #d5d9ff; border-radius: var(--r);
  padding: 1rem 1.15rem; color: #312e81; margin: 1rem 0;
}
.callout .icon { width: 26px; height: 26px; color: var(--indigo); margin-top: 1px; }
.callout p { margin: 0; color: #312e81; }

/* ---------- Page hero (guide/tool pages) ---------- */
.page-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(90deg, #ffffff 0%, #f8faff 45%, #e8efff 100%);
  border-bottom: 1px solid var(--line);
}
.page-hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 1rem;
  min-height: 330px; padding-block: 2.5rem;
}
.page-hero.plain .page-hero-inner { grid-template-columns: 1fr; min-height: 0; }
.page-hero .art { position: relative; align-self: stretch; }
.page-hero .art .landscape { position: absolute; right: 4%; bottom: -2.6rem; width: min(440px, 92%); }
.page-hero .art .mascot { position: absolute; right: -1%; bottom: -2.4rem; width: min(185px, 40%); filter: drop-shadow(0 10px 16px rgba(30, 64, 175, 0.2)); }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; list-style: none; margin: 1.2rem 0 0; padding: 0; font-size: 0.85rem; color: var(--slate); }
.meta-row li { display: inline-flex; align-items: center; gap: 0.4rem; }
.meta-row .icon { width: 17px; height: 17px; color: var(--muted); }
@media (max-width: 900px) {
  .page-hero-inner { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-block: 1.75rem; }
  .page-hero .art { display: none; }
}

/* ---------- Guide layout: TOC / article / sidebar ---------- */
.guide { display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; gap: 1.5rem; align-items: start; }
@media (max-width: 1100px) { .guide { grid-template-columns: 200px minmax(0, 1fr); } .guide-side { grid-column: 1 / -1; } }
@media (max-width: 820px) { .guide { grid-template-columns: 1fr; } }
.guide-left { display: grid; gap: 1rem; position: sticky; top: 88px; }
@media (max-width: 820px) { .guide-left { position: static; } }
.toc h2 { font-size: 1rem; margin-bottom: 0.6rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a {
  display: block; margin-left: -2px; padding: 0.4rem 0.8rem; border-left: 2px solid transparent;
  color: var(--slate); font-size: 0.88rem; font-weight: 500; text-decoration: none;
}
.toc a:hover { color: var(--primary); }
.toc a.is-active { color: var(--primary); border-left-color: var(--indigo); font-weight: 600; }
.help-card { display: grid; gap: 0.8rem; }
.help-card .row { display: flex; gap: 0.7rem; align-items: flex-start; }
.help-card strong { display: block; font-size: 0.92rem; color: var(--navy); }
.help-card p { margin: 0; font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
.help-card .btn { width: 100%; }

.article { min-width: 0; }
.article > section { margin-bottom: 2.25rem; }
.article > section:last-child { margin-bottom: 0; }
.article h2 { font-size: clamp(1.4rem, 2.4vw, 1.7rem); margin-bottom: 0.5rem; }
.article p { color: var(--slate); }
.article .effect-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 420px) { .article .effect-grid { grid-template-columns: 1fr; } }
.effect-label { white-space: nowrap; }

.guide-side { display: grid; gap: 1rem; }
.side-tools h2, .side-list h2 { font-size: 1.05rem; margin-bottom: 0.75rem; }
.side-tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; list-style: none; margin: 0; padding: 0; }
.side-tool {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.35rem;
  height: 100%; padding: 0.9rem 0.5rem; border: 1px solid var(--line); border-radius: var(--r);
}
.side-tool:hover { border-color: #c7d2fe; box-shadow: var(--shadow); }
.side-tool a { color: var(--navy); font-weight: 700; font-size: 0.85rem; text-decoration: none; line-height: 1.25; }
.side-tool a::after { content: ""; position: absolute; inset: 0; }
.side-tool .go { font-size: 0.78rem; font-weight: 600; color: var(--primary); }
.side-tool .badge { width: 52px; height: 52px; }
.tip-card { background: #eef4ff; border-color: #d6e4ff; }
.tip-card h2 { display: flex; align-items: center; gap: 0.5rem; font-size: 1.05rem; margin-bottom: 0.4rem; }
.tip-card h2 .icon { color: var(--indigo); width: 24px; height: 24px; }
.tip-card p { margin: 0; font-size: 0.88rem; color: var(--slate); }
.side-list ul { list-style: none; margin: 0; padding: 0; }
.side-list li + li { border-top: 1px solid var(--line); }
.side-list a { display: flex; align-items: center; gap: 0.7rem; padding: 0.65rem 0; color: var(--navy); text-decoration: none; }
.side-list a:hover strong { color: var(--primary); }
.side-list strong { display: block; font-size: 0.88rem; }
.side-list small { display: block; color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
.side-list .chev { margin-left: auto; width: 18px; height: 18px; color: var(--muted); }
.side-list .mini { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--indigo-50); color: var(--indigo); }
.side-list .mini .icon { width: 19px; height: 19px; }

/* ---------- Type chart ---------- */
.chart-card { padding: 0; overflow: hidden; }
.chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); }
.chart-toolbar h2 { font-size: 1.15rem; margin: 0; }
.chart-status { margin: 0; color: var(--slate); font-size: 0.88rem; }
.chart-toolbar .btn { min-height: 38px; padding: 0.35rem 0.9rem; font-size: 0.88rem; }
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.type-chart { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1060px; font-size: 0.8rem; }
.type-chart th, .type-chart td { text-align: center; padding: 0; border-bottom: 1px solid #eef2f7; border-right: 1px solid #eef2f7; }
.type-chart tr > *:last-child { border-right: 0; }
.type-chart tbody tr:last-child > * { border-bottom: 0; }
.type-chart .axis-title th { border-bottom: 0; padding: 0.55rem 0 0.1rem; font-size: 0.78rem; font-weight: 700; color: var(--slate); background: var(--surface); }
.type-chart .axis-title .blank { position: sticky; left: 0; z-index: 3; }
.type-chart .axis-title small { font-weight: 500; color: var(--muted); }
.type-chart .corner {
  position: sticky; left: 0; z-index: 3; background: var(--surface); min-width: 118px;
  text-align: left; vertical-align: bottom; padding: 0.5rem 0.75rem; font-size: 0.78rem; font-weight: 700; color: var(--slate); line-height: 1.25;
}
.type-chart tbody th { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; }
.axis-btn {
  display: flex; align-items: center; gap: 0.45rem; width: 100%; min-height: 38px;
  padding: 0.25rem 0.6rem; border: 0; background: transparent;
  font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; text-align: left;
}
.axis-btn img { width: 22px; height: 22px; flex: none; }
thead .axis-btn { flex-direction: column; justify-content: flex-end; gap: 0.2rem; min-height: 60px; padding: 0.3rem 0.1rem; font-size: 0.66rem; text-align: center; }
thead .axis-btn img { width: 26px; height: 26px; }
.axis-btn:hover { background: var(--indigo-50); }
.axis-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--tc) 22%, #ffffff); }
.type-chart td { width: 52px; height: 38px; }
.type-chart td.m2 { background: #f0fdf4; }
.type-chart td.m05 { background: #fef5f5; }
.type-chart td.m0 { background: #f1f5f9; }
.sym { display: inline-block; vertical-align: middle; }
.sym-2 { width: 14px; height: 14px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px #bbf7d0; }
.sym-05 { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 13px solid #dc2626; }
.sym-0 { width: 15px; height: 15px; border-radius: 50%; background: #475569; box-shadow: inset 0 0 0 4px #94a3b8; }
.sym-1 { width: 12px; height: 2px; border-radius: 2px; background: #94a3b8; }
.type-chart.has-focus td, .type-chart.has-focus tbody th { opacity: 0.3; }
.type-chart.has-focus td.on, .type-chart.has-focus tbody th.on { opacity: 1; }
.type-chart td.on { box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.45); }
.type-chart td.cross { box-shadow: inset 0 0 0 2px var(--primary); }
.chart-legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.75rem;
  list-style: none; margin: 0; padding: 0.85rem 1rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--slate);
}
.chart-legend li { display: inline-flex; align-items: center; gap: 0.5rem; }
.chart-legend strong { color: var(--navy); }

/* Type-by-type cards */
.type-summaries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
@media (max-width: 1000px) { .type-summaries { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .type-summaries { grid-template-columns: 1fr; } }
.type-summary h3 { margin-bottom: 0.75rem; }
.type-summary dl { margin: 0; display: grid; gap: 0.65rem; }
.type-summary dt { font-weight: 600; font-size: 0.8rem; color: var(--muted); }
.type-summary dd { margin: 0.25rem 0 0; }
.type-summary .none { color: var(--muted); font-size: 0.85rem; }

/* ---------- Calculator ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .calc { grid-template-columns: 1fr; } }
.mode-switch { display: flex; flex-wrap: wrap; gap: 0.25rem; border: 0; margin: 0 0 1.25rem; padding: 0; border-bottom: 1px solid var(--line); }
.mode-switch legend { font-weight: 700; margin-bottom: 0.4rem; padding: 0; float: left; width: 100%; color: var(--navy); }
.mode-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-switch label {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 0.9rem;
  font-weight: 600; font-size: 0.92rem; color: var(--slate); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.mode-switch input:checked + label { color: var(--primary); border-bottom-color: var(--indigo); }
.mode-switch input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: -3px; }
.type-picker { border: 0; margin: 0 0 1.25rem; padding: 0; min-width: 0; }
.type-picker legend { font-weight: 700; margin-bottom: 0.6rem; padding: 0; color: var(--navy); }
.type-picker .hint { font-weight: 400; color: var(--muted); font-size: 0.88rem; }
.picker-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.45rem; }
@media (max-width: 520px) { .picker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.picker-grid input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.picker-grid label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  min-height: 70px; padding: 0.45rem 0.2rem; border-radius: 10px; cursor: pointer;
  background: color-mix(in srgb, var(--tc, #cbd5e1) 12%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--tc, #cbd5e1) 30%, #ffffff);
  font-size: 0.74rem; font-weight: 600; color: var(--navy);
}
.picker-grid label img { width: 28px; height: 28px; }
.picker-grid label.none-opt { background: var(--surface); border-style: dashed; border-color: #94a3b8; color: var(--slate); }
.picker-grid label:hover { background: color-mix(in srgb, var(--tc, #cbd5e1) 25%, #ffffff); }
.picker-grid input:checked + label {
  background: color-mix(in srgb, var(--tc, #cbd5e1) 30%, #ffffff);
  border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary);
}
.picker-grid input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 3px; }
.picker-grid input:disabled + label { opacity: 0.4; cursor: not-allowed; }
.results { position: sticky; top: 88px; }
@media (max-width: 900px) { .results { position: static; } }
.results h2 { font-size: 1.3rem; }
.results .picked { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.result-group { padding: 0.85rem 0; border-top: 1px solid var(--line); }
.result-group h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; font-size: 0.95rem; margin-bottom: 0.5rem; }
.result-group .mult { display: inline-grid; place-items: center; min-width: 2.6rem; padding: 0.05rem 0.4rem; border-radius: 6px; font-weight: 800; font-size: 0.85rem; }
.mult.x4 { background: #ffe4e6; color: #9f1239; }
.mult.x2 { background: #fff1f2; color: #be123c; }
.mult.x1 { background: #f1f5f9; color: #475569; }
.mult.half { background: #eff6ff; color: #1d4ed8; }
.mult.quarter { background: #dbeafe; color: #1e40af; }
.mult.zero { background: #334155; color: #fff; }
.result-group .sub { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.result-empty { color: var(--muted); }
.results-art { display: block; width: 160px; margin: 0.75rem auto 0; }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 1rem; margin-bottom: 0.5rem; }
.faq summary { cursor: pointer; font-weight: 600; padding: 0.8rem 0; min-height: 44px; color: var(--navy); }
.faq details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 0.7rem; }

/* Prose pages */
.prose-card { max-width: 820px; margin-inline: auto; padding: clamp(1.25rem, 4vw, 2.5rem); }
.prose-card h2 { margin-top: 1.9rem; font-size: 1.3rem; }
.prose-card h2:first-child { margin-top: 0; }
.prose-card p, .prose-card li { color: var(--slate); }
.prose-card ul { padding-left: 1.2rem; }
.prose-card li { margin-bottom: 0.35rem; }
.prose-card table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.92rem; }
.prose-card th, .prose-card td { border: 1px solid var(--line); padding: 0.5rem 0.7rem; text-align: left; vertical-align: top; }
.prose-card th { background: var(--indigo-50); color: var(--navy); }
.prose-card address { font-style: normal; color: var(--slate); }
.table-wrap { overflow-x: auto; }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(2rem, 5vw, 3.5rem); background: var(--surface); border-top: 1px solid var(--line); }
.footer-main { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.25rem 2rem; padding-block: 1.6rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem 1.4rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { display: inline-block; padding: 0.35rem 0; color: var(--slate); font-size: 0.85rem; font-weight: 500; text-decoration: none; }
.footer-links a:hover { color: var(--primary); text-decoration: underline; }
.footer-disclaimer { max-width: 340px; margin: 0; text-align: right; font-size: 0.74rem; color: var(--muted); line-height: 1.5; }
.footer-disclaimer a { color: var(--muted); }
.footer-base { border-top: 1px solid var(--line); padding-block: 0.9rem; font-size: 0.74rem; color: var(--muted); }
.footer-base p { margin: 0; }
.footer-base address { display: inline; font-style: normal; }
.footer-base a { color: var(--muted); }
@media (max-width: 900px) {
  .footer-main { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer-disclaimer { text-align: center; max-width: 36rem; }
  .footer-base { text-align: center; }
}

/* 404 */
.not-found { text-align: center; padding-block: clamp(2.5rem, 8vw, 5rem); }
.not-found-art { position: relative; width: min(460px, 100%); margin: 0 auto 1.5rem; }
.not-found-art .landscape { display: block; width: 100%; height: auto; }
.not-found-art .mascot { position: absolute; right: -4%; bottom: -6%; width: 32%; height: auto; filter: drop-shadow(0 10px 16px rgba(30, 64, 175, 0.2)); }
.not-found .lede { margin-inline: auto; max-width: 32rem; color: var(--slate); }
.not-found .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.5rem; }

/* ---------- Nature chart ---------- */
.finder-title { font-size: 1.3rem; }
.finder-help { color: var(--slate); font-size: 0.92rem; }
.stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 520px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat-grid label { background: var(--surface); border-color: var(--line); }
.stat-grid label:hover { background: var(--indigo-50); }
.stat-grid input:checked + label { background: var(--indigo-50); }
.stat-label { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; white-space: nowrap; }
.stat-badge { width: 22px; height: 22px; }
.nature-big { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; color: var(--primary); margin: 0.25rem 0 0.75rem; line-height: 1; }
.nature-effects { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.5rem; }
.nature-effects li { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem; border-radius: var(--r); }
.nature-effects li.up { background: #fff1f2; color: #9f1239; }
.nature-effects li.down { background: #eff6ff; color: #1e40af; }
.nature-flavour { color: var(--slate); margin: 0; }
.nature-grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 720px; }
.nature-grid th, .nature-grid td { padding: 0.7rem 0.6rem; border-bottom: 1px solid #eef2f7; border-right: 1px solid #eef2f7; text-align: center; }
.nature-grid tr > *:last-child { border-right: 0; }
.nature-grid tbody tr:last-child > * { border-bottom: 0; }
.nature-grid .axis-title th { border-bottom: 0; padding: 0.55rem 0 0.1rem; font-size: 0.78rem; font-weight: 700; color: var(--slate); }
.nature-grid .axis-title small, .nature-grid .corner small { font-weight: 500; color: var(--muted); }
.nature-grid .corner { text-align: left; font-size: 0.78rem; color: var(--slate); }
.nature-grid tbody th { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.nature-name { display: block; font-weight: 700; color: var(--navy); }
.nature-sub { display: block; font-size: 0.72rem; color: var(--muted); }
.nature-grid td.neutral { background: #f1f5f9; }
.nature-grid td.on { background: var(--indigo-50); box-shadow: inset 0 0 0 2px var(--primary); }
.swatch-neutral { display: inline-block; width: 18px; height: 18px; border-radius: 4px; background: #f1f5f9; border: 1px solid #cbd5e1; }
.nature-list-card { padding: 0; }
.nature-list { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 520px; }
.nature-list th, .nature-list td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; }
.nature-list thead th { background: var(--indigo-50); color: var(--navy); font-size: 0.82rem; }
.nature-list tbody tr:last-child > * { border-bottom: 0; }
.nature-list .up { color: #be123c; font-weight: 600; }
.nature-list .down { color: #1d4ed8; font-weight: 600; }

/* ---------- Catch rate ---------- */
.field { display: grid; gap: 0.35rem; margin-bottom: 1.1rem; }
.field > label, .check-list legend { font-weight: 700; color: var(--navy); }
.field input[type="number"], .field select, .inline-number input {
  min-height: 44px; padding: 0.4rem 0.7rem; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; background: var(--surface); color: var(--ink);
}
.field-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 0.9rem; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.field-help { margin: 0; font-size: 0.82rem; color: var(--muted); }
.searchbar-inline { margin-top: 0; max-width: none; box-shadow: none; padding: 0.2rem 0.6rem; }
.species-card { margin-top: 0.5rem; padding: 0.8rem 1rem; border-radius: var(--r); background: var(--indigo-50); border: 1px solid #d5d9ff; }
.species-name { margin: 0 0 0.4rem; font-weight: 800; font-size: 1.15rem; color: var(--navy); }
.species-no { font-weight: 600; color: var(--muted); font-size: 0.9rem; }
.species-rate { margin: 0.5rem 0 0; color: var(--slate); font-size: 0.9rem; }
.species-rate span { color: var(--muted); font-size: 0.82rem; }
input[type="range"] { width: 100%; accent-color: var(--primary); min-height: 32px; }
.range-marks { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); }
.status-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.status-grid label { background: var(--surface); border-color: var(--line); }
.status-grid input:checked + label { background: var(--indigo-50); }
.mult-hint { font-size: 0.68rem; font-weight: 500; color: var(--muted); }
.check-list { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.35rem; }
.check-list legend { margin-bottom: 0.4rem; padding: 0; }
.check-list label, .more-options .check { display: flex; align-items: center; gap: 0.55rem; min-height: 40px; color: var(--slate); }
.check-list input[type="checkbox"], .more-options input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); }
.inline-number input { width: 5.5rem; margin-left: auto; }
.more-options { border: 1px solid var(--line); border-radius: var(--r); padding: 0 1rem; margin-bottom: 1rem; }
.more-options summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; color: var(--navy); }
.more-options[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 0.8rem; }
.chance-big { margin: 0.2rem 0 0.6rem; font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; color: var(--primary); line-height: 1; }
.chance-big span { display: block; margin-top: 0.35rem; font-size: 0.9rem; font-weight: 500; letter-spacing: 0; color: var(--slate); }
.meter { height: 12px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-bottom: 1rem; }
.meter span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #22c55e); }
.chance-facts { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.chance-facts li { padding: 0.7rem 0.8rem; border-radius: var(--r); background: #f8fafc; border: 1px solid var(--line); }
.chance-facts strong { display: block; color: var(--navy); }
.chance-facts span { font-size: 0.82rem; color: var(--muted); }
.best-title { font-size: 0.95rem; margin: 0.5rem 0; }
.best-balls { margin: 0; padding: 0; list-style: none; counter-reset: ball; }
.best-balls li { counter-increment: ball; display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.2rem; border-top: 1px solid var(--line); }
.best-balls li::before { content: counter(ball); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--indigo-50); color: var(--primary); font-weight: 700; font-size: 0.8rem; }
.best-balls li strong { margin-left: auto; color: var(--navy); }
.best-balls li.is-current { font-weight: 700; }
.best-balls li.is-current span::after { content: " (your ball)"; font-weight: 500; color: var(--muted); font-size: 0.82rem; }
.calc-note { margin: 0.9rem 0 0; font-size: 0.85rem; color: var(--muted); text-align: center; }
