/* ============================================================
   Mythox — Visual Systems OS · native page (rebuilt 2026-06-11)
   Brand OS tokens only (assets/brand.css). Sandboxed by #systems-root.
   Replaces the old gold-literal stylesheet — every color is a token,
   so the page recolors with the 4 palettes + light/dark.
   ============================================================ */
#systems-root{
  --danger:var(--red);
  --sys-pad:clamp(16px,3vw,40px);
  color:var(--text);
  font-family:var(--sans);
  -webkit-font-smoothing:antialiased;
}
#systems-root .wrap{max-width:var(--max);margin:0 auto;padding:var(--sys-pad) var(--sys-pad) 80px;}
#systems-root *{box-sizing:border-box;}

/* ---------- section scaffolding ---------- */
#systems-root section{margin-top:clamp(40px,6vw,76px);scroll-margin-top:18px;}
#systems-root .sec-head{display:grid;grid-template-columns:auto 1fr;gap:6px 20px;align-items:start;margin-bottom:26px;}
#systems-root .sec-num{
  font-family:var(--mono);font-size:12px;font-weight:700;letter-spacing:.18em;
  color:var(--accent);padding-top:7px;grid-row:1/3;
}
#systems-root .sec-title h2{font-family:var(--serif);font-weight:600;font-size:clamp(22px,3.4vw,34px);line-height:1.08;margin:0 0 8px;letter-spacing:-.01em;}
#systems-root .sec-title p{color:var(--muted);font-size:14.5px;line-height:1.6;max-width:78ch;margin:0;}
#systems-root .sec-title em{color:var(--accent);font-style:italic;}
#systems-root .sec-title strong{color:var(--text);font-weight:650;}
#systems-root .sec-bar{grid-column:1/3;height:1px;background:linear-gradient(90deg,var(--accent),transparent 60%);opacity:.4;margin-top:8px;}

/* ---------- cards ---------- */
#systems-root .card{
  position:relative;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius-lg);padding:24px;transition:border-color .3s var(--ease),transform .3s var(--ease);
}
#systems-root .card:hover{border-color:var(--gold-line);}
#systems-root .card h3{font-family:var(--serif);font-size:18px;font-weight:600;margin:8px 0 8px;line-height:1.2;}
#systems-root .card h4{font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin:0 0 8px;}
#systems-root .card p{color:var(--muted);font-size:13.5px;line-height:1.62;margin:0 0 6px;}
#systems-root .card ul{margin:8px 0 0;padding-left:18px;color:var(--muted);font-size:13px;line-height:1.7;}
#systems-root .card ul strong{color:var(--text);}
#systems-root .card code{font-family:var(--mono);font-size:11.5px;color:var(--accent);background:var(--surface-2);padding:1px 6px;border-radius:5px;}
#systems-root .tag{
  display:inline-block;font-family:var(--mono);font-size:10.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:var(--accent);background:var(--gold-soft);border:1px solid var(--gold-line);padding:3px 10px;border-radius:999px;
}
#systems-root .grid{display:grid;gap:16px;}
#systems-root .grid-2{grid-template-columns:repeat(2,1fr);}
#systems-root .grid-3{grid-template-columns:repeat(3,1fr);}
#systems-root .grid-4{grid-template-columns:repeat(4,1fr);}

/* ============================================================
   HERO — constellation showcase
   ============================================================ */
