/* ==========================================================================
   The Studio 2K portal on Darkroom: Twilight's design system (its rules, its
   token ladder, its shell) with Studio2K's brand in the brand slots.
   docs/proposals/STUDIO2K-WORKSPACE.md section 5 has the rules and where each
   comes from; the values here are measured against WCAG 2.1 (contrast in
   brackets, on tray unless said).

   The laws, in short:
   - One dark room. No light theme.
   - One lamp per viewport: the logo's orange marks the single primary
     action (.btn.lamp) and nothing else. Never focus, never "active", never
     "new", never decoration.
   - Focus, selection, pins and the active item use the fixer (the text
     colour), never the lamp.
   - Success is plain text, never green. Only failure carries a hue.
   - Structure comes from mono labels on hairlines, not from shadows. No glow.
   ========================================================================== */

@font-face { font-family: "Inter"; src: url(/_portal/fonts/inter-var.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(/_portal/fonts/geist-mono-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
/* Studio2K's display voice, the same file the site's build self-hosts (next/font, latin). */
@font-face { font-family: "Anton SC"; src: url(/_portal/fonts/anton-sc.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
/* Studio2K's joining voice, for empty states only. */
@font-face { font-family: "Newsreader"; src: url(/_portal/fonts/newsreader-italic-300.woff2) format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }

:root {
  color-scheme: dark;

  /* The bench: Twilight's ladder, Studio2K's values (src/app/globals.css, the media brand's RULES.md). */
  --room: #121212;            /* page ground, the rail (Studio2K ink) */
  --tray: #1a1a1a;            /* cards, panels, fields */
  --tray-2: #202020;          /* subheads, column wells, hover on tray */
  --lift: #292929;            /* chips, the active item, pressed (Studio2K ink-2) */
  --fixer: #f0f0ed;           /* text, focus, selection (Studio2K paper; 15.24) */
  --fixer-2: #d6d6d2;         /* body text in long rows (11.94) */
  --muted: #9a9a96;           /* secondary text (6.16; 5.15 on lift) */
  --faint: #858581;           /* tertiary text, never on lift (4.70) */
  --hair: #2e2e2c;            /* rules and card borders */
  --hair-2: #3d3d3a;          /* outline buttons, rules that must read */
  --input: #6b6b67;           /* field boundary (3.25; WCAG 1.4.11) */
  --lamp: #e46f03;            /* the one primary action (5.86 on room); ink text on it */
  --lamp-hover: #f07a12;      /* the lamp pressed or hovered (ink on it 6.69) */
  --lamp-ink: #121212;
  --before: #2e5a86;          /* the previous version in a compare: fills only, never text */
  --bad: #f0565b;             /* errors and destructive actions only (5.13) */
  --bad-bg: rgb(240 86 91 / .1);
  --print: #f0f0ed;           /* the one light surface: a picked chip, a kbd on dark */
  --print-ink: #121212;
  --scrim: rgb(18 18 18 / .72);

  /* The names the page builders already use, mapped onto the bench. */
  --bg: var(--tray);
  --bg-2: var(--tray-2);
  --bg-3: var(--lift);
  --hover: var(--lift);
  --ink: var(--fixer);
  --ink-2: var(--fixer-2);
  --line: var(--hair);
  --line-2: var(--hair-2);
  --accent: var(--fixer);     /* old "accent" meant emphasis; emphasis is the fixer now */
  --accent-ink: var(--room);
  --accent-bg: var(--lift);
  --ok: var(--fixer); --ok-bg: var(--lift);
  --warn: var(--bad); --warn-bg: var(--bad-bg);
  --stop: var(--bad); --stop-bg: var(--bad-bg);
  --blue: var(--fixer); --blue-bg: var(--lift);
  --canvas: #0d0d0d;
  --canvas-paper: var(--tray);

  --r: 6px;                   /* Twilight's radius-lg (0.375rem) */
  --r-sm: 4px;
  --ease: cubic-bezier(.22, 1, .36, 1);   /* ease-out-quint, the one motion */
  --dur: 200ms;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Anton SC", "Anton", Impact, "Arial Narrow", sans-serif;
  --serif: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }
html { background: var(--room); color: var(--ink); }
body { margin: 0; background: var(--room); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "cv11", "ss01"; }
a { color: inherit; text-decoration: none; }
a.link, .prose a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a.link:hover, .prose a:hover { text-decoration-color: var(--ink); }
code, .mono { font-family: var(--mono); font-size: 12px; }
code { word-break: break-all; background: var(--lift); border-radius: var(--r-sm); padding: 1px 5px; }
:focus-visible { outline: 2px solid var(--fixer); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--fixer); color: var(--room); }
svg[aria-hidden="true"] { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
details > summary svg { margin-right: 4px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .xs { font-size: 12px; }
.label { font-family: var(--mono); font-size: 12px; color: var(--muted); }
h1, h2, h3 { letter-spacing: -.01em; }
/* Twilight's type-label: mono, uppercase, tracked, on a hairline. */
.type-label { font: 500 10px/1.35 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 768px) { .type-label { font-size: 11px; letter-spacing: .18em; } }
/* Two labels on one hairline (Twilight's RuleLabel). */
.rule { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.rule > * { min-width: 0; }
.rule h2 { margin: 0; font: inherit; letter-spacing: inherit; color: var(--ink); }
.rule a:hover { color: var(--ink); }
kbd { font: 500 9px/1 var(--mono); background: var(--lift); color: var(--muted); border-radius: 3px; padding: 3px 5px; }

/* --- Shell: Twilight's admin sidebar, Studio2K's mark ------------------------- */
.app { min-height: 100vh; display: grid; grid-template-columns: 256px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--room); border-right: 1px solid var(--line); scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 20px 15px; color: var(--ink); border-bottom: 1px solid var(--line); }
.brand svg { height: 14px; width: auto; display: block; }
.brand .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lamp); flex: none; }
.brand .where { margin-left: auto; font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--hair-2); border-radius: 999px; padding: 4px 7px; }
.nav { display: flex; flex-direction: column; padding: 8px 0; flex: 1; }
.nav .group { padding: 16px 20px 4px; }
.nav details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.nav details > summary { display: flex; align-items: center; gap: 8px; padding: 8px 20px 4px; }
.nav details > summary:hover { color: var(--ink); }
.nav details > summary .chev { margin-left: auto; transition: transform var(--dur) var(--ease); }
.nav details[open] > summary .chev { transform: rotate(90deg); }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; margin: 0 8px; padding: 6px 12px; border-radius: var(--r); color: var(--muted); font-size: 14px; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.nav a + a { margin-top: 1px; }
.nav a svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.nav a:hover { background: var(--lift); color: var(--ink); }
.nav a:hover svg { color: var(--ink); }
.nav a.on { background: var(--lift); color: var(--ink); font-weight: 500; box-shadow: inset 2px 0 0 var(--fixer); }
.nav a.on svg { color: var(--ink); }
.nav a .count { margin-left: auto; font: 500 11px/20px var(--mono); font-variant-numeric: tabular-nums; min-width: 20px; text-align: center; padding: 0 6px; border-radius: 999px; background: var(--lift); color: var(--ink); }
.nav a.on .count { background: var(--room); }
.nav a .count.quiet { background: transparent; color: var(--faint); }
.sidebar .who { border-top: 1px solid var(--line); padding: 10px 12px 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.sidebar .who > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The phone's top bar: menu, the page's name, a spacer (Twilight's admin layout). */
.topbar { display: none; }
.scrim { display: none; }

.main { min-width: 0; }
.page { max-width: 1280px; margin: 0 auto; padding: 32px 32px 64px; }
.page.wide { max-width: none; padding: 20px 24px 32px; }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.pagehead > div:first-child { min-width: 0; }
.crumbs { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; font: 500 10px/1.35 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--faint); }
/* type-page in Studio2K's display face: Anton SC, uppercase. */
.pagehead h1 { margin: 0; font: 400 32px/1 var(--display); letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; }
.pagehead .lede { margin: 8px 0 0; color: var(--muted); max-width: 70ch; }
.pagehead .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -12px 0 24px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px; color: var(--muted); font-size: 14px; border-bottom: 1px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--fixer); font-weight: 500; }
.tabs a .n { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: 4px; }

@media (max-width: 1023px) {
  /* Rows hug their content: a short page's head stays under the top bar instead of stretching to fill the screen. */
  .app { grid-template-columns: 1fr; align-content: start; }
  .topbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; height: 56px; padding: 0 8px; background: var(--room); border-bottom: 1px solid var(--line); }
  .topbar .menu { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r); color: var(--ink); }
  .topbar .menu:hover { background: var(--lift); }
  .topbar .menu svg { width: 20px; height: 20px; }
  .topbar .here { text-align: center; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* The rail becomes a drawer over a scrim, opened by the menu link (#rail) with no script. */
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(288px, 86vw); height: 100dvh; transform: translateX(-100%); transition: transform 300ms var(--ease); visibility: hidden; }
  .sidebar:target { transform: none; visibility: visible; }
  .sidebar:target ~ .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: var(--scrim); }
  .sidebar .close { display: grid; }
  .brand .where { margin-left: auto; }
  .page { padding: 20px 16px 48px; }
  .page.wide { padding: 12px 12px 24px; }
  .pagehead h1 { font-size: 28px; }
}
.sidebar .close { place-items: center; width: 44px; height: 44px; margin: -12px -8px -12px 0; border-radius: var(--r); color: var(--muted); }
@media (min-width: 1024px) { .sidebar .close { display: none; } }
.sidebar .close:hover { background: var(--lift); color: var(--ink); }
.sidebar .close svg { width: 18px; height: 18px; }

