/* views.css — Board / Timeline / Coordination / Dashboard / Team
   + Assistant drawer + user modal extras. Dark glass-morphism theme.
   All class names preserved for JS compatibility. */

/* ── GrowFlow wordmark ── */
.gf-mark{display:inline-flex;align-items:center;gap:10px;margin:0}
.gf-mark .pp-leaf{flex-shrink:0}
.gf-name{font-family:'Saira',system-ui,sans-serif;font-weight:700;letter-spacing:-.03em;line-height:1;color:var(--ink)}
.gf-name b{font-weight:700;background:linear-gradient(120deg,#2BE8A0 0%,#2FD9D9 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent}

/* ── View header ── */
.view-head{display:flex;align-items:flex-end;gap:14px;padding:4px 2px 16px}
.view-title{font-family:var(--font-display);font-size:21px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--ink)}
.view-sub{font-size:13px;color:var(--ink-3);font-weight:500;margin-top:2px}
.lbl-hint{font-weight:500;color:var(--ink-3);font-size:11px;margin-left:6px}
.kempty{color:var(--ink-3);font-size:13px;padding:14px 6px;text-align:center}

/* ── Board: horizontal day swimlanes ──
   One full-width lane per weekday (Mon→Fri); the day's cards flow into a
   responsive grid (wrap left→right) ordered chronologically, NOT by completion
   state. Today's lane is accented. Days with no tasks collapse to a thin
   header bar so they don't waste the canvas. A compact status chip on each
   card still surfaces progress at a glance. */
.kboard{display:flex;flex-direction:column;gap:12px}
.kcol{background:var(--surface-2);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.kcol.today{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary) inset,0 0 14px rgba(var(--accent-rgb),.16)}
.kcol.today .kcol-head{background:linear-gradient(0deg,var(--primary-soft),var(--primary-soft)),var(--surface-3);color:var(--ink)}
.kcol-head{display:flex;align-items:center;gap:9px;font-weight:700;font-size:13px;color:var(--ink);
  padding:11px 15px;background:var(--surface-3);border-bottom:1px solid var(--line)}
.kcol-head .dot{width:9px;height:9px;border-radius:999px;flex-shrink:0}
.kcount{margin-left:auto;background:var(--surface);border:1px solid var(--line);border-radius:999px;
  font-size:11px;font-weight:700;color:var(--ink-2);padding:1px 9px}
.kcol-body{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px;padding:13px 15px;align-items:start}
.kcard{background:var(--surface);border:1px solid var(--line);border-radius:11px;padding:12px;cursor:pointer;
  box-shadow:var(--sh-1);transition:transform .12s,box-shadow .12s}
@media (hover: hover) and (pointer: fine){
  .kcard:hover{transform:translateY(-2px);box-shadow:var(--sh-2)}
}
.kcard:active{transform:translateY(-2px) scale(.97)}
/* Empty day → header bar only, no wasted grid padding. */
.kcol.empty .kcol-head{color:var(--ink-3)}
.kcol.empty .kcol-head .dot{opacity:.6}
.kcol.empty .kcol-body{display:block;padding:7px 15px}
.kcol.empty .kempty{padding:2px;text-align:left;font-size:12px;opacity:.55}
.role-lock{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:var(--ink-3);
  background:var(--surface-2);border:1px solid var(--line);border-radius:9px;padding:7px 11px}
.kcard-top{display:flex;align-items:center;gap:8px;margin-bottom:7px}
.kcard-dept{font-size:11px;font-weight:700;letter-spacing:.02em}
.kcard-top .kstatus{margin-left:auto}
.kstatus{font-size:10px;font-weight:700;padding:3px 8px;cursor:inherit;backdrop-filter:none}
.kstatus .dot{width:6px;height:6px;border-radius:999px;flex-shrink:0}
.kcard-title{font-size:13px;font-weight:600;color:var(--ink);line-height:1.35;margin-bottom:10px;
  display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.kcard-foot{display:flex;align-items:center;gap:6px}

/* ── Timeline ── */
.timeline-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;align-items:start}
.tlcol{background:var(--surface-2);border:1px solid var(--line);border-radius:14px;padding:10px}
.tlcol.today{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary) inset,0 0 12px rgba(var(--accent-rgb),.18)}
.tlcol-head{display:flex;align-items:center;gap:8px;font-weight:800;font-size:13px;color:var(--ink-2);padding:2px 4px 10px}
.tlcol-body{display:flex;flex-direction:column;gap:8px}
.tlcard{background:var(--surface);border:1px solid var(--line);border-left:3px solid var(--ink-3);border-radius:10px;
  padding:10px;cursor:pointer;box-shadow:var(--sh-1);transition:transform .12s}
@media (hover: hover) and (pointer: fine){
  .tlcard:hover{transform:translateY(-2px)}
}
.tlcard-title{font-size:12.5px;font-weight:600;color:var(--ink);line-height:1.35;margin-bottom:8px}
.tlcard-meta{display:flex;align-items:center;gap:6px}

/* ── Coordination ── */
.coord-list{display:flex;flex-direction:column;gap:10px}
.coord-row{display:grid;grid-template-columns:minmax(180px,1.3fr) auto auto;gap:16px;align-items:center;
  background:var(--surface);border:1px solid var(--line);border-radius:13px;padding:14px 16px;box-shadow:var(--sh-1)}
.coord-row.ready{border-color:rgba(var(--accent-rgb),.35);background:linear-gradient(0deg,rgba(var(--accent-rgb),.04),rgba(var(--accent-rgb),.04)),var(--surface)}
.coord-title{font-size:14px;font-weight:700;color:var(--ink)}
.coord-id{font-size:11.5px;color:var(--ink-3);font-weight:600;font-family:ui-monospace,monospace;margin-top:2px}
.coord-flow{display:flex;align-items:center;gap:8px;justify-self:center}
.coord-status{display:flex;align-items:center;gap:10px;justify-self:end}
.coord-tag{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:700;border-radius:999px;padding:4px 10px}
.coord-tag.ok{background:var(--primary);color:var(--text-on-primary)}
.coord-tag.ok .icon{stroke:var(--text-on-primary)}
.coord-tag.wait{background:var(--amber-soft);color:var(--amber);border:1px solid rgba(199,154,84,.35)}
.coord-tag.prog{background:var(--surface-2);color:var(--ink-3);border:1px solid var(--line)}

/* ── Facility resource strip — site-wide totals (total + per-phase) as a
   single flowing row, distinct from the .dash-kpis tile grid used elsewhere. ── */
.fac-resbar{display:flex;align-items:center;justify-content:center;gap:26px;flex-wrap:wrap;
  padding:14px 8px;margin-bottom:14px}
.fac-res{display:flex;align-items:center;gap:9px}
.fac-res-ic{width:30px;height:30px;flex:none;border-radius:50%;background:var(--surface-2);
  box-shadow:inset 0 0 0 1px var(--line)}
.fac-res-v{font-size:20px;font-weight:800;min-width:22px;text-align:center}
.fac-res-l{font-size:11.5px;color:var(--ink-3);font-weight:600;text-transform:uppercase;letter-spacing:.04em}

/* ── Dashboard ── */
.dash-kpis{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-bottom:14px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px 18px;box-shadow:var(--sh-1)}
.kpi-v{font-size:30px;font-weight:800;letter-spacing:-1px;line-height:1;color:var(--ink)}
.kpi-l{font-size:12px;color:var(--ink-3);font-weight:600;margin-top:6px}
.dash-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.dash-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px 18px;box-shadow:var(--sh-1)}
.dash-card-ttl{font-size:12px;font-weight:800;letter-spacing:.4px;text-transform:uppercase;color:var(--ink-3);margin-bottom:14px}
.dash-bar-row{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.dbl{font-size:12.5px;font-weight:600;color:var(--ink-2);width:120px;flex-shrink:0}
.dbv{font-size:13px;font-weight:800;color:var(--ink);width:26px;text-align:right}
.dash-person{display:flex;align-items:center;gap:10px;padding:7px 0;border-top:1px solid var(--line-2)}
.dash-person:first-of-type{border-top:none}
.dp-name{font-size:13px;font-weight:700;color:var(--ink)}
.dp-role{font-size:11px;color:var(--ink-3);font-weight:500}
.dp-count{background:var(--teal-soft);color:var(--teal);font-weight:800;font-size:13px;border-radius:8px;padding:3px 11px}
.dash-blk{display:flex;gap:9px;align-items:flex-start;padding:8px 0;border-top:1px solid var(--line-2)}
.dash-blk:first-of-type{border-top:none}
.dbk-t{font-size:13px;font-weight:700;color:var(--ink)}
.dbk-s{font-size:11.5px;color:var(--red);font-weight:600;margin-top:2px}

/* ── Team ── */
.team-count{font-size:12px;font-weight:700;color:var(--ink-3);margin-bottom:12px}
.team-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px}
.team-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:15px;box-shadow:var(--sh-1)}
.team-card.me{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary) inset,0 0 14px rgba(var(--accent-rgb),.15)}
.team-top{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.tc-name{font-size:14.5px;font-weight:800;color:var(--ink)}
.tc-you{font-size:10px;font-weight:800;color:var(--text-on-primary);background:var(--primary);border-radius:6px;padding:1px 6px;vertical-align:middle}
.tc-role{font-size:12px;color:var(--ink-3);font-weight:600;margin-top:1px}
.tc-dept{display:flex;align-items:center;gap:8px;font-size:12.5px;font-weight:600;color:var(--ink-2);
  padding:8px 0;border-top:1px solid var(--line-2);border-bottom:1px solid var(--line-2);margin-bottom:11px}
.tc-actions{display:flex;align-items:center;gap:7px}
.tc-active{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:700;color:var(--primary)}

/* user modal: avatar swatches + RACI chips */
.swatches{display:flex;gap:9px;flex-wrap:wrap}
.swatch{width:30px;height:30px;border-radius:9px;cursor:pointer;box-shadow:0 0 0 2px var(--surface),0 0 0 2px var(--line)}
.swatch.on{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--primary)}
.chips-who{flex-wrap:wrap;gap:7px}
.chip-opt.who{display:inline-flex;align-items:center;gap:6px;padding:5px 11px 5px 5px}

/* ── Assistant drawer ── */
.assistant-overlay{position:fixed;inset:0;background:rgba(2,7,5,.55);opacity:0;visibility:hidden;
  transition:opacity .25s;z-index:120}
