/* Calculator page. Layout: inputs panel left, results right; stacks below 900px. */
:root { --grid: #e4eaed; --axis: #c3cbd0; }
@media (prefers-color-scheme: dark) { :root { --grid: #222c33; --axis: #35424b; } }

.calc-hero { padding-block: 36px 8px; display: grid; gap: 12px; }
.calc-hero p { color: var(--ink-2); font-size: 1.1rem; max-width: 62ch; }
.calc { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; padding-block: 20px 40px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: grid; gap: 16px; min-width: 0; }
.panel h2 { font-size: 1.3rem; }
.field { display: grid; gap: 5px; }
.field label, .field .lbl { font-size: 0.88rem; font-weight: 600; }
.field .hint { font-size: 0.8rem; color: var(--muted); }
.field input, .field select { font: inherit; font-size: 1rem; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); width: 100%; }
.field input:focus, .field select:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.zip-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.zip-row .btn { padding: 9px 16px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.status { font-size: 0.85rem; color: var(--ink-2); min-height: 1.3em; }
.status.error { color: var(--bad); font-weight: 600; }
details.adv summary { cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--accent); }
details.adv[open] { display: grid; gap: 12px; }
details.adv[open] summary { margin-bottom: 4px; }

.results { display: grid; gap: 16px; min-width: 0; scroll-margin-top: 16px; }
.place { font-size: 0.85rem; color: var(--muted); }
.verdict { display: grid; gap: 4px; border-radius: 12px; padding: 16px 18px; background: var(--sunk); }
.verdict .vl { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 1.45rem; font-weight: 700; }
.verdict .vl::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.verdict.good { background: var(--good-soft); } .verdict.good .vl::before { background: var(--good); }
.verdict.ok { background: var(--accent-soft); } .verdict.ok .vl::before { background: var(--accent); }
.verdict.warn { background: var(--warn-soft); } .verdict.warn .vl::before { background: var(--warn); }
.verdict.bad { background: var(--bad-soft); } .verdict.bad .vl::before { background: var(--bad); }
.verdict p { color: var(--ink-2); font-size: 0.95rem; }

.big { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 16px; }
.big .fig { display: grid; gap: 2px; align-content: start; min-width: 0; }
.big .l { font-size: 0.8rem; color: var(--ink-2); }
.big .v { font-family: var(--body); font-size: 1.5rem; font-weight: 650; line-height: 1.2; }
.big .hero .v { font-size: 2.4rem; letter-spacing: -0.02em; white-space: nowrap; }
.big .s { font-size: 0.78rem; color: var(--muted); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare .fig { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 2px; }
.compare .l { font-size: 0.8rem; color: var(--ink-2); }
.compare .v { font-size: 1.3rem; font-weight: 650; }
.compare .s { font-size: 0.82rem; color: var(--muted); }
.compare-line { font-weight: 600; }

.chart-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 16px 8px; display: grid; gap: 8px; min-width: 0; }
.chart-panel h3 { font-family: var(--body); font-size: 1rem; font-weight: 600; }
.chart-panel .sub { font-size: 0.85rem; color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.82rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
#chart { position: relative; }
#chart svg { display: block; width: 100%; }
#chart svg text { font-family: var(--body); font-variant-numeric: tabular-nums; }
.tip { position: absolute; top: 4px; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 0.8rem; line-height: 1.45; box-shadow: 0 6px 18px rgba(8, 20, 28, 0.12); min-width: 170px; font-variant-numeric: tabular-nums; }
.tip .tt { font-weight: 600; }
.tip .row { display: flex; justify-content: space-between; gap: 14px; color: var(--ink-2); }
.tip .row span:first-child { display: inline-flex; align-items: center; gap: 6px; }
details.tbl summary { cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--accent); padding: 4px 0 8px; }
details.tbl table { border-collapse: collapse; width: 100%; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
details.tbl th, details.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
details.tbl th:first-child, details.tbl td:first-child { text-align: left; }
details.tbl th { font-size: 0.78rem; color: var(--ink-2); }
details.tbl tr.tot td { font-weight: 650; border-bottom: 0; }
.shear-note { font-size: 0.85rem; color: var(--muted); }

.method { padding-block: 24px 40px; }

@media (max-width: 900px) {
  .calc { grid-template-columns: 1fr; }
  .big { grid-template-columns: 1fr 1fr; }
  .big .hero { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .compare, .two { grid-template-columns: 1fr; }
}

/* Gear suggestions under the results; one group shows, matched to the verdict */
.picks { display: grid; gap: 10px; margin-top: 8px; }
.picks[hidden] { display: none; }
.picks h3 { font-family: var(--display); font-size: 1.35rem; font-weight: 700; }
.picks .sub { font-size: 0.95rem; color: var(--ink-2); }
.picks .read-next { font-size: 0.9rem; color: var(--ink-2); }
.quote-box { margin-top: 4px; }
.quote-box[hidden] { display: none; }

/* Result visuals */
.viz { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.viz[hidden] { display: none; }
.viz h3 { font-size: 1rem; }
.vkey { font-size: 0.8rem; color: var(--ink-2); display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; }
.vkey i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
.vkey i.line { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed var(--ink); vertical-align: 3px; }
.mchart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 150px; position: relative; border-bottom: 1px solid var(--line); margin-top: 6px; }
.mchart .b { background: var(--solar, #a35d00); border-radius: 4px 4px 0 0; min-height: 2px; }
.mchart .b.short { background: var(--warn-soft); box-shadow: inset 0 0 0 1.5px var(--warn); }
.mchart .use { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--ink); pointer-events: none; }
.mlabels { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; font-size: 0.7rem; color: var(--muted); text-align: center; }
.dm-bar { position: relative; height: 14px; background: var(--sunk); border-radius: 7px; margin-top: 6px; }
.dm-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; background: var(--good); transition: width .2s ease; }
.dm-fill.over { background: var(--bad); }
.dm-lim { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--ink); left: 50%; }
.dm-scale { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); }
.blayout { display: grid; gap: 8px; padding-top: 4px; }
.brow { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.brow > span { font-size: 0.75rem; color: var(--muted); width: 58px; flex: none; }
.bcell { width: 34px; height: 22px; border-radius: 4px; background: var(--accent-soft); border: 1.5px solid var(--accent); position: relative; }
.bcell::before, .bcell::after { content: ""; position: absolute; top: -5px; width: 6px; height: 4px; border-radius: 1px 1px 0 0; background: var(--accent); }
.bcell::before { left: 5px; } .bcell::after { right: 5px; background: var(--bad); }
.blayout .more { font-size: 0.8rem; color: var(--ink-2); }
.share { border-collapse: collapse; width: 100%; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.share th, .share td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.share thead th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.share tbody th { font-weight: 600; }
.share tr.hl th, .share tr.hl td, .share td.hl { background: var(--accent-soft); font-weight: 650; }
@media (max-width: 600px) { .share th, .share td { padding: 6px; } }