/* --- Building blocks ------------------------------------------------------ */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1100px) { .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-main { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--tray); min-width: 0; }
.card > .head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 16px 10px; border-bottom: 1px solid var(--line); }
/* Card heads are labels on a hairline, as in Twilight's admin. */
.card > .head h2 { margin: 0; font: 500 10px/1.35 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.card > .head .label { font-size: 12px; }
.card > .body { padding: 14px 16px; }
.card > .body.flush { padding: 0; }
.section-title { font: 500 11px/1.35 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin: 0 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.metric { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--tray); display: flex; flex-direction: column; gap: 10px; }
a.metric { transition: background-color var(--dur) var(--ease); }
a.metric:hover { background: var(--tray-2); }
.metric .k { font: 500 10px/1.35 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
/* type-numeral in the display face. */
.metric .v { font: 400 34px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.metric .v.accent { color: var(--ink); }
.metric .v.bad { color: var(--bad); }
@media (max-width: 680px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.pillars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 24px; overflow: hidden; background: var(--tray); }
.pillar { padding: 14px 16px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-height: 150px; }
.pillar:last-child { border-right: 0; }
.pillar:hover { background: var(--tray-2); }
.pillar .top { display: flex; justify-content: space-between; align-items: center; }
.pillar .name { font-weight: 600; }
.pillar p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.pillar .facts { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
@media (max-width: 1200px) { .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pillar { border-bottom: 1px solid var(--line); } }
@media (max-width: 680px) { .pillars { grid-template-columns: 1fr; } .pillar { border-right: 0; min-height: 0; } }

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); min-width: 0; }
.list > .item:first-child { border-top: 0; }
a.item { transition: background-color var(--dur) var(--ease); }
a.item:hover { background: var(--tray-2); }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .end { display: flex; align-items: center; gap: 8px; flex: none; font-size: 12.5px; color: var(--muted); }
.item.wrap .title, .item.wrap .meta { white-space: normal; }
.item.top { align-items: flex-start; }
.subhead { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--tray-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.list > .subhead:first-child { border-top: 0; }
.subhead .grow { flex: 1; }

.icon { width: 32px; height: 32px; border-radius: var(--r); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); flex: none; overflow: hidden; background: var(--room); }
.icon svg { width: 16px; height: 16px; }
.icon img { width: 100%; height: 100%; object-fit: cover; }

/* Status: a mark and a word. Waiting is a solid fixer dot, in progress a ring,
   settled a muted dot; only failure carries a hue (Darkroom's status law). */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; box-sizing: border-box; }
.status.requested::before, .status.wait::before, .status.proposed::before, .status.pending::before, .status.queued::before { background: var(--fixer); }
.status.in_progress::before, .status.running::before { background: transparent; border: 2px solid var(--fixer); }
.status.approved::before, .status.ok::before, .status.done::before, .status.used::before { background: var(--muted); }
.status.maybe::before, .status.redo::before, .status.late::before { background: transparent; border: 2px solid var(--muted); }
.status.blocked::before, .status.overdue::before { background: transparent; border: 2px solid var(--bad); }
.status.declined::before, .status.rejected::before, .status.expired::before, .status.halted::before, .status.failed::before, .status.error::before { background: var(--bad); }
.status.halted, .status.failed, .status.error { color: var(--bad); }
.status.mac-on::before { background: var(--fixer); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fixer) 25%, transparent); }
.status.mac-off::before { background: transparent; border: 2px solid var(--bad); }
.status.withdrawn::before, .status.cancelled::before, .status.not_wired::before, .status.listed_only::before, .status.stopped::before { background: var(--hair-2); }
.tag { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: var(--r-sm); border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.tag.accent { border-color: transparent; background: var(--lift); color: var(--ink); }
.pill { display: inline-flex; align-items: center; font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--hair-2); border-radius: 999px; padding: 4px 8px; color: var(--muted); white-space: nowrap; }