.assistant-overlay.open{opacity:1;visibility:visible}
.assistant-drawer{position:fixed;top:0;right:0;height:100vh;width:400px;max-width:92vw;
  background:var(--glass-bg);backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
  border-left:1px solid var(--glass-border);box-shadow:-12px 0 40px rgba(0,0,0,.5);z-index:130;
  transform:translateX(100%);transition:transform .28s var(--ease-out);display:flex;flex-direction:column}
.assistant-drawer.open{transform:translateX(0)}
.asst-head{display:flex;align-items:center;gap:11px;padding:18px 18px 14px;border-bottom:1px solid var(--line)}
.asst-head .pp-leaf{width:26px;height:30px;flex-shrink:0}
.asst-title{font-size:15px;font-weight:800;color:var(--ink)}
.asst-tag{font-size:11px;font-weight:700;color:var(--orange);text-transform:uppercase;letter-spacing:.5px}
.asst-body{flex:1;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column}
.asst-status{display:flex;align-items:center;gap:8px;font-size:11.5px;font-weight:700;color:var(--ink-3);
  background:var(--surface-2);border:1px solid var(--line);border-radius:9px;padding:7px 11px;margin-bottom:12px}
.asst-status .dot{width:8px;height:8px;border-radius:999px;flex-shrink:0}
.asst-test{margin-left:auto;font:inherit;font-size:11px;font-weight:700;color:var(--blue);background:none;border:none;cursor:pointer;padding:2px 4px}
.asst-test:hover{text-decoration:underline}
.asst-actions{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.asst-act{display:inline-flex;align-items:center;gap:7px;font-size:12.5px;font-weight:700;color:var(--ink-2);
  background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:8px 12px;cursor:pointer;transition:background .15s,border-color .15s}
.asst-act:hover{background:var(--surface-3);border-color:var(--primary)}
.asst-thread{display:flex;flex-direction:column;gap:12px}
.asst-msg{display:flex;gap:9px;align-items:flex-start}
.asst-msg.me{justify-content:flex-end}
.asst-msg .icon{flex-shrink:0;margin-top:6px}
.asst-bubble{font-size:13.5px;line-height:1.5;border-radius:13px;padding:10px 13px;max-width:84%}
.asst-msg.ai .asst-bubble{background:var(--surface-2);color:var(--ink);border:1px solid var(--line);border-top-left-radius:4px}
.asst-msg.me .asst-bubble{background:var(--primary);color:var(--text-on-primary);border-top-right-radius:4px}
.asst-li{padding:7px 0;border-top:1px solid var(--line-2);font-size:13px;color:var(--ink);font-weight:600}
.asst-li:first-child{border-top:none}
.asst-sub{font-size:11.5px;color:var(--ink-3);font-weight:500;margin-top:2px}
.asst-foot{padding:13px 16px;border-top:1px solid var(--line);display:flex;gap:9px;align-items:center}
.asst-foot input{flex:1;border:1px solid var(--line);border-radius:11px;padding:11px 13px;font-size:13.5px;
  font-family:inherit;outline:none;background:var(--surface-2);color:var(--ink)}
.asst-foot input:focus{border-color:var(--primary);background:var(--surface-3);box-shadow:0 0 0 2px var(--focus-ring)}
.asst-foot input::placeholder{color:var(--ink-4)}
.asst-typing{display:inline-flex;gap:4px;padding:2px 0}
.asst-typing span{width:6px;height:6px;border-radius:999px;background:var(--ink-3);animation:asst-bounce 1.2s infinite}
.asst-typing span:nth-child(2){animation-delay:.15s}.asst-typing span:nth-child(3){animation-delay:.3s}
@keyframes asst-bounce{0%,60%,100%{transform:translateY(0);opacity:.4}30%{transform:translateY(-4px);opacity:1}}

/* ── Settings: tabbed layout ── */
.set-tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin:-6px 0 16px;overflow-x:auto;flex-wrap:wrap}
.set-tab{font-size:12.5px;font-weight:700;color:var(--ink-3);padding:9px 12px;cursor:pointer;white-space:nowrap;
  border-bottom:2px solid transparent;margin-bottom:-1px;transition:color .15s;background:none;border-top:none;border-left:none;border-right:none}
.set-tab:hover{color:var(--ink-2)}
.set-tab.on{color:var(--primary);border-bottom-color:var(--primary)}
/* renderSettings() rebuilds the body and injects only the active pane (a bare
   `.set-pane`, no `.on`), so the pane must always show. An earlier `.on`-gated
   rule hid every pane (the JS never adds `.on`), leaving the modal blank. */
.set-pane{display:flex;flex-direction:column;gap:12px}
.set-grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.set-note{font-size:11.5px;color:var(--ink-3);line-height:1.5;margin-top:6px}
.set-check{display:flex;align-items:center;gap:9px;font-size:13px;font-weight:600;color:var(--ink-2);padding:8px 0;cursor:pointer}
.set-check input{width:16px;height:16px;accent-color:var(--primary);cursor:pointer}
.set-row{display:flex;align-items:center;justify-content:space-between;gap:16px}
.set-lab{font-size:13.5px;font-weight:700;color:var(--ink)}
.set-hint{font-size:11.5px;color:var(--ink-3);font-weight:500;line-height:1.4}
.set-msg{font-size:12px;font-weight:600;min-height:16px}
.set-kv{display:flex;justify-content:space-between;gap:16px;font-size:13px;color:var(--ink-2);padding:7px 0;border-bottom:1px solid var(--line-2)}
.set-kv b{color:var(--ink);font-weight:700}
.seg{display:inline-flex;background:var(--surface-3);border-radius:9px;padding:3px}
.seg-b{border:none;background:none;padding:6px 13px;font-size:12.5px;font-weight:700;color:var(--ink-2);cursor:pointer;border-radius:7px}
.seg-b.on{background:var(--surface);color:var(--ink);box-shadow:var(--sh-1)}
.ai-bind{border:1px solid var(--line);border-radius:11px;padding:12px 13px;margin-bottom:10px;background:var(--surface-2)}
.ai-bind-h{display:flex;align-items:center;justify-content:space-between;gap:12px}
.ai-bind-h b{font-family:var(--font-mono);font-size:12.5px;color:var(--ink)}
.ai-bind-on{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:700;color:var(--ink-2);cursor:pointer;white-space:nowrap}
.ai-bind select{width:100%;margin-top:9px;border:1px solid var(--line);border-radius:8px;padding:8px 10px;font-size:12.5px;background:var(--surface);color:var(--ink);font-family:inherit;outline:none}

