/* Syntat Aurora. Custom properties mirror DESIGN.md tokens one-to-one (AD-15): colors bare, other groups prefixed
   (typography-, rounded-, spacing-; elevation keeps its own shadow- names). Each -dark token is the dark value of
   its light property. No web font, no external URL. */

:root {
  /* colors */
  --ground: #F6F3EE;
  --surface: #FFFFFF;
  --surface-2: #FBF9F6;
  --glass: #FFFFFFB8;
  --line: #E9E4DC;
  --line-2: #DDD6CB;
  --input-border: #8C857B;
  --ink: #1D1A16;
  --ink-2: #4E4841;
  --ink-3: #6B655E;
  --agent: #5B3DF5;
  --agent-tint: #EFEBFF;
  --ok: #1F7A43;
  --ok-tint: #E5F4EA;
  --warn: #8F4F06;
  --warn-tint: #FDF1D8;
  --warn-line: #F0CF8E;
  --bad: #B42318;
  --bad-tint: #FDECEA;
  --focus: #1D1A16;
  --focus-inverse: #FFFFFF;
  --scrim: #1D1A1657;
  --health-ok: #278A4E;
  --health-lag: #A87310;
  --chart-planning: #A87418;

  /* typography (font shorthand; letter-spacing is set where the token is used) */
  --typography-ui: 400 13px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --typography-ui-strong: 550 13px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --typography-meta: 400 12px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --typography-label-caps: 600 11px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --typography-tag: 600 11px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --typography-tag-illustrative: 600 10px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --typography-pulse: 400 15px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --typography-palette-input: 400 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --typography-section-title: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --typography-panel-title: 650 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --typography-empty-title: 650 20px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --typography-kpi: 650 20px/1.1 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --typography-page-title: 650 22px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --typography-task-title: 650 24px/1.25 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --typography-hero-title: 650 28px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --typography-key-chip: 600 12px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --typography-code: 500 12px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --typography-kbd: 500 11px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* rounded */
  --rounded-xs: 5px;
  --rounded-chip: 7px;
  --rounded-sm: 8px;
  --rounded-md: 12px;
  --rounded-lg: 16px;
  --rounded-full: 9999px;

  /* spacing */
  --spacing-1: 4px;
  --spacing-2: 8px;
  --spacing-3: 12px;
  --spacing-4: 16px;
  --spacing-5: 20px;
  --spacing-6: 24px;
  --spacing-7: 32px;
  --spacing-8: 48px;
  --spacing-nav-width: 240px;
  --spacing-nav-width-compact: 220px;
  --spacing-rail-width: 312px;
  --spacing-rail-width-wide: 384px;
  --spacing-main-padding-top: 28px;
  --spacing-main-padding-x: 32px;
  --spacing-main-padding-top-mobile: 20px;
  --spacing-main-padding-x-mobile: 16px;
  --spacing-control-height: 36px;
  --spacing-control-height-ghost: 30px;
  --spacing-control-height-row: 28px;
  --spacing-target-min-touch: 44px;
  --spacing-bottom-tabs-height: 56px;
  --spacing-pulse-max: 760px;
  --spacing-frame-max: 1440px;
  --spacing-bp-compact: 1180px; /* media queries cannot read properties: the queries below repeat these two */
  --spacing-bp-mobile: 760px;

  /* elevation */
  --shadow-1: 0 1px 2px rgba(48,36,20,.05), 0 0 0 1px var(--line);
  --shadow-2: 0 1px 2px rgba(48,36,20,.06), 0 8px 24px -12px rgba(48,36,20,.18), 0 0 0 1px var(--line);
  --shadow-3: 0 2px 4px rgba(48,36,20,.06), 0 24px 48px -20px rgba(48,36,20,.28), 0 0 0 1px var(--line);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #15130F;
    --surface: #1E1B17;
    --surface-2: #24211C;
    --glass: #1E1B17C7;
    --line: #332E27;
    --line-2: #403A31;
    --input-border: #7A7265;
    --ink: #F3EFE8;
    --ink-2: #C9C2B7;
    --ink-3: #A39B8F;
    --agent: #A894FF;
    --agent-tint: #2A2346;
    --ok: #6FD49A;
    --ok-tint: #16301F;
    --warn: #F5C46B;
    --warn-tint: #33270F;
    --warn-line: #5C4518;
    --bad: #FF8A80;
    --bad-tint: #3A1A17;
    --focus: #F3EFE8;
    --focus-inverse: #1E1B17;
    --scrim: #0000008C;
    --health-ok: #2F9E5B;
    --health-lag: #D99A1E;
    --chart-planning: #E3A73A;
    --shadow-1: 0 0 0 1px var(--line);
    --shadow-2: 0 8px 24px -12px rgba(0,0,0,.6), 0 0 0 1px var(--line);
    --shadow-3: 0 24px 48px -20px rgba(0,0,0,.7), 0 0 0 1px var(--line);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ground: #15130F;
  --surface: #1E1B17;
  --surface-2: #24211C;
  --glass: #1E1B17C7;
  --line: #332E27;
  --line-2: #403A31;
  --input-border: #7A7265;
  --ink: #F3EFE8;
  --ink-2: #C9C2B7;
  --ink-3: #A39B8F;
  --agent: #A894FF;
  --agent-tint: #2A2346;
  --ok: #6FD49A;
  --ok-tint: #16301F;
  --warn: #F5C46B;
  --warn-tint: #33270F;
  --warn-line: #5C4518;
  --bad: #FF8A80;
  --bad-tint: #3A1A17;
  --focus: #F3EFE8;
  --focus-inverse: #1E1B17;
  --scrim: #0000008C;
  --health-ok: #2F9E5B;
  --health-lag: #D99A1E;
  --chart-planning: #E3A73A;
  --shadow-1: 0 0 0 1px var(--line);
  --shadow-2: 0 8px 24px -12px rgba(0,0,0,.6), 0 0 0 1px var(--line);
  --shadow-3: 0 24px 48px -20px rgba(0,0,0,.7), 0 0 0 1px var(--line);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; display: flex; flex-direction: column; /* the view-as banner, then the shell in what is left */
  background: var(--ground);
  color: var(--ink);
  font: var(--typography-ui);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1 { font: var(--typography-page-title); letter-spacing: -.015em; margin: 0 0 var(--spacing-3); }
p { margin: 0 0 var(--spacing-3); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--rounded-sm); }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
kbd {
  font: var(--typography-kbd); color: var(--ink-3); background: var(--surface-2);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: var(--rounded-xs);
  padding: 3px 5px; min-width: 20px; text-align: center; display: inline-block;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: var(--spacing-2); top: -48px; z-index: 10; padding: var(--spacing-2) var(--spacing-3);
  background: var(--surface); box-shadow: var(--shadow-2); border-radius: var(--rounded-sm); font: var(--typography-ui-strong); }
.skip:focus { top: var(--spacing-2); }
.lbl { font: var(--typography-label-caps); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 var(--spacing-2); }
.link { font: var(--typography-ui-strong); border-bottom: 1px solid var(--line-2); }
.link:hover { border-color: var(--ink); }

