/* ════════════════════════════════════════════════════════════════════
   HUROZO DESIGN SYSTEM · v0.2.1 — visual-restraint pass (DD-8)
   Single source of truth — tokens · global components · OS-shell chrome.
   Every Hurozo hi-fi screen links this file.

   ── SIGNAL RULE (read before adding orange) ─────────────────────────
   Calm by default. Emphasis is earned, not constant.
   • PRIMARY ACTION  = ink (black). One filled primary per surface.
                       Secondary = outline. Tertiary = text-only.
   • ORANGE (signal) = a RARE accent, never the workhorse. Allowed only for:
       (a) brand identity — the glyph mark;
       (b) the single active app in the dock (one ambient brand accent);
       (c) genuinely LIVE work — the working pulse, in-flight progress;
       (d) "your turn / needs you now" — as a small dot/marker, not a fill;
       (e) live focus — the focus ring, the just-wrote flash.
     Orange is NOT for: counts, tags, type/scope/id chips, on-states,
     active tabs, selected rows, or decoration. Those are ink or neutral.
   • STATUS / STAGE  = subtle semantic dots (blue/amber/green/red), not fills.
   • COLOUR earns its place — if it carries no meaning, it is neutral.
   ════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Serif:ital,wght@0,400;1,400&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=switzer@400,500,600,700&display=swap');

:root {
  /* Neutrals — paper white + true black */
  --paper: #FFFFFF; --paper-2: #FAFAFA; --paper-3: #F2F2F2;
  --rule: #E5E5E5; --rule-2: #D1D1D1;
  --ink: #000000; --ink-2: #1A1A1A; --ink-3: #4A4A4A; --ink-4: #767676; --ink-5: #A3A3A3;

  /* Dark surface */
  --void: #0A0A0A; --surface: #141414; --surface-2: #1E1E1E; --surface-3: #2A2A2A;
  --d-rule: rgba(255,255,255,0.10); --d-rule-2: rgba(255,255,255,0.18);
  --d-text: #F5F5F5; --d-text-2: rgba(245,245,245,0.65); --d-text-3: rgba(245,245,245,0.40);

  /* Signal */
  --signal: #E25E2E; --signal-press: #C24A1F; --signal-tint: #FBE7DD; --signal-tint-2: #FDF1EB; --signal-on-dark: #FF7A4A;

  /* Status — muted, never decoration */
  --ok: #1F7A4D; --ok-tint: #E4F2EB; --warn: #B45309; --warn-tint: #FBEFD9; --err: #B42318; --err-tint: #FBE7E5;
  --info: #2A5A8A; --info-tint: #E6EEF5;

  /* Status DOTS — softer, friendlier hues for small 7-8px status/stage dots
     (carry meaning at a glance without the saturation of the text colours) */
  --dot-idle: #A3A3A3; --dot-doing: #3B82C4; --dot-review: #D08A2C; --dot-blocked: #D2493E; --dot-done: #369A66;

  /* Type */
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --serif: 'IBM Plex Serif', Georgia, serif;
  --body: 'Switzer', 'IBM Plex Sans', system-ui, sans-serif;
  --display: 'IBM Plex Sans', system-ui, sans-serif;

  /* Radius — flat by default */
  --r-1: 2px; --r-2: 4px; --r-3: 6px; --r-4: 10px;

  /* Spacing (4-base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* Elevation */
  --sh-1: 0 1px 2px rgba(0,0,0,0.06);
  --sh-2: 0 4px 14px -6px rgba(0,0,0,0.16);
  --sh-3: 0 14px 40px -16px rgba(0,0,0,0.28);
  --sh-4: 0 24px 64px -20px rgba(0,0,0,0.40);

  /* Focus ring */
  --focus: 0 0 0 3px var(--signal-tint);
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
.hz, .hz * { margin: 0; padding: 0; }
.hz {
  font-family: var(--body); font-size: 14px; line-height: 1.5;
  color: var(--ink-2); background: var(--paper);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.hz button { font: inherit; cursor: pointer; color: inherit; background: none; border: none; }
.hz svg { display: block; }
.hz a { color: inherit; }

/* ════════════════════════════════════════════════════════════════════
   TYPE
   ════════════════════════════════════════════════════════════════════ */
.t-display { font-family: var(--display); font-weight: 600; font-size: 60px; line-height: 1.0; letter-spacing: -0.03em; color: var(--ink); }
.t-h1 { font-family: var(--display); font-weight: 600; font-size: 40px; line-height: 1.05; letter-spacing: -0.025em; color: var(--ink); }
.t-h2 { font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); }
.t-h3 { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); }
.t-h4 { font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.25; letter-spacing: -0.005em; color: var(--ink); }
.t-lede { font-family: var(--body); font-weight: 400; font-size: 18px; line-height: 1.5; color: var(--ink-3); }
.t-body { font-family: var(--body); font-weight: 400; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.t-small { font-family: var(--body); font-weight: 400; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.t-mono { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.t-label { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); }
.t-label-sm { font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); }
.t-data { font-family: var(--mono); font-size: 13px; color: var(--ink-2); font-feature-settings: 'tnum' 1; }
.t-quote { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 20px; line-height: 1.4; color: var(--ink-2); }
.t-signal { color: var(--signal); }
.num { font-feature-settings: 'tnum' 1; }

/* ════════════════════════════════════════════════════════════════════
   GLYPH MARK  (brand)
   ════════════════════════════════════════════════════════════════════ */
.gm {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper);
  font-family: var(--display); font-weight: 600; letter-spacing: -0.04em; position: relative;
  width: 24px; height: 24px; font-size: 15px; border-radius: var(--r-1);
}
.gm.signal { background: var(--signal); }
.gm .acc { position: absolute; right: 3px; bottom: 3px; width: 4px; height: 4px; background: var(--signal); }
.gm.signal .acc { background: var(--paper); }
.wm { font-family: var(--display); font-weight: 600; letter-spacing: -0.03em; color: var(--ink); }

/* icon sizing helper */
.ic { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 20px; height: 20px; }

