:root {
  color-scheme: light;
  --page: #f4f3ef;
  --surface: #fcfcfb;
  --surface-2: #f0efeb;
  --surface-3: #e7e5df;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --border-strong: rgba(11, 11, 11, 0.2);
  --zatu: #2a78d6;
  --zatu-soft: #cde2fb;
  --amazon: #eb6834;
  --amazon-soft: #fbdccd;
  --kingdom: #1baf7a;
  --kingdom-soft: #d3f2e6;
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --good: #0ca30c;
  --good-ink: #006300;
  --good-soft: #dff3df;
  --warn: #fab219;
  --warn-ink: #7a5200;
  --warn-soft: #fdf0cf;
  --bad: #d03b3b;
  --bad-soft: #f8dcdc;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --surface-3: #2c2c2a;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --zatu: #3987e5;
    --zatu-soft: #17365c;
    --amazon: #d95926;
    --amazon-soft: #4a2412;
    --kingdom: #199e70;
    --kingdom-soft: #0e3a2a;
    --accent: #3987e5;
    --accent-ink: #86b6ef;
    --good-ink: #0ca30c;
    --good-soft: #10310f;
    --warn-ink: #fab219;
    --warn-soft: #3b2c06;
    --bad-soft: #3d1414;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --surface-3: #2c2c2a;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --zatu: #3987e5;
  --zatu-soft: #17365c;
  --amazon: #d95926;
  --amazon-soft: #4a2412;
  --kingdom: #199e70;
  --kingdom-soft: #0e3a2a;
  --accent: #3987e5;
  --accent-ink: #86b6ef;
  --good-ink: #0ca30c;
  --good-soft: #10310f;
  --warn-ink: #fab219;
  --warn-soft: #3b2c06;
  --bad-soft: #3d1414;
  --shadow: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--accent-ink); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }
button {
  cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px;
  padding: 6px 12px; font-weight: 600; min-height: 32px;
}
button:hover { background: var(--surface-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: var(--surface-2); }
button.icon { width: 32px; padding: 0; }
button.link { border: none; background: none; padding: 0; min-height: 0; color: var(--accent-ink); font-weight: 600; }
button:disabled { opacity: 0.55; cursor: default; }
input, select, textarea {
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); padding: 6px 10px; min-height: 32px;
  min-width: 0;
}
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--accent); }
input[type="range"] { padding: 0; border: none; accent-color: var(--accent); background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap;
}
.chip.subtle { background: transparent; border-color: transparent; }
.chip.ok::before, .chip.off::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.chip.off::before { background: var(--bad); }