/* Buttons: outline by default, ghost, and the lamp for the one primary action. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--hair-2); background: transparent; color: var(--ink); font: 500 13.5px/1 var(--sans); cursor: pointer; white-space: nowrap; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.btn:hover { background: var(--lift); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--hair-2); }
.btn.secondary:hover { background: var(--lift); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn.ghost:hover { background: var(--lift); color: var(--ink); }
.btn.lamp, .btn.accent { background: var(--lamp); border-color: var(--lamp); color: var(--lamp-ink); font-weight: 600; }
.btn.lamp:hover, .btn.accent:hover { background: var(--lamp-hover); border-color: var(--lamp-hover); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--hair-2); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn svg { width: 15px; height: 15px; }
@media (pointer: coarse) { .btn { min-height: 40px; } .btn.sm { min-height: 36px; } }

input[type=text], input[type=password], input[type=email], input[type=date], input[type=search], textarea, select { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--input); border-radius: var(--r); background: var(--room); color: var(--ink); font: 14px var(--sans); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
select { padding-right: 6px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--fixer); box-shadow: 0 0 0 1px var(--fixer); }
/* iOS zooms into any field under 16px on a touch screen. */
@media (pointer: coarse) { input[type=text], input[type=password], input[type=email], input[type=date], input[type=search], textarea, select { font-size: 16px; } }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline input[type=text] { flex: 1 1 200px; width: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 680px) { .form-grid { grid-template-columns: 1fr; } }