/* ════════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--body); font-weight: 500; font-size: 13.5px; line-height: 1;
  padding: 9px 14px; border: 1px solid transparent; border-radius: var(--r-2);
  letter-spacing: -0.005em; text-decoration: none; white-space: nowrap;
  background: var(--ink); color: var(--paper);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.btn:hover { background: var(--ink-2); }
.btn:active { background: #000; transform: translateY(0.5px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn .ic { width: 15px; height: 15px; }

/* ── ladder ── one filled primary per surface; demote the rest ──────
   .btn            PRIMARY   — solid ink (default). Rare: one per view.
   .btn.secondary  SECONDARY — neutral outline. The common action button.
   .btn.tertiary   TERTIARY  — text-only. Low-stakes / inline actions.
   .btn.signal     EMPHATIC  — orange. EXCEPTIONAL: use only when the
                   primary action is also the live/now/irreversible moment
                   (Send · Approve & run). Never two on one surface,
                   never beside an ink primary. */
.btn.signal { background: var(--signal); }
.btn.signal:hover { background: var(--signal-press); }
.btn.secondary, .btn.outline { background: transparent; border-color: var(--rule-2); color: var(--ink-2); }
.btn.secondary:hover, .btn.outline:hover { border-color: var(--ink-2); background: var(--paper-2); }
.btn.tertiary, .btn.ghost { background: transparent; color: var(--ink-2); }
.btn.tertiary:hover, .btn.ghost:hover { background: var(--paper-3); }
.btn.danger { background: transparent; border-color: var(--rule-2); color: var(--err); }
.btn.danger:hover { background: var(--err-tint); border-color: var(--err); }
.btn[disabled], .btn.disabled { background: var(--paper-3); color: var(--ink-5); border-color: transparent; cursor: not-allowed; }

.btn.sm { font-size: 12.5px; padding: 6px 10px; gap: 5px; }
.btn.lg { font-size: 15px; padding: 12px 20px; }
.btn.icon { padding: 8px; width: 34px; height: 34px; }
.btn.icon.sm { padding: 6px; width: 28px; height: 28px; }
.btn.block { display: flex; width: 100%; }
.btn kbd { font-family: var(--mono); font-size: 11px; opacity: 0.7; }

/* on dark */
.btn.on-dark { background: var(--paper); color: var(--ink); }
.btn.on-dark:hover { background: var(--paper-2); }
.btn.outline-d { background: transparent; border-color: var(--d-rule-2); color: var(--d-text); }
.btn.outline-d:hover { border-color: var(--paper); }
.btn.ghost-d { background: transparent; color: var(--d-text-2); }
.btn.ghost-d:hover { background: var(--surface-3); color: var(--d-text); }

/* ════════════════════════════════════════════════════════════════════
   CHIPS · TAGS · BADGES
   ════════════════════════════════════════════════════════════════════ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 3px 7px; background: var(--paper-3); color: var(--ink-3);
  border: 1px solid var(--rule); border-radius: var(--r-1); white-space: nowrap;
}
/* .chip.signal demoted: neutral body + a thin orange "needs-you / live" rule,
   not an orange fill. Reserve for items that genuinely need the operator now. */
.chip.signal { background: var(--paper-3); color: var(--ink-2); border-color: var(--rule); box-shadow: inset 2px 0 0 var(--signal); }
.chip.ok { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-tint); color: var(--warn); border-color: transparent; }
.chip.err { background: var(--err-tint); color: var(--err); border-color: transparent; }
.chip.info { background: var(--info-tint); color: var(--info); border-color: transparent; }
.chip.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.ghost { background: transparent; }
.chip .ldot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* tag — softer, sentence-case label (e.g. object type) */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 6px; color: var(--ink-4); border: 1px solid var(--rule); border-radius: var(--r-1); white-space: nowrap;
}

/* count / dot badge */
/* count badge — neutral by default (a count is not an action).
   .badge.signal reserved for "needs you now" counts (unread / actionable). */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--ink); color: var(--paper); border-radius: 999px;
  font-family: var(--mono); font-size: 10px; font-weight: 600; line-height: 1; font-feature-settings: 'tnum' 1;
}
.badge.signal { background: var(--signal); }
.badge.neutral { background: var(--ink); }
.badge.ghost { background: var(--paper-3); color: var(--ink-3); }
.badge.dot { min-width: 8px; width: 8px; height: 8px; padding: 0; }

/* status pill (status≠stage : this is STATUS) */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-3); white-space: nowrap;
}
.status .sd { width: 7px; height: 7px; border-radius: 999px; background: var(--dot-idle); flex: none; }
.status.backlog .sd { background: var(--dot-idle); }
.status.doing   .sd { background: var(--dot-doing); }
.status.review  .sd { background: var(--dot-review); }
.status.blocked .sd { background: var(--dot-blocked); }
.status.done    .sd { background: var(--dot-done); }

/* stage chip + who's-next (status≠stage : this is STAGE) */
.stage {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 6px; border: 1px solid var(--rule); border-radius: var(--r-1);
  color: var(--ink-3); background: var(--paper); white-space: nowrap;
}
.stage .pos { color: var(--ink); font-weight: 600; }
.who {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.02em;
  padding: 2px 6px 2px 4px; border-radius: var(--r-1);
  background: var(--paper-3); color: var(--ink-2); white-space: nowrap;
}
.who.gate { background: var(--paper-3); color: var(--ink-2); box-shadow: inset 2px 0 0 var(--signal); }
.who .av-xs { width: 14px; height: 14px; font-size: 8px; }

/* ════════════════════════════════════════════════════════════════════
   WORKER / ASYNC STATE  (working · waiting · failed · done · idle)
   ════════════════════════════════════════════════════════════════════ */