/* ----- top bar ----- */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 17px; }
.brand p { color: var(--muted); font-size: 12px; }
.version { font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--zatu-soft); border-radius: 6px; padding: 1px 6px; vertical-align: 2px; }
.logo { width: 30px; height: 30px; }
.logo-box { fill: var(--zatu); }
.logo-tape { stroke: var(--surface); stroke-width: 2; }
.logo-lid { fill: var(--amazon); }
.topbar-status { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.topbar-actions { display: flex; gap: 4px; }

/* ----- layout ----- */
.layout { display: grid; grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); gap: 20px; padding: 20px; align-items: start; max-width: 1640px; margin: 0 auto; }
.catalog { position: sticky; top: 74px; max-height: calc(100vh - 94px); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.planner { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }

/* ----- catalog ----- */
.catalog-tools { display: flex; gap: 8px; }
.catalog-tools input { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.buyable-toggle { font-size: 12.5px !important; font-weight: 600 !important; }
.catalog-tools select { max-width: 190px; }
#sortReverse { flex: none; font-size: 15px; }
#sortReverse[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.game-foot .gap { color: var(--good-ink); }
.bgg-link { font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; margin-left: 6px; white-space: nowrap; }
.bgg-link:hover { color: var(--accent-ink); text-decoration: underline; }
.filters button { font-size: 12px; padding: 3px 10px; min-height: 26px; border-radius: 999px; font-weight: 600; color: var(--ink-2); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.filters .count { opacity: 0.7; font-weight: 500; margin-left: 3px; }
.game-list { overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px 4px 8px 2px; flex: 1; min-height: 200px; }
.game {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; align-items: start;
}
.game.in-plan { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.game.must { box-shadow: inset 3px 0 0 var(--ink); }
.thumb {
  width: 44px; height: 44px; border-radius: 8px; background: var(--surface-2) center / cover no-repeat; display: grid; place-items: center;
  font-weight: 700; color: var(--muted); font-size: 16px; grid-row: span 2;
}
.game-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 650; background: none; border: none; padding: 0; min-height: 0; text-align: left; line-height: 1.25; color: var(--ink); }
.game-title:hover { text-decoration: underline; background: none; }
.offers { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--ink-2); grid-column: 2 / 4; }
.offer-tag { display: inline-flex; align-items: center; gap: 5px; }
.offer-tag .dot, .store-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.zatu, .store-dot.zatu { background: var(--zatu); }
.dot.amazon, .store-dot.amazon { background: var(--amazon); }
.dot.kingdom, .store-dot.kingdom { background: var(--kingdom); }
.offer-tag.dead { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--axis); }
.offer-tag.best { color: var(--ink); font-weight: 600; }
.game-foot { grid-column: 2 / 4; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.tri { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.tri button { border: none; border-radius: 0; min-height: 26px; padding: 2px 9px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface); }
.tri button + button { border-left: 1px solid var(--border); }
.tri button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.tri button[data-sel="must"][aria-pressed="true"] { background: var(--ink); color: var(--surface); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; border-radius: 6px; padding: 2px 7px;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.badge.good { background: var(--good-soft); color: var(--good-ink); }
.badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.plan { background: var(--zatu-soft); color: var(--accent-ink); }
.badge.store-zatu { background: var(--zatu-soft); color: var(--accent-ink); }
.badge.store-amazon { background: var(--amazon-soft); color: var(--ink); }
.badge.store-kingdom { background: var(--kingdom-soft); color: var(--ink); }
.legend-note { font-size: 12px; color: var(--muted); }

.remote { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.remote-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 13px; }
.remote-row img { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; }
.remote-row .grow { flex: 1; min-width: 0; }

/* ----- planner controls ----- */
.controls { display: flex; flex-wrap: wrap; gap: 14px 24px; padding: 14px 16px; align-items: flex-end; }
.control { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.budget-control { flex: 1; min-width: 260px; }
.budget-inputs { display: flex; align-items: center; gap: 10px; }
.budget-inputs input[type="range"] { flex: 1; }
.affix { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); overflow: hidden; }
.affix > span { padding: 0 8px; color: var(--muted); background: var(--surface-2); align-self: stretch; display: grid; place-items: center; }
.affix input { border: none; border-radius: 0; width: 90px; font-weight: 700; font-size: 15px; }
.affix.wide input { width: 110px; font-size: 14px; font-weight: 600; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.stepper button { border: none; border-radius: 0; width: 32px; font-size: 16px; }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; font-size: 15px; color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: none; border-radius: 0; font-size: 12.5px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-checked="true"], .seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.store-toggles { display: flex; gap: 6px; }
.store-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 5px 10px; font-weight: 600; color: var(--ink); cursor: pointer; }
.store-toggle.zatu { box-shadow: inset 3px 0 0 var(--zatu); }
.store-toggle.amazon { box-shadow: inset 3px 0 0 var(--amazon); }
.store-toggle.kingdom { box-shadow: inset 3px 0 0 var(--kingdom); }

/* ----- picks ----- */
.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pick {
  text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; min-height: 0;
  background: var(--surface); border: 1px solid var(--border); font-weight: 400;
}
.pick .pick-name { font-size: 12px; font-weight: 650; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.pick .pick-value { font-size: 18px; font-weight: 700; color: var(--ink); }
.pick .pick-sub { font-size: 12px; color: var(--muted); }
.pick[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.pick:disabled { opacity: 0.5; }

/* ----- charts ----- */
.chart-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-head p { font-size: 12.5px; margin-top: 2px; }
.frontier-host { position: relative; min-width: 0; }
.chart-empty { padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 10px; }
svg text { font-family: inherit; }
.frontier .grid line { stroke: var(--grid); stroke-width: 1; }
.frontier .baseline, .orders-curve .baseline { stroke: var(--axis); stroke-width: 1; }
.frontier .axis-labels text, .orders-curve .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.frontier .axis-title { fill: var(--muted); font-size: 11px; }
.frontier .parity { stroke: var(--axis); stroke-width: 1; }
.frontier .parity-label { fill: var(--muted); font-size: 10.5px; }
.frontier .budget { stroke: var(--ink-2); stroke-width: 1; }
.frontier .budget-label { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.frontier .cloud circle { fill: var(--muted); opacity: 0.28; }
.frontier .frontier-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.frontier .frontier-dots circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.frontier .frontier-dots circle.pick { fill: var(--accent); }
.frontier .frontier-dots circle.selected { fill: var(--ink); stroke: var(--surface); stroke-width: 3; }
.frontier .hits circle { fill: transparent; cursor: pointer; outline: none; }
.frontier .hits circle:focus-visible { stroke: var(--accent); stroke-width: 2; }
.tooltip {
  position: absolute; z-index: 5; width: 236px; pointer-events: none; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14); color: var(--ink);
}
.tooltip span { color: var(--ink-2); }
.tooltip ul { margin: 6px 0 4px; padding-left: 16px; color: var(--ink-2); }
.tooltip em { color: var(--muted); font-style: normal; font-size: 11px; }
.curve-card { padding: 14px 16px; display: grid; grid-template-columns: minmax(200px, 1fr) minmax(240px, 420px); gap: 16px; align-items: center; }
.orders-curve { width: 100%; }
.mini-title { font-size: 12px; font-weight: 650; color: var(--ink-2); margin-bottom: 4px; }
.orders-curve .bar path { fill: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.orders-curve .bar.current path { fill: var(--accent); }
.orders-curve .bar { cursor: pointer; outline: none; }
.orders-curve .bar:hover path, .orders-curve .bar:focus-visible path { fill: var(--accent-ink); }
.orders-curve .hit { fill: transparent; }
.orders-curve .bar-label { fill: var(--ink); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.orders-curve .bar-label.muted { fill: var(--muted); }
.table-view summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.table-view table { margin-top: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; }
td.num, th.num { text-align: right; }
tr.selected-row td { background: var(--zatu-soft); }

/* ----- plan ----- */
.plan { display: flex; flex-direction: column; gap: 14px; }
.plan-head { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.plan-headline { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.plan-headline h2 { font-size: 22px; }
.plan-headline .sub { color: var(--ink-2); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.metric { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.metric span { display: block; font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.metric strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.metric.total { background: var(--ink); color: var(--surface); }
.metric.total span { color: inherit; opacity: 0.75; }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notes { display: flex; flex-direction: column; gap: 6px; }
.note { font-size: 12.5px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); }
.note.warn { background: var(--warn-soft); color: var(--warn-ink); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.good { background: var(--good-soft); color: var(--good-ink); }
.note b { color: inherit; }

.timeline { display: flex; flex-direction: column; gap: 12px; position: relative; }
.order { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
.order-rail { display: flex; flex-direction: column; align-items: center; }
.order-num {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none;
}
.order-num.zatu { background: var(--zatu); }
.order-num.amazon { background: var(--amazon); }
.order-num.kingdom { background: var(--kingdom); }
.order-rail .line { width: 2px; flex: 1; background: var(--grid); margin-top: 4px; }
.order-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.order-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.order-top h3 { font-size: 15px; }
.order-top .when { color: var(--ink-2); font-size: 12.5px; }
.order-total { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; }
.order-items { display: flex; flex-direction: column; gap: 4px; }
.order-item { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.order-item a { color: var(--ink); text-decoration: none; }
.order-item a:hover { text-decoration: underline; }
.order-item .must-tag { font-size: 10.5px; font-weight: 700; color: var(--ink-2); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 4px; margin-left: 6px; }
.breakdown { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--ink-2); }
.breakdown b { color: var(--ink); font-variant-numeric: tabular-nums; }
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.gauge { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.gauge-label { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); }
.gauge-label b { color: var(--ink); }
.gauge-track { height: 8px; border-radius: 4px; background: var(--surface-3); position: relative; overflow: hidden; }
.gauge-fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); }
.gauge-fill.good { background: var(--good); }
.gauge-fill.warn { background: var(--warn); }
.gauge-fill.bad { background: var(--bad); }
.gauge-note { color: var(--muted); }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.order-actions a.button, a.button {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 6px 12px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--border-strong); color: var(--ink); background: var(--surface); min-height: 32px;
}
a.button.zatu { background: var(--zatu); border-color: var(--zatu); color: #fff; }
a.button.amazon { background: var(--amazon); border-color: var(--amazon); color: #fff; }
a.button.kingdom { background: var(--kingdom); border-color: var(--kingdom); color: #fff; }
.offer-card.kingdom { box-shadow: inset 3px 0 0 var(--kingdom); }

.suggestions { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.suggestion { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.suggestion:last-child { border-bottom: none; }
.suggestion .grow { flex: 1; min-width: 0; }

.empty { padding: 28px; text-align: center; color: var(--ink-2); }
.empty h3 { font-size: 16px; margin-bottom: 6px; color: var(--ink); }

/* ----- drawer ----- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.32); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 41;
  display: flex; flex-direction: column; border-left: 1px solid var(--border); box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); gap: 12px; }
.drawer-head h2 { font-size: 17px; }
.drawer-body { overflow: auto; padding: 16px 18px 40px; display: flex; flex-direction: column; gap: 18px; }
.drawer section { display: flex; flex-direction: column; gap: 10px; }
.drawer h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.form-grid label, .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.form-grid .wide { grid-column: 1 / -1; }
.check { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-weight: 500 !important; color: var(--ink) !important; font-size: 13px !important; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.offer-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.offer-card.zatu { box-shadow: inset 3px 0 0 var(--zatu); }
.offer-card.amazon { box-shadow: inset 3px 0 0 var(--amazon); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.detail-hero { display: flex; gap: 12px; align-items: center; }
.detail-hero .thumb { width: 64px; height: 64px; }
.status-line { font-size: 12.5px; color: var(--ink-2); min-height: 18px; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width 0.3s; }
.tier-table input { width: 90px; }
.error-list { font-size: 12px; padding-left: 18px; margin: 0; color: var(--ink-2); max-height: 180px; overflow: auto; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px;
  border-radius: 10px; z-index: 60; font-weight: 600; font-size: 13px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); max-width: calc(100vw - 32px);
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .catalog { position: static; max-height: none; }
  .game-list { max-height: 60vh; }
  .planner { order: -1; }
}
@media (max-width: 760px) {
  .layout { padding: 12px 16px; gap: 14px; }
  .topbar { padding: 10px 16px; }
  .topbar-status { order: 3; flex-basis: 100%; }
  .curve-card { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .order { grid-template-columns: minmax(0, 1fr); }
  .order-rail { flex-direction: row; gap: 8px; }
  .order-rail .line { display: none; }
}
