/* ============================================================
   Views & components — "Manifest" light theme.
   Hairline rules, runway gauges, receipt-style plan cart.
   ============================================================ */

/* ===== Popover + info dot ================================= */
.info-dot { width: 17px; height: 17px; border-radius: 50%; border: none; background: transparent; color: var(--ink-4); display: inline-grid; place-items: center; flex: none; padding: 0; vertical-align: -3px; }
.info-dot:hover, .info-dot:focus-visible { color: var(--accent); outline: none; }
.info-dot svg { width: 14px; height: 14px; }
.popover { position: fixed; z-index: 100; max-width: 290px; background: var(--ink-btn); color: #eef1f6; border-radius: 9px; padding: 11px 13px; font-size: 11.5px; line-height: 1.5; box-shadow: var(--shadow-pop); opacity: 0; transform: translateY(3px); pointer-events: none; transition: opacity .13s, transform .13s; }
.popover.show { opacity: 1; transform: none; pointer-events: auto; }
.popover::after { content: ""; position: absolute; left: var(--arrow, 50%); bottom: -6px; transform: translateX(-50%) rotate(45deg); width: 11px; height: 11px; background: var(--ink-btn); border-radius: 2px; }
.popover.below::after { bottom: auto; top: -6px; }
.popover b { color: #fff; font-weight: 600; }
.popover .pop-h { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: #93a0b3; margin-bottom: 6px; }
.popover .pop-row { display: flex; justify-content: space-between; gap: 14px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.popover .pop-row:last-child { border-bottom: none; }
.popover .pop-row .v { font-family: var(--font-mono); color: #fff; }
.popover ul { margin: 4px 0 0; padding-left: 15px; }
.popover li { margin: 2px 0; }
.popover .pop-code { font-family: var(--font-mono); font-size: 9.5px; color: #93a0b3; margin-top: 7px; }

/* ===== Cover timeline strip ============================== */
.timeline { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 13px 15px 11px; box-shadow: var(--shadow-1); }
.tl-track { position: relative; height: 34px; margin: 18px 6px 6px; }
.tl-axis { position: absolute; left: 0; right: 0; top: 21px; height: 3px; background: var(--hairline); border-radius: 3px; }
.tl-axis .filled { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.tl-tick { position: absolute; top: 16px; width: 1px; height: 9px; background: var(--ink-4); opacity: .35; }
.tl-tick .lab { position: absolute; top: 12px; left: 0; transform: translateX(-50%); font-family: var(--font-mono); font-size: 9px; color: var(--ink-4); white-space: nowrap; }
.tl-mark { position: absolute; top: 22px; transform: translate(-50%, -50%); width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--surface-1); z-index: 2; display: grid; place-items: center; cursor: default; }
.tl-mark svg { width: 8px; height: 8px; color: #fff; }
.tl-mark.now    { background: var(--accent); width: 12px; height: 12px; }
.tl-mark.risk   { background: var(--danger); }
.tl-mark.sea    { background: var(--ink-btn); }
.tl-mark.air    { background: var(--info); }
.tl-mark.inbound{ background: var(--success); }
.tl-flag { position: absolute; top: -3px; transform: translateX(-50%); font-family: var(--font-mono); font-size: 9px; color: var(--ink-3); white-space: nowrap; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 16px; }
.tl-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: var(--ink-3); }
.tl-leg .d { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* ===== Readiness gate banner ============================== */
.gate {
  flex: none; display: flex; align-items: center; gap: 13px;
  padding: 9px 18px; border-bottom: 1px solid var(--rule);
  background: var(--danger-bg);
}
.gate.warn { background: var(--caution-bg); }
.gate .gate-ic { width: 18px; height: 18px; color: var(--danger); flex: none; }
.gate.warn .gate-ic { color: var(--caution); }
.gate .g-head { font-weight: 600; font-size: var(--fs-sm); }
.gate .g-detail { color: var(--ink-2); font-size: var(--fs-sm); }
.gate .g-detail::before { content: "·"; margin: 0 8px; color: var(--ink-4); }

/* ===== Substrip: workbench nav ============================ */
.substrip {
  height: var(--substrip-h); flex: none;
  display: flex; align-items: center; gap: 4px; padding: 0 14px;
  background: var(--surface-0); border-bottom: 1px solid var(--hairline);
  overflow-x: auto; scrollbar-width: none;
}
.substrip::-webkit-scrollbar { display: none; }
.wb-tab {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 7px 12px; border-radius: 7px; color: var(--ink-3);
  font-size: 12.5px; font-weight: 500; border: 1px solid transparent;
}
.wb-tab:hover { color: var(--ink); background: var(--surface-2); }
.wb-tab.active { color: var(--ink); background: var(--surface-1); border-color: var(--hairline); font-weight: 600; box-shadow: var(--shadow-1); }
.wb-tab svg { width: 15px; height: 15px; opacity: .8; }
.wb-tab.active svg { color: var(--accent); opacity: 1; }
.wb-tab .count {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  background: var(--surface-3); padding: 0 6px; border-radius: 100px; min-width: 18px; text-align: center;
}
.wb-tab.active .count { color: var(--ink); }
.wb-tab .count.alert { color: #fff; background: var(--danger); }
.wb-sep { width: 1px; height: 22px; background: var(--hairline); margin: 0 5px; flex: none; }

/* shared underline tabs (Orders / Inventory) */
.otabs { display: flex; gap: 4px; }
.otab { padding: 9px 15px; border: none; background: none; color: var(--ink-3); font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.otab:hover { color: var(--ink); }
.otab.active { color: var(--ink); border-bottom-color: var(--accent); }
.otab svg { width: 15px; height: 15px; flex: none; }
.otab .count { font-family: var(--font-mono); font-size: 10.5px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 100px; padding: 0 7px; }

/* ===== Main region ======================================== */
.main { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.view { position: absolute; inset: 0; display: none; }
.view.active { display: block; }

/* ---- Triage view: IA-driven grid ------------------------- */
.triage { width: 100%; min-height: 0; }

.triage.active[data-ia="three"] {
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0,1fr) minmax(310px, 380px);
}
.triage[data-ia="three"] .queue-pane  { border-right: 1px solid var(--rule); }
.triage[data-ia="three"] .detail-pane { border-right: 1px solid var(--rule); }
.triage[data-ia="three"] .plan-rail   { display: flex; }
.triage[data-ia="three"] .plan-bar    { display: none; }
.triage[data-ia="three"] .detail-close { display: none; }

.triage.active[data-ia="drawer"] { display: block; position: relative; }
.triage[data-ia="drawer"] .queue-pane { width: 100%; height: 100%; padding-bottom: 56px; }
.triage[data-ia="drawer"] .detail-pane {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(780px, 84%);
  background: var(--surface-0); border-left: 1px solid var(--rule);
  box-shadow: var(--shadow-pop); transform: translateX(100%);
  transition: transform .26s cubic-bezier(.4,0,.2,1); z-index: 20;
}
.triage[data-ia="drawer"].detail-open .detail-pane { transform: translateX(0); }
.triage[data-ia="drawer"] .plan-rail { display: none; }
.triage[data-ia="drawer"] .plan-bar  { display: flex; }

.triage.active[data-ia="inline"] { display: block; }
.triage[data-ia="inline"] .queue-pane { width: 100%; height: 100%; padding-bottom: 56px; }
.triage[data-ia="inline"] .detail-pane.docked { position: static; border: none; box-shadow: none; width: auto; transform: none; border-top: 1px solid var(--rule); background: var(--surface-0); }
.triage[data-ia="inline"] .plan-rail { display: none; }
.triage[data-ia="inline"] .plan-bar  { display: flex; }
.triage[data-ia="inline"] .detail-close { display: none; }

/* ===== Queue pane ========================================= */
.queue-pane { display: flex; flex-direction: column; min-height: 0; background: var(--surface-0); }

/* triage summary strip */
.triage-strip {
  flex: none; display: flex; align-items: stretch;
  background: var(--surface-1); border-bottom: 1px solid var(--hairline);
}
.tcard {
  flex: 1; padding: 10px 13px; cursor: pointer; min-width: 0;
  border-right: 1px solid var(--hairline-soft); position: relative;
}
.tcard:last-child { border-right: none; }
.tcard:hover { background: var(--surface-2); }
.tcard.sel { background: var(--surface-2); }
.tcard.sel::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.tcard.sel.ready::after   { background: var(--success); }
.tcard.sel.needs_review::after { background: var(--warning); }
.tcard.sel.blocked::after { background: var(--danger); }
.tcard.sel.all::after     { background: var(--accent); }
.tcard .t-num { font-family: var(--font-display); font-size: 23px; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
.tcard .t-lbl { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }
.tcard.ready .t-num   { color: var(--success); }
.tcard.needs_review .t-num { color: var(--warning); }
.tcard.blocked .t-num { color: var(--danger); }
.tcard.all .t-num     { color: var(--ink); }

/* next-action pointer — editorial callout */
.next-action {
  flex: none; display: flex; align-items: center; gap: 13px;
  margin: 12px 13px 2px; padding: 11px 13px;
  background: var(--surface-1); border: 1px solid var(--accent-line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); cursor: pointer;
}
.next-action:hover { background: var(--accent-dim); }
.next-action .na-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.next-action .na-ic svg { width: 17px; height: 17px; }
.next-action .na-k { font-size: 9.5px; text-transform: uppercase; letter-spacing: .15em; color: var(--accent); font-weight: 700; }
.next-action .na-t { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 1px; }
.next-action .na-t b { color: var(--ink); font-weight: 600; }
.next-action .na-go { color: var(--accent); width: 18px; flex: none; }

/* filters */
.qfilters { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 13px; border-bottom: 1px solid var(--hairline); }
.search {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
  background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-sm); padding: 0 9px;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.search svg { width: 14px; height: 14px; color: var(--ink-4); flex: none; }
.search input { flex: 1; background: none; border: none; outline: none; color: var(--ink); font-size: var(--fs-sm); height: 31px; min-width: 0; }
.search input::placeholder { color: var(--ink-4); }
.search kbd { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); border: 1px solid var(--hairline); border-radius: 4px; padding: 1px 5px; }

.selectwrap { position: relative; }
.selectwrap select {
  appearance: none; background: var(--surface-1); border: 1px solid var(--hairline); color: var(--ink);
  font-size: var(--fs-sm); border-radius: var(--radius-sm); height: 31px; padding: 0 26px 0 10px; outline: none;
}
.selectwrap::after { content: ""; position: absolute; right: 10px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: translateY(-65%) rotate(45deg); pointer-events: none; }
.selectwrap select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.seg button { background: none; border: none; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; padding: 4px 9px; border-radius: 4px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface-1); color: var(--ink); box-shadow: var(--shadow-1); }

/* queue presets */
.qpresets { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 13px 11px; border-bottom: 1px solid var(--hairline); overflow-x: auto; scrollbar-width: none; }
.qpresets::-webkit-scrollbar { display: none; }
.qpresets .qp-ic { color: var(--ink-4); display: inline-grid; place-items: center; flex: none; }
.qpresets .qp-ic svg { width: 14px; height: 14px; }
.qp { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 5px 10px; border-radius: 100px; border: 1px solid var(--hairline); background: var(--surface-1); color: var(--ink-3); font-size: 11px; font-weight: 600; }
.qp:hover { color: var(--ink); background: var(--surface-2); border-color: var(--rule); }
.qp svg { width: 12px; height: 12px; }
.qp.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-dim); }

/* queue row checkbox */
.qrow .qcheck { position: absolute; left: 9px; top: 11px; width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--rule); background: var(--surface-1); display: none; place-items: center; color: transparent; padding: 0; z-index: 3; }
.qrow:hover .qcheck, .qrow.selected .qcheck { display: grid; }
.qrow .qcheck svg { width: 12px; height: 12px; }
.qrow .qcheck.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.qrow:hover .sdot { opacity: 0; }
.qrow.selected { background: var(--accent-dim); }
.qrow.selected .sdot { opacity: 0; }

/* selection action bar */
.sel-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 13px; background: var(--ink-btn); color: var(--paper); border-bottom: 1px solid var(--hairline); }
.sel-bar .sb-lead { font-size: var(--fs-sm); color: #c4cdda; }
.sel-bar .sb-count { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: #fff; margin-right: 2px; }
.sel-bar .btn.ghost { color: #c4cdda; }
.sel-bar .btn.ghost:hover { color: #fff; background: rgba(255,255,255,.1); }
.qrow {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 11px; align-items: center;
  padding: 10px 13px; border-bottom: 1px solid var(--hairline-soft); cursor: pointer; position: relative;
}
.qrow .sdot { margin-top: 4px; align-self: start; }
.qrow:hover { background: var(--surface-1); }
.qrow.active { background: var(--surface-1); }
.qrow.cursor::after { content: ""; position: absolute; inset: 0; border: 1.5px solid var(--accent); border-radius: 4px; pointer-events: none; }
.qrow .q-main { min-width: 0; }
.qrow .q-sku { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.qrow.active .q-sku { color: var(--accent); }
.qrow .q-meta { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.qrow .q-meta .asin { color: var(--ink-4); }
.qrow .q-risk { font-size: var(--fs-xs); margin-top: 5px; display: flex; align-items: center; gap: 7px; }
.qrow .q-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.qrow .q-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.qrow:hover .q-actions, .qrow.active .q-actions, .qrow.cursor .q-actions { opacity: 1; }
.qa { width: 25px; height: 25px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--surface-1); display: grid; place-items: center; color: var(--ink-3); }
.qa:hover { color: var(--ink); background: var(--surface-2); border-color: var(--rule); }
.qa svg { width: 13px; height: 13px; }
.qa.added { color: var(--success); border-color: var(--success-line); background: var(--success-bg); }

/* confidence meter */
.conf { display: inline-flex; align-items: center; gap: 6px; }
.conf .bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 13px; }
.conf .bars i { width: 3px; background: var(--hairline); border-radius: 1px; display: block; }
.conf .bars i:nth-child(1){ height: 5px; } .conf .bars i:nth-child(2){ height: 9px; } .conf .bars i:nth-child(3){ height: 13px; }
.conf.high .bars i  { background: var(--success); }
.conf.medium .bars i:nth-child(-n+2) { background: var(--warning); }
.conf.low .bars i:nth-child(1)  { background: var(--danger); }
.conf .cscore { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; }

/* ===== Detail pane ======================================== */
.detail-pane { display: flex; flex-direction: column; min-height: 0; background: var(--surface-0); }
.detail-empty { flex: 1; display: grid; place-items: center; padding: 40px; text-align: center; color: var(--ink-3); }
.detail-empty svg { width: 40px; height: 40px; color: var(--ink-4); margin-bottom: 14px; }
.detail-empty h3 { color: var(--ink-2); margin: 0 0 6px; font-weight: 600; font-size: 15px; font-family: var(--font-display); }

.detail-head { flex: none; padding: 16px var(--pad) 13px; border-bottom: 1px solid var(--hairline); background: var(--surface-1); }
.detail-close { width: 29px; height: 29px; border-radius: 7px; border: 1px solid var(--hairline); background: var(--surface-1); color: var(--ink-3); display: grid; place-items: center; }
.detail-close:hover { color: var(--ink); background: var(--surface-2); }
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title .d-sku { font-family: var(--font-mono); font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.detail-sub { color: var(--ink-3); font-size: var(--fs-sm); margin-top: 6px; display: flex; gap: 16px; flex-wrap: wrap; }
.detail-sub b { color: var(--ink-2); font-weight: 600; }
.detail-sub .dsub-risk { margin-left: -2px; }
.conf-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; border-radius: 5px; border: 1px solid; font-family: var(--font-mono); font-weight: 700; font-size: 11px; }
.conf-badge .bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.conf-badge .bars i { width: 3px; background: currentColor; opacity: .3; border-radius: 1px; display: block; }
.conf-badge .bars i:nth-child(1){ height: 5px; } .conf-badge .bars i:nth-child(2){ height: 8px; } .conf-badge .bars i:nth-child(3){ height: 12px; }
.conf-badge.high { color: var(--success); border-color: var(--success-line); background: var(--success-bg); }
.conf-badge.medium { color: var(--warning); border-color: var(--warning-line); background: var(--warning-bg); }
.conf-badge.low { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.conf-badge.high .bars i, .conf-badge.medium .bars i:nth-child(-n+2), .conf-badge.low .bars i:nth-child(1) { opacity: 1; }
.conf-badge .info-dot { color: inherit; opacity: .7; }
.detail-body { flex: 1; overflow: auto; min-height: 0; padding: var(--pad); display: flex; flex-direction: column; gap: calc(var(--gap) + 4px); }

.sect-h { display: flex; align-items: center; gap: 10px; margin: 0 0 11px; }
.sect-h .s-t { font-size: 10px; text-transform: uppercase; letter-spacing: .15em; color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.sect-h .s-line { flex: 1; height: 1px; background: var(--hairline); }

/* location cards — NO left border; flag glyph + runway gauge */
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 9px; }
.loc {
  background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 11px 12px;
  box-shadow: var(--shadow-1); position: relative;
}
.loc.dim { opacity: .55; }
.loc .l-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.loc .l-id { display: flex; align-items: center; gap: 7px; }
.loc .l-code { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); }
.loc .l-label { font-size: var(--fs-sm); font-weight: 600; margin-top: 1px; }
.loc .l-src { font-size: 8.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 700; border: 1px solid var(--accent-line); border-radius: 4px; padding: 1px 5px; }
.loc .l-nums { display: flex; align-items: baseline; gap: 7px; margin-top: 11px; }
.loc .l-days { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.loc .l-days small { font-size: 10px; color: var(--ink-4); font-weight: 500; font-family: var(--font-sans); letter-spacing: 0; margin-left: 3px; }
.loc .l-units { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); margin-top: 6px; }
.loc .l-after { font-size: 10.5px; margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.loc .l-after .arrow { color: var(--ink-4); }
.loc .l-after .to { font-family: var(--font-mono); font-weight: 700; }
.loc .l-after.up .to { color: var(--success); }
.loc .l-after.down .to { color: var(--caution); }

/* runway gauge */
.loc .l-bar { height: 7px; border-radius: 4px; background: var(--surface-3); margin-top: 9px; position: relative; overflow: hidden; }
.loc .l-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; transition: width .35s cubic-bezier(.4,0,.2,1); }
.loc .l-bar .ghost { position: absolute; top: 0; bottom: 0; border-radius: 0 4px 4px 0; opacity: .9; background-image: repeating-linear-gradient(45deg, currentColor 0 3px, transparent 3px 6px); transition: width .35s, left .35s; }
.loc .l-bar .ghost.up { color: var(--success); }
.loc .l-bar .ghost.down { color: var(--caution); }
.loc .l-bar .tgt { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); z-index: 2; }
.loc .l-id { display: flex; align-items: flex-start; gap: 8px; }
.loc .l-id .flag { margin-top: 3px; }
.loc .l-status { font-size: 10px; color: var(--ink-3); margin-top: 10px; line-height: 1.4; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.loc .l-status .chip, .loc .l-status .lvl { align-self: center; }
.loc .l-reason { color: var(--ink-3); }

/* movement / lane cards */
.lane { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.lane + .lane { margin-top: 10px; }
.lane.blocked { background: var(--surface-0); }
.lane.in-plan { border-color: var(--success-line); }
.lane.in-plan .lane-h { background: var(--success-bg); }
.lane-h { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--hairline-soft); }
.lane-route { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lane-loc { font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.lane-route .arr { color: var(--accent); flex: none; }
.lane-route .arr svg { width: 16px; height: 16px; display: block; }
.lane-label { font-size: var(--fs-xs); color: var(--ink-3); }
.lane-h .spacer { flex: 1; }
.lane-body { padding: 13px; }

.move-edit { display: flex; flex-direction: column; gap: 11px; }
.move-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stepper { display: flex; align-items: center; border: 1px solid var(--hairline); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-1); }
.stepper button { padding: 0 10px; height: 31px; min-width: 36px; background: var(--surface-1); border: none; border-left: 1px solid var(--hairline); color: var(--ink-2); font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.stepper button:first-child { border-left: none; }
.stepper button:hover { background: var(--surface-2); color: var(--ink); }
.stepper input { width: 70px; height: 31px; background: none; border: none; border-left: 1px solid var(--hairline); border-right: 1px solid var(--hairline); color: var(--ink); text-align: center; font-family: var(--font-mono); font-size: 14px; font-weight: 700; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.move-top .units-lbl { font-size: var(--fs-xs); color: var(--ink-4); text-transform: uppercase; letter-spacing: .08em; }
.move-top .rec { font-size: var(--fs-xs); color: var(--ink-3); }
.move-top .rec b { color: var(--ink-2); font-family: var(--font-mono); }

.quicks { display: flex; gap: 6px; flex-wrap: wrap; }
.quick { font-family: var(--font-mono); font-size: var(--fs-xs); padding: 5px 9px; border-radius: 5px; border: 1px solid var(--hairline); background: var(--surface-1); color: var(--ink-2); font-weight: 600; }
.quick:hover { background: var(--surface-2); color: var(--ink); border-color: var(--accent-line); }
.quick.clear { color: var(--ink-4); }

.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 4px; background: var(--surface-3); outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-1); border: 2px solid var(--accent); cursor: grab; box-shadow: var(--shadow-1); }
.slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface-1); border: 2px solid var(--accent); cursor: grab; }
.slider:disabled { opacity: .4; }

.mode-toggle { display: inline-flex; border: 1px solid var(--hairline); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-1); }
.mode-toggle button { padding: 6px 13px; background: var(--surface-1); border: none; border-left: 1px solid var(--hairline); color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.mode-toggle button:first-child { border-left: none; }
.mode-toggle button svg { width: 13px; height: 13px; }
.mode-toggle button:hover { color: var(--ink); background: var(--surface-2); }
.mode-toggle button.on[data-mode="air"]   { background: var(--info); color: #fff; }
.mode-toggle button.on[data-mode="sea"]    { background: var(--ink-btn); color: var(--paper); }
.mode-toggle button.on[data-mode="split"]  { background: var(--accent); color: var(--accent-ink); }

.lane-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lane-foot .eta { font-size: var(--fs-xs); color: var(--ink-3); }
.lane-foot .eta b { color: var(--ink-2); font-family: var(--font-mono); }
.blocked-note { position: relative; display: block; padding: 9px 11px 9px 40px; background: var(--danger-bg); border: 1px solid var(--danger-line); border-radius: var(--radius-sm); color: var(--danger); font-size: var(--fs-xs); line-height: 1.45; }
.blocked-note svg { display: none; }
.blocked-note::before { content: "HOLD"; position: absolute; left: 0; top: 0; bottom: 0; width: 28px; background: var(--danger); color: var(--paper); display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--font-mono); font-weight: 700; font-size: 9.5px; letter-spacing: .22em; }
.warn-note { position: relative; display: block; padding: 9px 11px 9px 40px; background: var(--caution-bg); border: 1px solid var(--caution-line); border-radius: var(--radius-sm); color: var(--caution); font-size: var(--fs-xs); line-height: 1.45; }
.warn-note svg { display: none; }
.warn-note::before { content: "FLAG"; position: absolute; left: 0; top: 0; bottom: 0; width: 28px; background: var(--caution); color: var(--paper); display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--font-mono); font-weight: 700; font-size: 9.5px; letter-spacing: .22em; }

/* status stamp — coded operational tag */
.stamp { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: 3px 8px 3px 6px; border-radius: 5px; border: 1px solid; line-height: 1.2; white-space: nowrap; }
.stamp svg { width: 13px; height: 13px; flex: none; }
.stamp.success { color: var(--success); border-color: var(--success-line); background: var(--success-bg); }
.stamp.warning { color: var(--warning); border-color: var(--warning-line); background: var(--warning-bg); }
.stamp.danger  { color: var(--danger);  border-color: var(--danger-line);  background: var(--danger-bg); }
.stamp.info    { color: var(--info);    border-color: var(--info-line);    background: var(--info-bg); }
.stamp.muted   { color: var(--muted-t); border-color: var(--muted-line);   background: var(--muted-bg); }

/* policy level — bare gauge read-out */
.lvl { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.lvl svg { width: 13px; height: 13px; flex: none; }
.lvl.danger { color: var(--danger); } .lvl.caution { color: var(--caution); } .lvl.warning { color: var(--warning); }
.lvl.success { color: var(--success); } .lvl.info { color: var(--info); } .lvl.muted { color: var(--ink-3); } .lvl.over { color: var(--over); }

/* risk countdown */
.risk { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.risk svg { width: 13px; height: 13px; flex: none; }
.risk .rk-t { color: var(--ink-3); }
.risk .rk-d { font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: -.02em; text-transform: none; }
.risk.danger { color: var(--danger); } .risk.danger .rk-d { color: var(--danger); }
.risk.caution { color: var(--caution); } .risk.caution .rk-d { color: var(--caution); }
.risk.warning { color: var(--warning); } .risk.warning .rk-d { color: var(--warning); }
.risk.success { color: var(--success); } .risk.success .rk-t { color: var(--success); }

/* before→after mini */
.ba-mini { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11px; padding: 9px 11px; background: var(--surface-0); border: 1px dashed var(--hairline); border-radius: var(--radius-sm); }

/* supplier order cards */
.so-card { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px 13px; box-shadow: var(--shadow-1); }
.so-card + .so-card { margin-top: 9px; }
.so-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.so-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 8px 16px; margin-top: 11px; }
.so-grid .f-k { font-size: 9.5px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .09em; }
.so-grid .f-v { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--ink); margin-top: 2px; font-weight: 600; }
.cash-guard { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 8px 11px; border-radius: var(--radius-sm); font-size: var(--fs-xs); }
.cash-guard.ok { background: var(--success-bg); color: var(--success); }
.cash-guard.warn { background: var(--caution-bg); color: var(--caution); }

/* allocation ledger */
.ledger-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(94px,1fr)); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; background: var(--surface-1); box-shadow: var(--shadow-1); }
.ls-cell { padding: 10px 12px; border-right: 1px solid var(--hairline-soft); border-bottom: 1px solid var(--hairline-soft); }
.ls-cell .k { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-4); }
.ls-cell .v { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-top: 3px; letter-spacing: -.01em; }
.ls-cell .v.gap { color: var(--caution); } .ls-cell .v.unc { color: var(--danger); } .ls-cell .v.sup { color: var(--accent); }

table.ledger { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); margin-top: 10px; }
table.ledger th { text-align: left; color: var(--ink-4); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 9px; padding: 7px 9px; border-bottom: 1.5px solid var(--rule); }
table.ledger td { padding: 8px 9px; border-bottom: 1px solid var(--hairline-soft); color: var(--ink-2); vertical-align: top; }
table.ledger td.n { font-family: var(--font-mono); text-align: right; color: var(--ink); }
table.ledger tr:hover td { background: var(--surface-0); }
table.ledger .rc { font-family: var(--font-mono); font-size: 9px; color: var(--ink-4); margin-top: 2px; }

/* ===== Plan rail — receipt / manifest ===================== */
.plan-rail { flex-direction: column; min-height: 0; background: var(--surface-1); }
.plan-rail-h { padding: 14px var(--pad) 12px; border-bottom: 1.5px dashed var(--rule); }
.plan-rail-h .pr-t { font-family: var(--font-display); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.plan-rail-h .pr-sub { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 5px; line-height: 1.4; }
.plan-items { flex: 1; overflow: auto; min-height: 0; padding: 6px 0; }
.plan-empty { flex: 1; display: grid; place-items: center; text-align: center; padding: 30px 22px; color: var(--ink-4); }
.plan-empty svg { width: 34px; height: 34px; margin-bottom: 12px; color: var(--ink-4); }
.pitem { padding: 10px var(--pad); border-bottom: 1px dashed var(--hairline); position: relative; }
.pitem:hover { background: var(--surface-0); }
.pitem .pi-top { display: flex; align-items: baseline; gap: 8px; }
.pitem .pi-route { font-family: var(--font-mono); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pitem .pi-mode { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); text-transform: uppercase; }
.pitem .pi-leader { flex: 1; border-bottom: 1px dotted var(--rule); transform: translateY(-3px); min-width: 12px; }
.pitem .pi-units { font-family: var(--font-mono); font-size: 13px; font-weight: 700; white-space: nowrap; }
.pitem .pi-sku { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-3); margin-top: 4px; }
.pitem .pi-rm { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 4px; background: none; border: none; color: var(--ink-4); display: none; place-items: center; }
.pitem:hover .pi-rm { display: grid; }
.pitem .pi-rm:hover { color: var(--danger); background: var(--danger-bg); }
.plan-foot { flex: none; padding: 13px var(--pad); border-top: 2px solid var(--ink); background: var(--surface-1); }
.plan-totals { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--fs-sm); margin-bottom: 11px; }
.plan-totals .pt-units { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }

/* bottom plan bar */
.plan-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 54px; z-index: 25;
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
  background: var(--surface-1); border-top: 2px solid var(--ink);
  box-shadow: 0 -6px 22px rgba(40,34,20,.10);
}
.plan-bar .pb-stat { font-size: var(--fs-sm); color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.plan-bar .pb-stat b { font-family: var(--font-mono); color: var(--ink); font-weight: 700; }
.plan-bar .pb-chips { display: flex; gap: 8px; overflow: auto; flex: 1; scrollbar-width: none; }
.plan-bar .pb-chips::-webkit-scrollbar { display: none; }

/* ===== Workspaces ========================================= */
.ws { width: 100%; height: 100%; display: flex; flex-direction: column; min-height: 0; background: var(--surface-0); }
.ws-head { flex: none; padding: 16px 20px 14px; border-bottom: 1px solid var(--hairline); display: flex; align-items: flex-start; gap: 14px; background: var(--surface-1); }
.ws-head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.ws-head .ws-desc { color: var(--ink-3); font-size: var(--fs-sm); margin-top: 4px; max-width: 680px; line-height: 1.5; }
.ws-head .ws-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ws-body { flex: 1; overflow: auto; min-height: 0; padding: 20px; }
.ws-note { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--ink-3); }