.flash { border: 1px solid var(--line); border-left: 2px solid var(--fixer); border-radius: var(--r); padding: 10px 12px; font-size: 13.5px; margin: 0 0 20px; background: var(--tray); }
.flash.err { border-left-color: var(--bad); }
/* An empty state: the fact, then the next step (Twilight's dashed box). */
.empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty.box { border: 1px dashed var(--hair-2); border-radius: var(--r); text-align: left; display: flex; flex-direction: column; gap: 4px; }
.empty.box b { color: var(--ink); font-weight: 500; }
.empty .calm { display: block; font: italic 300 22px/1.2 var(--serif); color: var(--ink); margin-bottom: 4px; }
details > summary { cursor: pointer; list-style: none; color: var(--muted); font-size: 13px; }
details > summary::-webkit-details-marker { display: none; }
details > summary:hover { color: var(--ink); }
details.danger > summary { color: var(--bad); }
.reason { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.findings { margin: 4px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--bad); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--tray-2); white-space: nowrap; font: 500 10px/1.35 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.table td { padding: 9px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--tray-2); }
.table .num { text-align: right; font-family: var(--mono); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tr.sub td { color: var(--muted); }
.table tr.sub td:first-child { padding-left: 32px; }
.scroll-x { overflow-x: auto; }
.bignums { display: flex; gap: 32px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.bignums .v { font: 400 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.bignums .k { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.meter { height: 4px; border-radius: 999px; background: var(--lift); overflow: hidden; margin-top: 10px; }
.meter > span { display: block; height: 100%; background: var(--fixer); }
.meter.over > span { background: var(--bad); }

/* --- The review and file workspace ---------------------------------------- */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 360px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; height: calc(100vh - 118px); min-height: 560px; background: var(--tray); }
.canvas { background: var(--canvas); position: relative; overflow: auto; display: flex; flex-direction: column; min-width: 0; }
.canvas.paper { background: var(--canvas-paper); }
.canvas .bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--ink-2); font-size: 12.5px; border-bottom: 1px solid var(--line); flex: none; }
.canvas.paper .bar { color: var(--muted); background: var(--tray); }
.canvas .bar .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas .bar a { color: inherit; } .canvas .bar a:hover { text-decoration: underline; }
.stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; min-height: 0; }
.stage.top { align-items: flex-start; }
.stage video, .stage img.media { max-width: 100%; max-height: calc(100vh - 230px); display: block; border-radius: var(--r-sm); background: #000; }
.stage audio { width: min(640px, 100%); }
.stage .sheet { margin-top: 12px; max-width: 100%; border-radius: var(--r-sm); }
.markers { position: relative; height: 18px; margin: 8px auto 0; width: 100%; max-width: 100%; }
.markers .m { position: absolute; top: 3px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--fixer); border: 2px solid var(--canvas); cursor: pointer; }
.pinbox { position: relative; display: block; width: min(100%, 1100px); margin: 0 auto; }
.pinbox img.media { width: 100%; height: auto; max-height: none; }
.pinbox.design { display: block; width: 100%; background: #fff; border-radius: var(--r-sm); border: 1px solid var(--line); }
.pinbox iframe { display: block; width: 100%; height: var(--h, 2400px); border: 0; background: #fff; border-radius: var(--r-sm); }
.pinlayer { position: absolute; inset: 0; pointer-events: none; }
/* A page design, laid out at desktop width and scaled to the canvas (live.js sets --s and --x). Without the script it fills the canvas as before. */
.pagefit { width: 100%; min-width: 0; }
.pagefit.scaled { height: calc(var(--h, 2400px) * var(--s, 1)); overflow: hidden; }
.pagefit.scaled .pinbox.design { width: 1440px; margin: 0 0 0 var(--x, 0px); border: 0; box-shadow: 0 0 0 1px var(--line); transform: scale(var(--s, 1)); transform-origin: 0 0; }
.pagefit.scaled .pin { transform: translate(-50%, -100%) scale(calc(1 / var(--s, 1))); transform-origin: 50% 100%; }
.pinbox.pinning .pinlayer { pointer-events: auto; cursor: crosshair; outline: 2px solid var(--fixer); outline-offset: -2px; }
/* Pins are fixer, never the lamp. */
.pin { position: absolute; transform: translate(-50%, -100%); min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px 11px 11px 2px; background: var(--fixer); color: var(--room); font: 600 11px/22px var(--sans); text-align: center; pointer-events: none; box-shadow: 0 0 0 2px var(--room); }
.pin.new { background: var(--room); color: var(--fixer); box-shadow: 0 0 0 2px var(--fixer); }
.document { width: 100%; max-width: 760px; background: var(--tray); border: 1px solid var(--line); border-radius: var(--r); padding: 40px 48px; font-size: 15px; line-height: 1.7; }
@media (max-width: 680px) { .document { padding: 20px; } }
.document h2 { font-size: 26px; line-height: 1.25; margin: 0 0 12px; } .document h3 { font-size: 19px; } .document h4 { font-size: 16px; }
.document pre { white-space: pre-wrap; background: var(--room); padding: 12px 14px; border-radius: var(--r); font: 12.5px/1.6 var(--mono); }
pre.args { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--room); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--r); font: 12.5px/1.6 var(--mono); }
.document blockquote { border-left: 2px solid var(--line-2); margin: 12px 0; padding: 0 0 0 14px; color: var(--ink-2); }
.blk { position: relative; border-radius: var(--r); margin: 0 -12px; padding: 0 12px; }
.blk:hover { background: var(--tray-2); }
.blk.has { background: var(--lift); box-shadow: inset 2px 0 0 var(--fixer); }
.blk > details { margin: -6px 0 6px; } .blk > details > summary { font-size: 12px; opacity: 0; }
.blk:hover > details > summary, .blk.has > details > summary, .blk > details[open] > summary { opacity: 1; }
@media (hover: none) { .blk > details > summary { opacity: 1; } }
.blk .note { margin-bottom: 8px; }

