@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Azeret Mono";
  src: url("assets/fonts/azeret-mono-var.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --ground: #0a1317;
  --ground-2: #0e1b20;
  --panel: #102128;
  --line: rgba(214, 232, 226, 0.12);
  --line-2: rgba(214, 232, 226, 0.28);
  --ink: #e8f0ec;
  --muted: #91a7a2;
  --amber: #f3c14b;
  --amber-soft: rgba(243, 193, 75, 0.14);
  --mint: #63e6b0;
  --mint-soft: rgba(99, 230, 176, 0.12);
  --red: #ff6a4d;
  --red-soft: rgba(255, 106, 77, 0.12);
  --cold: #3d5862;
  --sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --mono: "Azeret Mono", ui-monospace, "SFMono-Regular", monospace;
  --max: 1400px;
  --gutter: clamp(18px, 4.2vw, 56px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--ground);
  background-image:
    radial-gradient(ellipse at 70% -10%, rgba(99, 230, 176, 0.06), transparent 55%),
    radial-gradient(ellipse at 0% 40%, rgba(243, 193, 75, 0.04), transparent 45%),
    linear-gradient(rgba(214, 232, 226, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 232, 226, 0.02) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--amber); color: var(--ground); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) var(--ground); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid var(--ground); }

a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.mono {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--muted);
}