.wstate {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-3);
}
.wstate .wd { width: 8px; height: 8px; border-radius: 999px; background: var(--ink-5); flex: none; position: relative; }
.wstate.working .wd { background: var(--signal); }
.wstate.working .wd::after {
  content: ''; position: absolute; inset: -4px; border-radius: 999px;
  border: 1.5px solid var(--signal); opacity: 0.4; animation: wpulse 1.6s ease-out infinite;
}
.wstate.waiting .wd { background: var(--warn); }
.wstate.failed  .wd { background: var(--err); }
.wstate.done    .wd { background: var(--ok); }
.wstate.idle    .wd { background: var(--ink-5); }
.wstate.working { color: var(--signal-press); }
@keyframes wpulse { 0% { transform: scale(0.7); opacity: 0.5; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wstate.working .wd::after { animation: none; } }

/* ════════════════════════════════════════════════════════════════════
   AVATARS · PRESENCE
   ════════════════════════════════════════════════════════════════════ */
.av {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 11px; font-weight: 600; flex: none;
}
.av.sq { border-radius: var(--r-2); }
.av.xs { width: 16px; height: 16px; font-size: 8px; }
.av.sm { width: 22px; height: 22px; font-size: 9px; }
.av.lg { width: 40px; height: 40px; font-size: 15px; }
.av.signal { background: var(--signal); }
.av.g1 { background: #3A3A3A; } .av.g2 { background: #5A5A5A; } .av.g3 { background: #7A7A7A; }
/* worker avatars use a neutral square tile w/ a letter */
.av.worker { background: var(--surface); color: var(--d-text); border-radius: var(--r-2); }
.av-stack { display: inline-flex; align-items: center; }
.av-stack .av { border: 1.5px solid var(--paper); margin-left: -7px; }
.av-stack .av:first-child { margin-left: 0; }
.av-stack .av.more { background: var(--paper-3); color: var(--ink-4); }
/* presence ring */
.av.live { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--signal); }

/* ════════════════════════════════════════════════════════════════════
   CARDS · SURFACES
   ════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-3);
  padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3);
}
.card.flat { border-radius: 0; }
.card.elevated { border-color: transparent; box-shadow: var(--sh-2); }
.card.hover:hover { border-color: var(--rule-2); box-shadow: var(--sh-1); }
.card.signal-l { border-left: 3px solid var(--signal); }
.card.pad-sm { padding: var(--s-3); }
.card.pad-lg { padding: var(--s-5); }
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-3); }
.panel.tinted { background: var(--paper-2); }

/* KPI tile */
.kpi { display: flex; flex-direction: column; gap: 6px; padding: var(--s-4); }
.kpi .kl { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); }
.kpi .kn { font-family: var(--display); font-weight: 600; font-size: 28px; letter-spacing: -0.02em; color: var(--ink); font-feature-settings: 'tnum' 1; }
.kpi .kd { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.kpi .kd.up { color: var(--ok); } .kpi .kd.down { color: var(--err); } .kpi .kd.sig { color: var(--signal); }

/* ════════════════════════════════════════════════════════════════════
   FORM CONTROLS
   ════════════════════════════════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .flabel { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-4); }
.input, .select, .textarea {
  font-family: var(--body); font-size: 14px; color: var(--ink); background: var(--paper);
  padding: 9px 11px; border: 1px solid var(--rule-2); border-radius: var(--r-2); outline: none; width: 100%;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--ink-5); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: var(--focus); }
.input[disabled] { background: var(--paper-3); color: var(--ink-5); cursor: not-allowed; }
.input.invalid { border-color: var(--err); }
.input.invalid:focus { box-shadow: 0 0 0 3px var(--err-tint); }
.field .help { font-family: var(--body); font-size: 12px; color: var(--ink-4); }
.field .help.err { color: var(--err); }
/* input with leading icon */
.input-ic { position: relative; display: flex; align-items: center; }
.input-ic > .ic { position: absolute; left: 11px; color: var(--ink-4); pointer-events: none; }
.input-ic > .input { padding-left: 34px; }

/* search field */
.search {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px;
  border: 1px solid var(--rule-2); border-radius: var(--r-2); background: var(--paper); color: var(--ink-4);
}
.search:focus-within { border-color: var(--ink); box-shadow: var(--focus); }
.search input { flex: 1; border: none; outline: none; background: transparent; font-family: var(--body); font-size: 14px; color: var(--ink); }
.search input::placeholder { color: var(--ink-5); }

/* toggle */
.toggle { position: relative; width: 38px; height: 22px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.toggle .track { position: absolute; inset: 0; background: var(--rule-2); border-radius: 999px; transition: background 140ms ease; }
.toggle .thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: var(--paper); border-radius: 999px; box-shadow: var(--sh-1); transition: transform 140ms ease; }
.toggle input:checked ~ .track { background: var(--ink); }
.toggle input:checked ~ .thumb { transform: translateX(16px); }
.toggle input:focus-visible ~ .track { box-shadow: var(--focus); }

/* checkbox + radio */
.check, .radio { position: relative; width: 18px; height: 18px; flex: none; display: inline-flex; }
.check input, .radio input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.check .box { width: 18px; height: 18px; border: 1px solid var(--rule-2); border-radius: var(--r-1); background: var(--paper); display: flex; align-items: center; justify-content: center; }
.radio .box { width: 18px; height: 18px; border: 1px solid var(--rule-2); border-radius: 999px; background: var(--paper); }
.check .box .ic { stroke: var(--paper); width: 12px; height: 12px; opacity: 0; }
.check input:checked ~ .box { background: var(--ink); border-color: var(--ink); }
.check input:checked ~ .box .ic { opacity: 1; }
.radio input:checked ~ .box { border-color: var(--ink); border-width: 5px; }
.check input:focus-visible ~ .box, .radio input:focus-visible ~ .box { box-shadow: var(--focus); }

/* segmented control / sub-tabs */
.segmented { display: inline-flex; border: 1px solid var(--rule-2); border-radius: var(--r-2); background: var(--paper); padding: 2px; }
.segmented button {
  font-family: var(--body); font-size: 13px; font-weight: 500; color: var(--ink-4);
  padding: 6px 12px; border-radius: var(--r-1); white-space: nowrap; letter-spacing: -0.005em;
}
.segmented button:hover { color: var(--ink-2); }
.segmented button.on { background: var(--ink); color: var(--paper); }

/* underline tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); }
.tabs button {
  font-family: var(--body); font-size: 14px; font-weight: 500; color: var(--ink-4);
  padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; letter-spacing: -0.005em;
  display: inline-flex; align-items: center; gap: 7px;
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs button .badge { transform: scale(0.85); }

/* ════════════════════════════════════════════════════════════════════
   MENU / DROPDOWN
   ════════════════════════════════════════════════════════════════════ */
.menu {
  min-width: 220px; background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r-3);
  box-shadow: var(--sh-3); padding: 6px;
}
.menu-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); padding: 8px 10px 5px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; font-size: 13.5px; color: var(--ink-2); border-radius: var(--r-1); letter-spacing: -0.005em;
}
.menu-item .ic { color: var(--ink-4); }
.menu-item .mk { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.menu-item:hover { background: var(--ink); color: var(--paper); }
.menu-item:hover .ic, .menu-item:hover .mk { color: var(--d-text-2); }
.menu-item.danger { color: var(--err); }
.menu-item.danger:hover { background: var(--err); color: var(--paper); }
.menu-item.danger:hover .ic { color: var(--paper); }
.menu-sep { height: 1px; background: var(--rule); margin: 6px 4px; }

/* ════════════════════════════════════════════════════════════════════
   MODAL / DIALOG
   ════════════════════════════════════════════════════════════════════ */
.scrim { position: fixed; inset: 0; background: rgba(10,10,10,0.32); display: flex; align-items: center; justify-content: center; padding: var(--s-6); z-index: 100; }
.modal {
  width: 100%; max-width: 560px; background: var(--paper); border-radius: var(--r-4);
  box-shadow: var(--sh-4); overflow: hidden; display: flex; flex-direction: column; max-height: 86vh;
}
.modal.lg { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) var(--s-5) var(--s-3); }
.modal-head .mt { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; color: var(--ink); }
.modal-head .ms { font-size: 13px; color: var(--ink-4); margin-top: 3px; }
.modal-body { padding: var(--s-3) var(--s-5); overflow: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--rule); background: var(--paper-2); }
.modal-foot .left { margin-right: auto; }

