:root {
  /* Cyberpunk palette (shared with the Profile Dex + landing). Dark = default. */
  --bg: #00131b;
  --bg-2: #031e28;
  --panel: #06222e;
  --panel-2: #0a2c3a;
  --line: #174155;
  --neon: #46e8e0;
  --neon-dim: #2aa7a2;
  --gold: #d1b235;
  --ice: #ddf3fb;
  --sky: #87b9cd;
  --text: #cfe8f2;
  --muted: #7f9aab;
  --alert: #e2453b;
  --mono: "Consolas", "SFMono-Regular", "Courier New", monospace;
  --sans: "Segoe UI", system-ui, sans-serif;

  /* legacy aliases used throughout this stylesheet */
  --ink: var(--text);
  --link: var(--neon);
  --accent: var(--neon);
  --soft: #0a2c3a;
  --soft-2: #12394b;
  --shadow: 0 1px 3px rgba(0, 0, 0, .5);
  --max: 1180px;
  --stripe: rgba(135, 185, 205, .05);
  --row-hover: #1a5d7a;

  /* masthead / compare-bar chrome (flips in light mode below) */
  --chrome: #031e28;
  --chrome-text: #ddf3fb;

  /* legacy logo-* aliases (map onto the flipping palette above) */
  --logo-navy: var(--bg);
  --logo-navy-2: var(--chrome);
  --logo-steel: var(--panel-2);
  --logo-sky: var(--neon);
  --logo-sky-2: var(--neon-dim);
  --logo-ice: var(--chrome-text);
}