.panel { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--tray); }
.panel .ptabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; }
.panel .ptabs span { padding: 10px 6px; font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--fixer); margin-bottom: -1px; }
.panel .ptabs .n { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: 4px; font-weight: 400; }
.panel .scroll { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.panel .compose { border-top: 1px solid var(--line); padding: 12px 16px 14px; flex: none; background: var(--tray); }
@media (max-width: 960px) { .workspace { grid-template-columns: 1fr; height: auto; } .panel { border-left: 0; border-top: 1px solid var(--line); } .canvas { min-height: 50vh; } }

.notes { display: flex; flex-direction: column; gap: 2px; }
.note { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 8px; margin: 0 -8px; border-radius: var(--r); font-size: 13.5px; }
.note:hover { background: var(--tray-2); }
.note .av { width: 24px; height: 24px; border-radius: 50%; background: var(--lift); color: var(--ink-2); display: grid; place-items: center; font: 600 10px/1 var(--sans); text-transform: uppercase; }
.note.owner .av { background: var(--fixer); color: var(--room); }
.note .top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.note .who { font-weight: 600; } .note .when { color: var(--faint); font-size: 12px; }
.note .text { margin-top: 2px; white-space: pre-wrap; color: var(--ink-2); }
.note .acts { margin-top: 4px; display: flex; gap: 6px; }
.note.done { opacity: .55; }
.noteReply { margin-left: 18px; border-left: 2px solid var(--line-2); padding-left: 6px; }
.note.done .text { text-decoration: line-through; text-decoration-color: var(--faint); }
.anchor { font-family: var(--mono); font-size: 11px; color: var(--ink); background: var(--lift); border: 0; border-radius: var(--r-sm); padding: 2px 6px; cursor: default; }
button.anchor { cursor: pointer; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--muted); font: 12px var(--sans); cursor: pointer; }
.linkbtn:hover { color: var(--ink); text-decoration: underline; }

/* Verdicts: Approve is the lamp, the rest are outlines. */
.decide { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.decide .btn { height: 34px; }
.btn.v-approve { background: var(--lamp); border-color: var(--lamp); color: var(--lamp-ink); font-weight: 600; }
.btn.v-approve:hover { background: var(--lamp-hover); border-color: var(--lamp-hover); }
.btn.v-maybe, .btn.v-redo, .btn.v-decline { background: transparent; color: var(--ink); border-color: var(--hair-2); }
.btn.v-maybe:hover, .btn.v-redo:hover { background: var(--lift); } .btn.v-decline:hover { background: var(--bad-bg); color: var(--bad); }
.anchors { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.anchors input[type=text] { width: 96px; height: 28px; font-family: var(--mono); font-size: 12px; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; } .cmp video, .cmp img { width: 100%; border-radius: var(--r-sm); }

/* --- Tasks: a board ------------------------------------------------------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.column { background: var(--room); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 200px; }
.column > .head { display: flex; align-items: baseline; gap: 8px; padding: 12px 12px 10px; font: 500 10px/1.35 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.column > .head .n { font-family: var(--mono); font-size: 11px; color: var(--faint); font-weight: 400; margin-left: auto; letter-spacing: 0; }
.column > .cards { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 8px; }
.tcard { display: block; background: var(--tray); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; transition: border-color var(--dur) var(--ease); }
.tcard:hover { border-color: var(--line-2); background: var(--tray-2); }
.tcard .title { font-weight: 500; font-size: 13.5px; line-height: 1.4; }
.tcard .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); align-items: center; }
.timeline { display: flex; flex-direction: column; }
.timeline .ev { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 8px 0; font-size: 13px; }
.timeline .ev::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin-top: 6px; }

/* --- Files ---------------------------------------------------------------- */
.path { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-family: var(--mono); font-size: 13px; }
.path a { color: var(--muted); } .path a:hover { color: var(--ink); } .path .sep { color: var(--faint); }

/* --- A tool a session built, at full size --------------------------------- */
.toolframe { width: 100%; height: calc(100vh - 170px); min-height: 560px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; display: block; }
.toolcard { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); min-height: 120px; background: var(--tray); }
.toolcard:hover { background: var(--tray-2); }
.toolcard .name { font-weight: 600; }
.toolcard .meta { margin-top: auto; font-size: 12px; color: var(--faint); }

/* --- Sign in -------------------------------------------------------------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--room); }
.signin .card { width: min(400px, 100%); padding: 28px; }
.signin h1 { font: 400 28px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; margin: 20px 0 8px; }
.signin input[name=token] { font-family: var(--mono); font-size: 13px; margin: 10px 0; }
.signin .btn { width: 100%; height: 36px; }
.signin .btn:not(.secondary):not(.ghost) { background: var(--lamp); border-color: var(--lamp); color: var(--lamp-ink); font-weight: 600; }
.signin .btn:not(.secondary):not(.ghost):hover { background: var(--lamp-hover); border-color: var(--lamp-hover); }
/* Sign-up: what do you do? Each kind names a house's levels (spaces.ts HOUSE_KINDS). */
.signin .kinds { border: 0; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.signin .kinds legend { padding: 0; margin-bottom: 6px; }
.signin .kind { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--hair-2); border-radius: var(--r); cursor: pointer; transition: border-color var(--dur) var(--ease); }
.signin .kind:hover { border-color: var(--muted); }
.signin .kind:has(input:checked) { border-color: var(--lamp); }
.signin .kind input { margin: 3px 0 0; accent-color: var(--lamp); height: auto; flex: none; }
.signin .kind > span { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--ink); }
.signin .kind > span strong { font-weight: 500; }
@media (max-width: 640px) {
  .signin { min-height: 100dvh; place-items: start center; padding-top: 48px; }
  .signin input, .signin input[name=token] { font-size: 16px; height: 44px; }
  .signin .btn { height: 44px; }
}
footer.foot { margin-top: 32px; color: var(--faint); font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* --- Live: the dot, the activity feed, toasts ----------------------------- */
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-right: 6px; vertical-align: 1px; }
.live-dot.on { background: var(--fixer); box-shadow: 0 0 0 3px var(--lift); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px transparent; } }
.item.act { align-items: flex-start; }
.item.act .av, .toast .av { width: 24px; height: 24px; border-radius: 50%; background: var(--lift); color: var(--ink-2); display: grid; place-items: center; font: 600 10px/1 var(--sans); text-transform: uppercase; flex: none; margin-top: 1px; }
.item.act .title { white-space: normal; font-weight: 400; color: var(--ink-2); }
.item.act .title b { color: var(--ink); font-weight: 600; }
.item.act .title span { color: var(--ink); }
/* A refetch dims the frame instead of blanking it; new rows arrive on lift. */
.item.act.fresh { animation: fresh 2.5s var(--ease); }
@keyframes fresh { from { background: var(--lift); } to { background: transparent; } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--tray); border: 1px solid var(--hair-2); border-radius: var(--r); padding: 10px 12px; font-size: 13px; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.toast .grow { min-width: 0; } .toast .title { display: block; } .toast .meta { color: var(--muted); font-size: 12px; }
.toast.out { opacity: 0; transform: translateY(6px); }
[hidden] { display: none !important; }