#systems-root .sys-hero{
  display:grid;grid-template-columns:minmax(300px,0.82fr) 1.18fr;gap:clamp(20px,3vw,44px);align-items:center;
  margin-bottom:8px;padding-top:6px;
}
#systems-root .sys-hd-kicker{
  display:inline-flex;align-items:center;gap:8px;font-family:var(--mono);font-size:11.5px;font-weight:700;
  letter-spacing:.2em;text-transform:uppercase;color:var(--accent);margin-bottom:18px;
}
#systems-root .sys-hd-kicker .dot{width:7px;height:7px;border-radius:50%;background:var(--accent);box-shadow:0 0 12px var(--glow);animation:sysPulse 2.6s var(--ease) infinite;}
@keyframes sysPulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.5;transform:scale(.8)}}
#systems-root .sys-hd-title{font-family:var(--serif);font-weight:600;font-size:clamp(30px,4.6vw,56px);line-height:1.02;letter-spacing:-.02em;margin:0 0 18px;}
#systems-root .sys-hd-title em{color:var(--accent);font-style:italic;}
#systems-root .sys-hd-sub{color:var(--muted);font-size:15px;line-height:1.66;max-width:52ch;margin:0 0 22px;}
#systems-root .sys-hd-meta{display:flex;align-items:center;gap:12px;font-size:13px;color:var(--muted);margin-bottom:24px;}
#systems-root .sys-hd-meta strong{color:var(--text);font-family:var(--serif);font-size:18px;font-weight:600;}
#systems-root .sys-hd-meta .sep{color:var(--line-2);}
#systems-root .sys-hero-jump{display:flex;flex-wrap:wrap;gap:8px;}
#systems-root .chip{
  display:inline-flex;align-items:center;gap:7px;font-size:12.5px;font-weight:600;color:var(--text);text-decoration:none;
  background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:7px 14px;transition:all .25s var(--ease);
}
#systems-root .chip .num{font-family:var(--mono);font-size:10px;color:var(--accent);}
#systems-root .chip:hover{border-color:var(--accent);transform:translateY(-1px);box-shadow:0 6px 18px -10px var(--glow);}
#systems-root .chip.ghost{opacity:.7;}

#systems-root .sys-hero-map{position:relative;}
#systems-root .sys-hero-map #network{width:100%;}
#systems-root .systems-constel{width:100%;min-height:340px;}
#systems-root .map-legend{display:flex;flex-wrap:wrap;gap:14px;justify-content:center;margin-top:14px;}
#systems-root .map-legend .lg-row{display:inline-flex;align-items:center;gap:7px;font-family:var(--mono);font-size:11px;letter-spacing:.04em;color:var(--muted);}
#systems-root .lg-dot{width:9px;height:9px;border-radius:50%;display:inline-block;}
#systems-root .lg-dot[data-g="core"]{background:var(--accent);box-shadow:0 0 8px var(--glow);}
#systems-root .lg-dot[data-g="midas"]{background:var(--accent-2);}
#systems-root .lg-dot[data-g="solomon"]{background:color-mix(in srgb,var(--accent) 55%,var(--muted));}
#systems-root .lg-dot[data-g="course"]{background:var(--muted);}

/* ============================================================
   NATIVE ANIMATED DIAGRAMS
   ============================================================ */
#systems-root .diagram-card{padding:30px 26px;overflow:hidden;}
#systems-root .diagram-cap{color:var(--muted);font-size:13px;line-height:1.6;margin:18px 0 0;text-align:center;}
#systems-root .diagram-cap em{color:var(--accent);font-style:italic;font-family:var(--serif);}