.so-layout { display: grid; grid-template-columns: 290px 1fr; gap: 20px; height: 100%; min-height: 0; }
.wh-list { display: flex; flex-direction: column; gap: 9px; overflow: auto; }
.wh-card { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 13px; cursor: pointer; box-shadow: var(--shadow-1); }
.wh-card:hover { background: var(--surface-2); }
.wh-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.wh-card .wh-code { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); }
.wh-card .wh-name { font-size: var(--fs); font-weight: 700; margin-top: 1px; font-family: var(--font-display); }
.wh-card .wh-stats { display: flex; gap: 16px; margin-top: 11px; }
.wh-card .wh-stat .n { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.wh-card .wh-stat .l { font-size: 9px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .08em; }
.wh-modes { display: flex; gap: 5px; margin-top: 11px; }

.mode-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.mode-col { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; box-shadow: var(--shadow-1); overflow: hidden; }
.mode-col-h { padding: 13px 15px; border-bottom: 1px solid var(--hairline); }
.mode-col-h .mc-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-family: var(--font-display); }
.mode-col-h .mc-title svg { width: 16px; height: 16px; }
.mode-col-h.air .mc-title svg { color: var(--info); }
.mode-col-h .mc-meta { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 9px; font-size: var(--fs-xs); color: var(--ink-3); }
.mode-col-h .mc-meta b { color: var(--ink-2); font-family: var(--font-mono); }
.mode-lines { padding: 9px; display: flex; flex-direction: column; gap: 7px; }
.so-line { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface-0); border: 1px solid var(--hairline-soft); }
.so-line .sl-sku { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 700; }
.so-line .sl-demand { font-size: var(--fs-xs); color: var(--ink-4); }
.so-line .sl-units { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; }

