/* access-term — design tokens, round 3 (colour system).
   Strict superset of the C2 tokens: every C2 name still exists; new names are marked NEW.
   Four colour jobs, never mixed:
     WHO    identity  — --who-you, --who-lead, --who-1 … --who-8
     STATE  what is happening — --run, --hold, --stop, --clear   (reserved hues: green, amber, red)
     ACT    what you can press / what is yours — --accent (= --you)
     WHERE  surfaces — --sys < --well < --side < --ground < --panel < --panel-2
   Everything else is ink. See COLOUR.md. */
:root, [data-theme="dark"] {
  /* WHERE — six levels, darkest to lightest. Each step is visible on its own. */
  --sys: #0C0E11;      /* NEW system bar, lock-screen bar */
  --well: #12151A;     /* recessed: code, diff, inputs */
  --side: #171B21;     /* NEW side region behind panes */
  --ground: #1F242B;   /* conversation pane, pane bodies */
  --panel: #2A3039;    /* cards, pane headers, Now strip, tiles */
  --panel-2: #363D49;  /* hover, selected row, active pane header */
  --rule: #3B434F;     /* hairlines */
  --rule-2: #7C8795;   /* the rail, control outlines */

  /* INK */
  --ink: #F4F6F8;      /* what is said to him, what he said */
  --ink-2: #C7CDD5;    /* detail that carries meaning */
  --ink-3: #A9B2BD;    /* activity, labels */
  --num: #A9B4C2;      /* NEW times, counts, durations (tabular) */
  --code-ink: #B4D2DA; /* NEW file paths and code — a cool tone of its own */

  /* WHO */
  --who-you: #5B9DFF;      /* NEW the owner. Also the interactive accent: "blue is yours". */
  --who-you-bg: #1F3352;   /* NEW band behind his messages */
  --who-lead: #F283C6;     /* NEW Claude, the lead agent */
  --who-1: #25C7D9;       /* NEW worker palette, assigned by spawn order (see COLOUR.md) */
  --who-2: #B4D44A;
  --who-3: #C993F7;
  --who-4: #D9BE8C;
  --who-5: #A9D4F2;
  --who-6: #B3954A;
  --who-7: #93A5C4;
  --who-8: #C39AC0;

  /* ACT */
  --accent: #5B9DFF;   /* NEW primary button, selected tab, focus ring, links, selection, the mark's lamp */
  --on-accent: #08111F;/* NEW text on an accent fill */
  --accent-bg: #1F3352;/* NEW selected row tint */

  /* STATE — meanings unchanged from C2 */
  --run: #48C282;      /* working */
  --hold: #F0B429;     /* waiting for you */
  --hold-ink: #F0B429;
  --on-hold: #17191A;
  --stop: #F6787C;     /* stopped or lost; the Stop control */
  --stop-fill: #C4323A;
  --clear: #7C8794;    /* done — needs nothing */

  /* KIND — pale tints for the small activity icons; shape carries the kind, tint groups it */
  --k-look: #A9C6E8;   /* NEW read, search, web */
  --k-make: #E8DDBF;   /* NEW edit, run a command */
  --k-talk: #DBC4EF;   /* NEW message to another agent */
  --add-bg: #173B2B;   /* NEW added line */
  --add-ink: #AEEBCB;
  --del-bg: #47232B;   /* NEW removed line */
  --del-ink: #F4BBBF;

  --on-ink: #17191A;   /* kept from C2: text on a paper-white fill */
}
[data-theme="light"] {
  --sys: #E3E7EB; --well: #E2E6EB; --side: #E8EBEF; --ground: #F4F6F8; --panel: #FFFFFF; --panel-2: #E9EFF7;
  --rule: #CBD1D9; --rule-2: #737D89;
  --ink: #0E1216; --ink-2: #333B45; --ink-3: #515C69; --num: #56616E; --code-ink: #1F5563;
  --who-you: #1B5FD1; --who-you-bg: #DCE8FF; --who-lead: #AE1F7C;
  --who-1: #076C78; --who-2: #526B08; --who-3: #7438BD; --who-4: #765B1E; --who-5: #2A6894; --who-6: #71560C; --who-7: #465B7E; --who-8: #84487F;
  --accent: #1B5FD1; --on-accent: #FFFFFF; --accent-bg: #DCE8FF;
  --run: #126F40; --hold: #B07800; --hold-ink: #7F4F00; --on-hold: #17191A; --stop: #B9242B; --stop-fill: #C4262E; --clear: #5E6873;
  --k-look: #2F5F94; --k-make: #6B5514; --k-talk: #6A3F96;
  --add-bg: #DDF3E6; --add-ink: #0E5A33; --del-bg: #FBE3E4; --del-ink: #8E1C22;
  --on-ink: #FFFFFF;
}
:root {
  --sans: "IBM Plex Sans", sans-serif;
  --cond: "IBM Plex Sans Condensed", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --r: 3px;
  --r-1: 5px; --r-2: 8px; --r-3: 10px; --r-4: 12px; --r-5: 16px; --r-6: 20px; --r-7: 28px;   /* the scale a look may restate (aurum-glass 01-tokens) */
  --l1: 700 22px/28px var(--cond);
  --you: 700 19px/28px var(--sans);
  --say: 400 17px/28px var(--sans);
  --lead: 600 18px/26px var(--sans);
  --ui: 600 15px/20px var(--cond);
  --do: 500 14px/20px var(--sans);
  --meta: 500 12.5px/16px var(--sans);
  --code: 400 13px/20px var(--mono);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--side); color: var(--ink); font: 400 16px/24px var(--sans); -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision; overflow: hidden; }