/* ---------- controls ---------- */
.button-primary {
  display: inline-flex; align-items: center; gap: var(--spacing-2); height: var(--spacing-control-height);
  padding: 0 var(--spacing-4); border: 0; border-radius: var(--rounded-sm);
  background: var(--ink); color: var(--surface); font: var(--typography-ui-strong);
}
.ghost {
  display: inline-flex; align-items: center; gap: 6px; height: var(--spacing-control-height-ghost);
  padding: 0 10px; border: 0; border-radius: var(--rounded-sm); background: var(--surface);
  box-shadow: var(--shadow-1); color: var(--ink-2); font-weight: 500;
}
.ghost:hover { color: var(--ink); }
.row-action {
  display: inline-flex; align-items: center; gap: var(--spacing-2); height: var(--spacing-control-height-row);
  padding: 0 10px; border: 0; border-radius: var(--rounded-sm); background: var(--surface);
  box-shadow: var(--shadow-1); color: var(--ink); font: var(--typography-meta); font-weight: 550; white-space: nowrap;
}
.row-action:hover { box-shadow: 0 0 0 1px var(--ink-3); }
.input {
  background: var(--surface); color: var(--ink); border: 1px solid var(--input-border);
  border-radius: var(--rounded-sm); padding: 4px 8px; font: var(--typography-ui);
}
.banner {
  padding: 10px var(--spacing-3); border-radius: var(--rounded-md); background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink-2); font: var(--typography-meta);
}
[role="alert"].banner { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }

/* ---------- tiles, connection dot ---------- */
.tile {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: var(--rounded-sm);
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-2);
  font: 700 12px/1 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}
.tile-lg { width: 36px; height: 36px; font-size: 14px; }
/* DESIGN.md › Connection dot: 6px green and silent while connected, 8px amber with a sentence when not. */
.cdot { display: inline-block; flex: none; border-radius: var(--rounded-full); vertical-align: middle; }
.cdot-ok { width: 6px; height: 6px; margin-left: 6px; background: var(--ok); }
.cdot-off { width: 8px; height: 8px; margin-right: var(--spacing-2); background: var(--warn); }
.disconnected { margin: 0 0 var(--spacing-4); color: var(--warn); font: var(--typography-ui); }

/* ---------- landing (invite, sign-in) ---------- */
.landing { flex: 1; display: flex; flex-direction: column; }
.l-top { display: flex; align-items: center; gap: 10px; padding: var(--spacing-4) var(--spacing-6); }
.l-top .ghost { margin-left: auto; }
.brand { display: flex; align-items: center; gap: 10px; font: var(--typography-section-title); font-size: 15px; }
.brand-mark { width: 28px; height: 28px; border-radius: var(--rounded-sm); background: var(--ink); color: var(--surface); display: grid; place-items: center; }
.l-body { flex: 1; display: flex; justify-content: center; padding: 40px var(--spacing-4) 56px; }
.l-card { width: 100%; max-width: 620px; }
.l-card h1 { font: var(--typography-hero-title); letter-spacing: -.02em; margin: 0 0 var(--spacing-2); }
.sub { font: var(--typography-pulse); color: var(--ink-2); margin: 0 0 var(--spacing-6); }
.foot-note { font: var(--typography-meta); color: var(--ink-3); margin-top: var(--spacing-4); }
.invite-steps { font: var(--typography-pulse); color: var(--ink-2); margin: 0 0 var(--spacing-6); padding-left: 1.4em; }
.invite-steps li + li { margin-top: var(--spacing-2); }

/* ---------- app shell ---------- */
.app { flex: 1; display: grid; grid-template-columns: var(--spacing-nav-width) minmax(0, 1fr); grid-template-rows: 1fr auto;
  grid-template-areas: "nav main" "foot main"; }
.nav { grid-area: nav; padding: var(--spacing-4) var(--spacing-3) 0; display: flex; flex-direction: column; gap: var(--spacing-1); border-right: 1px solid var(--line); }
.nav .brand { padding: var(--spacing-1) 10px var(--spacing-3); }
.nav .brand-mark { width: 24px; height: 24px; font-size: 12px; }
.reason {
  margin: 0; padding: var(--spacing-2) 10px; border-radius: var(--rounded-sm); background: var(--bad-tint);
  color: var(--bad); font: var(--typography-code); white-space: pre-wrap; word-break: break-word;
}
.chrome-error:empty { display: none; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; border-radius: var(--rounded-sm); background: transparent; color: var(--ink-2); font-weight: 500; text-align: left; }
.nav-item:hover { background: var(--surface); color: var(--ink); }
.nav-item[aria-current] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.nav-item .badge { margin-left: auto; }
/* The Today badge (DESIGN.md › Nav, Bottom tabs): the open cards, amber on its tint, hidden at 0 */
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--rounded-full);
  background: var(--warn-tint); color: var(--warn); font: var(--typography-tag); }
.badge[hidden] { display: none; }
/* The person menu (EXPERIENCE.md › Nav): avatar and name at the nav's foot, opening on click */
.person { grid-area: foot; position: relative; padding: var(--spacing-3); border-right: 1px solid var(--line); }
.person summary { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--rounded-sm); cursor: pointer;
  list-style: none; color: var(--ink-2); font-weight: 500; }
.person summary::-webkit-details-marker { display: none; }
.person summary:hover, .person[open] summary { background: var(--surface); color: var(--ink); }
.avatar { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: var(--rounded-full);
  background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); font: var(--typography-tag); }
.person-menu { position: absolute; left: var(--spacing-3); right: var(--spacing-3); bottom: calc(100% - var(--spacing-2)); display: flex;
  flex-direction: column; align-items: flex-start; gap: var(--spacing-3); padding: var(--spacing-3); border-radius: var(--rounded-lg);
  background: var(--surface); box-shadow: var(--shadow-3); }
.phone-only, .tabs { display: none; }
.theme { display: flex; align-items: center; gap: var(--spacing-2); font: var(--typography-meta); color: var(--ink-3); }
.main-col { grid-area: main; min-width: 0; display: flex; flex-direction: column; }
.main { padding: var(--spacing-main-padding-top) var(--spacing-main-padding-x) var(--spacing-7); min-width: 0; }
.pulse { font: var(--typography-pulse); color: var(--ink-2); max-width: var(--spacing-pulse-max); margin: 0 0 var(--spacing-5); }

/* ---------- inline error (Errors (render)) ---------- */
.action-failed {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-2); margin: 0 0 var(--spacing-3);
  padding: 10px var(--spacing-3); border-radius: var(--rounded-md); background: var(--bad-tint); color: var(--bad);
  font: var(--typography-meta);
}
.action-failed .row-action { margin-left: auto; }

/* ---------- rows, keys and actions ---------- */
.status:empty { display: none; }
.status {
  max-width: var(--spacing-pulse-max); padding: 10px var(--spacing-3); margin: 0 0 var(--spacing-4);
  border-radius: var(--rounded-md); background: var(--surface); box-shadow: var(--shadow-2); font: var(--typography-ui);
}
.n { font: var(--typography-tag); padding: 3px 7px; border-radius: var(--rounded-full); background: var(--surface-2);
  color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums; }
.group { background: var(--surface); border-radius: var(--rounded-lg); box-shadow: var(--shadow-2); margin-bottom: var(--spacing-4); overflow: hidden; }
.group-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px var(--spacing-4) 10px; }
.group-h h2 { font: var(--typography-section-title); margin: 0; }
.group-h p { margin: 0 0 0 auto; font: var(--typography-meta); color: var(--ink-3); }
.rows { list-style: none; margin: 0; padding: 0 6px 6px; }
.row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 6px var(--spacing-3);
  padding: 10px; border-radius: var(--rounded-md); }
