/* Layout: spec-sheet tool page. Main column (calculator, then long guide) + 300px sidebar for ads and related tools; stacks on phones. Result card is styled as an equipment rating plate. */
:root {
  --bg: #F3F6F8;
  --surface: #FFFFFF;
  --ink: #14202A;
  --muted: #586977;
  --line: #D6DEE4;
  --cool: #1C68A8;
  --cool-soft: #E3EEF7;
  --heat: #B9501A;
  --heat-soft: #F8E9E0;
  --plate: #E4E9ED;
  --plate-edge: #B9C4CC;
  --ad: #EEF1F3;
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem;
  --r: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E151B; --surface: #16202A; --ink: #E4ECF2; --muted: #93A4B2; --line: #2A3845;
    --cool: #5BA8E4; --cool-soft: #16304A; --heat: #EE8A50; --heat-soft: #3A2318;
    --plate: #1D2933; --plate-edge: #364654; --ad: #1A242E; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E151B; --surface: #16202A; --ink: #E4ECF2; --muted: #93A4B2; --line: #2A3845;
  --cool: #5BA8E4; --cool-soft: #16304A; --heat: #EE8A50; --heat-soft: #3A2318;
  --plate: #1D2933; --plate-edge: #364654; --ad: #1A242E; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 1rem; line-height: 1.6; }
a { color: var(--cool); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--cool); outline-offset: 2px; }

.site-head { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding-block: var(--s3); flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: var(--s2); }
.brand-mark { display: inline-flex; width: 1.6rem; height: 1.6rem; border-radius: 4px; overflow: hidden; }
.brand-mark span { flex: 1; }
.brand-mark span:first-child { background: var(--cool); }
.brand-mark span:last-child { background: var(--heat); }
.nav { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: .9rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }

.wrap { max-width: 1140px; margin: 0 auto; padding-inline: 16px; }
.page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s6); padding-block: var(--s5) var(--s7); }
@media (max-width: 960px) { .page { grid-template-columns: minmax(0, 1fr); } .sidebar { display: none; } }

.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: var(--s3); }
.crumbs a { color: var(--muted); }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.1rem, 5vw, 3rem); font-weight: 700; letter-spacing: .005em; }
h2 { font-size: 1.75rem; font-weight: 600; margin-top: var(--s7); margin-bottom: var(--s3); }
h3 { font-size: 1.3rem; font-weight: 600; margin-top: var(--s5); margin-bottom: var(--s2); }
.lede { color: var(--muted); max-width: 65ch; margin: var(--s3) 0 0; font-size: 1.05rem; }
.updated { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); margin-top: var(--s3); letter-spacing: .02em; }

/* Calculator */
.calc { margin-top: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
@media (max-width: 760px) { .calc { grid-template-columns: minmax(0, 1fr); } }
.calc-form { padding: var(--s5); display: grid; gap: var(--s4); align-content: start; border-right: 1px solid var(--line); }
@media (max-width: 760px) { .calc-form { border-right: 0; border-bottom: 1px solid var(--line); } }
.field { display: grid; gap: var(--s1); min-width: 0; }
.field label, .field .label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }
select, input[type="number"] {
  width: 100%; font: inherit; font-size: .98rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 4px; padding: .55rem .65rem; min-width: 0;
}
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { text-align: center; padding: .5rem .3rem; font-size: .85rem; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); border-left: 1px solid var(--line); line-height: 1.25; }
.seg label:first-of-type { border-left: 0; }
.seg label small { display: block; font-family: var(--font-mono); font-size: .68rem; color: var(--muted); }
.seg input:checked + label { background: var(--cool-soft); color: var(--cool); box-shadow: inset 0 -2px 0 var(--cool); }
.seg input:focus-visible + label { outline: 2px solid var(--cool); outline-offset: -2px; }
.checks { display: grid; gap: var(--s2); }
.check { display: flex; gap: var(--s2); align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { margin-top: .3rem; accent-color: var(--cool); }
.check span small { color: var(--muted); font-family: var(--font-mono); font-size: .75rem; margin-left: .25rem; }
.hint { font-size: .8rem; color: var(--muted); }

.calc-out { padding: var(--s5); display: grid; gap: var(--s4); align-content: start; min-width: 0; }
.out-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.big { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.6rem, 7vw, 3.4rem); line-height: 1; font-variant-numeric: tabular-nums; }
.range-txt { font-family: var(--font-mono); font-size: .9rem; color: var(--muted); }
.rangebar { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--cool), var(--heat)); margin-top: var(--s2); }
.rangebar i { position: absolute; top: -5px; width: 4px; height: 20px; background: var(--ink); border-radius: 2px; transform: translateX(-50%); }
.rangeends { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: .75rem; color: var(--muted); margin-top: var(--s1); }

