/* ---------- Westcool brand tokens ----------
   Cyan #009DD9, charcoal #202020, Bebas Neue and Montserrat,
   taken from westcool.com.au                                    */
:root{
  --brand:#009dd9;
  --brand-deep:#0079a8;
  --brand-soft:#dcf0fa;
  --plant:#141a1f;            /* the dark band, same in both themes */
  --plant-ink:#e8eff4;

  --ground:#eaf0f4; --surface:#ffffff; --surface2:#f2f7fa; --surface3:#e0e9ef;
  --ink:#1a2126; --ink2:#5c6b76; --ink3:#8395a1;
  --line:#ccdae3; --line2:#dde7ed;
  --pipe:#93a9b8;

  --low:#009dd9;              /* suction, the cold side */
  --low-soft:#dcf0fa;
  --high:#c4362b;             /* discharge, the hot side */
  --high-soft:#f8e2df;
  --copper:#b0743a;           /* liquid line */
  --good:#1f7a55; --good-soft:#dbf0e6;
  --warn:#9a7314; --warn-soft:#f7edd3;
  --bad:#c4362b;  --bad-soft:#f8e2df;

  --shadow:0 1px 2px rgba(20,26,31,.06), 0 6px 18px rgba(20,26,31,.06);
  --mono:"IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans:"Montserrat", "Helvetica Neue", Arial, sans-serif;
  --display:"Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --r:4px;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --ground:#0c1114; --surface:#151c21; --surface2:#1b242a; --surface3:#243038;
    --ink:#e6eef3; --ink2:#94a6b2; --ink3:#6f818d;
    --line:#2a353d; --line2:#212b32;
    --pipe:#465661;
    --brand-soft:#0a2836; --brand-deep:#4cc0ee;
    --low-soft:#0a2836;
    --high:#e0705c; --high-soft:#331915; --bad:#e0705c; --bad-soft:#331915;
    --copper:#cd9155;
    --good:#46ab80; --good-soft:#0f2a20;
    --warn:#cfa646; --warn-soft:#2b2311;
    --shadow:0 1px 2px rgba(0,0,0,.45), 0 6px 20px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"]{
  --ground:#0c1114; --surface:#151c21; --surface2:#1b242a; --surface3:#243038;
  --ink:#e6eef3; --ink2:#94a6b2; --ink3:#6f818d;
  --line:#2a353d; --line2:#212b32;
  --pipe:#465661;
  --brand-soft:#0a2836; --brand-deep:#4cc0ee;
  --low-soft:#0a2836;
  --high:#e0705c; --high-soft:#331915; --bad:#e0705c; --bad-soft:#331915;
  --copper:#cd9155;
  --good:#46ab80; --good-soft:#0f2a20;
  --warn:#cfa646; --warn-soft:#2b2311;
  --shadow:0 1px 2px rgba(0,0,0,.45), 0 6px 20px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
body{
  margin:0; background:var(--ground); color:var(--ink);
  font-family:var(--sans); font-size:13.5px; line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{margin:0; font-weight:600; text-wrap:balance}
button{font:inherit; color:inherit}
:focus-visible{outline:2px solid var(--brand); outline-offset:2px; border-radius:3px}

.eyebrow{
  font-size:10px; font-weight:700; letter-spacing:.16em; text-transform:uppercase;
  color:var(--ink3);
}

/* ---------- masthead ---------- */
.masthead{
  position:relative; background:var(--plant); color:var(--plant-ink);
  border-bottom:3px solid var(--brand); overflow:hidden;
}
#frost{position:absolute; inset:0; width:100%; height:100%; opacity:.45; pointer-events:none}
.masthead-in{
  position:relative; max-width:1420px; margin:0 auto; padding:16px 20px 18px;
  display:flex; align-items:center; justify-content:space-between; gap:26px; flex-wrap:wrap;
}
.brand{display:flex; align-items:center; gap:16px; min-width:0}
.badge{width:58px; height:58px; flex:0 0 58px}
.brand h1{
  font-family:var(--display); font-size:40px; font-weight:400; line-height:.92;
  letter-spacing:.02em; color:#fff;
}
.brand .sub{font-size:11.5px; color:#9fb4c0; margin-top:3px; max-width:62ch; line-height:1.5}
.brand .co{font-size:10px; font-weight:700; letter-spacing:.18em; text-transform:uppercase; color:var(--brand)}
.masthead-right{display:flex; gap:8px; align-items:center}

.btn{
  border:1px solid var(--line); background:var(--surface); color:var(--ink);
  padding:8px 14px; border-radius:var(--r); cursor:pointer; font-size:12.5px;
  font-weight:600; display:inline-flex; align-items:center; gap:7px;
  transition:background .12s, border-color .12s;
}
.btn:hover{background:var(--surface2); border-color:var(--ink3)}
.btn-primary{background:var(--ink); color:var(--surface); border-color:var(--ink)}
.btn-primary:hover{background:var(--ink2); border-color:var(--ink2)}
.btn-accent{background:var(--brand); color:#fff; border-color:var(--brand); border-radius:100px; padding:9px 20px}
.btn-accent:hover{background:var(--brand-deep); border-color:var(--brand-deep)}
.btn:disabled{opacity:.4; cursor:not-allowed}
.btn-sm{padding:5px 10px; font-size:11.5px}
.masthead .btn{background:rgba(255,255,255,.07); border-color:rgba(255,255,255,.2); color:#e8eff4}
.masthead .btn:hover{background:rgba(255,255,255,.15); border-color:rgba(255,255,255,.34)}
.masthead .btn-accent{background:var(--brand); border-color:var(--brand); color:#fff}
.masthead .btn-accent:hover{background:#00b3f0; border-color:#00b3f0}

/* ---------- shell ---------- */
.shell{max-width:1420px; margin:0 auto; padding:0 20px 80px}

/* ---------- system chips ---------- */
.systembar{display:flex; gap:6px; flex-wrap:wrap; padding:18px 0 2px}
.chip{
  border:1px solid var(--line); background:var(--surface); border-radius:100px;
  padding:6px 14px; cursor:pointer; font-size:12px; font-weight:600;
  display:inline-flex; align-items:center; gap:8px; transition:.12s;
}
.chip:hover{border-color:var(--brand)}
.chip[aria-pressed="true"]{background:var(--plant); color:#fff; border-color:var(--plant)}
.chip[aria-pressed="true"] .ref{color:var(--brand); opacity:1}
.chip .ref{font-family:var(--mono); font-size:10px; opacity:.7; font-weight:500}

/* ---------- layout ---------- */
.work{display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,1fr); gap:18px; margin-top:18px; align-items:start}
@media (max-width:1080px){ .work{grid-template-columns:1fr} }
.col{display:flex; flex-direction:column; gap:14px; min-width:0}

.card{background:var(--surface); border:1px solid var(--line2); border-radius:8px; box-shadow:var(--shadow)}
.card-hd{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:11px 16px; border-bottom:1px solid var(--line2);
}
.card-hd h2{
  font-family:var(--display); font-weight:400; font-size:19px; line-height:1;
  letter-spacing:.045em; text-transform:uppercase; color:var(--brand-deep);
}
.card-bd{padding:16px}

/* ---------- job card ---------- */
.job{border-top:3px solid var(--brand)}
.job blockquote{margin:0; font-size:15.5px; line-height:1.5; color:var(--ink); text-wrap:pretty}
.job .meta{margin-top:12px; padding-top:12px; border-top:1px solid var(--line2); color:var(--ink2); font-size:12px}

/* ---------- schematic ---------- */
.schematic{width:100%; height:auto; display:block}
.sch-wrap{padding:10px 12px 6px; overflow-x:auto}
.sch-label{font-family:var(--mono); font-size:8px; fill:var(--ink3); letter-spacing:.06em}
.sch-slotlabel{font-family:var(--mono); font-size:7.5px; fill:var(--ink3); letter-spacing:.05em}
.sch-name{font-family:var(--sans); font-size:9px; font-weight:600; fill:var(--ink2)}
.sch-val{font-family:var(--mono); font-size:11.5px; font-weight:600; fill:var(--ink)}
.sch-val.empty{fill:var(--ink3); font-weight:400}
.sch-body{fill:var(--surface2); stroke:var(--line); stroke-width:1.2}
.sch-body.iced{fill:var(--brand-soft); stroke:var(--brand)}
.sch-pipe{fill:none; stroke:var(--pipe); stroke-width:5; stroke-linecap:round; stroke-linejoin:round; opacity:.55}
.sch-thin{fill:none; stroke:var(--pipe); stroke-width:1.6}
.sch-fin{fill:none; stroke:var(--line); stroke-width:1}
.sch-hdr{fill:var(--surface3); stroke:var(--line); stroke-width:1}
.sch-detail{fill:none; stroke:var(--ink3); stroke-width:1.3; stroke-linecap:round}
.sch-tag{fill:none; stroke:var(--line); stroke-width:1; stroke-dasharray:3 3}
.sch-tag.filled{fill:var(--surface2); stroke:var(--line2); stroke-dasharray:none}
.sch-marker{fill:var(--surface3); stroke:var(--line); stroke-width:1}
.sch-marker.on{fill:var(--brand); stroke:var(--brand)}
.sch-num{font-family:var(--mono); font-size:9px; font-weight:600; fill:var(--ink3)}
.sch-marker.on + .sch-num{fill:#062330}

/* fluid moving through the pipes */
.flow{
  fill:none; stroke-width:3.2; stroke-linecap:round; stroke-dasharray:8 12;
  animation:flowdash var(--t,2s) linear infinite;
}
.flow.high{stroke:var(--high)}
.flow.low{stroke:var(--low)}
.flow.liq{stroke:var(--copper)}
.flow.air{stroke:var(--ink3); stroke-width:2.4; stroke-dasharray:6 14; animation-duration:var(--ta,2s)}
.flow.wet{stroke:var(--low); animation-duration:var(--tw,1.4s)}
.flow.gas{stroke:var(--low); opacity:.7; animation-duration:var(--tg,2s)}
.flow.lt{animation-duration:var(--tl,2s)}
@keyframes flowdash{ to{ stroke-dashoffset:-20 } }

.fanblade{animation:spin var(--fan,1.4s) linear infinite}
.fanblade.cond{animation-duration:var(--fanc,1.4s)}
@keyframes spin{ to{ transform:rotate(360deg) } }

.svg-stopped .flow{animation-play-state:paused; opacity:.18}
.svg-stopped .fanblade{animation-play-state:paused; opacity:.4}
.fan-off .fanblade{animation-play-state:paused; opacity:.3}
.svg-trip .flow.high{animation:flowdash var(--t,2s) linear infinite, tripflash 1.1s ease-in-out infinite}
@keyframes tripflash{ 50%{ opacity:.2 } }

@media (prefers-reduced-motion:reduce){
  .flow, .fanblade{animation:none!important}
  .flow{stroke-dasharray:none; opacity:.85}
}

/* ---------- readings ---------- */
.toolgroup{border-top:1px solid var(--line2)}
.toolgroup:first-of-type{border-top:none}
.toolgroup-hd{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 16px 8px; background:var(--surface2);
}
.toolgroup-hd .t{display:flex; flex-direction:column; gap:0}
.toolgroup-hd strong{font-size:12px; font-weight:700}
.toolgroup-hd span{font-size:11px; color:var(--ink3)}
.cost{font-family:var(--mono); font-size:10.5px; color:var(--ink3); white-space:nowrap}

.reading{
  display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center;
  padding:8px 16px; border-top:1px dashed var(--line);
}
.reading:first-of-type{border-top:none}
.reading .lbl{font-size:12.5px; line-height:1.35}
.reading .sub{font-size:11px; color:var(--ink3); margin-top:2px}
.reading.untaken .lbl{color:var(--ink2)}
.reading.taken{border-top-style:solid; border-top-color:var(--line2)}

.val{
  font-family:var(--mono); font-size:14.5px; font-weight:600; text-align:right;
  white-space:nowrap; padding:2px 8px; border-radius:3px; min-width:80px;
}
.val.txt{font-family:var(--sans); font-size:12px; font-weight:500; text-align:left; white-space:normal; max-width:290px; line-height:1.4}
.val.ok{background:var(--good-soft); color:var(--good)}
.val.hi{background:var(--bad-soft); color:var(--bad)}
.val.lo{background:var(--low-soft); color:var(--brand-deep)}
.val.neutral{background:var(--surface3); color:var(--ink)}
.locked{font-size:11px; color:var(--ink3); font-style:italic; text-align:right; max-width:200px}

/* ---------- controls ---------- */
.ctrl{padding:11px 16px; border-top:1px dashed var(--line)}
.ctrl:first-child{border-top:none}
.ctrl-hd{display:flex; justify-content:space-between; align-items:baseline; gap:10px}
.ctrl-hd label{font-size:12px; font-weight:600}
.ctrl-hd .v{font-family:var(--mono); font-size:12px; color:var(--brand-deep); font-weight:600}
.ctrl .help{font-size:11px; color:var(--ink3); margin-top:2px}
input[type=range]{width:100%; margin:7px 0 0; accent-color:var(--brand)}

/* ---------- status strip ---------- */
.status{
  display:flex; flex-wrap:wrap; background:var(--surface);
  border:1px solid var(--line2); border-radius:8px; overflow:hidden; box-shadow:var(--shadow);
}
.stat{flex:1 1 110px; padding:10px 14px; border-left:1px solid var(--line2); min-width:0}
.stat:first-child{border-left:none}
.stat .k{font-size:9.5px; font-weight:700; letter-spacing:.13em; text-transform:uppercase; color:var(--ink3)}
.stat .v{font-family:var(--mono); font-size:18px; font-weight:600; margin-top:2px; line-height:1.1}
.stat .v small{font-size:11px; font-weight:500; color:var(--ink3); font-family:var(--sans)}

.alarm{
  display:flex; gap:10px; padding:10px 14px; border-radius:6px;
  background:var(--bad-soft); border:1px solid var(--bad); color:var(--bad);
  font-size:12px; line-height:1.45; font-weight:500;
}
.alarm.warn{background:var(--warn-soft); border-color:var(--warn); color:var(--warn)}
.alarm b{display:block; font-size:12px}

/* ---------- diagnosis ---------- */
.pick{display:flex; flex-direction:column; gap:5px; max-height:290px; overflow-y:auto; padding-right:4px}
.opt{
  display:flex; gap:10px; align-items:flex-start; padding:8px 11px; border:1px solid var(--line2);
  border-radius:var(--r); cursor:pointer; background:var(--surface2); font-size:12px; line-height:1.4;
  transition:.12s; text-align:left; width:100%;
}
.opt:hover{border-color:var(--brand)}
.opt[aria-pressed="true"]{border-color:var(--brand); background:var(--brand-soft); box-shadow:inset 0 0 0 1px var(--brand)}
.opt .cat{font-size:9.5px; letter-spacing:.09em; text-transform:uppercase; color:var(--ink3); font-weight:700; flex:0 0 84px; padding-top:2px}

/* ---------- result ---------- */
.score{display:flex; align-items:baseline; gap:14px; flex-wrap:wrap}
.score .big{font-family:var(--display); font-size:64px; font-weight:400; line-height:.85; color:var(--brand-deep)}
.bars{display:flex; flex-direction:column; gap:7px; margin-top:14px}
.bar{display:grid; grid-template-columns:150px 1fr 54px; gap:10px; align-items:center; font-size:12px}
.bar .track{height:6px; background:var(--surface3); border-radius:3px; overflow:hidden}
.bar .fill{height:100%; background:var(--good); border-radius:3px}
.bar .fill.part{background:var(--warn)}
.bar .fill.none{background:var(--bad)}
.bar .n{font-family:var(--mono); text-align:right; color:var(--ink2)}

.verdict{padding:12px 14px; border-radius:6px; font-size:13px; line-height:1.5; margin-bottom:14px}
.verdict.right{background:var(--good-soft); border:1px solid var(--good); color:var(--good)}
.verdict.wrong{background:var(--bad-soft); border:1px solid var(--bad); color:var(--bad)}
.verdict b{display:block; margin-bottom:3px}

table.readout{width:100%; border-collapse:collapse; font-size:12px}
table.readout th{
  text-align:left; font-size:9.5px; letter-spacing:.11em; text-transform:uppercase;
  color:var(--ink3); font-weight:700; padding:6px 8px; border-bottom:1px solid var(--line);
}
table.readout td{padding:6px 8px; border-bottom:1px solid var(--line2); vertical-align:top}
table.readout td.num{font-family:var(--mono); text-align:right; white-space:nowrap; font-weight:600}
table.readout tr.key td{background:var(--brand-soft)}
table.readout tr.key td:first-child::before{content:"key "; font-family:var(--mono); font-size:9px; color:var(--brand-deep); letter-spacing:.08em}
.tablewrap{overflow-x:auto}

/* ---------- trainer drawer ---------- */
.scrim{position:fixed; inset:0; background:rgba(10,15,18,.55); z-index:40; backdrop-filter:blur(2px)}
.drawer{
  position:fixed; top:0; right:0; bottom:0; width:min(470px,100%); z-index:41;
  background:var(--surface); border-left:1px solid var(--line);
  display:flex; flex-direction:column; box-shadow:-14px 0 40px rgba(10,15,18,.28);
}
.drawer-hd{padding:16px 20px 14px; border-bottom:1px solid var(--line2); display:flex; justify-content:space-between; align-items:flex-start; gap:12px; background:var(--plant); color:var(--plant-ink)}
.drawer-hd h2{font-family:var(--display); font-weight:400; font-size:26px; letter-spacing:.04em; text-transform:uppercase; color:#fff; line-height:1}
.drawer-hd .eyebrow{color:var(--brand)}
.drawer-hd .note{color:#9fb4c0}
.drawer-hd .btn{background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.22); color:#e8eff4}
.drawer-bd{padding:16px 20px; overflow-y:auto; flex:1; display:flex; flex-direction:column; gap:16px}
.drawer-ft{padding:13px 20px; border-top:1px solid var(--line2); display:flex; gap:9px; background:var(--surface2)}
.field label{display:block; font-size:10px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--ink3); margin-bottom:6px}
select{
  width:100%; padding:8px 10px; border:1px solid var(--line); border-radius:var(--r);
  background:var(--surface2); color:var(--ink); font:inherit; font-size:12.5px;
}
.sev{display:flex; gap:6px}
.sev button{flex:1; padding:7px; border:1px solid var(--line); background:var(--surface2); border-radius:var(--r); cursor:pointer; font-size:12px; font-weight:600}
.sev button[aria-pressed="true"]{background:var(--brand); color:#fff; border-color:var(--brand)}

.hidden{display:none!important}
.muted{color:var(--ink2)}
.note{font-size:11px; color:var(--ink3); line-height:1.5}
.rule{height:1px; background:var(--line2); border:none; margin:0}
.footer{margin-top:30px; padding-top:16px; border-top:1px solid var(--line); color:var(--ink3); font-size:11px; line-height:1.65}
.history{display:flex; flex-direction:column; gap:4px; font-size:11.5px}
.hrow{display:grid; grid-template-columns:1fr auto auto; gap:10px; padding:6px 0; border-bottom:1px solid var(--line2)}
.hrow .s{font-family:var(--mono); font-weight:600}

/* ---------- sign in gate ---------- */
.gate{
  position:fixed; inset:0; z-index:60; background:var(--plant);
  display:flex; align-items:center; justify-content:center; padding:24px; overflow-y:auto;
}
.gate-card{
  width:min(400px,100%); background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.12);
  border-radius:12px; padding:30px 28px 24px; text-align:center; color:var(--plant-ink);
  box-shadow:0 24px 60px rgba(0,0,0,.45);
}
.gate-badge{width:70px; height:70px; margin:0 auto 14px; display:block}
.gate-card .co{font-size:10px; font-weight:700; letter-spacing:.2em; text-transform:uppercase; color:var(--brand)}
.gate-card h1{font-family:var(--display); font-weight:400; font-size:38px; line-height:1; color:#fff; margin:4px 0 8px}
.gate-sub{font-size:12.5px; color:#a3b8c4; margin:0 0 18px; line-height:1.55}
.gate-card label{
  display:block; text-align:left; font-size:10px; font-weight:700; letter-spacing:.13em;
  text-transform:uppercase; color:#8fa5b2; margin:14px 0 5px;
}
.gate-card input{
  width:100%; padding:10px 12px; border-radius:var(--r); font:inherit; font-size:14px;
  background:rgba(0,0,0,.28); border:1px solid rgba(255,255,255,.18); color:#fff;
}
.gate-card input:focus{outline:2px solid var(--brand); outline-offset:1px}
.gate-go{width:100%; justify-content:center; margin-top:20px}
.gate-back{width:100%; justify-content:center; margin-top:8px; background:transparent; border-color:rgba(255,255,255,.2); color:#cfe0ea}
.gate-card .note{color:#8fa5b2; text-align:left; margin:8px 0 0}
.gate-foot{font-size:11px; color:#7d94a2; margin:20px 0 0; line-height:1.55}
.gate-msg{padding:9px 12px; border-radius:6px; font-size:12px; line-height:1.45; margin-bottom:4px; text-align:left}
.gate-msg.bad{background:rgba(224,112,92,.14); border:1px solid #e0705c; color:#f0a294}
.gate-msg.good{background:rgba(70,171,128,.14); border:1px solid #46ab80; color:#7fcfaa}

/* ---------- who is signed in ---------- */
.whoami{display:flex; align-items:center; gap:8px; margin-right:4px; flex-wrap:wrap}
.who-name{font-size:12px; font-weight:600; color:#e8eff4}
.who-role{
  font-size:9.5px; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:var(--brand); border:1px solid var(--brand); border-radius:100px; padding:2px 8px;
}

/* ---------- people modal ---------- */
.modal{
  position:fixed; z-index:41; top:50%; left:50%; transform:translate(-50%,-50%);
  width:min(760px,calc(100% - 32px)); max-height:88vh; background:var(--surface);
  border:1px solid var(--line); border-radius:10px; display:flex; flex-direction:column;
  box-shadow:0 30px 70px rgba(10,15,18,.4); overflow:hidden;
}
.modal-hd{
  padding:15px 20px; background:var(--plant); color:var(--plant-ink);
  display:flex; justify-content:space-between; align-items:flex-start; gap:12px;
}
.modal-hd h2{font-family:var(--display); font-weight:400; font-size:26px; letter-spacing:.04em; text-transform:uppercase; color:#fff; line-height:1}
.modal-hd .eyebrow{color:var(--brand)}
.modal-hd .btn{background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.22); color:#e8eff4}
.modal-bd{padding:18px 20px 22px; overflow-y:auto}
.sub-hd{font-size:11px; font-weight:700; letter-spacing:.13em; text-transform:uppercase; color:var(--ink3); margin:22px 0 10px}

table.people{width:100%; border-collapse:collapse; font-size:12.5px}
table.people th{
  text-align:left; font-size:9.5px; letter-spacing:.11em; text-transform:uppercase;
  color:var(--ink3); font-weight:700; padding:6px 8px; border-bottom:1px solid var(--line);
}
table.people td{padding:8px; border-bottom:1px solid var(--line2); vertical-align:middle}
table.people input.u-name{
  width:100%; min-width:120px; padding:5px 8px; font:inherit; font-size:12.5px; font-weight:600;
  border:1px solid transparent; border-radius:var(--r); background:transparent; color:var(--ink);
}
table.people input.u-name:hover{border-color:var(--line)}
table.people input.u-name:focus{border-color:var(--brand); background:var(--surface2); outline:none}
table.people select{width:auto; min-width:96px; padding:5px 8px; font-size:12px}
.u-acts{white-space:nowrap; text-align:right}
.u-acts .btn{margin-left:5px}
.pill{
  font-size:9.5px; font-weight:700; letter-spacing:.09em; text-transform:uppercase;
  padding:3px 8px; border-radius:100px; white-space:nowrap;
}
.pill.on{background:var(--good-soft); color:var(--good)}
.pill.warn{background:var(--warn-soft); color:var(--warn)}
.pill.off{background:var(--surface3); color:var(--ink3)}

.addrow{display:flex; gap:8px; flex-wrap:wrap; align-items:center}
.addrow input, .addrow select{
  padding:8px 10px; border:1px solid var(--line); border-radius:var(--r);
  background:var(--surface2); color:var(--ink); font:inherit; font-size:12.5px;
}
.addrow input{flex:1 1 180px; min-width:0}
.rolelist{margin:0; padding-left:18px; font-size:12px; color:var(--ink2); line-height:1.7}
.rolelist strong{color:var(--ink)}
.warnbox{
  margin-top:20px; padding:12px 14px; border-radius:6px; font-size:11.5px; line-height:1.6;
  background:var(--warn-soft); border:1px solid var(--warn); color:var(--warn);
}
.warnbox strong{display:block; margin-bottom:3px}

/* ---------- issuing the file to the crew ---------- */
.issuebox{
  padding:13px 15px; border-radius:6px; margin-bottom:16px; font-size:12px; line-height:1.6;
  background:var(--brand-soft); border:1px solid var(--brand); color:var(--ink);
}
.issuebox strong{display:block; margin-bottom:3px; font-size:12.5px}
.issuebox .btn{margin-top:10px}

/* ---------- Emerson controller screen ---------- */
.e2-bezel{fill:var(--surface3); stroke:var(--line); stroke-width:1.2}
.e2-screen{fill:#0e171c; stroke:#243139; stroke-width:1}
.e2-panel{fill:none; stroke:#2c3d47; stroke-width:1}
.e2-override{fill:#0b4f6c; stroke:#25b6e8; stroke-width:1}
.e2-rule{stroke:#2c3d47; stroke-width:1}
.e2-hd{font-family:var(--mono); font-size:11px; font-weight:600; fill:#8fd6f2; letter-spacing:.08em}
.e2-cap{font-family:var(--mono); font-size:8.5px; font-weight:600; fill:#5f7b88; letter-spacing:.12em}
.e2-lbl{font-family:var(--mono); font-size:10px; fill:#a8bcc6}
.e2-num{font-family:var(--mono); font-size:11.5px; font-weight:600; fill:#e6f4fa}
.e2-txt{font-family:var(--mono); font-size:10px; fill:#cfe2ea}
.e2-dim{font-family:var(--mono); font-size:8.5px; fill:#61818f; letter-spacing:.06em}
.e2-row{fill:#131f26; stroke:#22303a; stroke-width:1}
.e2-row.off{fill:#2a1a17; stroke:#5c3229}
.e2-adv{font-family:var(--mono); font-size:8.5px; fill:#a8bcc6; white-space:pre}
.e2-adv.alarm{fill:#f0a08e}
.e2-adv.fail{fill:#ff8f7a; font-weight:600}
.e2-alarm{font-family:var(--mono); font-size:11px; font-weight:700; fill:#ff7d63; letter-spacing:.1em;
  animation:e2blink 1.1s steps(1) infinite}
@keyframes e2blink{0%,55%{opacity:1}56%,100%{opacity:.15}}
.e2-fkeys{fill:#131f26; stroke:#22303a; stroke-width:1}
.e2-fk{font-family:var(--mono); font-size:8.5px; font-weight:600; fill:#7f9dab; letter-spacing:.1em}
@media (prefers-reduced-motion: reduce){ .e2-alarm{animation:none} }

/* ---------- logged trends ---------- */
.trendrow{display:block}
.trend{margin-top:10px; border:1px solid var(--line2); border-radius:6px; background:var(--surface2); padding:10px 12px 8px}
.trend-hd strong{font-size:12.5px; font-weight:600; color:var(--ink)}
.trend-axis{margin:4px 0 8px; font-size:10.5px; line-height:1.45; color:var(--ink2)}
.trend-note{margin-top:6px; font-size:10.5px; line-height:1.45; color:var(--warn)}
.trend-empty{padding:22px 14px; border:1px dashed var(--line); border-radius:5px; text-align:center;
  font-size:11.5px; line-height:1.55; color:var(--ink2)}
.trend-empty b{display:block; color:var(--ink); font-size:12.5px; margin-bottom:5px}
.trendsvg{display:block; width:100%; height:auto; touch-action:none}
.trend-read{min-height:15px; margin-top:3px; font-family:var(--mono); font-size:10.5px; color:var(--ink2)}
.tr-grid{stroke:var(--line2); stroke-width:1}
.tr-grid.faint{stroke:var(--line2); stroke-width:1; opacity:.5}
.tr-ytick,.tr-xtick{font-family:var(--mono); font-size:9px; fill:var(--ink3)}
.tr-line{fill:none; stroke:var(--brand); stroke-width:2; stroke-linejoin:round; stroke-linecap:round}
.tr-end{fill:var(--brand); stroke:var(--surface2); stroke-width:2}
.tr-ref{stroke:var(--ink3); stroke-width:1.2; stroke-dasharray:5 4}
.tr-reftxt{font-family:var(--mono); font-size:8.5px; fill:var(--ink3); letter-spacing:.06em}
.tr-gap{fill:var(--line2); opacity:.55}
.tr-gaptxt{font-family:var(--mono); font-size:9px; fill:var(--ink3); letter-spacing:.08em}
.tr-hit{fill:transparent; cursor:crosshair}
.tr-crossline{stroke:var(--ink3); stroke-width:1}
.tr-crossdot{fill:var(--brand); stroke:var(--surface2); stroke-width:2}
