:root {
  color-scheme: light;
  --page: oklch(0.965 0.012 160);
  --surface: oklch(0.995 0.003 160);
  --surface-muted: oklch(0.94 0.014 160);
  --ink: oklch(0.25 0.02 165);
  --muted: oklch(0.46 0.025 165);
  --line: oklch(0.84 0.025 160);
  --line-strong: oklch(0.72 0.04 160);
  --header: oklch(0.24 0.035 180);
  --accent: oklch(0.49 0.13 150);
  --accent-strong: oklch(0.38 0.12 150);
  --accent-soft: oklch(0.91 0.055 150);
  --info: oklch(0.56 0.12 225);
  --info-strong: oklch(0.38 0.11 225);
  --info-soft: oklch(0.93 0.035 220);
  --candidate-strong: oklch(0.48 0.13 68);
  --candidate-soft: oklch(0.94 0.055 78);
  --conflict-strong: oklch(0.44 0.16 28);
  --conflict-soft: oklch(0.94 0.045 28);
  --warning: var(--candidate-strong);
  --warning-soft: var(--candidate-soft);
  --selection-soft: oklch(0.95 0.04 100);
  --stat-low: oklch(0.55 0.16 28);
  --stat-mid: oklch(0.60 0.14 70);
  --stat-high: oklch(0.49 0.13 150);
  --stat-peak: oklch(0.48 0.13 225);
  --type-normal: oklch(0.78 0.025 90);
  --type-fire: oklch(0.51 0.18 35);
  --type-water: oklch(0.49 0.15 245);
  --type-electric: oklch(0.82 0.17 90);
  --type-grass: oklch(0.72 0.16 135);
  --type-ice: oklch(0.82 0.09 205);
  --type-fighting: oklch(0.52 0.16 25);
  --type-poison: #6f2a73;
  --type-ground: oklch(0.75 0.11 75);
  --type-flying: oklch(0.75 0.09 275);
  --type-psychic: oklch(0.51 0.18 350);
  --type-bug: oklch(0.69 0.13 120);
  --type-rock: oklch(0.55 0.08 80);
  --type-ghost: oklch(0.48 0.12 305);
  --type-dragon: oklch(0.52 0.19 285);
  --type-dark: oklch(0.39 0.04 40);
  --type-steel: oklch(0.73 0.035 250);
  --type-fairy: oklch(0.81 0.12 350);
  --grass: var(--type-grass);
  --poison: var(--type-poison);
  --focus: oklch(0.55 0.18 250);
  --radius: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font: var(--font-sans);
  --mono: var(--font-mono);
  --text-caption: 0.75rem;
  --text-small: 0.875rem;
  --text-ui: 0.9375rem;
  --text-body: 1rem;
  --text-subhead: 1.125rem;
  --text-section: 1.25rem;
  --text-title: 2rem;
  --text-display: 2.25rem;
  --leading-compact: 1.25;
  --leading-ui: 1.45;
  --leading-body: 1.65;
  --leading-heading: 1.2;
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --control-min: 2.75rem;
  --row-compact: 3.25rem;
  --row-mobile: 3.75rem;
  --gutter-mobile: 1rem;
  --gutter-desktop: 1.5rem;
  --section-gap: 2rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent-strong);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--focus) 48%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 30;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  color: var(--surface);
  background: var(--header);
  border-radius: 6px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.wiki-header {
  min-height: 68px;
  position: sticky;
  z-index: 20;
  top: 0;
  padding: 10px max(24px, calc((100vw - 1440px) / 2));
  display: grid;
  grid-template-columns: 230px minmax(280px, 640px) 1fr;
  align-items: center;
  gap: 28px;
  color: oklch(0.96 0.01 160);
  background: var(--header);
  border-bottom: 3px solid var(--accent);
}

.wiki-brand {
  min-height: var(--control-min);
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--header);
  background: oklch(0.82 0.17 135);
  border-radius: 50%;
  font: 700 var(--text-caption)/1 var(--mono);
}

.wiki-brand > span:last-child {
  display: flex;
  flex-direction: column;
}

.wiki-brand strong {
  font-size: var(--text-section);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.wiki-brand small {
  margin-top: 2px;
  color: oklch(0.78 0.02 165);
  font-size: var(--text-caption);
}

.search-field {
  min-height: var(--control-min);
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid oklch(0.65 0.025 165);
  border-radius: 8px;
}

.search-field:focus-within {
  border-color: oklch(0.79 0.15 135);
  outline: 2px solid color-mix(in oklch, oklch(0.79 0.15 135) 28%, transparent);
}

.search-field > span {
  margin-left: 12px;
  color: var(--muted);
  font-size: var(--text-section);
}

.search-field input {
  min-width: 0;
  width: 100%;
  height: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: var(--text-small);
}

.search-field input::placeholder {
  color: oklch(0.47 0.018 165);
}

kbd {
  margin-right: 7px;
  padding: 4px 7px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  font: var(--text-caption)/1 var(--mono);
}

.header-status {
  justify-self: end;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  line-height: 1.25;
}

.header-status span {
  color: oklch(0.78 0.02 165);
  font-size: var(--text-caption);
}

.header-status strong {
  font-size: var(--text-small);
}

.research-notice,
.page-tabs,
.article-nav,
.wiki-shell,
footer {
  width: min(1440px, calc(100% - 48px));
  margin-inline: auto;
}

.research-notice {
  min-height: 36px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  background: transparent;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-small);
}

.research-notice > span {
  padding: 1px 6px;
  color: var(--info-strong);
  background: var(--info-soft);
  border-radius: 4px;
  font-weight: 700;
}

.research-notice p {
  margin: 0;
}

.research-notice a {
  margin-left: auto;
  color: var(--info-strong);
  font-weight: 600;
  text-decoration: none;
}

.page-tabs {
  min-height: 45px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  border-bottom: 1px solid var(--line-strong);
}

.page-tabs a,
.page-tabs .view-tab {
  min-height: var(--control-min);
  padding: 10px 14px 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  font-size: var(--text-small);
  font-weight: 600;
  cursor: pointer;
}

.page-tabs a:hover,
.page-tabs .view-tab:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.page-tabs a.is-active,
.page-tabs .view-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.page-tabs .view-tab small {
  margin-left: 4px;
  padding: 1px 5px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  font: 700 var(--text-caption)/1 var(--mono);
}

.page-tabs > span {
  margin: 0 0 11px auto;
  color: var(--muted);
  font: var(--text-caption)/1 var(--mono);
}

.article-nav {
  min-height: 58px;
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.article-nav button {
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease;
}

.article-nav button:last-child {
  align-items: flex-end;
  text-align: right;
}

.article-nav button:hover {
  background: var(--accent-soft);
}

.article-nav button:active {
  transform: translateY(1px);
}

.article-nav button span {
  color: var(--muted);
  font-size: var(--text-caption);
}

.article-nav button strong {
  margin-top: 1px;
  font-size: var(--text-small);
}

.article-nav-center {
  padding: 0 18px;
  align-self: center;
  color: var(--muted);
  border-inline: 1px solid var(--line);
  font-size: var(--text-caption);
  white-space: nowrap;
}

.wiki-shell {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 330px;
  align-items: start;
  gap: 24px;
}

.wiki-toc,
.infobox-panel {
  position: sticky;
  top: 92px;
}

.toc-links {
  padding-bottom: 18px;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line-strong);
}

.toc-links strong,
.database-summary h2,
.catalog-heading h2 {
  margin: 0 0 8px;
  font-size: var(--text-small);
}

.toc-links a {
  padding: 5px 8px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 5px;
  font-size: var(--text-small);
}