::selection { background: var(--accent); color: var(--on-accent); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
svg.ic .f { fill: currentColor; stroke: none; }
.mono { font-family: var(--mono); font-size: .9em; letter-spacing: -.01em; }
time, .tn, .meta { font-variant-numeric: tabular-nums; }
.meta { font: var(--meta); color: var(--num); }

.mark { display: block; flex: none; }
.mark .m { fill: var(--ink); }
.mark .l { fill: var(--accent); }
.wm { font: 700 13px/16px var(--cond); letter-spacing: .1em; display: inline-flex; align-items: center; white-space: nowrap; }
.wm i { display: inline-block; width: .5em; height: .17em; background: currentColor; margin: 0 .22em 0 .14em; }

/* state lamps: shape + colour, never colour alone */
.lamp { display: inline-block; width: 9px; height: 9px; flex: none; background: var(--run); }
.lamp.hold { background: var(--hold); transform: rotate(45deg); }
.lamp.done { background: var(--clear); height: 2px; }
.lamp.stop { background: none; border: 2px solid var(--stop); }
.lamp.check { background: none; border: 2px solid var(--ink); }
.lamp.stale, .lamp.idle { background: none; border: 2px solid var(--clear); }

.bus { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.bus i { flex: 1 1 0; height: 10px; background: var(--run); }
.bus i.h { height: 16px; background: var(--hold); }
.bus i.d { height: 4px; background: var(--clear); }
.bus i.o { background: var(--ink); }
.bus i.x { background: var(--rule-2); height: 4px; }
.bus.stale i { background: none !important; border: 1.5px solid var(--rule-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border: 1px solid var(--rule-2); border-radius: var(--r); font: 600 16px/20px var(--cond); color: var(--ink); white-space: nowrap; background: var(--panel); }
.btn svg.ic { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.stop { border-color: var(--stop); font-weight: 700; background: none; }
.btn .sq { width: 10px; height: 10px; background: var(--stop); flex: none; }
.btn.stopall { background: var(--stop-fill); border-color: var(--stop-fill); color: #fff; font-weight: 700; }
.btn.stopall .sq { background: #fff; }
.btn.dark { background: var(--on-hold); border-color: var(--on-hold); color: #F6F7F7; font-weight: 700; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 14px; gap: 6px; }
.btn.sm .sq { width: 8px; height: 8px; }
.btn.off { color: var(--ink-3); border-color: var(--rule); background: none; }
.btn.off .sq { background: var(--rule-2); }
kbd { font: 600 11.5px/16px var(--sans); color: var(--ink-3); border: 1px solid var(--rule-2); border-radius: 2px; padding: 0 5px; min-width: 18px; text-align: center; display: inline-block; white-space: nowrap; }
.btn.primary kbd, .btn.dark kbd, .btn.stopall kbd { color: inherit; border-color: currentColor; opacity: .75; }
a, .link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
