    *,
    *::before,
    *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    :root {
      /* ── v2 "Deepen & Elevate" canonical theme (navy #2C3C63 / teal #8CC4D4) ──
         Surface/text tokens adopt the canonical engentus-full-redesign theme
         (lib/theme.mjs). Variable NAMES are preserved so every screen's existing
         var() refs re-skin instantly. Legacy alias names (--brdl/--tdark/--red/
         --grn/--pur) keep their original VALUES so unaudited screens are unchanged;
         the new v2 names are added for the component-alignment pass. */
      /* layered navy ramp, anchored to brand navy #2C3C63 (= logo background) */
      --bg2: #18243d;       /* wells / chart insets (darkest) */
      --dk: #20304e;        /* app canvas / content (deeper than v1) */
      --mid: #2C3C63;       /* panels / sidebars / chrome ← matches the logos */
      --surface2: #35466b;  /* raised cards */
      --raise: #3f5279;     /* raised controls / hover */
      --brd: #3c4f76;
      --brd2: #4c628d;
      /* text */
      --t1: #eaf1fb;
      --t2: #a6b6cf;   /* a11y: WCAG AA-normal (4.5:1) on all surfaces incl. raised cards */
      --t3: #8b9bb8;   /* a11y: muted text lifted from failing (1.9:1) to AA-large on every surface, hierarchy kept t3<t2<t1 */
      /* accents */
      --blue: #8CC4D4;
      --blu2: #5AAABF;
      --bluf: #cfeaf2;
      --teal-dim: rgba(140,196,212,.14);
      --orange: #F2934E;
      --orange2: #EC7424;
      --orange-dim: rgba(242,147,78,.14);
      --ylw: #EC7424;
      --ok: #34D399;
      --amber: #F5A524;
      --danger: #F87171;
      --danger2: #EF4444;
      --purple: #C084FC;
      /* legacy aliases — original values preserved (still referenced by current screens) */
      --brdl: #e2e8f0;      /* LIGHT border on light sub-panels (.stbl/.anova-*) — keep light */
      --tdark: #1e293b;
      --red: #dc2626;
      --grn: #16a34a;
      --pur: #7c3aed;
      /* type scale */
      --fs-xs: 11px; --fs-sm: 12.5px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 26px; --fs-3xl: 33px;
      /* spacing */
      --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 22px; --s6: 32px;
      /* radius + elevation */
      --r-sm: 7px; --r: 11px; --r-lg: 15px;
      --sh-1: 0 1px 2px rgba(0,0,0,.35);
      --sh-2: 0 8px 26px rgba(0,0,0,.40);
      --sh-3: 0 26px 70px rgba(0,0,0,.55);
      /* fonts */
      --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
      --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
      /* layout — preserved from live app */
      --sw: 284px;
      --th: 44px;
      --sch: 50px;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      /* v2: theme.mjs atmospheric teal+orange glow over the canvas */
      background:
        radial-gradient(1100px 620px at 82% -12%, rgba(140,196,212,.06), transparent 60%),
        radial-gradient(900px 540px at 8% 110%, rgba(242,147,78,.05), transparent 55%),
        var(--dk);
      color: var(--t1);
      height: 100vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      font-size: 12.5px
    }

    /* ── TOOLBAR ── */
    #tb {
      height: var(--th);
      /* nav polish: subtle top-highlight/bottom-shade depth (palette-agnostic) + elevation so the nav reads as a distinct layer */
      background: linear-gradient(rgba(255,255,255,.05), rgba(0,0,0,.07)), var(--mid);
      border-bottom: 1px solid var(--brd);
      box-shadow: 0 2px 10px rgba(0,0,0,.28);
      display: flex;
      align-items: center;
      flex-shrink: 0;
      z-index: 50
    }

    #tb-brand {
      padding: 0 14px;
      min-width: var(--sw);
      border-right: 1px solid var(--brd);
      height: 100%;
      display: flex;
      align-items: center;
      gap: 8px;
      letter-spacing: -.02em;
      transition: background .15s;
      user-select: none;
    }

    #tb-brand.clickable { cursor: pointer; }
    #tb-brand.clickable:hover { background: rgba(255,255,255,.05); }

    #tb-divider {
      width: 1px;
      height: 24px;
      background: var(--brd);
      flex-shrink: 0
    }

    /* Goodman-specific toolbar items — toggled by router */
    #tb-goodman-tools {
      display: none;
      align-items: center;
      flex: 1;
    }

    .goodman-toolbar-shell { display: contents; }

    .mode-pill {
      display: flex;
      background: var(--mid);
      border-radius: 6px;
      padding: 2px;
      margin: 0 12px;
      gap: 2px
    }

    .mode-btn {
      background: none;
      border: none;
      color: var(--t2);
      padding: 4px 14px;
      border-radius: 4px;
      cursor: pointer;
      font-size: 12px;
      font-weight: 500;
      transition: all .15s
    }

    .mode-btn.on {
      background: var(--blue);
      color: var(--dk);
      box-shadow: 0 1px 5px rgba(140,196,212,.35); /* nav polish: active pill lifts */
    }

    #tb-wins {
      display: flex;
      gap: 2px;
      margin-left: auto;
      padding-right: 8px;
      align-items: center
    }

    /* User profile */
    #user-prof {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0 14px;
      cursor: pointer;
      border-left: 1px solid var(--brd);
      height: 100%;
      flex-shrink: 0;
      user-select: none;
      transition: background .15s;
      position: relative
    }

    #user-prof:hover { background: rgba(255,255,255,.04) }

    #up-avatar {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      /* nav polish: refined avatar — subtle gradient + soft ring */
      background: linear-gradient(135deg, var(--blue), var(--blu2));
      box-shadow: 0 0 0 2px rgba(140,196,212,.22), 0 2px 5px rgba(0,0,0,.25);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10.5px;
      font-weight: 700;
      color: var(--dk);
      flex-shrink: 0
    }

    #up-info { display: flex; flex-direction: column; gap: 1px }
    #up-name { font-size: 11.5px; font-weight: 600; color: var(--t1); line-height: 1.2 }
    #up-role { font-size: 9.5px; color: var(--t2); line-height: 1.2 }
    #up-caret { font-size: 9px; color: var(--t2); margin-left: 2px }

    #up-menu {
      position: absolute;
      top: calc(100% + 2px);
      right: 0;
      background: var(--mid);
      border: 1px solid var(--brd);
      border-radius: 8px;
      min-width: 170px;
      z-index: 200;
      box-shadow: 0 8px 24px rgba(0,0,0,.3);
      padding: 4px;
      display: none
    }

    #up-menu.open { display: block }

    .up-mi {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 10px;
      border-radius: 5px;
      font-size: 12px;
      color: var(--t1);
      cursor: pointer;
      transition: background .1s
    }

    .up-mi:hover { background: rgba(255,255,255,.07) }
    .up-mi-icon { font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; color: var(--t2) }
    .up-sep { height: 1px; background: var(--brd); margin: 3px 0 }

    .tbw {
      background: none;
      border: 1px solid transparent;
      border-radius: 6px;
      color: var(--t2);
      padding: 5px 10px;
      cursor: pointer;
      font-size: 12px;
      font-weight: 500;
      transition: all .15s;
      display: flex;
      align-items: center;
      gap: 5px
    }

    .tbw:hover { border-color: var(--brd); color: var(--t1) }
    .tbw.on { background: var(--mid); border-color: var(--blue); color: var(--blue) }

    /* ── HOME VIEW ── */
    #view-home { flex: 1; display: flex; overflow: hidden; }

    #news-panel {
      /* redesign: the feed is no longer a heavy full-rail — it's a lighter, slimmer
         ACTIVITY column on the RIGHT; cards float on the canvas, grid becomes the hero */
      order: 2;
      width: 264px;
      min-width: 264px;
      background: transparent;
      border-left: 1px solid var(--brd);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .news-hdr {
      padding: 11px 13px;
      border-bottom: 1px solid var(--brd);
      font-size: 9.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: var(--t2);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .news-live {
      display: flex;
      align-items: center;
      gap: 5px;
      font-size: 9px;
      color: #4ade80;
      font-weight: 600;
    }

    .news-live-dot {
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: #4ade80;
      animation: livepulse 2s infinite;
    }

    @keyframes livepulse {
      0%, 100% { opacity: 1; }
      50% { opacity: .3; }
    }

    .news-list { flex: 1; overflow-y: auto; padding: 8px; }
    .news-list::-webkit-scrollbar { width: 4px; }
    .news-list::-webkit-scrollbar-thumb { background: var(--brd); border-radius: 2px; }

    .news-item {
      background: var(--surface2); /* v2: raised feed card, pops off the --mid sidebar */
      border-radius: var(--r-sm);
      box-shadow: var(--sh-1); /* v2: subtle resting elevation */
      padding: 10px 12px;
      margin-bottom: 8px;
      border-left: 3px solid transparent; /* colored per .ni-* category */
      cursor: pointer;
      transition: background .12s, box-shadow .12s;
    }

    .news-item:hover { background: rgba(0,0,0,.3); }
    .ni-alert    { border-left-color: var(--ylw); }
    .ni-product  { border-left-color: #4ade80; }
    .ni-industry { border-left-color: #a78bfa; }
    .ni-platform { border-left-color: var(--blue); }

    .ni-cat { font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
    .ni-alert .ni-cat    { color: var(--ylw); }
    .ni-product .ni-cat  { color: #4ade80; }
    .ni-industry .ni-cat { color: #a78bfa; }
    .ni-platform .ni-cat { color: var(--blue); }
    .ni-title { font-size: 11.5px; color: var(--t1); line-height: 1.38; margin-bottom: 4px; }
    .ni-time  { font-size: 9.5px; color: var(--t2); }

    #module-area { order: 1; flex: 1; overflow-y: auto; padding: 32px 36px; } /* redesign: hero, generous breathing room */
    #module-area::-webkit-scrollbar { width: 5px; }
    #module-area::-webkit-scrollbar-thumb { background: var(--brd); border-radius: 3px; }

    .mod-area-hdr { margin-bottom: 26px; } /* redesign: hero page-header */
    .mod-area-hdr h2 { font-size: var(--fs-2xl); font-weight: 700; color: var(--t1); margin-bottom: 7px; letter-spacing: -.01em; }
    .mod-area-meta { display: flex; align-items: center; gap: 10px; }
    .mod-area-meta p { font-size: 11px; color: var(--t2); }

    .mill-pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: rgba(140,196,212,.1);
      border: 1px solid rgba(140,196,212,.22);
      border-radius: 4px;
      padding: 2px 9px;
      font-size: 10px;
      color: var(--blue);
      font-weight: 600;
    }

    #module-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px; /* redesign: more breathing room */
    }

    .mod-card {
      background: var(--surface2); /* v2: raised card, pops off the --dk canvas */
      border: 1px solid var(--brd);
      border-radius: var(--r);
      box-shadow: var(--sh-2); /* v2: soft resting elevation */
      padding: var(--s5) var(--s4) var(--s4); /* v2: more generous */
      display: flex;
      flex-direction: column;
      align-items: flex-start; /* v2: left-aligned card */
      gap: var(--s2);
      text-align: left;
      transition: all .18s;
      position: relative;
      min-height: 158px;
    }

    .mod-card.active {
      border-color: rgba(140,196,212,.45);
      cursor: pointer;
      /* keep the raised surface + a teal tint (don't drop to near-transparent) */
      background: linear-gradient(rgba(140,196,212,.07), rgba(140,196,212,.07)), var(--surface2);
    }

    .mod-card.active:hover {
      background: linear-gradient(rgba(140,196,212,.13), rgba(140,196,212,.13)), var(--surface2);
      border-color: var(--blue);
      transform: translateY(-2px);
      box-shadow: var(--sh-3);
    }

    /* redesign: coming-soon = a distinct FLAT, recessed tier (not just a dimmer copy of the
       live cards) so the eye instantly separates what's clickable now from what's coming.
       Live cards stay raised + teal-tinted; locked drop their elevation, recede into the
       canvas, and take a dashed "not-built-yet" border. (critique: hierarchy too weak.) */
    .mod-card.locked {
      opacity: .6;
      background: var(--dk);
      box-shadow: none;
      border-style: dashed;
      border-color: var(--brd);
    }

    .mod-icon { width: 56px; height: 46px; border-radius: var(--r-sm); overflow: hidden; flex-shrink: 0; background: var(--bg2); } /* v2: rounded inset well */
    .mod-name { font-size: var(--fs-md); font-weight: 600; color: var(--t1); line-height: 1.3; } /* v2: 14px */
    .mod-desc { font-size: 11px; color: var(--t2); line-height: 1.45; }
    .mod-lock { position: absolute; top: 9px; right: 9px; font-size: 10px; color: var(--t2); opacity: .55; }

    .mod-status {
      font-size: 9px;
      padding: 3px 10px;
      border-radius: 999px; /* v2: pill badge */
      font-weight: 600;
      letter-spacing: .03em;
      margin-top: auto;
    }

    .ms-open { background: rgba(140,196,212,.18); color: var(--blue); }
    .ms-soon { background: rgba(255,255,255,.05); color: var(--t2); }

    /* ── GOODMAN VIEW ── */
    #view-goodman { flex: 1; display: none; flex-direction: column; overflow: hidden; }

    /* ── BODY ── */
    #body { flex: 1; display: flex; overflow: hidden }

    /* ── SIDEBAR ── */
    #sb {
      width: var(--sw);
      min-width: var(--sw);
      background: var(--mid);
      border-right: 1px solid var(--brd);
      display: flex;
      flex-direction: column;
      overflow: hidden
    }

    #sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden }
    #sb-scroll::-webkit-scrollbar { width: 4px }
    #sb-scroll::-webkit-scrollbar-thumb { background: var(--brd); border-radius: 2px }

    .ssec { padding: 10px 12px; border-bottom: 1px solid var(--brd) }

    .ssec-title {
      font-size: 9.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: var(--t1); /* designed section header: more presence */
      margin-bottom: 9px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: relative;
      padding-left: 10px;
    }
    .ssec-title::before { /* teal accent tick */
      content: '';
      position: absolute;
      left: 0;
      top: 1px;
      bottom: 1px;
      width: 3px;
      border-radius: 2px;
      background: var(--blue);
    }

    .ssec-title button { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 11px; font-weight: 600; padding: 0 }
    .ssec-title button:hover { color: var(--blu2) }

    .sim-row {
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 5px 7px;
      border-radius: 5px;
      cursor: pointer;
      margin-bottom: 2px;
      transition: background .1s
    }

    .sim-row:hover { background: rgba(255,255,255,.05) }
    .sim-row.on { background: rgba(140,196,212,.15) }
    .sim-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0 }
    .sim-name { flex: 1; font-size: 12px; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }

    .sim-badge { font-size: 9px; padding: 1px 5px; border-radius: 3px; font-weight: 600; flex-shrink: 0 }
    .sim-badge.idle    { background: rgba(255,255,255,.1); color: var(--t2) }
    .sim-badge.running { background: rgba(140,196,212,.3); color: #6CBDCF }
    .sim-badge.done    { background: rgba(22,163,74,.2); color: #86efac }
    .sim-badge.stale   { background: rgba(236,116,36,.2); color: #FDBA74 }
    .sim-badge.stopped { background: rgba(220,38,38,.15); color: #fca5a5 }

    .sim-acts { display: flex; gap: 2px; opacity: 0; transition: opacity .15s }
    .sim-row:hover .sim-acts { opacity: 1 }

    .sab { background: none; border: none; color: var(--t2); cursor: pointer; padding: 1px 4px; border-radius: 3px; font-size: 10px }
    .sab:hover { background: rgba(255,255,255,.1); color: var(--t1) }

    .add-sim-btn {
      width: 100%;
      padding: 6px;
      background: rgba(140,196,212,.12);
      border: 1px dashed rgba(140,196,212,.4);
      border-radius: 5px;
      color: var(--blue);
      font-size: 11.5px;
      cursor: pointer;
      font-weight: 500;
      transition: all .15s;
      margin-top: 4px
    }

    .add-sim-btn:hover { background: rgba(140,196,212,.22) }

    .mc-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px }
    .mc-row label { font-size: 11px; color: var(--t2); flex: 1 }

    .mc-row input[type=number] {
      width: 72px;
      background: var(--dk);
      color: var(--t1);
      border: 1px solid var(--brd);
      border-radius: 4px;
      padding: 3px 6px;
      font-size: 11px;
      text-align: right
    }

    .run-row { display: flex; gap: 5px; margin-top: 8px }

    .rbtn { flex: 1; padding: 7px; border-radius: 5px; border: none; cursor: pointer; font-size: 11.5px; font-weight: 600; transition: all .15s }
    .rbtn.go { background: var(--grn); color: #fff }
    .rbtn.go:hover { background: #15803d }
    .rbtn.go:disabled { opacity: .4; cursor: not-allowed }
    .rbtn.pause { background: var(--ylw); color: #fff }
    .rbtn.stop { background: var(--dk); border: 1px solid var(--brd); color: var(--t2) }

    .prog-wrap { height: 4px; background: var(--brd); border-radius: 2px; margin-top: 6px; overflow: hidden }
    .prog-fill { height: 100%; background: var(--blue); border-radius: 2px; transition: width .3s; width: 0% }
    .prog-lbl { font-size: 9.5px; color: var(--t2); margin-top: 2px }

    .bs-item { border-radius: 6px; border: 1px solid var(--brd); margin-bottom: 5px; overflow: hidden }

    .bs-head {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 9px;
      cursor: pointer;
      background: rgba(255,255,255,.03);
      transition: background .1s;
      user-select: none
    }

    .bs-head:hover { background: rgba(255,255,255,.07) }
    .bs-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0 }
    .bs-name { flex: 1; font-size: 12px; font-weight: 500 }
    .bs-actions { display: flex; gap: 3px }
    .bs-act { background: none; border: none; color: var(--t2); cursor: pointer; font-size: 11px; padding: 1px 4px; border-radius: 3px }
    .bs-act:hover { background: rgba(255,255,255,.1); color: var(--t1) }
    .bs-chev { color: var(--t2); font-size: 10px; transition: transform .15s; flex-shrink: 0 }
    .bs-chev.open { transform: rotate(90deg) }
    .bs-params { display: none; padding: 2px 8px 8px }
    .bs-params.open { display: block }

    .cat-lbl {
      font-size: 9px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .06em;
      color: var(--t2);
      margin: 8px 0 4px;
      padding-left: 2px;
      border-top: 1px solid var(--brd);
      padding-top: 6px
    }

    .cat-lbl:first-child { border-top: none; margin-top: 4px }

    .prow { margin-bottom: 6px }
    .prow-top { display: flex; align-items: center; gap: 5px; margin-bottom: 2px }
    .plabel { flex: 1; font-size: 10.5px; color: var(--t2); line-height: 1.3 }
    .pval { font-size: 11px; font-weight: 600; color: var(--blue); min-width: 52px; text-align: right; font-variant-numeric: tabular-nums }

    .free-tog { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; flex-shrink: 0 }
    .tog-track { width: 24px; height: 13px; background: var(--brd); border-radius: 7px; position: relative; transition: background .15s; flex-shrink: 0 }
    .tog-track.on { background: var(--blue) }
    .tog-knob { width: 9px; height: 9px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: left .15s }
    .tog-track.on .tog-knob { left: 13px }
    .tog-lbl { font-size: 9px; color: var(--t2) }

    .dist-box { background: rgba(0,0,0,.25); border-radius: 4px; padding: 5px 7px; margin-top: 3px; display: none }
    .dist-box.open { display: block }
    .dist-sel { width: 100%; background: var(--dk); color: var(--t1); border: 1px solid var(--brd); border-radius: 3px; padding: 3px 5px; font-size: 11px; margin-bottom: 4px }
    .dist-inputs { display: flex; gap: 5px; flex-wrap: wrap }
    .dig { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 58px }
    .dig label { font-size: 9px; color: var(--t2) }
    .dig input { background: var(--dk); color: var(--t1); border: 1px solid var(--brd); border-radius: 3px; padding: 2px 5px; font-size: 11px; width: 100% }

    /* redesign: refined slider (mockup .uslider) — rounded track + teal handle w/ ring + shadow.
       Palette-agnostic (token names): re-skins with whatever brand palette lands. Shared by every
       analysis screen's sliders (mill-force, mill-charge, goodman). */
    input[type=range] {
      -webkit-appearance: none; appearance: none;
      width: 100%; height: 15px; background: transparent;
      cursor: pointer; outline: none;
    }
    /* VALUE FILL (mockup .uslider, --v = value% set in JS): teal up to the value, dim rest —
       so the slider shows how full the value is. */
    input[type=range]::-webkit-slider-runnable-track {
      height: 5px; border-radius: 999px; border: 1px solid var(--brd);
      background: linear-gradient(90deg, var(--blue) 0 var(--v, 50%), var(--bg2) var(--v, 50%) 100%);
    }
    input[type=range]::-moz-range-track { height: 5px; border-radius: 999px; border: 1px solid var(--brd); background: var(--bg2); }
    input[type=range]::-moz-range-progress { height: 5px; border-radius: 999px; background: var(--blue); }
    input[type=range]::-webkit-slider-thumb {
      -webkit-appearance: none; appearance: none; margin-top: -6px; /* center 15px thumb on the 5px track */
      width: 15px; height: 15px; border-radius: 50%;
      background: var(--blue); border: 2px solid var(--mid);
      box-shadow: var(--sh-1); cursor: pointer; transition: background .15s, transform .1s;
    }
    input[type=range]::-moz-range-thumb {
      width: 15px; height: 15px; border-radius: 50%;
      background: var(--blue); border: 2px solid var(--mid);
      box-shadow: var(--sh-1); cursor: pointer;
    }
    input[type=range]:hover::-webkit-slider-thumb { background: var(--bluf); transform: scale(1.08); }
    input[type=range]:hover::-moz-range-thumb { background: var(--bluf); }

    .probe-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px }
    .probe-row label { font-size: 11px; color: var(--t2); flex: 1 }
    .probe-val { font-size: 11px; font-weight: 600; color: var(--blue); min-width: 52px; text-align: right; font-variant-numeric: tabular-nums }

    .save-sim-btn { width: 100%; margin-top: 10px; padding: 6px 0; background: var(--blue); color: var(--dk); border: none; border-radius: 6px; font-size: 11.5px; font-weight: 600; cursor: pointer; letter-spacing: .3px; opacity: .9 }
    .save-sim-btn:hover { opacity: 1 }

    .info-box { background: rgba(0,0,0,.2); border-radius: 5px; padding: 8px 10px; margin-top: 4px }
    .info-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--t2); margin-bottom: 3px }
    .info-row:last-child { margin-bottom: 0 }
    .info-val { font-weight: 600; font-variant-numeric: tabular-nums }

    /* ── CHART AREA ── */
    #chart-area { flex: 1; display: flex; flex-direction: column; overflow: hidden }

    /* redesign: Goodman safety-verdict HERO band (surface-what-matters, shared hero-card
       vocabulary). Sits above the chart; accent rail green=SAFE / red=AT-RISK off the same
       computed damage/cyc as the sidebar. Presentation-only; sidebar readout preserved. */
    #goodman-hero { display: flex; gap: 10px; padding: 10px 8px 0; flex-shrink: 0; }
    #goodman-hero:empty { display: none; }
    /* unified trio hero-card vocabulary: surface2 + 1px brd + var(--r-sm) radius + a left accent
       rail (3px metric / 4px emphasis) + uppercase .06em label + bold value. Shared by goodman
       verdict cards (.gh-card), mill-force KPIs (.mfk), mill-charge metrics (.mill-metric-row). */
    .gh-card {
      flex: 1 1 0; min-width: 0; position: relative;
      background: var(--surface2); border: 1px solid var(--brd);
      border-radius: var(--r-sm); padding: 9px 13px 10px 15px; overflow: hidden;
    }
    .gh-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
    .gh-card.safe::before { background: var(--ok); }
    .gh-card.caution::before { background: var(--amber); }
    .gh-card.risk::before { background: var(--danger); }
    .gh-name { font-size: 11px; font-weight: 600; margin-bottom: 2px; }
    .gh-verdict { font-size: 19px; font-weight: 800; letter-spacing: .02em; line-height: 1.1; }
    .gh-card.safe .gh-verdict { color: var(--ok); }
    .gh-card.caution .gh-verdict { color: var(--amber); }
    .gh-card.risk .gh-verdict { color: var(--danger); }
    /* Readability bug (ref-1782828731149-4): this safety-readout sub-line was
       10.5px + --t3 (dimmest) — hard to read. Bigger + brighter, values brightest (--t1). */
    .gh-sub { font-size: 12px; color: var(--t2); margin-top: 4px; }
    .gh-sub b { color: var(--t1); font-weight: 700; }

    #scr.hidden+#chart-wrap { margin-top: 8px; border-radius: 8px }

    #chart-wrap {
      flex: 1;
      /* redesign: dark-integrate the plot field — was #fff (a white island bolted onto the
         navy app, the biggest "two unrelated UIs" break); now a framed dark panel matching
         mill-force, so the chart reads as part of one app. */
      background: var(--dk);
      margin: 0 8px 8px;
      border: 1px solid var(--brd);
      border-radius: 0 0 8px 8px;
      position: relative;
      overflow: hidden;
      box-shadow: 0 1px 4px rgba(0,0,0,.28)
    }

    #chart-svg, #mc-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block }
    #mc-canvas { pointer-events: none }

    #chart-tip {
      position: absolute;
      pointer-events: none;
      background: rgba(15,23,42,.9);
      color: var(--t1);
      padding: 6px 10px;
      border-radius: 6px;
      font-size: 11px;
      opacity: 0;
      transition: opacity .1s;
      line-height: 1.7;
      z-index: 20;
      white-space: nowrap
    }

    /* ── SCRUBBER ── */
    #scr {
      height: var(--sch);
      background: var(--mid);
      border-bottom: 1px solid var(--brd);
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 0 12px;
      margin: 7px 8px 0;
      border-radius: 8px 8px 0 0;
      flex-shrink: 0
    }

    #scr.hidden { display: none }

    #play-btn {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      border: none;
      background: var(--blue);
      color: var(--dk);
      cursor: pointer;
      font-size: 11px;
      flex-shrink: 0;
      transition: background .15s;
      display: flex;
      align-items: center;
      justify-content: center
    }

    #play-btn::before { content: ''; }

    #play-btn:hover { background: var(--blu2) }
    #time-sl { flex: 1 }

    #t-lbl { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; color: var(--t1) }
    .fail-badge { font-size: 10.5px; min-width: 80px; text-align: right; color: #f87171; font-variant-numeric: tabular-nums }

    /* ── FLOATING WINDOWS ── */
    #wl { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 200 }

    .fw {
      position: absolute;
      pointer-events: all;
      background: #fff;
      border-radius: 10px;
      box-shadow: 0 8px 32px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.07);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      min-width: 300px;
      min-height: 140px
    }

    .fw-tb { background: var(--dk); padding: 7px 9px; display: flex; align-items: center; gap: 7px; cursor: grab; flex-shrink: 0; border-radius: 10px 10px 0 0; user-select: none }
    .fw-tb:active { cursor: grabbing }
    .fw-title { flex: 1; font-size: 12px; font-weight: 600; color: var(--t1) }

    .fw-btn { width: 18px; height: 18px; border-radius: 3px; border: none; background: rgba(255,255,255,.1); color: var(--t2); cursor: pointer; font-size: 10px; display: flex; align-items: center; justify-content: center; transition: background .1s }
    .fw-btn:hover { background: rgba(255,255,255,.2); color: var(--t1) }
    .fw-body { flex: 1; overflow: auto; position: relative }
    .fw-rz { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, #e2e8f0 50%) }

    .stbl { width: 100%; border-collapse: collapse; font-size: 11.5px }
    .stbl th { background: #f8fafc; color: #475569; font-weight: 600; padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--brdl); font-size: 10px; text-transform: uppercase; letter-spacing: .04em }
    .stbl td { padding: 5px 8px; border-bottom: 1px solid #f1f5f9; color: #1e293b }
    .stbl .num { font-variant-numeric: tabular-nums; text-align: right }
    .stbl tr:last-child td { border-bottom: none }

    .sc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px }

    .anova-stat { display: flex; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid var(--brdl) }
    .anova-kv { display: flex; flex-direction: column; gap: 2px }
    .anova-k { font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; font-weight: 600 }
    .anova-v { font-size: 16px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums }
    .anova-sig { font-size: 10px; padding: 2px 7px; border-radius: 3px; font-weight: 600; align-self: center }
    .anova-sig.yes { background: #dcfce7; color: #15803d }
    .anova-sig.no  { background: #f1f5f9; color: #64748b }
    .anova-note { font-size: 10.5px; color: #64748b; padding: 6px 12px; border-bottom: 1px solid var(--brdl) }

    .leg-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px }
    .leg-sw { width: 13px; height: 13px; border-radius: 3px; flex-shrink: 0; opacity: .85 }
    .leg-row span { font-size: 10.5px; color: var(--t2) }

    .bs-edit-form { display: none; padding: 6px 8px 8px; background: rgba(0,0,0,.18); border-top: 1px solid var(--brd) }
    .bs-edit-form.open { display: block }

    .bs-ef-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px }
    .bs-ef-row label { font-size: 10px; color: var(--t2); width: 40px; flex-shrink: 0 }
    .bs-ef-row input[type=text] { flex: 1; background: var(--dk); color: var(--t1); border: 1px solid var(--brd); border-radius: 3px; padding: 3px 6px; font-size: 11px }
    .bs-ef-row input[type=color] { width: 32px; height: 22px; border: none; background: none; cursor: pointer; padding: 0; border-radius: 3px }
    .bs-ef-save { background: var(--blue); color: var(--dk); border: none; border-radius: 3px; padding: 3px 10px; font-size: 10px; cursor: pointer; font-weight: 600 }

    .edit-group { background: rgba(0,0,0,.2); border-radius: 5px; padding: 8px 9px; margin-bottom: 7px }
    .edit-group-title { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--t2); margin-bottom: 6px }

    .efield-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px }
    .efield-row label { font-size: 10px; color: var(--t2); flex: 1 }
    .efield-row input[type=text] { flex: 2; background: var(--dk); color: var(--t1); border: 1px solid var(--brd); border-radius: 3px; padding: 2px 5px; font-size: 11px }
    .efield-row input[type=number] { width: 52px; background: var(--dk); color: var(--t1); border: 1px solid var(--brd); border-radius: 3px; padding: 2px 5px; font-size: 11px; text-align: right }
    .efield-row input[type=color] { width: 30px; height: 20px; border: none; background: none; cursor: pointer; padding: 0 }

    .annot-list { margin-top: 4px }
    .annot-row { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; background: rgba(255,255,255,.04); border-radius: 3px; padding: 3px 5px }
    .annot-row input[type=text] { flex: 1; background: var(--dk); color: var(--t1); border: 1px solid var(--brd); border-radius: 3px; padding: 2px 4px; font-size: 10.5px }
    .annot-row input[type=number] { width: 46px; background: var(--dk); color: var(--t1); border: 1px solid var(--brd); border-radius: 3px; padding: 2px 4px; font-size: 10.5px; text-align: right }
    .annot-del { background: none; border: none; color: var(--t2); cursor: pointer; padding: 1px 3px; border-radius: 2px; font-size: 10px }
    .annot-del:hover { background: rgba(220,38,38,.2); color: #f87171 }

    .add-annot-btn { width: 100%; padding: 5px; background: rgba(140,196,212,.1); border: 1px dashed rgba(140,196,212,.35); border-radius: 4px; color: var(--blue); font-size: 11px; cursor: pointer; font-weight: 500; margin-top: 4px; transition: all .15s }
    .add-annot-btn:hover { background: rgba(140,196,212,.2) }

    body.edit-mode #chart-svg { cursor: crosshair }
    body.edit-mode #chart-svg [data-editable] { cursor: pointer }
    body.edit-mode #chart-svg [data-editable]:hover { opacity: .75 }
    .edit-selected { outline: 2px dashed var(--blue) }

    /* ── MILL CHARGE VIEW ── */
    #view-mill { flex: 1; display: none; flex-direction: column; overflow: hidden; }

    #mill-body { flex: 1; display: flex; overflow: hidden; }

    #mill-sb {
      width: var(--sw);
      min-width: var(--sw);
      background: var(--mid);
      border-right: 1px solid var(--brd);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    #mill-sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
    #mill-sb-scroll::-webkit-scrollbar { width: 4px; }
    #mill-sb-scroll::-webkit-scrollbar-thumb { background: var(--brd); border-radius: 2px; }

    #mill-main { flex: 1; display: flex; overflow: hidden; background: var(--dk); padding: 16px; }
    /* redesign: framed + titled chart panel — matches goodman/mill-force so the trio reads as
       one system (consistency: mill-charge's plot was full-bleed + unframed). */
    #mill-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface2); border: 1px solid var(--brd); border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.28); }
    #mill-chart-title { padding: 9px 14px; border-bottom: 1px solid var(--brd); background: rgba(0,0,0,.10); font-size: 13px; font-weight: 600; color: var(--t1); flex-shrink: 0; }

    #mill-canvas-wrap {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 8px; /* redesign: trim padding so the enlarged charge diagram fills more of the canvas */
      min-width: 0;
    }

    #mill-canvas {
      width: 100%;
      height: 100%;
      display: block;
      border-radius: 10px;
    }

    #mill-metrics {
      width: 190px;
      min-width: 190px;
      background: var(--mid);
      border-left: 1px solid var(--brd);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    #mill-metrics-hdr {
      padding: 10px 12px;
      border-bottom: 1px solid var(--brd);
      font-size: 9.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: var(--t2);
    }

    /* redesign: the metrics rail shares mill-force's hero-card vocabulary — the regime
       (the one thing this screen exists to tell you) leads as a hero banner, each metric
       sits in its own card with a teal accent rail + strong value hierarchy. Was a flat
       undifferentiated label/value list (recolor); now reads as designed + consistent. */
    #mill-metrics-panel { padding: 12px; display: flex; flex-direction: column; gap: 8px; }

    .mill-metric-row {
      position: relative;
      display: flex;
      flex-direction: column; /* unified trio card: label-above-value (was horizontal row), matches .mfk/.gh-card */
      gap: 3px;
      background: var(--surface2);
      border: 1px solid var(--brd);
      border-radius: var(--r-sm);
      padding: 9px 11px 9px 14px;
      overflow: hidden;
    }
    .mill-metric-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }

    .mill-metric-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--t3); }
    .mill-metric-val { font-size: 15px; font-weight: 700; color: var(--t1); font-variant-numeric: tabular-nums; letter-spacing: -.3px; }

    /* regime = the headline; flex order lifts it to the top of the rail (no JS change) */
    /* regime hero = the screen's card vocabulary (not a solid box): surface2 + rail + label + value,
       rail/value colored by the regime (--rail = the badge color; cataracting is now orange not red). */
    .mill-regime-badge {
      order: -1; position: relative;
      margin: 0 0 3px;
      padding: 9px 11px 9px 14px;
      background: var(--surface2);
      border: 1px solid var(--brd);
      border-radius: var(--r-sm);
      overflow: hidden;
      display: flex; flex-direction: column; gap: 3px;
    }
    .mill-regime-badge::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rail, var(--orange)); }
    .mrb-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--t3); }
    .mrb-val { font-size: 15px; font-weight: 800; letter-spacing: .04em; color: var(--rail, var(--t1)); }

    .mill-preset-btn {
      display: block;
      width: 100%;
      text-align: left;
      padding: 6px 8px;
      margin-bottom: 4px;
      background: rgba(0,0,0,.18);
      border: 1px solid var(--brd);
      border-radius: 5px;
      color: var(--t1);
      font-size: 11.5px;
      cursor: pointer;
      transition: background .1s;
    }
    .mill-preset-btn:hover { background: rgba(140,196,212,.12); border-color: rgba(140,196,212,.35); }

    #spd-wrap { display: flex; align-items: center; gap: 4px; flex-shrink: 0 }
    #spd-sl { width: 72px; accent-color: var(--blue); cursor: pointer }
    #spd-lbl { font-size: 10.5px; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; color: var(--t1) }

    #trail-wrap { display: flex; align-items: center; gap: 3px; flex-shrink: 0; cursor: pointer }
    #trail-wrap label { font-size: 10.5px; color: var(--t2); cursor: pointer }
    #trail-cb { accent-color: var(--blue); cursor: pointer }

    .cloud-note { font-size: 9.5px; color: var(--t2); margin-top: 5px; font-style: italic }

    /* ── AUTH VIEWS (login / signout) — position:fixed, overlay everything ── */
    /* Logo fix: images in column-flex containers must not stretch on the cross-axis */
    .auth-hero img { align-self: flex-start; }
    .auth-form-logo img { align-self: flex-start; }
    #view-login, #view-signout {
      position: fixed;
      inset: 0;
      display: none;
      z-index: 1000;
    }

    .auth-left {
      flex: 0 0 55%;
      background:
        linear-gradient(160deg, rgba(12,20,42,0.91) 0%, rgba(36,54,90,0.86) 55%, rgba(18,28,55,0.93) 100%),
        url(img/main.png) center / cover no-repeat;
      display: flex;
      flex-direction: column;
      padding: 32px 40px;
      position: relative;
      overflow: hidden;
    }

    /* Subtle grid overlay */
    .auth-left::before {
      content: '';
      position: absolute;
      inset: 0;
      background-image:
        linear-gradient(rgba(140,196,212,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140,196,212,.035) 1px, transparent 1px);
      background-size: 44px 44px;
      pointer-events: none;
    }

    .auth-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      position: relative;
      z-index: 1;
    }

    .auth-brand-div {
      width: 1px;
      height: 20px;
      background: rgba(140,196,212,.35);
    }

    .auth-hero {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      position: relative;
      z-index: 1;
      padding: 0 8px;
    }

    .auth-tagline {
      font-size: 28px;
      font-weight: 700;
      color: var(--t1);
      line-height: 1.22;
      margin-bottom: 14px;
      letter-spacing: -.025em;
    }

    .auth-tagline em {
      color: var(--blue);
      font-style: normal;
    }

    .auth-sub {
      font-size: 13px;
      color: rgba(148,163,184,.85);
      line-height: 1.65;
      margin-bottom: 34px;
      max-width: 380px;
    }

    .auth-bullets {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .auth-bullet {
      display: flex;
      align-items: center;
      gap: 11px;
      font-size: 12.5px;
      color: rgba(241,245,249,.78);
    }

    .auth-bullet-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--blue);
      flex-shrink: 0;
      box-shadow: 0 0 0 3px rgba(140,196,212,.18);
    }

    .auth-footer {
      font-size: 10px;
      color: rgba(148,163,184,.45);
      position: relative;
      z-index: 1;
    }

    /* Right form panel */
    .auth-right {
      flex: 1;
      background: #f8fafc;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 40px 36px;
    }

    .auth-form-wrap { width: 100%; max-width: 372px; }

    .auth-form-logo { margin-bottom: 26px; }

    .auth-form-title {
      font-size: 22px;
      font-weight: 700;
      color: #0f172a;
      margin-bottom: 5px;
      letter-spacing: -.025em;
    }

    .auth-form-sub {
      font-size: 12px;
      color: #64748b;
      margin-bottom: 26px;
    }

    /* Microsoft SSO button */
    .ms-btn {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 11px;
      padding: 12px 18px;
      background: #2f2f2f;
      color: #fff;
      border: none;
      border-radius: var(--r-sm); /* redesign: unify rounded language */
      font-size: 13.5px;
      font-weight: 500;
      cursor: pointer;
      transition: background .15s;
      letter-spacing: .01em;
      margin-bottom: 20px;
      font-family: inherit;
    }

    .ms-btn:hover:not(:disabled) { background: #1a1a1a; }

    .ms-btn:disabled {
      cursor: default;
      opacity: .78;
    }

    /* Divider */
    .auth-divider {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 20px;
    }

    .auth-divider-line { flex: 1; height: 1px; background: #e2e8f0; }

    .auth-divider-text {
      font-size: 11px;
      color: #94a3b8;
      white-space: nowrap;
    }

    /* Fields */
    .auth-field { margin-bottom: 14px; }

    .auth-field label {
      display: block;
      font-size: 11.5px;
      font-weight: 600;
      color: #374151;
      margin-bottom: 5px;
    }

    .auth-input {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid #d1d5db;
      border-radius: var(--r-sm); /* redesign: unify rounded language */
      font-size: 13px;
      color: #0f172a;
      background: #fff;
      transition: border-color .15s, box-shadow .15s;
      outline: none;
      font-family: inherit;
    }

    .auth-input:focus {
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(140,196,212,.2);
    }

    .auth-pw-wrap { position: relative; }

    .auth-pw-toggle {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      cursor: pointer;
      color: #94a3b8;
      width: 28px;
      height: 28px;
      padding: 0;
      display: grid;
      place-items: center;
    }

    .auth-pw-toggle:hover { color: #475569; }

    .auth-eye {
      width: 18px;
      height: 18px;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.8;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .auth-pw-toggle[data-visible="true"] .auth-eye-open { display: none; }
    .auth-pw-toggle:not([data-visible="true"]) .auth-eye-closed { display: none; }

    .auth-forgot {
      text-align: right;
      margin-top: -8px;
      margin-bottom: 20px;
    }

    .auth-forgot a {
      font-size: 11px;
      color: var(--blu2);
      text-decoration: none;
    }

    .auth-forgot a:hover { text-decoration: underline; }

    .auth-submit {
      width: 100%;
      padding: 11.5px;
      /* redesign: the primary CTA carries the brand — navy -> teal gradient instead of flat
         navy, so the control users focus on reads as Engentus (critique: no brand in controls) */
      background: linear-gradient(135deg, var(--mid) 0%, #2f5d86 100%);
      color: #fff;
      border: none;
      border-radius: var(--r-sm); /* redesign: unify rounded language */
      font-size: 13.5px;
      font-weight: 600;
      cursor: pointer;
      transition: background .15s, transform .1s, box-shadow .15s;
      letter-spacing: .015em;
      font-family: inherit;
      box-shadow: var(--sh-1); /* redesign: subtle designed lift */
    }

    .auth-submit:hover { background: linear-gradient(135deg, #34507f 0%, var(--blu2) 100%); box-shadow: var(--sh-2); transform: translateY(-1px); }
    .auth-submit:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; } /* teal focus ring = brand + a11y */

    /* a11y (WCAG 2.4.7 Focus Visible): every keyboard-focusable control gets the SAME brand
       teal focus ring — previously only login had one. Uses :focus-visible so mouse clicks stay
       clean; covers the button-based tabs/pills, the model radios, buttons, and data-nav chrome.
       (Module cards are div[onclick] w/o tabindex — keyboard focusability is a separate markup step.) */
    button:focus-visible,
    .mill-force-pill:focus-visible,
    .tab:focus-visible, .ws-tab:focus-visible,
    .radio-chip:focus-visible,
    input:focus-visible,
    .save-sim-btn:focus-visible,
    .up-mi:focus-visible,
    [data-nav]:focus-visible,
    .mod-card:focus-visible,
    a:focus-visible {
      outline: 2px solid var(--blue);
      outline-offset: 2px;
      border-radius: 6px;
    }

    /* a11y (WCAG 2.3.3): honor a user's reduced-motion preference — kill the continuous "Live"
       pulse and collapse transform lifts / animations to near-instant, while keeping the UI
       responsive (state still changes, just without motion). Only active when opted in. */
    @media (prefers-reduced-motion: reduce) {
      .news-live-dot { animation: none; }
      *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
      }
    }

    .auth-error {
      min-height: 16px;
      margin: 10px 0 0;
      font-size: 11px;
      color: #dc2626;
    }

    .auth-notice {
      position: fixed;
      top: 18px;
      right: 18px;
      z-index: 1400;
      display: none;
      max-width: min(360px, calc(100vw - 32px));
      padding: 12px 14px;
      border: 1px solid rgba(220,38,38,.32);
      border-left: 4px solid #dc2626;
      border-radius: 6px;
      background: rgba(255,255,255,.98);
      color: #7f1d1d;
      box-shadow: 0 16px 36px rgba(15,23,42,.22);
      font-size: 12px;
      line-height: 1.45;
      font-weight: 600;
    }

    .auth-notice.show { display: block; }

    .auth-hint {
      margin-top: 12px;
      font-size: 10.5px;
      color: #64748b;
      line-height: 1.45;
    }

    .auth-form-footer {
      margin-top: 22px;
      font-size: 10.5px;
      color: #94a3b8;
      text-align: center;
      line-height: 1.65;
    }

    .auth-form-footer a { color: var(--blu2); text-decoration: none; }
    .auth-form-footer a:hover { text-decoration: underline; }

    /* ── PAGE-TURN ANIMATION ── */
    /* Perspective sits on the fixed container; the inner .auth-book is the "page" */
    #view-login  { perspective: 2200px; perspective-origin: 50% 50%; }
    #view-signout { perspective: 2200px; perspective-origin: 50% 50%; }

    .auth-book {
      width: 100%;
      height: 100%;
      display: flex;
      flex-shrink: 0;
      position: relative;
      transform-origin: right center;
      transition: transform 0.9s cubic-bezier(0.77, 0, 0.175, 1);
      backface-visibility: hidden;
      will-change: transform;
    }

    /* Fold shadow — grows on the right edge as the page turns away */
    .auth-book::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(to left,
        rgba(0,0,0,.6) 0%, rgba(0,0,0,.15) 18%, transparent 45%);
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.9s cubic-bezier(0.77, 0, 0.175, 1);
    }

    .auth-book.folding::after { opacity: 1; }

    /* Sign-out incoming flip: shadow is on the left edge instead */
    #view-signout .auth-book { transform-origin: left center; }
    #view-signout .auth-book::after {
      background: linear-gradient(to right,
        rgba(0,0,0,.6) 0%, rgba(0,0,0,.15) 18%, transparent 45%);
    }

    /* Loading spinner for the sign-in button */
    @keyframes authSpin { to { transform: rotate(360deg); } }

    .auth-spinner {
      display: inline-block;
      width: 13px;
      height: 13px;
      border: 2px solid rgba(255,255,255,.28);
      border-top-color: rgba(255,255,255,.9);
      border-radius: 50%;
      animation: authSpin 0.65s linear infinite;
      vertical-align: -2px;
      margin-right: 5px;
      flex-shrink: 0;
    }

    .ms-btn .auth-spinner {
      border-color: rgba(255,255,255,.28);
      border-top-color: rgba(255,255,255,.9);
    }

    /* Signout confirmation */
    .auth-signout-icon {
      width: 54px;
      height: 54px;
      border-radius: 50%;
      background: var(--grn);
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 20px;
      font-size: 24px;
      color: #fff;
    }

    .auth-so-title {
      font-size: 21px;
      font-weight: 700;
      color: #0f172a;
      margin-bottom: 9px;
      letter-spacing: -.025em;
      text-align: center;
    }

    .auth-so-sub {
      font-size: 12.5px;
      color: #64748b;
      text-align: center;
      margin-bottom: 28px;
      line-height: 1.55;
    }

    #view-mill-force { flex: 1; display: none; flex-direction: column; overflow: hidden; }

    /* ── MILL FORCE STYLES (mirrors mill-force-main.js layout) ── */
    #mill-force-body { flex: 1; display: flex; overflow: hidden; }

    #mill-force-sb {
      width: var(--sw);
      background: var(--mid);
      border-right: 1px solid var(--brd);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      flex-shrink: 0;
    }

    #mill-force-sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
    #mill-force-sb-scroll::-webkit-scrollbar { width: 4px; }
    #mill-force-sb-scroll::-webkit-scrollbar-thumb { background: var(--brd); border-radius: 2px; }

    /* redesign: the analysis canvas breathes — padded, with a hero KPI band over a framed chart panel */
    #mill-force-chart-area { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--dk); overflow: hidden; }

    /* redesign: HERO KPI BAND — headline force results, surfaced (mirrors the home hero's "show what matters") */
    /* hero-ify (F2): two tiers — the PEAK loads lead big, the input-derived metrics demote small */
    #mill-force-kpis { display: flex; flex-direction: column; gap: 9px; flex-shrink: 0; }
    #mill-force-kpis.empty { display: none; }
    .mfk-hero-row { display: flex; gap: 12px; }
    .mfk-sub-row { display: flex; gap: 8px; }
    .mfk { flex: 1 1 0; min-width: 100px; background: var(--surface2); border: 1px solid var(--brd); border-radius: var(--r-sm); padding: 12px 14px 12px 16px; display: flex; flex-direction: column; gap: 5px; position: relative; overflow: hidden; }
    .mfk::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); } /* teal accent rail */
    .mfk.peak { padding: 14px 16px 15px 18px; } /* hero: the peak load that matters in the field */
    .mfk.peak::before { background: var(--orange); width: 4px; }
    .mfk.sub { padding: 8px 10px 8px 12px; background: rgba(53,70,107,.5); } /* demoted secondary metric */
    .mfk.sub.peak::before { background: var(--orange); } /* MAX F_R: demoted but still a peak (orange rail) */
    .mfk-hero-row .mfk { flex: 0 1 300px; } /* the single hero card — prominent, not stretched full-width */
    .mfk-label { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--t3); white-space: nowrap; }
    .mfk.sub .mfk-label { font-size: 9px; }
    .mfk-val { font-size: 23px; line-height: 1; font-weight: 700; color: var(--t1); letter-spacing: -.5px; }
    .mfk.peak .mfk-val { font-size: 30px; } /* the headline number */
    .mfk.sub .mfk-val { font-size: 16px; color: var(--t2); }
    .mfk-unit { font-size: 12px; font-weight: 500; color: var(--t3); margin-left: 4px; letter-spacing: 0; }
    .mfk.sub .mfk-unit { font-size: 10px; }
    .mfk-diff { font-size: 10px; color: var(--orange); font-weight: 500; }

    /* redesign: framed analysis panel — the chart sits in an intentional card, not floating in void */
    #mill-force-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface2); border: 1px solid var(--brd); border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.28); }
    #mill-force-chart-tabs { display: flex; gap: 0; padding: 8px 12px; border-bottom: 1px solid var(--brd); background: rgba(0,0,0,.10); flex-shrink: 0; }
    /* nav: clean underline tabs for in-content section nav (active = teal text + teal underline) */
    /* chart-view tabs: LIFT the mockup's .ws-tab/.tab pill treatment (teal-dim active bg + blue +
       ring) instead of the under-lifted underline — one tab/pill active vocabulary across the app. */
    .mill-force-cht-tab { background: transparent; border: 1px solid transparent; color: var(--t2); padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 550; transition: .12s; }
    .mill-force-cht-tab:hover { color: var(--t1); background: rgba(255,255,255,.04); }
    .mill-force-cht-tab.active { background: rgba(140,196,212,.14); color: var(--blue); border-color: rgba(140,196,212,.3); font-weight: 650; box-shadow: inset 0 0 0 1px rgba(140,196,212,.25); }

    #mill-force-chart-wrap { flex: 1; overflow: hidden; position: relative; background: var(--dk); display: flex; flex-direction: column; }
    #mill-force-chart-title {
      padding: 10px 16px 0;
      color: var(--t1);
      font-size: 13px;
      font-weight: 600;
      flex-shrink: 0;
    }
    #mill-force-empty {
      margin: 16px;
      padding: 12px 14px;
      border: 1px dashed var(--brd);
      border-radius: 6px;
      color: var(--t2);
      font-size: 11px;
      background: rgba(140,196,212,.05);
      flex-shrink: 0;
    }
    #mill-force-svg { width: 100%; height: 100%; flex: 1; min-height: 0; }
    #mill-force-tip { position: absolute; background: rgba(29,39,83,.95); color: #f1f5f9; padding: 8px 12px; border-radius: 5px; font-size: 10.5px; z-index: 100; pointer-events: none; display: none; border: 1px solid var(--brd); box-shadow: 0 4px 12px rgba(0,0,0,.4); }

    .mill-force-mode-pills { display: flex; gap: 6px; padding: 6px 0; }
    .mill-force-pill { background: var(--dk); border: 1px solid var(--brd); color: var(--t2); padding: 5px 14px; border-radius: var(--r-sm); cursor: pointer; font-size: 11px; transition: all 0.15s; } /* redesign: rounded to match the designed language */
    .mill-force-pill:hover { background: rgba(140,196,212,.08); border-color: var(--brd); }
    .mill-force-pill.active { background: rgba(140,196,212,.14); color: var(--blue); border-color: rgba(140,196,212,.35); font-weight: 650; box-shadow: inset 0 0 0 1px rgba(140,196,212,.25); } /* match the unified teal-dim active (was too weak) */

    /* Ore/Charge selector — LIFT the mockup's authored treatment (was a clipping button row;
       Review note: 'a row of buttons aint it' / 'copy my full redesign'. Mockup screens/mill-charge.mjs:23
       = .pills.pills-grid (2-col wrapping grid) + theme.mjs chips. Scoped to mill-charge so
       mill-force's mode pills stay a row. Now wraps to fit the sidebar — no clip, reads designed. */
    #view-mill .mill-force-mode-pills {
      display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
      padding: 3px; background: var(--bg2); border: 1px solid var(--brd); border-radius: 10px;
    }
    #view-mill .mill-force-pill {
      background: transparent; border: none; padding: 7px 6px; border-radius: 7px;
      color: var(--t2); font-size: 11px; font-weight: 550; text-align: center;
    }
    #view-mill .mill-force-pill:hover { background: rgba(140,196,212,.07); color: var(--t1); }
    #view-mill .mill-force-pill.active {
      background: rgba(140,196,212,.14); color: var(--blue); font-weight: 650;
      box-shadow: inset 0 0 0 1px rgba(140,196,212,.25);
    }
    .mill-force-model-radio { display: flex; gap: 12px; padding: 4px 0; }
    .mill-force-model-option { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 11px; }
    .mill-force-model-option input:disabled + span { opacity: 0.55; }

    .prow { margin: 8px 0; display: flex; flex-direction: column; gap: 4px; }
    .prow-top { display: flex; justify-content: space-between; align-items: center; }
    .plabel { font-size: 11px; color: var(--t2); }
    .pval { font-size: 11px; color: var(--blue); font-weight: 600; }
    /* Different sized sliders: this was a 4px var(--brd) track orphan overriding the
       unified refined input[type=range] .uslider (5px). Neutralized so mill-force + mill-charge
       sliders inherit the ONE slider vocabulary. (class kept for JS; only the conflicting track
       props removed.) */
    .mill-force-slider { cursor: pointer; }

    .mill-force-result-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 11px; }
    .mill-force-rl { color: var(--t2); }
    .mill-force-rv { color: var(--t1); font-weight: 600; }
    .mill-force-rd { color: var(--ylw); font-size: 10px; }
    .mill-force-empty-results { color: var(--t2); font-size: 11px; padding-top: 6px; }

    .mill-force-mc-toggle { cursor: pointer; }
    .mill-force-mc-toggle:hover { color: var(--blue); }
    .mc-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 11px; }
    .rbtn { background: var(--mid); border: 1px solid var(--brd); color: var(--t1); padding: 4px 12px; border-radius: 3px; cursor: pointer; font-size: 10px; transition: all 0.15s; }
    .rbtn:hover:not(:disabled) { background: rgba(140,196,212,.12); border-color: rgba(140,196,212,.35); color: var(--blue); }
    .rbtn:disabled { opacity: 0.5; cursor: not-allowed; }
