@font-face {
  font-family: "Instrument Sans";
  src: url("assets/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono-semibold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #101214;
  --rail: #131517;
  --surface: #181a1d;
  --surface-deep: #141619;
  --surface-high: #202225;
  --border: #2b2e31;
  --border-soft: #25282b;
  --text: #ebebea;
  --muted: #a4a7ab;
  --dim: #81868c;
  --orange: #f38a49;
  --orange-hot: #ff9c61;
  --orange-soft: #2c231e;
  --green: #8ccbb0;
  --cyan: #83adbf;
  --red: #e58b86;
  --rail-width: 198px;
  --top-height: 62px;
  --radius: 8px;
  --sans: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  font-family: var(--sans);
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100dvh; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { color: #1b1009; background: var(--orange); }
:focus-visible { outline: 2px solid var(--orange-hot); outline-offset: 3px; }
svg { display: block; width: 20px; height: 20px; }
h1, h2, h3, p { margin: 0; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 30; top: 12px; left: 12px; padding: 10px 14px; color: var(--bg); background: var(--orange); }

.topbar {
  height: var(--top-height);
  display: flex;
  align-items: center;
  padding: 0 25px;
  gap: 22px;
  background: #151719;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wordmark > span { font-size: 18px; font-weight: 800; letter-spacing: .045em; line-height: 1; }
.brand-tail { color: #d2d3d3; }
.topbar-location { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.topbar-slash { color: #545960; font-family: var(--mono); }
.topbar-end { display: flex; gap: 9px; align-items: center; margin-left: auto; }
.save-indicator { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 12px var(--mono); margin-right: 10px; white-space: nowrap; }
.save-indicator i, .match-status i { width: 6px; height: 6px; flex-shrink: 0; background: var(--green); border-radius: 50%; }
.save-indicator.problem i { background: var(--red); }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; background: #1c1e21; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
.icon-button:hover { background: #272a2e; color: var(--text); }
.icon-button svg { width: 17px; height: 17px; }

.shell { display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); min-height: calc(100dvh - var(--top-height)); }
.sidebar { position: sticky; top: var(--top-height); height: calc(100dvh - var(--top-height)); display: flex; flex-direction: column; background: var(--rail); border-right: 1px solid var(--border-soft); padding: 21px 13px 14px; }
.nav { display: grid; gap: 5px; }
.nav-item { display: flex; min-height: 44px; align-items: center; gap: 11px; padding: 0 11px; color: var(--muted); border: 1px solid transparent; border-radius: 5px; font-size: 14px; font-weight: 550; white-space: nowrap; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: var(--text); background: #1d2023; }
.nav-item.active { color: var(--orange-hot); background: #28201c; border-color: #382b23; }
.nav-alert { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.sidebar-bottom { margin-top: auto; padding: 10px 9px 0; }
.sidebar-rank { display: flex; align-items: center; gap: 9px; }
.rank-emblem { display: grid; place-items: center; color: #aaa8a1; height: 34px; width: 34px; flex-shrink: 0; border: 1px solid #343536; border-radius: 5px; background: #202122; }
.rank-emblem svg { width: 18px; height: 18px; }
.sidebar-rank-info span, .sidebar-rank-info strong { display: block; }
.sidebar-rank-info span { color: var(--dim); font-size: 12px; margin-bottom: 2px; }
.sidebar-rank-info strong { font-size: 14px; }
.rank-track, .progress-track { height: 4px; overflow: hidden; border-radius: 3px; background: #303236; }
.rank-track { margin: 13px 0 16px; }
.rank-track i, .progress-track i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--orange); transition: width .2s ease-out; }
.help-button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 13px 0 3px; border: 0; border-top: 1px solid var(--border-soft); background: transparent; color: var(--muted); text-align: left; font-size: 14px; }
.help-button:hover { color: var(--text); }
.help-button svg { width: 17px; height: 17px; }

.main { min-width: 0; outline: none; }
.content { width: min(100%, 1510px); padding: 29px clamp(20px, 2.65vw, 44px) 40px; margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.page-heading h1 { font-size: clamp(30px, 3vw, 40px); letter-spacing: -.048em; font-weight: 730; line-height: 1.04; }
.page-heading p { margin-top: 7px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.season-link { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 8px 12px 8px 8px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-deep); }
.season-link:hover { border-color: #69472e; }
.season-link small, .season-link strong { display: block; }
.season-link small { color: var(--dim); font-size: 12px; }
.season-link strong { font-size: 14px; margin-top: 2px; }
.season-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--orange); background: #30251e; border-radius: 5px; }
.season-icon svg { width: 17px; height: 17px; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.metric { min-width: 0; min-height: 77px; display: flex; align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.metric > div { min-width: 0; }
.metric-label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 3px; }
.metric strong { font-family: var(--mono); font-size: clamp(19px, 2vw, 25px); font-weight: 600; letter-spacing: -.07em; line-height: 1.15; white-space: nowrap; }
.metric .unit { font-size: .58em; color: var(--dim); padding-left: 4px; letter-spacing: 0; }
.metric-icon { display: grid; place-items: center; width: 39px; height: 39px; flex: none; border: 1px solid #363839; border-radius: 6px; }
.metric-icon svg { width: 19px; height: 19px; }
.credits-icon { background: #2b231e; border-color: #423126; color: var(--orange); }
.income-icon { background: #202922; border-color: #2e3b33; color: var(--green); }
.round-icon { background: #20282e; border-color: #2d3a43; color: #9ab8ca; }
.metric-aside { margin-left: auto; align-self: flex-end; color: var(--dim); font: 12px var(--mono); white-space: nowrap; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.82fr) minmax(285px, 1fr); gap: 15px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 55px; padding: 12px 15px; gap: 12px; }
.panel-title { display: flex; align-items: center; gap: 9px; }
.panel-title h2 { color: var(--text); font-size: 16px; font-weight: 680; white-space: nowrap; }
.section-icon { color: #9b9fa4; }
.section-icon svg { width: 17px; height: 17px; }
.text-link { flex: none; color: #e69a70; font-size: 13px; font-weight: 600; }
.text-link:hover { color: var(--orange-hot); text-decoration: underline; text-underline-offset: 3px; }
.panel-heading-meta { color: var(--dim); font: 12px var(--mono); text-align: right; }
.match-status { display: flex; align-items: center; gap: 8px; color: #b2c6bb; font: 12px var(--mono); white-space: nowrap; }
.match-status[data-state="win"] { color: var(--green); }
.match-status[data-state="playing"] { color: #edb493; }
.match-status[data-state="playing"] i { background: var(--orange); }
.match-status[data-state="loss"] { color: var(--red); }
.match-status[data-state="loss"] i { background: var(--red); }
.radar-frame { isolation: isolate; position: relative; height: clamp(220px, 25vw, 356px); margin: 0 12px; border: 1px solid #323637; border-radius: 6px; overflow: hidden; background: #14181a; }
.radar-frame canvas { display: block; width: 100%; height: 100%; }
.radar-caption, .radar-legend, .radar-coordinate { position: absolute; pointer-events: none; }
.radar-caption { top: 14px; left: 14px; display: grid; gap: 4px; padding: 7px 9px; border-left: 2px solid #c17147; background: #101517db; }
.radar-caption span { color: #a8b1b4; font: 10px var(--mono); letter-spacing: .13em; }
.radar-caption strong { font-size: 15px; line-height: 1.2; color: #e5e9e8; }
.radar-map-button { position: absolute; top: 13px; right: 13px; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 4px; border: 1px solid #424a4f; background: #181d20eb; color: #aebbc3; }
.radar-map-button:hover { color: var(--orange-hot); border-color: #845a41; }
.radar-map-button svg { width: 17px; height: 17px; }
.radar-legend { bottom: 13px; left: 14px; display: flex; gap: 12px; padding: 5px 6px; color: #bdc6c8; background: #14181ce0; font: 10px var(--mono); }
.radar-legend span { display: flex; align-items: center; gap: 5px; }
.radar-legend i { display: block; width: 6px; height: 6px; border-radius: 50%; background: #79bcc5; }
.radar-legend span + span i { background: #ea8d52; border-radius: 1px; transform: rotate(45deg); }
.radar-coordinate { bottom: 14px; right: 15px; color: #8d9aa0; font: 12px var(--mono); }
.radar-coordinate span { color: #ca9a7f; }
.match-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 14px; }
.match-meta { display: flex; align-items: center; gap: 10px; }
.score { display: flex; align-items: center; gap: 5px; flex: none; padding: 7px 8px; border-radius: 5px; border: 1px solid #35383b; background: #131618; font: 15px var(--mono); line-height: 1.05; }
.score strong:first-child { color: #a1bfce; }
.score strong:last-child { color: #e3a789; }
.score span { color: #70777d; }
.match-round { display: grid; gap: 2px; min-width: 0; }
.match-round strong { font-size: 13px; white-space: nowrap; }
.match-round span { color: var(--dim); font: 11px var(--mono); white-space: nowrap; }
.round-bank { display: grid; grid-template-columns: auto auto; gap: 6px 9px; align-items: center; margin-left: auto; padding-right: 4px; color: var(--muted); font: 11px var(--mono); }
.round-bank span, .round-bank strong { white-space: nowrap; }
.round-bank strong { color: #e0b79b; font-weight: 500; }
.tactics, .segmented { display: flex; flex-shrink: 0; padding: 3px; border: 1px solid #34373b; border-radius: 6px; background: #141618; }
.tactics button, .segmented button { min-height: 29px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); padding: 0 9px; white-space: nowrap; font-size: 13px; }
.tactics button:hover, .segmented button:hover { color: var(--text); }
.tactics button[aria-pressed="true"], .segmented button[aria-pressed="true"] { background: #303236; color: #f1efed; }
.round-action { display: flex; align-items: center; gap: 15px; border-top: 1px solid var(--border-soft); padding: 12px 14px; }
.primary-button { min-height: 44px; padding: 0 12px; border: 1px solid #f9985e; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: #24150c; background: var(--orange); font-size: 15px; font-weight: 750; }
.primary-button:hover:not(:disabled) { background: var(--orange-hot); }
.primary-button:active:not(:disabled) { background: #e7793d; }
.primary-button:disabled { opacity: .71; }
.primary-button svg { width: 16px; height: 16px; }
.round-action .primary-button { flex: 1; justify-content: flex-start; }
.primary-button kbd { margin-left: auto; padding: 3px 6px; border: 1px solid #bd692f; border-radius: 3px; color: #482714; background: #db7437; font: 11px var(--mono); }
.round-reward { text-align: right; min-width: 94px; }
.round-reward small, .round-reward strong { display: block; white-space: nowrap; }
.round-reward small { color: var(--muted); font-size: 12px; }
.round-reward strong { margin-top: 2px; color: var(--green); font: 600 16px var(--mono); }

.operations-panel .panel-heading { border-bottom: 1px solid var(--border-soft); }
.ops-caption { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px 4px; color: var(--dim); font: 11px var(--mono); }
.ops-caption span:first-child { text-transform: uppercase; letter-spacing: .075em; }
.unit-list { display: grid; padding: 0 14px; }
.unit-row { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 70px; border-bottom: 1px solid var(--border-soft); padding: 9px 0; }
.unit-row:last-child { border-bottom: 0; }
.unit-icon, .item-icon { display: grid; place-items: center; flex-shrink: 0; border: 1px solid #38393b; border-radius: 5px; height: 38px; width: 38px; background: #232426; color: #c6aea0; }
.unit-icon svg, .item-icon svg { width: 18px; height: 18px; }
.unit-row.locked .unit-icon { color: #8a8d90; background: #202224; border-color: #323537; }
.unit-title { display: flex; align-items: center; gap: 6px; }
.unit-title h3 { font-size: 14px; line-height: 1.2; font-weight: 650; }
.unit-owned { padding: 1px 4px; border-radius: 3px; color: #b0b3b7; background: #2a2d30; font: 10px var(--mono); }
.unit-detail { font-size: 12px; margin-top: 4px; color: var(--muted); line-height: 1.3; }
.unit-detail strong { font-weight: 500; color: var(--green); }
.buy-button, .subtle-button { display: inline-flex; gap: 6px; justify-content: center; align-items: center; min-height: 34px; padding: 0 9px; border-radius: 5px; border: 1px solid #63442f; background: #2b211b; color: #ffa570; white-space: nowrap; font: 600 12px var(--mono); }
.buy-button:hover:not(:disabled), .subtle-button:hover:not(:disabled) { background: #39281f; border-color: #a26946; }
.buy-button:disabled, .subtle-button:disabled { border-color: #33373a; background: #202225; color: #a0a2a5; }
.buy-button svg, .subtle-button svg { width: 13px; height: 13px; }
.buy-button { min-width: 68px; }
.panel-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); border-top: 1px solid var(--border-soft); background: #16181a; border-radius: 0 0 7px 7px; padding: 12px 14px; margin-top: 4px; font-size: 13px; line-height: 1.45; }
.panel-note svg { width: 15px; height: 15px; margin-top: 2px; color: var(--dim); }

.events { display: grid; margin: 0; padding: 0 15px 4px; list-style: none; }
.event { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 7px 0; border-top: 1px solid var(--border-soft); }
.event-icon { display: grid; place-items: center; flex: none; width: 28px; height: 28px; background: #26282b; border-radius: 5px; color: var(--muted); }
.event-icon svg { width: 15px; height: 15px; }
.event-icon.win, .event-icon.contract, .event-icon.offline, .event-icon.match { background: #24312b; color: var(--green); }
.event-icon.loss { background: #302627; color: var(--red); }
.event-icon.purchase, .event-icon.research, .event-icon.season, .event-icon.doctrine, .event-icon.milestone { background: #30271f; color: var(--orange); }
.event-copy { min-width: 0; display: grid; gap: 2px; }
.event-copy strong { font-size: 13px; }
.event-copy span { color: var(--muted); font-size: 12px; line-height: 1.3; }
.event time { flex: none; margin-left: auto; color: var(--dim); font: 11px var(--mono); }
.briefing-body { padding: 3px 15px 15px; }
.briefing-body h3 { font-size: 15px; margin-bottom: 4px; }
.briefing-body p { color: var(--muted); font-size: 13px; line-height: 1.45; }
.briefing-body .progress-track { margin-top: 13px; }
.briefing-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; color: var(--muted); font: 12px var(--mono); }
.contract-reward { color: var(--green); }

.catalogue-panel .panel-heading { border-bottom: 1px solid var(--border-soft); }
.catalogue-panel .unit-list { padding: 0 17px 4px; }
.catalogue-panel .unit-row { grid-template-columns: 40px minmax(0, 1fr) minmax(104px, auto); min-height: 75px; }
.catalogue-panel .unit-title h3 { font-size: 15px; }
.catalogue-panel .unit-detail { font-size: 13px; }
.catalogue-panel .unit-detail span + strong::before { content: " · "; color: var(--dim); }
.new-milestone { display: inline-block; color: #e6a47f; font: 11px var(--mono); white-space: nowrap; margin-top: 4px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin: 0; padding: 14px; }
.data-card { display: flex; flex-direction: column; min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-deep); }
.data-card.active { border-color: #725037; }
.data-card h3 { font-size: 15px; margin: 10px 0 4px; }
.data-card p { font-size: 13px; line-height: 1.5; color: var(--muted); }
.data-card .progress-track { margin-top: 12px; }
.data-card .card-meta { font: 11px/1.5 var(--mono); margin-top: 8px; color: var(--dim); }
.card-end { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding-top: 12px; margin-top: auto; }
.card-end .buy-button { margin-left: auto; }
.card-state, .intel-label { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font: 12px var(--mono); }
.intel-label svg { width: 15px; height: 15px; color: var(--orange); }
.card-state.owned { color: var(--green); }
.circuit-season { margin-bottom: 15px; }
.circuit-subhead { padding: 12px 15px 0; border-top: 1px solid var(--border-soft); }
.circuit-subhead h3 { font-size: 15px; }
.circuit-subhead p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.circuit-subhead + .events { margin-top: 12px; }
.season-body { padding: 15px; }
.season-text { color: var(--muted); font-size: 14px; line-height: 1.5; margin-bottom: 13px; }
.season-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.season-stat { padding: 11px; border-radius: 5px; border: 1px solid var(--border-soft); background: var(--surface-deep); }
.season-stat small, .season-stat strong { display: block; }
.season-stat small { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.season-stat strong { font: 600 17px var(--mono); }
.season-requirement { display: flex; align-items: center; gap: 10px; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 10px; }

.dialog { width: min(100% - 28px, 490px); max-height: calc(100% - 28px); padding: 0; background: #1a1c1f; color: var(--text); border: 1px solid #43474b; border-radius: 8px; box-shadow: 0 18px 85px #000a; }
.dialog::backdrop { background: #07090ac2; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.dialog-heading h2 { font-size: 19px; }
.dialog-body { padding: 15px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.dialog-body p + p { margin-top: 9px; }
.dialog-body ul { margin: 0; padding-left: 20px; }
.dialog-body li + li { margin-top: 7px; }
.dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.dialog-actions .subtle-button { min-height: 38px; }
.dialog .card-grid { padding: 0; grid-template-columns: 1fr; gap: 8px; }
.dialog .data-card h3 { margin-top: 0; }
.dialog .data-card .item-icon { display: none; }
.dialog .data-card .card-end { padding-top: 7px; }
.toast-stack { position: fixed; display: grid; gap: 7px; z-index: 9; right: 17px; bottom: 17px; width: min(320px, calc(100vw - 34px)); pointer-events: none; }
.toast { padding: 11px 13px; border-radius: 6px; border: 1px solid #434649; border-left: 3px solid var(--orange); background: #242629; box-shadow: 0 5px 14px #0008; color: var(--text); font-size: 13px; line-height: 1.4; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }

@media (min-width: 1061px) {
  .overview-grid { grid-template-areas: "match operations" "activity briefing"; }
  .match-panel { grid-area: match; }
  .operations-panel { grid-area: operations; align-self: stretch; display: flex; flex-direction: column; }
  .operations-panel .panel-note { margin-top: auto; }
  .activity-panel { grid-area: activity; }
  .briefing-panel { grid-area: briefing; }
}

@media (max-width: 1180px) {
  :root { --rail-width: 172px; }
  .metric-aside { display: none; }
}

@media (max-width: 1060px) {
  :root { --rail-width: 66px; }
  .sidebar { padding-inline: 8px; }
  .nav-item { justify-content: center; padding: 0 8px; position: relative; }
  .nav-item > span + span, .sidebar-rank-info, .help-button { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .help-button { position: static; width: 100%; height: 35px; clip-path: none; font-size: 0; padding: 10px 0 0; justify-content: center; }
  .sidebar-bottom { padding: 0 6px; }
  .sidebar-rank { justify-content: center; }
  .nav-alert { position: absolute; top: 6px; right: 7px; }
}

@media (min-width: 781px) and (max-width: 1240px) {
  .round-bank { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 780px) {
  :root { --top-height: 55px; }
  .topbar { padding: 0 16px; }
  .shell { display: block; }
  .sidebar { position: sticky; top: var(--top-height); z-index: 4; height: auto; padding: 5px 12px; border-right: none; border-bottom: 1px solid var(--border); }
  .nav { display: flex; gap: 4px; justify-content: space-between; }
  .nav-item { flex: 1; min-height: 37px; padding: 0 6px; gap: 6px; }
  .nav-item > span + span { position: static; height: auto; width: auto; overflow: visible; clip-path: none; }
  .nav-item svg { width: 16px; height: 16px; }
  .sidebar-bottom { display: none; }
  .content { padding: 19px 15px 30px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .radar-frame { height: clamp(222px, 51vw, 360px); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 475px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar-location { display: none; }
  .topbar-end { gap: 6px; }
  .wordmark { gap: 7px; }
  .wordmark > span { font-size: 16px; }
  .wordmark img { width: 27px; height: 27px; }
  .save-indicator { margin-right: 4px; font-size: 10px; }
  .topbar .icon-button { width: 32px; height: 32px; }
  .sidebar { padding-inline: 6px; }
  .nav { gap: 3px; }
  .nav-item { flex-direction: column; gap: 4px; min-height: 46px; padding: 4px 1px; font-size: 10px; }
  .content { padding: 16px 9px 24px; }
  .page-heading { gap: 6px; margin-bottom: 14px; }
  .page-heading h1 { font-size: 28px; }
  .page-heading p { font-size: 12px; margin-top: 4px; max-width: 230px; }
  .season-link { gap: 6px; padding: 6px; }
  .season-icon { width: 25px; height: 27px; }
  .season-icon svg { width: 13px; }
  .season-link small { font-size: 10px; }
  .season-link strong { font-size: 11px; }
  .metrics { gap: 5px; margin-bottom: 8px; }
  .metric { gap: 5px; padding: 6px 5px; min-height: 57px; }
  .metric-icon { width: 22px; height: 24px; border-radius: 4px; }
  .metric-icon svg { width: 13px; height: 13px; }
  .metric-label { font-size: 10px; line-height: 1.12; min-height: 1em; }
  .metric strong { font-size: 16px; }
  .overview-grid { gap: 8px; }
  .panel-heading { min-height: 45px; padding: 9px 10px; }
  .radar-frame { margin-inline: 7px; }
  .radar-caption { left: 8px; top: 8px; }
  .radar-coordinate, .radar-map-button { right: 8px; }
  .radar-map-button { top: 8px; }
  .radar-legend { left: 8px; bottom: 7px; }
  .match-controls { padding: 9px 8px; gap: 6px; }
  .match-controls:has(.round-bank:not([hidden])) { display: grid; grid-template-columns: 1fr auto; }
  .round-bank { grid-row: 2; grid-column: 1 / -1; justify-self: start; margin: 0; }
  .match-meta { gap: 5px; }
  .score { padding: 6px 4px; gap: 3px; font-size: 13px; }
  .match-round strong { font-size: 11px; }
  .match-round span { font-size: 9px; }
  .tactics button { min-height: 28px; padding: 0 5px; font-size: 11px; }
  .round-action { padding: 8px; }
  .round-action kbd { display: none; }
  .card-grid { grid-template-columns: minmax(0, 1fr); padding: 8px; }
  .season-stat strong { font-size: 14px; }
}

@media (max-width: 350px) {
  .metric-icon { display: none; }
  .score { font-size: 11px; }
  .catalogue-panel .panel-heading { flex-wrap: wrap; }
  .catalogue-panel .panel-title h2 { white-space: normal; }
  .catalogue-panel .unit-list { padding-inline: 9px; }
  .catalogue-panel .unit-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .catalogue-panel .unit-icon { width: 32px; height: 32px; }
}

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