/* ════════════════════════════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════════════════════════════ */
.toast-zone { position: fixed; bottom: var(--s-5); right: var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); z-index: 120; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 12px; min-width: 320px; max-width: 480px;
  padding: 12px 14px; background: var(--ink); color: var(--d-text); border-radius: var(--r-3); box-shadow: var(--sh-3);
}
.toast .ti { width: 8px; height: 8px; border-radius: 999px; background: var(--signal); flex: none; }
.toast.ok .ti { background: #6FCF97; } .toast.err .ti { background: #F08C82; }
.toast .tx { flex: 1; font-size: 13.5px; }
.toast .tx b { font-weight: 600; }
.toast .tsub { font-family: var(--mono); font-size: 11px; color: var(--d-text-3); margin-top: 2px; }
.toast .ta { font-family: var(--body); font-size: 13px; font-weight: 500; color: var(--signal-on-dark); white-space: nowrap; }
.toast .tx-mono { font-family: var(--mono); font-size: 11px; color: var(--d-text-3); }

/* ════════════════════════════════════════════════════════════════════
   TOOLTIP
   ════════════════════════════════════════════════════════════════════ */
.tip { position: relative; display: inline-flex; }
.tip .tipc {
  position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 5px 9px; white-space: nowrap;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; border-radius: var(--r-1);
  opacity: 0; pointer-events: none; transition: opacity 110ms ease; z-index: 30;
}
.tip:hover .tipc { opacity: 1; }
.tip .tipc::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%) rotate(45deg) translateY(-4px); width: 8px; height: 8px; background: var(--ink); }

/* ════════════════════════════════════════════════════════════════════
   TABLE
   ════════════════════════════════════════════════════════════════════ */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 500; padding: 10px 14px; border-bottom: 1px solid var(--rule); background: var(--paper-2);
}
.tbl tbody td { padding: 11px 14px; border-bottom: 1px solid var(--rule); color: var(--ink-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: var(--paper-2); }
.tbl .c-id { font-family: var(--mono); color: var(--ink-4); }
.tbl .c-name { font-weight: 500; color: var(--ink); }
.tbl .c-num { font-family: var(--mono); text-align: right; font-feature-settings: 'tnum' 1; }
.tbl.lined { border: 1px solid var(--rule); border-radius: var(--r-3); overflow: hidden; }

/* ════════════════════════════════════════════════════════════════════
   PROVENANCE  (shown only when "unusual")
   ════════════════════════════════════════════════════════════════════ */
.prov { border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--paper-2); overflow: hidden; }
.prov-head { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-4); }
.prov-head .flag { margin-left: auto; color: var(--warn); }
.prov-row { display: grid; grid-template-columns: 72px 1fr; gap: 10px; padding: 7px 11px; font-size: 12px; border-bottom: 1px dashed var(--rule); }
.prov-row:last-child { border-bottom: none; }
.prov-row .pk { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); }
.prov-row .pv { color: var(--ink-2); }
.prov-row .pv .src-tag { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* ════════════════════════════════════════════════════════════════════
   STATES — skeleton · empty · progress
   ════════════════════════════════════════════════════════════════════ */
.skel { background: linear-gradient(90deg, var(--paper-3) 0%, var(--paper-2) 50%, var(--paper-3) 100%); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; border-radius: var(--r-1); }
.skel.line { height: 10px; } .skel.line.w40 { width: 40%; } .skel.line.w60 { width: 60%; } .skel.line.w80 { width: 80%; }
.skel.block { height: 64px; border-radius: var(--r-2); }
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-3); padding: var(--s-8) var(--s-5); }
.empty .ei { width: 44px; height: 44px; border: 1.5px dashed var(--rule-2); border-radius: var(--r-3); display: flex; align-items: center; justify-content: center; color: var(--ink-5); }
.empty .et { font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--ink-2); letter-spacing: -0.01em; }
.empty .ed { font-size: 13.5px; color: var(--ink-4); max-width: 360px; }