/* --- System anatomy (Inputs -> Processes -> Outputs -> Feedback under Environment) --- */
#systems-root .env-label{
  display:inline-block;font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.18em;text-transform:uppercase;
  color:var(--muted);border:1px dashed var(--line-2);border-radius:8px;padding:5px 12px;margin-bottom:22px;
}
#systems-root .sys-anatomy{
  position:relative;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px;
  padding:14px 6px 8px;
}
#systems-root .sa-node{
  flex:1 1 150px;min-width:130px;max-width:230px;display:flex;flex-direction:column;gap:4px;text-align:center;
  background:var(--surface-2);border:1.5px solid var(--line);border-radius:14px;padding:18px 14px;
  will-change:translate;transition:border-color .3s var(--ease),box-shadow .3s var(--ease),transform .3s var(--ease);
}
#systems-root .sa-node .sa-k{font-family:var(--mono);font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;}
#systems-root .sa-node .sa-d{font-size:12.5px;color:var(--text);}
#systems-root .sa-node .sa-sub{font-size:11px;color:var(--muted);}
#systems-root .sa-in{border-color:var(--gold-line);}
#systems-root .sa-in .sa-k{color:var(--accent);}
#systems-root .sa-proc{flex:1.3 1 190px;max-width:280px;border-color:var(--accent);background:linear-gradient(180deg,var(--gold-soft),var(--surface-2));}
#systems-root .sa-proc .sa-k{color:var(--accent);}
#systems-root .sa-out .sa-k{color:var(--accent-2);}
#systems-root .sa-out{border-color:color-mix(in srgb,var(--accent-2) 40%,transparent);}
#systems-root .sa-fb{border-color:color-mix(in srgb,var(--ok) 45%,transparent);}
#systems-root .sa-fb .sa-k{color:var(--ok);}
#systems-root .sa-node:hover{box-shadow:0 0 0 1px var(--accent),0 10px 30px -16px var(--glow);transform:translateY(-3px) scale(1.02);}
#systems-root .sa-arrow{flex:0 0 auto;color:var(--accent);opacity:.6;width:40px;}
#systems-root .sa-arrow svg{width:100%;height:12px;display:block;}
#systems-root .sa-loop{
  flex-basis:100%;text-align:center;margin-top:14px;font-family:var(--mono);font-size:11px;letter-spacing:.1em;
  color:var(--ok);
}

/* --- Macro funnel (renderDashFunnel emits .funnel-row) --- */
#systems-root .funnel{display:flex;flex-direction:column;gap:9px;margin-top:6px;}
#systems-root .funnel-row{
  display:flex;align-items:center;gap:14px;margin:0 auto;padding:13px 18px;border-radius:12px;
  background:var(--surface-2)!important;border:1px solid var(--line);
  will-change:translate;transition:border-color .3s var(--ease),box-shadow .3s var(--ease);
  position:relative;overflow:hidden;
}
#systems-root .funnel-row::before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,var(--gold-soft),transparent 80%);opacity:.7;pointer-events:none;}
#systems-root .funnel-row:hover{border-color:var(--accent);box-shadow:0 8px 26px -16px var(--glow);}
#systems-root .funnel-row>*{position:relative;}
#systems-root .funnel-row .num{font-family:var(--mono);font-size:11px;font-weight:700;color:var(--accent);min-width:26px;}
#systems-root .funnel-row .stage{flex:1;font-size:13.5px;}
#systems-root .funnel-row .stage strong{color:var(--text)!important;font-weight:650;}

/* --- Pipe / bottleneck (native) --- */
#systems-root .pipe{display:flex;align-items:stretch;gap:8px;margin-top:8px;flex-wrap:wrap;}
#systems-root .pipe-seg{
  flex:1 1 150px;min-width:120px;display:flex;flex-direction:column;justify-content:flex-end;gap:8px;
  background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:14px;min-height:128px;
  will-change:translate;transition:border-color .3s var(--ease),box-shadow .3s var(--ease);position:relative;
}
#systems-root .pipe-seg .ps-k{font-size:12.5px;font-weight:650;color:var(--text);}
#systems-root .pipe-seg .ps-tag{font-family:var(--mono);font-size:9px;font-weight:700;letter-spacing:.12em;color:var(--red);}
#systems-root .pipe-seg .ps-bar{display:block;height:10px;border-radius:6px;width:var(--f);background:var(--accent);box-shadow:0 0 14px -2px var(--glow);transition:width .5s var(--ease);}
#systems-root .pipe-seg .ps-bar.yield{background:var(--ok);}
#systems-root .pipe-seg.choke{border-color:color-mix(in srgb,var(--red) 55%,transparent);}
#systems-root .pipe-seg.choke .ps-bar{background:var(--red);}
#systems-root .pipe-seg:hover{border-color:var(--accent);box-shadow:0 10px 28px -18px var(--glow);}
#systems-root .pipe-legend{display:flex;flex-wrap:wrap;gap:16px;margin-top:18px;}
#systems-root .pipe-legend span{display:inline-flex;align-items:center;gap:7px;font-size:11.5px;color:var(--muted);}
#systems-root .pipe-legend i{width:10px;height:10px;border-radius:3px;display:inline-block;}
#systems-root .pipe-legend .d-th{background:var(--accent);}
#systems-root .pipe-legend .d-bn{background:var(--red);}
#systems-root .pipe-legend .d-yd{background:var(--ok);}
#systems-root .pipe-legend .d-lt{background:var(--muted);}

