:root {
  color-scheme: light;
  --paper: #e9eef0;
  --surface: #f7f9f8;
  --ink: #142630;
  --muted: #63737a;
  --line: #c3ced1;
  --deep: #18313d;
  --blue: #245fc4;
  --teal: #17776c;
  --amber: #d48325;
  --red: #af4643;
  --white: #ffffff;
  --display: "Arial Narrow", "Aptos Display", "Segoe UI Variable Display", sans-serif;
  --body: "Aptos", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: var(--body);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(24, 49, 61, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 49, 61, .045) 1px, transparent 1px);
  background-size: 28px 28px;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #79a6ff; outline-offset: 2px; }

.topbar {
  min-height: 68px;
  padding: 0 3vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--surface);
  background: var(--deep);
  border-bottom: 4px solid var(--blue);
}

.brandMark {
  display: inline-block;
  padding: 7px 9px 6px;
  color: var(--deep);
  background: #b9d4ff;
  font: 800 13px/1 var(--mono);
  letter-spacing: .08em;
}

.hostName { margin-left: 16px; font: 600 13px/1 var(--mono); color: #bdd0d8; }
.topbarMeta { display: flex; align-items: center; gap: 18px; font: 12px/1.2 var(--mono); color: #bdd0d8; }
.quietButton { padding: 7px 10px; color: var(--surface); background: transparent; border: 1px solid #55707d; }
.quietButton:hover { border-color: #b9d4ff; }

.dashboardShell { width: min(1500px, 94vw); margin: 34px auto 70px; }
.heroGrid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(250px, 1fr); border: 1px solid var(--line); background: var(--surface); }
.runnerBench { padding: clamp(24px, 4vw, 56px); background: var(--deep); color: var(--white); }
.sectionHeading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font: 800 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.runnerBench .eyebrow { color: #8fb8ff; }
h1, h2 { margin: 0; font-family: var(--display); font-stretch: condensed; }
h1 { max-width: 700px; font-size: clamp(42px, 6vw, 82px); font-weight: 800; line-height: .91; letter-spacing: -.045em; text-transform: uppercase; }
h2 { font-size: clamp(22px, 2.2vw, 34px); line-height: 1; letter-spacing: -.025em; }
.activeCount { font: 600 13px/1 var(--mono); color: #b9ccd4; white-space: nowrap; }

.runnerRail { margin-top: 44px; border-top: 1px solid #47616c; }
.runnerLane { display: grid; grid-template-columns: 74px minmax(120px, 1fr) 86px; gap: 16px; align-items: center; min-height: 60px; border-bottom: 1px solid #47616c; }
.laneName { font: 700 12px/1 var(--mono); color: #c7d8df; }
.laneTrack { position: relative; height: 11px; overflow: hidden; background: repeating-linear-gradient(90deg, #294652 0, #294652 1px, transparent 1px, transparent 8%); border: 1px solid #4c6873; }
.laneFill { display: block; height: 100%; min-width: 2px; background: #76a5f6; transition: width .45s ease; }
.runnerLane.active .laneFill { background: var(--amber); }
.runnerLane.active .laneTrack::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 7px, rgba(255,255,255,.16) 7px 10px); animation: laneMove 1.6s linear infinite; }
.laneState { display: flex; align-items: center; justify-content: end; gap: 8px; font: 700 11px/1 var(--mono); text-transform: uppercase; }
.laneDot { width: 9px; height: 9px; border: 2px solid #79909a; border-radius: 50%; }
.runnerLane.active .laneDot { border-color: #f6b75f; background: #f6b75f; box-shadow: 0 0 0 4px rgba(246,183,95,.13); }

.rangePanel { padding: 30px; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.rangeSwitch { display: grid; margin-top: 12px; border-top: 1px solid var(--line); }
.rangeSwitch button { padding: 13px 4px; text-align: left; color: var(--muted); background: transparent; border: 0; border-bottom: 1px solid var(--line); font: 700 12px/1 var(--mono); }
.rangeSwitch button::before { content: "○"; display: inline-block; width: 25px; color: #829197; }
.rangeSwitch button.selected { color: var(--ink); }
.rangeSwitch button.selected::before { content: "●"; color: var(--blue); }
.healthNote { margin-top: auto; padding-top: 30px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.healthNote::before { content: ""; display: block; width: 36px; height: 3px; margin-bottom: 12px; background: var(--teal); }
.healthNote.warning::before { background: var(--amber); }
.healthNote.critical::before { background: var(--red); }

.ledger { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 18px; background: var(--surface); border: 1px solid var(--line); }
.ledger article { min-height: 150px; padding: 24px; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.ledger article:last-child { border-right: 0; }
.ledger span { color: var(--muted); font: 700 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.ledger strong { margin-top: auto; font: 800 clamp(30px, 4vw, 55px)/.95 var(--display); letter-spacing: -.04em; }
.ledger small { margin-top: 9px; color: var(--muted); font: 12px/1.3 var(--mono); }
.ledger .costCell { color: var(--white); background: var(--blue); }
.ledger .costCell span, .ledger .costCell small { color: #cfddfb; }

.chartGrid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-top: 18px; }
.instrument, .runnerTableWrap, .sessionTableWrap { padding: 26px; background: var(--surface); border: 1px solid var(--line); }
.instrument.wide { grid-row: span 2; }
.instrumentHead { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.legend { display: flex; gap: 16px; color: var(--muted); font: 11px/1 var(--mono); }
.legend span::before { content: ""; display: inline-block; width: 18px; height: 3px; margin-right: 7px; vertical-align: middle; background: var(--blue); }
.legend .memoryKey::before { background: var(--teal); }
.chart { min-height: 220px; margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: repeating-linear-gradient(0deg, transparent 0, transparent 43px, rgba(20,38,48,.08) 44px); }
.chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart .axis { stroke: #aebbc0; stroke-width: 1; }
.chart .series { fill: none; stroke: var(--blue); stroke-width: 2.25; vector-effect: non-scaling-stroke; }
.chart .series.secondary { stroke: var(--teal); }
.chart .area { fill: rgba(36, 95, 196, .08); stroke: none; }
.chart .empty { color: var(--muted); display: grid; place-items: center; min-height: 220px; font: 12px/1.5 var(--mono); }
.miniStats, .durationStats { margin: 24px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.miniStats div, .durationStats div { padding-top: 13px; border-top: 1px solid var(--line); }
.miniStats dt, .durationStats dt { color: var(--muted); font: 10px/1 var(--mono); text-transform: uppercase; }
.miniStats dd, .durationStats dd { margin: 8px 0 0; font: 750 21px/1 var(--display); }

.lowerGrid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 18px; margin-top: 18px; }
table { width: 100%; margin-top: 24px; border-collapse: collapse; }
th { padding: 10px 8px; color: var(--muted); border-bottom: 1px solid var(--ink); text-align: left; font: 700 10px/1 var(--mono); text-transform: uppercase; }
td { padding: 13px 8px; border-bottom: 1px solid var(--line); font: 13px/1.2 var(--mono); }
td:last-child, th:last-child { text-align: right; }
.statusTag { display: inline-flex; align-items: center; gap: 7px; }
.statusTag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.statusTag.interrupted::before { background: var(--amber); }
.statusTag.active::before { background: var(--blue); box-shadow: 0 0 0 3px rgba(36,95,196,.12); }
.tableScroll { overflow-x: auto; }

.loginBody { min-height: 100vh; display: grid; place-items: center; background: var(--deep); }
.loginShell { width: min(940px, 92vw); min-height: 560px; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--surface); box-shadow: 0 24px 80px rgba(3,17,24,.35); }
.loginSignal { position: relative; padding: 50px; display: flex; flex-direction: column; color: var(--white); background: #214654; overflow: hidden; }
.loginSignal::after { content: ""; position: absolute; right: -80px; bottom: -130px; width: 370px; height: 370px; border: 80px solid rgba(143,184,255,.13); border-radius: 50%; }
.loginSignal p { position: relative; z-index: 1; max-width: 310px; margin: auto 0 0; font: 700 clamp(27px, 4vw, 46px)/1.02 var(--display); letter-spacing: -.025em; }
.signalLines { display: grid; gap: 16px; margin-top: 95px; }
.signalLines i { height: 4px; background: #6b94a3; transform-origin: left; }
.signalLines i:nth-child(1) { width: 72%; }
.signalLines i:nth-child(2) { width: 47%; background: #8fb8ff; }
.signalLines i:nth-child(3) { width: 88%; }
.signalLines i:nth-child(4) { width: 30%; background: #f2af57; }
.loginPanel { padding: clamp(36px, 6vw, 76px); display: flex; flex-direction: column; justify-content: center; }
.loginPanel h1 { font-size: clamp(37px, 5vw, 61px); }
.loginIntro { margin: 18px 0 30px; color: var(--muted); line-height: 1.5; }
.loginPanel form { display: grid; gap: 19px; }
.loginPanel label { color: var(--muted); font: 700 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.loginPanel input { width: 100%; margin-top: 8px; padding: 13px 2px; color: var(--ink); background: transparent; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; }
.loginPanel input:focus { border-color: var(--blue); outline: 0; }
.loginPanel button { margin-top: 8px; padding: 14px 18px; color: var(--white); background: var(--blue); border: 0; font-weight: 750; }
.loginPanel button:hover { background: #174ca9; }
.loginNotice { padding: 12px 14px; color: #762c29; background: #f7e2df; border-left: 4px solid var(--red); font-size: 13px; line-height: 1.35; }

@keyframes laneMove { to { transform: translateX(12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

@media (max-width: 900px) {
  .heroGrid, .chartGrid, .lowerGrid { grid-template-columns: 1fr; }
  .rangePanel { border-left: 0; border-top: 1px solid var(--line); }
  .healthNote { margin-top: 25px; }
  .ledger { grid-template-columns: 1fr 1fr; }
  .ledger article:nth-child(2) { border-right: 0; }
  .ledger article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .instrument.wide { grid-row: auto; }
}

@media (max-width: 620px) {
  .topbar { padding: 14px 4vw; align-items: start; }
  .hostName { display: block; margin: 9px 0 0; }
  .topbarMeta { align-items: end; flex-direction: column-reverse; gap: 8px; }
  .dashboardShell { width: 94vw; margin-top: 18px; }
  .sectionHeading { align-items: start; flex-direction: column; }
  .runnerBench, .rangePanel, .instrument, .runnerTableWrap, .sessionTableWrap { padding: 22px; }
  .runnerLane { grid-template-columns: 58px minmax(80px, 1fr) 70px; gap: 9px; }
  .ledger { grid-template-columns: 1fr; }
  .ledger article { min-height: 125px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ledger article:last-child { border-bottom: 0; }
  .loginShell { width: 100%; min-height: 100vh; grid-template-columns: 1fr; }
  .loginSignal { min-height: 260px; padding: 28px; }
  .signalLines { margin-top: 45px; }
  .loginSignal p { margin-top: 35px; font-size: 28px; }
  .loginPanel { padding: 38px 28px 54px; }
}