/* ── Water QC log modal ── */
.wl-row{display:grid;grid-template-columns:110px 1fr 130px 20px;gap:10px;align-items:center;padding:5px 0}
.wl-name{font-size:12.5px;font-weight:700;color:var(--ink-2)}
.wl-input{border:1px solid var(--line);border-radius:8px;padding:7px 10px;font-size:13px;font-family:inherit;outline:none;background:var(--surface-2);color:var(--ink);width:100%}
.wl-input:focus{border-color:var(--primary);background:var(--surface-3);box-shadow:0 0 0 2px var(--focus-ring)}
.wl-input::placeholder{color:var(--ink-4)}
.wl-spec{font-size:10.5px;color:var(--ink-3);text-align:right}
.wl-flag{font-size:14px;font-weight:800;text-align:center}
.wl-verdict{font-size:12.5px;font-weight:700;border-radius:9px;padding:0;margin-top:4px;line-height:1.4}
.wl-verdict.ok{color:var(--primary-fg);background:var(--primary-soft);padding:9px 12px}
.wl-verdict.bad{color:var(--red-fg,#FF8090);background:var(--red-soft);padding:9px 12px}

/* ── Facility floor-plan map ── */
.fac-chips{display:flex;gap:7px;flex-wrap:wrap}
.fac-chip{display:inline-flex;align-items:center;gap:7px;font:700 12px/1 'Saira',system-ui,sans-serif;
  color:var(--ink-2);background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:7px 12px;cursor:pointer;transition:border-color .15s,background .15s,opacity .15s}
.fac-chip.on{border-color:var(--zc);background:rgba(0,0,0,0);outline:1px solid var(--zc)}
.fac-chip:not(.on){opacity:.5}
.fac-sw{width:11px;height:11px;border-radius:3px}
.fac-ct{background:var(--surface-3);border-radius:999px;font-size:10px;padding:1px 6px;color:var(--ink-3)}
.fac-wrap{display:grid;grid-template-columns:1fr 300px;gap:16px;margin-top:14px;align-items:start}
.fac-stage{position:relative;width:100%;aspect-ratio:1040/680;background:
  repeating-linear-gradient(0deg,transparent,transparent 39px,rgba(var(--accent-rgb),.04) 39px,rgba(var(--accent-rgb),.04) 40px),
  repeating-linear-gradient(90deg,transparent,transparent 39px,rgba(var(--accent-rgb),.04) 39px,rgba(var(--accent-rgb),.04) 40px),
  var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--sh-1);overflow:hidden}
.fac-room{position:absolute;border:1.5px solid;border-radius:8px;padding:7px 9px;cursor:pointer;overflow:hidden;
  transition:transform .12s,box-shadow .12s,opacity .2s;display:flex;flex-direction:column;gap:3px}
@media (hover: hover) and (pointer: fine){
  .fac-room:hover{transform:translateY(-1px);box-shadow:0 6px 16px rgba(0,0,0,.4);z-index:5}
}
.fac-room.sel{box-shadow:0 0 0 2px var(--primary),0 8px 20px rgba(0,0,0,.5),0 0 18px rgba(var(--accent-rgb),.2);z-index:6}
.fac-code{font:800 11px/1 ui-monospace,monospace;display:flex;align-items:center;gap:5px}
.fac-name{font-size:10.5px;font-weight:600;color:var(--ink-2);line-height:1.2}
.fac-dot{width:7px;height:7px;border-radius:999px;display:inline-block}
.fac-panel{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px;box-shadow:var(--sh-1);position:sticky;top:0}
.fac-panel-empty{text-align:center;padding:30px 18px;color:var(--ink-3)}
.fac-kv{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 0;border-top:1px solid var(--line-2);font-size:12.5px;color:var(--ink-3);font-weight:600}
.fac-kv:first-of-type{border-top:none}
.fac-kv b{color:var(--ink)}
.fac-sec{font-size:10px;font-weight:700;letter-spacing:.4px;color:var(--ink-3);text-transform:uppercase;margin:14px 0 8px;padding-top:12px;border-top:1px solid var(--line)}
.fac-water{display:flex;align-items:center;gap:8px;padding:7px 9px;background:var(--surface-2);border:1px solid var(--line);border-radius:9px;margin-bottom:6px;cursor:pointer}
.fac-water:hover{border-color:var(--primary)}
@media (max-width:900px){.fac-wrap{grid-template-columns:1fr}.fac-name{font-size:9px}}

/* ── SP-06 Post-Curing Sampling ── */
.sp-scope{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:14px 0 4px}
.sp-scope>div{background:var(--surface-2);border:1px solid var(--line);border-radius:11px;padding:11px 13px;font-size:12px;color:var(--ink-2);line-height:1.45}
.sp-scope-k{display:block;font-size:10px;font-weight:800;letter-spacing:.4px;text-transform:uppercase;color:var(--ink-3);margin-bottom:4px}
.sp-stepper{display:flex;align-items:center;margin:18px 0 14px}
.sp-step{display:flex;align-items:center;gap:9px;cursor:pointer;opacity:.55;transition:opacity .15s}
.sp-step.on,.sp-step.done{opacity:1}
.sp-stepn{width:26px;height:26px;border-radius:999px;background:var(--surface-3);color:var(--ink-2);font-weight:800;font-size:12.5px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.sp-step.on .sp-stepn{background:var(--blue);color:#fff}
.sp-step.done .sp-stepn{background:var(--primary);color:var(--text-on-primary)}
.sp-stepl{font-size:12.5px;font-weight:700;color:var(--ink-2);white-space:nowrap}
.sp-stepbar{flex:1;height:2px;background:var(--line);margin:0 12px;min-width:18px}
.sp-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:20px;box-shadow:var(--sh-1)}
.sp-grid2{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.sp-grid2.sp-tight{gap:12px;margin:0}
.sp-grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:16px 0}
.sp-field{margin-bottom:13px}
.sp-field label{display:block;font-size:11px;font-weight:700;color:var(--ink-2);margin-bottom:5px}
.sp-field input{width:100%;border:1px solid var(--line);border-radius:9px;padding:9px 12px;font-size:13px;outline:none;background:var(--surface-2);color:var(--ink);font-family:inherit;box-sizing:border-box}
.sp-field input:focus{border-color:var(--primary);background:var(--surface-3);box-shadow:0 0 0 2px var(--focus-ring)}
.sp-field input::placeholder{color:var(--ink-4)}
.sp-gate{border:1.5px solid var(--line);border-radius:13px;padding:15px;background:var(--surface-2)}
.sp-gate.pass{border-color:rgba(var(--accent-rgb),.45);background:linear-gradient(0deg,rgba(var(--accent-rgb),.05),rgba(var(--accent-rgb),.05)),var(--surface)}
.sp-gate.fail{border-color:rgba(255,77,94,.45);background:linear-gradient(0deg,rgba(255,77,94,.05),rgba(255,77,94,.05)),var(--surface)}
.sp-gate-h{display:flex;align-items:center;gap:8px;font-weight:800;font-size:13.5px;color:var(--ink)}
.sp-gate-v{font-size:12px;font-weight:700;margin-top:9px;color:var(--ink-2)}
.sp-gate.pass .sp-gate-v{color:var(--primary-fg)}.sp-gate.fail .sp-gate-v{color:var(--red)}
.sp-formula{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:var(--surface-3);color:var(--ink-2);border:1px solid var(--line);border-radius:11px;padding:12px 15px;font-family:ui-monospace,monospace;font-size:13px;font-weight:600}
.sp-formula-calc{color:var(--ink)}.sp-formula-calc b{color:var(--primary);font-size:15px}
.sp-formula .btn{margin-left:auto}
.sp-cont-legend{font-size:12px;color:var(--ink-2);font-weight:600;margin:14px 0 8px}
.sp-cont-grid{display:flex;flex-wrap:wrap;gap:6px}
.sp-cont{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;
  background:var(--surface-2);border:1px solid var(--line);color:var(--ink-3)}
.sp-cont.on{background:var(--blue);border-color:var(--blue);color:#fff;box-shadow:0 3px 8px rgba(47,217,217,.3)}
.sp-stat{background:var(--surface-2);border:1px solid var(--line);border-radius:11px;padding:13px}
.sp-stat-v{font-size:22px;font-weight:800;color:var(--ink);letter-spacing:-.5px}
.sp-stat-l{font-size:11px;color:var(--ink-3);font-weight:600;margin-top:3px}
.sp-stat input[type=range]{width:100%;margin-top:8px;accent-color:var(--primary)}
.sp-note{display:flex;gap:9px;align-items:flex-start;background:var(--blue-soft);border-radius:10px;padding:11px 13px;font-size:12.5px;color:var(--ink-2);font-weight:600;line-height:1.45;margin-top:14px}
.sp-note .icon{flex-shrink:0;margin-top:1px}
.sp-note.warn{background:var(--red-soft);color:var(--red)}
.sp-srow{display:grid;grid-template-columns:1fr 70px 200px 50px;gap:12px;align-items:center;padding:11px 12px;border:1px solid var(--line);border-radius:11px;margin-bottom:7px;background:var(--surface)}
.sp-srow.head{background:transparent;border:none;padding:2px 12px;margin-bottom:4px}
.sp-srow.head>div{font-size:10px;font-weight:800;letter-spacing:.4px;text-transform:uppercase;color:var(--ink-3)}
.sp-srow.first{border-color:rgba(var(--accent-rgb),.45);box-shadow:0 0 0 1px rgba(var(--accent-rgb),.3) inset;background:linear-gradient(0deg,rgba(var(--accent-rgb),.04),rgba(var(--accent-rgb),.04)),var(--surface)}
.sp-srow.seal:not(.first){background:var(--surface-2)}
.sp-srow.off{opacity:.5}
.sp-srow-n{width:22px;height:22px;border-radius:6px;background:var(--surface-3);color:var(--ink-2);font-weight:800;font-size:11px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.sp-srow-name{font-size:13px;font-weight:700;color:var(--ink)}
.sp-srow-label{font-size:10.5px;color:var(--ink-3);margin-top:3px}
.sp-srow-mass{font-size:13px;font-weight:800;color:var(--ink)}
.sp-srow-lab select{width:100%;border:1px solid var(--line);border-radius:8px;padding:6px 8px;font-size:11.5px;background:var(--surface-2);color:var(--ink);font-family:inherit;outline:none}
.sp-tag-first{font-size:9px;font-weight:800;letter-spacing:.3px;color:var(--text-on-primary);background:var(--primary);border-radius:5px;padding:2px 6px}
.sp-tag-counter,.sp-tag-ret{font-size:9px;font-weight:800;letter-spacing:.3px;color:var(--ink-3);background:var(--surface-3);border-radius:5px;padding:2px 6px}
.sp-lock{display:flex;justify-content:center}
.sp-switch{position:relative;display:inline-block;width:34px;height:20px;cursor:pointer}
.sp-switch input{opacity:0;width:0;height:0}
.sp-switch span{position:absolute;inset:0;background:var(--surface-3);border:1px solid var(--line);border-radius:999px;transition:background .2s,border-color .2s}
.sp-switch span:before{content:"";position:absolute;width:16px;height:16px;left:2px;top:2px;background:var(--ink-3);border-radius:50%;transition:transform .2s,background .2s}
.sp-switch input:checked+span{background:var(--primary);border-color:var(--primary)}
.sp-switch input:checked+span:before{transform:translateX(14px);background:var(--text-on-primary)}
.sp-mass-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:12px;padding:11px 14px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;font-size:12.5px;font-weight:700;color:var(--ink-2)}
.sp-sec{font-size:10.5px;font-weight:800;letter-spacing:.4px;text-transform:uppercase;color:var(--ink-3);margin-bottom:11px}
.sp-disp{display:flex;gap:11px;align-items:flex-start;border:1.5px solid var(--line);border-radius:12px;padding:13px;margin-bottom:10px;cursor:pointer;transition:border-color .15s,background .15s}
.sp-disp.on{border-color:var(--primary);background:var(--primary-soft)}
.sp-disp input{margin-top:3px;accent-color:var(--primary)}
.sp-disp-t{font-size:13.5px;font-weight:700;color:var(--ink)}
.sp-disp-s{font-size:11.5px;color:var(--ink-3);font-weight:500;margin-top:2px;line-height:1.4}
.sp-summary{background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:14px}
.sp-summary .row{justify-content:space-between;font-size:12.5px;color:var(--ink-2);font-weight:600;padding:5px 0}
.sp-lab-row{border-top:1px solid var(--line-2)}
.sp-nav{display:flex;align-items:center;gap:10px;margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.sp-nav-hint{font-size:12px;color:var(--ink-3);font-weight:600}

@media (max-width:820px){.sp-grid2,.sp-grid3{grid-template-columns:1fr}.sp-srow{grid-template-columns:1fr 50px;row-gap:8px}.sp-srow-lab,.sp-srow-tog{grid-column:span 2}}

/* keep language toggle visible on small screens too */
.lang-toggle{display:flex !important}
@media (max-width:820px){
  .timeline-grid,.dash-kpis{grid-template-columns:repeat(2,1fr)}
  .dash-grid,.set-grid2{grid-template-columns:1fr}
  .coord-row{grid-template-columns:1fr;gap:10px}
  .coord-flow,.coord-status{justify-self:start}
}

/* ── Theme / skin picker (GF.openThemePicker) ── */
.theme-group-lbl{font-size:11px;font-weight:800;letter-spacing:.5px;text-transform:uppercase;
  color:var(--ink-3);margin-bottom:8px}
.theme-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.theme-chip{display:flex;align-items:center;gap:9px;padding:8px 10px;cursor:pointer;
  border:1px solid var(--glass-border);border-radius:10px;background:var(--surface-2);
  color:var(--ink);font-family:inherit;text-align:left;transition:border-color .14s,background .14s}
.theme-chip:hover{border-color:var(--primary);background:var(--surface-3)}
.theme-chip.on{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary) inset}
.theme-sw{width:26px;height:26px;border-radius:7px;flex-shrink:0;position:relative;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.14),0 1px 3px rgba(0,0,0,.35)}
.theme-sw>span{position:absolute;right:3px;bottom:3px;width:11px;height:11px;border-radius:999px;
  box-shadow:0 0 0 1.5px rgba(0,0,0,.25)}
.theme-nm{flex:1;min-width:0;font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.theme-ck{stroke:var(--primary);width:15px;height:15px;flex-shrink:0}

/* ── Module picker (GF.openModulePicker) ── */
.module-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px}
.module-chip{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:14px 14px 12px;
  cursor:pointer;border:1px solid var(--glass-border);border-radius:12px;background:var(--surface-2);
  color:var(--ink);font-family:inherit;text-align:left;transition:border-color .14s,background .14s;width:100%}
.module-chip:hover{border-color:var(--primary);background:var(--surface-3)}
.module-chip.on{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary) inset}
.module-chip-ic{width:22px;height:22px;stroke:var(--primary);margin-bottom:2px}
.module-chip-nm{font-size:13px;font-weight:700;line-height:1.2}
.module-chip-desc{font-size:11.5px;color:var(--ink-2);line-height:1.4;flex:1}
.module-chip-ck{stroke:var(--primary);width:15px;height:15px;align-self:flex-end}

/* ── Department home (depthome-view.js) ── */
.dh-head{align-items:center;gap:12px}
.dh-head .dh-icon{display:inline-flex;align-items:center;justify-content:center;
  width:40px;height:40px;border-radius:12px;flex-shrink:0;
  background:color-mix(in srgb, var(--dh-color, var(--primary)) 14%, transparent);
  border:1px solid color-mix(in srgb, var(--dh-color, var(--primary)) 28%, transparent)}
.dh-head .dh-icon .icon{width:20px;height:20px}
.dh-presets{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:2px 0 14px}
.dh-presets-lbl{font-size:11px;font-weight:800;letter-spacing:.5px;text-transform:uppercase;color:var(--ink-3)}
.preset-chip{display:inline-flex;align-items:center;gap:5px}
.preset-chip .icon{width:13px;height:13px}
.dh-panels{display:flex;flex-direction:column;gap:14px}
.dh-panel .panel-body{display:flex;flex-direction:column;gap:12px}
.dh-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px}
.dh-group-head{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.dh-group-key{font-family:var(--mono);font-size:12px;font-weight:700;color:var(--ink-2);
  background:var(--surface-3);border:1px solid var(--line);padding:2px 8px;border-radius:6px}
.dh-group-key.dh-ungrouped{color:var(--ink-3);background:transparent;border-style:dashed}
.dh-inout{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.dh-empty{padding:34px 20px;text-align:center;border:1px dashed var(--line);border-radius:14px;margin-bottom:14px}
.dh-empty-title{font-size:15px;font-weight:700;color:var(--ink-2)}
.dh-empty-sub{font-size:12.5px;color:var(--ink-3);margin-top:6px}
.kcard-foot .attr-chip{max-width:110px;overflow:hidden;text-overflow:ellipsis}
@media (max-width:760px){.dh-inout{grid-template-columns:1fr}.dh-grid{grid-template-columns:1fr}}

/* ── Add-modal department template fields (dept-templates.js) ── */
.dept-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.dept-fields .af-field{margin:0}
@media (max-width:560px){.dept-fields{grid-template-columns:1fr}}

/* ── Executive Report (execreport-view.js) ── */
.xr-chips{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 16px}
.xr-chips-compact{margin:0;padding:10px 14px;border-bottom:1px solid var(--line)}
.xr-chip{display:inline-flex}
.xr-chip-in{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:700;
  padding:4px 11px;border-radius:99px;white-space:nowrap}
.xr-chip-in .dot{width:7px;height:7px;border-radius:99px;opacity:.8}
.xr-kpis{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 16px}
.xr-kpi{flex:1 1 130px;background:var(--surface);border:1px solid var(--line);border-radius:11px;padding:10px 14px}
.xr-kpi .v{font-family:var(--font-display);font-size:24px;font-weight:700;color:var(--ink)}
.xr-kpi .l{font-size:11px;color:var(--ink-3);font-weight:600}
.xr-secs{display:flex;flex-direction:column;gap:10px}
.xr-sec{background:var(--surface);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.xr-sec.open{border-color:var(--border-strong)}
.xr-sec-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;user-select:none;flex-wrap:wrap}
.xr-sec-head:hover{background:var(--surface-2)}
.xr-sec-head b{font-size:14px}
.xr-sec-head .sub{font-family:var(--mono);font-size:11px}
.xr-sec-body{padding:4px 16px 14px;border-top:1px solid var(--line-2)}
.xr-exports{display:flex;gap:8px;margin:10px 0}
.xr-tsec{margin:10px 0}
.xr-tsec-head{font-weight:700;font-size:13px;margin-bottom:5px;color:var(--ink)}
.xr-badge{font-size:10px;font-weight:700;color:var(--amber-fg);background:var(--amber-soft);
  padding:1px 7px;border-radius:8px}
.xr-frow{display:flex;gap:12px;padding:2.5px 0;font-size:12.5px}
.xr-frow .k{flex:0 0 44%;min-width:0;color:var(--ink-2)}
.xr-frow .v{flex:1;color:var(--ink);font-weight:600}
.xr-nar{font-size:13px;line-height:1.6;color:var(--ink);white-space:pre-wrap;margin-top:4px}
.xr-tasks{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.xr-task{background:var(--surface-2);border:1px solid var(--line-2);border-radius:9px;padding:0 12px}
.xr-task[open]{padding-bottom:10px;border-color:var(--line)}
.xr-task summary{display:flex;align-items:center;gap:9px;padding:9px 0;cursor:pointer;flex-wrap:wrap;list-style:none}
.xr-task summary::-webkit-details-marker{display:none}
.xr-task-title{flex:1;min-width:180px;font-weight:600;font-size:13px}
.xr-desc{font-size:12.5px;color:var(--ink-2);margin:2px 0 8px;white-space:pre-wrap}
.xr-note{font-size:12px;color:var(--ink-2);padding:3px 0 3px 10px;border-left:2px solid var(--line);margin:4px 0}
.xr-note b{color:var(--ink)} .xr-note .by{font-style:italic;color:var(--ink-3)}
.xr-task-actions{display:flex;gap:8px;margin-top:8px}
@media (max-width:760px){.xr-frow .k{flex-basis:52%}.xr-kpi .v{font-size:20px}.ana-tv{font-size:20px}}

/* ── Calendar (month grid) ── */
.cal-bar{display:flex;align-items:center;gap:10px;margin:6px 0 12px}
.cal-title{font-family:var(--font-display);font-size:19px;font-weight:700;color:var(--ink);min-width:180px;text-align:center}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.cal-dow{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--ink-3);padding:4px 6px}
.cal-cell{min-height:92px;background:var(--glass-bg);border:1px solid var(--glass-border);border-radius:var(--r-md,10px);
  padding:6px;overflow:hidden}
.cal-pad{background:none;border-color:transparent}
.cal-today{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary),0 0 14px rgba(var(--accent-rgb),.25)}
.cal-num{font-family:var(--mono);font-size:11px;color:var(--ink-3);margin-bottom:4px}
.cal-today .cal-num{color:var(--primary);font-weight:700}
.cal-chip{font-size:11px;color:var(--ink-2);background:var(--surface-2);border-left:3px solid var(--primary);
  border-radius:4px;padding:2px 5px;margin-bottom:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.cal-chip:hover{color:var(--ink);background:var(--primary-soft)}
.cal-chip.done{opacity:.55;text-decoration:line-through}
.cal-more{font-size:10px;color:var(--ink-4)}
@media (max-width:880px){.cal-grid{grid-template-columns:repeat(7,minmax(40px,1fr))}.cal-cell{min-height:56px}.cal-chip{display:none}.cal-more{display:block}}

/* ── Workload (crew capacity) ── */
.wl-hint{font-size:12px;color:var(--ink-3);margin:2px 0 12px}
.wl-list{display:flex;flex-direction:column;gap:10px}
.wl-row{display:grid;grid-template-columns:220px 220px 1fr;gap:14px;align-items:center;
  background:var(--glass-bg);border:1px solid var(--glass-border);border-radius:var(--r-md,10px);padding:10px 14px}
.wl-row.wl-over{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary),0 0 16px rgba(var(--accent-rgb),.3)}
.wl-who{display:flex;align-items:center;gap:10px;min-width:0}
.wl-name{min-width:0}.wl-name b{display:block;font-size:13.5px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wl-name span{font-size:11px;color:var(--ink-3)}
.wl-bar{position:relative;height:18px;background:var(--surface-2);border:1px solid var(--line);border-radius:9px;overflow:hidden}
.wl-fill{width:100%;height:100%;border-radius:9px;transform-origin:left center;transition:transform .3s ease}
.wl-fill.wl-ok{background:linear-gradient(90deg,var(--green-soft),var(--green))}
.wl-fill.wl-warm{background:linear-gradient(90deg,var(--orange-soft),var(--orange))}
.wl-fill.wl-hot{background:linear-gradient(90deg,var(--red-soft),var(--red))}
.wl-pts{position:absolute;right:8px;top:50%;transform:translateY(-50%);font-family:var(--mono);font-size:10.5px;color:var(--ink)}
.wl-chips{display:flex;flex-wrap:wrap;gap:5px;min-width:0}
.wl-chip{display:inline-flex;align-items:center;gap:5px;font-size:11px;color:var(--ink-2);background:var(--surface-2);border:1px solid var(--line);
  border-radius:6px;padding:3px 8px;cursor:grab;white-space:nowrap}
.wl-chip:hover{color:var(--ink);border-color:var(--primary)}
/* priority dot on each load chip (Mass Weed workload mockup) — same palette as .prtag */
.wl-dot{width:6px;height:6px;border-radius:999px;flex:none;background:var(--ink-4)}
.wl-dot.critical{background:var(--red)}
.wl-dot.high{background:var(--orange)}
.wl-dot.medium{background:var(--blue)}
.wl-dot.low{background:var(--ink-4)}
/* the 4-KPI band above the crew list reuses the shared .ana-tiles grid */
.wl-kpis{margin-bottom:14px}
.wl-none{font-size:11.5px;color:var(--ink-4)}
@media (max-width:880px){.wl-row{grid-template-columns:1fr;gap:8px}}

/* ── Analytics view ── */
.ana-head { display:flex; gap:6px; margin-bottom:12px; }
.ana-tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin-bottom:14px; }
.ana-tile { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px 14px; }
.ana-tl { font-size:12px; color:var(--ink-3); margin-bottom:4px; }
.ana-tv { font-size:26px; font-weight:600; color:var(--ink); }
.ana-ts { font-size:12px; color:var(--ink-2); margin-top:2px; }
/* Value tones for the exec cockpit KPI band (GF.kpiTile's 4th arg) — on-time
   reads green, overdue red, over-budget effort amber. */
.ana-tv--good { color:var(--primary); }
.ana-tv--bad  { color:var(--red-fg,var(--red)); }
.ana-tv--warn { color:var(--amber-fg,var(--amber,var(--orange))); }
/* Sub-line tones (GF.kpiTile's 5th arg, subTone) — same palette as the value
   tones above, for a badge on the tile's second line (e.g. "3 overdue").
   Kept as real CSS classes rather than a passed-in inline <span style=...>
   string so the color is applied inside GF.kpiTile, after GF.esc has already
   run on `sub`. */
.ana-ts--good { color:var(--primary); }
.ana-ts--bad  { color:var(--red-fg,var(--red)); }
.ana-ts--warn { color:var(--amber-fg,var(--amber,var(--orange))); }
.ana-grid2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:12px; }
.ana-panel { padding:14px 16px; }
.ana-pt { font-size:13px; font-weight:600; color:var(--ink-2); margin-bottom:10px; }
.ana-panel svg { width:100%; height:auto; display:block; }
.ana-grid { stroke:var(--line); stroke-width:1; }
.ana-tick { font-size:9px; fill:var(--ink-3); font-family:inherit; }
.ana-cap { font-size:10px; fill:var(--ink-2); font-weight:600; font-family:inherit; }
.ana-legend { display:flex; gap:14px; margin-top:8px; font-size:12px; color:var(--ink-2); }
.ana-legend i { display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:5px; vertical-align:-1px; }
.ana-note { font-size:12px; color:var(--ink-3); margin-top:8px; }
.ana-row { display:grid; grid-template-columns:minmax(90px,130px) 1fr 34px auto; gap:8px; align-items:center; padding:4px 0; }
.ana-rl { font-size:12.5px; color:var(--ink-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ana-hb { height:14px; background:var(--surface-2); border-radius:0 4px 4px 0; overflow:hidden; }
.ana-hb-f { height:100%; background:var(--ch-a); border-radius:0 4px 4px 0; }
.ana-rv { font-size:12.5px; color:var(--ink); font-weight:600; text-align:right; font-variant-numeric:tabular-nums; }
.ana-rx { display:flex; gap:10px; font-size:11.5px; color:var(--ink-2); white-space:nowrap; }
.ana-rx .fs-dot { margin-right:4px; }

/* ── QMS Studio views ── */
.qms-zone { font-size:12px; color:var(--ink-3); border:1px solid var(--line);
  border-left:3px solid var(--violet); border-radius:8px; padding:8px 12px; margin-bottom:12px; }
.qms-search { background:var(--surface-2); border:1px solid var(--line); border-radius:8px;
  color:var(--ink); padding:8px 12px; font-size:13px; min-width:200px; }
.qms-list { display:flex; flex-direction:column; }
.qms-row { display:flex; gap:10px; align-items:center; padding:9px 8px; border-bottom:1px solid var(--line);
  cursor:pointer; border-radius:6px; }
.qms-row:hover { background:var(--surface-2); }
.qms-row.on { background:var(--surface-2); }
.qms-code { font-size:12px; color:var(--ink-2); flex:none; min-width:96px; }
.qms-title { flex:1; font-size:13px; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.qms-detail { background:var(--surface-2); border-radius:0 0 8px 8px; padding:12px 14px; margin-bottom:6px; }
.qms-dgrid { display:grid; grid-template-columns:auto 1fr; gap:4px 14px; font-size:12.5px;
  color:var(--ink-3); margin-bottom:10px; }
.qms-dgrid b { color:var(--ink); font-weight:500; }
.qms-dl { display:flex; gap:8px; flex-wrap:wrap; }
.qms-hit { border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin-bottom:8px; }
.qms-hit-h { display:flex; gap:10px; align-items:center; margin-bottom:6px; flex-wrap:wrap; }
.qms-hit-b { font-size:13px; color:var(--ink-2); line-height:1.5; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce){
  .kcard:hover{transform:none}
  .tlcard:hover{transform:none}
  .fac-room:hover{transform:none}
  .asst-typing span{animation-duration:2.4s}
}


/* ═══════════════════════════════════════════════════════════════════════
   MASS WEED MW-1 COVERAGE PASS — audit / calendar / intake page styling
   merged in from the per-page staging sheets. Cross-skin generic tokens
   only, so every rule inherits light / dark / skin theming.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── AUDIT view ──────────────────────────────────────────────────────── */

/* Integrity strip container — the mockup's "verify bar": chain glyph + meta on
   the left, verdict(s) + Verify action on the right; wraps on narrow widths. */
.audit-verifybar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 6px 4px 14px;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 11px);
}

/* Chain glyph well at the strip's left edge. */
.audit-vb-ic {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: var(--r-md, 8px);
}
.audit-vb-ic .icon { width: 18px; height: 18px; }

/* Title + SHA-256 meta line block; takes the remaining row width. */
.audit-vb-body { flex: 1; min-width: 160px; }
.audit-vb-title {
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: .02em;
}
.audit-vb-meta {
  margin-top: 2px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--ink-3);
}