.progress { height: 6px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.progress.live > span { background: var(--signal); }  /* only while work is genuinely in flight */
.progress.thin { height: 3px; }

/* ════════════════════════════════════════════════════════════════════
   OS-SHELL CHROME  (folded in from the chrome sheet)
   ════════════════════════════════════════════════════════════════════ */
/* menu bar */
.menubar { display: flex; align-items: stretch; justify-content: space-between; height: 46px; background: var(--paper); border-bottom: 1px solid var(--rule); user-select: none; }
.menubar .mb-left, .menubar .mb-right { display: flex; align-items: stretch; }
.menubar .mb-brand { display: flex; align-items: center; gap: 9px; padding: 0 14px 0 16px; }
.menubar .mb-brand .wm { font-size: 15px; }
.menubar .mb-sep { width: 1px; background: var(--rule); margin: 10px 0; }
.mb-item { display: flex; align-items: center; padding: 0 12px; font-size: 13.5px; color: var(--ink-3); letter-spacing: -0.005em; }
.mb-item:hover { background: var(--paper-3); color: var(--ink-2); }
.mb-item.open { background: var(--ink); color: var(--paper); }
.mb-right { align-items: center; gap: 2px; padding-right: 8px; }
.mb-icbtn { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--r-2); color: var(--ink-3); position: relative; }
.mb-icbtn:hover { background: var(--paper-3); color: var(--ink-2); }
.mb-icbtn.active { background: var(--ink); color: var(--paper); }
.mb-icbtn .badge { position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; border: 1.5px solid var(--paper); background: var(--signal); }
.mb-cmdk { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 11px; border: 1px solid var(--rule-2); border-radius: var(--r-2); color: var(--ink-4); font-size: 12.5px; margin: 0 6px; }
.mb-cmdk:hover { border-color: var(--ink-3); color: var(--ink-3); }
.mb-cmdk kbd { font-family: var(--mono); font-size: 10px; background: var(--paper-3); border: 1px solid var(--rule); border-radius: var(--r-1); padding: 1px 4px; color: var(--ink-3); }
.mb-account { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 6px; border-radius: var(--r-2); color: var(--ink-2); }
.mb-account:hover { background: var(--paper-3); }
.mb-account .nm { font-size: 13px; }

/* space switcher */
.space-pill { display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px 0 7px; background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r-2); color: var(--ink-2); }
.space-pill:hover { border-color: var(--ink-3); background: var(--paper-2); }
.space-pill.open { border-color: var(--ink); }
.space-pill .tok { width: 22px; height: 22px; border-radius: var(--r-1); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--paper); flex: none; }
.space-pill .nm { font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.space-pill .chev { color: var(--ink-4); }
.tok.s1 { background: var(--signal); } .tok.s2 { background: #2F6F4F; } .tok.s3 { background: #3A4A6A; } .tok.s4 { background: var(--ink-3); }

/* window title bar */
.titlebar { display: flex; align-items: center; gap: 16px; height: 40px; padding: 0 14px; background: var(--paper-2); border-bottom: 1px solid var(--rule); user-select: none; }
.lights { display: flex; align-items: center; gap: 8px; }
.lights .lt { width: 12px; height: 12px; border-radius: 999px; background: var(--ink-5); display: flex; align-items: center; justify-content: center; }
.lights .lt svg { width: 8px; height: 8px; stroke: rgba(0,0,0,0.55); stroke-width: 1.6; fill: none; stroke-linecap: round; opacity: 0; }
.lights:hover .lt svg { opacity: 1; }
.lights:hover .lt.close { background: var(--err); } .lights:hover .lt.min { background: var(--warn); } .lights:hover .lt.zoom { background: var(--ok); }
.tb-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-4); white-space: nowrap; }
.tb-crumbs .sl { color: var(--ink-5); font-family: var(--mono); }
.tb-crumbs .seg { color: var(--ink-3); }
.tb-crumbs .seg:hover { color: var(--ink-2); }
.tb-crumbs .cur { color: var(--ink); font-weight: 500; }
.tb-crumbs .id { font-family: var(--mono); font-size: 12px; color: var(--ink-3); background: var(--paper-3); padding: 2px 6px; border-radius: var(--r-1); }

/* dock */
.dock { width: 60px; background: var(--void); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; user-select: none; }
.dock .dk-brand .gm { width: 30px; height: 30px; font-size: 18px; border-radius: var(--r-2); }
.dock .dk-rule { width: 26px; height: 1px; background: var(--d-rule); margin: 4px 0; }
.dock-spacer { flex: 1; }
.dk-app { position: relative; display: flex; align-items: center; justify-content: center; }
.dk-tile { width: 38px; height: 38px; border-radius: var(--r-3); background: var(--surface-2); color: var(--d-text-2); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: -0.03em; border: 1px solid var(--d-rule); }
.dk-app:hover .dk-tile { background: var(--surface-3); color: var(--d-text); }
.dk-app.active .dk-tile { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.dk-app .dk-ind { position: absolute; left: -11px; top: 50%; transform: translateY(-50%); width: 3px; height: 8px; border-radius: 999px; background: transparent; }
.dk-app.active .dk-ind { background: var(--signal-on-dark); height: 18px; }
.dk-app:hover:not(.active) .dk-ind { background: var(--d-text-3); }
.dk-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; background: var(--signal); color: var(--paper); border-radius: 999px; font-family: var(--mono); font-size: 9px; font-weight: 600; line-height: 16px; text-align: center; border: 2px solid var(--void); }
.dk-add { width: 38px; height: 38px; border-radius: var(--r-3); border: 1px dashed var(--d-rule-2); color: var(--d-text-3); display: flex; align-items: center; justify-content: center; }
.dk-add:hover { border-color: var(--signal-on-dark); color: var(--signal-on-dark); border-style: solid; }

/* command palette */
.cmd { width: 100%; max-width: 600px; background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r-4); box-shadow: var(--sh-4); overflow: hidden; }
.cmd-search { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--rule); }
.cmd-search .mag { color: var(--ink-4); }
.cmd-search input { flex: 1; border: none; outline: none; background: transparent; font-family: var(--body); font-size: 17px; color: var(--ink); letter-spacing: -0.01em; }
.cmd-search input::placeholder { color: var(--ink-5); }
.cmd-search .scope { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); background: var(--paper-3); padding: 4px 7px; border-radius: var(--r-1); }
.cmd-group { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); padding: 11px 18px 5px; }
.cmd-row { display: flex; align-items: center; gap: 13px; padding: 9px 18px; position: relative; }
.cmd-row .lead { width: 26px; height: 26px; flex: none; border-radius: var(--r-2); display: flex; align-items: center; justify-content: center; background: var(--paper-3); color: var(--ink-3); }
.cmd-row .lead.obj { background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 10px; font-weight: 600; }
.cmd-row .cbody { flex: 1; min-width: 0; }
.cmd-row .ctitle { font-size: 14px; color: var(--ink-2); letter-spacing: -0.005em; display: flex; align-items: center; gap: 8px; }
.cmd-row .ctitle b { font-weight: 600; color: var(--ink); }
.cmd-row .csub { font-family: var(--mono); font-size: 11px; color: var(--ink-4); margin-top: 2px; }
.cmd-row .rkey { font-family: var(--mono); font-size: 11px; color: var(--ink-4); display: flex; gap: 4px; flex: none; }
.cmd-row .rkey kbd { background: var(--paper-3); border: 1px solid var(--rule); border-radius: var(--r-1); padding: 1px 5px; color: var(--ink-3); }
.cmd-row.sel { background: var(--paper-2); }
.cmd-row.sel::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ink); }
.cmd-row:hover:not(.sel) { background: var(--paper-2); }
.cmd-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--rule); background: var(--paper-2); }
.cmd-foot .hint { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); margin-right: 14px; }
.cmd-foot kbd { font-family: var(--mono); font-size: 10px; background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r-1); padding: 1px 5px; color: var(--ink-3); min-width: 18px; text-align: center; }