.row + .row { box-shadow: 0 -1px 0 var(--line); }
.row:hover { background: var(--surface-2); }
.row:focus-within { background: var(--agent-tint); box-shadow: inset 3px 0 0 var(--agent); }
.row:focus-within + .row { box-shadow: none; }
.key { display: inline-flex; align-items: center; gap: 4px; width: max-content; min-height: 24px; padding: 0 7px; white-space: nowrap;
  border-radius: var(--rounded-chip); background: var(--surface); box-shadow: var(--shadow-1); color: var(--ink); font: var(--typography-key-chip); }
a.key:hover { box-shadow: 0 0 0 1px var(--ink-3); }
.key svg.i { width: 11px; height: 11px; color: var(--ink-3); }
.rmain { min-width: 0; }
.r-title { margin: 0; font-weight: 550; line-height: 1.3; }
.r-meta { margin: 0; font: var(--typography-meta); color: var(--ink-3); overflow-wrap: anywhere; }
.acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--spacing-2); }
.act { display: inline-flex; align-items: center; gap: var(--spacing-2); height: var(--spacing-control-height-row);
  padding: 0 6px 0 10px; border: 0; border-radius: var(--rounded-sm); background: var(--surface); box-shadow: var(--shadow-1);
  color: var(--ink); font: var(--typography-meta); font-weight: 550; white-space: nowrap; }
.act:hover { box-shadow: 0 0 0 1px var(--ink-3); }
.act-primary { background: var(--ink); color: var(--surface); box-shadow: none; }
.act[aria-disabled="true"] { cursor: not-allowed; background: var(--surface-2); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.row-error:empty { display: none; }
.row .row-error { grid-column: 2 / -1; }
.row-error .action-failed { margin: 0; }
/* Your Todo tasks: a row with no kind glyph, and the section's one-line notes. */
.row-todo { grid-template-columns: 72px minmax(0, 1fr) auto; }
.todo-note { padding: 0 var(--spacing-4) 14px; }
/* Inside a group or a panel nothing is a box of its own (DESIGN.md: flat sections inside one surface): rules divide */
.hires { display: flex; flex-direction: column; }
.hire { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.hire-h { margin: 0; font: var(--typography-section-title); overflow-wrap: anywhere; }
.hire p { margin: 0; color: var(--ink-2); }
.hire p b { color: var(--ink); font-weight: 600; }
.hire .keys { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--spacing-8) var(--spacing-4); }
.empty h2 { font: var(--typography-empty-title); letter-spacing: -.01em; margin: var(--spacing-4) 0 var(--spacing-2); }
.empty p { max-width: 460px; color: var(--ink-2); }

/* ---------- task story ---------- */
a.r-title { display: block; }
a.r-title:hover { text-decoration: underline; }
.crumbs { display: flex; align-items: center; gap: var(--spacing-2); margin: 0 0 var(--spacing-3); font: var(--typography-meta); color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
/* The task story (DESIGN.md › Layout: one column, header · next step · timeline). */
.story-head, .story-step, .story-tl { max-width: var(--spacing-pulse-max); margin-bottom: var(--spacing-5); }
.story-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--spacing-2); }
.story-head .crumbs { margin: 0; }
.story-head h1 { margin: 0; font: var(--typography-task-title); letter-spacing: -.015em; }
.story-head h1.from-comment { color: var(--ink-2); }
.story-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-2); margin: 0; font: var(--typography-meta); color: var(--ink-3); }
.story-state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-2); margin: 0; color: var(--ink-2); }
.story-step { display: flex; flex-direction: column; gap: var(--spacing-2); padding-bottom: var(--spacing-5); border-bottom: 1px solid var(--line); }
.story-next { margin: 0; color: var(--ink-2); }
.story-next:empty { display: none; }
.story-tl h2 { font: var(--typography-section-title); margin: 0 0 var(--spacing-3); }
.ambiguous { list-style: none; margin: 0 0 var(--spacing-4); padding: 0; display: flex; flex-direction: column; gap: var(--spacing-2); }
.story-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-3); margin: 0 0 var(--spacing-4); }
.story-top h1 { margin: 0; }
.story-top h1.from-comment { color: var(--ink-2); }
/* State Pill (DESIGN.md › state-pill-*): one word, its look by state; never the row's background. */
.state { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--spacing-2); border-radius: var(--rounded-full);
  font: var(--typography-tag); white-space: nowrap; }
.state-you { background: var(--warn-tint); color: var(--warn); }
.state-someone { background: var(--surface); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.state-stuck { background: var(--bad-tint); color: var(--bad); }
.state-working { background: var(--agent-tint); color: var(--agent); }
.state-done { background: var(--ok-tint); color: var(--ok); }
.state-parked { background: var(--surface-2); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.state .i { width: 12px; height: 12px; margin-right: 4px; flex: none; }
/* Task Row (DESIGN.md › Task Row): two lines on the ground, a hairline between rows, the whole row a link. */
.work-group { margin: 0 0 var(--spacing-5); }
.work-group h2 { display: flex; align-items: center; gap: var(--spacing-2); margin: 0 0 var(--spacing-1); font: var(--typography-section-title); }
.work-group h2 .n, .work-group h2 small { font: var(--typography-meta); color: var(--ink-3); }
.task-rows { list-style: none; margin: 0; padding: 0; }
.task-row + .task-row { border-top: 1px solid var(--line); }
.tr-link { display: flex; flex-direction: column; gap: 2px; padding: 10px var(--spacing-2); border-radius: var(--rounded-md);
  color: inherit; text-decoration: none; }
.tr-link:hover { background: var(--surface-2); }
.tr-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--spacing-3); }
.tr-top .r-title { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.tr-top .dupes { color: var(--ink-3); font-weight: 400; }
.tr-meta { font: var(--typography-meta); color: var(--ink-3); overflow-wrap: anywhere; }
.tr-meta .kc { font: var(--typography-key-chip); }
.tr-plan { padding: 0 var(--spacing-2) 10px; }
.tr-plan .tr-said { margin: 0 0 var(--spacing-2); font-size: 14px; overflow-wrap: anywhere; }
.tr-plan .card-foot { padding-top: 0; border-top: 0; }
.ws-chip { display: inline-block; padding: 0 6px; border-radius: var(--rounded-chip); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line); }
.filters .clear { align-self: center; font: var(--typography-meta); }
.r-status { margin: 2px 0 0; color: var(--ink-2); }
.r-title.from-comment { color: var(--ink-3); }
#story-actions { display: flex; flex-direction: column; gap: var(--spacing-3); }
.story-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-2); }
.none { color: var(--ink-2); margin: 0; }
.panel { background: var(--surface); border-radius: var(--rounded-lg); box-shadow: var(--shadow-2); padding: 18px var(--spacing-5); }
.panel-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-h h2 { font: var(--typography-section-title); margin: 0; }
.panel-h .r { margin-left: auto; font: var(--typography-meta); color: var(--ink-3); }
.chip { display: inline-flex; align-items: center; padding: 3px var(--spacing-2); border-radius: var(--rounded-chip);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font: var(--typography-meta); font-weight: 500; }
.tag { font: var(--typography-tag); padding: 4px 7px; border-radius: 6px; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: var(--spacing-3) 0 0; padding: 0; }
.verdicts { margin-top: var(--spacing-3); font: var(--typography-meta); color: var(--ink-2); }
.verdicts summary { cursor: pointer; }
.verdicts ul { margin: var(--spacing-2) 0 0; padding-left: var(--spacing-5); }
.card { margin: 0; padding-left: var(--spacing-3); border-left: 2px solid var(--line-2); }
.wrong-pick { display: flex; flex-direction: column; gap: var(--spacing-3); width: 100%; }
.wrong-pick[hidden] { display: none; }
.wrong-pick .lbl { margin: 0; }
.wp-who { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--spacing-2) var(--spacing-4); }
.wp-who legend, .wp-missing { font: var(--typography-ui-strong); color: var(--ink); padding: 0; margin-bottom: var(--spacing-2); }
.wp-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.wp-picks, .wp-acts { display: flex; flex-wrap: wrap; gap: var(--spacing-2); }
.wp-picks .chip { cursor: pointer; border: 0; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl > li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: var(--spacing-3); padding: 0 0 var(--spacing-4); position: relative; }
.tl > li:not(:last-child)::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.tl p { margin: 0; overflow-wrap: anywhere; }
.tl b { font-weight: 600; }
.tl time { font: var(--typography-meta); color: var(--ink-3); white-space: nowrap; }
.pt { width: 12px; height: 12px; border-radius: var(--rounded-full); background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-2); margin: 4px 2px 0; }
/* Timeline node looks (DESIGN.md › timeline-node-*): Syntat or an agent acted, a person acted, waits on a person, done,
   broken (red is Stuck only), and router chatter, smaller and grey. */
