:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e222b;
  --border: #2a2f3a;
  --text: #e6e3db;
  --muted: #8d93a0;
  --accent: #d9b56a;
  --over: #d63370;
  --spare: #d4a03a;
  --over-text: #ff8fb8;
  --spare-text: #f0c46a;
  --accent-ink: #1a1408;
  --cost-bg: #2c2618;
  --hover: rgb(255 255 255 / 0.07);
  --border-hover: #3a4150;
  --header-top: #161920;
  --sticky-bg: rgb(15 17 21 / 0.92);
  --shadow: rgb(0 0 0 / 0.5);
  --radius: 8px;
  --gap: 0.75rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

.f-MO {
  --fc: #c8443b;
  --fc-ink: #fff;
}
.f-NG {
  --fc: #ebb81c;
}
.f-NR {
  --fc: #4a8fd6;
}
.f-SK {
  --fc: #9a6ad8;
}
.f-ST {
  --fc: #5aaa55;
}
.f-SY {
  --fc: #e5803a;
}
.f-NE {
  --fc: #9a9488;
}

* {
  box-sizing: border-box;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* rem, so the Display text-size setting (root font-size) scales everything. */
  font: 0.9375rem / 1.45 var(--font);
}

button,
input {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--header-top), var(--bg));
}
h1 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
h1 span {
  color: var(--text);
  font-weight: 400;
}
.meta {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 0.85rem;
}

.mode {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.mode button {
  border: 0;
  background: none;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
}
.mode button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

/* Filters */
.filters {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem 1.25rem;
  background: var(--sticky-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--gap);
}
.label {
  /* Set from the longest translated label (see main.ts) so rows stay aligned in every language. */
  width: var(--label-width, 5.5rem);
  flex: none;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--fc) 45%, var(--border));
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    opacity 0.15s;
}
.pill span {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--muted);
}
.pill:hover {
  background: color-mix(in srgb, var(--fc) 15%, var(--surface));
}
.pill[aria-pressed="true"] {
  background: var(--fc);
  border-color: var(--fc);
  /* Per-colour ink keeps text on solid pills at WCAG AA (most palette colours are too light for white). */
  color: var(--fc-ink, #111318);
}
.pill[aria-pressed="true"] span {
  color: inherit;
  opacity: 0.8;
}
.pill.empty {
  opacity: 0.35;
}
/* Stratagem icon pills: the art, then a fixed-width count so every tile is the same size. */
.pill.art {
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
}
.art img {
  width: 2.5rem;
  height: 2.5rem;
}
/* Stratagem art is a square crop; leader ability icons already have their own shape. */
[data-stratagem] img {
  border-radius: 999px;
}
.picked {
  align-self: center;
  color: var(--spare);
  font-size: 0.85rem;
}
.pill.art span {
  min-width: 3ch;
  font-variant-numeric: tabular-nums;
}
/* Stratagem pills: neutral row above the faction row, the note below. */
.stack {
  display: grid;
  gap: 0.4rem;
}
/* Lines up under the pills, so the row label centres on the pills alone. */
.note.indent {
  margin-top: -0.2rem;
  margin-left: calc(var(--label-width, 5.5rem) + var(--gap));
}
.hint {
  color: var(--muted);
  font-size: 0.85rem;
}
/* As tall as a tile row, so the tiles appearing when a faction is picked don't push the page down. */
#leader .hint {
  line-height: calc(2.9rem + 2px);
}

.chips-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.chips-box:hover {
  border-color: var(--border-hover);
}

.chips-box {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.4rem;
  min-height: 2.4rem;
}
.chips-box:focus-within {
  border-color: var(--accent);
}
.chips {
  display: contents;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.3rem 0.15rem 0.6rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--fc) 22%, var(--surface-2));
  border-left: 3px solid var(--fc);
  font-size: 0.9rem;
}
.chip button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.25rem;
  border-radius: 4px;
}
.chip button:hover {
  color: var(--text);
  background: var(--hover);
}