/* ════════════════════════════════════════════════════════════════════
   RUN BOARD  (Kanban — status columns; stage/who/state ride the card)
   ════════════════════════════════════════════════════════════════════ */
.filterbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.filterbar .grow { flex: 1; }
.filterbar .fb-search { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--rule-2); border-radius: var(--r-2); color: var(--ink-4); min-width: 200px; }
.filterbar .fb-search input { border: none; outline: none; background: transparent; font-family: var(--body); font-size: 13px; color: var(--ink); width: 100%; }
.filterbar .fb-search:focus-within { border-color: var(--ink); box-shadow: var(--focus); }
.fb-select { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border: 1px solid var(--rule-2); border-radius: var(--r-2); font-size: 13px; color: var(--ink-2); }
.fb-select:hover { border-color: var(--ink-3); }
.fb-select .tok { width: 16px; height: 16px; border-radius: var(--r-1); font-size: 8px; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); height: 100%; min-height: 0; background: var(--paper); overflow-x: auto; overflow-y: hidden; }
.bcol { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--rule); }
.bcol:last-child { border-right: none; }
.bcol-head { display: flex; align-items: center; gap: 8px; padding: 11px 13px; background: var(--paper); border-bottom: 1px solid var(--rule); }
.bcol-head .sd { width: 7px; height: 7px; border-radius: 999px; background: var(--dot-idle); flex: none; }
.bcol-head.backlog .sd { background: var(--dot-idle); } .bcol-head.doing .sd { background: var(--dot-doing); }
.bcol-head.review .sd { background: var(--dot-review); } .bcol-head.blocked .sd { background: var(--dot-blocked); } .bcol-head.done .sd { background: var(--dot-done); }
.bcol-head .bname { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.bcol-head .bct { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-5); }
.bcol-head .badd { color: var(--ink-4); display: flex; }
.bcol-head .badd:hover { color: var(--ink); }
.bcol-body { flex: 1; overflow-y: auto; padding: 9px; display: flex; flex-direction: column; gap: 8px; background: var(--paper-2); }

.ecard { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-3); padding: 10px 11px; display: flex; flex-direction: column; gap: 9px; cursor: pointer; transition: border-color 120ms ease, box-shadow 120ms ease; }
.ecard:hover { border-color: var(--rule-2); box-shadow: var(--sh-1); }
.ecard:active { box-shadow: none; }
.ecard.needs { border-left: 2px solid var(--signal); padding-left: 10px; }
.ecard .ec-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ecard .ec-ttl { font-size: 13px; font-weight: 500; color: var(--ink); letter-spacing: -0.005em; line-height: 1.3; }
.ecard .ec-id { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.03em; color: var(--ink-5); flex: none; padding-top: 1px; }
.ecard .ec-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ecard .ec-mid { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ecard .ec-foot { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding-top: 2px; border-top: 1px solid var(--paper-3); }
.ecard .ec-val { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-feature-settings: 'tnum' 1; }
.ec-flag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--signal-press); }
.ec-flag:hover { color: var(--signal); }

/* swimlane (by worker) — pipeline view */
.swim { display: flex; flex-direction: column; height: 100%; overflow-y: auto; background: var(--paper-2); }
.swimrow { display: grid; grid-template-columns: 150px 1fr; border-bottom: 1px solid var(--rule); min-height: 116px; }
.swimrow:last-child { border-bottom: none; }
.swim-head { display: flex; flex-direction: column; gap: 7px; padding: 14px; border-right: 1px solid var(--rule); background: var(--paper); position: sticky; left: 0; }
.swim-head .sh-w { display: flex; align-items: center; gap: 8px; }
.swim-head .sh-n { font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--ink); letter-spacing: -0.01em; }
.swim-head .sh-ct { font-family: var(--mono); font-size: 10px; color: var(--ink-4); }
.swim-cards { display: flex; gap: 8px; padding: 11px; overflow-x: auto; align-items: flex-start; }
.swim-cards .ecard { width: 232px; flex: none; }

/* ════════════════════════════════════════════════════════════════════
   EPIC CHAIN  (child cards + dependency rail) · ACTIVITY · CHAT · DIFF
   ════════════════════════════════════════════════════════════════════ */
.chain { display: flex; flex-direction: column; }
.cstep { display: grid; grid-template-columns: 30px 1fr; gap: 14px; }
.cstep .crail { display: flex; flex-direction: column; align-items: center; }
.cstep .cnode { width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--paper); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--ink-4); flex: none; z-index: 1; }
.cstep.done .cnode { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.cstep.active .cnode { border-color: var(--signal); color: var(--signal); box-shadow: 0 0 0 3px var(--signal-tint); }
.cstep.gate .cnode { background: var(--paper); border-color: var(--signal); color: var(--signal-press); box-shadow: 0 0 0 3px var(--signal-tint); }
.cstep.idle .cnode { color: var(--ink-5); }
.cstep .cline { flex: 1; width: 1.5px; background: var(--rule); margin: 3px 0; min-height: 12px; }
.cstep.done .cline { background: var(--ink-3); }
.cstep:last-child .cline { display: none; }
.cstep .cbody { padding-bottom: 14px; min-width: 0; }

.cchild { border: 1px solid var(--rule); border-radius: var(--r-3); background: var(--paper); padding: 12px 13px; display: flex; flex-direction: column; gap: 9px; cursor: pointer; transition: border-color 120ms ease, box-shadow 120ms ease; }
.cchild:hover { border-color: var(--rule-2); }
.cchild.sel { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-tint); }
.cchild.gate { background: var(--paper); border-left: 3px solid var(--signal); }
.cchild .cc-top { display: flex; align-items: center; gap: 9px; }
.cchild .cc-name { font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: -0.01em; color: var(--ink); }
.cchild .cc-role { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); }
.cchild .cc-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.cchild .cc-slice { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.cchild .cc-slice b { color: var(--ink-2); font-weight: 600; }
.cchild .cc-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.mact { display: inline-flex; align-items: center; gap: 5px; font-family: var(--body); font-size: 11.5px; color: var(--ink-3); padding: 4px 8px; border: 1px solid var(--rule); border-radius: var(--r-1); background: var(--paper); }
.mact:hover { border-color: var(--ink-3); color: var(--ink); background: var(--paper-2); }
.mact .ic { width: 12px; height: 12px; }
.mact.warn:hover { border-color: var(--warn); color: var(--warn); background: var(--warn-tint); }
.cc-corrected { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); }