.pt-acted { box-shadow: inset 0 0 0 2px var(--agent); }
.pt-person { box-shadow: inset 0 0 0 2px var(--ink-3); } /* a person acted: no hue (DESIGN.md › Colors) */
.pt-waiting { background: var(--warn); box-shadow: none; }
.pt-done { background: var(--ok); box-shadow: none; }
.pt-broken { background: var(--bad); box-shadow: none; }
.pt-system { width: 8px; height: 8px; margin: 6px 4px 0; background: var(--line-2); box-shadow: none; }
.tl-body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--spacing-2); min-width: 0; }
.tl-system .tl-body p { color: var(--ink-3); }
.looked summary { cursor: pointer; font: var(--typography-meta); color: var(--ink-2); }
.others { list-style: none; margin: var(--spacing-2) 0 0; padding: 0 0 0 var(--spacing-3); }
.others li { color: var(--ink-2); padding: 2px 0; }
.others b { color: var(--ink); font-weight: 550; }
.raw { margin: var(--spacing-2) 0 0; color: var(--ink-2); font: var(--typography-code); white-space: pre-wrap; word-break: break-word; }

/* ---------- command palette ---------- */
.palette {
  width: min(640px, calc(100% - 32px)); margin: 88px auto auto; padding: 0; border: 0;
  border-radius: var(--rounded-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3);
}
.palette::backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
.p-in { display: flex; align-items: center; gap: 10px; padding: 14px var(--spacing-4); border-bottom: 1px solid var(--line); color: var(--ink-3); }
.p-in input { flex: 1; min-width: 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink); font: var(--typography-palette-input); outline: none; }
.p-in input:focus { border-bottom-color: var(--focus); }
.p-in input:focus-visible { outline: none; } /* the 2px focus-colour bottom rule is its focus indicator */
.p-body { list-style: none; margin: 0; padding: 0 6px 6px; max-height: 420px; overflow: auto; }
.p-lbl { margin: 0; padding: 16px 16px 6px; font: var(--typography-label-caps); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.p-item { display: flex; align-items: center; gap: var(--spacing-3); padding: var(--spacing-2) 10px; border-radius: 10px; cursor: pointer; font-weight: 550; }
.p-item .tile { width: 24px; height: 24px; font-size: 11px; border-radius: var(--rounded-chip); }
.p-item:hover { background: var(--surface-2); }
.p-item[aria-selected="true"] { background: var(--agent-tint); }
.p-item[hidden] { display: none; }
.p-empty { margin: 0; padding: 0 var(--spacing-4); color: var(--ink-3); }
.p-empty:not(:empty) { padding: var(--spacing-3) var(--spacing-4); }

/* ---------- `?` shortcut overlay (DESIGN.md › Shortcut overlay): the only place kbd caps render ---------- */
.kbd-overlay {
  width: min(520px, calc(100% - 32px)); margin: 88px auto auto; padding: var(--spacing-4); border: 0;
  border-radius: var(--rounded-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3);
}
.kbd-overlay::backdrop { background: var(--scrim); }
.keys-h { display: flex; align-items: center; gap: var(--spacing-3); margin: 0 0 var(--spacing-3); }
.keys-h h2 { margin: 0; font: var(--typography-section-title); }
.keys-h form { margin-left: auto; }
.keys-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--spacing-2) var(--spacing-4); margin: 0; align-items: center; }
.keys-list dt { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.keys-list dd { margin: 0; color: var(--ink-2); }

/* ---------- Team ---------- */
.team-group { margin-bottom: var(--spacing-6); }
.grp-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 var(--spacing-3); }
.grp-h h2 { font: var(--typography-section-title); margin: 0; }
.grp-h p { margin: 0 0 0 auto; font: var(--typography-meta); color: var(--ink-3); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--spacing-3); margin-bottom: var(--spacing-3); }
.mc { display: flex; flex-direction: column; gap: 10px; padding: var(--spacing-4); border-radius: var(--rounded-lg);
  background: var(--surface); box-shadow: var(--shadow-2); min-width: 0; }
.mc-wide { grid-column: 1 / -1; }
.mc-h { display: flex; align-items: center; gap: var(--spacing-3); }
.mc-h small { display: block; font: var(--typography-meta); color: var(--ink-3); }
.mc-name { margin: 0; font: var(--typography-ui-strong); font-size: 14px; overflow-wrap: anywhere; }
.av { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: var(--rounded-md);
  font: var(--typography-tag); }
.av-agent { background: var(--agent-tint); color: var(--agent); }
.av-person { background: var(--surface-2); color: var(--ink-2); }
.mc .lbl { margin: 0; }
.cap { margin: 0; color: var(--ink-2); max-width: 64ch; }
.facts-line { margin: 0; font: var(--typography-meta); color: var(--ink-2); }
.mc .keys { display: flex; flex-wrap: wrap; gap: 6px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--spacing-5); }
.split > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--spacing-2) var(--spacing-3); margin: 0;
  font: var(--typography-meta); }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: var(--rounded-chip);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font: var(--typography-meta); }
.ctl { margin: 0; }
.ctl-row { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-3); }
.ctl-row .t { display: block; font-weight: 550; }
.ctl-row .d { display: block; font: var(--typography-meta); color: var(--ink-3); }
.tg-wrap { display: inline-flex; align-items: center; gap: 6px; font: var(--typography-meta); font-weight: 550; }
.tg { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
/* Switch (DESIGN.md › Switch): a track and a knob, not a checkbox */
.tg[role="switch"] { appearance: none; position: relative; flex: none; width: 32px; height: 18px; border-radius: var(--rounded-full);
  background: var(--line-2); cursor: pointer; transition: background .15s; }
.tg[role="switch"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: var(--rounded-full); background: var(--surface); box-shadow: var(--shadow-1); transition: transform .15s; }
.tg[role="switch"]:checked { background: var(--ink); }
.tg[role="switch"]:checked::after { transform: translateX(14px); }
.tg[role="switch"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ladder { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--spacing-2); }
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border-radius: var(--rounded-sm); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line); width: max-content; max-width: 100%; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { padding: 5px 10px; border-radius: var(--rounded-xs); font: var(--typography-meta); font-weight: 550; color: var(--ink-2); cursor: pointer; }
.seg input:checked + label { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 1px; }
.note { margin: 0; font: var(--typography-meta); color: var(--ink-3); }
#paused-banner:empty { display: none; }
#paused-banner { margin: 0 0 var(--spacing-4); }
.banner-paused { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); margin: 0; }
.edit-cap { align-self: flex-start; }