.split-card { margin-top: 7px; padding: 11px; background: var(--surface-0); border: 1px solid var(--hairline); border-radius: var(--radius-sm); }
.split-bar { height: 11px; border-radius: 4px; overflow: hidden; display: flex; margin: 9px 0; }
.split-bar .air { background: var(--info); } .split-bar .sea { background: var(--ink-btn); }
.split-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: var(--fs-xs); }

/* generic data tables */
.dtable { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.dtable th { position: sticky; top: 0; background: var(--surface-1); text-align: left; color: var(--ink-4); font-weight: 700; font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; padding: 10px 12px; border-bottom: 1.5px solid var(--rule); z-index: 1; }
.dtable td { padding: 10px 12px; border-bottom: 1px solid var(--hairline-soft); color: var(--ink-2); }
.dtable td.n { font-family: var(--font-mono); text-align: right; color: var(--ink); }
.dtable tr:hover td { background: var(--surface-0); }
.dtable .sku { font-family: var(--font-mono); color: var(--ink); font-weight: 700; }
.dtable.bg { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }

/* top-up group */
.tu-group { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow-1); }
.tu-group-h { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--hairline-soft); }
.tu-route { display: flex; align-items: center; gap: 9px; }
.tu-route .pill { font-family: var(--font-mono); font-size: 12px; font-weight: 700; padding: 4px 10px; background: var(--surface-0); border: 1px solid var(--hairline); border-radius: 6px; }
.tu-route .arr { color: var(--accent); }
.tu-stats { margin-left: auto; display: flex; gap: 20px; }
.tu-stats .n { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.tu-stats .l { font-size: 9px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .08em; }
.tu-meta { padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; border-bottom: 1px solid var(--hairline-soft); }
.evidence { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--hairline-soft); }
.ev-chip { font-size: var(--fs-xs); color: var(--ink-3); background: var(--surface-0); border: 1px solid var(--hairline); border-radius: 5px; padding: 3px 9px; font-family: var(--font-mono); }