.combo {
  position: relative;
  flex: 1;
  min-width: 14rem;
}
.combo input {
  width: 100%;
  border: 0;
  background: none;
  padding: 0.25rem;
  outline: none;
}
.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(26rem, 90vw);
  margin: 0;
  padding: 0.3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px var(--shadow);
}
.suggestions > div {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border-left: 3px solid var(--fc, transparent);
  cursor: pointer;
}
.suggestions [role="option"]:hover {
  background: var(--hover);
}
.suggestions [aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
}
.suggestions .sug-name {
  flex: 1;
}
.suggestions .count {
  color: var(--muted);
  font-size: 0.8rem;
}
.suggestions .none {
  color: var(--muted);
  cursor: default;
  border: 0;
}

.cost {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.4rem;
  border-radius: 4px;
  background: var(--cost-bg);
  color: var(--accent);
  font: 600 0.75rem var(--mono);
}

.clear,
.link {
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
}
.clear:hover {
  color: var(--text);
  border-color: var(--border-hover);
}
.link {
  border: 0;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 1.25rem;
  padding: 1rem 1.25rem 3rem;
  max-width: 1400px;
}
.result-head,
.panel h2 {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Results */
.results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.deck {
  position: relative;
  padding: 0.6rem 0.9rem 0.6rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.deck::before {
  content: "";
  position: absolute;
  inset: 6px auto 6px 0;
  width: 4px;
  border-radius: 0 3px 3px 0;
  background: var(--fc);
}
.deck:hover {
  border-color: var(--border-hover);
}
.deck.over {
  border-color: color-mix(in srgb, var(--over) 55%, var(--border));
}

.deck-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.deck-toggle {
  flex: 1;
  min-width: 0;
  display: grid;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.deck-name {
  font-weight: 600;
}
.deck-toggle[aria-expanded="true"] .deck-name {
  color: var(--accent);
}
.deck-sub {
  color: var(--muted);
  font-size: 0.85rem;
}
.deck-id {
  font: 0.78rem var(--mono);
  color: var(--muted);
  background: var(--surface-2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.open {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--border);
}
.open:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
}
.stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
}
.stat img {
  height: 1rem;
  width: auto;
  opacity: 0.9;
}
.stat small {
  color: var(--muted);
  font-size: inherit;
}
.badge {
  margin-left: -0.5rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: help;
}
.badge.over {
  background: color-mix(in srgb, var(--over) 22%, transparent);
  color: var(--over-text);
}
.badge.spare {
  background: color-mix(in srgb, var(--spare) 20%, transparent);
  color: var(--spare-text);
}

.decklist {
  list-style: none;
  margin: 0.7rem 0 0.2rem;
  padding: 0.6rem 0 0;
  border-top: 1px solid var(--border);
  columns: 2 16rem;
  column-gap: 1.5rem;
}
.decklist li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.12rem 0.3rem;
  border-radius: 4px;
  break-inside: avoid;
}
.decklist a {
  text-decoration: none;
}
.decklist a:hover {
  text-decoration: underline;
  color: var(--accent);
}
.decklist .hit {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
/* Dims the text only, so a selected card keeps its highlight background. */
.decklist .common > :is(span, a) {
  opacity: 0.4;
}
.decklist .copies {
  color: var(--muted);
  font-size: 0.8rem;
}

.more {
  padding: 1rem;
  text-align: center;
}
.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Side panel */
.panel {
  position: sticky;
  top: 13rem;
  align-self: start;
}
.bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.bars button {
  position: relative;
  display: flex;
  width: 100%;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  border: 0;
  border-radius: 6px;
  background: none;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.bars button:hover {
  background: var(--surface-2);
}
.bar-name {
  flex: 1;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-n {
  z-index: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.bar {
  position: absolute;
  inset: auto auto 0 0;
  height: 3px;
  width: var(--pct);
  background: var(--fc);
  opacity: 0.8;
}
.bars .none {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 860px) {
  .topbar {
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .meta {
    margin: 0;
    width: 100%;
  }
  .filters {
    position: static;
  }
  .row {
    flex-wrap: wrap;
  }
  .label {
    width: 100%;
  }
  .note.indent {
    margin-left: 0;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .panel {
    position: static;
    order: -1;
  }
  .bars {
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  }
}

.note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--spare);
}

.f2-MO {
  --fc2: #c8443b;
}
.f2-NG {
  --fc2: #ebb81c;
}
.f2-NR {
  --fc2: #4a8fd6;
}
.f2-SK {
  --fc2: #9a6ad8;
}
.f2-ST {
  --fc2: #5aaa55;
}

/* Dual-faction cards: split the faction stripe between both colors. */
.chip.dual {
  border-left: 0;
  box-shadow:
    inset 3px 0 0 var(--fc),
    inset 6px 0 0 var(--fc2);
  padding-left: 0.75rem;
}

.s-community {
  --fc: #3fb5a3;
}
.s-shinmiri2 {
  --fc: #a3c94a;
}

.deck-src {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
}
.src {
  padding: 0 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fc);
  background: color-mix(in srgb, var(--fc) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--fc) 40%, transparent);
}
.votes,
.updated {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Accessibility: themes, contrast, colour vision, motion ---------- */

[data-theme="light"] {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #eeebe4;
  --border: #d3cec2;
  --border-hover: #a9a397;
  --text: #1c1e23;
  --muted: #555b67;
  --accent: #8a6213;
  --accent-ink: #fff;
  --over: #b8235f;
  --spare: #a8740e;
  --over-text: #a01e55;
  --spare-text: #7d5508;
  --cost-bg: #f1e6cc;
  --hover: rgb(0 0 0 / 0.05);
  --header-top: #ebe7de;
  --sticky-bg: rgb(245 243 238 / 0.94);
  --shadow: rgb(0 0 0 / 0.15);
  color-scheme: light;
}
/* Faction/source colours double as text on tinted badges; darken them on light backgrounds. */
[data-theme="light"] .src,
[data-theme="light"] .pill:not([aria-pressed="true"]) span {
  color: color-mix(in srgb, var(--fc) 45%, #000);
}

[data-contrast="high"] {
  --text: #ffffff;
  --muted: #c9ced8;
  --border: #6b7280;
  --border-hover: #9aa1ad;
  --over-text: #ffb3d0;
  --spare-text: #ffd98a;
}
[data-contrast="high"][data-theme="light"] {
  --text: #000;
  --muted: #2f333b;
  --border: #6b6558;
  --border-hover: #3d392f;
  --over-text: #7a1440;
  --spare-text: #5a3c00;
}
[data-contrast="high"] .pill.empty {
  opacity: 0.6;
}
[data-contrast="high"] .deck,
[data-contrast="high"] .chips-box {
  border-width: 2px;
}

/* Okabe–Ito palette: distinguishable under protanopia, deuteranopia and tritanopia. */
[data-cvd="true"] .f-MO,
[data-cvd="true"] .f2-MO {
  --fc: #d55e00;
  --fc2: #d55e00;
  --fc-ink: #111318;
}
[data-cvd="true"] .f-NG,
[data-cvd="true"] .f2-NG {
  --fc: #f0e442;
  --fc2: #f0e442;
}
[data-cvd="true"] .f-NR,
[data-cvd="true"] .f2-NR {
  --fc: #0072b2;
  --fc2: #0072b2;
  --fc-ink: #fff;
}
[data-cvd="true"] .f-SK,
[data-cvd="true"] .f2-SK {
  --fc: #cc79a7;
  --fc2: #cc79a7;
}
[data-cvd="true"] .f-ST,
[data-cvd="true"] .f2-ST {
  --fc: #009e73;
  --fc2: #009e73;
}
[data-cvd="true"] .f-SY {
  --fc: #e69f00;
}
[data-cvd="true"] .s-community {
  --fc: #56b4e9;
}
[data-cvd="true"] {
  --over: #d55e00;
  --spare: #56b4e9;
  --over-text: #ff9a52;
  --spare-text: #8fd0f5;
}
[data-cvd="true"][data-theme="light"] {
  --over-text: #9c3f00;
  --spare-text: #005a8c;
}

/* Faction code on each deck: read by screen readers always, shown visually in colour-blind mode. */
.fcode {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
[data-cvd="true"] .fcode {
  position: static;
  width: auto;
  height: auto;
  clip-path: none;
  margin-right: 0.45rem;
  padding: 0 0.35rem;
  border-radius: 4px;
  font: 700 0.72rem var(--mono);
  background: var(--fc);
  color: var(--fc-ink, #111318);
  vertical-align: 0.1em;
}

@media (prefers-reduced-motion: reduce) {
  * {
    /* biome-ignore lint/complexity/noImportantStyles: must override every component transition for users who asked for less motion */
    transition: none !important;
    /* biome-ignore lint/complexity/noImportantStyles: same reason as above */
    scroll-behavior: auto !important;
  }
}

/* Display menu */
.display {
  position: relative;
}
.display summary {
  list-style: none;
  cursor: pointer;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
}
.display summary::-webkit-details-marker {
  display: none;
}
.display-word {
  font-weight: 400;
  margin-left: 0.25rem;
}
.display summary:hover,
.display[open] summary {
  color: var(--text);
  border-color: var(--border-hover);
}
.display-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: grid;
  gap: 0.8rem;
  width: max-content;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px var(--shadow);
}
.setting {
  display: grid;
  gap: 0.35rem;
}
.setting-label {
  padding: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.seg button {
  border: 0;
  background: none;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
}
.seg button:hover:not(:disabled) {
  color: var(--text);
}
.seg button:disabled {
  opacity: 0.4;
  cursor: default;
}
.seg button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.seg output {
  min-width: 3.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.result-bar .result-head {
  margin: 0;
}
.result-bar .clear {
  padding: 0.2rem 0.7rem;
  font-size: 0.85rem;
}
/* Pushes both buttons to the right, together. */
#dim-common {
  margin-left: auto;
}
.result-bar .clear[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
.result-bar .clear:disabled {
  opacity: 0.4;
  cursor: default;
}

.decklist .power {
  min-width: 1.6rem;
  text-align: right;
  font: 600 0.8rem var(--mono);
  color: var(--text);
}

.b-spare {
  --fc: var(--spare);
}
.b-exact {
  --fc: var(--accent);
  --fc-ink: var(--accent-ink);
}
.b-over {
  --fc: var(--over);
  --fc-ink: #fff;
}

.freq {
  margin-bottom: 0.6rem;
}
.freq button {
  font-size: 0.85rem;
}

/* Credits */
.credits-open {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.credits-open:hover {
  color: var(--text);
  border-color: var(--border-hover);
}
.credits {
  width: min(36rem, calc(100vw - 2rem));
  padding: 0;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px var(--shadow);
}
.credits::backdrop {
  background: rgb(0 0 0 / 0.55);
}
.credits > * {
  margin: 0 1.25rem;
}
.credits-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}
.credits h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.credits p {
  margin-top: 0.6rem;
  color: var(--muted);
}
.credit-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.credit-list li {
  display: grid;
  gap: 0.2rem;
}
.credit-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
}
.credit-name a,
.credit-links a {
  color: var(--accent);
}
.credit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}
.credit-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.brand {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}
/* Official brand colours (YouTube red, Twitch purple). */
.brand.yt {
  fill: #ff0000;
}
.brand.tw {
  fill: #9146ff;
}
/* GitHub's mark is monochrome; follow the text colour so it suits both themes. */
.brand.gh {
  fill: currentColor;
}
.credits-note {
  font-size: 0.8rem;
  padding-top: 0.8rem;
  margin-bottom: 1.1rem;
  border-top: 1px solid var(--border);
}
.credits-note a {
  color: var(--accent);
}

/* Language menu (reuses the Display menu's popup styles) */
.lang-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.globe {
  width: 1.05em;
  height: 1.05em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.lang-panel {
  margin: 0;
  gap: 0.15rem;
  padding: 0.4rem;
}
.lang-panel button {
  border: 0;
  background: none;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.lang-panel button:hover {
  background: var(--hover);
}
.lang-panel button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.sug-alt {
  color: var(--muted);
  font-size: 0.85em;
}

/* Skip links: off-screen until focused (screen readers still reach them), then a bar at the top. */
.skip {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px var(--shadow);
}
.skip:not(:focus-within),
.skip-past:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Help dialog: quick guide, then keyboard shortcuts */
.credits h3 {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.guide {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding-left: 1.4rem;
}
#help-readme {
  color: var(--accent);
}
.keys {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1rem;
  margin-top: 0.6rem;
}
.keys dt {
  text-align: right;
}
.keys dd {
  margin: 0;
}
.keys kbd {
  padding: 0.1rem 0.4rem;
  font: inherit;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 0.3rem;
  background: var(--surface);
}
.keys + p {
  margin-bottom: 1rem;
}