/* Verdict pills sit as a group so both chain verdicts stay together and wrap
   as one unit before the button. */
.audit-vb-verdicts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Verdict pill — base + ok / bad / idle states. */
.audit-verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.audit-verdict .icon { width: 14px; height: 14px; }
.audit-verdict.ok {
  color: var(--green, #2BE8A0);
  background: var(--green-soft, rgba(43, 232, 160, .12));
  border: 1px solid var(--green-soft, rgba(43, 232, 160, .25));
}
.audit-verdict.bad {
  color: var(--red, #FF4D5E);
  background: var(--red-soft, rgba(255, 77, 94, .12));
  border: 1px solid var(--red-soft, rgba(255, 77, 94, .25));
}
.audit-verdict.idle {
  color: var(--ink-3);
  background: transparent;
  border: 1px solid var(--line);
}

/* Filter row — chain chips, action chips, table popup and search box, all on
   one wrapping line. */
.audit-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 4px 12px;
}

/* A tight group of related filter chips (chain, or action). */
.audit-fseg {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* Filter chip toggle — the mockup's .fbtn: compact, uppercase, on/off. */
.audit-fchip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 11px;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md, 7px);
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.audit-fchip:hover { color: var(--ink); border-color: var(--primary); }
.audit-fchip.on {
  color: var(--text-on-primary, #041018);
  background: var(--primary);
  border-color: transparent;
}

/* Keeps the table popup trigger from collapsing too narrow beside the chips. */
.audit-tablesel { min-width: 150px; }

/* Free-text search box — grows to fill leftover width, magnifier + input. */
.audit-search {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md, 8px);
}
.audit-search .icon { color: var(--ink-3); width: 16px; height: 16px; flex: none; }
.audit-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 12.5px;
}
.audit-search input::placeholder { color: var(--ink-3); }