.wrap {
  width: min(var(--max), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  background: var(--amber);
  color: var(--ground);
  padding: 10px 16px;
  font-weight: 700;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

/* ---------- bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(10, 19, 23, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.bar-in {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}
.brand-a { color: var(--ink); }
.brand-b { color: var(--amber); font-weight: 600; }

.bar-tool { margin-left: auto; }
.bar-live { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--muted); }
.bar-live b { color: var(--mint); font-weight: 500; }

.reset {
  border: 1px solid var(--line-2);
  background: transparent;
  min-height: 36px;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.reset:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- intro ---------- */

.intro { padding: clamp(40px, 7vw, 84px) 0 clamp(28px, 4vw, 48px); }

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
}

.intro h1 {
  font-size: clamp(2.5rem, 6vw, 5.2rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-variation-settings: "wdth" 112;
  max-width: 16ch;
  text-wrap: balance;
}

.intro-copy p {
  color: var(--muted);
  max-width: 48ch;
  font-size: 1.02rem;
}

.intro-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.intro-specs li { display: flex; flex-direction: column; gap: 2px; }
.intro-specs b { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }

/* ---------- bench ---------- */

.bench {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.build {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 0 30px;
  padding: 24px 0 26px;
  border-bottom: 1px solid var(--line);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  grid-column: 1 / -1;
}
.panel-head h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }
.panel-head .mono { font-size: 0.62rem; text-align: right; }

.presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 22px;
  grid-column: 1 / -1;
}
.preset {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--ground-2);
  padding: 9px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 58px;
}
.preset b { font-size: 0.82rem; font-weight: 600; }
.preset span { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.preset:hover { border-color: var(--line-2); }
.preset[aria-pressed="true"] { border-color: var(--amber); background: var(--amber-soft); }
.preset[aria-pressed="true"] b { color: var(--amber); }

.control-group { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 0; }
.control-group h3 {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.control-group h3 .mono { color: var(--amber); }

.loads { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.load {
  border: 1px solid var(--line);
  background: transparent;
  text-align: left;
  padding: 8px 9px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  min-height: 46px;
}
.load b { font-size: 0.78rem; font-weight: 500; }
.load span { font-family: var(--mono); font-size: 0.56rem; color: var(--muted); letter-spacing: 0.04em; }
.load:hover { border-color: var(--line-2); }
.load[aria-pressed="true"] { border-color: rgba(243, 193, 75, 0.55); background: var(--amber-soft); }
.load[aria-pressed="true"] b { color: var(--amber); }
.load.na { opacity: 0.55; }

.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.field { margin-top: 14px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.field-head label, .field-label { font-size: 0.82rem; font-weight: 500; }
.field-label { margin: 16px 0 8px; }
.field-head output {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--amber);
  font-weight: 500;
}

input[type="range"] {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  appearance: none;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(90deg, var(--amber) 0 var(--fill, 33%), var(--line-2) var(--fill, 33%) 100%);
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--line-2); }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--amber); }
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -6px;
  background: var(--amber);
  border: 2px solid var(--ground);
  border-radius: 50%;
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--amber);
  border: 2px solid var(--ground);
  border-radius: 50%;
}

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.seg button {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 6px 8px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.seg button b { display: block; font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 500; }
.seg button:hover { border-color: var(--line-2); }
.seg button[aria-pressed="true"] { border-color: var(--mint); background: var(--mint-soft); color: var(--mint); }
.seg button[aria-pressed="true"] b { color: var(--mint); }

/* ---------- stage ---------- */

.stage {
  padding: 24px 0 30px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  scroll-margin-top: 76px;
}

.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.clock { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 0 12px; }
.clock .mono:first-child { grid-column: 1; }
.clock b {
  grid-column: 1;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.clock .mono:last-child { grid-column: 1; }
.clock #clockDay { color: var(--amber); }

.stage-actions { display: flex; gap: 8px; align-items: center; }

.run {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  background: var(--amber);
  color: #141006;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.run:hover { background: #ffd166; }
.run:disabled { opacity: 0.6; cursor: wait; }
.run-icon {
  width: 0;
  height: 0;
  border-left: 9px solid currentColor;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.run.running .run-icon {
  width: 9px;
  height: 12px;
  border: 0;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

.rewind {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  background: transparent;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.rewind:hover { border-color: var(--mint); color: var(--mint); }

/* ---------- scene ---------- */

.scene {
  position: relative;
  min-height: 440px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, #081217 0%, #0a1a20 55%, #071014 100%);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 540px) 84px minmax(210px, 280px);
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 38px 26px 32px;
}

.rain {
  position: absolute;
  inset: -20%;
  background-image: repeating-linear-gradient(103deg, transparent 0 26px, rgba(150, 200, 210, 0.09) 26px 27px, transparent 27px 54px);
  background-size: 54px 54px;
  opacity: 0.55;
  animation: rain 1.1s linear infinite;
  pointer-events: none;
}
@keyframes rain { from { background-position: 0 0; } to { background-position: -22px 54px; } }

.house {
  position: relative;
  width: 100%;
  max-width: 470px;
  justify-self: center;
  z-index: 1;
}

.roof {
  height: 46px;
  background: linear-gradient(180deg, #22343a, #16262c);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border-bottom: 1px solid var(--line-2);
}

.rooms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-2);
  border-top: 0;
  background: #0a1418;
}

.room {
  position: relative;
  min-height: 112px;
  padding: 22px 10px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-content: flex-end;
  gap: 4px 8px;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.room:nth-child(2n) { border-right: 0; }
.room:nth-child(n+3) { border-bottom: 0; }

.room.lit {
  background: linear-gradient(180deg, rgba(243, 193, 75, 0.16), rgba(243, 193, 75, 0.05));
  box-shadow: inset 0 0 34px rgba(243, 193, 75, 0.12);
}

.room-name { position: absolute; top: 6px; left: 9px; font-size: 0.6rem; color: var(--muted); }
.room.lit .room-name { color: var(--amber); }

.appliance {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #849994;
  border: 1px solid transparent;
  padding: 1px 3px;
}
.appliance.on { color: var(--amber); border-color: rgba(243, 193, 75, 0.35); background: rgba(243, 193, 75, 0.08); }
.appliance.na { color: rgba(255, 106, 77, 0.55); text-decoration: line-through; }

.wire {
  position: relative;
  height: 2px;
  background: var(--line-2);
  z-index: 1;
}
.wire::after {
  content: "";
  position: absolute;
  inset: -3px 0;
  background: repeating-linear-gradient(90deg, var(--mint) 0 6px, transparent 6px 16px);
  opacity: 0;
  transition: opacity 0.3s;
}
.wire.live::after { opacity: 0.85; animation: flow 0.7s linear infinite; }
@keyframes flow { from { background-position: 0 0; } to { background-position: 32px 0; } }

.unit {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #101f24, #0c171b);
  padding: 10px;
}

.unit-head { display: flex; justify-content: space-between; gap: 8px; }
.unit-head .mono { font-size: 0.56rem; }
.unit-name { font-size: 0.86rem; font-weight: 600; margin: 2px 0 8px; letter-spacing: -0.01em; }

.cell {
  position: relative;
  height: 132px;
  border: 1px solid var(--line-2);
  background: #081114;
  overflow: hidden;
}
.cell-fill {
  position: absolute;
  inset: auto 0 0 0;
  height: 100%;
  background: linear-gradient(180deg, var(--mint), #2f9f7a);
  transition: height 0.35s ease, background 0.35s ease;
}
.cell-fill.low { background: linear-gradient(180deg, var(--amber), #a97416); }
.cell-fill.empty { background: var(--red); }
.cell-ticks {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(180deg, transparent 0 21px, rgba(8, 17, 20, 0.55) 21px 22px);
  pointer-events: none;
}

.unit-reads { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 8px; }
.unit-reads div { display: flex; flex-direction: column; }
.unit-reads b { font-size: 0.95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.unit-reads .mono { font-size: 0.5rem; letter-spacing: 0.06em; }

.grid-badge {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 6px;
}
.grid-badge b { color: var(--red); }

.outage-label {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.blackout {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(5, 10, 12, 0.86);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 20px;
}
.blackout[hidden] { display: none; }
.blackout b { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.02em; }
.blackout span:last-child { color: var(--muted); font-size: 0.85rem; max-width: 34ch; }
.blackout .mono { color: var(--red); }

/* ---------- tape ---------- */

.tape-wrap { margin-top: 12px; }

.tape {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  height: 36px;
  border: 1px solid var(--line);
  padding: 3px;
  background: #071014;
}

.tick {
  min-width: 0;
  border: 0;
  padding: 0;
  background: rgba(99, 230, 176, 0.55);
  cursor: pointer;
  height: 100%;
}
.tick.low { background: rgba(243, 193, 75, 0.7); }
.tick.dead { background: rgba(255, 106, 77, 0.45); }
.tick:hover { outline: 1px solid var(--ink); outline-offset: 0; }
.tick.active { background: var(--ink); }

.tape-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tape-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tape-legend .sw { width: 12px; height: 6px; display: inline-block; background: rgba(99, 230, 176, 0.55); }
.tape-legend .sw.low { background: rgba(243, 193, 75, 0.7); }
.tape-legend .sw.dead { background: rgba(255, 106, 77, 0.45); }
.tape-legend .mono { margin-left: auto; font-size: 0.54rem; }

/* ---------- verdict ---------- */

.verdict {
  margin-top: 14px;
  border-left: 2px solid var(--amber);
  background: linear-gradient(90deg, var(--amber-soft), transparent 70%);
  padding: 10px 14px;
}
.verdict-line { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.verdict-sub { color: var(--muted); font-size: 0.8rem; margin-top: 3px; }

.contenders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }

.contender {
  border: 1px solid var(--line);
  background: var(--ground-2);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 64px;
}
.contender:hover { border-color: var(--line-2); }
.contender[aria-pressed="true"] { border-color: var(--mint); background: var(--mint-soft); }
.contender .rank { font-family: var(--mono); font-size: 0.52rem; letter-spacing: 0.1em; color: var(--muted); }
.contender b { font-size: 0.8rem; font-weight: 600; line-height: 1.2; }
.contender .meta { font-family: var(--mono); font-size: 0.56rem; color: var(--muted); letter-spacing: 0.04em; }
.contender[aria-pressed="true"] .rank { color: var(--mint); }

.readout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
  margin-top: 12px;
}
.readout div { background: var(--ground-2); padding: 7px 10px; display: flex; flex-direction: column; min-width: 0; }
.readout b { font-size: 0.84rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout .mono { font-size: 0.52rem; }

.cost-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.cost-line .mono { font-size: 0.56rem; }
.cost-line b { font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.cost-bar {
  flex: 1 1 120px;
  height: 4px;
  background: var(--line);
  min-width: 80px;
}
.cost-bar span { display: block; height: 100%; background: var(--mint); width: 0; transition: width 0.3s; }
.cost-bar span.over { background: var(--red); }
#costNote { font-size: 0.54rem; }

/* ---------- picks ---------- */

.picks { padding: clamp(44px, 6vw, 76px) 0 0; }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.sec-head h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); font-weight: 700; letter-spacing: -0.03em; }

.pick-rows { border-top: 1px solid var(--line-2); }

.pick {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 150px 140px 74px 100px;
  gap: 18px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.pick-no { font-family: var(--mono); font-size: 0.72rem; color: var(--amber); letter-spacing: 0.08em; }
.pick-name { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.pick-tag { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.pick-why { color: var(--muted); font-size: 0.86rem; margin-top: 8px; max-width: 60ch; }
.pick-caveat { color: var(--muted); font-size: 0.79rem; margin-top: 5px; max-width: 60ch; }
.pick-caveat b { color: var(--ink); font-weight: 600; }

.pick-metric { display: flex; flex-direction: column; gap: 2px; }
.pick-metric b { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pick-metric .mono { font-size: 0.52rem; }

.score-bar { height: 4px; background: var(--line); margin-top: 8px; }
.score-bar span { display: block; height: 100%; background: var(--mint); }
.score-bar span.mid { background: var(--amber); }
.score-bar span.low { background: var(--red); }
.pick-score b { font-size: 1.1rem; }

.pick-link {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line-2);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 10px;
}
.pick-link:hover { border-color: var(--amber); color: var(--amber); }

.rest { border-bottom: 1px solid var(--line-2); }
.rest summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
}
.rest summary::-webkit-details-marker { display: none; }
.rest summary .mono:last-child { font-size: 0.56rem; color: var(--muted); }
.rest[open] summary { border-bottom: 1px solid var(--line); }

.rest-table { padding: 6px 0 16px; }
.rest-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 70px 90px 90px 90px 110px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font-family: var(--sans);
  font-size: 0.82rem;
  text-align: left;
  width: 100%;
}
.rest-name { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.rest-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rest-run {
  flex: none;
  border: 1px solid var(--line-2);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
}
.rest-run:hover { border-color: var(--amber); color: var(--amber); }
.rest-link {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--amber);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  justify-self: start;
}
.rest-link::after { content: " ↗"; }
.rest-link:hover { color: var(--ink); }
.rest-row.head { font-family: var(--mono); font-size: 0.54rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rest-row b { font-weight: 600; }
.rest-row span { font-variant-numeric: tabular-nums; }
.rest-row .over { color: var(--red); }

/* ---------- notes ---------- */

.notes { padding: clamp(40px, 6vw, 72px) 0; }
.notes details { border-top: 1px solid var(--line-2); }
.notes summary {
  padding: 18px 0;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.notes summary::-webkit-details-marker { display: none; }
.notes summary::after { content: "+"; font-family: var(--mono); color: var(--amber); }
.notes details[open] summary::after { content: "−"; }

.notes-body { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); padding: 4px 0 12px; }
.notes-col h3 { font-size: 0.95rem; font-weight: 700; margin: 18px 0 8px; }
.notes-col h3:first-child { margin-top: 0; }
.notes-col p { color: var(--muted); font-size: 0.88rem; margin-bottom: 10px; max-width: 58ch; }
.limits li { color: var(--muted); font-size: 0.84rem; padding: 7px 0 7px 14px; border-top: 1px solid var(--line); position: relative; }
.limits li::before { content: "—"; position: absolute; left: 0; color: var(--amber); }
.limits b { color: var(--ink); font-weight: 600; }
.sources li { font-size: 0.8rem; padding: 5px 0; border-top: 1px solid var(--line); }
.sources a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.sources a:hover { color: var(--mint); border-color: var(--mint); }
.fine { color: var(--muted); font-size: 0.74rem; margin-top: 14px; }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line); padding: 26px 0 40px; }
.affiliate-disclaimer {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.6;
  max-width: 95ch;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.affiliate-disclaimer strong { color: var(--ink); font-weight: 600; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; align-items: baseline; }
.foot-mark { font-weight: 800; letter-spacing: -0.02em; }
.foot .mono { font-size: 0.58rem; }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .build { grid-template-columns: 1fr 1fr; }
  .control-group-wide { grid-column: 1 / -1; }
  .loads { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .pick { grid-template-columns: 44px minmax(0, 1fr) 140px 120px 66px; }
  .pick-link { grid-column: 2 / -1; justify-self: start; padding: 0 18px; }
}

@media (max-width: 760px) {
  .intro-grid { grid-template-columns: 1fr; }
  .intro h1 { max-width: 20ch; }
  .build { grid-template-columns: 1fr; }
  .control-group-wide { grid-column: auto; }
  .presets { grid-template-columns: 1fr 1fr; }
  .loads { grid-template-columns: 1fr 1fr; }
  .scene { grid-template-columns: 1fr; gap: 14px; padding: 44px 14px 18px; }
  .wire { width: 2px; height: 28px; justify-self: center; }
  .wire::after { inset: 0 -3px; background: repeating-linear-gradient(180deg, var(--mint) 0 6px, transparent 6px 16px); }
  .unit { width: min(240px, 100%); justify-self: center; }
  .rooms { grid-template-columns: 1fr 1fr; }
  .room { min-height: 92px; }
  .contenders { grid-template-columns: 1fr; }
  .readout { grid-template-columns: 1fr 1fr; }
  .pick { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; }
  .pick-metric, .pick-score { grid-column: 2; }
  .pick-link { grid-column: 2; }
  .rest-row { grid-template-columns: minmax(0, 1fr) 52px 66px 92px; gap: 8px; font-size: 0.76rem; }
  .rest-row > span:nth-child(4), .rest-row > span:nth-child(5) { display: none; }
  .notes-body { grid-template-columns: 1fr; }
  .bar-tool { display: none; }
}

@media (max-width: 520px) {
  .rest-row { grid-template-columns: minmax(0, 1fr) 44px 88px; }
  .rest-row > span:nth-child(3), .rest-row > span:nth-child(4), .rest-row > span:nth-child(5) { display: none; }
  .bar-live { display: none; }
  .seg { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .brand-b { font-size: 0.9rem; }
  .stage-head { align-items: flex-start; }
  .stage-actions { width: 100%; }
  .run { flex: 1; justify-content: center; }
  .grid-badge, .outage-label { font-size: 0.48rem; }
  .room { min-height: 100px; padding-inline: 7px; }
  .appliance { font-size: 0.55rem; }
  .tape-legend .mono { display: none; }
  .pick-name { font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
/* Related decisions, last-checked line and touch targets (added 2026-11-06) */
.related-tools { padding-top: 1.6rem; }
.related-title { margin: 0 0 0.5rem; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.65; }
.related-tools ul { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.related-tools a { color: inherit; opacity: 0.9; }
.related-tools a:hover { opacity: 1; text-decoration: underline; }
.last-checked { margin: 0.55rem 0 0; font-size: 0.72rem; letter-spacing: 0.02em; opacity: 0.7; }

/* Static catalogue: the product list as HTML, so it survives without JavaScript. */
.catalogue { padding-block: clamp(2.5rem, 6vw, 4rem); }
.catalogue h2 { margin: 0 0 0.5rem; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.catalogue > p { margin: 0 0 1.2rem; color: var(--muted); max-width: 64ch; }
.catalogue-static { overflow-x: auto; }
.catalogue-static table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.catalogue-static caption { text-align: left; padding-bottom: 0.7rem; color: var(--muted); }
.catalogue-static th, .catalogue-static td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.catalogue-static thead th { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.catalogue-static a { color: inherit; text-underline-offset: 3px; }

/* The quotable answer under the h1. */
.lede-answer { max-width: 62ch; margin: 0 0 0.9rem; font-size: 1.06em; line-height: 1.6; }