/* --- The lightbox: one piece at a time, full screen ------------------------ */
.lb { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: 52px minmax(0, 1fr) 84px; background: var(--room); color: var(--ink); }
.lb-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.lb-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.lb-title .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-title .m { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-pos { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.lb .status { color: var(--ink-2); }
.lb-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: var(--r); background: none; color: var(--ink-2); flex: none; cursor: pointer; font: inherit; padding: 0; }
.lb-btn:hover { background: var(--lift); color: var(--ink); }
.lb-btn svg { width: 18px; height: 18px; }
.lb-stage { position: relative; min-width: 0; min-height: 0; overflow: auto; display: flex; background: var(--canvas); }
.lb-stage.paper { background: var(--tray); }
.lb-canvas { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lb-canvas .stage { padding: 28px 72px; }
.lb-canvas .stage video, .lb-canvas .stage img.media { max-height: calc(100vh - 220px); }
/* An image fits the screen: the box takes the picture's shape (live.js reads it into --ar), so pins sit on the picture. */
.lb-canvas .pinbox:not(.design) { width: min(100%, calc((100vh - 220px) * var(--ar, 1.7778))); }
.lb-canvas .pinbox:not(.design) img.media { width: 100%; height: auto; max-height: none; }
/* Filled: as wide as the canvas, scrolling down a tall design. Z or the button toggles it. */
.lb-stage.fill .lb-canvas .pinbox:not(.design) { width: min(100%, 1600px); }
.lb-btn[aria-pressed="true"] { background: var(--lift); color: var(--ink); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--scrim); color: var(--ink); border: 1px solid var(--hair-2); }
.lb-nav:hover { background: var(--fixer); color: var(--room); }
.lb-nav svg { width: 22px; height: 22px; }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-side { grid-row: 2; grid-column: 2; display: flex; flex-direction: column; min-height: 0; background: var(--tray); color: var(--ink); border-left: 1px solid var(--line); }
.lb-scroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.lb-compose { border-top: 1px solid var(--line); padding: 12px 16px 14px; }
.lb-strip { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; padding: 10px 12px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: thin; }
.lb-thumb { position: relative; flex: none; width: 92px; height: 60px; border-radius: var(--r); overflow: hidden; background: var(--tray); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); opacity: .7; }
.lb-thumb:hover { opacity: 1; }
.lb-thumb.on { opacity: 1; border-color: var(--fixer); box-shadow: 0 0 0 1px var(--fixer); }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumb .k svg { width: 18px; height: 18px; }
.lb-thumb .s { position: absolute; right: 5px; bottom: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--hair-2); }
.lb-thumb .s.requested { background: var(--fixer); } .lb-thumb .s.approved { background: var(--muted); } .lb-thumb .s.maybe, .lb-thumb .s.redo { background: transparent; border: 1.5px solid var(--muted); } .lb-thumb .s.declined, .lb-thumb .s.expired { background: var(--bad); }
@media (max-width: 960px) {
  .lb { position: static; min-height: 100vh; grid-template-columns: minmax(0, 1fr); grid-template-rows: 52px auto auto auto; }
  .lb > * { min-width: 0; }
  .lb-top { gap: 6px; padding: 0 6px; }
  .lb-pos .l, .lb-top .status { display: none; }
  .lb-stage { min-height: 56vh; }
  .lb-canvas .stage { padding: 16px 52px; }
  .lb-side { grid-row: 3; grid-column: 1; border-left: 0; }
  .lb-strip { grid-row: 4; }
}
/* In the lightbox, toasts sit over the stage's top left, clear of the verdicts. */
.lb ~ .toasts { top: 64px; left: 16px; right: auto; bottom: auto; }

/* Sessions: a runner's transcript, one line per thing the agent said or did. */
.transcript { display: flex; flex-direction: column; max-height: 70vh; overflow: hidden auto; }
.tev { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.tev:first-child { border-top: 0; }
.tev .k { font: 500 10px/20px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--faint); }
.tev .b { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; color: var(--ink); }
.tev.k-tool .b { font: 12.5px/20px var(--mono); color: var(--ink-2); }
.tev.k-note .b { color: var(--muted); }
.tev.k-result { background: var(--tray-2); }
.tev.k-result .k { color: var(--ink); }
.tev.fresh { animation: fresh 2.5s var(--ease); }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .tev { grid-template-columns: 1fr; gap: 0; } .transcript { max-height: none; } }