/* "Showing N of M" count shown above the list only while a search is active. */
.audit-count {
  font-size: 11px;
  color: var(--ink-3);
  margin: 0 2px 8px;
  letter-spacing: .02em;
}

/* ── CALENDAR view ───────────────────────────────────────────────────── */

/* ── Toolbar legend ──────────────────────────────────────────────────────
   Decodes the department colours the grid chips are tinted with (each chip's
   border-left-color = GF.dep(t.dept).color). Only departments present in the
   month on screen are listed, so it stays small and contextual. */
.cal-legend{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; margin-left:auto; }
.cal-lg{ display:flex; align-items:center; gap:6px; font-size:11px; color:var(--ink-3);
  text-transform:uppercase; letter-spacing:.06em; white-space:nowrap; }
.cal-lg-dot{ width:10px; height:10px; border-radius:2px; flex:none; }

/* ── "Upcoming" horizontal strip ─────────────────────────────────────────
   The next several not-done task due-dates from the tasks this view already
   holds (GF.state.tasks + tree children) — no new data source. Scrolls
   horizontally; each card deep-links to the task via the same xrJump the chips
   use. */
.cal-up-wrap{ margin:2px 0 14px; }
.cal-up-label{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.08em;
  color:var(--ink-3); margin-bottom:8px; }
.cal-upstrip{ display:flex; gap:10px; overflow-x:auto; padding-bottom:6px;
  scrollbar-width:thin; scrollbar-color:var(--glass-border) transparent; }
.cal-upstrip::-webkit-scrollbar{ height:6px; }
.cal-upstrip::-webkit-scrollbar-thumb{ background:var(--glass-border); border-radius:3px; }
.cal-upcard{ flex:none; min-width:170px; max-width:230px; display:flex; gap:10px; align-items:flex-start;
  text-align:left; padding:10px 13px; cursor:pointer; background:var(--glass-bg);
  border:1px solid var(--glass-border); border-left:3px solid var(--primary);
  border-radius:var(--r-md,10px); transition:background .13s ease, box-shadow .13s ease, transform .13s ease; }
.cal-upcard:hover{ background:var(--primary-soft); box-shadow:0 0 0 1px var(--primary); transform:translateY(-1px); }
.cal-upcard:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }
.cal-up-dot{ width:9px; height:9px; border-radius:2px; flex:none; margin-top:3px; }
.cal-up-body{ display:flex; flex-direction:column; min-width:0; }
.cal-up-title{ font-size:12.5px; font-weight:600; color:var(--ink);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-up-date{ font-size:10.5px; color:var(--ink-4); margin-top:3px;
  text-transform:uppercase; letter-spacing:.04em; }
.cal-up-empty{ font-size:12px; color:var(--ink-4); padding:8px 2px; }

/* ── Mass Weed HUD polish: angled corners echoing the mockup's clip-path cards ── */
:root[data-theme^="mass-weed"] .cal-upcard{ border-radius:0;
  clip-path:polygon(0 0,100% 0,100% calc(100% - 7px),calc(100% - 7px) 100%,0 100%); }
:root[data-theme^="mass-weed"] .cal-lg-dot,
:root[data-theme^="mass-weed"] .cal-up-dot{ border-radius:1px; }

/* ── Narrow screens: the base cal- rules already hide grid chips < 880px and
   fall back to the "+N" pill, so drop the colour legend too (its chips are the
   thing being decoded). The Upcoming strip keeps its own horizontal scroll. ── */
@media (max-width:880px){ .cal-legend{ display:none; } }

/* ── AI INTAKE view ──────────────────────────────────────────────────── */

/* Two-column intake layout: source text (left) beside the extracted candidate
   cards (right). Collapses to a single stacked column on narrow screens. */
.mwtmp-intake-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 840px) {
  .mwtmp-intake-layout { grid-template-columns: 1fr; }
}
/* Let each grid track shrink below its content width instead of forcing the
   page to scroll horizontally (long unbroken pasted lines, wide cards). */
.mwtmp-intake-col { min-width: 0; }

/* Column heading — the small uppercased label above each column. */
.mwtmp-col-t {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
  margin: 0 2px 10px;
}