/* --- Build -> Test -> Improve loop (native) --- */
#systems-root .loop{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px;margin-top:8px;}
#systems-root .loop-node{
  flex:0 0 auto;width:150px;height:150px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  background:radial-gradient(circle at 38% 30%,var(--gold-soft),var(--surface-2) 70%);
  border:2px solid var(--accent);text-align:center;will-change:translate;
  transition:box-shadow .3s var(--ease),transform .3s var(--ease);
}
#systems-root .loop-node .ln-num{font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.16em;color:var(--accent);}
#systems-root .loop-node .ln-k{font-family:var(--serif);font-size:19px;font-weight:600;color:var(--text);}
#systems-root .loop-node .ln-d{font-size:10.5px;color:var(--muted);}
#systems-root .loop-node:hover{box-shadow:0 0 28px -6px var(--glow);transform:scale(1.05);}
#systems-root .loop-edge{font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--accent);opacity:.7;}
#systems-root .loop-edge.return{color:var(--ok);flex-basis:100%;text-align:center;margin-top:4px;}

/* ============================================================
   KPI row · simulator · health tiles
   ============================================================ */
#systems-root .kpi-row{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-top:24px;margin-bottom:24px;}
#systems-root .kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px;}
#systems-root .kpi .lbl{font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-bottom:8px;}
#systems-root .kpi .val{font-family:var(--serif);font-size:28px;font-weight:600;line-height:1;}
#systems-root .kpi .val .unit{font-size:14px;color:var(--muted);}
#systems-root .kpi .delta{font-size:11px;color:var(--muted);margin-top:6px;}

#systems-root .sim-grid{display:grid;grid-template-columns:minmax(280px,360px) 1fr;gap:20px;align-items:start;}
#systems-root .controls{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:22px;}
#systems-root .controls h4{font-family:var(--mono);font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--accent);margin:0 0 16px;}
#systems-root .ctrl{margin-bottom:16px;}
#systems-root .ctrl-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:7px;}
#systems-root .ctrl-head label{font-size:12.5px;font-weight:600;color:var(--text);}
#systems-root .ctrl-head .v{font-family:var(--mono);font-size:12.5px;font-weight:700;color:var(--accent);}
#systems-root .ctrl-hint{font-size:11px;color:var(--muted);line-height:1.5;margin-top:6px;}
#systems-root .ctrl-hint b{color:var(--text);font-weight:600;}
#systems-root .ctrl select{
  width:100%;background:var(--surface-2);border:1px solid var(--line);border-radius:9px;color:var(--text);
  font-family:var(--sans);font-size:13px;padding:9px 11px;cursor:pointer;
}
#systems-root input[type="range"]{
  -webkit-appearance:none;appearance:none;width:100%;height:5px;border-radius:5px;
  background:var(--viz-track);outline:none;cursor:pointer;
}
#systems-root input[type="range"]::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border-radius:50%;background:var(--accent);box-shadow:0 0 10px -1px var(--glow);cursor:pointer;border:2px solid var(--surface);}
#systems-root input[type="range"]::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:var(--accent);border:2px solid var(--surface);cursor:pointer;}