/* activity feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 24px 1fr; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.feed-item:last-child { border-bottom: none; }
.feed-item .fav { width: 24px; height: 24px; }
.feed-item .ft { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.feed-item .ft b { font-weight: 600; color: var(--ink); }
.feed-item .ft .via { font-family: var(--mono); font-size: 10px; color: var(--signal-press); }
.feed-item .ftime { font-family: var(--mono); font-size: 10px; color: var(--ink-5); margin-top: 3px; }

/* chat dock / co-edit */
.chat { display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 88%; padding: 9px 12px; border-radius: var(--r-3); font-size: 13px; line-height: 1.5; }
.bubble.user { align-self: flex-end; background: var(--ink); color: var(--d-text); border-bottom-right-radius: var(--r-1); }
.bubble.worker { align-self: flex-start; background: var(--paper-3); color: var(--ink-2); border-bottom-left-radius: var(--r-1); }
.bubble .bmeta { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 5px; }
.bubble.user .bmeta { color: var(--d-text-3); justify-content: flex-end; }
.chat-input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule-2); border-radius: var(--r-2); padding: 8px 10px; background: var(--paper); }
.chat-input:focus-within { border-color: var(--ink); box-shadow: var(--focus); }
.chat-input input { flex: 1; border: none; outline: none; background: transparent; font-family: var(--body); font-size: 13px; color: var(--ink); }
.chat-input input::placeholder { color: var(--ink-5); }
.chat-input .slash { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.scoped-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); background: var(--paper-3); padding: 4px 8px; border-radius: var(--r-1); }

/* diff (chat ⇄ structure reconciliation) */
.diff { border: 1px solid var(--rule); border-radius: var(--r-2); overflow: hidden; }
.diff .dl { padding: 7px 12px; font-size: 13.5px; line-height: 1.5; font-family: var(--serif); }
.diff .dl.del { background: var(--err-tint); color: var(--err); text-decoration: line-through; text-decoration-color: rgba(180,35,24,0.5); }
.diff .dl.ins { background: var(--ok-tint); color: #14653b; }
.diff-bar { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--rule); background: var(--paper-2); }
.diff-bar .dlabel { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); margin-right: auto; }

/* ════════════════════════════════════════════════════════════════════
   MOBILE  (phone-first operator surfaces — Decisions · Chat)
   ════════════════════════════════════════════════════════════════════ */
.device { width: 375px; height: 812px; background: #0A0A0A; border-radius: 48px; padding: 11px; flex: none; position: relative; box-shadow: 0 40px 90px -34px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.35); }
.device .screen { width: 100%; height: 100%; border-radius: 38px; overflow: hidden; background: var(--paper); display: flex; flex-direction: column; position: relative; }
.island { position: absolute; top: 21px; left: 50%; transform: translateX(-50%); width: 104px; height: 28px; background: #000; border-radius: 16px; z-index: 20; }
.home-ind { position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%); width: 132px; height: 5px; border-radius: 3px; background: var(--ink); opacity: 0.8; z-index: 20; }
.statusbar { height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 8px 24px 0; flex: none; }
.statusbar .clock { font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--ink); letter-spacing: -0.01em; }
.statusbar .sgl { display: flex; align-items: center; gap: 6px; color: var(--ink); }

.m-appbar { display: flex; align-items: center; gap: 12px; padding: 6px 16px 12px; border-bottom: 1px solid var(--rule); flex: none; }
.m-appbar .mtitle { font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: -0.02em; color: var(--ink); }
.m-appbar .mct { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.m-appbar .micon { width: 34px; height: 34px; border-radius: 999px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.m-appbar .micon:hover { background: var(--paper-3); }
.m-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.m-lane { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); padding: 14px 16px 6px; display: flex; align-items: center; gap: 8px; background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.m-lane.sla { color: var(--err); } .m-lane.judge { color: var(--ink-2); }
.m-lane .ld { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.m-lane .lct { margin-left: auto; color: var(--ink-5); }

.mrow { display: flex; flex-direction: column; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--rule); }
.mrow:active { background: var(--paper-2); }
.mrow .m1 { display: flex; align-items: center; gap: 8px; }
.mrow .mtype { font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 6px; border-radius: var(--r-1); background: var(--paper-3); color: var(--ink-3); }
.mrow .mtype.send { background: var(--paper-3); color: var(--ink-2); box-shadow: inset 2px 0 0 var(--signal); }
.mrow .mtype.confirm { background: var(--info-tint); color: var(--info); }
.mrow .mtype.flag { background: var(--warn-tint); color: var(--warn); }
.mrow .mage { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--ink-4); }
.mrow .mage.breach { color: var(--err); }
.mrow .mttl { font-size: 14.5px; font-weight: 500; color: var(--ink); letter-spacing: -0.005em; }
.mrow .mexc { font-size: 12.5px; color: var(--ink-4); line-height: 1.45; }
.mrow .macts { display: flex; gap: 8px; margin-top: 2px; }

.m-auto { display: flex; align-items: center; gap: 11px; padding: 13px 16px; background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.m-auto .ai { width: 30px; height: 30px; border-radius: var(--r-2); background: var(--ok-tint); color: var(--ok); display: flex; align-items: center; justify-content: center; flex: none; }

.tabbar { display: flex; border-top: 1px solid var(--rule); background: var(--paper); padding: 8px 6px 22px; flex: none; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-5); position: relative; }
.tabbar button.on { color: var(--ink); }
.tabbar button .tbadge { position: absolute; top: -3px; right: 50%; margin-right: -16px; min-width: 15px; height: 15px; }

/* in-chat action card (chat can act) */
.actioncard { border: 1px solid var(--rule-2); border-radius: var(--r-3); background: var(--paper); padding: 12px 13px; display: flex; flex-direction: column; gap: 10px; align-self: flex-start; max-width: 92%; box-shadow: var(--sh-1); }
.actioncard .ac-h { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); }
.actioncard .ac-ttl { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.actioncard .ac-sub { font-size: 12.5px; color: var(--ink-4); line-height: 1.45; }
.actioncard .ac-acts { display: flex; gap: 8px; }
.ctx-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); background: var(--paper-3); padding: 4px 9px; border-radius: 999px; }
.via-trace { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ok); }

