/* THEME COLOURS, PAGE FRAME. Start here to change a colour: the variables in :root are the OLED theme, [data-theme="classic"] overrides them.
   Also: the header bar (brand, tabs, clock, progress line), the error banner, and the container that holds the four pages. */

  /* ---- OLED theme (the default): true black, hairlines, one accent. A black pixel is switched OFF on an OLED screen. ---- */
  :root { --bg:#000; --card:#000; --ink:#e4e6ea; --mut:#6c7480; --below:#ff7a45; --gen:#3ddc97; --warn:#ffb000; --bad:#ff4d4d;
          --val:#35e0ff; --acc:#35e0ff; --line:#1d1d1d; --line2:#2a2a2a; --grid:#151515; --hdr:3.2rem; --strip:4.4rem; --sx:0px; --sy:0px;
          --font:ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace; }
  /* ---- classic theme: the slate-blue look ---- */
  [data-theme="classic"] { --bg:#12151c; --card:#1a1f29; --ink:#e8ebf2; --mut:#98a2b3; --below:#eb6834; --gen:#35c27a; --warn:#f0b429; --bad:#ef5b5b;
          --val:#5b9cf0; --acc:#5b9cf0; --line:transparent; --line2:#2a3140; --grid:#2a3140; --font:system-ui, sans-serif; }

  * { box-sizing:border-box; }
  html { font-size:16px; }                         /* the script below replaces this: 16px x SCALE */
  body { margin:0; background:var(--bg); color:var(--ink); font:1rem var(--font); font-variant-numeric:tabular-nums; overflow:hidden; }

  /* ---- header: brand, navigation tabs, progress line ---- */
  header { position:relative; height:var(--hdr); display:flex; gap:1.4rem; align-items:center; padding:0 1.2rem; background:var(--card);
           border-bottom:1px solid var(--line); }
  h1 { font-size:1.3rem; margin:0; white-space:nowrap; }
  #tabs { display:flex; gap:.5rem; }
  .tab { cursor:pointer; padding:.25rem .8rem; border:1px solid var(--line2); color:var(--mut); letter-spacing:.16em; font-size:.85rem; white-space:nowrap; }
  .tab .sub { letter-spacing:.04em; opacity:.8; }
  .tab.on { color:var(--ink); border-color:var(--val); box-shadow:inset 0 -2px 0 var(--val); }
  .sp { flex:1; }
  #clock { font-size:1.6rem; }
  #prog { position:absolute; left:0; bottom:-1px; height:2px; width:0; background:var(--val); }
  @keyframes fill { from { width:0; } to { width:100%; } }
  #banner { display:none; position:fixed; top:var(--hdr); left:0; right:0; z-index:5; padding:.5rem 1.2rem;
            background:var(--bad); color:#fff; font-weight:700; font-size:1.2rem; }

  /* ---- views ---- */
  #views { position:relative; height:calc(100vh - var(--hdr)); }
  .view { position:absolute; inset:0; display:none; }
  #v-blocks.on { display:flex; flex-direction:column; }
  #v-status.on { display:grid; }

  /* ---- replay: the "history" button in the header, the bar under the pages (js/12-replay.js) ---- */
  #rp { display:none; position:fixed; left:0; right:0; bottom:0; height:var(--rpbar); z-index:4; align-items:center; gap:.4rem; padding:0 1rem;
        background:var(--card); border-top:1px solid var(--line2); font-size:.8rem; letter-spacing:.06em; }
  body.rpbar { --rpbar:2.6rem; }
  body.rpbar #rp { display:flex; }
  body.rpbar #views { height:calc(100vh - var(--hdr) - var(--rpbar)); }
  #rp button, #rp select { background:var(--card); color:var(--ink); border:1px solid var(--mut); border-radius:0; padding:.2rem .55rem; font:inherit; cursor:pointer; }
  #rp button:hover:not(:disabled), #rp select:hover { border-color:var(--val); }
  #rp button:disabled { opacity:.35; cursor:default; }
  #rp-live { color:var(--val); border-color:var(--val); }
  body.replay #rp-live { color:var(--mut); border-color:var(--mut); }
  #rp-slider { flex:1 1 10rem; min-width:6rem; accent-color:var(--val); }
  #rp-time { color:var(--val); font-weight:700; min-width:12rem; text-align:right; }
  body.replay #rp-time { color:var(--warn); }
  body.replay header { border-bottom-color:var(--warn); }
  body.replay #clock::before { content:"REPLAY "; color:var(--warn); font-size:.9rem; letter-spacing:.12em; }
  body.replay #histbtn { color:var(--warn); border-color:var(--warn); }
  body.rel #relbtn { color:var(--gen); border-color:var(--gen); opacity:1; }
  body.rel #relbtn.wait { color:var(--warn); border-color:var(--warn); border-style:dashed; }          /* ON, but it cannot judge yet: see its tooltip */          /* IRR-REL is ON: health is judged against the light on each block */
  body.replay #flowbox { border-color:var(--warn); }
  body.phone #rp { flex-wrap:wrap; height:auto; padding:.4rem .6rem; }
  body.phone.rpbar #views { height:auto; }