.toc-links a:hover,
.toc-links a.is-current {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.database-summary {
  padding: 18px 0;
  border-bottom: 1px solid var(--line-strong);
}

.database-summary dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.database-summary dl > div {
  padding: 8px;
  background: color-mix(in oklch, var(--surface) 70%, transparent);
  border-radius: 6px;
}

.database-summary dt {
  color: var(--muted);
  font-size: var(--text-caption);
}

.database-summary dd {
  margin: 2px 0 0;
  font: 700 var(--text-subhead)/1 var(--mono);
}

.database-summary .is-warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.catalog-panel {
  padding-top: 18px;
}

.catalog-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.catalog-heading span {
  color: var(--muted);
  font: var(--text-caption)/1 var(--mono);
}

.species-list {
  max-height: clamp(260px, 36vh, 380px);
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.species-row {
  min-height: 52px;
  width: 100%;
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease;
}

.species-row:hover {
  background: var(--surface);
  border-color: var(--line);
}

.species-row.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: color-mix(in oklch, var(--accent) 38%, var(--line));
}

.species-row-number {
  font: 700 var(--text-caption)/1 var(--mono);
}

.species-row-names {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.species-row-names strong {
  overflow: hidden;
  font-size: var(--text-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.species-row-names small {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.species-row-count {
  color: var(--muted);
  font: 700 var(--text-caption)/1 var(--mono);
  text-align: right;
}

.empty-result {
  padding: 18px 8px;
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: var(--text-caption);
}

.empty-result strong {
  color: var(--ink);
  font-size: var(--text-small);
}

.article-main {
  min-width: 0;
  overflow: clip;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  scroll-margin-top: 84px;
}

body[data-view="catalog"] .article-nav,
body[data-view="catalog"] .wiki-toc,
body[data-view="catalog"] .infobox-panel,
body[data-view="catalog"] #detail-panel,
body[data-view="catalog"] #sources {
  display: none;
}

body[data-view="catalog"] .wiki-shell {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 14px;
}

body[data-view="catalog"] .article-main {
  grid-column: 1;
}

body[data-view="detail"] #catalog-view {
  display: none;
}

.catalog-view {
  min-width: 0;
}

.catalog-masthead {
  min-height: 124px;
  padding: 18px var(--space-6);
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}

.catalog-masthead > div {
  max-width: 760px;
}

.catalog-masthead p {
  margin: 0 0 var(--space-2);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: 700;
  line-height: var(--leading-ui);
  letter-spacing: 0.08em;
}

.catalog-masthead h1 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: var(--leading-heading);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.catalog-masthead > div > span {
  margin-top: 6px;
  display: block;
  color: var(--muted);
  font-size: var(--text-small);
}

.catalog-register {
  min-height: 56px;
  padding: 0 var(--space-6);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-4);
  background: color-mix(in oklch, var(--info-soft) 42%, var(--surface));
  border-bottom: 1px solid var(--line-strong);
}

.catalog-register-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.catalog-register-label strong {
  color: var(--ink);
  font-size: var(--text-small);
}

.catalog-register-label small {
  color: var(--muted);
  font-size: var(--text-caption);
}

#catalog-result-count {
  margin: 0;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: 700;
  line-height: var(--leading-compact);
  white-space: nowrap;
}

.catalog-range-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.catalog-range-nav a {
  min-height: var(--control-min);
  padding-inline: var(--space-3);
  display: inline-flex;
  align-items: center;
  color: var(--info-strong);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: 600;
  text-decoration: none;
}

.catalog-range-nav a:hover {
  color: var(--info-strong);
  background: color-mix(in oklch, var(--info) 13%, var(--surface));
}

.catalog-table-frame {
  padding: 0 var(--space-6) var(--space-3);
  overflow: visible;
}

.catalog-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: separate;
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
}

.catalog-table th {
  position: sticky;
  z-index: 5;
  top: 68px;
  height: 54px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--info-soft);
  border-bottom: 2px solid var(--line-strong);
  font-size: var(--text-small);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: left;
}

.catalog-table th:first-child { width: 86px; }
.catalog-table th:nth-child(2) { width: 27%; }
.catalog-table th:nth-child(3) { width: 18%; }
.catalog-table th:nth-child(4) { width: 82px; }
.catalog-table th:nth-child(5) { width: 88px; }
.catalog-table th:nth-child(6) { width: 130px; }
.catalog-table th:nth-child(7) { width: 120px; }