/* Decisions: the options as large tap targets. The recommended one carries a
   label, not a colour: the lamp never means "recommended". */
.choices { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.choices legend { margin-bottom: 4px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--tray); cursor: pointer; }
.choice:hover { border-color: var(--line-2); }
.choice.rec { border-color: var(--hair-2); border-style: dashed; }
.choice input { margin-top: 3px; flex: none; width: 18px; height: 18px; accent-color: var(--fixer); }
.choice:has(input:checked) { border-color: var(--fixer); border-style: solid; background: var(--lift); }
.choices:disabled .choice, .choice:has(input:disabled) { cursor: default; }
.choice-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.choice-label { font-weight: 500; color: var(--ink); }
.choice-detail { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.decision-context { font-size: 14px; line-height: 1.65; }
.decision-context p { margin: 0 0 10px; }
.decision-context ul, .decision-context ol { margin: 0 0 10px; padding-left: 20px; }

/* --- Artifakt slice 1: a note's picks, and what fixed it (review-pages.ts, annotate.ts) --- */
.picks { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.fixed { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }

/* --- Today: one queue of what needs you ----------------------------------- */
/* A row's picture: a still's own image, a video's poster (portrait), or its type's mark. */
.queue .thumb { width: 56px; height: 40px; flex: none; border-radius: var(--r-sm); overflow: hidden; background: var(--room); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.queue .thumb.tall { width: 32px; height: 48px; margin: 0 12px; }
.queue .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.queue .thumb svg { width: 16px; height: 16px; }
.queue .item .end { gap: 10px; }
.queue .item .end .pill { min-width: 64px; justify-content: center; }
.queue .subhead { padding: 8px 16px; font: 500 10px/1.35 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); background: var(--room); }
.queue .subhead a { color: var(--ink); }
.queue .subhead a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* The numbers as one slim strip, not four tiles. */
.metrics.strip { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--tray); margin-bottom: 24px; }
.metrics.strip .metric { border: 0; border-radius: 0; background: transparent; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.metrics.strip .metric + .metric { border-left: 1px solid var(--line); }
.metrics.strip .metric .v { font-size: 26px; }
@media (max-width: 680px) { .metrics.strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .metrics.strip .metric:nth-child(3) { border-left: 0; } .metrics.strip .metric:nth-child(n+3) { border-top: 1px solid var(--line); } }
.queue { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--tray); overflow: hidden; }
.queue .item { padding: 12px 16px; }
.queue .kind { width: 92px; flex: none; }
.queue .kind .pill { justify-content: center; }
.queue .who { font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.queue .item.stop { box-shadow: inset 2px 0 0 var(--bad); }
.queue .item.stop .pill { border-color: var(--bad); color: var(--bad); }
.queue .grow .title, .queue .grow .meta { display: block; }
/* On a phone: the type over the title, the details wrapping under it; the venture is in the details. */
@media (max-width: 560px) {
  .queue .item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .queue .kind { width: auto; }
  .queue .grow .title, .queue .grow .meta { white-space: normal; }
  .queue .item .end { display: none; }
}
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .today-grid { grid-template-columns: 1fr; } }
.section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* --- The venture switcher and the rail toggle (plain links to /portal/view) --- */
.switch { margin: 8px 8px 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--tray); }
.switch > summary { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 8px; padding: 8px 10px; color: var(--ink); }
.switch > summary .type-label { grid-column: 1; }
.switch > summary .cur { grid-column: 1; font-size: 13.5px; font-weight: 500; }
.switch > summary .chev { grid-column: 2; grid-row: 1 / 3; align-self: center; transition: transform var(--dur) var(--ease); }
.switch[open] > summary .chev { transform: rotate(90deg); }
.switch .menu { display: flex; flex-direction: column; padding: 4px; border-top: 1px solid var(--line); }
.switch .menu a { padding: 7px 8px; border-radius: var(--r-sm); color: var(--muted); font-size: 13.5px; }
.switch .menu a:hover { background: var(--lift); color: var(--ink); }
.switch .menu a.on { color: var(--ink); box-shadow: inset 2px 0 0 var(--fixer); background: var(--lift); }
.railtoggle { display: flex; align-items: center; gap: 12px; margin: 0 8px 8px; padding: 6px 12px; border-radius: var(--r); color: var(--muted); font-size: 13px; }
.railtoggle:hover { background: var(--lift); color: var(--ink); }
.railtoggle svg { width: 16px; height: 16px; }
@media (min-width: 1024px) {
  .app.rail-min { grid-template-columns: 64px minmax(0, 1fr); }
  .rail-min .brand { padding: 16px 0 15px; justify-content: center; }
  .rail-min .brand svg, .rail-min .brand .where { display: none; }
  .rail-min .brand .dot { width: 10px; height: 10px; }
  .rail-min .switch, .rail-min .nav .group, .rail-min .nav details > summary, .rail-min .who > span, .rail-min .lbl { display: none; }
  .rail-min .nav details { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
  .rail-min .nav details:not([open]) > a { display: flex; }
  .rail-min .nav a, .rail-min .railtoggle { justify-content: center; margin: 0 8px; padding: 8px 0; }
  .rail-min .nav a .count { position: absolute; top: 2px; right: 4px; min-width: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
  .rail-min .nav a .count.quiet { display: none; }
  .rail-min .who { display: none; }
}
@media (max-width: 1023px) { .railtoggle { display: none; } }

/* --- The logo is the venture switcher: a dropdown over the page ----------------- */
.brand { padding: 12px 12px 11px; gap: 8px; }
.brandswitch { position: relative; flex: 1; min-width: 0; }
.brandswitch > summary { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; border-radius: var(--r); cursor: pointer; color: var(--ink); list-style: none; }
.brandswitch > summary::-webkit-details-marker { display: none; }
.brandswitch > summary:hover, .brandswitch[open] > summary { background: var(--lift); }
.brandswitch > summary .chev { margin-left: auto; color: var(--muted); transition: transform var(--dur) var(--ease); }
.brandswitch[open] > summary .chev { transform: rotate(90deg); }
.brandswitch .own { font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--hair-2); border-radius: 999px; padding: 3px 6px; }
.mark { display: inline-flex; align-items: center; height: 18px; color: var(--ink); }
.mark svg { height: 15px; width: auto; display: block; }
.mark img { height: 18px; width: auto; max-width: 130px; display: block; }
.mark.word { font: 400 20px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.brandswitch .dropdown { position: absolute; top: calc(100% + 6px); left: 0; z-index: 80; width: 264px; padding: 6px; border: 1px solid var(--hair-2); border-radius: var(--r); background: var(--tray); box-shadow: 0 16px 40px -20px rgb(0 0 0 / .8); display: flex; flex-direction: column; gap: 2px; }
.brandswitch .dropdown .head { padding: 6px 8px 4px; }
.brandswitch .dropdown a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--muted); font-size: 13px; }
.brandswitch .dropdown a:hover { background: var(--lift); color: var(--ink); }
.brandswitch .dropdown a.on { background: var(--lift); color: var(--ink); box-shadow: inset 2px 0 0 var(--fixer); }
.brandswitch .dropdown .mark { height: 16px; }
.brandswitch .dropdown .mark img { height: 16px; }
.brandswitch .dropdown .mark svg { height: 13px; }
.brandswitch .dropdown .mark.word { font-size: 17px; }
.nav { padding-top: 10px; }
/* The rail is short now, so it needn't scroll: the switcher's dropdown can hang over the page. */
@media (min-width: 1024px) { .sidebar { overflow: visible; } }
.brandswitch .dropdown a .lbl { color: inherit; }
.who { gap: 6px; }
.who .railtoggle { margin: 0 0 0 auto; padding: 6px; }
.who .railtoggle svg { width: 16px; height: 16px; }
@media (min-width: 1024px) {
  .rail-min .brandswitch > summary { justify-content: center; padding: 0; }
  .rail-min .brandswitch > summary .mark, .rail-min .brandswitch > summary .chev, .rail-min .brandswitch .own { display: none; }
  .rail-min .brandswitch > summary::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--lamp); }
  .rail-min .who { display: flex; justify-content: center; padding: 10px 0; }
  .rail-min .who > span, .rail-min .who form { display: none; }
  .rail-min .who .railtoggle { margin: 0; }
}