/* Live character-counter row under the source textarea. */
.mwtmp-cap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-3);
}
/* Over the 4000-char advisory cap — the counter turns red (advisory only, the
   Analyze action is never disabled; the backend imposes no hard limit). */
.mwtmp-cap.over { color: var(--red-fg, var(--red)); }

/* Idle placeholder shown in the candidates column before any extraction runs. */
.mwtmp-intake-idle {
  font-size: 13px;
  color: var(--ink-3);
  padding: 10px 2px;
  line-height: 1.5;
}

/* Source-quote attribution on a candidate card — the source snippet the AI
   drew the task from. Rendered by the view only when the extraction payload
   carries the quote; that field is DEFERRED backend data as of this pass (see
   the note in intake-view.js), so today this rule is defined ahead of the data
   and simply lies dormant until a quote arrives. */
.mwtmp-cand-src {
  margin-top: 8px;
  font-size: 11.5px;
  font-style: italic;
  color: var(--ink-3);
  line-height: 1.45;
}


/* ═══════════════════════════════════════════════════════════════════════
   MASS WEED MW-1 COVERAGE PASS (batch 2) — dashboard / facility / analytics
   / my-day page styling, merged from the per-page staging sheets. Cross-skin
   generic tokens only; theme-aware in light / dark / every skin.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── DASHBOARD view ──────────────────────────────────────────────────── */

/* ── KPI week-over-week delta line (appended under .kpi-l) ── */
.kpi-delta{font-size:11px;font-weight:800;letter-spacing:.02em;margin-top:6px;
  display:inline-flex;align-items:center;gap:3px;line-height:1}
.kpi-delta--good{color:var(--green)}
.kpi-delta--bad{color:var(--red)}
.kpi-delta--flat{color:var(--ink-3)}

/* ── Alerts feed (real notifications from GF.WWF._notif.items) ── */
.dash-card--wide{grid-column:1 / -1}
.dash-alert{display:flex;align-items:center;gap:10px;padding:9px 0;
  border-top:1px solid var(--line-2)}
.dash-alert:first-of-type{border-top:none}
.dash-alert-dot{width:8px;height:8px;border-radius:50%;flex:none;
  background:var(--primary);box-shadow:0 0 7px var(--primary)}
.dash-alert--crit .dash-alert-dot{background:var(--red);box-shadow:0 0 7px var(--red)}
.dash-alert--warn .dash-alert-dot{background:var(--amber);box-shadow:0 0 7px var(--amber)}
.dash-alert-tx{font-size:13px;color:var(--ink-2);flex:1;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-alert--crit .dash-alert-tx{color:var(--ink);font-weight:600}
.dash-alert-age{font-size:11px;font-weight:700;color:var(--ink-3);
  letter-spacing:.04em;flex:none}
.dash-alert-empty{font-size:12.5px;color:var(--ink-3);padding:6px 0}

/* ── Pipeline lifecycle strip (departments as flow-ordered lifecycle pills) ── */
.dash-strip{display:flex;align-items:center;gap:12px;flex-wrap:wrap;
  margin:14px 0;padding:11px 14px;background:var(--surface);
  border:1px solid var(--line);border-radius:12px;box-shadow:var(--sh-1)}
.dash-strip-h{font-size:11px;font-weight:800;letter-spacing:.5px;
  text-transform:uppercase;color:var(--ink-3);flex:none}
.dash-mods{display:flex;gap:7px;flex-wrap:wrap;flex:1}
.dash-mod{display:inline-flex;align-items:center;gap:6px;cursor:pointer;
  font:inherit;font-size:11px;font-weight:700;letter-spacing:.02em;
  color:var(--ink-2);padding:4px 9px;border-radius:8px;
  background:var(--surface-2);border:1px solid var(--line);transition:border-color .12s}
.dash-mod:hover{border-color:var(--mc)}
.dash-mod.on{border-color:var(--mc);box-shadow:inset 0 0 0 1px var(--mc)}
.dash-mod-dot{width:7px;height:7px;border-radius:50%;flex:none;
  background:var(--mc);box-shadow:0 0 6px var(--mc)}
.dash-mod--idle{opacity:.6}
.dash-mod--idle .dash-mod-dot{box-shadow:none}
.dash-mod-n{font-size:10px;font-weight:800;color:var(--ink-3);
  background:var(--surface-3);border-radius:5px;padding:0 5px}

/* ── ANALYTICS view (yield-domain band) ──────────────────────────────── */

/* Section divider introducing the yield-domain band beneath the task-domain
   analytics grid — one labelled rule, reused for each such section. */
.ana-sec { display:flex; align-items:center; gap:9px; margin:24px 0 12px; padding-top:16px; border-top:1px solid var(--line); }
.ana-sec .ana-sec-ic { width:18px; height:18px; flex:0 0 auto; stroke:var(--primary); }
.ana-sec h3 { margin:0; font-size:14px; font-weight:600; color:var(--ink); }
.ana-sec .ana-sec-note { margin-left:auto; font-size:11.5px; color:var(--ink-3); }

@media (max-width:520px) { .ana-sec .ana-sec-note { display:none; } }

/* ── MY-DAY view ─────────────────────────────────────────────────────── */

/* ── Greeting hero (evolves the plain .view-head for the personal My Day) ── */
.md-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;
  flex-wrap:wrap;padding:4px 2px 16px}
.md-hero__hi{font-family:var(--font-display);font-size:26px;font-weight:700;
  letter-spacing:.02em;color:var(--ink);line-height:1.1}
.md-hero__sub{font-size:13px;color:var(--ink-3);font-weight:500;margin-top:5px;
  letter-spacing:.02em}

/* Visible ⌘K affordance — a real <button> wired to GF.cmdk.open() */
.md-hero__cmd{display:inline-flex;align-items:center;gap:9px;cursor:pointer;
  padding:9px 13px;background:var(--surface-2);color:var(--ink-3);
  border:1px solid var(--line);border-radius:var(--r-md);font:inherit;
  transition:border-color .12s ease,color .12s ease}
.md-hero__cmd:hover{border-color:var(--primary);color:var(--ink-2)}
.md-hero__cmd .icon{width:15px;height:15px;color:var(--primary)}
.md-hero__cmd span{font-size:12.5px;letter-spacing:.03em;white-space:nowrap}
.md-hero__cmd kbd{font-family:var(--font-display);font-size:10px;letter-spacing:.06em;
  color:var(--ink-3);border:1px solid var(--line);border-radius:4px;padding:2px 6px;
  background:rgba(var(--accent-rgb),.06)}

/* ── 7-day strip: this week's per-day load of MY tasks (informational) ── */
.md-strip{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;margin-bottom:14px}
.md-day{text-align:center;padding:9px 0 8px;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--r-md);box-shadow:var(--sh-1)}
.md-day.is-today{border-color:var(--primary);background:var(--primary-soft)}
.md-day__dn{font-size:10px;text-transform:uppercase;letter-spacing:.12em;
  color:var(--ink-3);font-weight:600}
.md-day__dd{font-family:var(--font-display);font-size:19px;font-weight:700;
  color:var(--ink);margin-top:2px;line-height:1}
.md-day__dots{margin-top:6px;min-height:6px;display:flex;gap:3px;justify-content:center}
.md-day__dots i{width:5px;height:5px;border-radius:50%;background:var(--ink-3);opacity:.55}
.md-day.is-today .md-day__dots i{background:var(--primary);opacity:.9}

@media (max-width:640px){
  .md-hero__cmd span{display:none}
  .md-day__dd{font-size:17px}
}


/* ═══════════════════════════════════════════════════════════════════════
   MASS WEED MW-1 COVERAGE PASS (batch 3) — approvals / eCoA intake /
   leaves-stability page styling, merged from the per-page staging sheets.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── APPROVALS view (unified sign-off queue) ─────────────────────────── */

/* ── Container ─────────────────────────────────────────────────────────── */
.mwq {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.mwq-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px 0;
}
.mwq-ttl {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ── Tabs ──────────────────────────────────────────────────────────────── */
.mwq-tabs {
  display: flex;
  gap: 2px;
  margin-left: auto;
  flex-wrap: wrap;
}
.mwq-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font: inherit;
  font-size: 12.5px;
  letter-spacing: .03em;
  color: var(--ink-3);
  background: transparent;
  border: none;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 transparent;
  transition: color .12s, box-shadow .12s, background .12s;
}
.mwq-tab:hover { color: var(--ink); }
.mwq-tab.on {
  color: var(--primary);
  box-shadow: inset 0 -2px 0 var(--primary);
  background: rgba(var(--accent-rgb), .08);
}
.mwq-c {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  padding: 1px 6px;
  text-align: center;
  border-radius: 999px;
  color: var(--ink-3);
  background: var(--surface-3);
}
.mwq-tab.on .mwq-c { color: var(--primary); background: rgba(var(--accent-rgb), .16); }

/* ── Rows ──────────────────────────────────────────────────────────────── */
.mwq-list { padding: 6px 8px 8px; }
.mwq-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-2);
}
.mwq-row:last-child { border-bottom: none; }
.mwq-ic {
  width: 34px;
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--blue);
  background: rgba(var(--accent-rgb), .1);
}
.mwq-ic .icon { width: 17px; height: 17px; }
.mwq-ic--warn { color: var(--orange); background: rgba(230, 160, 40, .14); }
.mwq-ic--good { color: var(--green);  background: rgba(80, 200, 120, .14); }
.mwq-ic--bad  { color: var(--red);    background: rgba(230, 80, 80, .14); }
.mwq-ic--info { color: var(--blue);   background: rgba(70, 150, 230, .14); }

.mwq-body { min-width: 0; }
.mwq-t {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mwq-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.mwq-kind {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  color: var(--ink-3);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

/* ── Empty + deferred states ───────────────────────────────────────────── */
.mwq-empty {
  text-align: center;
  color: var(--ink-3);
  padding: 26px 0;
  font-size: 12.5px;
}
.mwq-defer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 4px 2px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-3);
  background: rgba(var(--accent-rgb), .06);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.mwq-defer .icon { width: 15px; height: 15px; flex: none; color: var(--blue); margin-top: 1px; }

/* ── Mass-Weed-only: angular clip + accent glow (matches the mockup HUD) ── */
:root[data-theme^="mass-weed"] .mwq {
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .22);
}
:root[data-theme^="mass-weed"] .mwq-ic {
  clip-path: polygon(5px 0, 100% 0, 100% 100%, 0 100%, 0 5px);
  border-radius: 0;
}
:root[data-theme^="mass-weed"] .mwq-kind {
  clip-path: polygon(3px 0, 100% 0, 100% 100%, 0 100%, 0 3px);
  border-radius: 0;
}
:root[data-theme^="mass-weed"] .mwq-tab.on {
  text-shadow: 0 0 10px rgba(var(--accent-rgb), .5);
}
:root[data-theme^="mass-weed"] .mwq-ttl {
  text-shadow: 0 0 12px rgba(var(--accent-rgb), .3);
}