/* typed simulator inputs + % / # unit toggle (Phase 4 Group C) */
#systems-root .ctrl .num-in{
  width:100%;background:var(--surface-2);border:1px solid var(--line);border-radius:9px;color:var(--text);
  font-family:var(--mono);font-size:14px;font-weight:600;padding:9px 11px;outline:none;
}
#systems-root .ctrl .num-in:focus-visible{border-color:var(--accent);box-shadow:0 0 0 3px var(--glow);}
#systems-root .rate-row{display:flex;gap:8px;align-items:stretch;}
#systems-root .rate-row .num-in{flex:1;min-width:0;}
#systems-root .unit-toggle{display:inline-flex;flex:0 0 auto;background:var(--surface-2);border:1px solid var(--line);border-radius:9px;overflow:hidden;}
#systems-root .unit-toggle .ut{
  appearance:none;border:0;background:transparent;color:var(--muted);cursor:pointer;
  font-family:var(--mono);font-size:11px;font-weight:700;padding:0 10px;white-space:nowrap;
}
#systems-root .unit-toggle .ut + .ut{border-left:1px solid var(--line);}
#systems-root .unit-toggle .ut.active{background:var(--accent);color:var(--surface);}
#systems-root .unit-toggle .ut:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;}

#systems-root .sim-out{display:flex;flex-direction:column;gap:18px;}
#systems-root .health-row{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;}
#systems-root .health-tile{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px;}
#systems-root .health-tile .lbl{font-family:var(--mono);font-size:9.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-bottom:8px;}
#systems-root .health-tile .val{font-family:var(--serif);font-size:24px;font-weight:600;line-height:1.1;}
#systems-root .health-tile .val.good{color:var(--ok);}
#systems-root .health-tile .val.warn{color:var(--warn);}
#systems-root .health-tile .val.bad{color:var(--red);}
#systems-root .sim-charts{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
#systems-root .sim-explain{background:var(--surface);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:var(--radius);padding:18px 20px;font-size:13.5px;line-height:1.7;color:var(--muted);}
#systems-root .sim-explain .tag{margin-bottom:10px;}
#systems-root .sim-explain strong{color:var(--text);}

/* ---------- chart boxes ---------- */
#systems-root .chart-box{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);padding:20px;}
#systems-root .chart-box h5{font-size:12.5px;font-weight:650;color:var(--text);margin:0 0 14px;}
#systems-root .chart-box canvas{width:100%!important;height:240px!important;}
#systems-root .sim-charts .chart-box canvas{height:210px!important;}

/* ============================================================
   data tables · worktables · save bars
   ============================================================ */
#systems-root .id-row{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:18px;}
#systems-root .id-row input{
  flex:1 1 150px;min-width:120px;background:var(--surface-2);border:1px solid var(--line);border-radius:9px;
  color:var(--text);font-family:var(--sans);font-size:13px;padding:10px 12px;
}
#systems-root .id-row input[type="number"]{flex:0 0 130px;}
#systems-root .id-row input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--gold-soft);}
#systems-root .data-table{width:100%;border-collapse:collapse;font-size:13px;}
#systems-root .data-table th{
  text-align:left;font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);padding:10px 12px;border-bottom:1px solid var(--line);
}
#systems-root .data-table td{padding:11px 12px;border-bottom:1px solid var(--line);color:var(--text);}
#systems-root .data-table tr:hover td{background:var(--surface-2);}
#systems-root .data-table .num{font-family:var(--mono);font-size:12px;color:var(--muted);}
#systems-root .pill{display:inline-block;font-family:var(--mono);font-size:10.5px;font-weight:700;padding:2px 9px;border-radius:999px;}
#systems-root .pill.fit{color:var(--ok);background:color-mix(in srgb,var(--ok) 14%,transparent);}
#systems-root .pill.warn{color:var(--warn);background:color-mix(in srgb,var(--warn) 16%,transparent);}
#systems-root .pill.kill{color:var(--red);background:color-mix(in srgb,var(--red) 15%,transparent);}
#systems-root .row-del{background:none;border:none;color:var(--muted);font-size:17px;cursor:pointer;line-height:1;padding:0 4px;transition:color .2s;}
#systems-root .row-del:hover{color:var(--red);}
#systems-root .empty{color:var(--muted);font-size:13px;line-height:1.6;padding:18px 4px;text-align:center;}