/* ---------- Sites & accounts ---------- */
a[aria-disabled="true"] { cursor: not-allowed; opacity: .6; }
.button-primary[aria-disabled="true"], .row-action[aria-disabled="true"] { cursor: not-allowed; background: var(--surface-2);
  color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-2); }
input[aria-disabled="true"], textarea[aria-disabled="true"], input[aria-disabled="true"] + label { cursor: not-allowed; opacity: .7; }
.sites { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--spacing-4); align-items: start; }
.sites-col { display: flex; flex-direction: column; gap: var(--spacing-4); min-width: 0; }
a.button-primary { text-decoration: none; }
.site-add { display: flex; flex-direction: column; gap: 6px; margin: 0 0 var(--spacing-4); }
.site-add-row { display: flex; flex-wrap: wrap; gap: var(--spacing-2); }
.site-add .input { flex: 1; min-width: 12ch; font: var(--typography-code); }
.approved-sites-table { width: 100%; border-collapse: collapse; font: var(--typography-meta); }
.approved-sites-table th, .approved-sites-table td { padding: 9px 6px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
.approved-sites-table thead th { font: var(--typography-label-caps); letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3); border-top: 0; }
.approved-sites-table .host { font: var(--typography-ui-strong); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink-2); overflow-wrap: anywhere; }
.approved-sites-table td:last-child { text-align: right; }
.logins { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--spacing-3); }
.login-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.login-line { margin: 0 0 var(--spacing-3); color: var(--ink-2); }
.record { margin: 0 0 var(--spacing-3); color: var(--ink-2); }

/* ---------- side panel: capability replay ---------- */
.railed { display: grid; grid-template-columns: minmax(0, 1fr) var(--spacing-rail-width-wide); gap: var(--spacing-5); align-items: start; }
.railed > div { min-width: 0; }
.side-panel {
  position: sticky; top: var(--spacing-4); padding: var(--spacing-5); border-radius: var(--rounded-lg);
  border-left: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-1); min-width: 0;
}
.panel-body { display: flex; flex-direction: column; align-items: stretch; gap: var(--spacing-3); }
.panel-body > .chip { align-self: flex-start; }
.panel-title { font: var(--typography-panel-title); margin: 0; }
.panel-body .lbl, .panel-body .note, .panel-body .card { margin: 0; }
.panel-acts { display: flex; flex-direction: column; gap: var(--spacing-2); }
.panel-acts .button-primary { justify-content: space-between; }
.button-primary kbd { background: transparent; color: inherit; opacity: .75; border-color: color-mix(in srgb, var(--surface) 35%, transparent); }
.replay { display: flex; flex-direction: column; gap: var(--spacing-2); }
.hire-list, .chg { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hire-list li { color: var(--ink-2); }
.hire-list b { display: block; color: var(--ink); font-weight: 600; }
.impact { margin: 0; font: var(--typography-ui); color: var(--ink-2); }
.impact b { font: var(--typography-kpi); color: var(--ink); margin-right: 4px; }
.chg li { display: flex; flex-direction: column; gap: 4px; padding: var(--spacing-2) 0; border-top: 1px solid var(--line); }
.chg li:first-child { border-top: 0; }
.fromto { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: var(--typography-ui-strong); }
.from { color: var(--ink-3); text-decoration: line-through; }
.to { color: var(--ink); }
.wy { font: var(--typography-meta); color: var(--ink-3); overflow-wrap: anywhere; }
.replay .keys { display: flex; flex-wrap: wrap; gap: 6px; }
.replay-failed { margin: 0; font: var(--typography-meta); color: var(--bad); overflow-wrap: anywhere; }
.banner-unsaved { background: var(--agent-tint); border-color: transparent; color: var(--agent); margin: 0 0 var(--spacing-4); }
.banner-unsaved[hidden] { display: none; }
.form-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--spacing-4); align-items: start; }
.form-row + .form-row { border-top: 1px solid var(--line); padding-top: var(--spacing-3); }
.fl { font: var(--typography-ui-strong); }
.fl small { display: block; font: var(--typography-meta); color: var(--ink-3); font-weight: 400; }
.cap-edit { width: 100%; resize: vertical; line-height: 1.5; }

/* ---------- support banner (AD-14; DESIGN.md › Support banner): neutral, it waits on no one ---------- */
.support-banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-2) var(--spacing-3);
  padding: var(--spacing-2) var(--spacing-main-padding-x); background: var(--surface); color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--line); font: var(--typography-ui); font-weight: 600; }
.support-banner p { margin: 0; }
.support-banner b { font-weight: 700; }
.support-banner .ghost { margin-left: auto; }

/* ---------- Support ---------- */
.l-top .nav-item { margin-left: var(--spacing-3); }
.support-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--spacing-2) var(--spacing-3); margin-bottom: var(--spacing-3); }
.support-h h1 { margin: 0; }
.switch-row { display: inline-flex; align-items: center; gap: var(--spacing-2); min-height: 44px; cursor: pointer; font: var(--typography-meta); color: var(--ink-2); }
.switch-n { color: var(--ink-3); }
.outage { margin: 0 0 var(--spacing-5); padding: 10px var(--spacing-3); border-radius: var(--rounded-md);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font: var(--typography-ui); }
details.fleet-group summary { cursor: pointer; font: var(--typography-section-title); }
details.fleet-group[open] summary { margin-bottom: var(--spacing-3); }
.fleet-group { margin-bottom: var(--spacing-5); }
.fleet-group .panel-h h2 { font: var(--typography-section-title); }
/* The Support table (DESIGN.md › Support table row): a tbody per workspace, its row and its details. */
.sup-table thead button { all: unset; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.sup-table thead button:hover { color: var(--ink); }
.sup-table thead button:focus-visible { outline: 2px solid var(--agent); outline-offset: 2px; border-radius: 4px; }
.sup-table th[aria-sort="ascending"] button::after { content: " ↑"; }
.sup-table th[aria-sort="descending"] button::after { content: " ↓"; }
.sup-table tbody th { overflow-wrap: anywhere; }
.sup-table .sup-more td { border-top: 0; padding-top: 0; }
.sup-table .needs-l { display: none; }
.sup-more summary { cursor: pointer; color: var(--ink-3); width: fit-content; }
.sup-more details[open] summary { margin-bottom: var(--spacing-2); }
.sup-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--spacing-2); margin: 0 0 var(--spacing-2); color: var(--ink-2); }
.sup-dl { display: none; margin: 0 0 var(--spacing-2); }
.sup-dl div { display: flex; justify-content: space-between; gap: var(--spacing-3); padding: 4px 0; }
.sup-dl dt { color: var(--ink-3); }
.sup-dl dd { margin: 0; color: var(--ink); text-align: right; }
.sup-acts { text-align: right; white-space: nowrap; }
.sup-acts .row-action { margin-right: var(--spacing-3); }
.sup-acts .view-as { display: inline-flex; vertical-align: middle; }
.hw { display: inline-flex; align-items: center; gap: 4px; font-weight: 550; white-space: nowrap; color: var(--ink-2); }
.hw .i { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.hw-broken { color: var(--bad); }
.hw-disconnected, .hw-not-ready { color: var(--warn); }
.hw-healthy { color: var(--ok); }
.hw-quiet { color: var(--ink-3); }
.hw-fix { display: block; color: var(--ink-3); }
.sup-list { list-style: none; margin: 0; padding: 0; }
.sup-item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-2) var(--spacing-3); padding: var(--spacing-3) 0; border-top: 1px solid var(--line); }
.sup-item:first-child { border-top: 0; padding-top: 0; }
.sup-item .grow { flex: 1 1 240px; min-width: 0; }
.sup-item .count { min-width: 40px; font: var(--typography-section-title); }
.sup-what { font-weight: 550; overflow-wrap: anywhere; }
.sup-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font: var(--typography-meta); color: var(--ink-3); }
.sup-item .requested { margin-left: 0; }
.sup-meta[data-raw-causes] { flex-direction: column; align-items: flex-start; }
.dash { color: var(--ink-3); }
/* Support › Release replay (V-114): a case per panel, its email newest first, then each task's thread. */
.rp-case { margin-bottom: var(--spacing-5); }
.rp-case .panel-h h2 { overflow-wrap: anywhere; }
.rp-h { font: var(--typography-ui-strong); margin: var(--spacing-3) 0 var(--spacing-2); }
.rp-digest, .rp-entries { margin: 0 0 var(--spacing-3); padding-left: var(--spacing-5); color: var(--ink-2); overflow-wrap: anywhere; }
.rp-digest li, .rp-entries li { padding: 2px 0; }
.rp-entries li { white-space: pre-wrap; }
.rp-ping { color: var(--ink); font-weight: 550; }
.rp-thread summary { cursor: pointer; color: var(--ink-2); padding: var(--spacing-2) 0; overflow-wrap: anywhere; }
.spark-cell { display: inline-flex; align-items: flex-end; gap: var(--spacing-2); }
.spark-cell .spark { width: 72px; height: 24px; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 40px; }
.spark i { flex: 1; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--agent); }
.spark i.z { height: 2px; background: var(--line-2); }
.spark-l { margin: 0; font: var(--typography-meta); color: var(--ink-3); }
.view-as { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: var(--spacing-control-height-row);
  padding: 0 10px; border: 0; border-radius: var(--rounded-sm); background: var(--surface-2); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line-2); font: var(--typography-meta); font-weight: 550; } /* neutral: support mode waits on no one */