/* data readiness */
.parity { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 18px; }
.parity .p-cell { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-1); }
.parity .p-cell .pn { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.parity .p-cell .pl { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 3px; }
.parity .p-cell.bad .pn { color: var(--danger); }
.parity .p-cell.warn .pn { color: var(--caution); }
.parity .p-cell.ok .pn { color: var(--success); }

.source-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr auto; gap: 14px; align-items: center; padding: 13px 15px; background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); margin-bottom: 9px; box-shadow: var(--shadow-1); }
.source-row .src-name { font-weight: 700; font-size: var(--fs); }
.source-row .src-conn { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-4); margin-top: 2px; }
.source-row .src-meta { font-size: var(--fs-xs); color: var(--ink-3); }
.source-row .src-meta b { color: var(--ink-2); font-family: var(--font-mono); }
.state-pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; }

/* worksheet grid */
.sheet-wrap { overflow: auto; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface-1); box-shadow: var(--shadow-1); }
table.sheet { border-collapse: collapse; font-family: var(--font-mono); font-size: var(--fs-xs); white-space: nowrap; }
table.sheet th, table.sheet td { border: 1px solid var(--hairline-soft); padding: 6px 10px; text-align: right; }
table.sheet th { background: var(--surface-2); color: var(--ink-3); position: sticky; top: 0; font-weight: 600; text-align: center; }
table.sheet td.rh { background: var(--surface-0); color: var(--ink-4); text-align: center; position: sticky; left: 0; }
table.sheet td.txt { text-align: left; color: var(--ink); }
table.sheet td.t-danger { color: var(--danger); font-weight: 700; } table.sheet td.t-success { color: var(--success); }
table.sheet td.t-caution { color: var(--caution); } table.sheet td.t-muted { color: var(--ink-4); }
.sheet-steps { display: flex; gap: 11px; flex-wrap: wrap; margin-bottom: 16px; }
.sheet-step { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 11px 14px; flex: 1; min-width: 180px; box-shadow: var(--shadow-1); }
.sheet-step .sn { width: 23px; height: 23px; border-radius: 6px; background: var(--ink-btn); color: var(--paper); display: grid; place-items: center; font-weight: 700; font-size: 11px; flex: none; font-family: var(--font-mono); }
.sheet-step .st { font-weight: 700; font-size: var(--fs-sm); }
.sheet-step .sd { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }

/* policy checks — NO left border; leading icon tile */
.policy-list { display: flex; flex-direction: column; gap: 9px; }
.policy-item { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.policy-item .pi-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.policy-item .pi-ic svg { width: 16px; height: 16px; }
.policy-item.ok .pi-ic { background: var(--success-bg); color: var(--success); }
.policy-item.warn .pi-ic { background: var(--caution-bg); color: var(--caution); }
.policy-item .pi-t { font-weight: 700; font-size: var(--fs); }
.policy-item .pi-d { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 3px; }
.policy-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px,1fr)); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; background: var(--surface-1); box-shadow: var(--shadow-1); }
.policy-meta .pm { padding: 12px 14px; border-right: 1px solid var(--hairline-soft); border-bottom: 1px solid var(--hairline-soft); }
.policy-meta .pm .k { font-size: 9px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-4); }
.policy-meta .pm .v { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-top: 3px; }

/* ===== Right inbox drawers ================================ */
.drawer-scrim { position: fixed; inset: 0; background: rgba(40,34,20,.32); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; backdrop-filter: blur(1px); }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 92vw); background: var(--surface-0); border-left: 1px solid var(--rule); box-shadow: var(--shadow-pop); z-index: 61; transform: translateX(100%); transition: transform .24s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-h { flex: none; padding: 16px 18px; border-bottom: 1px solid var(--hairline); display: flex; align-items: center; gap: 12px; background: var(--surface-1); }
.drawer-h h3 { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.drawer-tabs { display: flex; gap: 4px; padding: 10px 14px 0; }
.drawer-body { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }

/* inbox item — NO left border; leading severity flag */
.inbox-item { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 13px; box-shadow: var(--shadow-1); }
.inbox-item .ii-top { display: flex; align-items: center; gap: 8px; }
.inbox-item .ii-title { font-weight: 700; font-size: var(--fs); }
.inbox-item .ii-rec { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 6px; }
.inbox-item .ii-meta { display: flex; gap: 6px 12px; flex-wrap: wrap; margin-top: 9px; font-size: var(--fs-xs); color: var(--ink-4); }
.inbox-item .ii-meta b { color: var(--ink-3); font-family: var(--font-mono); }
.inbox-item .ii-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.inbox-item.done { opacity: .55; }
.inbox-item.done .ii-title { text-decoration: line-through; }

/* ===== Toasts ============================================= */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink-btn); color: var(--paper); border-radius: var(--radius); padding: 11px 16px; box-shadow: var(--shadow-pop); font-size: var(--fs-sm); display: flex; align-items: center; gap: 10px; animation: tin .2s ease; max-width: 460px; }
.toast .t-ic { width: 18px; height: 18px; flex: none; }
.toast.success .t-ic { color: #6fd6a0; } .toast.info .t-ic { color: #8fb4f5; } .toast.warn .t-ic { color: #f0b86a; }
.toast .undo { color: var(--accent-2); background: #fff; border-radius: 5px; padding: 2px 8px; margin-left: 6px; font-weight: 700; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ===== Shortcut overlay =================================== */
.kbd-overlay { position: fixed; inset: 0; background: rgba(40,34,20,.4); z-index: 90; display: none; place-items: center; backdrop-filter: blur(2px); }
.kbd-overlay.open { display: grid; }
.kbd-card { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius-lg); width: min(560px, 92vw); box-shadow: var(--shadow-pop); overflow: hidden; }
.kbd-card h3 { margin: 0; padding: 17px 20px; border-bottom: 1px solid var(--hairline); font-family: var(--font-display); font-size: 16px; }
.kbd-list { padding: 14px 20px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 11px 28px; }
.kbd-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); color: var(--ink-2); }
.kbd-line .keys { display: flex; gap: 4px; }
kbd { font-family: var(--font-mono); font-size: 11px; background: var(--surface-2); border: 1px solid var(--hairline); border-bottom-width: 2px; border-radius: 5px; padding: 2px 7px; color: var(--ink); min-width: 20px; text-align: center; font-weight: 600; }