/* Light "day mode" — pale version of the same cyberpunk palette. */
:root[data-theme="light"] {
  --bg: #d7e8ef;
  --bg-2: #e6f2f7;
  --panel: #ffffff;
  --panel-2: #eef6fa;
  --line: #aecdd9;
  --neon: #0e7c85;
  --neon-dim: #0a5b62;
  --gold: #9a7716;
  --ice: #0b2733;
  --sky: #2f6981;
  --text: #143039;
  --muted: #4f6d7c;
  --alert: #c1392f;
  --soft: #eef6fa;
  --soft-2: #dce9ef;
  --shadow: 0 1px 3px rgba(20, 60, 80, .12);
  --stripe: rgba(135, 185, 205, .05);
  --row-hover: #b3d8e8;
  --chrome: #e9f3f8;
  --chrome-text: #0b2733;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(70, 232, 224, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(226, 69, 59, 0.05), transparent 60%),
    var(--bg);
  font: 15px/1.55 var(--sans);
  min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(180deg, rgba(70, 232, 224, 0.035) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: 0 0 60px rgba(0, 0, 0, .35);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: var(--chrome);
  border-bottom: 2px solid var(--neon);
}
.masthead-brand { display: flex; align-items: center; gap: 12px; }
.masthead-brand, .masthead-brand:hover { text-decoration: none; }
.masthead-logo { width: 38px; height: 38px; filter: drop-shadow(0 0 6px rgba(70, 232, 224, 0.45)); }
.home-link { color: var(--neon); font: 700 20px var(--mono); letter-spacing: .26em; text-transform: uppercase; text-shadow: 0 0 10px rgba(70, 232, 224, 0.35); }
.home-link:hover { text-decoration: none; color: var(--ice); }
.dashboard-link { color: var(--sky); font: 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.dashboard-link:hover { color: var(--neon); }

/* ---------- Masthead global search ---------- */
.dex-search-wrap { position: relative; margin-right: auto; }
.dex-search {
  width: 220px; max-width: 42vw; padding: 7px 12px;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px;
  font: 13px var(--sans); outline: none;
}
.dex-search::placeholder { color: var(--muted); }
.dex-search:focus { border-color: var(--neon); box-shadow: 0 0 0 2px rgba(70, 232, 224, .2); }
.dex-search-results {
  position: absolute; top: calc(100% + 5px); left: 0; z-index: 9500;
  min-width: 260px; max-width: 340px; max-height: 62vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.ds-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 13px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.ds-item:last-child { border-bottom: 0; }
.ds-item:hover, .ds-item.active { background: var(--row-hover); }
.ds-name { font-weight: 600; font-size: 13px; }
.ds-cat { flex: 0 0 auto; color: var(--muted); font: 11px var(--mono); letter-spacing: .04em; }
.ds-empty { padding: 11px 13px; color: var(--muted); font-size: 12px; font-style: italic; }

main { padding: 26px 30px 50px; }
.loading, .empty { padding: 60px; color: var(--muted); text-align: center; }

.page-title { margin: 12px 0 22px; font: 700 30px var(--mono); letter-spacing: .14em; text-transform: uppercase; text-align: center; color: var(--gold); text-shadow: 0 2px 10px rgba(209, 178, 53, .3); }

.intro {
  margin: 0 0 22px;
  padding: 18px 22px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  color: var(--text);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.intro p { margin: 0 0 8px; }
.intro p:last-child { margin: 0; }

/* ---------- List controls ---------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  justify-content: center;
  margin: 0 0 18px;
}
.control { display: flex; align-items: center; gap: 9px; }
.control label { font-weight: 600; color: var(--muted); }
.control input, .control select {
  padding: 8px 11px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
}
.control input { width: 240px; }
.control input:focus, .control select:focus { border-color: var(--neon); box-shadow: 0 0 0 2px rgba(70, 232, 224, .2); }
.result-count { color: var(--muted); font-size: 13px; text-align: center; margin-bottom: 12px; }

/* ---------- Pokédex table ---------- */
.dex-wrap { overflow-x: auto; }
table.dex {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.dex thead th {
  position: sticky;
  top: 0;
  padding: 11px 10px;
  background: var(--panel-2);
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font: 700 12px var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
table.dex thead th.col-num,
table.dex thead th.col-name,
table.dex thead th.col-type { text-align: left; }
table.dex thead th .arrow { color: var(--muted); font-size: 10px; margin-left: 4px; }
table.dex thead th.sorted-asc .arrow::after { content: "▲"; color: var(--neon); }
table.dex thead th.sorted-desc .arrow::after { content: "▼"; color: var(--neon); }
table.dex tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}
table.dex tbody tr:hover,
table.dex tbody tr:nth-child(even):hover { background: var(--row-hover); }
td.col-num { width: 92px; text-align: left; color: var(--muted); white-space: nowrap; }
.sprite { display: inline-block; background-repeat: no-repeat; background-position: 0 0; vertical-align: middle; }
td.col-num .icon { vertical-align: middle; margin-right: 6px; }
td.col-name { text-align: left; }
td.col-name a { font-weight: 700; }
td.col-name .form-name { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
td.col-type { text-align: left; white-space: nowrap; }
td.col-total { font-weight: 700; }

/* ---------- Type badges ---------- */
.type-badge {
  display: inline-block;
  min-width: 64px;
  margin: 1px 0;
  padding: 3px 0;
  color: #fff;
  font: 700 11px "Segoe UI", Arial, sans-serif;
  letter-spacing: .3px;
  text-align: center;
  text-transform: uppercase;
  border-radius: 4px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.type-stack .type-badge { display: block; }
.type-badge.small { min-width: 50px; padding: 2px 0; font-size: 10px; }

.type-NORMAL { background: #9099a1; }
.type-FIRE { background: #ff9d55; }
.type-WATER { background: #4d90d5; }
.type-ELECTRIC { background: #f4d23c; text-shadow: none; color: #3a3a1f; }
.type-GRASS { background: #63bc5a; }
.type-ICE { background: #73cec0; }
.type-FIGHTING { background: #ce4069; }
.type-POISON { background: #ab6ac8; }
.type-GROUND { background: #d97746; }
.type-FLYING { background: #8fa9de; }
.type-PSYCHIC { background: #fa7179; }
.type-BUG { background: #90c12c; }
.type-ROCK { background: #c7b78b; }
.type-GHOST { background: #5269ac; }
.type-DRAGON { background: #0b6dc3; }
.type-DARK { background: #5a5366; }
.type-STEEL { background: #5a8ea1; }
.type-FAIRY { background: #ec8fe6; }
.type-QMARKS { background: #6a8a82; }

/* ---------- Detail page ---------- */
.detail-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.detail-title { margin: 2px 0 4px; font: 700 30px var(--mono); letter-spacing: .05em; text-align: center; color: var(--ice); }
.detail-sub { margin: 0 0 18px; color: var(--muted); text-align: center; }

.form-tabs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 0 0 22px; }
.form-tabs-label { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-right: 2px; }
.form-tab {
  padding: 6px 15px;
  color: var(--sky);
  background: var(--panel-2);
  border: 1px solid var(--line);
  font: 600 12px var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: background .12s, border-color .12s, color .12s;
}
.form-tab:hover { border-color: var(--neon); color: var(--ice); }
.form-tab.active { color: var(--neon); background: rgba(70, 232, 224, 0.08); border-color: var(--neon); }

.detail-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  margin-bottom: 30px;
}
.detail-art {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}
.detail-art .sprite { margin: 0 auto; }

h2.section {
  margin: 34px 0 14px;
  padding-bottom: 7px;
  font: 700 18px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--line);
}
h3.block { margin: 0 0 10px; font: 700 14px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--sky); }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { width: 38%; color: var(--muted); font-weight: 600; }
.placeholder { color: var(--muted); font-style: italic; }
.note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

/* ---------- Stats ---------- */
.stat-row { display: grid; grid-template-columns: 92px 42px 1fr 124px; gap: 10px; align-items: center; margin-bottom: 7px; font-size: 14px; }
.stat-row .stat-label { color: var(--text); font-weight: 600; }
.stat-row .stat-value { font-weight: 700; text-align: right; }
.stat-bar { height: 13px; background: var(--soft-2); border-radius: 7px; overflow: hidden; }
.stat-fill { display: block; height: 100%; border-radius: 7px; }
.stat-range { color: var(--muted); font-size: 12px; text-align: right; }
.stat-total { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; }

/* ---------- Type defenses ---------- */
.type-def-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.type-def {
  width: 58px;
  text-align: center;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.type-def .t { padding: 3px 0; color: #fff; font: 700 10px Arial; text-transform: uppercase; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.type-def .m { padding: 3px 0; font: 700 12px Arial; background: var(--panel); color: var(--muted); }
.type-def .m.mult-0 { background: #4b4b4b; color: #fff; }
.type-def .m.mult-25 { background: #1d7a3a; color: #fff; }
.type-def .m.mult-50 { background: #5fb96f; color: #fff; }
.type-def .m.mult-1 { background: var(--soft); color: var(--muted); }
.type-def .m.mult-2 { background: #f0a23c; color: #fff; }
.type-def .m.mult-4 { background: #d3502a; color: #fff; }
a.type-def { text-decoration: none; cursor: pointer; transition: border-color .12s, transform .12s; }
a.type-def:hover { border-color: var(--neon); transform: translateY(-2px); }

/* ---------- Evolution ---------- */
.evo-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.evo-stage { display: flex; flex-direction: column; align-items: center; width: 130px; text-align: center; }
.evo-stage .sprite { margin: 0 auto; }
.evo-stage .evo-name { font-weight: 700; }
.evo-stage .evo-types { display: flex; gap: 3px; justify-content: center; margin-top: 3px; }
.evo-arrow { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: 12px; min-width: 84px; }
.evo-arrow .a { font-size: 20px; line-height: 1; }
.evo-branches { display: flex; flex-direction: column; gap: 12px; }
.evo-branch { display: flex; align-items: center; gap: 6px; }

/* ---------- Moves ---------- */
.moves-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; }
table.moves { width: 100%; border-collapse: collapse; font-size: 13px; }
table.moves th, table.moves td { padding: 6px 7px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.moves th { background: var(--panel-2); color: var(--muted); text-align: right; }
table.moves th.l, table.moves td.l { text-align: left; }
table.moves td.move-name { font-weight: 600; }
.cat-badge { display: inline-block; min-width: 56px; padding: 2px 6px; color: #fff; font: 700 10px Arial; text-align: center; border-radius: 3px; text-transform: uppercase; }
.cat-Physical { background: #c0392b; }
.cat-Special { background: #2e6da4; }
.cat-Status { background: #8a8f97; }

/* ---------- Forms ---------- */
.forms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.form-card { padding: 16px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; }
.form-card .form-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.form-card .form-head .sprite { flex: 0 0 auto; }
.form-card h3 { margin: 0; font: 700 16px Georgia, serif; }
.form-card .form-types { display: flex; gap: 4px; margin-top: 4px; }
.form-card table.data th { width: 46%; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .moves-columns { grid-template-columns: 1fr; }
  .control input { width: 180px; }
}

/* ---------- QoL: theme toggle ---------- */
.dex-theme, .masthead-toggle {
  padding: 7px 14px;
  color: var(--sky);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  font: 600 12px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.dex-theme:hover, .masthead-toggle:hover { border-color: var(--neon); color: var(--neon); }

/* ---------- Move / Ability cross-reference pages ---------- */
.xr-count { display: inline-block; margin-left: 8px; padding: 1px 9px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 999px; vertical-align: middle; }
.mv-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.abil-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; margin: 8px 0 4px; }
.mon-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 6px; padding: 12px 8px 10px;
  color: var(--ink); text-decoration: none; text-align: center;
  background: var(--soft); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .12s, background .12s, transform .12s;
}
.mon-chip:hover { border-color: var(--accent); background: var(--panel-2); transform: translateY(-2px); }
.mon-chip .sprite { flex: 0 0 auto; margin: 0; }
.mc-name { width: 100%; font-size: 12.5px; font-weight: 600; line-height: 1.22; overflow-wrap: anywhere; word-break: break-word; }
.mc-badge { font-size: 11px; font-weight: 600; color: var(--neon); }
.loc-table td:first-child { font-weight: 600; }
.move-name a { color: var(--accent); text-decoration: none; }
.move-name a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .mv-grid { grid-template-columns: 1fr; }
  .abil-cols { grid-template-columns: 1fr; }
}

/* ---------- QoL: comparison ---------- */
.cmp-toggle {
  margin-left: 8px;
  padding: 1px 7px;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.4;
}
.cmp-toggle:hover { border-color: var(--accent); color: var(--accent); }
.cmp-toggle.active { color: var(--bg); background: var(--accent); border-color: var(--accent); }

#compare-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: min(92vw, 1000px);
  padding: 10px 14px;
  color: var(--logo-ice);
  background: var(--logo-navy-2);
  border: 1px solid var(--logo-sky-2);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
}
.cmp-chips { display: flex; flex-wrap: wrap; gap: 7px; overflow: hidden; }
.cmp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px 3px 11px;
  background: var(--logo-steel);
  border-radius: 999px;
  font-size: 12px;
}
.cmp-chip button { border: 0; background: none; color: #cfe6ef; cursor: pointer; font-size: 12px; padding: 0 2px; }
.cmp-chip button:hover { color: #fff; }
.cmp-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.cmp-go {
  padding: 7px 15px;
  color: #04222c;
  background: var(--logo-sky);
  border-radius: 8px;
  font-weight: 700;
}
.cmp-go:hover { background: #a7d2e3; text-decoration: none; }
.cmp-clear { padding: 7px 12px; color: var(--logo-ice); background: transparent; border: 1px solid var(--logo-steel); border-radius: 8px; cursor: pointer; }
.cmp-clear:hover { border-color: var(--logo-sky); }

.cmp-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.cmp-table th, .cmp-table td { padding: 11px 12px; border: 1px solid var(--line); text-align: center; }
.cmp-table thead th { background: var(--soft); vertical-align: bottom; }
.cmp-table thead .sprite { margin: 0 auto; }
.cmp-name { display: block; margin: 4px 0 6px; font: 700 15px Georgia, serif; }
.cmp-table tbody th { text-align: left; background: var(--soft); width: 110px; }
.cmp-cell { min-width: 120px; }
.cmp-bar { display: block; height: 7px; margin-bottom: 4px; background: var(--soft-2); border-radius: 6px; overflow: hidden; }
.cmp-bar span { display: block; height: 100%; border-radius: 6px; }
.cmp-num { font-weight: 600; }
.cmp-cell.best, .cmp-total td.best { background: rgba(35, 205, 94, .16); outline: 2px solid #1f9d52; }
.cmp-cell.best .cmp-num, .cmp-total td.best { font-weight: 800; }

/* compare: section headers, abilities, type defenses, detail button */
.cmp-section td { text-align: left; background: var(--soft-2); font: 700 13px "Segoe UI", Arial, sans-serif; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cmp-section-note { font-weight: 400; text-transform: none; letter-spacing: 0; }
.cmp-abil { min-width: 120px; font-size: 13px; }
.cmp-hidden { margin-top: 4px; color: var(--muted); font-size: 12px; }
.cmp-deftype { text-align: center !important; width: 90px; }
.cmp-deftype .type-badge { display: inline-block; }
.cmp-def { min-width: 90px; }
.cmp-mult { display: inline-block; min-width: 40px; padding: 3px 8px; border-radius: 5px; font: 700 13px Arial; background: var(--soft); color: var(--muted); }
.cmp-mult.mult-0 { background: #4b4b4b; color: #fff; }
.cmp-mult.mult-25 { background: #1d7a3a; color: #fff; }
.cmp-mult.mult-50 { background: #5fb96f; color: #fff; }
.cmp-mult.mult-1 { background: var(--soft-2); color: var(--text); }
.cmp-mult.mult-2 { background: #f0a23c; color: #fff; }
.cmp-mult.mult-4 { background: #d3502a; color: #fff; }
.cmp-def.best { background: rgba(35, 205, 94, .16); outline: 2px solid #1f9d52; }

.detail-art { flex-direction: column; gap: 12px; }
.cmp-toggle-big {
  padding: 7px 16px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font: 600 13px "Segoe UI", Arial, sans-serif;
}
.cmp-toggle-big:hover { border-color: var(--accent); color: var(--accent); }
.cmp-toggle-big.active { color: var(--bg); background: var(--accent); border-color: var(--accent); }

/* subtle zebra striping for the main table */
table.dex tbody tr:nth-child(even) { background: var(--stripe); }

/* ===== Promo card button + toast ===== */
.pdx-card-btn {
  margin-left: 10px;
  padding: 2px 10px;
  color: var(--accent);
  background: var(--soft);
  border: 1px solid var(--accent);
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.pdx-card-btn:hover { color: #fff; background: var(--accent); }
.pdx-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #06222e; border: 1px solid #46e8e0; color: #ddf3fb;
  font-family: "Consolas", monospace; font-size: 13px; padding: 10px 18px; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 0 20px rgba(70, 232, 224, 0.25);
}
.pdx-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Showcase mode (clean public view) ===== */
.dex-showcase-toggle {
  background: transparent; color: #9fc4d2; border: 1px solid var(--logo-sky);
  border-radius: 6px; padding: 4px 12px; font-size: 12px; cursor: pointer;
  font-family: "Consolas", monospace; letter-spacing: .04em;
}
.dex-showcase-toggle:hover { color: var(--logo-ice); border-color: var(--logo-ice); }
.dex-showcase-toggle[aria-pressed="true"] { color: #46e8e0; border-color: #46e8e0; }
body.showcase .dev-only { display: none !important; }
body.showcase .espio-fab, body.showcase .espio-panel { display: none !important; }

/* New / custom content badges in the list */
.new-badge { display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 5px; border-radius: 3px; margin-left: 5px; vertical-align: middle; border: 1px solid currentColor; line-height: 1.5; }
.nb-New { color: #b8901a; }
.nb-Theta { color: #a640bd; }
.nb-Mega { color: #1c9c95; }
.nb-Regional { color: #3f78d0; }
[data-theme="dark"] .nb-New { color: #d1b235; }
[data-theme="dark"] .nb-Theta { color: #d07be0; }
[data-theme="dark"] .nb-Mega { color: #46e8e0; }
[data-theme="dark"] .nb-Regional { color: #7fb3ff; }

/* ===== Clickable type badges + Type page ===== */
a.type-link { text-decoration: none; cursor: pointer; transition: filter .12s, transform .12s; }
a.type-link:hover { filter: brightness(1.08); transform: translateY(-1px); }

.type-title-badge { min-width: 150px; font-size: 20px; padding: 6px 20px; vertical-align: middle; }
.type-title-tag { font: italic 600 22px Georgia, serif; color: var(--muted); }
.type-intro { max-width: 900px; margin: 4px auto 18px; color: var(--ink); line-height: 1.55; text-align: center; }

.type-counts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 24px; }
.type-counts > div { flex: 1 1 130px; max-width: 200px; text-align: center; padding: 12px 8px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; }
.type-counts b { display: block; font: 700 26px Georgia, serif; }
.type-counts span { color: var(--muted); font-size: 12px; }

.type-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.type-line { margin: 14px 0 6px; font-size: 14px; font-weight: 600; }
.type-line.good::before { content: "\2714  "; color: #3ca55c; }
.type-line.bad::before { content: "\2716  "; color: #d3502a; }
.type-badge-row { display: flex; flex-wrap: wrap; gap: 5px; }
.type-badge-row .type-badge { min-width: 66px; }

.tac-wrap { overflow-x: auto; padding-bottom: 6px; }
.tac-table { border-collapse: collapse; margin: 4px 0; }
.tac-table th { padding: 0; }
.tac-table thead th { font: 700 9px Arial; color: #fff; width: 26px; height: 22px; text-align: center; text-shadow: 0 1px 1px rgba(0,0,0,.3); border: 1px solid #fff; }
.tac-table tbody th { font: 700 9px Arial; color: #fff; width: 30px; text-align: center; text-shadow: 0 1px 1px rgba(0,0,0,.3); border: 1px solid #fff; }
.tac-th { display: block; padding: 6px 0; color: inherit; text-decoration: none; cursor: pointer; }
.tac-th:hover { text-decoration: underline; filter: brightness(1.15); }
.tac { width: 26px; height: 24px; text-align: center; font: 700 12px Arial; border: 1px solid #fff; }
.tac.mult-0 { background: #4b4b4b; color: #fff; }
.tac.mult-25 { background: #1d7a3a; color: #fff; }
.tac.mult-50 { background: #5fb96f; color: #fff; }
.tac.mult-1 { background: var(--soft); color: transparent; }
.tac.mult-2 { background: #f0a23c; color: #fff; }
.tac.mult-4 { background: #d3502a; color: #fff; }
.tac.tac-diag { outline: 2px solid var(--soft-2); outline-offset: -2px; opacity: .82; }

.type-effects { margin: 8px 0; padding-left: 22px; line-height: 1.7; }
.type-effects li { margin-bottom: 4px; }
.type-lang { border-collapse: collapse; font-size: 14px; }
.type-lang th { text-align: right; padding: 5px 14px 5px 0; color: var(--muted); font-weight: 600; }
.type-lang td { padding: 5px 0; }

.tstat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tstat { flex: 1 1 120px; text-align: center; padding: 12px 6px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; }
.tstat-v { display: block; font: 700 22px Georgia, serif; }
.tstat-l { display: block; font-size: 13px; font-weight: 600; }
.tstat-r { display: block; color: var(--muted); font-size: 11px; }

.type-mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.type-mon { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px; padding: 12px 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); text-align: center; transition: border-color .12s, background .12s, transform .12s; }
.type-mon:hover { border-color: var(--accent); background: var(--panel-2); transform: translateY(-2px); }
.type-mon .sprite { flex: 0 0 auto; margin: 0; }
.type-mon .tm-name { width: 100%; font-weight: 600; font-size: 12.5px; line-height: 1.22; overflow-wrap: anywhere; word-break: break-word; }
.type-mon .tm-meta { display: block; color: var(--muted); font-size: 11px; }

/* ===== Notable trainers (Pokémon page) ===== */
.trainer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.trainer-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); transition: border-color .12s, background .12s, transform .12s; }
.trainer-card:hover { border-color: var(--accent); background: var(--soft); transform: translateY(-1px); }
.trainer-mug { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--soft-2); flex-shrink: 0; }
.trainer-mug-none { display: flex; align-items: center; justify-content: center; font: 700 20px Georgia, serif; color: var(--muted); }
.trainer-name { font-weight: 600; font-size: 13px; line-height: 1.25; }
.trainer-role { display: block; color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

[data-theme="dark"] .type-counts > div,
[data-theme="dark"] .tstat,
[data-theme="dark"] .type-mon:hover,
[data-theme="dark"] .trainer-card:hover { background: rgba(255,255,255,.04); }
[data-theme="dark"] .tac.mult-1 { background: rgba(255,255,255,.06); }

@media (max-width: 720px) {
  .type-cols { grid-template-columns: 1fr; gap: 14px; }
}