.catalog-table td {
  min-height: 64px;
  padding: 14px 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.catalog-table tbody tr {
  scroll-margin-top: 124px;
  transition: background 120ms ease;
}

.catalog-table tbody tr:hover {
  background: var(--selection-soft);
}

.catalog-number {
  color: var(--muted);
  font: 700 var(--text-small)/1.25 var(--mono);
}

.catalog-names button {
  min-height: var(--control-min);
  min-width: 0;
  width: 100%;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(76px, 0.8fr) minmax(90px, 1fr);
  gap: 1px 12px;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.catalog-names button:hover strong {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.catalog-names strong {
  grid-row: 1 / 3;
  align-self: center;
  overflow: hidden;
  font-size: var(--text-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-names span,
.catalog-names small {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-types .type-chip {
  margin-block: 2px;
  font-size: var(--text-small);
}

.catalog-measure {
  font: 700 var(--text-small)/1.25 var(--mono);
}

.catalog-measure small {
  margin-left: 3px;
  color: var(--muted);
  font-size: var(--text-small);
}

.catalog-stat {
  font: 700 var(--text-small)/1.25 var(--mono);
}

.catalog-stat > span {
  width: 64px;
  height: 3px;
  margin-top: 7px;
  display: block;
  overflow: hidden;
  background: var(--line);
}

.catalog-stat > span > i {
  width: var(--stat-percent);
  height: 100%;
  display: block;
  background: var(--stat-color, var(--accent));
}

.stat-low { --stat-color: var(--stat-low); }
.stat-mid { --stat-color: var(--stat-mid); }
.stat-high { --stat-color: var(--stat-high); }
.stat-peak { --stat-color: var(--stat-peak); }

.catalog-status > span,
.catalog-status > small {
  display: block;
  white-space: nowrap;
}

.catalog-status > span {
  color: var(--accent-strong);
  font-size: var(--text-small);
  font-weight: 700;
}

.catalog-status > span i {
  width: 6px;
  height: 6px;
  margin-right: 6px;
  display: inline-block;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.catalog-status > small {
  margin: 3px 0 0 12px;
  color: var(--muted);
  font-size: var(--text-small);
}

.catalog-empty td {
  height: 260px;
  text-align: center;
}

.catalog-empty strong,
.catalog-empty span {
  display: block;
}

.catalog-empty span {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--text-caption);
}

.catalog-footnote {
  min-height: 76px;
  width: auto;
  margin: 0;
  padding: 18px 38px;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  border-top: 1px solid var(--line-strong);
  font-size: var(--text-small);
}

.catalog-footnote span {
  color: var(--accent-strong);
  font-weight: 700;
}

.catalog-footnote p {
  margin: 0;
  color: var(--muted);
}

.article-document {
  --species-accent: var(--accent);
  padding: 28px 34px 10px;
}

.article-heading {
  padding: 18px 20px;
  background: color-mix(in oklch, var(--species-accent) 11%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--species-accent) 34%, var(--line));
  border-radius: 8px;
}

.article-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.article-index {
  margin: 0 0 2px;
  color: var(--muted);
  font: var(--text-caption)/1.4 var(--mono);
}

.article-heading h1 {
  margin: 0;
  font-size: var(--text-title);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.generation-tag {
  padding: 4px 9px;
  color: var(--ink);
  background: color-mix(in oklch, var(--species-accent) 22%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--species-accent) 38%, var(--line));
  border-radius: 999px;
  font-size: var(--text-caption);
  font-weight: 700;
}

.localized-names {
  margin: 9px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  color: var(--muted);
  font-size: var(--text-small);
}

.localized-names strong {
  color: var(--ink);
}

.verification-banner {
  margin: 20px 0 0;
  padding: 11px 13px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 7px;
}

.verification-banner strong {
  white-space: nowrap;
  font-size: var(--text-small);
}

.verification-banner span {
  color: color-mix(in oklch, var(--accent-strong) 78%, var(--ink));
  font-size: var(--text-caption);
}

.article-section {
  padding: 26px 0;
  scroll-margin-top: 90px;
  border-bottom: 1px solid var(--line);
}

.article-section:last-child {
  border-bottom: 0;
}

.article-section h2,
.source-section h2 {
  margin: 0;
  font-size: var(--text-section);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.article-section > p,
.source-section header p {
  max-width: 70ch;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  text-wrap: pretty;
}

.article-lead {
  color: var(--ink) !important;
  font-size: var(--text-body) !important;
  line-height: var(--leading-body);
}

.quick-facts {
  margin: 20px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quick-facts > div {
  min-height: 72px;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.quick-facts > div:last-child {
  border-right: 0;
}

.quick-facts dt {
  color: var(--muted);
  font-size: var(--text-caption);
}

.quick-facts dd {
  margin: 8px 0 0;
  font-weight: 700;
}

.ability-summary {
  margin-top: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  background: var(--surface-muted);
  border-radius: 8px;
}

.ability-summary h3 {
  margin: 0;
  font-size: var(--text-small);
}

.ability-summary > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ability-record {
  min-width: 150px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.ability-record strong {
  font-size: var(--text-small);
}

.ability-record small {
  grid-column: 1;
  color: var(--muted);
  font-size: var(--text-caption);
}

.ability-record b {
  grid-column: 2;
  grid-row: 1 / 3;
}

.type-chip {
  margin-right: 5px;
  padding: 2px 9px;
  display: inline-block;
  color: oklch(0.2 0.02 165);
  border-radius: 999px;
  font-size: var(--text-caption);
  font-weight: 700;
}

.type-grass {
  background: var(--type-grass);
}

.type-chip.type-poison,
.type-poison {
  color: white;
  background: var(--type-poison);
}

.type-normal { background: var(--type-normal); }
.type-fire { color: white; background: var(--type-fire); }
.type-water { color: white; background: var(--type-water); }
.type-electric { background: var(--type-electric); }
.type-ice { background: var(--type-ice); }
.type-fighting { color: white; background: var(--type-fighting); }
.type-ground { background: var(--type-ground); }
.type-flying { background: var(--type-flying); }
.type-psychic { color: white; background: var(--type-psychic); }
.type-bug { background: var(--type-bug); }
.type-rock { color: white; background: var(--type-rock); }
.type-ghost { color: white; background: var(--type-ghost); }
.type-dragon { color: white; background: var(--type-dragon); }
.type-dark { color: white; background: var(--type-dark); }
.type-steel { background: var(--type-steel); }
.type-fairy { background: var(--type-fairy); }

.theme-normal { --species-accent: var(--type-normal); }
.theme-fire { --species-accent: var(--type-fire); }
.theme-water { --species-accent: var(--type-water); }
.theme-electric { --species-accent: var(--type-electric); }
.theme-grass { --species-accent: var(--type-grass); }
.theme-ice { --species-accent: var(--type-ice); }
.theme-fighting { --species-accent: var(--type-fighting); }
.theme-poison { --species-accent: var(--type-poison); }
.theme-ground { --species-accent: var(--type-ground); }
.theme-flying { --species-accent: var(--type-flying); }
.theme-psychic { --species-accent: var(--type-psychic); }
.theme-bug { --species-accent: var(--type-bug); }
.theme-rock { --species-accent: var(--type-rock); }
.theme-ghost { --species-accent: var(--type-ghost); }
.theme-dragon { --species-accent: var(--type-dragon); }
.theme-dark { --species-accent: var(--type-dark); }
.theme-steel { --species-accent: var(--type-steel); }
.theme-fairy { --species-accent: var(--type-fairy); }

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.section-title-row > span {
  color: var(--muted);
  font-size: var(--text-caption);
}

.stats-table {
  width: 100%;
  margin-top: 18px;
  border-spacing: 0;
  border-collapse: separate;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: var(--text-small);
}

.stats-table th,
.stats-table td {
  padding: 8px 11px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.stats-table thead th {
  color: var(--muted);
  background: var(--info-soft);
  font-size: var(--text-caption);
}

.stats-table tbody th {
  font-weight: 600;
}

.stats-table tbody tr:hover {
  background: var(--selection-soft);
}

.stats-table tfoot th,
.stats-table tfoot td {
  border-bottom: 0;
  background: var(--accent-soft);
}

.stat-value {
  font: 700 var(--text-small)/1 var(--mono);
}

.status-badge {
  padding: 2px 7px;
  display: inline-block;
  border-radius: 999px;
  font-size: var(--text-caption);
  font-weight: 700;
  white-space: nowrap;
}

.status-verified {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.status-candidate {
  color: var(--candidate-strong);
  background: var(--candidate-soft);
}

.status-conflict {
  color: var(--conflict-strong);
  background: var(--conflict-soft);
}

.evolution-chain {
  margin-top: 17px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in oklch, var(--accent) 22%, var(--line));
  border-radius: 8px;
  font-size: var(--text-small);
}

.evolution-chain b {
  color: var(--accent);
  font-size: var(--text-subhead);
}

.evolution-chain strong {
  color: var(--accent-strong);
}

.scope-note {
  padding: 10px 12px;
  color: var(--candidate-strong) !important;
  background: var(--candidate-soft);
  border-radius: 7px;
  font-size: var(--text-small) !important;
}

.evidence-list {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.evidence-row {
  min-height: 58px;
  padding: 9px 4px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.evidence-row:hover {
  background: var(--info-soft);
}

.tier-badge {
  width: 30px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--info-strong);
  background: var(--info-soft);
  border-radius: 5px;
  font: 700 var(--text-caption)/1 var(--mono);
}

.tier-t1 {
  color: oklch(0.32 0.10 225);
  background: oklch(0.90 0.055 218);
}

.tier-t2 {
  color: oklch(0.35 0.105 235);
  background: oklch(0.93 0.038 228);
}

.tier-t3 {
  color: oklch(0.38 0.075 250);
  background: oklch(0.95 0.025 245);
}

.evidence-name {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.evidence-name strong {
  overflow: hidden;
  font-size: var(--text-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-name small {
  overflow: hidden;
  color: var(--muted);
  font: var(--text-caption)/1.5 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-count {
  color: var(--muted);
  font-size: var(--text-caption);
}

.source-section {
  padding: 26px 34px 32px;
  scroll-margin-top: 90px;
  border-top: 1px solid color-mix(in oklch, var(--info) 30%, var(--line));
}

.entry-evidence h2,
.source-section h2 {
  color: var(--info-strong);
}

.source-grid {
  margin-top: 18px;
  border-top: 1px solid var(--line-strong);
}

.source-card {
  padding: 15px 8px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 120px 76px;
  align-items: start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  transition: background 120ms ease;
}

.source-card:hover {
  background: var(--info-soft);
}

.source-card h3 {
  margin: 0;
  font-size: var(--text-small);
}

.source-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.55;
}

.source-card dl {
  margin: 0;
  display: flex;
  gap: 12px;
}

.source-card dl > div {
  display: flex;
  flex-direction: column;
}

.source-card dt {
  color: var(--muted);
  font-size: var(--text-caption);
}

.source-card dd {
  margin: 2px 0 0;
  font: 700 var(--text-caption)/1 var(--mono);
}

.source-card > a {
  min-height: var(--control-min);
  justify-self: end;
  display: inline-flex;
  align-items: center;
  color: var(--info-strong);
  font-size: var(--text-caption);
  font-weight: 600;
  text-decoration: none;
}

.infobox-panel {
  min-width: 0;
}

.infobox-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid color-mix(in oklch, var(--species-accent) 52%, var(--line));
  border-radius: var(--radius);
}

.infobox-card > header {
  min-height: 72px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: color-mix(in oklch, var(--species-accent) 15%, var(--surface));
  border-bottom: 1px solid color-mix(in oklch, var(--species-accent) 34%, var(--line));
}

.infobox-card h2 {
  margin: 0;
  font-size: var(--text-subhead);
  line-height: 1.25;
}

.infobox-card header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--text-caption);
}

.infobox-card header > strong {
  font: 700 var(--text-section)/1 var(--mono);
}

.media-boundary {
  min-height: 196px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.media-boundary > span {
  color: color-mix(in oklch, var(--species-accent) 42%, var(--surface-muted));
  font: 700 var(--text-display)/1 var(--mono);
}

.media-boundary strong {
  margin-top: 14px;
  color: var(--ink);
  font-size: var(--text-small);
}

.media-boundary small {
  margin-top: 3px;
  font-size: var(--text-caption);
}

.infobox-table {
  margin: 0;
}

.infobox-table > div {
  min-height: 38px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.infobox-table dt {
  color: var(--muted);
  font-size: var(--text-caption);
}

.infobox-table dd {
  margin: 0;
  font-size: var(--text-small);
  text-align: right;
}

.infobox-card > footer {
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: var(--text-caption);
}

.candidate-count {
  padding: 2px 7px;
  color: var(--candidate-strong);
  background: var(--candidate-soft);
  border-radius: 999px;
  font-weight: 700;
}

.article-skeleton,
.infobox-skeleton {
  min-height: 420px;
  padding: 32px;
}

.article-skeleton > span,
.infobox-skeleton > span {
  height: 16px;
  margin-bottom: 14px;
  display: block;
  background: var(--surface-muted);
  border-radius: 5px;
  animation: skeleton-pulse 1.2s ease-in-out infinite alternate;
}

.article-skeleton > span:first-child {
  width: 44%;
  height: 34px;
}

.article-skeleton > span:nth-child(3),
.infobox-skeleton > span:nth-child(2) {
  width: 72%;
}

.error-card {
  min-height: 420px;
  padding: 48px 34px;
}

.error-card strong {
  color: oklch(0.47 0.16 30);
  font-size: var(--text-subhead);
}

footer {
  min-height: 90px;
  margin-top: 38px;
  padding-block: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  border-top: 1px solid var(--line-strong);
  font-size: var(--text-caption);
}

footer strong {
  color: var(--ink);
}

footer span:last-child {
  margin-left: auto;
}

@keyframes skeleton-pulse {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@media (max-width: 1180px) {
  .wiki-shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .wiki-toc {
    grid-row: 1 / 3;
  }

  .article-main,
  .infobox-panel {
    grid-column: 2;
  }

  .infobox-panel {
    position: static;
  }

  .infobox-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .infobox-card > header,
  .infobox-card > footer {
    grid-column: 1 / -1;
  }

  .media-boundary {
    min-height: 220px;
    border-right: 1px solid var(--line);
  }
}

@media (max-width: 820px) {
  .wiki-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .header-status {
    display: none;
  }

  .research-notice,
  .page-tabs,
  .article-nav,
  .wiki-shell,
  footer {
    width: min(100% - 28px, 720px);
  }

  .research-notice a {
    display: none;
  }

  .wiki-shell {
    grid-template-columns: 1fr;
  }

  body[data-view="detail"] .wiki-toc {
    display: none;
  }

  .catalog-masthead {
    min-height: 120px;
    padding: 20px var(--gutter-desktop);
  }

  .catalog-register {
    padding-inline: 24px;
  }

  .catalog-table-frame {
    padding-inline: var(--gutter-desktop);
  }

  .wiki-toc,
  .article-main,
  .infobox-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .wiki-toc {
    position: static;
  }

  .toc-links {
    padding-bottom: 12px;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .toc-links strong {
    margin: 0 8px 0 0;
    white-space: nowrap;
  }

  .toc-links a {
    white-space: nowrap;
  }

  .database-summary dl {
    grid-template-columns: repeat(5, 1fr);
  }

  .catalog-panel {
    padding-bottom: 4px;
  }

  .species-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .species-row {
    grid-template-columns: 1fr auto;
  }

  .species-row-number {
    grid-column: 1 / -1;
  }

  .species-row-count {
    align-self: end;
  }
}

@media (max-width: 600px) {
  .wiki-header {
    min-height: 64px;
    padding: var(--space-2) var(--gutter-mobile);
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-2);
  }

  .wiki-brand {
    justify-self: start;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .wiki-brand small {
    display: none;
  }

  .search-field {
    width: 100%;
  }

  .research-notice {
    padding-block: 6px;
    align-items: center;
  }

  .page-tabs {
    overflow-x: auto;
  }

  .page-tabs a,
  .page-tabs .view-tab,
  .page-tabs > span {
    white-space: nowrap;
  }

  .page-tabs > span {
    margin-left: 18px;
  }

  .article-nav {
    grid-template-columns: 1fr 1fr;
  }

  .article-nav-center {
    display: none;
  }

  .catalog-masthead {
    min-height: 112px;
    padding: 18px var(--gutter-mobile);
    align-items: center;
    background: var(--surface);
  }

  .catalog-masthead h1 {
    font-size: 1.5rem;
  }

  .catalog-masthead > div > span {
    margin-top: var(--space-2);
    font-size: var(--text-small);
  }

  .catalog-register {
    min-height: 0;
    padding: var(--space-2) var(--gutter-mobile);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-1) var(--space-2);
  }

  .catalog-register-label small {
    display: none;
  }

  #catalog-result-count {
    margin: 0;
    justify-self: end;
  }

  .catalog-range-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
  }

  .catalog-range-nav a {
    flex: 1;
    justify-content: center;
  }

  .catalog-table-frame {
    padding: 0 var(--gutter-mobile) var(--space-3);
    overflow: visible;
    background: var(--surface);
  }

  .catalog-table,
  .catalog-table tbody {
    display: block;
  }

  .catalog-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
  }

  .catalog-table tbody {
    display: block;
  }

  .catalog-table tbody tr {
    min-height: 92px;
    padding: var(--space-2) 0;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-1) var(--space-2);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .catalog-table tbody tr:hover {
    background: var(--selection-soft);
  }

  .catalog-table td {
    min-height: 0;
    padding: 0;
    display: block;
    border: 0;
  }

  .catalog-number {
    grid-column: 1;
    grid-row: 1;
  }

  .catalog-names {
    grid-column: 2;
    grid-row: 1;
  }

  .catalog-names button {
    min-height: var(--control-min);
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: 0;
  }

  .catalog-types {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .catalog-measure,
  .catalog-status {
    display: none !important;
  }

  .catalog-stat {
    grid-column: 3;
    grid-row: 2;
    align-self: start;
    color: var(--muted);
    text-align: right;
  }

  .catalog-stat > span {
    display: none;
  }

  .catalog-empty {
    display: block !important;
  }

  .catalog-empty td {
    height: auto;
    padding: 34px 12px;
  }

  .catalog-footnote {
    min-height: 96px;
    width: auto;
    padding: 18px 20px;
    display: block;
  }

  .catalog-footnote p {
    margin-top: 6px;
  }

  .database-summary dl {
    grid-template-columns: repeat(3, 1fr);
  }

  .species-list {
    grid-template-columns: 1fr;
  }

  .species-row {
    grid-template-columns: 50px 1fr auto;
  }

  .species-row-number {
    grid-column: auto;
  }

  .article-document,
  .source-section {
    padding-inline: 20px;
  }

  .article-title-row,
  .verification-banner,
  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .verification-banner strong {
    white-space: normal;
  }

  .quick-facts {
    grid-template-columns: 1fr 1fr;
  }

  .quick-facts > div:nth-child(2) {
    border-right: 0;
  }

  .quick-facts > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .stats-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .evolution-chain {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .evidence-row {
    grid-template-columns: 34px minmax(0, 1fr) 20px;
  }

  .snapshot-count {
    display: none;
  }

  .source-card {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .source-card dl {
    display: none;
  }

  .source-card > a {
    align-self: center;
    font-size: 0;
  }

  .source-card > a::after {
    content: "↗";
    font-size: var(--text-small);
  }

  .infobox-card {
    display: block;
  }

  .media-boundary {
    min-height: 170px;
    border-right: 0;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  footer span:last-child {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Production Generation I card catalog */

.wiki-header {
  width: 100%;
  height: 3.5rem;
  min-height: 3.5rem;
  padding: 0 max(2.25rem, calc((100vw - 1440px) / 2));
  grid-template-columns: 13.125rem minmax(20rem, 1fr) 21.25rem;
  gap: 1.375rem;
  color: #26304f;
  background: #ffffff;
  border-bottom: 1px solid #e4e7f2;
}

body[data-view="catalog"] .wiki-header {
  min-height: 3.5rem;
}

.wiki-brand {
  min-height: 2rem;
  gap: 0.625rem;
  color: #17203c;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  color: #ffffff;
  background: #5963d9;
  border-radius: 0.625rem;
  font-size: var(--text-small);
}

.wiki-brand strong {
  font-size: var(--text-ui);
  line-height: 1.1;
}

.wiki-brand small {
  margin-top: 0.0625rem;
  color: #68708a;
  font-size: 0.625rem;
  line-height: 1.15;
}

.global-nav {
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 1.5rem;
}

.global-nav button,
.global-nav a {
  min-width: 2.25rem;
  padding: 0 0.125rem;
  position: relative;
  display: grid;
  place-items: center;
  color: #70768d;
  background: transparent;
  border: 0;
  font-size: var(--text-caption);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.global-nav button::after,
.global-nav a::after {
  content: "";
  height: 0.1875rem;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  background: transparent;
  border-radius: 0.1875rem 0.1875rem 0 0;
}

.global-nav button:hover,
.global-nav a:hover,
.global-nav .is-active {
  color: #3f49bd;
}

.global-nav .is-active::after {
  background: #5963d9;
}

.wiki-header .search-field {
  min-height: 2.125rem;
  height: 2.125rem;
  gap: 0.5rem;
  color: #59607b;
  background: #f1f3fb;
  border: 0;
  border-radius: 0.625rem;
}

.wiki-header .search-field > span {
  margin-left: 0.875rem;
  font-size: var(--text-small);
}

.wiki-header .search-field input {
  font-size: var(--text-caption);
}

.wiki-header .search-field kbd {
  margin-right: 0.625rem;
  padding: 0.1875rem 0.375rem;
  background: #ffffff;
  border-color: #d9ddea;
}

body[data-view="catalog"] {
  background: #f4f6ff;
}

body[data-view="catalog"] .wiki-shell {
  width: 100%;
  margin: 0;
  display: block;
}

body[data-view="catalog"] .article-main {
  max-width: none;
  min-width: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.catalog-view {
  overflow: visible;
  background: #f4f6ff;
  border: 0;
  border-radius: 0;
}

.catalog-masthead {
  width: 100%;
  height: 5.125rem;
  min-height: 5.125rem;
  padding: 0 max(2.25rem, calc((100vw - 1440px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  color: #ffffff;
  background: #515bd4;
  border: 0;
  border-radius: 0;
}

.catalog-title-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.catalog-masthead p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.catalog-masthead h1 {
  margin: 0.0625rem 0;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.catalog-masthead .catalog-title-block > span {
  color: rgba(255, 255, 255, 0.84);
  font: 700 var(--text-caption)/1.2 var(--mono);
}

.catalog-metrics {
  min-width: 25rem;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.catalog-metrics > div {
  min-width: 0;
  padding-left: 1.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.catalog-metrics dt {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.625rem;
  font-weight: 700;
}

.catalog-metrics dd {
  margin: 0.125rem 0 0;
  color: #ffffff;
  font: 800 var(--text-body)/1.2 var(--font-sans);
}

.catalog-filter-bar {
  width: 100%;
  min-height: 5.25rem;
  padding: 0.625rem max(2.25rem, calc((100vw - 1440px) / 2));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1.5rem;
  color: #444c69;
  background: #ffffff;
  border-bottom: 1px solid #dfe3ee;
}

.catalog-type-filter-block {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.625rem;
}

.catalog-filter-label,
.catalog-view-controls > strong {
  min-height: 1.875rem;
  display: flex;
  align-items: center;
  color: #323a58;
  font-size: 0.6875rem;
  white-space: nowrap;
}

.catalog-type-filters {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4375rem;
}

.catalog-view-controls {
  display: flex;
  align-items: center;
  gap: 0.4375rem;
  white-space: nowrap;
}

.catalog-filter-bar select {
  max-width: 12rem;
  min-height: 2.25rem;
  padding: 0.25rem 0.625rem;
  color: #3e4869;
  background: #f6f7ff;
  border: 1px solid #dce0ee;
  border-radius: 0.5rem;
  font: 650 var(--text-small)/1.3 var(--font-sans);
  cursor: pointer;
}

.catalog-filter-bar select:focus-visible {
  outline: 2px solid #6573dd;
  outline-offset: 2px;
}

.catalog-type-filters button {
  min-height: 1.875rem;
  padding: 0 0.5625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: #69708a;
  background: #ffffff;
  border: 1px solid #dce0ee;
  border-radius: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 650;
}

.catalog-type-filters button {
  cursor: pointer;
}

.catalog-type-filters button b {
  color: #8b91a5;
  font-size: 0.625rem;
  font-variant-numeric: tabular-nums;
}

.catalog-type-filters button:hover,
.catalog-type-filters button.is-active {
  color: #27304f;
  background: color-mix(in oklch, var(--filter-accent) 14%, #ffffff);
  border-color: color-mix(in oklch, var(--filter-accent) 42%, #dce0ee);
}

.catalog-type-filters button.is-active b {
  color: color-mix(in oklch, var(--filter-accent) 72%, #27304f);
}

.filter-dot {
  width: 0.5rem;
  height: 0.5rem;
  flex: 0 0 auto;
  border-radius: 50%;
}

.type-matchup-panel {
  width: 100%;
  min-height: 3.75rem;
  padding: 0.625rem max(2.25rem, calc((100vw - 1440px) / 2));
  display: grid;
  grid-template-columns: auto auto auto minmax(15rem, 1fr);
  align-items: center;
  gap: 0.75rem 1.25rem;
  color: #444c69;
  background: #f7f8ff;
  border-bottom: 1px solid #dfe3ee;
}

.type-matchup-panel[hidden] {
  display: none;
}

.type-matchup-heading,
.type-matchup-relation,
.type-matchup-relation > span {
  display: flex;
  align-items: center;
}

.type-matchup-heading {
  gap: 0.4375rem;
  white-space: nowrap;
}

.type-matchup-heading strong {
  color: #27304f;
  font-size: var(--text-small);
}

.type-matchup-heading small {
  padding: 0.1875rem 0.375rem;
  color: #67708b;
  background: #ffffff;
  border: 1px solid #e0e3ef;
  border-radius: 999px;
  font-size: 0.625rem;
}

.type-matchup-relation {
  gap: 0.5rem;
  white-space: nowrap;
}

.type-matchup-relation > b {
  color: #5e6680;
  font-size: 0.6875rem;
}

.type-matchup-relation em {
  color: #3f49bd;
  font-style: normal;
}

.type-matchup-relation > span {
  gap: 0.25rem;
}

.type-matchup-chip,
.type-matchup-empty {
  min-width: 1.75rem;
  min-height: 1.5rem;
  padding: 0.1875rem 0.4375rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 750;
  line-height: 1;
}

.type-matchup-empty {
  color: #7b829a;
  background: #e8eaf2;
}

.type-matchup-panel p {
  min-width: 0;
  margin: 0;
  color: #717990;
  font-size: 0.625rem;
  line-height: 1.4;
  text-align: right;
}

.type-matchup-panel a {
  margin-left: 0.375rem;
  color: #3f49bd;
  font-weight: 750;
  white-space: nowrap;
}

.catalog-stage {
  padding: 0 max(2.25rem, calc((100vw - 1440px) / 2)) 2rem;
}

.catalog-list-head {
  height: 3.0625rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.catalog-list-head > div {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.catalog-list-head strong {
  color: #27304f;
  font-size: var(--text-small);
}

.catalog-list-head span {
  color: #7a8198;
  font-size: 0.6875rem;
}

.catalog-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.catalog-card {
  height: 8rem;
  position: relative;
  display: grid;
  grid-template-rows: 2.1875rem minmax(0, 1fr);
  overflow: hidden;
  color: #202943;
  background: #ffffff;
  border: 1px solid #dfe3ee;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.875rem rgba(53, 62, 104, 0.055);
  font-variant-numeric: tabular-nums;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.catalog-card:hover {
  border-color: color-mix(in oklch, var(--species-accent) 52%, #dfe3ee);
  box-shadow: 0 0.5rem 1.25rem rgba(53, 62, 104, 0.11);
  transform: translateY(-0.125rem);
}

.catalog-type-strip {
  height: 0.25rem;
  position: absolute;
  z-index: 1;
  top: 0.0625rem;
  right: 0.0625rem;
  left: 0.0625rem;
  display: flex;
  overflow: hidden;
  border-radius: 0.6875rem 0.6875rem 0 0;
}

.catalog-type-strip > i {
  min-width: 0;
  flex: 1;
}

.catalog-card-head {
  min-width: 0;
  padding: 0.5625rem 0.75rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.catalog-card-index,
.catalog-card-types {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.catalog-card-index b {
  color: color-mix(in oklch, var(--species-accent) 72%, #27304f);
  font: 800 0.6875rem/1 var(--mono);
}

.catalog-card-index small {
  padding: 0.1875rem 0.375rem;
  color: color-mix(in oklch, var(--species-accent) 72%, #27304f);
  background: color-mix(in oklch, var(--species-accent) 18%, #ffffff);
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1;
}

.catalog-card-types {
  justify-content: flex-end;
  gap: 0.3125rem;
}

.catalog-card .type-chip {
  min-width: 1.75rem;
  height: 1.125rem;
  padding: 0 0.5rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 0.625rem;
  line-height: 1;
}

.catalog-card-body {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 0.75rem 0.8125rem;
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) 5.25rem;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.catalog-media-slot {
  width: 4rem;
  height: 4rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: color-mix(in oklch, var(--species-accent) 72%, #27304f);
  background: color-mix(in oklch, var(--species-accent) 12%, #ffffff);
  border: 1px solid color-mix(in oklch, var(--species-accent) 30%, #ffffff);
  border-radius: 0.75rem;
}

.catalog-species-image {
  width: 100%;
  height: 100%;
  padding: 0.125rem;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0.1875rem 0.1875rem rgba(39, 48, 79, 0.1));
}

.catalog-media-slot i {
  width: 1.75rem;
  height: 1.5rem;
  position: relative;
  border: 0.125rem solid currentColor;
  border-radius: 0.375rem;
}

.catalog-media-slot i::after {
  content: "";
  width: 0.4375rem;
  height: 0.4375rem;
  position: absolute;
  top: 0.3125rem;
  left: 0.3125rem;
  background: currentColor;
  border-radius: 50%;
}

.catalog-media-slot small {
  font-size: 0.625rem;
  font-weight: 750;
  line-height: 1;
}

.media-placeholder {
  display: grid;
  justify-items: center;
  gap: 0.375rem;
}

.media-placeholder-large {
  min-height: 9rem;
  padding: 2rem;
  align-content: center;
  color: #7884a0;
  background: #f2f4fa;
  border: 1px dashed #c7cede;
  border-radius: 0.75rem;
}

.media-placeholder-large i {
  width: 2.5rem;
  height: 2rem;
  border: 2px solid currentColor;
  border-radius: 0.375rem;
}

.basic-profile-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.25rem;
}

.basic-profile-grid > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid #e8ebf3;
  font-size: var(--text-small);
}

.basic-profile-grid dt { flex-shrink: 0; color: #69718b; }
.basic-profile-grid dd { margin: 0; text-align: right; color: #27304f; overflow-wrap: anywhere; }

.evolution-branches {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.evolution-branches > div { min-width: 0; padding: 0.75rem; border-radius: 0.5rem; background: #f4f6fc; }
.evolution-branches h3 { margin: 0 0 0.5rem; font-size: var(--text-small); color: #69718b; }
.evolution-entry { display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; margin-top: 0.5rem; }
.evolution-entry strong { font-size: var(--text-small); }

@media (max-width: 600px) {
  .basic-profile-grid { grid-template-columns: minmax(0, 1fr); }
  .evolution-branches { grid-template-columns: minmax(0, 1fr); }
  .catalog-filter-bar select { min-height: 2.75rem; }
}

.catalog-card-name {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.catalog-card-name strong {
  overflow: hidden;
  color: #202943;
  font-size: var(--text-body);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-card-name span,
.catalog-card-name small {
  overflow: hidden;
  color: #666f8e;
  font-size: var(--text-caption);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-card-facts {
  min-width: 0;
  padding-left: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  border-left: 1px solid #e1e4ef;
  font-size: var(--text-caption);
}

.catalog-card-facts > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.125rem;
  line-height: 1.2;
}

.catalog-card-facts small {
  flex: 0 0 auto;
  color: #7b829a;
  font-size: 0.625rem;
  white-space: nowrap;
}

.catalog-card-facts b {
  color: #25304e;
  font: 800 0.6875rem/1.2 var(--font-sans);
  white-space: nowrap;
}

.catalog-empty {
  min-height: 8rem;
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.25rem;
  color: #69708a;
  background: #ffffff;
  border: 1px dashed #cfd4e4;
  border-radius: 0.75rem;
}

.catalog-empty strong {
  color: #303958;
}

.type-bg-normal { background: var(--type-normal); }
.type-bg-fire { background: var(--type-fire); }
.type-bg-water { background: var(--type-water); }
.type-bg-electric { background: var(--type-electric); }
.type-bg-grass { background: var(--type-grass); }
.type-bg-ice { background: var(--type-ice); }
.type-bg-fighting { background: var(--type-fighting); }
.type-bg-poison { background: var(--type-poison); }
.type-bg-ground { background: var(--type-ground); }
.type-bg-flying { background: var(--type-flying); }
.type-bg-psychic { background: var(--type-psychic); }
.type-bg-bug { background: var(--type-bug); }
.type-bg-rock { background: var(--type-rock); }
.type-bg-ghost { background: var(--type-ghost); }
.type-bg-dragon { background: var(--type-dragon); }
.type-bg-dark { background: var(--type-dark); }
.type-bg-steel { background: var(--type-steel); }
.type-bg-fairy { background: var(--type-fairy); }

@media (max-width: 1180px) {
  .wiki-header {
    padding-inline: 1.5rem;
    grid-template-columns: 11rem minmax(15rem, 1fr) 18rem;
  }

  .catalog-masthead,
  .catalog-filter-bar,
  .type-matchup-panel,
  .catalog-stage {
    padding-inline: 1.5rem;
  }

  .type-matchup-panel {
    grid-template-columns: auto auto auto;
  }

  .type-matchup-panel p {
    grid-column: 1 / -1;
    text-align: left;
  }

  .catalog-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .wiki-header,
  body[data-view="catalog"] .wiki-header {
    height: auto;
    min-height: 6.75rem;
    padding: 0.5rem 1rem;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 2.5rem 2.75rem;
    gap: 0.25rem 0.75rem;
  }

  .global-nav {
    justify-content: flex-end;
    gap: 0.875rem;
  }

  .global-nav button,
  .global-nav a {
    min-width: auto;
  }

  .wiki-header .search-field {
    min-height: 2.75rem;
    height: 2.75rem;
    grid-column: 1 / -1;
  }

  .catalog-masthead {
    height: auto;
    min-height: 6.75rem;
    padding: 0.875rem 1rem;
  }

  .catalog-metrics {
    min-width: 18rem;
  }

  .catalog-filter-bar {
    min-height: 5.25rem;
    padding: 0.5rem 1rem;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 0.375rem;
  }

  .catalog-type-filters {
    width: 100%;
  }

  .catalog-view-controls {
    align-self: flex-end;
  }

  .type-matchup-panel {
    padding: 0.625rem 1rem;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.625rem 1rem;
  }

  .type-matchup-panel p {
    grid-column: 1 / -1;
  }

  .catalog-stage {
    padding-inline: 1rem;
  }

  .catalog-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .wiki-brand small {
    display: none;
  }

  .global-nav {
    gap: 0.625rem;
  }

  .global-nav button,
  .global-nav a {
    font-size: 0.6875rem;
  }

  .catalog-masthead {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .catalog-metrics {
    min-width: 0;
    width: 100%;
  }

  .catalog-metrics > div:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .catalog-type-filter-block {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }

  .catalog-filter-label {
    min-height: 1.25rem;
  }

  .catalog-type-filters button {
    min-height: 2.25rem;
    flex: 1 0 calc(25% - 0.4375rem);
  }

  .catalog-view-controls {
    width: 100%;
    justify-content: space-between;
  }

  .catalog-view-controls select {
    width: min(14rem, 68%);
    max-width: none;
  }

  .type-matchup-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .type-matchup-heading,
  .type-matchup-relation,
  .type-matchup-panel p {
    grid-column: 1;
  }

  .type-matchup-heading {
    flex-wrap: wrap;
  }

  .type-matchup-relation {
    justify-content: space-between;
  }

  .type-matchup-relation > span {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .type-matchup-panel p {
    text-align: left;
  }

  .catalog-list-head {
    height: 3.5rem;
  }

  .catalog-card-grid {
    grid-template-columns: 1fr;
  }

  .catalog-card {
    width: 100%;
  }
}

/* Secondary pages: detail article and source ledger */

body[data-view="detail"] {
  background: #f4f6ff;
}

body[data-view="detail"] .article-nav,
body[data-view="detail"] .wiki-shell,
body[data-view="detail"] footer {
  width: min(1368px, calc(100% - 72px));
}

body[data-view="detail"] .article-nav {
  min-height: 3rem;
  margin-top: 0.75rem;
  background: #ffffff;
  border: 1px solid #dfe3ee;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.875rem rgba(53, 62, 104, 0.045);
}

body[data-view="detail"] .article-nav button {
  padding: 0.4375rem 0.875rem;
}

body[data-view="detail"] .article-nav button:hover {
  background: #eef0ff;
}

body[data-view="detail"] .article-nav button span,
body[data-view="detail"] .article-nav-center {
  color: #7a8198;
  font-size: 0.6875rem;
}

body[data-view="detail"] .article-nav button strong {
  color: #2d3654;
  font-size: var(--text-caption);
}

body[data-view="detail"] .wiki-shell {
  margin-top: 1rem;
  grid-template-columns: 11.25rem minmax(0, 1fr) 18.5rem;
  gap: 1rem;
}

body[data-view="detail"] .wiki-toc,
body[data-view="detail"] .infobox-panel {
  top: 4.5rem;
}

body[data-view="detail"] .wiki-toc {
  display: grid;
  gap: 0.75rem;
}

body[data-view="detail"] .toc-links,
body[data-view="detail"] .database-summary,
body[data-view="detail"] .catalog-panel {
  padding: 0.875rem;
  background: #ffffff;
  border: 1px solid #dfe3ee;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.875rem rgba(53, 62, 104, 0.04);
}

body[data-view="detail"] .toc-links {
  padding-bottom: 0.875rem;
  border-bottom: 1px solid #dfe3ee;
}

body[data-view="detail"] .toc-links strong,
body[data-view="detail"] .database-summary h2,
body[data-view="detail"] .catalog-heading h2 {
  color: #303958;
  font-size: var(--text-caption);
}

body[data-view="detail"] .toc-links a {
  min-height: 2rem;
  padding: 0.3125rem 0.5rem;
  display: flex;
  align-items: center;
  color: #69708a;
  border-radius: 0.5rem;
  font-size: var(--text-caption);
}

body[data-view="detail"] .toc-links a:hover,
body[data-view="detail"] .toc-links a.is-current {
  color: #3f49bd;
  background: #eef0ff;
}

body[data-view="detail"] .database-summary {
  border-bottom: 1px solid #dfe3ee;
}

body[data-view="detail"] .database-summary dl {
  gap: 0.375rem;
}

body[data-view="detail"] .database-summary dl > div {
  padding: 0.5rem;
  background: #f6f7fc;
  border: 1px solid #eceef6;
  border-radius: 0.5rem;
}

body[data-view="detail"] .database-summary dd {
  color: #27304f;
  font-size: var(--text-body);
}

body[data-view="detail"] .database-summary .is-warning {
  color: var(--candidate-strong);
  background: var(--candidate-soft);
  border-color: color-mix(in oklch, var(--candidate-strong) 18%, #ffffff);
}

body[data-view="detail"] .catalog-panel {
  padding-top: 0.875rem;
}

body[data-view="detail"] .species-list {
  margin-top: 0.375rem;
  padding-right: 0.1875rem;
  gap: 0.25rem;
}

body[data-view="detail"] .species-row {
  min-height: 2.75rem;
  padding: 0.375rem 0.4375rem;
  grid-template-columns: 2.5rem minmax(0, 1fr) 1.25rem;
  color: #27304f;
  border-radius: 0.5rem;
}

body[data-view="detail"] .species-row:hover {
  background: #f4f6ff;
  border-color: #dfe3ee;
}

body[data-view="detail"] .species-row.is-active {
  color: #3f49bd;
  background: #eef0ff;
  border-color: #cbd0ff;
}

body[data-view="detail"] .article-main {
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}

body[data-view="detail"] .article-document {
  padding: 0;
  background: transparent;
}

.article-heading {
  padding: 0;
  overflow: hidden;
  color: #ffffff;
  background: #515bd4;
  border: 0;
  border-radius: 0.75rem;
  box-shadow: 0 0.375rem 1.125rem rgba(53, 62, 104, 0.11);
}

.detail-type-strip {
  width: 100%;
  height: 0.25rem;
  display: flex;
  overflow: hidden;
}

.detail-type-strip > i {
  min-width: 0;
  flex: 1;
}

.article-heading-content {
  padding: 1.125rem 1.25rem 1rem;
}

.article-title-row {
  align-items: center;
}

.article-heading-meta,
.detail-heading-types {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-heading-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.research-trigger {
  min-height: 2.25rem;
  padding: 0.375rem 0.75rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 0.5rem;
  font-size: var(--text-caption);
  font-weight: 750;
  cursor: pointer;
}

.research-trigger:hover {
  background: rgba(255, 255, 255, 0.2);
}

.article-index {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.6875rem;
  font-weight: 700;
}

.article-heading h1 {
  color: #ffffff;
  font-size: 1.75rem;
}

.article-heading .generation-tag {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
}

.article-heading .type-chip {
  min-width: 2rem;
  margin-right: 0;
  padding: 0.25rem 0.625rem;
  text-align: center;
}

.article-heading .localized-names {
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.74);
  font-size: var(--text-caption);
}

.article-heading .localized-names strong {
  color: #ffffff;
}

body[data-view="detail"] .verification-banner {
  margin: 0.75rem 0 0;
  padding: 0.625rem 0.875rem;
  color: #26734c;
  background: #ffffff;
  border: 1px solid #d7eadf;
  border-left: 0.25rem solid #35a66c;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.875rem rgba(53, 62, 104, 0.035);
}

body[data-view="detail"] .verification-banner span {
  color: #62706c;
}

.article-section.detail-card {
  margin-top: 0.75rem;
  padding: 1.125rem 1.25rem;
  background: #ffffff;
  border: 1px solid #dfe3ee;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.875rem rgba(53, 62, 104, 0.04);
  scroll-margin-top: 4.75rem;
}

.article-section.detail-card h2,
.source-section h2 {
  color: #27304f;
  font-size: var(--text-subhead);
}

.article-section.detail-card > p {
  margin-top: 0.5rem;
  color: #68708a;
  font-size: var(--text-small);
  line-height: 1.65;
}

.article-section.detail-card .article-lead {
  font-size: var(--text-small) !important;
}

body[data-view="detail"] .quick-facts {
  margin-top: 0.875rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  background: #f7f8fc;
  border-color: #e1e4ef;
  border-radius: 0.625rem;
}

body[data-view="detail"] .quick-facts > div {
  min-height: 4rem;
  padding: 0.625rem 0.75rem;
}

body[data-view="detail"] .quick-facts dd {
  margin-top: 0.375rem;
  color: #27304f;
  font-size: var(--text-small);
}

body[data-view="detail"] .ability-summary {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f4f6ff;
  border: 1px solid #e1e4f3;
  border-radius: 0.625rem;
}

body[data-view="detail"] .ability-record {
  grid-template-columns: minmax(0, 1fr);
  background: #ffffff;
  border-color: #dfe3ee;
  border-radius: 0.5rem;
}

body[data-view="detail"] .stats-table {
  margin-top: 0.875rem;
  border-color: #dfe3ee;
  border-radius: 0.625rem;
}

body[data-view="detail"] .stats-table th:first-child {
  width: 68%;
}

body[data-view="detail"] .stats-table thead th {
  color: #59617d;
  background: #eef0ff;
}

body[data-view="detail"] .stats-table tbody tr:hover {
  background: #f7f8ff;
}

body[data-view="detail"] .stats-table tfoot th,
body[data-view="detail"] .stats-table tfoot td {
  background: color-mix(in oklch, var(--species-accent) 12%, #ffffff);
}

body[data-view="detail"] .evolution-chain {
  margin-top: 0.75rem;
  background: color-mix(in oklch, var(--species-accent) 10%, #ffffff);
  border-color: color-mix(in oklch, var(--species-accent) 35%, #dfe3ee);
  border-radius: 0.625rem;
}

body[data-view="detail"] .evolution-chain b,
body[data-view="detail"] .evolution-chain strong {
  color: color-mix(in oklch, var(--species-accent) 72%, #27304f);
}

body[data-view="detail"] .scope-note {
  margin-top: 0.625rem;
  border-radius: 0.5rem;
}

body[data-view="detail"] .evidence-list {
  margin-top: 0.75rem;
  border-top-color: #dfe3ee;
}

body[data-view="detail"] .evidence-row {
  padding-inline: 0.5rem;
  border-bottom-color: #e5e8f1;
  border-radius: 0.375rem;
}

body[data-view="detail"] .evidence-row:hover {
  background: #f4f6ff;
}

body[data-view="detail"] .infobox-card {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dfe3ee;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.875rem rgba(53, 62, 104, 0.05);
}

body[data-view="detail"] .infobox-card > header {
  min-height: 4.25rem;
  padding: 0.75rem 0.875rem;
  background: #f7f8fc;
  border-bottom-color: #e1e4ef;
}

body[data-view="detail"] .infobox-card h2 {
  color: #27304f;
}

body[data-view="detail"] .infobox-card header > strong {
  color: color-mix(in oklch, var(--species-accent) 72%, #27304f);
  font-size: var(--text-subhead);
}

body[data-view="detail"] .media-boundary {
  min-height: 18.5rem;
  padding: 1rem;
  color: #68708a;
  background: color-mix(in oklch, var(--species-accent) 8%, #ffffff);
  border-bottom: 0;
}

.detail-species-image {
  width: min(14rem, 100%);
  height: auto;
  aspect-ratio: 1;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0.375rem 0.375rem rgba(39, 48, 79, 0.12));
}

body[data-view="detail"] .media-boundary strong {
  margin-top: 0.625rem;
  color: #303958;
}

body[data-view="detail"] .media-boundary small {
  color: #7a8198;
}

body[data-view="detail"] .media-boundary small a {
  color: #3f49bd;
  font-weight: 700;
  text-decoration: none;
}

body[data-view="detail"] .media-boundary small a:hover {
  text-decoration: underline;
}

body[data-view="detail"] .infobox-table > div {
  min-height: 2.25rem;
  padding: 0.4375rem 0.75rem;
  border-bottom-color: #e7e9f2;
}

body[data-view="detail"] .infobox-table dt {
  color: #7a8198;
}

body[data-view="detail"] .infobox-table dd {
  color: #303958;
}

body[data-view="detail"] .infobox-card > footer {
  background: #f7f8fc;
}

.research-dialog {
  width: min(46rem, calc(100% - 2rem));
  max-width: none;
  max-height: min(44rem, calc(100dvh - 2rem));
  padding: 0;
  overflow: hidden;
  color: #27304f;
  background: #ffffff;
  border: 0;
  border-radius: 0.875rem;
  box-shadow: 0 1.5rem 4rem rgba(30, 39, 79, 0.24);
}

.research-dialog[open] {
  animation: research-dialog-in 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.research-dialog::backdrop {
  background: rgba(28, 33, 58, 0.58);
  animation: research-backdrop-in 180ms ease-out;
}

body:has(.research-dialog[open]) {
  overflow: hidden;
}

.research-dialog-shell {
  max-height: min(44rem, calc(100dvh - 2rem));
  display: flex;
  flex-direction: column;
}

.research-dialog-header {
  min-height: 4.5rem;
  padding: 0.875rem 1.125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 0 0 auto;
  background: #f5f6ff;
  border-bottom: 1px solid #e0e3ef;
}

.research-dialog-header h2,
.research-dialog-header p,
.research-section h3,
.research-summary h3 {
  margin: 0;
}

.research-dialog-header h2 {
  font-size: var(--text-subhead);
  line-height: 1.3;
}

.research-dialog-header p {
  margin-top: 0.125rem;
  color: #717990;
  font-size: var(--text-caption);
}

.research-dialog-header button {
  min-width: 3.5rem;
  min-height: 2.75rem;
  color: #3f49bd;
  background: #ffffff;
  border: 1px solid #cbd0ff;
  border-radius: 0.5rem;
  font-size: var(--text-caption);
  font-weight: 750;
  cursor: pointer;
}

.research-dialog-header button:hover {
  background: #eef0ff;
}

.research-dialog-content {
  min-height: 0;
  overflow-y: auto;
  scrollbar-color: #b8bfd7 transparent;
  scrollbar-width: thin;
}

.research-summary,
.research-section {
  padding: 1rem 1.125rem;
  border-bottom: 1px solid #e6e8f1;
}

.research-section:last-child {
  border-bottom: 0;
}

.research-summary {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.research-summary h3,
.research-section h3 {
  color: #69718b;
  font-size: var(--text-caption);
}

.research-summary strong {
  display: block;
  margin-top: 0.25rem;
  color: #27714c;
  font-size: var(--text-small);
}

.research-counts {
  margin: 0;
  display: flex;
}

.research-counts > div {
  min-width: 5rem;
  padding: 0 0.75rem;
  border-left: 1px solid #dfe3ee;
}

.research-counts dt {
  color: #7a8198;
  font-size: 0.625rem;
  white-space: nowrap;
}

.research-counts dd {
  margin: 0.125rem 0 0;
  color: #27304f;
  font-size: var(--text-body);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.research-status-list {
  margin-top: 0.625rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}

.research-status-list > div {
  min-height: 2.25rem;
  padding: 0.375rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid #eceef5;
  font-size: var(--text-caption);
}

.research-status-list > div > span:first-child {
  min-width: 0;
  overflow: hidden;
  color: #4f5875;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-notes {
  margin: 0.625rem 0 0;
  padding-left: 1.125rem;
  color: #626b84;
  font-size: var(--text-caption);
  line-height: 1.6;
}

.research-notes li + li {
  margin-top: 0.25rem;
}

.research-notes a,
.research-dialog .evidence-row {
  color: #3f49bd;
  text-underline-offset: 0.1875rem;
}

.research-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.research-section-heading span {
  color: #7a8198;
  font-size: var(--text-caption);
}

.research-dialog .evidence-list {
  margin-top: 0.5rem;
}

.research-dialog .evidence-row {
  min-height: 3rem;
  padding: 0.375rem 0;
}

@keyframes research-dialog-in {
  from {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes research-backdrop-in {
  from { background: rgba(28, 33, 58, 0); }
  to { background: rgba(28, 33, 58, 0.58); }
}

body[data-view="detail"] .source-section {
  margin-top: 0.75rem;
  padding: 1.125rem 1.25rem 1.25rem;
  background: #ffffff;
  border: 1px solid #dfe3ee;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.875rem rgba(53, 62, 104, 0.04);
  scroll-margin-top: 4.75rem;
}

.source-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.source-section-heading > div > span {
  color: #5963d9;
  font: 800 0.625rem/1.4 var(--mono);
  letter-spacing: 0.04em;
}

.source-section-heading h2 {
  margin-top: 0.125rem;
}

.source-section-heading p {
  margin-top: 0.375rem !important;
  color: #68708a !important;
  font-size: var(--text-small) !important;
}

.source-section-heading > strong {
  padding: 0.3125rem 0.625rem;
  flex: 0 0 auto;
  color: #3f49bd;
  background: #eef0ff;
  border: 1px solid #cbd0ff;
  border-radius: 999px;
  font-size: var(--text-caption);
  line-height: 1.25;
}

.source-grid {
  margin-top: 0.875rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
  border-top: 0;
}

.source-card {
  min-width: 0;
  padding: 0.875rem;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 0.625rem;
  overflow: hidden;
  background: #f9faff;
  border: 1px solid #e1e4ef;
  border-top: 0.25rem solid #8dcce6;
  border-radius: 0.625rem;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.source-card.source-tier-t2 {
  border-top-color: #7fa9e8;
}

.source-card.source-tier-t3 {
  border-top-color: #9f97d9;
}

.source-card:hover {
  background: #ffffff;
  border-color: #cbd0ff;
  box-shadow: 0 0.5rem 1.25rem rgba(53, 62, 104, 0.09);
  transform: translateY(-0.125rem);
}

.source-card > .tier-badge {
  grid-column: 1;
  grid-row: 1;
}

.source-card > div {
  min-width: 0;
  grid-column: 2 / -1;
  grid-row: 1;
}

.source-card h3 {
  color: #27304f;
  font-size: var(--text-small);
}

.source-card p {
  color: #70778f;
  font-size: 0.6875rem;
  line-height: 1.5;
}

.source-card dl {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  gap: 1rem;
}

.source-card > a {
  min-height: 2rem;
  grid-column: 3;
  grid-row: 2;
  align-self: center;
  color: #3f49bd;
  font-size: 0.6875rem;
}

body[data-view="detail"] footer {
  color: #70778f;
  border-top-color: #dfe3ee;
}

@media (max-width: 1180px) {
  body[data-view="detail"] .article-nav,
  body[data-view="detail"] .wiki-shell,
  body[data-view="detail"] footer {
    width: min(100% - 48px, 1132px);
  }

  body[data-view="detail"] .wiki-shell {
    grid-template-columns: 11.25rem minmax(0, 1fr);
  }

  body[data-view="detail"] .infobox-panel {
    grid-column: 2;
  }

  body[data-view="detail"] .infobox-card {
    display: block;
  }

  body[data-view="detail"] .infobox-card > .detail-type-strip,
  body[data-view="detail"] .infobox-card > header,
  body[data-view="detail"] .infobox-card > footer {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  body[data-view="detail"] .article-nav,
  body[data-view="detail"] .wiki-shell,
  body[data-view="detail"] footer {
    width: min(100% - 32px, 720px);
  }

  body[data-view="detail"] .article-nav {
    margin-top: 0.5rem;
  }

  body[data-view="detail"] .wiki-shell {
    margin-top: 0.75rem;
    grid-template-columns: 1fr;
  }

  body[data-view="detail"] .wiki-toc {
    display: none;
  }

  body[data-view="detail"] .article-main,
  body[data-view="detail"] .infobox-panel {
    grid-column: 1;
  }

  body[data-view="detail"] .infobox-card {
    display: block;
  }

  .source-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  body[data-view="detail"] .article-nav,
  body[data-view="detail"] .wiki-shell,
  body[data-view="detail"] footer {
    width: calc(100% - 28px);
  }

  body[data-view="detail"] .article-heading-content,
  .article-section.detail-card,
  body[data-view="detail"] .source-section {
    padding: 1rem;
  }

  .article-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .article-heading-actions {
    width: 100%;
    justify-content: space-between;
  }

  .article-heading-meta {
    width: auto;
  }

  body[data-view="detail"] .quick-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-view="detail"] .ability-summary {
    grid-template-columns: 1fr;
  }

  body[data-view="detail"] .ability-record {
    min-width: 0;
    flex: 1 1 100%;
  }

  .source-section-heading {
    flex-direction: column;
    gap: 0.625rem;
  }

  .source-card {
    grid-template-columns: 2rem minmax(0, 1fr) 2rem;
  }

  .source-card dl {
    display: flex;
  }

  .source-card > a {
    width: 2rem;
    min-height: 2rem;
    justify-self: end;
    font-size: 0;
  }

  .source-card > a::after {
    content: "↗";
    font-size: var(--text-small);
  }

  body[data-view="detail"] .infobox-card {
    display: block;
  }

  .research-dialog,
  .research-dialog-shell {
    max-height: calc(100dvh - 1.5rem);
  }

  .research-dialog {
    width: calc(100% - 1.5rem);
  }

  .research-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .research-counts {
    width: 100%;
  }

  .research-counts > div {
    min-width: 0;
    padding-inline: 0.625rem;
    flex: 1;
  }

  .research-counts > div:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .research-status-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