/* --- Layouts: the toolbar, Record, Library (ui.ts, "Layouts") ------------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -8px 0 24px; }
.toolbar .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--tray); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg a { padding: 6px 10px; border-radius: var(--r-sm); color: var(--muted); font-size: 13px; white-space: nowrap; }
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--lift); color: var(--ink); font-weight: 500; }
.seg a .n { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: 6px; }
.record { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .record { grid-template-columns: 1fr; } }
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pcard { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--tray); min-width: 0; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.pcard:hover { border-color: var(--line-2); background: var(--tray-2); }
.pcard .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pcard .name { font: 600 16px/1.3 var(--sans); overflow-wrap: anywhere; }
.pcard p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .nums { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.pcard .nums b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.pcard .meter { margin-top: 0; }
.board.compact { grid-template-columns: repeat(4, minmax(200px, 1fr)); }
.board.compact .column { min-height: 120px; }
.project-tag { font: 500 11px/1 var(--mono); color: var(--muted); border-left: 1px solid var(--line-2); padding-left: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .sidebar { transition: none; }
}

/* --- Thumbnails everywhere a piece has a picture ------------------------- */
.icon.thumb { width: 48px; height: 36px; padding: 0; background: var(--room); }
.icon.thumb.tall { width: 28px; height: 44px; margin: 0 10px; }
.icon.thumb img { width: 100%; height: 100%; object-fit: cover; }
.pcard .cover { display: block; margin: -16px -16px 4px; aspect-ratio: 16 / 7; overflow: hidden; border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; background: var(--room); }
.pcard .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- Juno: the portal's name (wordmark.ts JUNO_WORD) -------------------------
   Lowercase juno in one round stroke with the orbit as its o; its height
   follows the font size. These win over .brand svg and .mark svg, which size
   the Studio 2K wordmark. */
.j-word { display: block; height: 1.15em; width: auto; overflow: visible; color: var(--ink); font-size: 22px; }
.brand .j-word, .mark .j-word { height: 1.15em; width: auto; }
.mark .j-word { font-size: 18px; }
.brandswitch .dropdown .mark .j-word { font-size: 13px; }
.signin .brand .j-word { font-size: 28px; }
