/* ---------- the work console (Tor's "Style B", 10 Nov) ----------
   The artifact's own instrument panel: pale paper, cyan ink, hairline frames, mono labels. Light by default, as he
   chose it, and dark when the computer is set to dark. Everything is scoped under .console-skin so the rest of the
   app keeps its own look. */
.console-skin {
  --c-paper: #EDF2F3; --c-panel: #F7FAFA; --c-sunk: #E2EAEC; --c-line: #C9D7DA;
  --c-ink: #0E2A33; --c-ink2: #4A6670; --c-ink3: #7D949B;
  --c-cyan: #1C93AB; --c-done: #2F9E6B; --c-work: #C79A12; --c-unk: #D9643F; --c-violet: #6E63C7;
  --c-shadow: 0 1px 0 #FFFFFF inset, 0 1px 3px rgba(14, 42, 51, .10);
  --c-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --c-sans: "Inter Tight", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
  background: var(--c-paper); color: var(--c-ink); font-family: var(--c-sans); font-size: 14px; line-height: 1.5;
  min-height: 100%; padding: 0 max(16px, env(safe-area-inset-left, 0px)) 40px max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  .console-skin {
    --c-paper: #0C1619; --c-panel: #121F23; --c-sunk: #0A1215; --c-line: #24383E;
    --c-ink: #DCE9EC; --c-ink2: #95AEB5; --c-ink3: #5E787F;
    --c-cyan: #45BBD2; --c-done: #4FC48A; --c-work: #E0B63C; --c-unk: #EE8056; --c-violet: #9A90E8;
    --c-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 1px 3px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
.console-skin * { box-sizing: border-box; }
.console-skin h1, .console-skin h2, .console-skin h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; color: var(--c-ink); font-family: var(--c-sans); }
.console-skin button { font-family: inherit; }
.console-skin .cs-mono, .console-skin .cs-num { font-family: var(--c-mono); font-variant-numeric: tabular-nums; }
.console-skin .cs-lbl { font-family: var(--c-mono); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--c-ink3); }
.console-skin .cs-empty { color: var(--c-ink3); font-size: 12.5px; margin: 0; }

.cs-head { padding-block: 18px 12px; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--c-line); max-width: 1240px; margin: 0 auto; }
.cs-head h1 { font-size: 19px; max-width: 70ch; }
.cs-sub { color: var(--c-ink2); font-size: 12.5px; max-width: 70ch; margin: 4px 0 0; }
.cs-total { color: var(--c-ink2); font-size: 12.5px; margin: 10px 0 0; font-variant-numeric: tabular-nums; }
.cs-back { font: 500 12px/1 var(--c-sans); padding: 7px 10px; margin-bottom: 10px; border: 1px solid var(--c-line); background: var(--c-panel); color: var(--c-ink2); border-radius: 3px; cursor: pointer; }
.cs-nav { display: flex; gap: 2px; flex-wrap: wrap; margin: 12px auto 16px; max-width: 1240px; }
.cs-nav button { font: 500 12px/1 var(--c-sans); padding: 9px 13px; border: 1px solid var(--c-line); background: var(--c-panel); color: var(--c-ink2); cursor: pointer; border-radius: 3px; }
.cs-nav button[aria-current="true"] { background: var(--c-ink); color: var(--c-paper); border-color: var(--c-ink); }
.console-skin button:focus-visible { outline: 2px solid var(--c-cyan); outline-offset: 2px; }

.cs-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 1px; background: var(--c-line); border: 1px solid var(--c-line); border-radius: 4px; overflow: hidden; margin: 0 auto 16px; max-width: 1240px; }
.cs-rail div { background: var(--c-panel); padding: 9px 11px; min-width: 0; }
.cs-rail b { display: block; font-size: 19px; font-weight: 500; letter-spacing: -.02em; color: var(--c-ink); }
.cs-rail span { display: block; font-family: var(--c-mono); font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--c-ink3); margin-top: 2px; }