.plate { background: var(--plate); border: 1px solid var(--plate-edge); border-radius: 4px; padding: var(--s3) var(--s4); position: relative; font-family: var(--font-mono); font-size: .78rem; }
.plate::before, .plate::after { content: ""; position: absolute; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--plate-edge); }
.plate::before { left: 8px; } .plate::after { right: 8px; }
.plate-title { text-align: center; font-weight: 600; letter-spacing: .14em; font-size: .72rem; color: var(--muted); border-bottom: 1px solid var(--plate-edge); padding-bottom: var(--s2); margin-bottom: var(--s2); }
.plate dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .2rem var(--s3); margin: 0; }
.plate dt { color: var(--muted); letter-spacing: .06em; }
.plate dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl-wrap { overflow-x: auto; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 600; border-bottom: 0; border-top: 2px solid var(--ink); }
.note { font-size: .82rem; color: var(--muted); background: var(--bg); border-radius: 4px; padding: var(--s2) var(--s3); }
.note.warm { background: var(--heat-soft); color: var(--ink); }

/* Ads */
.ad-slot { background: var(--ad); border: 1px dashed var(--line); border-radius: 4px; display: grid; place-items: center; color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; margin-block: var(--s5); min-height: 120px; text-align: center; padding: var(--s3); }
.ad-slot small { display: block; letter-spacing: 0; text-transform: none; font-family: var(--font-mono); font-size: .7rem; margin-top: .2rem; }
.ad-slot.tall { min-height: 600px; margin-top: 0; }

/* Article */
.article { max-width: 70ch; }
.article p, .article li { color: var(--ink); }
.article ul, .article ol { padding-left: 1.2rem; }
.article li { margin-bottom: .35rem; }
.article .tbl-wrap { margin-block: var(--s3); }
.toc { border-left: 3px solid var(--cool); padding: var(--s2) var(--s4); margin-top: var(--s6); background: var(--surface); }
.toc strong { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .02em; }
.toc ol { margin: var(--s2) 0 0; }
.faq details { border-bottom: 1px solid var(--line); padding-block: var(--s3); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin-bottom: 0; }

.sidebar { display: grid; gap: var(--s5); align-content: start; }
.sticky { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); display: grid; gap: var(--s5); }
.related { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); }
.related h3 { margin-top: 0; font-size: 1.15rem; }
.related ul { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s2); font-size: .92rem; }
.related a { text-decoration: none; }
.related a:hover { text-decoration: underline; }
.related-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s3); list-style: none; padding: 0 !important; }
.related-inline a { display: block; padding: var(--s3); border: 1px solid var(--line); border-radius: 4px; background: var(--surface); text-decoration: none; font-weight: 500; }

footer { border-top: 1px solid var(--line); padding-block: var(--s5); font-size: .82rem; color: var(--muted); background: var(--surface); }
footer .wrap { display: flex; gap: var(--s4); justify-content: space-between; flex-wrap: wrap; }
@media (prefers-reduced-motion: no-preference) { .rangebar i { transition: left .25s ease; } }

/* ---- Shared calculator components ---- */
.seg.two { grid-template-columns: repeat(2, 1fr); }
.seg.four { grid-template-columns: repeat(4, 1fr); }
.ladder { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.ladder div { text-align: center; padding: .35rem 0; font-family: var(--font-mono); font-size: .74rem; background: var(--bg); border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ladder div.on { background: var(--cool); border-color: var(--cool); color: var(--surface); font-weight: 600; }
.ladder.heat div.on { background: var(--heat); border-color: var(--heat); }
.next { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; border: 1px solid var(--line); border-radius: 4px; padding: var(--s3); font-size: .92rem; }
.next a { font-weight: 600; text-decoration: none; }
.bars { display: grid; gap: var(--s3); }
.bar-row { display: grid; gap: var(--s1); }
.bar-row .bar-head { display: flex; justify-content: space-between; gap: var(--s2); font-size: .88rem; }
.bar-row .bar-head b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.bar-track { height: 12px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--cool); }
.bar-track i.heat { background: var(--heat); }
.zones { display: grid; gap: var(--s2); }
.zone { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: var(--s2); align-items: end; }
.zone .x { border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 4px; padding: .5rem .65rem; cursor: pointer; font: inherit; }
.btn { border: 1px solid var(--cool); background: transparent; color: var(--cool); border-radius: 4px; padding: .5rem .8rem; font: inherit; font-weight: 600; cursor: pointer; justify-self: start; }
.btn:hover { background: var(--cool-soft); }
@media (max-width: 480px) { .zone { grid-template-columns: 1fr 1fr; } .zone .x { grid-column: 2; justify-self: end; } }

/* ---- Hub and text pages ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3); margin-top: var(--s4); }
.card { display: grid; gap: var(--s1); padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--cool); }
.card strong { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--cool); }
.card span { font-size: .9rem; color: var(--muted); }
.card em { font-style: normal; font-family: var(--font-mono); font-size: .72rem; color: var(--muted); letter-spacing: .04em; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: var(--s6); }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.duo > div { border: 1px solid var(--line); border-radius: 4px; padding: var(--s3); min-width: 0; }
.duo .cool { border-top: 3px solid var(--cool); }
.duo .heat { border-top: 3px solid var(--heat); }
.duo .big { font-size: clamp(1.9rem, 5vw, 2.4rem); }
.duo .unit { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }
@media (max-width: 380px) { .duo { grid-template-columns: 1fr; } }

.ad { margin-block: var(--s5); min-height: 250px; text-align: center; }
.ad-side { min-height: 600px; margin-top: 0; }
.ad-label { display: block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s1); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.ad-slot { display: none !important; }
