/* Universal monitor chrome - the part every monitor page shares.
   Version 01. Created 2026-09-05 by Claude Opus 5 (1M) on Pine, at Max's
   instruction: "separate the common part from the variable part of every
   monitor page ... so it can be updated once, not on every page."

   Loaded by every monitor page BEFORE that page own <style> block, so a page
   can still override one rule locally when it genuinely differs.

   What belongs here: colour tokens, page frame, header, surfaces, status
   strips, allowance bars, chart frame, legend, form controls, table, footer,
   responsive rules.
   What does NOT belong here: a page own data-series classes (forecast*,
   recent*, cycle*, linear*, pace*, session*) - those are the variable part.

   Where copies of the same rule had drifted apart, the fullest variant won, so
   no page loses a state it used to show. */

:root {
  color-scheme: light;
  --ink:#17202a; --muted:#65717d; --line:#dce3e8; --paper:#fff; --wash:#f4f7f9;
  --blue:#1769e0; --green:#11845b; --amber:#b36500; --purple:#7650b8; --red:#c0372b;
}
* { box-sizing:border-box }
body { margin:0; background:var(--wash); color:var(--ink); font:16px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif }
main { max-width:1040px; margin:auto; padding:34px 22px 50px }
header { display:flex; justify-content:space-between; gap:24px; align-items:end; margin-bottom:22px }
header a { color:var(--blue); font-weight:600; text-decoration:none }
h1 { font-size:clamp(28px,4vw,46px); line-height:1.05; margin:0 0 8px; letter-spacing:-.04em }
.sub,.note { color:var(--muted) }

/* Live indicator, with the paused and broken states the Claude page introduced. */
.live { white-space:normal; color:var(--green); font-weight:700; text-align:right }
.live:before { content:""; display:inline-block; width:9px; height:9px; margin-right:7px; border-radius:50%; background:var(--green) }
.live.paused { color:var(--amber) } .live.paused:before { background:var(--amber) }
.live.broken { color:var(--red) } .live.broken:before { background:var(--red) }