.view-as:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); }
.tbl { overflow-x: auto; }
.fleet-table { width: 100%; border-collapse: collapse; font: var(--typography-meta); }
.fleet-table th, .fleet-table td { padding: 9px 6px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
.fleet-table thead th { font: var(--typography-label-caps); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); border-top: 0; }
.fleet-table tbody th { font-weight: 550; color: var(--ink); }
.fleet-table tfoot th, .fleet-table tfoot td { font-weight: 650; color: var(--ink); border-top: 2px solid var(--line-2); }
/* a numeric cell, not the `.n` count badge: no fill, no ring */
.fleet-table .n { text-align: right; padding: 9px 6px; border-radius: 0; background: none; box-shadow: none; font: inherit; }
.fleet-table thead th { white-space: nowrap; }
.cause { font: var(--typography-code); color: var(--bad); overflow-wrap: anywhere; }
.dm-stats { margin: 0; font: var(--typography-meta); color: var(--ink-2); }
.hire .keys { align-items: center; }

/* ---------- setup banner (CAP-15) ---------- */
.row-action-primary { background: var(--ink); color: var(--surface); box-shadow: none; }
.setup-banner { list-style: none; max-width: var(--spacing-pulse-max); margin: 0 0 var(--spacing-4); padding: 10px var(--spacing-3);
  border-radius: var(--rounded-md); background: var(--warn-tint); box-shadow: inset 0 0 0 1px var(--warn-line); color: var(--warn); }
.setup-banner li + li { margin-top: 4px; }
.setup-banner .link { color: inherit; font-weight: 550; text-decoration: underline; }

/* ---------- Work filters, Settings ---------- */
/* Filter chips (EXPERIENCE.md › Filter chip): links, the current one filled */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--spacing-4); }
.fchip { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border-radius: var(--rounded-chip);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font: var(--typography-meta);
  text-decoration: none; }
.fchip:hover { color: var(--ink); }
.fchip[aria-current] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 550; }
.settings { display: flex; flex-direction: column; gap: var(--spacing-4); max-width: 760px; }
.settings .facts { font: var(--typography-ui); }
.settings .facts dd { align-items: center; }
.settings .reason { flex: 1; }


/* ---------- Today (UX rescue Cut 2): one column, top line, Decision Cards, Workspace Strips ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--spacing-2) var(--spacing-3);
  margin: 0 0 var(--spacing-3); }
.page-head h1 { margin: 0; }
.today-top, .dcards, .strips-block, .passed-block { max-width: var(--spacing-pulse-max); }
/* The workspace chip (DESIGN.md › Workspace chip) with its connection dot */
.wschip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border: 0; border-radius: var(--rounded-chip);
  background: var(--surface); box-shadow: var(--shadow-1); color: var(--ink-2); font: var(--typography-ui-strong); }