#systems-root .save-bar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin-top:18px;padding-top:16px;border-top:1px solid var(--line);}
#systems-root .save-bar .meta{font-size:11.5px;color:var(--muted);}
#systems-root .save-bar .meta strong{color:var(--text);}
#systems-root .save-bar .actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
#systems-root .save-status{font-family:var(--mono);font-size:10.5px;color:var(--muted);opacity:0;transition:opacity .3s;}
#systems-root .save-status.show{opacity:1;color:var(--ok);}

/* ---------- buttons ---------- */
#systems-root .btn{
  font-family:var(--sans);font-size:13px;font-weight:600;color:var(--ink-on-accent);background:var(--accent);
  border:1px solid var(--accent);border-radius:9px;padding:9px 16px;cursor:pointer;transition:all .25s var(--ease);
}
#systems-root .btn:hover{box-shadow:0 6px 18px -8px var(--glow);transform:translateY(-1px);}
#systems-root .btn.ghost{background:transparent;color:var(--text);border-color:var(--line);}
#systems-root .btn.ghost:hover{border-color:var(--accent);color:var(--accent);box-shadow:none;}
#systems-root .btn.small{font-size:12px;padding:7px 12px;}
#systems-root .btn.save{background:var(--surface-2);color:var(--accent);border-color:var(--gold-line);}
#systems-root .btn.saved{background:var(--ok);color:var(--ink-on-accent);border-color:var(--ok);}

/* ============================================================
   builder wizard
   ============================================================ */
#systems-root .builder-grid{display:grid;grid-template-columns:minmax(220px,280px) 1fr;gap:20px;align-items:start;}
#systems-root .step-nav{display:flex;flex-direction:column;gap:8px;}
#systems-root .step-nav button{
  display:flex;align-items:center;gap:12px;text-align:left;background:var(--surface);border:1px solid var(--line);
  border-radius:12px;padding:12px 14px;cursor:pointer;color:var(--muted);transition:all .25s var(--ease);width:100%;
}
#systems-root .step-nav button .sn{font-family:var(--mono);font-size:11px;font-weight:700;color:var(--muted);flex:0 0 auto;}
#systems-root .step-nav button .sl{font-size:12.5px;font-weight:600;line-height:1.25;}
#systems-root .step-nav button.active{border-color:var(--accent);background:var(--gold-soft);color:var(--text);}
#systems-root .step-nav button.active .sn{color:var(--accent);}
#systems-root .step-nav button.done .sn{color:var(--ok);}
#systems-root .step-nav button:hover{border-color:var(--gold-line);}
#systems-root .step-tag{display:inline-block;font-family:var(--mono);font-size:10.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--accent);margin-bottom:10px;}
#systems-root .step-stage h3{font-family:var(--serif);font-size:22px;font-weight:600;margin:0 0 8px;}
#systems-root .step-intro{color:var(--muted);font-size:13.5px;line-height:1.6;margin:0 0 20px;}
#systems-root .field{margin-bottom:16px;}
#systems-root .field label{display:block;font-size:12.5px;font-weight:600;color:var(--text);margin-bottom:7px;}
#systems-root .field input,#systems-root .field textarea{
  width:100%;background:var(--surface-2);border:1px solid var(--line);border-radius:9px;color:var(--text);
  font-family:var(--sans);font-size:13.5px;padding:10px 12px;resize:vertical;
}
#systems-root .field textarea{min-height:80px;line-height:1.5;}
#systems-root .field input:focus,#systems-root .field textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--gold-soft);}
#systems-root .field .hint{font-size:11px;color:var(--muted);margin-top:6px;font-style:italic;}
#systems-root .step-actions{display:flex;align-items:center;gap:16px;margin-top:24px;}
#systems-root .progress{flex:1;height:5px;background:var(--viz-track);border-radius:5px;overflow:hidden;}
#systems-root .progress-bar{height:100%;background:var(--accent);border-radius:5px;transition:width .4s var(--ease);box-shadow:0 0 10px var(--glow);}
#systems-root .checklist{display:grid;gap:10px;margin-top:8px;}
#systems-root .checklist label{display:flex;align-items:center;gap:12px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:12px 14px;cursor:pointer;font-size:13px;color:var(--muted);transition:all .2s;}
#systems-root .checklist label.checked{border-color:var(--ok);color:var(--text);}
#systems-root .checklist input{accent-color:var(--accent);width:16px;height:16px;}

