@font-face {
  font-family: Inter;
  src: url("../assets/inter.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  background: #101522;
  color: #f4f5fa;
  font-size: 15px;
  --bg: #101522;
  --panel: #181f30;
  --panel-soft: #1c2538;
  --line: #303b52;
  --line-soft: #293348;
  --text: #f4f5fa;
  --muted: #adbad0;
  --quiet: #939fb6;
  --gold: #ffd063;
  --dark-gold: #251b0a;
  --good: #a8e7a9;
  --danger: #ffb2b4;
  --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #ffe29b; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
p, h1, h2, h3, ol { margin: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.muted, .footnote { color: var(--muted); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.topbar { background: #141b2a; border-bottom: 1px solid var(--line-soft); }
.top-inner {
  width: min(100% - 64px, 1392px);
  margin: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 70px;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-size: .98rem;
  font-weight: 750;
  letter-spacing: -.025em;
  white-space: nowrap;
}
.brand strong { color: var(--muted); font-weight: 550; margin-left: 3px; }
.navigation { display: flex; align-items: stretch; gap: 4px; }
.nav-button {
  border: 0;
  border-radius: 9px;
  padding: 10px 15px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  font-weight: 650;
}
.nav-button.selected { color: var(--text); background: #232d42; }
.nav-button:hover { color: var(--text); background: #253047; }
.header-share { justify-self: end; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  min-height: 40px;
  padding: 8px 14px;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 720;
  font-size: .89rem;
  line-height: 1.25;
}
.button-primary { background: var(--gold); color: var(--dark-gold); border-color: var(--gold); }
.button-primary:hover { background: #ffe095; border-color: #ffe095; }
.button-secondary { background: #212b40; color: var(--text); border-color: #39475e; }
.button-secondary:hover { background: #2a3650; }
.button-danger { background: #502b39; color: #ffe4e4; border-color: #975262; }
.button-danger:hover { background: #633449; }
.button-compact { min-height: 36px; padding: 7px 12px; font-size: .84rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

.shell { width: min(100% - 64px, 1392px); margin: 0 auto; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 0 23px;
}
.eyebrow {
  color: var(--gold);
  font-size: .74rem;
  font-weight: 720;
  text-transform: uppercase;
  letter-spacing: .105em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow-divider { color: #8c7446; padding: 0 3px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--gold); }
h1 {
  font-size: clamp(2.45rem, 5vw, 4.15rem);
  font-weight: 800;
  letter-spacing: -.057em;
  line-height: 1.08;
  margin: 7px 0;
}
.page-subtitle { color: var(--muted); font-size: 1.02rem; margin-top: 10px; line-height: 1.5; }
.queue-control legend { padding: 0 0 7px 2px; color: var(--muted); font-weight: 620; font-size: .77rem; }
.segmented { display: flex; gap: 3px; background: #191f30; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 6px 14px;
  font-size: .83rem;
  font-weight: 700;
}
.segmented button[aria-pressed="true"] { background: #344158; color: var(--text); }
.segmented button:hover { color: var(--text); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 335px; gap: 16px; align-items: stretch; }
.map-card { overflow: hidden; }
.map-bar {
  min-height: 52px;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.map-bar-title { font-weight: 720; padding-left: 2px; }
.small-control {
  min-height: 31px;
  border: 1px solid var(--line);
  background: #202a3e;
  border-radius: 7px;
  color: var(--muted);
  font-size: .77rem;
  font-weight: 650;
  padding: 4px 9px;
}
.small-control:hover, .small-control[aria-pressed="true"] { color: var(--text); border-color: #698098; }
.map-stage {
  position: relative;
  isolation: isolate;
  height: clamp(410px, 44vw, 606px);
  border-block: 1px solid #264761;
  background: #185a8a;
  overflow: hidden;
}
#island-map {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
#island-map:focus-visible { outline-offset: -3px; }
#island-map.grabbing { cursor: grabbing; }
.map-compass {
  position: absolute;
  inset: 13px 15px auto auto;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 31px;
  padding: 6px 8px;
  border: 1px solid #5d89a3;
  background: #12243ad9;
  color: #f5f8ff;
  border-radius: 8px;
  font-size: .7rem;
  font-weight: 800;
  pointer-events: none;
}
.map-compass span { color: var(--gold); font-size: .75rem; }
.map-controls {
  display: flex;
  flex-direction: column;
  position: absolute;
  right: 13px;
  bottom: 13px;
  overflow: hidden;
  background: #16243ae8;
  border: 1px solid #6c95ac;
  border-radius: 10px;
}
.map-controls button {
  width: 41px;
  height: 35px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: .78rem;
}
.map-controls button:first-child, .map-controls button:nth-child(2) { font-size: 1.35rem; }
.map-controls button + button { border-top: 1px solid #4a6780; }
.map-controls button:hover { background: #304560; }
.map-controls button:focus-visible { outline-offset: -3px; }
.map-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  padding: 7px 15px;
  gap: 6px 14px;
  color: var(--muted);
  font-size: .73rem;
}
#chest-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 16px; }
#chest-filters label { display: inline-flex; align-items: center; gap: 5px; min-height: 29px; cursor: pointer; }
#chest-filters input { margin: 0 2px 0 0; accent-color: var(--gold); }
.chest-dot { width: 7px; height: 7px; border-radius: 100%; display: inline-block; }
.chest-dot.regular { background: #fff4da; }
.chest-dot.rare { background: #edb0ff; }
.chest-dot.buried { background: #ffa16e; }
.layer-count { color: var(--quiet); font-variant-numeric: tabular-nums; }
.legend-note { white-space: nowrap; margin-left: auto; }

.route-card {
  --lane-color: var(--gold);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.route-top { padding: 19px 17px 12px; }
.route-top h2, .section-card h2, .match-history h2, .match-detail h2, .welcome h2, dialog h2 {
  font-size: 1.22rem;
  font-weight: 760;
  letter-spacing: -.035em;
}
.route-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 14px 0 18px; }
.route-chip {
  --chip-color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-height: 37px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #374157;
  background: #1d263a;
  color: var(--text);
  font-size: .79rem;
  font-weight: 650;
}
.route-chip[aria-pressed="true"] { border-color: var(--chip-color); background: #263043; }
.route-chip .lane-id, .stop-id {
  display: inline-grid;
  place-content: center;
  flex: 0 0 21px;
  border-radius: 6px;
  width: 21px;
  height: 21px;
  color: #141421;
  background: var(--chip-color);
  font-weight: 800;
  font-size: .73rem;
}
.route-meta { display: flex; flex-wrap: wrap; flex-direction: column; gap: 5px; }
.route-meta h3 { font-size: 1.1rem; font-weight: 750; color: var(--lane-color); letter-spacing: -.025em; }
.route-meta span { font-size: .77rem; color: var(--muted); line-height: 1.45; }
.stops { list-style: none; padding: 0 12px; display: grid; gap: 4px; }
.stop { min-width: 0; }
.stop button {
  text-align: left;
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 11px 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
}
.stop button:hover { background: #222c41; }
.stop button[aria-current="step"] { background: #222c41; border-color: #424e67; }
.stop-id { --chip-color: var(--lane-color); width: 26px; height: 26px; font-size: .7rem; margin-top: 1px; }
.stop strong { font-size: .9rem; line-height: 1.25; display: block; }
.stop small { display: block; font-size: .77rem; color: var(--muted); line-height: 1.47; margin-top: 4px; }
.alternate {
  margin: 7px 16px 0;
  padding: 9px 10px;
  text-align: left;
  line-height: 1.45;
  color: #adf0ff;
  background: #173147;
  border: 1px dashed #498a9a;
  border-radius: 8px;
  font-size: .77rem;
}
.alternate:hover { background: #204359; }
.route-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line-soft);
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .79rem;
}
.svg-label { pointer-events: none; }
.svg-pin { cursor: pointer; }
.svg-pin:hover .map-pin-ring, .svg-pin:focus-visible .map-pin-ring { stroke: white; stroke-width: 2.5; }
.svg-pin:focus-visible { outline: 0; }
.map-vector { vector-effect: non-scaling-stroke; }

.analysis-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-top: 16px; }
.section-card { padding: 18px; }
.section-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.section-top p { color: var(--muted); margin-top: 6px; font-size: .8rem; line-height: 1.45; }
.count-field { display: grid; gap: 4px; color: var(--muted); font-size: .75rem; }
.text-input {
  width: 100%;
  min-height: 41px;
  border: 1px solid #495671;
  border-radius: 8px;
  background: #111928;
  color: var(--text);
  padding: 9px 10px;
  outline-offset: 1px;
}
.text-input::placeholder { color: #8995ab; }
.number-input { width: 86px; min-height: 35px; padding: 6px 8px; font-variant-numeric: tabular-nums; }
.odds-table { width: 100%; border-collapse: collapse; margin-top: 13px; text-align: left; }
.odds-table th, .odds-table td { padding: 8px 6px 8px 0; border-bottom: 1px solid var(--line-soft); }
.odds-table th { color: var(--muted); font-size: .73rem; font-weight: 630; }
.odds-table td { font-size: .85rem; font-weight: 660; }
.odds-table td:not(:first-child) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.odds-table td:nth-child(3) { color: var(--gold); }
.footnote { color: var(--muted); line-height: 1.52; font-size: .77rem; margin-top: 10px; }
.footnote strong { color: var(--text); }
.pace-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 13px; }
.pace-grid div { display: grid; gap: 4px; background: #20293e; border: 1px solid #36415a; border-radius: 10px; padding: 9px 11px; }
.pace-grid strong { color: var(--gold); font-size: 1.45rem; letter-spacing: -.04em; }
.pace-grid span { color: var(--muted); font-size: .73rem; }
.plan-note { color: var(--text); line-height: 1.6; font-size: .84rem; margin-top: 11px; }
.footer { display: flex; justify-content: space-between; gap: 18px; color: var(--quiet); padding: 22px 0 32px; font-size: .75rem; line-height: 1.55; }
.footer details { max-width: 545px; }
.footer summary { cursor: pointer; color: var(--muted); }
.footer details p { margin-top: 7px; }
.source-links { display: flex; flex-wrap: wrap; gap: 4px 11px; }

.ledger-heading h1 { font-size: clamp(2.4rem, 4.9vw, 3.7rem); }
.ledger-heading { padding-bottom: 24px; }
.welcome { display: grid; grid-template-columns: 1fr 1fr; padding: 24px; gap: 26px; }
.welcome p { color: var(--muted); line-height: 1.6; font-size: .9rem; margin-top: 8px; max-width: 52ch; }
.welcome form { margin-top: 19px; }
.welcome label, dialog label { color: var(--muted); font-size: .8rem; font-weight: 680; display: block; margin-bottom: 5px; }
.welcome-form { display: flex; gap: 9px; max-width: 520px; }
.replay-help { border-left: 1px solid var(--line); padding-left: 24px; }
.text-link, .text-button { color: var(--gold); font-size: .82rem; font-weight: 670; }
.text-link { display: inline-block; margin-top: 10px; }
.text-button { padding: 6px 0; background: none; border: 0; text-align: left; }
.text-button:hover { color: #ffe69f; text-decoration: underline; }
#last-room { margin-top: 9px; }
.room-summary {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) 1fr 1fr 1fr;
  gap: 12px;
  padding: 18px;
  margin-bottom: 15px;
}
.room-summary > div { display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.room-summary > div:not(:first-child) { padding-left: 13px; border-left: 1px solid var(--line-soft); }
.room-summary strong { font-size: 1.8rem; color: var(--text); line-height: 1; font-weight: 760; font-variant-numeric: tabular-nums; }
.room-summary span { color: var(--muted); font-size: .79rem; }
.room-summary h2 { font-size: 1.2rem; letter-spacing: -.035em; overflow-wrap: anywhere; }
.room-summary .sync-label { font-size: .74rem; color: var(--good); }
.room-summary .sync-label.offline { color: var(--danger); }
.room-summary .text-button { font-size: .75rem; width: fit-content; }
.ledger-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; gap: 15px; }
.match-history { padding: 15px; }
.match-history h2 { margin-bottom: 12px; }
#match-list { display: grid; gap: 7px; max-height: 610px; overflow: auto; }
.match-tab {
  background: #1d2639;
  border: 1px solid #38435b;
  border-radius: 8px;
  color: var(--text);
  padding: 8px;
  min-height: 65px;
  width: 100%;
  text-align: left;
  font-size: .82rem;
}
.match-tab[aria-current="true"] { border-color: var(--gold); background: #2a3244; }
.match-tab strong, .match-tab span { display: block; overflow-wrap: anywhere; }
.match-tab span { font-size: .74rem; color: var(--muted); margin-top: 3px; }
.match-detail { padding: 17px; min-width: 0; }
.match-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 12px; margin-bottom: 14px; }
.match-top h2 { overflow-wrap: anywhere; }
.match-top p { margin-top: 5px; font-size: .8rem; color: var(--muted); line-height: 1.5; }
.match-total { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; padding: 9px 12px; margin-bottom: 13px; background: #202a3e; border-radius: 9px; }
.match-total strong { color: var(--gold); font-variant-numeric: tabular-nums; }
.match-total span { color: var(--muted); font-size: .78rem; }
.player-rows { display: grid; gap: 8px; }
.player-row {
  display: grid;
  grid-template-columns: 25px minmax(122px, 1fr) 80px minmax(180px, auto);
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #1b2437;
}
.player-row .slot-label { width: 24px; color: var(--muted); font-size: .74rem; font-weight: 730; text-align: center; }
.player-row label { min-width: 0; }
.player-row .text-input { min-height: 36px; font-size: .8rem; padding: 6px 7px; }
.player-row .button-row { gap: 5px; }
.player-row .button { min-height: 36px; padding: 6px 8px; font-size: .74rem; }
.player-source { grid-column: 2 / -1; font-size: .72rem; color: var(--muted); margin: -3px 0 0; line-height: 1.45; }
.player-source a { color: #baf1ff; }
.player-source .text-button { color: var(--muted); font-size: .72rem; padding: 0; margin-left: 9px; }
.warning-text { color: var(--gold); }
.ledger-odds { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; }
.ledger-odds p { margin-top: 4px; }
.ledger-probabilities { display: flex; gap: 22px; }
.ledger-probabilities div { display: grid; gap: 4px; white-space: nowrap; }
.ledger-probabilities span { color: var(--muted); font-size: .74rem; }
.ledger-probabilities strong { color: var(--gold); font-variant-numeric: tabular-nums; font-size: 1.24rem; }
.banner { margin: 0 0 13px; padding: 11px 13px; color: #ddf5de; border: 1px solid #416252; background: #203a35; border-radius: 9px; line-height: 1.45; font-size: .85rem; }
.banner.error { color: #ffe2e4; border-color: #85515e; background: #3e2837; }
#app-error, noscript .banner { margin-top: 16px; }

dialog {
  width: min(480px, 100% - 32px);
  background: #1b2438;
  color: var(--text);
  border: 1px solid #4b5873;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 18px 80px #05070cc0;
}
dialog::backdrop { background: #070a13be; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 11px; }
.dialog-close { font-size: 1.4rem; color: var(--muted); background: transparent; border: 0; border-radius: 6px; padding: 0 7px; height: 30px; }
.dialog-close:hover { color: var(--text); background: #2b3951; }
dialog p { line-height: 1.55; font-size: .84rem; color: var(--muted); margin: 6px 0 11px; }
dialog .footnote { font-size: .76rem; }
dialog form label:not(:first-child) { margin-top: 9px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.form-error { color: var(--danger); margin-top: 9px; }

@media (max-width: 1100px) {
  .top-inner, .shell { width: calc(100% - 42px); }
  .workspace { grid-template-columns: minmax(0, 1fr) 300px; }
  .route-top { padding-inline: 13px; }
  .map-stage { height: clamp(390px, 52vw, 570px); }
}

@media (max-width: 850px) {
  .workspace, .analysis-grid { grid-template-columns: minmax(0, 1fr); }
  .map-stage { height: clamp(391px, 73vw, 560px); }
  .route-top { padding: 14px; }
  .route-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-block: 10px 12px; }
  .route-bottom { margin-top: 8px; }
  .room-summary { grid-template-columns: minmax(160px, 1fr) repeat(3, minmax(80px, 1fr)); }
  .ledger-grid { grid-template-columns: 165px minmax(0, 1fr); }
  .player-row { grid-template-columns: 22px minmax(0, 1fr) 65px; }
  .player-row .button-row { grid-column: 2 / -1; }
  .ledger-odds { align-items: flex-start; }
}

@media (max-width: 590px) {
  .top-inner, .shell { width: calc(100% - 24px); }
  .top-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 9px 0 7px; }
  .brand { grid-column: 1; grid-row: 1; gap: 8px; font-size: .9rem; }
  .brand img { width: 29px; height: 29px; }
  .header-share { grid-column: 2; grid-row: 1; min-height: 33px; padding: 5px 10px; font-size: .76rem; }
  .navigation { grid-column: 1 / -1; grid-row: 2; gap: 6px; }
  .nav-button { padding: 7px 10px; font-size: .82rem; }
  .page-heading { align-items: flex-start; flex-direction: column; padding: 18px 0 14px; gap: 11px; }
  .page-subtitle { margin-top: 4px; font-size: .89rem; }
  h1 { margin: 5px 0; }
  .queue-control { width: 100%; }
  .queue-control legend { padding-bottom: 4px; }
  .segmented button { flex: 1; padding-inline: 5px; }
  .workspace, .analysis-grid { gap: 11px; }
  .map-bar { min-height: 44px; padding: 6px 9px; }
  .map-stage { height: clamp(326px, 99vw, 465px); }
  .map-legend { flex-wrap: wrap; justify-content: flex-start; padding-block: 5px; padding-inline: 9px; gap: 0 1px; }
  #chest-filters { gap: 0 9px; }
  .legend-note { margin-left: 0; font-size: .65rem; }
  .map-compass, .map-controls { right: 8px; }
  .map-controls { bottom: 8px; }
  .map-controls button { width: 34px; height: 35px; }
  .route-top { padding: 12px; }
  .route-chip { padding: 5px 3px; justify-content: center; gap: 4px; font-size: .72rem; }
  .route-chip .lane-id { width: 17px; height: 17px; flex-basis: 17px; font-size: .66rem; }
  .section-card { padding: 13px; }
  .footer { flex-direction: column; gap: 6px; padding-block: 17px 24px; }
  .welcome { grid-template-columns: minmax(0, 1fr); padding: 13px; gap: 16px; }
  .replay-help { padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); }
  .room-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px; gap: 8px; }
  .room-summary .room-identity { grid-column: 1 / -1; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
  .room-summary > div:not(:first-child) { padding-left: 5px; }
  .room-summary strong { font-size: 1.3rem; }
  .room-summary span { font-size: .68rem; }
  .ledger-grid { grid-template-columns: minmax(0, 1fr); }
  .match-history { padding: 11px; }
  #match-list { grid-auto-flow: column; grid-auto-columns: minmax(133px, 50%); max-height: unset; }
  .match-detail { padding: 11px; }
  .match-top { flex-wrap: wrap; }
  .ledger-odds { flex-direction: column; }
  .ledger-probabilities { gap: 14px; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

.history-actions { align-items: center; }
.history-actions select { width: auto; max-width: 100%; }
.history-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.history-metrics > div { display: grid; gap: 6px; padding: 16px; }
.history-metrics span { font-size: .86rem; font-weight: 700; color: var(--text); }
.history-metrics strong { color: var(--gold); font-size: clamp(1.28rem, 2.8vw, 2.05rem); font-variant-numeric: tabular-nums; }
.history-metrics small { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.history-method { margin: 11px 0 15px; }
.history-panel { padding: 15px; }
.history-panel h2 { font-size: 1.23rem; letter-spacing: -.025em; margin-bottom: 12px; }
.history-line {
  display: grid; grid-template-columns: minmax(178px,1.15fr) minmax(128px,1fr) minmax(86px,.65fr) minmax(102px,.7fr) minmax(140px,1fr);
  align-items: center; gap: 10px; padding: 12px; font-size: .82rem;
}
.history-labels { color: var(--muted); font-weight: 650; font-size: .73rem; }
.history-match { border: 1px solid var(--line-soft); border-radius: 10px; background: #20293c; margin-bottom: 7px; }
.history-match summary { list-style: none; cursor: pointer; }
.history-match summary::-webkit-details-marker { display: none; }
.history-match summary:hover { background: #26324a; border-radius: 9px; }
.history-match summary time { font-weight: 680; }
.history-match summary strong { color: var(--gold); }
.history-rate { color: var(--muted); }
.history-match-detail { padding: 8px 12px 12px; border-top: 1px solid var(--line); }
.history-match-detail ul { padding: 0; margin: 0; display: flex; flex-wrap: wrap; list-style: none; gap: 8px; }
.history-match-detail li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; overflow-wrap: anywhere;
  padding: 6px 9px; border-radius: 7px; background: #171f30; color: var(--muted); font-size: .79rem;
}
.history-match-detail strong { color: var(--text); }
.history-empty { padding: 12px; color: var(--muted); line-height: 1.45; }
#history-more { margin-top: 8px; }
@media (max-width: 850px) {
  .history-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-labels { display: none; }
  .history-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .history-rate { grid-column: 1 / -1; }
}
@media (max-width: 590px) {
  .history-actions .button { min-height: 36px; padding: 5px 9px; font-size: .79rem; }
  .history-actions select { min-height: 36px; padding: 5px; font-size: .79rem; }
  .history-metrics { gap: 8px; }
  .history-metrics > div { padding: 10px; }
  .topbar .navigation { flex-wrap: wrap; }
}