.cs-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 16px; align-items: start; max-width: 1240px; margin: 0 auto; }
@media (max-width: 860px) { .cs-grid { grid-template-columns: minmax(0, 1fr); } }
.cs-card { background: var(--c-panel); border: 1px solid var(--c-line); border-radius: 4px; box-shadow: var(--c-shadow); min-width: 0; }
.cs-chead { padding: 10px 12px; border-bottom: 1px solid var(--c-line); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cs-chead h2 { font-size: 13px; }
.cs-station .cs-chead h2 { font-size: 14.5px; }
.cs-body { padding: 12px; }
.cs-body.flush { padding: 0; overflow-x: auto; }
.cs-seg { display: flex; gap: 2px; }
.cs-seg button { font: 500 10.5px/1 var(--c-mono); padding: 5px 8px; border: 1px solid var(--c-line); background: var(--c-panel); color: var(--c-ink2); border-radius: 3px; cursor: pointer; }
.cs-seg button.on { background: var(--c-ink); color: var(--c-paper); border-color: var(--c-ink); }

.cs-plist { max-height: min(74vh, 720px); overflow: auto; overscroll-behavior: contain; }
.cs-grp { font-family: var(--c-mono); font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--c-ink3); background: var(--c-sunk); padding: 6px 12px; position: sticky; top: 0; border-block: 1px solid var(--c-line); z-index: 1; }
.cs-row { display: grid; grid-template-columns: 34px 1fr; gap: 9px; padding: 9px 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--c-line); cursor: pointer; color: inherit; font: inherit; align-items: start; }
.cs-row.own { cursor: default; }
.cs-row:hover:not(.own) { background: var(--c-sunk); }
.cs-row[aria-selected="true"] { background: var(--c-sunk); box-shadow: inset 3px 0 0 var(--c-cyan); }
.cs-yr { font-family: var(--c-mono); font-size: 10.5px; color: var(--c-ink3); font-variant-numeric: tabular-nums; padding-top: 1px; }
.cs-ttl { font-size: 12.5px; line-height: 1.35; min-width: 0; }
.cs-tt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-who { font-family: var(--c-mono); font-size: 10.5px; color: var(--c-ink3); }
.cs-meta { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.cs-chip { font-family: var(--c-mono); font-size: 9px; letter-spacing: .05em; padding: 1px 4px; border-radius: 2px; border: 1px solid var(--c-line); color: var(--c-ink2); background: var(--c-panel); }
.cs-chip.h { border-color: color-mix(in oklab, var(--c-cyan) 45%, var(--c-line)); color: var(--c-cyan); }
.cs-chip.yours { border-color: color-mix(in oklab, var(--c-violet) 45%, var(--c-line)); color: var(--c-violet); }
.cs-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
.cs-dot.d-full { background: var(--c-done); } .cs-dot.d-read { background: var(--c-work); } .cs-dot.d-thin { background: var(--c-unk); }
.cs-structure svg { display: block; width: 100%; height: auto; }
.cs-legend { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 12px; font-family: var(--c-mono); font-size: 10px; color: var(--c-ink2); }
.cs-legend span { display: inline-flex; gap: 5px; align-items: center; }

.cs-scene { position: relative; background: var(--c-sunk); border-bottom: 1px solid var(--c-line); min-height: 160px; }
.cs-art svg { display: block; width: 100%; height: auto; }
.cs-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 11px; font-family: var(--c-mono); font-size: 11px; line-height: 1.4; color: var(--c-ink); background: color-mix(in oklab, var(--c-panel) 86%, transparent); border-top: 1px solid var(--c-line); }
.cs-ask { padding: 28px 16px; display: grid; gap: 10px; justify-items: start; }
.cs-ask p { margin: 0; color: var(--c-ink2); font-size: 13px; }
.cs-beats { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--c-line); flex-wrap: wrap; }
.cs-beats:empty { display: none; }
.cs-beats button { font: 500 11px/1 var(--c-mono); padding: 5px 9px; border: 1px solid var(--c-line); background: var(--c-panel); color: var(--c-ink2); border-radius: 3px; cursor: pointer; }
.cs-beats button[aria-pressed="true"] { background: var(--c-ink); color: var(--c-paper); border-color: var(--c-ink); }
.cs-grow { margin-left: auto; }
.cs-btn { font: 600 11.5px/1 var(--c-sans); letter-spacing: .01em; padding: 8px 12px; border: 1px solid var(--c-cyan); background: var(--c-cyan); color: #fff; border-radius: 3px; cursor: pointer; }
.cs-btn.ghost { background: var(--c-panel); color: var(--c-cyan); }
.cs-btn.plain { background: transparent; border-color: var(--c-line); color: var(--c-ink2); }
.cs-btn:disabled { opacity: .55; cursor: default; }
.cs-fields { display: grid; gap: 11px; padding: 12px; }
.cs-field .cs-lbl { margin-bottom: 3px; }
.cs-field p { margin: 0; font-size: 13px; }
.cs-field ul { margin: 0; padding-left: 17px; font-size: 13px; }
.cs-field li { margin-bottom: 3px; }
.cs-field li::marker { color: var(--c-ink3); }
.cs-link { display: flex; gap: 6px; align-items: baseline; font-size: 12.5px; margin-bottom: 3px; }
.cs-link b { font-family: var(--c-mono); font-size: 10.5px; font-weight: 500; color: var(--c-ink2); }
.cs-src { font-family: var(--c-mono); font-size: 10.5px; color: var(--c-ink3); word-break: break-word; }

.cs-under { display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); gap: 16px; margin: 16px auto 0; max-width: 1240px; }
.console-skin table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.console-skin th, .console-skin td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.console-skin th { font-family: var(--c-mono); font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--c-ink3); font-weight: 500; }
.cs-stand { font-family: var(--c-mono); font-size: 10px; padding: 1px 5px; border-radius: 2px; white-space: nowrap; margin-left: 6px; }
td .cs-stand { margin-left: 0; }
.cs-stand.s-open { background: color-mix(in oklab, var(--c-work) 18%, transparent); color: var(--c-work); }
.cs-stand.s-closed { background: color-mix(in oklab, var(--c-done) 16%, transparent); color: var(--c-done); }
.cs-stand.s-prio { background: color-mix(in oklab, var(--c-unk) 16%, transparent); color: var(--c-unk); }
.cs-stand.s-lead { background: color-mix(in oklab, var(--c-cyan) 16%, transparent); color: var(--c-cyan); }
.cs-stand.s-dim { background: color-mix(in oklab, var(--c-ink3) 18%, transparent); color: var(--c-ink3); }
.cs-q { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--c-line); font-size: 12.5px; }
.cs-q:last-child { border-bottom: 0; }
.cs-q b { font-family: var(--c-mono); font-size: 10.5px; color: var(--c-cyan); font-weight: 500; }
.cs-clash { display: grid; gap: 9px; }
.cs-side { border-left: 2px solid var(--c-line); padding-left: 10px; }
.cs-side p { margin: 2px 0 0; font-size: 12.5px; }
.cs-side.a { border-color: var(--c-violet); }
.cs-side.b { border-color: var(--c-cyan); }
.cs-note { margin: 0; font-size: 12.5px; color: var(--c-ink2); }