/* ============================================================
   theory accordions · modules · exec weeks
   ============================================================ */
#systems-root .acc{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);margin-bottom:14px;overflow:hidden;}
#systems-root .acc>summary{display:flex;align-items:center;gap:14px;padding:20px 24px;cursor:pointer;list-style:none;user-select:none;transition:background .25s;}
#systems-root .acc>summary::-webkit-details-marker{display:none;}
#systems-root .acc>summary:hover{background:var(--surface-2);}
#systems-root .acc-k{font-family:var(--serif);font-size:17px;font-weight:600;color:var(--text);}
#systems-root .acc-h{flex:1;font-size:12.5px;color:var(--muted);}
#systems-root .acc-x{font-family:var(--mono);font-size:20px;color:var(--accent);transition:transform .3s var(--ease);line-height:1;}
#systems-root .acc[open]>summary .acc-x{transform:rotate(45deg);}
#systems-root .acc-body{padding:0 24px 24px;}
#systems-root .acc-intro{color:var(--muted);font-size:13.5px;line-height:1.6;margin:0 0 18px;}

#systems-root .module-card{background:var(--surface-2);border:1px solid var(--line);border-radius:14px;padding:18px;cursor:pointer;transition:all .25s var(--ease);}
#systems-root .module-card:hover{border-color:var(--gold-line);transform:translateY(-2px);}
#systems-root .module-card .mod-num{font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.1em;color:var(--accent);margin-bottom:8px;}
#systems-root .module-card h4{font-family:var(--serif);font-size:15px;font-weight:600;color:var(--text);text-transform:none;letter-spacing:0;margin:0 0 6px;}
#systems-root .module-card p{font-size:12.5px;color:var(--muted);line-height:1.55;margin:0;}
#systems-root .module-card .lessons{display:flex;justify-content:space-between;align-items:center;margin-top:12px;font-size:11px;color:var(--muted);}
#systems-root .module-card .lessons strong{font-size:18px;color:var(--accent);line-height:1;transition:transform .3s var(--ease);}
#systems-root .module-card .module-detail{max-height:0;overflow:hidden;opacity:0;font-size:12.5px;color:var(--muted);line-height:1.6;transition:all .35s var(--ease);}
#systems-root .module-card.open{border-color:var(--accent);}
#systems-root .module-card.open .module-detail{max-height:360px;opacity:1;margin-top:14px;padding-top:14px;border-top:1px solid var(--line);}
#systems-root .module-card.open .lessons strong{transform:rotate(45deg);display:inline-block;}

#systems-root .exec-week{background:var(--surface-2);border:1px solid var(--line);border-radius:14px;padding:18px;}
#systems-root .exec-week .wk{font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.12em;color:var(--accent);}
#systems-root .exec-week h4{font-family:var(--serif);font-size:16px;font-weight:600;color:var(--text);text-transform:none;letter-spacing:0;margin:6px 0 10px;}
#systems-root .exec-week ul{margin:0;padding-left:16px;color:var(--muted);font-size:12px;line-height:1.7;}

/* ---------- footer · back-to-top ---------- */
#systems-root .footer{display:flex;align-items:center;gap:16px;margin-top:60px;padding-top:24px;border-top:1px solid var(--line);}
#systems-root .footer .sig{font-family:var(--mono);font-size:10.5px;letter-spacing:.1em;color:var(--muted);}
#systems-root .footer .twin-bar{flex:1;height:2px;background:linear-gradient(90deg,var(--accent),var(--accent-2));border-radius:2px;opacity:.6;}
/* sits ABOVE the global AI dock launcher (bottom-right) so they never overlap */
#systems-root .totop{
  position:fixed;right:24px;bottom:92px;width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:var(--surface);border:1px solid var(--line);color:var(--accent);text-decoration:none;font-size:18px;
  opacity:0;pointer-events:none;transform:translateY(8px);transition:all .3s var(--ease);z-index:40;
}
#systems-root .totop.show{opacity:1;pointer-events:auto;transform:none;}
#systems-root .totop:hover{border-color:var(--accent);box-shadow:0 0 18px -4px var(--glow);}