/* ════════════════════════════════════════════════════════════════════
   BUILD APP  (view switcher · stat cards · card grid · disclosure · checklist)
   ════════════════════════════════════════════════════════════════════ */
.viewswitch { display: flex; align-items: center; gap: 14px; padding: 10px 20px; border-bottom: 1px solid var(--rule); background: var(--paper); flex: none; }
.viewswitch .vgrow { flex: 1; }

.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--rule); border-radius: var(--r-3); overflow: hidden; }
.statcard { padding: 15px 17px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 5px; cursor: pointer; background: var(--paper); transition: background 100ms ease; }
.statcard:last-child { border-right: none; }
.statcard:hover { background: var(--paper-2); }
.statcard .sl { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); }
.statcard .sn { font-family: var(--display); font-weight: 600; font-size: 28px; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
.statcard .sd { font-size: 12px; color: var(--ink-4); line-height: 1.4; }
.statcard.zero .sn { color: var(--ink-5); }
.statcard .cta { font-family: var(--body); font-size: 12.5px; font-weight: 500; color: var(--ink-2); display: inline-flex; gap: 5px; align-items: center; margin-top: 1px; }
.statcard .cta:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 14px; }
.addtile { border: 1.5px dashed var(--rule-2); border-radius: var(--r-3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 22px; min-height: 168px; color: var(--ink-4); cursor: pointer; transition: border-color 120ms ease, color 120ms ease, background 120ms ease; }
.addtile:hover { border-color: var(--ink-3); color: var(--ink-2); background: var(--paper-2); }
.addtile .plus { width: 38px; height: 38px; border-radius: 999px; border: 1.5px solid currentColor; display: flex; align-items: center; justify-content: center; }
.addtile .at-t { font-size: 13px; font-weight: 500; }
.addtile .at-in { width: 100%; }

.teamcard { border: 1px solid var(--rule); border-radius: var(--r-3); background: var(--paper); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 168px; transition: border-color 120ms ease, box-shadow 120ms ease; }
.teamcard:hover { border-color: var(--rule-2); box-shadow: var(--sh-1); }
.teamcard .tc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.teamcard .tc-name { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; color: var(--ink); }
.teamcard .tc-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-4); margin-top: 2px; }
.teamcard .tc-acts { display: flex; gap: 6px; margin-top: auto; }

.disclosure { border: 1px solid var(--rule); border-radius: var(--r-3); overflow: hidden; }
.disclosure-h { display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; background: var(--paper-2); }
.disclosure-h:hover { background: var(--paper-3); }
.disclosure-h .dt { font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--ink); }
.disclosure-h .dsub { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); }
.disclosure-h .dchev { margin-left: auto; color: var(--ink-4); transition: transform 160ms ease; }
.disclosure.open .dchev { transform: rotate(180deg); }
.disclosure-b { display: none; padding: 16px; border-top: 1px solid var(--rule); }
.disclosure.open .disclosure-b { display: block; }

.checklist { display: flex; align-items: center; gap: 20px; padding: 11px 16px; border: 1px solid var(--rule); border-radius: var(--r-3); background: var(--paper-2); flex-wrap: wrap; }
.checklist .clabel { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); }
.checklist .ci { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.checklist .ci .cdot { width: 16px; height: 16px; border-radius: 999px; border: 1.5px solid var(--rule-2); display: flex; align-items: center; justify-content: center; flex: none; }
.checklist .ci.done .cdot { background: var(--ok); border-color: var(--ok); }
.checklist .ci.done { color: var(--ink-2); }
.checklist .ci.now .cdot { border-color: var(--signal); }
.checklist .ci.now { color: var(--ink); font-weight: 500; }

/* worker roster (Workers view master list) */
.wrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-2); cursor: pointer; }
.wrow:hover { background: var(--paper-2); }
.wrow.sel { background: var(--ink); }
.wrow.sel .wr-n { color: var(--paper); }
.wrow.sel .wr-r { color: var(--d-text-3); }
.wrow .wr-n { font-size: 13.5px; font-weight: 500; color: var(--ink); letter-spacing: -0.005em; }
.wrow .wr-r { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); }

/* field flash when chat writes to it */
@keyframes fieldwrote { 0% { box-shadow: 0 0 0 3px var(--signal-tint); border-color: var(--signal); } 100% { box-shadow: 0 0 0 0 transparent; } }
.field.wrote .input, .field.wrote .textarea { animation: fieldwrote 1600ms ease-out; border-color: var(--signal); }

/* keyboard reach (UX A4) */
[role="button"][tabindex="0"]:focus-visible { outline: none; box-shadow: var(--focus), 0 0 0 1.5px var(--signal); border-radius: var(--r-2); }
/* menu bar collapse (UX A6) */
@media (max-width: 1000px) {
  .mb-account .nm { display: none; }
  .av-stack .av:nth-child(n+3) { display: none; }
  .mb-cmdk { padding: 0 8px; }
}

/* ── utility ──────────────────────────────────────────────────────── */
.row { display: flex; gap: var(--s-3); }
.col { display: flex; flex-direction: column; gap: var(--s-3); }
.wrap-gap { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.spread { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; }
.gap-1 { gap: var(--s-1); } .gap-2 { gap: var(--s-2); } .gap-4 { gap: var(--s-4); } .gap-5 { gap: var(--s-5); }
.grow { flex: 1; } .mut { color: var(--ink-4); } .none { display: none; }