.cs-agents, .cs-calls { max-width: 1240px; margin: 0 auto; }
.cs-agrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-top: 14px; }
.cs-agent { background: var(--c-panel); border: 1px solid var(--c-line); border-radius: 4px; padding: 12px; box-shadow: var(--c-shadow); }
.cs-atop { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.cs-agent h3 { font-size: 13.5px; text-transform: capitalize; }
.cs-agent ul { margin: 6px 0 8px; padding-left: 17px; font-size: 12.5px; color: var(--c-ink2); }
.cs-aline { margin: 0 0 6px; font-family: var(--c-mono); font-size: 11px; color: var(--c-ink); }
.cs-live { font-family: var(--c-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 5px; border-radius: 2px; }
.cs-live.on { background: color-mix(in oklab, var(--c-done) 16%, transparent); color: var(--c-done); }
.cs-live.off { background: color-mix(in oklab, var(--c-ink3) 18%, transparent); color: var(--c-ink3); }
.cs-call { background: var(--c-panel); border: 1px solid var(--c-line); border-radius: 4px; padding: 13px; box-shadow: var(--c-shadow); margin: 0 0 11px; display: grid; gap: 8px; justify-items: start; }
.cs-call h3 { font-size: 13.5px; }
.cs-rec { border-left: 2px solid var(--c-cyan); padding-left: 10px; margin: 0; font-size: 13px; }
.cs-foot { margin: 28px auto 0; padding-top: 12px; border-top: 1px solid var(--c-line); font-family: var(--c-mono); font-size: 10.5px; color: var(--c-ink3); display: flex; gap: 14px; flex-wrap: wrap; max-width: 1240px; }

/* ---------- the stage around the console: the rest of the app is night-dark, the console wears its own paper ---------- */
html:has(body.treestage) { background: #EDF2F3; }
body.treestage {
  --night: #EDF2F3; --bench: #F7FAFA; --glass: #C9D7DA; --chalk: #0E2A33; --pencil: #4A6670;
  background: #EDF2F3; color: #0E2A33;
}
@media (prefers-color-scheme: dark) {
  html:has(body.treestage) { background: #0C1619; }
  body.treestage { --night: #0C1619; --bench: #121F23; --glass: #24383E; --chalk: #DCE9EC; --pencil: #95AEB5; background: #0C1619; color: #DCE9EC; }
}
body.treestage .tree-area { display: block; overflow: visible; flex: none; border: 1px solid var(--glass); border-radius: 10px; }
body.treestage .brief-drawer { position: fixed; top: 0; bottom: 0; right: 0; z-index: 30; box-shadow: -8px 0 24px rgba(14, 42, 51, .18); }
/* full width: the console is the whole screen, as in the artifact. The office's work shows on the Agents tab. */
body.treestage .hero { grid-template-columns: minmax(0, 1fr); padding: 0 24px 24px; }
body.treestage .rail { display: none; }
body.treestage .stage { padding-top: 76px; }   /* the stage's first button never sits on the logo (Tor brain B3) */
.console-skin .cs-head h1 { font: 600 19px/1.3 var(--c-sans); white-space: normal; margin: 0; }
@media (min-width: 900px) { .cs-rail { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
@media (max-width: 860px) { body.treestage .hero { padding: 0 12px 16px; } body.treestage .stage { padding-top: 64px; } }
.cs-off { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--c-line); }
.cs-offform { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-offform input { flex: 1 1 240px; min-width: 0; font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--c-line); border-radius: 3px; background: var(--c-panel); color: var(--c-ink); }
.cs-paper .cs-access { margin: 2px 0 8px; font-size: 13px; }
.cs-paper .cs-access.full { color: var(--c-done); } .cs-paper .cs-access.thin { color: var(--c-unk); } .cs-paper .cs-access.yours { color: var(--c-violet); }
.cs-links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cs-links a { text-decoration: none; display: inline-block; }
.cs-abs summary { cursor: pointer; font-family: var(--c-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-cyan); }
.cs-abs p { font-size: 13px; line-height: 1.55; color: var(--c-ink2); margin: 6px 0 0; max-width: 75ch; }
.cs-term { box-shadow: 0 4px 14px rgba(14, 42, 51, .25); }