/* ============================================================
   responsive
   ============================================================ */
/* ============================================================
   ACTIVE SYSTEMS (Group D) — system list + per-system detail
   ============================================================ */
/* empty state */
#systems-root .act-empty{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);
  padding:clamp(28px,5vw,48px) 28px;text-align:center;
}
#systems-root .act-empty p{color:var(--muted);font-size:14.5px;line-height:1.62;max-width:54ch;margin:0 auto 18px;}
#systems-root .act-empty strong{color:var(--text);font-weight:650;}

/* system list */
#systems-root .act-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px;}
#systems-root .act-card{
  display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%;text-align:left;
  font-family:inherit;color:inherit;cursor:pointer;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);
  padding:22px 24px;transition:border-color .3s var(--ease),transform .3s var(--ease);
}
#systems-root .act-card:hover{border-color:var(--accent);transform:translateY(-1px);}
#systems-root .act-card-name{font-family:var(--serif);font-size:19px;font-weight:600;line-height:1.2;}
#systems-root .act-card-meta{font-size:12.5px;color:var(--muted);line-height:1.55;}
#systems-root .act-card-go{font-family:var(--mono);font-size:11px;font-weight:700;letter-spacing:.06em;color:var(--accent);margin-top:2px;}

/* detail */
#systems-root .act-back{margin-bottom:18px;}
#systems-root .act-name{font-family:var(--serif);font-size:clamp(20px,2.6vw,26px);font-weight:600;line-height:1.12;margin:0 0 4px;}
#systems-root .act-metrics{margin-top:18px;}

/* tool launcher (KPI tracker / Improver, each reveals a moved section) */
#systems-root .act-tool{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);
  padding:22px 24px;margin-top:16px;
}
#systems-root .act-tool-head{display:flex;justify-content:space-between;align-items:center;gap:20px;}
#systems-root .act-tool-copy{flex:1;min-width:0;}
#systems-root .act-tool-t{font-family:var(--serif);font-size:16.5px;font-weight:600;line-height:1.25;margin:0 0 6px;display:flex;align-items:center;gap:8px;text-transform:none;letter-spacing:0;color:var(--text);}
#systems-root .act-tool-why{color:var(--muted);font-size:13px;line-height:1.6;margin:0;max-width:64ch;}
#systems-root .act-reveal{flex:0 0 auto;white-space:nowrap;}

/* holder where #tester / #improver are re-parented; neutralize the section top-margin */
#systems-root .act-holder{margin-top:18px;border-top:1px solid var(--line);padding-top:6px;}
#systems-root .act-holder section{margin-top:0;}

@media (max-width:1040px){
  #systems-root .sys-hero{grid-template-columns:1fr;}
  #systems-root .sim-grid{grid-template-columns:1fr;}
  #systems-root .builder-grid{grid-template-columns:1fr;}
  #systems-root .step-nav{flex-direction:row;overflow-x:auto;}
  #systems-root .step-nav button{flex:0 0 auto;}
}
@media (max-width:760px){
  #systems-root .grid-2,#systems-root .grid-3,#systems-root .grid-4{grid-template-columns:1fr;}
  #systems-root .kpi-row,#systems-root .health-row{grid-template-columns:repeat(2,1fr);}
  #systems-root .sim-charts{grid-template-columns:1fr;}
  #systems-root .sa-arrow{transform:rotate(90deg);width:24px;}
  #systems-root .sys-anatomy{flex-direction:column;}
  #systems-root .sa-node{max-width:none;width:100%;}
  #systems-root .act-tool-head{flex-direction:column;align-items:flex-start;gap:14px;}
  #systems-root .act-reveal{width:100%;}
}
@media (prefers-reduced-motion:reduce){
  #systems-root *{animation:none!important;transition:none!important;}
}