/* Surfaces. */
.hero,.card,.controls,.chartCard { background:var(--paper); border:1px solid var(--line); border-radius:18px; box-shadow:0 3px 14px #1825360a }
.hero { padding:24px; margin-bottom:16px }
.card { padding:20px; min-height:142px }
.chartCard { padding:24px; margin-bottom:16px }
.controls { padding:20px 24px }
.controls h2 { margin:0 0 16px; font-size:20px }

/* Data-health strip and reset announcement. */
.dataHealth { display:flex; gap:10px; align-items:center; padding:10px 14px; margin:0 0 16px; border:1px solid #a8dcc7; border-radius:12px; background:#eaf8f2; color:#245d48; font-size:14px; font-weight:700 }
.dataHealth:before { content:""; width:10px; height:10px; flex:0 0 10px; border-radius:50%; background:var(--green) }
.dataHealth.stale { border-color:#efb7b0; background:#fff0ee; color:#8f2e26 }
.dataHealth.stale:before { background:var(--red) }
.dataHealth.broken { border:2px solid var(--red); background:#fff0ef; color:#8f2018; font-size:17px; box-shadow:0 0 0 3px #c0372b1f }
.dataHealth.broken:before { background:var(--red); box-shadow:0 0 0 5px #c0372b22 }
.resetAnnouncement { display:flex; gap:14px; align-items:center; padding:18px 22px; margin:16px 0; border:1px solid #a8dcc7; border-radius:16px; background:#eaf8f2; box-shadow:0 3px 14px #1825360a }
.resetAnnouncement[hidden] { display:none }
.resetIcon { font-size:28px; line-height:1 }
.resetTitle { font-size:19px; font-weight:780 }
.resetDetail { color:#356654; font-size:14px; margin-top:2px }

/* Allowance / spend bars. */
.allowanceBars { display:grid; gap:16px; margin-top:16px }
.allowanceBarHead { display:flex; justify-content:space-between; gap:16px; align-items:baseline }
.allowanceBarHead span { color:var(--ink); font-weight:700 }
.allowanceBarHead strong { font-size:20px; white-space:nowrap }
.bar { position:relative; height:20px; border-radius:8px; overflow:hidden; background:#e7edf2; margin:6px 0 4px }
.used { background:var(--ink) }
.elapsed { background:var(--green) }
.used,.elapsed { height:100%; min-width:0; border-radius:inherit; transition:width .25s ease }
.barDetail { color:var(--muted); font-size:13px }
.barlabels { display:flex; justify-content:space-between; gap:12px; color:var(--muted); font-size:14px }

/* Chart frame and axes - the box, not the lines drawn inside it. */
.chartHead { display:flex; justify-content:space-between; gap:20px; align-items:end; margin-bottom:16px }
.chartHead h2 { margin:0; font-size:22px }
.zoomRow { display:flex; align-items:center; gap:14px; margin:14px 0 2px; color:var(--muted); font-size:14px }
.zoomRow input { flex:1; accent-color:var(--blue) }
.zoomRow .zoomValue { font-weight:700; color:var(--ink); white-space:nowrap }
.rangePresets { display:flex; gap:7px; flex-wrap:wrap; margin:10px 0 18px }
.rangePresets button { margin:0; padding:5px 12px; border:1px solid var(--line); border-radius:999px; background:var(--paper); font-size:13px }
.rangePresets button.on { color:var(--paper); background:var(--ink); border-color:var(--ink) }
.chartWrap { position:relative; width:min(100%,620px); margin:auto; aspect-ratio:1; border-left:2px solid var(--ink); border-bottom:2px solid var(--ink); background:linear-gradient(to right,transparent 24.8%,var(--line) 25%,transparent 25.2%,transparent 49.8%,var(--line) 50%,transparent 50.2%,transparent 74.8%,var(--line) 75%,transparent 75.2%),linear-gradient(to top,transparent 24.8%,var(--line) 25%,transparent 25.2%,transparent 49.8%,var(--line) 50%,transparent 50.2%,transparent 74.8%,var(--line) 75%,transparent 75.2%) }
.chartWrap svg { display:block; width:100%; height:100%; overflow:visible }
.nowLine { stroke:var(--amber); stroke-width:.7; stroke-dasharray:1.2 1.2; opacity:.8 }
.axisLabel { position:absolute; color:var(--muted); font-size:12px }
.axisTop { top:0; left:-8px; transform:translate(-100%,-50%) }
.axisBottom { left:-8px; bottom:0; transform:translate(-100%,50%) }
.dateTick line { stroke:var(--ink); stroke-width:.5 } .dateTick text { fill:var(--muted); font-size:3px }
.legend { display:flex; flex-wrap:wrap; gap:18px; margin-top:42px; color:var(--muted); font-size:13px }
.key { display:inline-block; width:24px; height:3px; margin:0 7px 3px 0; vertical-align:middle; background:var(--ink) }
.key.target { height:0; border-top:2px dashed var(--blue); background:none }

/* Stat cards. */
.grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:16px }
.label { color:var(--muted); font-size:14px; font-weight:650; text-transform:uppercase; letter-spacing:.06em }
.value { margin:10px 0 4px; font-size:clamp(25px,3vw,38px); line-height:1.05; font-weight:750; letter-spacing:-.03em }
.small { font-size:14px; color:var(--muted) }
.verdict { border-left:7px solid var(--green) }
.verdict.warn { border-left-color:var(--amber) }
.verdict.bad { border-left-color:var(--red) }

/* Form controls. */
.inputs { display:grid; grid-template-columns:repeat(4,1fr); gap:14px }
label { display:block; color:var(--muted); font-size:13px; font-weight:650 }
input { width:100%; margin-top:6px; border:1px solid #bcc7d0; border-radius:9px; padding:10px 11px; color:var(--ink); background:#fff; font:inherit }
button { margin-top:16px; border:0; border-radius:9px; padding:10px 14px; background:#e9eef3; color:var(--ink); font-weight:700; cursor:pointer }

/* Table and footer. */
main .summary-table { width:100%; table-layout:fixed }
main .summary-table th,main .summary-table td { overflow-wrap:anywhere }
footer { margin-top:18px; font-size:13px; color:var(--muted) }

@media (max-width:800px) {
  .grid,.inputs { grid-template-columns:repeat(2,1fr) }
  header,.chartHead { align-items:start; flex-direction:column }
  .live { text-align:left }
  .zoomRow { align-items:stretch; flex-wrap:wrap } .zoomRow input { flex-basis:100% }
}
@media (max-width:480px) {
  .grid,.inputs { grid-template-columns:1fr }
  main { padding:22px 14px }
  .chartCard { padding:20px 16px }
  main .summary-table th,main .summary-table td { padding-left:3px; padding-right:3px; font-size:11px }
}