/* ===== Tweaks panel ====================================== */
#tweaks { position: fixed; right: 16px; bottom: 16px; width: 282px; background: var(--surface-1); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); z-index: 95; display: none; overflow: hidden; }
#tweaks.open { display: block; }
.tweaks-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--hairline); cursor: grab; background: var(--surface-0); }
.tweaks-h .tw-t { font-family: var(--font-display); font-weight: 600; font-size: 14px; flex: 1; }
.tweaks-h .tw-x { width: 23px; height: 23px; border-radius: 5px; border: none; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; }
.tweaks-h .tw-x:hover { color: var(--ink); }
.tweaks-body { padding: 13px 14px 16px; display: flex; flex-direction: column; gap: 15px; max-height: 70vh; overflow: auto; }
.tw-group .tw-lbl { font-size: 9.5px; text-transform: uppercase; letter-spacing: .13em; color: var(--ink-4); font-weight: 700; margin-bottom: 8px; }
.tw-seg { display: flex; gap: 4px; flex-wrap: wrap; }
.tw-seg button { flex: 1; min-width: 56px; padding: 7px 8px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--surface-0); color: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.tw-seg button.on { background: var(--ink-btn); color: var(--paper); border-color: var(--ink-btn); }
.tw-swatches { display: flex; gap: 9px; }
.tw-sw { width: 31px; height: 31px; border-radius: 8px; border: 2px solid var(--hairline); cursor: pointer; position: relative; }
.tw-sw.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px currentColor; }

/* responsive / mobile */
@media (max-width: 1080px) {
  .triage.active[data-ia="three"] { grid-template-columns: 1fr; }
  .triage[data-ia="three"] .detail-pane, .triage[data-ia="three"] .plan-rail { display: none; }
  .so-layout { grid-template-columns: 1fr; }
  .mode-cols { grid-template-columns: 1fr; }
  .parity { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 720px) {
  .topnav, .scope-chip .src-label { display: none; }
  .triage-strip { flex-wrap: wrap; }
  .tcard { min-width: 33%; border-bottom: 1px solid var(--hairline-soft); }
  .source-row { grid-template-columns: 1fr 1fr; }
  .kbd-list { grid-template-columns: 1fr; }
  .ws-head { flex-wrap: wrap; }
  .ws-head .ws-tools { margin-left: 0; }
}