button.wschip:hover { color: var(--ink); }
.wschip .cdot-ok, .wschip .cdot-off { margin: 0; }
/* Stat (DESIGN.md › Stat): one sentence, its numbers larger and linked */
.topline { margin: 0 0 var(--spacing-4); }
.stat { margin: 0; font: var(--typography-pulse); color: var(--ink-2); }
.stat a { color: var(--ink); border-bottom: 1px solid var(--ink-3); }
.stat a b { font: var(--typography-kpi); }
.empty-title { font: var(--typography-empty-title); letter-spacing: -.01em; margin: 0 0 var(--spacing-2); }
.sec { display: flex; align-items: center; gap: var(--spacing-2); margin: 0 0 var(--spacing-3); font: var(--typography-section-title); }
.sec .n { font: var(--typography-meta); color: var(--ink-3); }
.sec small { font: var(--typography-meta); color: var(--ink-3); }
/* Decision Card (DESIGN.md › Decision Card): the one card level, no box inside it */
.dcard { margin: 0 0 var(--spacing-3); padding: var(--spacing-4); border-radius: var(--rounded-lg); background: var(--surface); box-shadow: var(--shadow-2); }
.dcard:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.card-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--spacing-3); }
.dcause { width: 8px; height: 8px; flex: none; align-self: center; border-radius: var(--rounded-full); background: var(--warn); }
.card-top h3 { flex: 1; min-width: 0; margin: 0; font: var(--typography-ui-strong); font-size: 14px; overflow-wrap: anywhere; }
.card-top h3 a:hover { text-decoration: underline; }
.dup { color: var(--ink-3); font-weight: 400; }
.blast { margin-left: auto; font: var(--typography-ui-strong); color: var(--warn); white-space: nowrap; }
.dwhy { margin: var(--spacing-2) 0; font: var(--typography-pulse); color: var(--ink-2); }
.card-tasks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 var(--spacing-3); }
.card-tasks .key { min-height: 22px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--rounded-xs); }
.desc { font: var(--typography-meta); color: var(--ink-3); }
.frozen { list-style: none; margin: 0; padding: 0; }
.frozen .btn { margin-left: auto; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-2) var(--spacing-3); padding-top: var(--spacing-3); border-top: 1px solid var(--line); }
.card-acts { display: flex; flex-wrap: wrap; gap: var(--spacing-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; height: var(--spacing-control-height-row); padding: 0 var(--spacing-3);
  border: 0; border-radius: var(--rounded-sm); font: var(--typography-meta); font-weight: 550; white-space: nowrap; }
.btn-primary { background: var(--ink); color: var(--surface); }
.btn-row { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
a.btn:hover { box-shadow: 0 0 0 1px var(--ink-3); }
.btn[aria-disabled="true"] { cursor: not-allowed; }
.btn-row[aria-disabled="true"] { color: var(--ink-2); }
.default { margin: 0 0 0 auto; font: var(--typography-meta); color: var(--ink-3); }
.card-error:empty { display: none; }
/* Workspace Strip and quiet fold (DESIGN.md › Workspace Strip): lines on the ground, hairlines between */
.strips { list-style: none; margin: 0; padding: 0; }
.strips li { display: flex; align-items: center; }
.strips li + li, .quiet-fold { border-top: 1px solid var(--line); }
.ws-strip, .quiet-fold summary { display: grid; grid-template-columns: 8px minmax(0, max-content) minmax(0, 1fr) auto 16px; align-items: center;
  gap: var(--spacing-3); min-height: 44px; padding: 6px var(--spacing-2); border-radius: var(--rounded-md); }
.ws-strip:hover, .quiet-fold summary:hover { background: var(--surface-2); }
.sdot { width: 8px; height: 8px; border-radius: var(--rounded-full); background: var(--ink-3); }
.sdot-broken { background: var(--bad); }
.sdot-waiting { background: var(--warn); }
.sdot-acted { background: var(--agent); }
.sname { font: var(--typography-ui-strong); overflow-wrap: anywhere; }
.shead { color: var(--ink-2); min-width: 0; }
.smove { display: block; font: var(--typography-meta); color: var(--ink-3); }
.snext { font: var(--typography-meta); color: var(--ink-3); white-space: nowrap; }
.chev { color: var(--ink-3); grid-column: 5; }
.ws-strip { flex: 1; min-width: 0; }
.strip-linear { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 var(--spacing-2);
  border-radius: var(--rounded-md); font: var(--typography-meta); color: var(--ink-3); white-space: nowrap; }
.strip-linear:hover { background: var(--surface-2); color: var(--ink); }
.strip-linear svg.i { width: 11px; height: 11px; }
.quiet-fold summary { list-style: none; cursor: pointer; color: var(--ink-3); }
.quiet-fold summary::-webkit-details-marker { display: none; }
.q-line { color: var(--ink-2); font-weight: 550; white-space: nowrap; }
.q-names { font: var(--typography-meta); min-width: 0; overflow-wrap: anywhere; grid-column: 3 / 5; }
.quiet-fold[open] summary .chev { transform: rotate(90deg); }
.quiet-fold .strips { padding-left: var(--spacing-4); }
/* The workspace picker (DESIGN.md › Bottom sheet): an anchored popover on a desktop, a bottom sheet on a phone */
.ws-picker { width: 300px; max-height: min(70vh, 520px); margin: 0; padding: var(--spacing-2); border: 0; border-radius: var(--rounded-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); position: fixed; top: var(--picker-top, 80px);
  left: var(--picker-left, auto); overflow: auto; }
.ws-picker::backdrop { background: transparent; }
.ws-picker h2 { margin: var(--spacing-1) var(--spacing-2) var(--spacing-2); font: var(--typography-section-title); }
.ws-picker .grab { display: none; }
.picks { list-style: none; margin: 0; padding: 0; }
.pick { display: flex; align-items: center; gap: var(--spacing-2); min-height: 36px; padding: 6px 10px; border-radius: var(--rounded-sm); }
.pick:hover { background: var(--surface-2); }
.pick[aria-current] { font-weight: 600; }
.pick-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pick-quiet { color: var(--ink-3); }
.pick .check { color: var(--ink); }
.picks-lbl { margin: var(--spacing-2) 10px var(--spacing-1); font: var(--typography-label-caps); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
/* Toast (DESIGN.md › Toast): inverted, bottom-center of main, above the tabs on a phone; empty until an answer */
.toast { position: fixed; left: 50%; bottom: var(--spacing-6); transform: translateX(-50%); z-index: 20; max-width: min(560px, calc(100% - 32px));
  padding: 10px var(--spacing-4); border-radius: var(--rounded-md); background: var(--ink); color: var(--surface); box-shadow: var(--shadow-3); }
.toast:empty { display: none; }
.toast-said { margin: 0; }
.toast-undo { margin-left: var(--spacing-2); padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600;
  text-decoration: underline; cursor: pointer; }
.toast-undo:focus-visible, .toast a:focus-visible { outline: 2px solid var(--focus-inverse); outline-offset: 2px; }
.toast .action-failed { margin: 0; background: none; color: inherit; }
/* An answer on its way: its button disabled and spinning within 100 ms (EXPERIENCE.md › Decision Card) */
.btn[disabled], .toast-undo[disabled] { cursor: progress; opacity: .7; }
.btn.htmx-request::after { content: ""; width: 10px; height: 10px; margin-left: 6px; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: var(--rounded-full); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.htmx-request::after { animation: none; } }
.dcard-answered p { margin: 0; color: var(--ink-2); }
.dcard-answered .toast-undo { color: var(--ink); }
.requested { margin-left: var(--spacing-2); font: var(--typography-meta); font-weight: 600; color: var(--ok); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  /* compact (EXPERIENCE.md › Responsive): the nav as icons, each name in its tooltip */
  .app { grid-template-columns: 64px minmax(0, 1fr); }
  .nav { padding-inline: var(--spacing-2); align-items: center; }
  .nav-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav .brand { padding-inline: 0; }
  .nav-item { position: relative; justify-content: center; padding: 8px; }
  .nav-item .badge { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; }
  .person { padding-inline: var(--spacing-2); }
  .person summary { justify-content: center; padding: 6px; }
  .person-menu { right: auto; width: 220px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .railed, .sites { grid-template-columns: minmax(0, 1fr); }
  .side-panel { position: static; }
}
@media (max-width: 760px) {
  /* phone (DESIGN.md › Layout & Spacing): no side nav; the bottom tabs, and the person menu at the page's end */
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; grid-template-areas: "main" "foot";
    padding-bottom: calc(var(--spacing-bottom-tabs-height) + env(safe-area-inset-bottom)); }
  .nav { display: none; }
  .person { border-right: 0; border-top: 1px solid var(--line); padding: var(--spacing-3) var(--spacing-main-padding-x-mobile); }
  .person summary { justify-content: flex-start; min-height: var(--spacing-target-min-touch); }
  .person .nav-word { position: static; width: auto; height: auto; clip: auto; }
  .person-menu { left: var(--spacing-main-padding-x-mobile); right: var(--spacing-main-padding-x-mobile); width: auto; }
  .phone-only { display: inline-flex; align-items: center; min-height: var(--spacing-target-min-touch); }
  .tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    height: calc(var(--spacing-bottom-tabs-height) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); box-shadow: 0 -1px 0 var(--line); }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: var(--spacing-target-min-touch); color: var(--ink-3); font: var(--typography-meta); font-weight: 550; }
  .tab[aria-current] { color: var(--ink); }
  .tab .badge { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 4px; }
  .toast { bottom: calc(var(--spacing-bottom-tabs-height) + var(--spacing-3) + env(safe-area-inset-bottom)); }
  .ws-picker { width: 100%; max-width: 100%; max-height: 80vh; top: auto; bottom: 0; left: 0; right: 0;
    border-radius: var(--rounded-lg) var(--rounded-lg) 0 0; padding-bottom: calc(var(--spacing-3) + env(safe-area-inset-bottom)); }
  .ws-picker::backdrop { background: var(--scrim); }
  .ws-picker .grab { display: block; width: 36px; height: 4px; margin: 2px auto var(--spacing-2); border-radius: var(--rounded-full); background: var(--line-2); }
  .pick, .wschip { min-height: var(--spacing-target-min-touch); }
  .card-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .card-acts .btn { min-height: var(--spacing-target-min-touch); white-space: normal; text-align: center; }
  /* the primary, always first, and an odd one out after it span both columns */
  .card-acts .btn-primary, .card-acts .btn:last-child:nth-child(even) { grid-column: 1 / -1; }
  .blast { margin-left: 0; flex-basis: 100%; white-space: normal; }
  .default { margin-left: 0; }
  .ws-strip, .quiet-fold summary { grid-template-columns: 8px minmax(0, 1fr) auto 16px; row-gap: 2px; }
  .ws-strip .shead { grid-column: 2 / 4; grid-row: 2; }
  .ws-strip .chev, .quiet-fold .chev { grid-column: 4; grid-row: 1; }
  .quiet-fold .q-names { grid-column: 2 / 4; grid-row: 2; }
  .main { padding: var(--spacing-main-padding-top-mobile) var(--spacing-main-padding-x-mobile); }
  .l-top { padding: var(--spacing-3) var(--spacing-4); }
  .l-card h1 { font: var(--typography-page-title); }
  .ghost, .row-action, .nav-item { min-height: var(--spacing-target-min-touch); }
  .row { grid-template-columns: 20px minmax(0, 1fr); grid-template-areas: "kind main" "kind acts"; }
  .row-todo { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "key acts" "main main"; }
  .row .kind { grid-area: kind; align-self: start; }
  .row-todo > .key { grid-area: key; }
  .row .acts { grid-area: acts; justify-content: flex-start; }
  .row-todo .acts { justify-content: flex-end; }
  .row .rmain { grid-area: main; }
  .row-todo .row-error { grid-column: 1 / -1; }
  .act { min-height: var(--spacing-target-min-touch); }
  a.key { position: relative; }
  a.key::after { content: ""; position: absolute; inset: -10px -2px; } /* a 44px tap target around a text-high chip */
  .cards { grid-template-columns: minmax(0, 1fr); }
  .seg label { min-height: var(--spacing-target-min-touch); display: inline-flex; align-items: center; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: var(--spacing-2); }
  .button-primary { min-height: var(--spacing-target-min-touch); }
  .support-banner { padding: var(--spacing-2) var(--spacing-main-padding-x-mobile); }
  .view-as { min-height: var(--spacing-target-min-touch); }
  .approved-sites-table thead { display: none; }
  .approved-sites-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--line); padding: var(--spacing-2) 0; }
  .approved-sites-table th, .approved-sites-table td { border-top: 0; padding: 2px 6px; grid-column: 1; }
  .approved-sites-table td:last-child { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  /* Support's tables as stacked rows (EXPERIENCE.md › Responsive): each cell under its row's title, named by its column */
  .fleet-table thead { display: none; }
  .fleet-table tr { display: block; border-top: 1px solid var(--line); padding: var(--spacing-2) 0; }
  .fleet-table th, .fleet-table td, .fleet-table tfoot th, .fleet-table tfoot td { display: flex; justify-content: space-between;
    gap: var(--spacing-3); border-top: 0; padding: 2px 0; text-align: left; overflow-wrap: anywhere; }
  .fleet-table td[data-label]::before { content: attr(data-label); color: var(--ink-3); }
  .fleet-table tfoot tr { border-top: 2px solid var(--line-2); }
  /* the Support table: a row is its workspace, health word and needs-you count; its details list the rest */
  .sup-table .sup-row .wide { display: none; }
  .sup-table .sup-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--spacing-3); padding-bottom: 0; }
  .sup-table .sup-row th { flex: 1 1 100%; }
  .sup-table .sup-row td { display: block; }
  .sup-table .needs-l { display: inline; color: var(--ink-3); }
  .sup-table .sup-acts { flex: 1 1 100%; text-align: left; white-space: normal; }
  .sup-table .sup-more { border-top: 0; padding-top: 0; }
  .sup-table .sup-more td { display: block; }
  .sup-more summary { min-height: var(--spacing-target-min-touch); display: flex; align-items: center; }
  .sup-dl { display: block; }
  .act-row { grid-template-columns: 16px auto minmax(0, 1fr); row-gap: 4px; }
  .act-row .act-main { grid-column: 2 / -1; }
  .fchip, .pager .ghost, .tr-link { min-height: var(--spacing-target-min-touch); }
  .tr-top { flex-wrap: wrap; }
  .settings .facts { grid-template-columns: minmax(0, 1fr); }
  .settings .facts dd { margin-bottom: var(--spacing-2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Rules (EXPERIENCE.md › Rule row): one line per rule, its value, and "Change" opening the choice in place. */
.rules { display: grid; gap: var(--spacing-4); margin-bottom: var(--spacing-4); }
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--spacing-3); }
.rule { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--spacing-2) var(--spacing-3); min-width: 0; }
.rule-value { font-weight: 600; color: var(--ink); }
.rule-change > summary { cursor: pointer; list-style: none; }
.rule-change > summary::-webkit-details-marker { display: none; }
.rule-change[open] { flex: 1 1 100%; min-width: 0; }
.rule-change[open] > form { margin-top: var(--spacing-2); }
.rule-change:not([open]) > form { display: none; }
.rule-change .seg { max-width: 100%; }
.rule .row-error:empty { display: none; }

