/* Tool surface: calculators and price board. */

.tool-hero { padding-block: var(--space-7) var(--space-5); }
.tool-hero h1 { margin-bottom: var(--space-3); }
.tool-hero .lede { max-width: 72ch; }

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}
.tool-panel, .result-panel {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: var(--space-5);
}
.result-panel { position: sticky; top: 84px; }
.tool-panel h2, .result-panel h2 { margin: 0 0 var(--space-4); font-size: 1.05rem; }
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; }
  .result-panel { position: static; }
}

.preset-row, .filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.preset, .filter {
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-muted);
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
}
.preset:hover, .filter:hover { border-color: var(--brand); color: var(--brand); }
.filter[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.filter-bar .label { color: var(--text-faint); font-size: var(--text-xs); }

.result-list { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; }
.result-list dt { color: var(--text-muted); font-size: var(--text-sm); }
.result-list dd { margin: 0; text-align: right; color: var(--text-body); font-variant-numeric: tabular-nums; }
.kpi { display: block; color: var(--text-strong); font-size: clamp(1.8rem, 3.2vw, 2.4rem); font-weight: 700; line-height: 1.15; }
.kpi-sub { display: block; margin-top: 2px; color: var(--text-faint); font-size: var(--text-xs); }
.status-ok { color: var(--success); font-weight: 650; }
.status-bad { color: var(--danger); font-weight: 650; }

.note {
  margin-top: var(--space-5);
  padding: 12px 14px;
  border-left: 3px solid var(--brand);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.note > :last-child { margin-bottom: 0; }

.tool-actions { margin-top: var(--space-4); }
.tool-actions .btn { width: 100%; }
@media (min-width: 601px) { .tool-actions .btn { width: auto; } }

.tool-related { margin-top: var(--space-7); }
.tool-related ul { padding-left: 1.2em; }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: var(--space-4) 0; }
.tablewrap table { margin: 0; }
.best { color: var(--brand); font-weight: 650; }
.m-only { display: none; }
@media (max-width: 760px) {
  table { font-size: var(--text-xs); }
  th, td { padding: 7px 8px; }
  .c-kind, .c-note, .c-src, .c-diff { display: none; }
  .m-only { display: block; color: var(--text-faint); font-size: var(--text-xs); margin-top: 2px; }
}

.mine-form { display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr 0.8fr auto; gap: var(--space-3); align-items: end; }
.mine-form .field { margin: 0; }
@media (max-width: 760px) {
  .mine-form { grid-template-columns: 1fr 1fr; }
  .mine-form .field:nth-child(3) { grid-column: 1; }
  .mine-form .btn { grid-column: 1 / -1; }
}

/* ── legacy kit markup compatibility ────────────────────────
   Existing kit/capacity|bitrate|hdd-prices pages still use
   calc/panel/results/presets. Restyle them here while the
   shell and tokens are new. */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; margin-top: var(--space-5); }
.panel { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); padding: var(--space-5); }
.panel h2 { margin: 0 0 var(--space-4); font-size: 1.05rem; }
.results { position: sticky; top: 84px; }
.fieldrow { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.presets { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: 6px; }
.presets button { min-height: 36px; padding: 5px 12px; border: 1px solid var(--border-control); border-radius: var(--radius-pill); background: var(--bg-surface); color: var(--text-muted); font: inherit; font-size: var(--text-xs); cursor: pointer; }
.presets button:hover { border-color: var(--brand); color: var(--brand); }
.results dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.results dt { color: var(--text-muted); font-size: var(--text-sm); }
.results dd { margin: 0; text-align: right; color: var(--text-body); font-variant-numeric: tabular-nums; }
.results .big { display: block; color: var(--text-strong); font-size: clamp(1.8rem, 3.2vw, 2.4rem); font-weight: 700; line-height: 1.15; }
.results .sub { display: block; margin-top: 2px; color: var(--text-faint); font-size: var(--text-xs); }
.results .ok { color: var(--success); font-weight: 650; }
.results .bad { color: var(--danger); font-weight: 650; }
.notice { margin-top: var(--space-5); padding: 12px 14px; border-left: 3px solid var(--brand); background: var(--bg-subtle); color: var(--text-muted); font-size: var(--text-sm); }
.notice > :last-child { margin-bottom: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-4); color: var(--text-faint); font-size: var(--text-sm); }
.crumbs a { color: var(--text-muted); }
.crumbs .sep { color: var(--border-control); }
.filterbar { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: var(--space-4) 0 6px; }
.filterbar .lab { color: var(--text-faint); font-size: var(--text-xs); }
.filterbar button { min-height: 36px; padding: 5px 12px; border: 1px solid var(--border-control); border-radius: var(--radius-pill); background: var(--bg-surface); color: var(--text-muted); font: inherit; font-size: var(--text-xs); cursor: pointer; }
.filterbar button:hover { border-color: var(--brand); color: var(--brand); }
.filterbar button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.mine { margin-top: var(--space-7); }
.mine form { display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr 0.8fr auto; gap: var(--space-3); align-items: end; }
.mine .field { margin: 0; }
button.primary { min-height: 44px; padding: 10px 20px; border: 1px solid var(--brand); border-radius: 10px; background: var(--brand); color: #fff; font: inherit; font-size: var(--text-sm); font-weight: 650; cursor: pointer; }
@media (prefers-color-scheme: dark) { button.primary { color: #080a0f; } }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); background: transparent; color: var(--text-muted); font: inherit; font-size: var(--text-xs); cursor: pointer; }
td.num, th.num, td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
.kit-hero { padding-block: var(--space-7) var(--space-5); }
.kit-hero h1 { margin-bottom: var(--space-3); }
.kit-lede { max-width: 72ch; color: var(--text-muted); font-size: var(--text-lg); line-height: 1.65; }
.updated { color: var(--text-faint); font-size: var(--text-sm); }
@media (max-width: 900px) { .calc { grid-template-columns: 1fr; } .results { position: static; } }
@media (max-width: 600px) { .fieldrow { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .mine form { grid-template-columns: 1fr 1fr; } .mine form button { grid-column: 1 / -1; } }

/* Tool pages keep the old main.container wrapper; give it page rhythm. */
main.container { padding-top: var(--space-6); padding-bottom: var(--space-8); }