/* ── eCoA INTAKE view (document workbench) ───────────────────────────── */

.mwe-wb { margin: 4px 0 14px; }
.mwe-wb__top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.mwe-ic { width: 14px; height: 14px; flex: none; stroke: currentColor; fill: none; }
.mwe-n-ic { width: 11px; height: 11px; stroke: currentColor; fill: none; }

/* pipeline stepper */
.mwe-pipe { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.mwe-st {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mw-font-cond); font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--mw-text-faint); padding: 6px 10px;
}
.mwe-st .n {
  width: 19px; height: 19px; flex: none; display: grid; place-items: center;
  font-size: 9px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.mwe-st.done { color: var(--mw-stat-hi); }
.mwe-st.done .n { background: var(--mw-stat-hi); color: var(--mw-void); box-shadow: none; }
.mwe-st.cur { color: var(--mw-cyan-bright); }
.mwe-st.cur .n {
  box-shadow: inset 0 0 0 2px var(--mw-cyan-bright), 0 0 10px var(--mw-cyan);
  background: rgba(94, 200, 240, .12);
}
.mwe-st.rej { color: var(--mw-stat-lo); }
.mwe-st.rej .n { background: var(--mw-stat-lo); color: #fff; box-shadow: none; }
.mwe-arw { color: var(--mw-text-faint); font-size: 11px; padding: 0 2px; }

/* §6.3.1 countdown chip */
.mwe-clock {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mw-font-cond); font-weight: 700; font-size: 12px;
  letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
  padding: 6px 12px;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.mwe-clock--ok   { color: var(--mw-stat-hi);  box-shadow: inset 0 0 0 1.5px rgba(108, 240, 90, .5); background: rgba(108, 240, 90, .08); }
.mwe-clock--warn { color: var(--mw-stat-mid); box-shadow: inset 0 0 0 1.5px rgba(236, 236, 74, .5); background: rgba(236, 236, 74, .08); }
.mwe-clock--bad  { color: var(--mw-stat-lo);  box-shadow: inset 0 0 0 1.5px rgba(239, 77, 77, .55);  background: rgba(239, 77, 77, .09); }

/* SHA-256 custody bar */
.mwe-shabar {
  display: flex; gap: 9px; align-items: center;
  padding: 8px 13px; margin: 10px 0 0;
  font-family: var(--mw-mono); font-size: 10.5px; line-height: 1.5;
  color: var(--mw-text-dim);
  background: rgba(94, 200, 240, .05);
  box-shadow: inset 0 0 0 1px rgba(94, 200, 240, .18);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.mwe-shabar .mwe-ic { color: var(--mw-cyan-bright); }
.mwe-shabar b { color: var(--mw-ink); font-weight: 700; }
.mwe-shabar .mwe-sha { color: var(--mw-cyan-bright); }
.mwe-shabar--empty { color: var(--mw-text-faint); }
.mwe-shabar--empty .mwe-ic { color: var(--mw-text-faint); }

/* gate-note blocks */
.mwe-gates { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mwe-gate {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 13px; font-size: 11.5px; line-height: 1.5;
  color: var(--mw-text);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.mwe-gate .mwe-ic { margin-top: 1px; }
.mwe-gate b { color: var(--mw-ink); }
.mwe-gate.block { background: rgba(239, 77, 77, .08);  box-shadow: inset 0 0 0 1px rgba(239, 77, 77, .32); }
.mwe-gate.ok    { background: rgba(108, 240, 90, .07);  box-shadow: inset 0 0 0 1px rgba(108, 240, 90, .3); }
.mwe-gate.info  { background: rgba(94, 200, 240, .07);  box-shadow: inset 0 0 0 1px rgba(94, 200, 240, .28); }
.mwe-gate.block .mwe-ic { color: var(--mw-stat-lo); }
.mwe-gate.ok    .mwe-ic { color: var(--mw-stat-hi); }
.mwe-gate.info  .mwe-ic { color: var(--mw-cyan-bright); }

@media (max-width: 640px) {
  .mwe-wb__top { flex-direction: column; }
  .mwe-shabar { flex-wrap: wrap; }
}

/* ── LEAVES / stability view (pull-schedule drawer) ──────────────────── */

/* ── Scrim + right-side drawer ─────────────────────────────────────────── */
.mwl-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 10, 20, .68);
  backdrop-filter: blur(2px);
}
.mwl-drawer {
  position: fixed; top: 0; right: 0; height: 100%;
  width: min(480px, 94vw); z-index: 61;
  background: linear-gradient(160deg, var(--mw-panel), var(--mw-panel-2));
  box-shadow: -8px 0 40px rgba(0, 0, 0, .6), inset 1px 0 0 rgba(94, 200, 240, .3);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(.2, .7, .3, 1);
}
.mwl-drawer.on { transform: translateX(0); }

.mwl-dr-hd {
  position: sticky; top: 0; z-index: 2;
  padding: 18px 20px 14px;
  background: linear-gradient(160deg, var(--mw-panel), var(--mw-panel-2));
  box-shadow: inset 0 -1px 0 rgba(94, 200, 240, .16);
}
.mwl-dr-cls {
  position: absolute; top: 16px; right: 16px;
  cursor: pointer; color: var(--mw-text-dim);
  background: none; border: none; padding: 0; line-height: 0;
}
.mwl-dr-cls:hover { color: var(--mw-cyan-bright); }
.mwl-dr-cls svg { width: 20px; height: 20px; }
.mwl-dr-code { font-weight: 700; font-size: 14px; color: var(--mw-cyan-bright); }
.mwl-dr-title {
  font-family: var(--mw-font-cond), sans-serif;
  font-size: 17px; font-weight: 600; color: var(--mw-ink); margin-top: 5px;
}
.mwl-dr-bd { padding: 16px 20px 30px; }
.mwl-dr-sec {
  font-family: var(--mw-font-cond), sans-serif;
  text-transform: uppercase; letter-spacing: .12em;
  font-size: 11px; font-weight: 700; color: var(--mw-header); margin: 18px 0 10px;
}
.mwl-dr-bd .mwl-dr-sec:first-child { margin-top: 0; }

/* Grade / study-type badge, mirrors the mockup's .gd chip */
.mwl-gd {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 7px; color: #7fdfe0;
  box-shadow: inset 0 0 0 1px rgba(47, 217, 217, .4);
  clip-path: polygon(3px 0, 100% 0, 100% 100%, 0 100%, 0 3px);
}

/* ── Study meta grid ───────────────────────────────────────────────────── */
.mwl-meta {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 6px 14px; align-items: baseline; margin-bottom: 4px;
}
.mwl-meta-k {
  font-family: var(--mw-font-cond), sans-serif;
  text-transform: uppercase; letter-spacing: .06em;
  font-size: 10px; font-weight: 700; color: var(--mw-text-dim); white-space: nowrap;
}
.mwl-meta-v { font-size: 12.5px; color: var(--mw-text); }

/* ── Timepoint pull-schedule timeline ──────────────────────────────────── */
.mwl-tp {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; position: relative;
}
.mwl-tp:not(:last-child)::before {
  content: ""; position: absolute; left: 8px; top: 24px; bottom: -4px;
  width: 1px; background: rgba(94, 200, 240, .2);
}
.mwl-tp-dot {
  width: 17px; height: 17px; flex: none; border-radius: 50%;
  background: var(--mw-void);
  box-shadow: inset 0 0 0 2px var(--mw-text-faint);
  position: relative; z-index: 2;
}
.mwl-tp.done .mwl-tp-dot {
  box-shadow: inset 0 0 0 2px var(--mw-stat-hi); background: var(--mw-stat-hi);
}
.mwl-tp.due .mwl-tp-dot {
  box-shadow: inset 0 0 0 2px var(--mw-stat-mid), 0 0 8px var(--mw-stat-mid);
  background: var(--mw-stat-mid);
}
.mwl-tp-m {
  font-family: var(--mw-font-cond), sans-serif;
  font-weight: 700; font-size: 13px; color: var(--mw-ink);
  width: 72px; flex: none;
}
.mwl-tp-r { flex: 1; font-size: 11px; color: var(--mw-text-dim); }
.mwl-tp-r.mwl-blank, .mwl-blank { color: var(--mw-stat-mid); }
.mwl-tp-s {
  font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 1px 7px; white-space: nowrap;
  clip-path: polygon(3px 0, 100% 0, 100% 100%, 0 100%, 0 3px);
}
.mwl-tp-s.done { color: var(--mw-stat-hi); box-shadow: inset 0 0 0 1px rgba(108, 240, 90, .45); }
.mwl-tp-s.due { color: var(--mw-stat-mid); box-shadow: inset 0 0 0 1px rgba(236, 236, 74, .45); }
.mwl-tp-s.pend { color: var(--mw-text-faint); box-shadow: inset 0 0 0 1px rgba(127, 141, 164, .4); }

/* Deferred-data note: per-timepoint results have no backing field yet */
.mwl-defer { margin-top: 16px; opacity: .85; }

/* Row action that opens the drawer (reuses the app .btn look) */
.mwl-sched-btn { display: inline-flex; align-items: center; gap: 5px; }
.mwl-sched-btn svg { width: 13px; height: 13px; }


/* ═══════════════════════════════════════════════════════════════════════
   MASS WEED MW-1 COVERAGE PASS (batch 4) — team crew-roster + CoQ A4 preview
   ═══════════════════════════════════════════════════════════════════════ */

/* ── TEAM view (crew roster: hex avatars + stat bars) ────────────────── */

/* ── Hexagonal crew avatar ──────────────────────────────────────────────
   Wraps the shared GF.avatar so its initials / roster colour / name-title all
   still come from the real person record; ONLY the hexagon shape + accent glow
   are added. Accent-aware (cyan under Mass Weed, app accent elsewhere) via the
   app-wide --accent-rgb the rest of the roster already uses. */
.mwtm-hex{ display:inline-flex; flex:none; }
.mwtm-hex .avatar{
  border-radius:0;
  clip-path:polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  filter:drop-shadow(0 0 5px rgba(var(--accent-rgb), .55));
}

/* ── Per-person stat block ──────────────────────────────────────────────
   Sits between the department row and the action row of each team card. */
.mwtm-stats{ display:flex; flex-direction:column; gap:9px; margin-bottom:11px; }
.mwtm-stat{ margin:0; }
.mwtm-stat__head{
  display:flex; justify-content:space-between; align-items:baseline;
  gap:8px; margin-bottom:4px;
}
.mwtm-stat__name{
  font-size:10.5px; font-weight:600; text-transform:uppercase;
  letter-spacing:.06em; color:var(--ink-3);
}
.mwtm-stat__val{
  font-size:12.5px; font-weight:800; color:var(--ink);
  font-variant-numeric:tabular-nums;
}

/* Neutral "active load" fill — load is a magnitude, NOT a good/bad signal, so
   it must not borrow the green/amber/red semantic .mw-stat__fill hues. It
   tracks the live theme accent instead (cyan under Mass Weed). Sits inside the
   shared .mw-stat__track and is driven by an inline transform:scaleX(fraction),
   the same mechanism the app's .mw-stat__fill already uses. */
.mwtm-fill{
  width:100%; height:100%; border-radius:3px;
  transform-origin:left center; transition:transform .4s ease;
  background:linear-gradient(90deg, var(--mw-cyan-deep, var(--primary)), var(--primary));
  box-shadow:0 0 8px rgba(var(--accent-rgb), .5);
}

/* Honest empty state for a crew member with no owned tasks this week — never a
   misleading 0% completion bar. */
.mwtm-quiet{ font-size:11.5px; color:var(--ink-3); font-style:italic; padding:1px 0; }

/* Deferred-metrics note: efficiency / shift / zone need worklog-derived data
   that is not yet an app data source (a part-owner decision). Rendered as an
   explicit, low-key placeholder rather than fabricated numbers. */
.mwtm-defer{
  font-size:10px; color:var(--ink-3); opacity:.72;
  letter-spacing:.03em; line-height:1.35;
}

/* ── CoQ PRINT view (A4 paper preview) ───────────────────────────────── */

/* scroll frame + desk backdrop around the sheet */
.mwcoq-wrap{
  margin-top:12px;
  padding:18px;
  overflow-x:auto;
  background:var(--mw-void, #0a0f16);
  border-radius:8px;
  display:flex;
  justify-content:center;
}

/* the A4 sheet (fixed paper regardless of app theme — it is a document proof) */
.mwcoq-sheet{
  width:210mm;
  max-width:100%;
  min-height:220mm;
  box-sizing:border-box;
  padding:16mm 16mm 14mm;
  position:relative;
  background:#f4f8fc;
  color:#0d2036;
  box-shadow:0 18px 50px rgba(0,0,0,.45);
  font-family:'Titillium Web', system-ui, sans-serif;
}
.mwcoq-sheet .mono{ font-family:'Geist Mono', ui-monospace, monospace; }

/* watermark (status-driven text supplied inline by the view) */
.mwcoq-wm{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  pointer-events:none; opacity:.05; overflow:hidden;
}
.mwcoq-wm span{
  font-family:'Saira Condensed', sans-serif;
  font-weight:800; font-size:150px; letter-spacing:6px;
  color:#0a4a6e; transform:rotate(-24deg); white-space:nowrap;
}

/* header */
.mwcoq-hd{
  display:flex; align-items:flex-start; gap:14px;
  border-bottom:3px solid #0a4a6e; padding-bottom:12px;
  position:relative;
}
.mwcoq-hd__badge{
  width:46px; height:46px; flex:none;
  display:grid; place-items:center;
  background:#0a4a6e; color:#fff; border-radius:6px;
}
.mwcoq-hd__badge .icon{ width:26px; height:26px; stroke:#fff; fill:none; }
.mwcoq-hd__t{ flex:1; }
.mwcoq-hd__ttl{
  font-family:'Saira Condensed', sans-serif;
  font-weight:800; font-size:23px; letter-spacing:.02em;
  text-transform:uppercase; color:#0d2036; line-height:1.05;
}
.mwcoq-hd__sub{
  font-family:'Saira Condensed', sans-serif;
  font-weight:700; font-size:12px; letter-spacing:.06em;
  text-transform:uppercase; color:#0a4a6e; margin-top:2px;
}
.mwcoq-hd__no{ text-align:right; }
.mwcoq-hd__no .l{
  font-size:8px; text-transform:uppercase; letter-spacing:.12em; color:#5a7690;
}
.mwcoq-hd__no .v{ font-weight:700; font-size:14px; color:#0a4a6e; }

.mwcoq-verdict{
  display:inline-flex; align-items:center; gap:8px;
  font-family:'Saira Condensed', sans-serif;
  font-weight:800; font-size:16px; letter-spacing:.06em;
  text-transform:uppercase; padding:5px 15px; margin-top:8px;
  background:#eaf2f9;
}
.mwcoq-verdict.pass{ background:#c9f0d6; }
.mwcoq-verdict.fail{ background:#f7d3d6; }
.mwcoq-verdict.pending{ background:#e6ecf2; }

/* section label */
.mwcoq-sec{
  font-family:'Saira Condensed', sans-serif;
  font-weight:700; font-size:12px; text-transform:uppercase; letter-spacing:.1em;
  color:#0a4a6e; margin:16px 0 7px; padding-bottom:3px;
  border-bottom:1.5px solid #0a4a6e;
}

/* product identity key/value grid */
.mwcoq-kvgrid{
  display:grid; grid-template-columns:1fr 1fr; gap:0 26px; margin:2px 0 4px;
}
.mwcoq-kv{
  display:flex; gap:10px; padding:5px 0;
  border-bottom:1px solid #dbe6f0; font-size:11.5px;
}
.mwcoq-kv dt{
  width:44%; color:#5a7690; text-transform:uppercase; letter-spacing:.04em;
  font-size:9.5px; padding-top:2px; margin:0;
}
.mwcoq-kv dd{
  margin:0; flex:1; font-size:11px; color:#0d2036; font-weight:600;
}
.mwcoq-kv dd.mono{ font-family:'Geist Mono', ui-monospace, monospace; }

/* analytical results table */
.mwcoq-res{ width:100%; border-collapse:collapse; font-size:10.5px; }
.mwcoq-res th{
  text-align:left; background:#0a4a6e; color:#fff;
  font-family:'Saira Condensed', sans-serif; font-weight:600;
  text-transform:uppercase; letter-spacing:.04em; font-size:8.5px; padding:5px 8px;
}
.mwcoq-res td{
  padding:5px 8px; border-bottom:1px solid #dbe6f0;
  font-family:'Geist Mono', ui-monospace, monospace; color:#0d2036;
}
.mwcoq-res td.mwcoq-p{ font-family:'Titillium Web', sans-serif; color:#0d2036; }
.mwcoq-res th.mwcoq-num, .mwcoq-res td.mwcoq-num{ text-align:right; }
.mwcoq-cmp{ font-weight:700; text-align:center; }
.mwcoq-prov{ font-size:8.5px; color:#5a7690; }

/* signatures */
.mwcoq-sigrow{
  display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; margin-top:6px;
}
.mwcoq-sig{ font-size:10px; }
.mwcoq-sig__l{
  font-size:8px; text-transform:uppercase; letter-spacing:.08em; color:#5a7690;
}
.mwcoq-sig__nm{
  font-family:'Geist Mono', ui-monospace, monospace; font-weight:700; color:#0d2036;
  border-top:1px solid #0d2036; margin-top:20px; padding-top:4px; font-size:10.5px;
}
.mwcoq-sig__meta{ font-size:8.5px; color:#5a7690; margin-top:2px; }

/* certification note / draft notice */
.mwcoq-qp{
  margin-top:14px; padding:11px 14px;
  background:#eaf2f9; border-left:4px solid #0a4a6e;
  font-size:10px; line-height:1.5; color:#0d2036;
}
.mwcoq-draft-note{
  margin-top:14px; padding:9px 12px;
  background:#fff4e0; border-left:4px solid #d08a1a;
  font-size:10px; line-height:1.4; color:#0d2036;
}

/* footer */
.mwcoq-foot{
  margin-top:16px; display:flex; justify-content:space-between; gap:12px;
  flex-wrap:wrap; font-size:8px; color:#5a7690;
  border-top:1px solid #dbe6f0; padding-top:5px;
}

@media (max-width:640px){
  .mwcoq-kvgrid{ grid-template-columns:1fr; }
  .mwcoq-sigrow{ grid-template-columns:1fr; }
  .mwcoq-sheet{ padding:10mm 8mm 9mm; }
}


/* ── SEARCH page (search-view.js — full-page grouped search) ──────────────
   A rail-reachable companion to the ⌘K palette; same in-memory sources,
   grouped. Generic tokens only, so it inherits every skin. */
.sr-box{display:flex;align-items:center;gap:10px;margin:4px 0 8px;padding:12px 16px;
  background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r-lg,12px)}
.sr-box-ic{color:var(--ink-3);flex:none}
.sr-box-ic .icon{width:20px;height:20px}
.sr-input{flex:1;min-width:0;background:none;border:none;outline:none;color:var(--ink);
  font:inherit;font-size:17px}
.sr-input::placeholder{color:var(--ink-3)}
.sr-hint{font-size:12px;color:var(--ink-3);margin:0 4px 14px;line-height:1.5}
.sr-results{display:flex;flex-direction:column;gap:16px}
.sr-group{display:flex;flex-direction:column;gap:2px}
.sr-group-h{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:700;
  text-transform:uppercase;letter-spacing:.08em;color:var(--ink-3);margin:0 2px 6px}
.sr-count{background:var(--surface-3);border-radius:999px;font-size:10px;font-weight:800;
  color:var(--ink-3);padding:1px 7px}
.sr-row{display:flex;align-items:center;gap:11px;width:100%;text-align:left;cursor:pointer;
  padding:10px 12px;background:var(--surface);border:1px solid var(--line);border-radius:10px;
  color:var(--ink);font:inherit;transition:background .12s ease,border-color .12s ease,transform .12s ease}
.sr-row:hover{background:var(--primary-soft);border-color:var(--primary);transform:translateX(2px)}
.sr-row:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.sr-ic{flex:none;color:var(--ink-3);display:grid;place-items:center}
.sr-ic .icon{width:16px;height:16px}
.sr-label{flex:1;min-width:0;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sr-sub{flex:none;font-size:11.5px;color:var(--ink-3)}
.sr-empty{padding:22px 6px;text-align:center;color:var(--ink-3);font-size:13px;line-height:1.55}
/* Mass Weed HUD: angular row corners echoing the mockup's clip-path cards. */
:root[data-theme^="mass-weed"] .sr-row{border-radius:0;
  clip-path:polygon(0 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%)}