/* Today: the questions people asked the viewer (V-118) */
.asked { margin: var(--spacing-5) 0 var(--spacing-6); }
.asked-h { display: flex; align-items: baseline; gap: var(--spacing-2); margin: 0 0 4px; font: var(--typography-section-title); }
.asked-h .n { font: var(--typography-meta); color: var(--ink-3); }
.asked-note { margin: 0 0 var(--spacing-3); font: var(--typography-meta); color: var(--ink-3); }
.mlist { list-style: none; margin: 0; padding: 0; border-radius: var(--rounded-lg); background: var(--surface); box-shadow: var(--shadow-2); }
.mrow { padding: var(--spacing-4); }
.mrow + .mrow { border-top: 1px solid var(--line); }
.mtop { display: flex; align-items: baseline; gap: var(--spacing-2); }
.mwho { flex: 1; min-width: 0; margin: 0; font: var(--typography-ui); color: var(--ink-2); }
.mwho b { font: var(--typography-ui-strong); color: var(--ink); }
.mwho a { color: var(--ink); border-bottom: 1px solid var(--line-2); }
.mwait { font: var(--typography-meta); color: var(--ink-3); white-space: nowrap; }
.mwait-long { color: var(--warn); font-weight: 600; }
.asked-sent { margin: 0 0 var(--spacing-3); font: var(--typography-meta); color: var(--ink-2); }
.mreply { margin-top: var(--spacing-2); }
.mreply summary { cursor: pointer; font: var(--typography-meta); color: var(--ink-2); }
.mreply textarea { display: block; width: 100%; margin: var(--spacing-2) 0; font: var(--typography-pulse); }
.mreply .mmeta { margin: 0 0 var(--spacing-2); font: var(--typography-meta); color: var(--ink-3); }
.mq { margin: 6px 0 0; font: var(--typography-pulse); color: var(--ink); }

/* Passed on for you (V-125): read-only rows, quiet because nothing waits on the viewer. */
.passed { list-style: none; margin: 0; padding: 0; }
.passed li { padding: var(--spacing-2) 0; border-top: 1px solid var(--line, var(--surface-2)); }
.passed .p-idea { display: block; color: var(--ink); }
.passed .p-meta { display: block; font: var(--typography-meta); color: var(--ink-3); }
