/* Nubivola app screens. Style: framed sheet & structured cards from the v0 design system (t732/t733/t806).
   Face: cool-tinted neutral ground with deep teal/cyan brand accent; figures and ids in Geist Mono / IBM Plex Mono.
   Signature element: the plan meter (usage, the stop line, the next change of the stop level).
   Grid: canvas 24px padding; 12 columns, 24px gutter; blocks span 8 + 4 (sum 12) so cards land on both edges. */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap");

:root {
  --ground: #f9fafa; --background: var(--ground);
  --surface: #ffffff; --card: var(--surface); --popover: var(--surface);
  --raised: #f1f4f5; --secondary: var(--raised); --muted-surface: var(--raised);
  --active: #e4ebee;
  --border: #e1e7ea;
  --rule: #ebeef0;
  --control: #c8d3d8;
  --text: #0d1417; --foreground: var(--text); --ink: var(--text);
  --muted: #55636b; --muted-foreground: var(--muted);
  --accent: #1b6c80; --accent-hover: #155565;
  --primary: #1b6c80; --primary-ink: #ffffff; --primary-foreground: var(--primary-ink);
  --tint: rgba(27, 108, 128, 0.08);
  --terminal: #0c1417; --terminal-ink: #e9eff1;
  --positive: #157f4b;
  --negative: #b42318;
  --warning: #b45309;
  /* Fills (bars, status dots): --warning is text-dark and reads as red on a fill. */
  --warning-fill: #f59e0b;
  --chart-1: #1b6c80;
  --chart-2: #2f70bb;
  --chart-3: #b45309;
  --chart-muted: #c8d3d8;
  --pill-positive-bg: #dcfce7; --pill-positive-ink: #064e3b;
  --pill-negative-bg: #fee2e2; --pill-negative-ink: #7f1d1d;
  --pill-warning-bg: #fef3c7; --pill-warning-ink: #92400e;
  --pill-neutral-bg: #eaeff2; --pill-neutral-ink: #273339;
  --pill-info-bg: #e0f1f5; --pill-info-ink: #114a58;
  --pill-qa-bg: #dbeafe; --pill-qa-ink: #1e3a8a;
  --pill-merge-bg: #ede9fe; --pill-merge-ink: #4c1d95;
  --pill-muted-bg: #f1f4f5; --pill-muted-ink: #475569;

  --tone-info-border: #1b6c80; --tone-info-bg: #f2f8fa; --tone-info-hover: #e5f1f4;
  --coordinator-card-bg: #f3f9fb; --coordinator-card-border: #8ec5d2;
  --tone-qa-border: #2563eb; --tone-qa-bg: #eff6ff; --tone-qa-hover: #dbeafe;
  --tone-merge-border: #7c3aed; --tone-merge-bg: #f8f6fe; --tone-merge-hover: #efe9fc;
  --tone-surface-border: var(--border); --tone-surface-bg: var(--surface); --tone-surface-hover: var(--raised);
  --tone-warn-border: #b45309; --tone-warn-bg: #fdfaf2; --tone-warn-hover: #f9f0df;
  --tone-pos-border: #166534; --tone-pos-bg: #eef7f2; --tone-pos-hover: #dfefe6;
  --tone-neutral-border: #7c8b94; --tone-neutral-bg: #f6f8f9; --tone-neutral-hover: #eaeef0;
  --tone-muted-border: #94a3b8; --tone-muted-bg: #f9fafa; --tone-muted-hover: #f1f4f5;

  --needs-attention-bg: #fffbf0;
  --needs-attention-border: #d97706;
  --needs-attention-glow: 0 0 0 1px #d97706, 0 0 16px rgba(217, 119, 6, 0.28);
  --needs-urgent-bg: #fff5f5;
  --needs-urgent-border: #e11d48;
  --needs-urgent-glow: 0 0 0 1px #e11d48, 0 0 18px rgba(225, 29, 72, 0.38);
  --needs-urgent-glow-hot: 0 0 0 2px #e11d48, 0 0 26px rgba(225, 29, 72, 0.6);
  --owner: #6d28d9; --owner-bg: #f5f3ff; --owner-ink: #4c1d95;

  --font: "Geist", "Geist Sans", "IBM Plex Sans", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: var(--font);
  --mono: "Geist Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-mono: var(--mono);
  --fs-display: clamp(2.25rem, 4.2vw, 3.5rem); --fs-h1: clamp(1.5rem, 2.4vw, 2rem);
  --fs-title: 24px; --fs-h2: 18px; --fs-section: 17px; --fs-lede: 17px; --fs-kpi: 28px; --fs-row: 15px; --fs-body: 14px; --fs-small: 12px;
  --lh-tight: 1.08; --lh-heading: 1.2; --lh-card: 1.35; --lh-body: 1.5;
  --ls-tight: -0.03em; --ls-heading: -0.025em; --ls-card: -0.015em; --ls-mono: 0.08em;

  --radius: 10px; --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px; --radius-xl: 14px; --radius-pill: 999px;
  --radius-card: 10px; --radius-control: 8px; --radius-sheet: 14px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;
  --sheet-inset: 8px; --sidebar-width: 240px; --topbar: 48px;
  --gap: 24px; --pad: 24px; --card-pad: 20px;
  --control-height: 32px; --row-height: 44px;
  --shadow-xs: 0 1px 2px rgba(13, 20, 23, 0.04);
  --shadow-sm: 0 1px 3px rgba(13, 20, 23, 0.06), 0 1px 2px rgba(13, 20, 23, 0.04);
  --shadow-md: 0 4px 12px rgba(13, 20, 23, 0.07), 0 1px 3px rgba(13, 20, 23, 0.05);
  --shadow-lg: 0 12px 28px rgba(13, 20, 23, 0.10), 0 2px 6px rgba(13, 20, 23, 0.05);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #090c0e; --surface: #0f1417; --raised: #151c20; --active: #1c252b;
    --border: #1d262b; --rule: #161e22; --control: #2d3a42;
    --text: #e9eff1; --muted: #8b9aa2;
    --accent: #5bb4c9; --accent-hover: #72c4d6; --primary: #5bb4c9; --primary-ink: #04161b;
    --tint: rgba(91, 180, 201, 0.11); --terminal: #060a0c; --terminal-ink: #e9eff1;
    --positive: #34d399; --negative: #f87171; --warning: #f59e0b; --warning-fill: #f59e0b;
    --chart-1: #5bb4c9; --chart-2: #77a6e3; --chart-3: #f59e0b; --chart-muted: #2d3a42;
    --pill-positive-bg: #11281e; --pill-positive-ink: #6ee7b7;
    --pill-negative-bg: #2c1619; --pill-negative-ink: #fca5a5;
    --pill-warning-bg: #2a2110; --pill-warning-ink: #fcd34d;
    --pill-neutral-bg: #1c252b; --pill-neutral-ink: #cfd8dc;
    --pill-info-bg: #11262c; --pill-info-ink: #8fd0de;
    --pill-qa-bg: #172554; --pill-qa-ink: #bfdbfe;
    --pill-merge-bg: #251b38; --pill-merge-ink: #c4b5fd;
    --pill-muted-bg: #151c20; --pill-muted-ink: #94a3b8;

    --tone-info-border: #5bb4c9; --tone-info-bg: #0e181d; --tone-info-hover: #132229;
    --coordinator-card-bg: #111d23; --coordinator-card-border: rgba(91, 180, 201, 0.42);
    --tone-qa-border: #60a5fa; --tone-qa-bg: #0f1c33; --tone-qa-hover: #152544;
    --tone-merge-border: #a78bfa; --tone-merge-bg: #191326; --tone-merge-hover: #231a36;
    --tone-surface-border: var(--border); --tone-surface-bg: var(--surface); --tone-surface-hover: var(--raised);
    --tone-warn-border: #f59e0b; --tone-warn-bg: #1e1910; --tone-warn-hover: #282114;
    --tone-pos-border: #34d399; --tone-pos-bg: #0d1c15; --tone-pos-hover: #13271d;
    --tone-neutral-border: #64748b; --tone-neutral-bg: #13191d; --tone-neutral-hover: #1a2228;
    --tone-muted-border: #475569; --tone-muted-bg: #0f1417; --tone-muted-hover: #151c20;

    --needs-attention-bg: #221c10;
    --needs-attention-border: #f59e0b;
    --needs-attention-glow: 0 0 0 1px #f59e0b, 0 0 18px rgba(245, 158, 11, 0.35);
    --needs-urgent-bg: #281215;
    --needs-urgent-border: #f43f5e;
    --needs-urgent-glow: 0 0 0 1px #f43f5e, 0 0 20px rgba(244, 63, 94, 0.45);
    --needs-urgent-glow-hot: 0 0 0 2px #f43f5e, 0 0 30px rgba(244, 63, 94, 0.7);
    --owner: #c4b5fd; --owner-bg: #1c1528; --owner-ink: #ddd6fe;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.32);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.50), 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.40);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #090c0e; --surface: #0f1417; --raised: #151c20; --active: #1c252b;
  --border: #1d262b; --rule: #161e22; --control: #2d3a42;
  --text: #e9eff1; --muted: #8b9aa2;
  --accent: #5bb4c9; --accent-hover: #72c4d6; --primary: #5bb4c9; --primary-ink: #04161b;
  --tint: rgba(91, 180, 201, 0.11); --terminal: #060a0c; --terminal-ink: #e9eff1;
  --positive: #34d399; --negative: #f87171; --warning: #f59e0b; --warning-fill: #f59e0b;
  --chart-1: #5bb4c9; --chart-2: #77a6e3; --chart-3: #f59e0b; --chart-muted: #2d3a42;
  --pill-positive-bg: #11281e; --pill-positive-ink: #6ee7b7;
  --pill-negative-bg: #2c1619; --pill-negative-ink: #fca5a5;
  --pill-warning-bg: #2a2110; --pill-warning-ink: #fcd34d;
  --pill-neutral-bg: #1c252b; --pill-neutral-ink: #cfd8dc;
  --pill-info-bg: #11262c; --pill-info-ink: #8fd0de;
  --pill-qa-bg: #172554; --pill-qa-ink: #bfdbfe;
  --pill-merge-bg: #251b38; --pill-merge-ink: #c4b5fd;
  --pill-muted-bg: #151c20; --pill-muted-ink: #94a3b8;

  --tone-info-border: #5bb4c9; --tone-info-bg: #0e181d; --tone-info-hover: #132229;
  --coordinator-card-bg: #111d23; --coordinator-card-border: rgba(91, 180, 201, 0.42);
  --tone-qa-border: #60a5fa; --tone-qa-bg: #0f1c33; --tone-qa-hover: #152544;
  --tone-merge-border: #a78bfa; --tone-merge-bg: #191326; --tone-merge-hover: #231a36;
  --tone-surface-border: var(--border); --tone-surface-bg: var(--surface); --tone-surface-hover: var(--raised);
  --tone-warn-border: #f59e0b; --tone-warn-bg: #1e1910; --tone-warn-hover: #282114;
  --tone-pos-border: #34d399; --tone-pos-bg: #0d1c15; --tone-pos-hover: #13271d;
  --tone-neutral-border: #64748b; --tone-neutral-bg: #13191d; --tone-neutral-hover: #1a2228;
  --tone-muted-border: #475569; --tone-muted-bg: #0f1417; --tone-muted-hover: #151c20;

  --needs-attention-bg: #221c10;
  --needs-attention-border: #f59e0b;
  --needs-attention-glow: 0 0 0 1px #f59e0b, 0 0 18px rgba(245, 158, 11, 0.35);
  --needs-urgent-bg: #281215;
  --needs-urgent-border: #f43f5e;
  --needs-urgent-glow: 0 0 0 1px #f43f5e, 0 0 20px rgba(244, 63, 94, 0.45);
  --needs-urgent-glow-hot: 0 0 0 2px #f43f5e, 0 0 30px rgba(244, 63, 94, 0.7);
  --owner: #c4b5fd; --owner-bg: #1c1528; --owner-ink: #ddd6fe;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.50), 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.40);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--text);
  font: 400 var(--fs-body)/var(--lh-body) var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono, code { font-family: var(--mono); font-size: 0.93em; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
[hidden] { display: none !important; }

/* Screen reader only utility (WCAG) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip link: hidden offscreen until focused by keyboard navigation */
.skip-link {
  position: absolute;
  top: -9999px;
  left: -9999px;
  z-index: 1000;
  padding: 8px 16px;
  background: var(--surface);
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius-control);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
  left: 12px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- shell: one tinted L-frame, the white sheet inset 8px ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); grid-template-rows: var(--topbar) 1fr; min-height: 100vh; }
.side { grid-row: 1 / 3; display: flex; flex-direction: column; padding: 14px 12px 16px; gap: 4px; border-right: 1px solid var(--border); background: var(--ground); }
.brand { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 6px; margin-bottom: 6px; text-decoration: none; color: var(--text); }
.brand-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; background: var(--tint); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); color: var(--accent); flex: none; }
.brand svg { flex: none; }
.brand b { font-weight: 600; font-size: 15px; letter-spacing: -0.015em; }
.nav-connecting { margin: 0 0 8px; padding: 0 10px; color: var(--muted); font-size: 12px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  height: 34px; padding: 0 10px; margin-bottom: 2px; border-radius: 8px; border: 1px solid transparent;
  color: var(--muted); text-decoration: none; transition: background var(--t, 150ms), border-color 150ms, color 150ms;
}
.nav a:hover { background: var(--raised); color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-xs); color: var(--text); font-weight: 600; }
.nav .count { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); font-weight: 500; }
.nav a:hover .count, .nav a[aria-current="page"] .count { color: var(--text); }
.nav .nav-projects { list-style: none; margin: 0 0 4px; padding: 0 0 2px 14px; }
.nav .nav-projects a { height: auto; min-height: 24px; padding: 1px 8px; font-size: 12px; }
.nav .nav-projects a[aria-current="true"] { color: var(--accent); font-weight: 600; background: var(--tint); }
.nav .count.decisions { color: var(--negative); font-weight: 600; }
.side .foot { margin-top: auto; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-xs); color: var(--muted); font-size: 12px; display: grid; gap: 5px; }
.side .foot [data-web-version],
.side .foot [data-hub-version] { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.side .foot .version-label { flex-shrink: 0; }
.side .foot .version-val { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--chart-muted); vertical-align: 1px; }
.dot.ok { background: var(--positive); }
.dot.warn, .dot.throttled { background: var(--warning-fill); }
.dot.bad, .dot.stopped { background: var(--negative); }
.dot.warn.muted-warn,
.dot.muted-warn { background: var(--tone-warn-border); opacity: 0.8; }
.line.tone-muted-warn { color: var(--muted); }
.line.tone-warn, .line.throttled { color: var(--warning); }
.line.tone-bad, .line.stopped { color: var(--negative); }

.top { display: flex; align-items: center; gap: 10px; padding: 0 calc(var(--sheet-inset) + 4px) 0 16px; }
.top .crumbs { color: var(--muted); font-size: 13px; }
.top .crumbs b { color: var(--text); font-weight: 600; }
.top .grow { flex: 1; }
.top-tabs { display: none; align-items: center; gap: 2px; padding: 2px; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-control); }
.top-tabs a { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; }
.top-tabs a:hover { color: var(--text); }
.top-tabs a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-xs); }
.theme-toggle { display: inline-flex; align-items: center; gap: 2px; padding: 2px; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-control); }
.theme-btn { height: 24px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.theme-btn:hover { color: var(--text); }
.theme-btn.active, .theme-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-xs); }
.sheet {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sheet);
  box-shadow: var(--shadow-sm);
  margin: 0 var(--sheet-inset) var(--sheet-inset) 12px; padding: var(--pad); min-width: 0;
}
.btn.menu-btn { display: none; }
.only-sm { display: none; }
.stack { display: grid; gap: var(--gap); align-content: start; }

/* ---------- title row ---------- */
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.title-row > div:first-child { flex: 1; min-width: 0; }
h1 { font-size: var(--fs-title); font-weight: 600; letter-spacing: var(--ls-heading); line-height: var(--lh-heading); margin: 0; }
.title-heading, .heading-with-help, .setup-step-head.heading-with-help { display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
.help-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0; border-radius: 50%;
  border: 1px solid var(--control); background: var(--surface); color: var(--muted);
  font-size: 12px; font-weight: 600; line-height: 1; cursor: pointer; flex-shrink: 0;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.help-toggle:hover, .help-toggle[aria-expanded="true"] {
  background: var(--raised); color: var(--text); border-color: var(--accent);
}
.help-panel {
  margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius-control);
  background: var(--raised); border: 1px solid var(--border); color: var(--muted);
  font-size: 13px; line-height: 1.5; max-width: 72ch;
}
.finding { margin: 8px 0 0; font-size: var(--fs-row); color: var(--muted); max-width: 76ch; }
.finding b { color: var(--text); font-weight: 600; }
.finding.finding-banner { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--radius-control); background: var(--raised); border: 1px solid var(--border); line-height: 1.4; }
.finding.finding-banner.tone-warn { background: var(--tone-warn-bg); border-color: var(--tone-warn-border); }
.finding.finding-banner.tone-bad { background: var(--pill-negative-bg); border-color: var(--negative); }
.finding.finding-banner.tone-ok { background: var(--tone-pos-bg); border-color: color-mix(in srgb, var(--positive) 28%, var(--border)); }
.finding.finding-banner .dot { flex: none; }
.needs-you-block .block-head .meta:not(:empty),
.owner-window .block-head .meta:not(:empty),
.owner-block .block-head .meta:not(:empty) { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.needs-you-block[data-needs-level="urgent"] .block-head .meta:not(:empty),
.owner-window[data-needs-level="urgent"] .block-head .meta:not(:empty),
.owner-block[data-needs-level="urgent"] .block-head .meta:not(:empty) { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.active-project { background: var(--tint); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; flex: none; align-items: center; }
.actions select, .actions input { width: auto; height: var(--control-height); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control-height); padding: 0 12px; border-radius: var(--radius-control);
  border: 1px solid var(--control); background: var(--surface); cursor: pointer; white-space: nowrap;
  transition: background 150ms, transform 120ms var(--ease-out);
}
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:hover { opacity: 0.9; }
.btn.danger { color: var(--negative); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.small { height: 28px; padding: 0 10px; font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
input[type=text], input[type=search], input[type=url], input[type=password], input[type=number], select, textarea {
  height: 36px; padding: 0 10px; border: 1px solid var(--control); border-radius: var(--radius-control);
  background: var(--surface); width: 100%;
}
textarea { height: auto; padding: 10px; line-height: 1.55; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 13px; }
label.field { display: grid; gap: 6px; font-weight: 500; }
label.field span.hint { font-weight: 400; color: var(--muted); font-size: 13px; }

/* ---------- grid and blocks ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.grid.overview-cockpit { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.grid.overview-cockpit > .span-12 { grid-column: 1 / -1; }
.overview-col-left, .overview-col-right { min-width: 0; }
.ov-head-sub { display: grid; gap: 4px; }
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.span-12 { grid-column: span 12; }
.span-6 { grid-column: span 6; }
.block { min-width: 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; min-height: 28px; }
.block-head > div { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.block-head h2 { font-size: var(--fs-section); font-weight: 600; letter-spacing: var(--ls-card); line-height: var(--lh-card); margin: 0; }
.block-head .meta { color: var(--muted); font-size: 13px; }
.card { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-xs); }
.well { background: var(--raised); border-radius: var(--radius-card); padding: 16px; }
.empty { color: var(--muted); padding: 18px 16px; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pill.info { background: var(--pill-info-bg); color: var(--pill-info-ink); }
.pill.qa { background: var(--pill-qa-bg); color: var(--pill-qa-ink); }
.pill.merge { background: var(--pill-merge-bg); color: var(--pill-merge-ink); }
.pill.surface {
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--positive) 48%, var(--border));
  background-color: var(--tone-surface-bg);
  background-image: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--positive) 34%, transparent) 0 6px,
    transparent 6px 12px
  );
  background-size: 17px 17px;
  animation: running-stripes 1.1s linear infinite;
}
@keyframes running-stripes {
  from { background-position: 0 0; }
  to { background-position: 17px 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .pill.surface { animation: none; }
}
[data-legend-tone="surface"] > i {
  background-color: var(--tone-surface-bg) !important;
  background-image: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--positive) 34%, transparent) 0 4px,
    transparent 4px 8px
  ) !important;
}
.pill.neutral { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.pill.muted { background: var(--pill-muted-bg); color: var(--pill-muted-ink); }
.pill.urgent { background: var(--pill-negative-bg); color: var(--pill-negative-ink); border: 1px solid var(--negative); font-weight: 600; font-size: 11px; padding: 0 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.pill.free-local-badge { font-size: 11px; height: 18px; padding: 0 6px; margin-left: 6px; vertical-align: middle; }
/* Ability/skill chips on agent cards: outline so they read as capabilities, not status (t788) */
.pill.outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.pill.outline.muted { background: transparent; color: var(--muted); border-style: dashed; }
.who .roles .capability-chip { margin-left: 4px; }
/* Assignee unavailable warning chip on task rows/cards (t646) */
.chip { display: inline-flex; align-items: center; font-size: 11px; font-weight: 500; line-height: 1; white-space: nowrap; vertical-align: middle; }
.chip.warn, .assignee-warn-chip {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: var(--radius-control);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  background: var(--pill-warning-bg);
  color: var(--pill-warning-ink);
  border: 1px solid var(--warning);
}
.machine-profile { font-weight: 500; }
.local-runtime-state { color: var(--accent); font-size: 12px; }

/* ---------- agents: the plan meters ---------- */
.agents { display: grid; }
.agent { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(0, 1.4fr) minmax(220px, 1.5fr); gap: 16px; padding: 14px 16px; border-top: 1px solid var(--rule); align-items: start; }
.agent.compact { grid-template-columns: minmax(180px, 1.1fr) minmax(0, 2fr); }
.agent:first-child { border-top: 0; }

/* Agents page: summary header, then cards, then a muted legend and rare team controls. */
.agents-summary-card { padding: 16px 20px; margin-bottom: 16px; display: grid; gap: 12px; }
.agents-summary-card .title-row { margin-bottom: 0; }
.agents-summary-meta { margin: 4px 0 0; font-size: 13px; }
.agents-page-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 10px 2px 4px; }
.agents-meter-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 11px; color: var(--muted); }
.agents-meter-legend .legend-title { font-weight: 500; color: var(--muted); margin-right: 4px; }
.agents-team-controls { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.agents-team-controls .btn { height: 24px; padding: 0 8px; font-size: 12px; color: var(--muted); background: transparent; border-color: transparent; }
.agents-meter-legend .legend-item { display: inline-flex; align-items: center; gap: 6px; }
.agents-meter-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; position: relative; }
.agents-meter-legend .swatch-used { background: var(--accent); border-right: 2px solid var(--text); }
.agents-meter-legend .swatch-est { background: repeating-linear-gradient(135deg, var(--chart-1) 0 3px, color-mix(in srgb, var(--chart-1) 45%, transparent) 3px 6px); }
.agents-meter-legend .swatch-pace { background: var(--raised); border-right: 2px solid var(--muted); }
.agents-meter-legend .swatch-throttled { background: var(--warning); }
.agents-meter-legend .swatch-stopped { background: var(--negative); }
.agents-setup-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.agents-setup-col { display: grid; gap: 16px; min-width: 0; }
.agents-setup-col .add-agent-card,
.agents-setup-col .machine-setup-container > .setup-card:first-child { margin-top: 0 !important; }
.agents.agents-page-list { gap: 12px; background: transparent; border: 0; box-shadow: none; padding: 0; }
.agents.agents-page-list > .agent { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-xs); padding: 16px; }
.agents.agents-page-list > .agent:first-child { border-top: 1px solid var(--border); }
.agents.agents-page-list .who .roles { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.agents.agents-page-list .meters { min-width: 0; }

/* Active Coordinator highlight (t866): subtle border and background tint without layout shift. */
.agent.coordinator-active { background: var(--coordinator-card-bg); border-color: var(--coordinator-card-border); }
.agents.overview-agents > .agent.coordinator-active { background: var(--coordinator-card-bg); border-color: var(--coordinator-card-border); box-shadow: inset 0 0 0 1px var(--coordinator-card-border); }
.agents.overview-agents > .agent.coordinator-active:first-child { border-top-left-radius: calc(var(--radius-card) - 1px); border-top-right-radius: calc(var(--radius-card) - 1px); }
.agents.overview-agents > .agent.coordinator-active:last-child { border-bottom-left-radius: calc(var(--radius-card) - 1px); border-bottom-right-radius: calc(var(--radius-card) - 1px); }
.agents.agents-page-list > .agent.coordinator-active,
.agents.agents-page-list > .agent.coordinator-active:first-child { background: var(--coordinator-card-bg); border-color: var(--coordinator-card-border); }

/* Machines section on the Agents page: one card per machine. */
.machines-section { margin-top: 20px; }
.machines-section .section-title { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.machine-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.machine-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-xs); padding: 12px 14px; display: grid; gap: 10px; align-content: start; }
.machine-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.machine-card-head .machine-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.machine-card-agents { display: flex; flex-wrap: wrap; gap: 6px; }
.who { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.who > div { flex: 1; min-width: 0; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--text); background: hsl(var(--h) 45% 88%); }
.avatar svg { display: block; flex: none; }
:root[data-theme="dark"] .avatar { background: hsl(var(--h) 30% 24%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { background: hsl(var(--h) 30% 24%); } }
.who b { display: block; font-weight: 500; }
.who .roles { color: var(--muted); font-size: 13px; line-height: 1.35; }
.who .model-name { color: var(--text); font-size: 12px; font-weight: 500; margin-top: 2px; }
.agent-machine { font-weight: 400; color: var(--muted); }
.agents-warning { color: var(--warning); font-size: 13px; margin-top: 4px; }
.thin-bars { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; width: 180px; max-width: 100%; }
.agents.overview-agents > .agent.compact { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.agents.overview-agents .thin-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 8px 12px; width: 100%; margin-top: 8px; }
.thin-meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.thin-meter-pct { color: var(--text); font-weight: 500; }
.overview-meter-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 16px; border-top: 1px solid var(--rule); background: var(--raised); border-radius: 0 0 calc(var(--radius-card) - 1px) calc(var(--radius-card) - 1px); font-size: 12px; color: var(--muted); }
.overview-meter-legend .legend-item { display: inline-flex; align-items: center; gap: 5px; }
.overview-meter-legend .swatch.stop-tick { display: inline-block; width: 2px; height: 10px; background: var(--text); border-radius: 1px; }
.overview-meter-legend .swatch.next-tick { display: inline-block; width: 2px; height: 10px; background: var(--muted); opacity: 0.55; border-radius: 1px; }
.bar.thin { height: 4px; border-radius: 2px; }
.bar.thin .fill { border-radius: 2px; }
.bar.thin .stop, .bar.thin .next { top: -2px; bottom: -2px; }
.usage-bar-wrap { position: relative; cursor: pointer; outline: none; display: block; }
.usage-bar-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.usage-popup { display: none; position: absolute; bottom: calc(100% + 6px); left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.4; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); z-index: 100; pointer-events: none; }
.usage-bar-wrap:hover .usage-popup, .usage-bar-wrap:focus .usage-popup, .usage-bar-wrap:focus-within .usage-popup, .usage-bar-wrap.open .usage-popup { display: block; }
.usage-popup .popup-title { color: var(--text); font-weight: 500; }
.usage-popup .popup-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.doing { min-width: 0; }
.doing .line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doing .sub { color: var(--muted); font-size: 13px; }
.agent-stats { color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 4px; }
.agent-action-info { margin-top: 3px; font-size: 12px; }
.agent-action-info.overdue { font-weight: 500; }
.agent-action-details { margin-top: 6px; font-size: 12px; color: var(--text); overflow-wrap: anywhere; }
.agent-action-details summary { color: var(--muted); cursor: pointer; }
.agent-action-details dl { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 2px 8px; margin: 6px 0; }
.agent-action-details dt { color: var(--muted); }
.agent-action-details dd { margin: 0; }
.agent-action-details ol { margin: 0; padding-left: 18px; color: var(--muted); }
.agent-setup-tip {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--tone-info-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-size: var(--fs-small);
  line-height: 1.45;
  color: var(--text);
}
.agent-setup-tip-head {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--accent);
}
.agent-setup-tip ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}
.agent-setup-tip li {
  color: var(--text);
}
.agent-setup-tip code {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  word-break: break-word;
}
.agent-row-actions { display: none; }
.agent-config { margin-top: 6px; grid-column: 1 / -1; width: 100%; }
.agent-config > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 44px;
  cursor: pointer;
  color: var(--muted);
  font-size: var(--fs-small);
  user-select: none;
  list-style: none;
  padding: 6px 10px;
  border-radius: var(--radius-control);
}
.agent-config > summary::-webkit-details-marker {
  display: none;
}
.agent-config > summary:hover,
.agent-config[open] > summary {
  color: var(--text);
}
.agent-config > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.agent-config > summary .chevron {
  width: 16px;
  height: 16px;
  transition: transform 160ms var(--ease-out);
}
.agent-config[open] > summary .chevron {
  transform: rotate(180deg);
}

.agent-config-body {
  display: grid;
  gap: 14px;
  margin-top: 8px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
}

.agent-config-section {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}
.agent-config-section:first-child {
  border-top: none;
  padding-top: 0;
}
.agent-config-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  user-select: none;
}
.agent-config-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.agent-config-form {
  display: grid;
  gap: 10px;
}
.agent-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.agent-config-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text);
}
.agent-config-field .label-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.agent-config-field select,
.agent-config-field input {
  width: 100%;
}
.agent-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.agent-config-row select {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 100%;
}
.agent-config-row .actions {
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
}
.agent-config-fields {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.agent-config-fields select,
.agent-config-fields input {
  max-width: 100%;
}
.agent-config-section.danger-zone .agent-config-section-label {
  color: var(--negative);
}
.agent-stuck-check-slot { grid-column: 1 / -1; width: 100%; }
.agent-stuck-check-slot:empty { display: none; }
.agent-stuck-check { margin: 8px 0 0; font-size: 13px; color: var(--warning); overflow-wrap: anywhere; }
.agent-stuck-check a { color: inherit; }
.abilities-list { display: grid; gap: 8px; }
.ability-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 10px; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-control); }
.ability-row .ability-info { display: flex; flex-direction: column; gap: 2px; }
.ability-row .ability-name { font-weight: 600; font-size: 13px; }
.ability-row .ability-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.add-ability-dialog { max-height: calc(100vh - 48px); overflow-y: auto; }
.ability-catalog-options { display: grid; gap: 8px; max-height: 55vh; overflow-y: auto; padding-right: 4px; }
.ability-category-heading { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-top: 8px; margin-bottom: 2px; }
.ability-catalog-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-control); cursor: pointer; background: var(--surface); }
.ability-catalog-card:hover { border-color: var(--accent); }
.skills-list { display: grid; gap: 8px; }
.skill-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 10px; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-control); }
.skill-row .skill-info { display: flex; flex-direction: column; gap: 2px; }
.skill-row .skill-name { font-weight: 600; font-size: 13px; }
.skill-row .skill-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.add-skill-dialog { max-height: calc(100vh - 48px); overflow-y: auto; }
.skill-catalog-options { display: grid; gap: 8px; max-height: 55vh; overflow-y: auto; padding-right: 4px; }
.skill-catalog-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-control); cursor: pointer; background: var(--surface); }
.skill-catalog-card:hover { border-color: var(--accent); }
.custom-mcp-fields { display: grid; gap: 10px; padding: 12px; background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-control); }
.sign-in-step-box { background: var(--ground); border: 1px solid var(--border); padding: 10px; border-radius: var(--radius-control); font-size: 13px; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); }
.ability-warning-banner { padding: 10px 12px; background: var(--tone-warn-bg); border: 1px solid var(--tone-warn-border); color: var(--warning); border-radius: var(--radius-control); font-size: 13px; }
.disclosure-toggle { min-height: 44px; cursor: pointer; user-select: none; list-style: none; display: flex; align-items: center; gap: 8px; }
.disclosure-toggle::-webkit-details-marker { display: none; }
.disclosure-toggle::marker { content: ''; }
.disclosure-toggle:not(tr)::before { content: '▸'; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; font-size: 16px; line-height: 1; color: var(--muted); flex: none; }
details[open] > summary.disclosure-toggle::before, .disclosure-toggle:not(tr)[aria-expanded="true"]::before { content: '▾'; color: var(--text); }
.agent-config > summary.disclosure-toggle::before, .setup-card-summary.disclosure-toggle::before { display: none; }
.disclosure-cue { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
details[open] > summary .disclosure-closed, .disclosure-toggle[aria-expanded="true"] .disclosure-closed { display: none; }
details:not([open]) > summary .disclosure-open, .disclosure-toggle[aria-expanded="false"] .disclosure-open { display: none; }
.log-tail-summary { font-size: 12px; font-weight: 600; margin: 4px 0; }
.setup-card-summary { cursor: pointer; font-weight: 600; font-size: 14px; min-height: 44px; padding: 12px 16px; list-style: none; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; user-select: none; }
.setup-card-summary .card-summary-title { font-weight: 600; }
.setup-card-summary .sub { font-size: 12px; }
.setup-card-summary::-webkit-details-marker { display: none; }
.setup-card-summary::after { content: '▸'; font-size: 16px; line-height: 1; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: transform 150ms ease, color 150ms ease; }
.agents-setup-grid .setup-card-summary { display: grid; grid-template-columns: minmax(0, 1fr) 18px; }
.agents-setup-grid .setup-card-summary .card-summary-title { grid-column: 1; grid-row: 1; }
.agents-setup-grid .setup-card-summary .sub { grid-column: 1; grid-row: 2; }
.agents-setup-grid .setup-card-summary::after { grid-column: 2; grid-row: 1 / span 2; }
details[open] > .setup-card-summary::after { content: '▾'; color: var(--text); }
.machine-setup-container { display: grid; gap: 0; }
.role-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.role-check { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); font-size: 13px; cursor: pointer; user-select: none; transition: background 150ms, border-color 150ms, color 150ms; }
.role-check:hover { border-color: var(--accent); background: var(--raised); }
.role-check:has(input[type="checkbox"]:checked) { background: var(--tint); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); font-weight: 500; }
.role-check input[type="checkbox"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; opacity: 0; }
.role-check::before { content: ''; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: none; border: 1.5px solid var(--control); border-radius: 4px; background: var(--surface); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; transition: background 150ms, border-color 150ms, box-shadow 150ms; }
.role-check:has(input[type="checkbox"]:checked)::before { content: '✓'; background: var(--accent); border-color: var(--accent); }
.role-check:focus-within, .role-check:has(input[type="checkbox"]:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.role-check:has(input[type="checkbox"]:focus-visible)::before { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.roles-suggestion { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; }
.meters { display: grid; gap: 10px; }
.meter { display: grid; gap: 4px; }
.meter .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.meter .row .v { font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 8px; border-radius: 4px; background: var(--raised); overflow: visible; }
:root[data-theme="dark"] .bar { background: var(--active); }
.bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--chart-1); }
/* taste-skill-ignore: a hatch encodes "estimated", like a timeline hatch; it is data, not decoration */
.bar .fill.est { background: repeating-linear-gradient(135deg, var(--chart-1) 0 4px, color-mix(in srgb, var(--chart-1) 55%, transparent) 4px 7px); }
.bar .fill.throttled { background: var(--warning-fill); }
.bar .fill.est.throttled { background: repeating-linear-gradient(135deg, var(--warning-fill) 0 4px, color-mix(in srgb, var(--warning-fill) 55%, transparent) 4px 7px); }
.bar .fill.stopped { background: var(--negative); }
.bar .fill.est.stopped { background: repeating-linear-gradient(135deg, var(--negative) 0 4px, color-mix(in srgb, var(--negative) 55%, transparent) 4px 7px); }
.bar .fill.stale { opacity: 0.62; }
.bar.unknown { border: 1px dashed var(--border); background: transparent; }
.bar .fill.unknown { width: 0 !important; background: transparent; }
.bar .stop { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); border-radius: 1px; }
.bar .next { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--muted); opacity: 0.55; border-radius: 1px; }

/* Agent model routing & tier picker (t2164) */
.agent-pin-field { display: flex; align-items: center; gap: 8px; margin-top: 4px; cursor: pointer; }
.agent-pin-status.pinned { color: var(--accent); font-weight: 500; }
.model-recommendation-line { margin: 6px 0 2px; font-size: 13px; }
.model-recommendation-label { font-weight: 500; }

.model-tier-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.model-tier-badge { font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--raised); border: 1px solid var(--border); }
.model-confidence-badge { color: var(--muted); padding: 2px 8px; border-radius: 4px; background: var(--raised); }
.model-tier-reason { font-size: 12px; }

.active-tier-override {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--tint);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: var(--radius-control);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}
.active-tier-override-label { font-weight: 600; }
.toggle-override-btn { margin-top: 6px; }

.tier-override-form {
  display: none;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}
.tier-override-form.open { display: grid; }
.override-reason-input { width: 100%; }
.tier-override-actions { margin-top: 4px; }

/* Shared goal marker: one bounded line, with title ellipsis and visible class. */
.agent-goal-marker { display: flex; align-items: baseline; gap: 6px; min-width: 0; max-width: 100%; margin: 4px 0; font-size: 12px; line-height: 18px; color: var(--text); text-decoration: none; }
.agent-goal-label, .agent-goal-class, .agent-goal-percent { flex: none; color: var(--muted); font-size: 11px; }
.agent-goal-label { font-weight: 600; }
.agent-goal-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-goal-marker:hover .agent-goal-title { text-decoration: underline; }
.agent-goal-marker:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* ---------- decisions ---------- */
.decision { padding: 14px 16px; border-top: 1px solid var(--rule); }
.decision:first-child { border-top: 0; }
.decision .q { white-space: pre-wrap; margin: 0 0 10px; }
.decision .kind { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.decision .opts { display: flex; gap: 8px; flex-wrap: wrap; }
.decision.is-urgent {
  background: color-mix(in srgb, var(--needs-urgent-border) 6%, transparent);
  border-left: 3px solid var(--needs-urgent-border);
}
.decision.is-attention {
  border-left: 3px solid var(--needs-attention-border);
}

/* Completed owner actions are quiet history, separate from pending decision cards. */
.owner-history-list {
  list-style: none; margin: 0; padding: 4px 16px 12px;
  color: var(--muted); font-weight: 400; font-size: 13px;
  overflow-wrap: anywhere;
}
.owner-history-list li { padding: 3px 0; }
.owner-history-outcome[data-tone="positive"] { color: var(--positive); }
.owner-history-outcome[data-tone="negative"] { color: var(--negative); }
/* Owner action walkthrough cards (t1055) */
.owner-action { display: grid; gap: 8px; }
.owner-action-title { margin: 0; font-size: 15px; }
.owner-action-why { margin: 0; }
.owner-action-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.owner-action-block { display: grid; gap: 4px; }
.owner-action-block-label { font-weight: 600; font-size: 13px; }
.owner-action-block .codeblock pre { padding-right: 72px; }
.owner-action-verify { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.owner-action-note { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.owner-action-note input { flex: 1; min-width: 200px; }
.owner-action-done-msg { margin: 0; font-size: 13px; color: var(--muted); }
.owner-actions-inline { margin: 4px 0 12px; }
.owner-actions-inline .owner-action { padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.owner-action.is-urgent {
  background: color-mix(in srgb, var(--needs-urgent-border) 6%, transparent);
  border-color: var(--needs-urgent-border);
}
.owner-action.is-attention {
  border-color: var(--needs-attention-border);
}


/* ---------- Needs you box glow & states (t628) ---------- */
.card.needs-you-card {
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card.needs-you-card[data-needs-level="attention"],
.card.needs-you-attention,
.owner-window[data-needs-level="attention"] .card:not(.empty),
.needs-you-block[data-needs-level="attention"] .card:not(.empty) {
  background: var(--needs-attention-bg);
  border-color: var(--needs-attention-border);
  box-shadow: var(--needs-attention-glow);
}

.card.needs-you-card[data-needs-level="urgent"],
.card.needs-you-urgent,
.owner-window[data-needs-level="urgent"] .card:not(.empty),
.needs-you-block[data-needs-level="urgent"] .card:not(.empty) {
  background: var(--needs-urgent-bg);
  border-color: var(--needs-urgent-border);
  box-shadow: var(--needs-urgent-glow);
  animation: needs-urgent-pulse 2.5s ease-in-out infinite;
}

.owner-window { min-width: 0; }
.decision.owner-request {
  border-left: 3px solid var(--chart-1);
}
.decision.owner-request .q {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.decision.empty-pending-note {
  border-top: 1px solid var(--rule);
}

@keyframes needs-urgent-pulse {
  0%, 100% {
    box-shadow: var(--needs-urgent-glow);
  }
  50% {
    box-shadow: var(--needs-urgent-glow-hot);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card.needs-you-card[data-needs-level="urgent"],
  .card.needs-you-urgent,
  .needs-you-block[data-needs-level="urgent"] .card:not(.empty) {
    animation: none;
  }
}

/* ---------- work: state strip and table ---------- */
.strip { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--raised); margin: 4px 0 10px; gap: 2px; }
.strip span { display: block; height: 100%; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 0 12px 8px; }
td { padding: 0 12px; height: var(--row-height); border-top: 1px solid var(--rule); vertical-align: middle; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--raised); }

/* Status-tinted task rows */
tr[data-tone="info"] { --tone-border: var(--tone-info-border); --tone-bg: var(--tone-info-bg); --tone-hover-bg: var(--tone-info-hover); }
tr[data-tone="qa"] { --tone-border: var(--tone-qa-border); --tone-bg: var(--tone-qa-bg); --tone-hover-bg: var(--tone-qa-hover); }
tr[data-tone="merge"] { --tone-border: var(--tone-merge-border); --tone-bg: var(--tone-merge-bg); --tone-hover-bg: var(--tone-merge-hover); }
tr[data-tone="surface"] { --tone-border: var(--tone-surface-border); --tone-bg: var(--tone-surface-bg); --tone-hover-bg: var(--tone-surface-hover); }
tr[data-tone="warn"] { --tone-border: var(--tone-warn-border); --tone-bg: var(--tone-warn-bg); --tone-hover-bg: var(--tone-warn-hover); }
tr[data-tone="pos"] { --tone-border: var(--tone-pos-border); --tone-bg: var(--tone-pos-bg); --tone-hover-bg: var(--tone-pos-hover); }
tr[data-tone="neutral"] { --tone-border: var(--tone-neutral-border); --tone-bg: var(--tone-neutral-bg); --tone-hover-bg: var(--tone-neutral-hover); }
tr[data-tone="muted"] { --tone-border: var(--tone-muted-border); --tone-bg: var(--tone-muted-bg); --tone-hover-bg: var(--tone-muted-hover); }

tr[data-tone] td { background: var(--tone-bg, transparent); }
tr[data-tone] td:first-child { border-left: 3px solid var(--tone-border, transparent); }
tr[data-tone].click:hover td { background: var(--tone-hover-bg, var(--raised)); }

/* Slow pulse glow on active, QA and blocked task rows */
@keyframes row-glow {
  0%, 100% {
    box-shadow: inset 3px 0 0 var(--tone-border, transparent);
  }
  50% {
    box-shadow: inset 3px 0 0 var(--tone-border, transparent), inset 6px 0 12px -2px var(--tone-border, transparent);
  }
}

/* Brief flash on rows that changed state, progress or note */
@keyframes row-flash {
  0% {
    background: var(--tone-info-bg, rgba(56, 139, 253, 0.35));
  }
  100% {
    background: var(--tone-bg, transparent);
  }
}

tr.glow, tr.glow td:first-child {
  animation: row-glow 3s ease-in-out infinite;
}

/* Initial-load bar. Width updates on the same node so this transition can interpolate a jump. */
.nv-loader-track { width: min(240px, 72vw); height: 4px; margin-top: 16px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 28%, transparent); overflow: hidden; }
.nv-loader-bar { height: 100%; background: var(--accent, var(--nv-accent)); transition: width 160ms linear; }
@media (prefers-reduced-motion: reduce) { .nv-loader-bar { transition: none; } }

tr.flash {
  animation: row-flash 1.5s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  tr.glow, tr.glow td:first-child, tr.flash {
    animation: none;
  }
}

.tasks-updated { font-size: 13px; font-weight: normal; margin-left: 8px; vertical-align: middle; color: var(--muted); }
.tasks-warn { font-size: 13px; font-weight: normal; margin-left: 8px; vertical-align: middle; color: var(--warning); }

.pill .elapsed { font-variant-numeric: tabular-nums; opacity: 0.9; }
td .t { display: block; max-width: 44ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td .desc { display: block; color: var(--text); font-size: 13px; line-height: 1.4; margin: 2px 0; max-width: 58ch; }
td .s { display: block; color: var(--muted); font-size: 12px; max-width: 52ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-group { margin-top: 14px; }
.work-group:first-of-type { margin-top: 10px; }
.work-group-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; padding: 6px 12px; background: var(--raised); border-radius: 6px 6px 0 0; }
.work-group table { margin-bottom: 0; }
.work-group th, .work-group td { padding-left: 8px; padding-right: 8px; }
.work-group td { height: auto; min-height: var(--row-height); padding-top: 6px; padding-bottom: 6px; }
.work-group td .t, .work-group td .s { white-space: normal; overflow-wrap: anywhere; max-width: none; }
.work-group td:first-child, .work-group td:nth-child(4) { white-space: nowrap; }
.live-task-list { display: grid; }
.live-task-row { padding: 10px 12px; border-top: 1px solid var(--rule); border-left: 3px solid var(--tone-border, transparent); background: var(--tone-bg, transparent); cursor: pointer; min-width: 0; }
.live-task-row:hover { background: var(--tone-hover-bg, var(--raised)); }
.live-task-row[data-tone="info"] { --tone-border: var(--tone-info-border); --tone-bg: var(--tone-info-bg); --tone-hover-bg: var(--tone-info-hover); }
.live-task-row[data-tone="qa"] { --tone-border: var(--tone-qa-border); --tone-bg: var(--tone-qa-bg); --tone-hover-bg: var(--tone-qa-hover); }
.live-task-row[data-tone="merge"] { --tone-border: var(--tone-merge-border); --tone-bg: var(--tone-merge-bg); --tone-hover-bg: var(--tone-merge-hover); }
.live-task-row[data-tone="surface"] { --tone-border: var(--tone-surface-border); --tone-bg: var(--tone-surface-bg); --tone-hover-bg: var(--tone-surface-hover); }
.task-mark { display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: 1px; box-sizing: border-box; border: 1.5px solid currentColor; }
.task-mark-dependency { border-radius: 50%; }
.task-mark-parked { border-radius: 1px; }
.live-task-row[data-tone="warn"] { --tone-border: var(--tone-warn-border); --tone-bg: var(--tone-warn-bg); --tone-hover-bg: var(--tone-warn-hover); }
.live-task-row[data-tone="pos"] { --tone-border: var(--tone-pos-border); --tone-bg: var(--tone-pos-bg); --tone-hover-bg: var(--tone-pos-hover); }
.live-task-row[data-tone="neutral"] { --tone-border: var(--tone-neutral-border); --tone-bg: var(--tone-neutral-bg); --tone-hover-bg: var(--tone-neutral-hover); }
.live-task-row[data-tone="muted"] { --tone-border: var(--tone-muted-border); --tone-bg: var(--tone-muted-bg); --tone-hover-bg: var(--tone-muted-hover); }
.live-task-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.live-task-id { font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.live-task-row .t { font-weight: 500; flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.live-task-badges { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.live-task-row .desc, .live-task-row .s { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.live-task-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.table-wrap,
[data-slot="tasks-body"],
.work-group {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
[data-slot="tasks-body"] > .table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
[data-slot="tasks-body"] > .table-wrap th {
  padding: 10px 12px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--raised);
  border-bottom: 1px solid var(--rule);
}
.project-switcher-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.tasks-project-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.project-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: background 150ms, border-color 150ms, color 150ms;
}
.project-pill:hover {
  background: var(--raised);
}
.project-pill.active,
.project-pill[aria-current="true"] {
  background: var(--tint);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--accent);
}
.project-pill b {
  font-weight: 600;
}
.project-switcher-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs button {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 150ms, color 150ms, box-shadow 150ms;
}
.tabs button:hover {
  color: var(--text);
}
.tabs button[aria-selected="true"] {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.task-inline { padding: 12px 4px 8px; outline: none; min-width: 0; max-width: 100%; }
.task-inline-row td { background: var(--raised); border-bottom: 1px solid var(--border); max-width: 100%; min-width: 0; }
.tasks-card > *, .detail-meta-card, .detail-meta-card > *, .detail-acceptance li, .detail-acceptance li > span, .detail-deliverables-grid, .detail-deliverables-grid .deliv { min-width: 0; max-width: 100%; }
.detail-title, .detail-acceptance li > span, .detail-links-row .pill, .detail-branch-box code, .detail-deliverables-grid .deliv { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.detail-links-row .pill { height: auto; }
@media (max-width: 700px) {
  .task-inline .btn { min-height: 44px; }
  .task-inline .detail-deliverables-grid { display: grid; gap: 8px; }
}
.tasks-card { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.tasks-card .tabs, .tasks-card .legend { margin-bottom: 0; }
.tasks-search-field { margin: 0; }
input.tasks-search { height: 44px; width: 100%; max-width: 100%; font-size: 16px; }


/* Task rows open inline details without adding disclosure boxes to table columns. */
tr.task-row, tr.task-row > td { cursor: pointer; }
tr.task-row > td { height: 44px; }
tr.task-row > td:first-child { white-space: nowrap; }
tr.task-row:focus-visible, .task-plaque:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* ---------- milestones, lists ---------- */
.ms { padding: 8px 16px; border-top: 1px solid var(--rule); }
.ms:first-child { border-top: 0; }
.ms .row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ms-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms .bar { width: 64px; flex: none; }
.ms .num { flex: none; font-size: 12px; white-space: nowrap; }
.ms .bar .fill { background: var(--chart-1); }
.ms-goal { margin-top: 2px; font-size: 12px; overflow-wrap: anywhere; }
.ms-more { border-top: 1px solid var(--rule); }
.ms-more:not([open]) > .ms { display: none; }
.ms-more > summary { padding: 0 16px; font-size: 13px; color: var(--muted); }
.ms-footer { padding: 6px 16px 8px; border-top: 1px solid var(--rule); font-size: 13px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 9px 16px; border-top: 1px solid var(--rule); }
.feed li:first-child { border-top: 0; }
.feed time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.feed .who { display: inline; color: var(--muted); }
.deliv { padding: 12px 16px; border-top: 1px solid var(--rule); }
.deliv:first-child { border-top: 0; }
.deliv.deliv-with-icon { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; }
.deliv-icon-tile { width: 36px; height: 36px; border-radius: 8px; background: var(--tint); border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border)); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.deliv-body { min-width: 0; }
.deliv .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.deliv .row { flex-wrap: wrap; row-gap: 4px; }
.deliv .row .actions { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.deliv-title-wrap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.deliv-ext { display: inline-flex; align-items: center; justify-content: center; height: 20px; padding: 0 6px; border-radius: 5px; background: var(--raised); border: 1px solid var(--border); color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; flex: none; }
.deliv-meta { margin-top: 3px; }
.deliv .row .project-task-counts { margin-right: auto; padding-left: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; align-self: center; }
@media (max-width: 480px) {
  .deliv .row { flex-wrap: wrap; row-gap: 4px; }
}


/* Project → milestones → goals → tasks. Completed branches start closed. */
.progress-milestone-row { border-top: 1px solid var(--rule); padding: 8px 16px; min-width: 0; }
.progress-milestone-row:first-child { border-top: 0; }
.progress-summary { cursor: pointer; padding: 4px 0; }
.progress-summary-content { display: inline-flex; vertical-align: top; flex-wrap: wrap; align-items: center; gap: 6px 12px; width: calc(100% - 24px); }
.progress-summary-content > b { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.progress-summary .progress-bar-wrap { margin-left: auto; }
.progress-children { border-left: 1px solid var(--rule); margin: 6px 0 0 6px; padding-left: 12px; min-width: 0; }
.progress-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 6px 0; overflow-wrap: anywhere; }
.progress-goal-row { padding: 6px 0; border-top: 1px solid var(--rule); min-width: 0; }
.progress-ungrouped { padding: 8px 0; }
.progress-task-row { display: grid; grid-template-columns: minmax(40px, auto) minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 0; font-size: 13px; border-top: 1px solid var(--rule); }
.progress-task-id { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-task-title { overflow-wrap: anywhere; }
.progress-all-tasks { display: inline-block; padding: 6px 0; }
.progress-card .task-state { background: var(--raised); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 5px; font-size: 11px; }
@media (max-width: 520px) {
  .progress-milestone-row { padding: 8px 10px; }
  .progress-children { padding-left: 8px; margin-left: 3px; }
  .progress-task-row { grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; }
  .progress-task-id { grid-column: 1 / -1; max-width: none; }
  .progress-summary .bar { width: 64px !important; }
}

.progress-milestone-row:not([open]) > summary .progress-summary-content,
.progress-goal-row:not([open]) > summary .progress-summary-content { flex-wrap: nowrap; }
.progress-milestone-row:not([open]) > summary b,
.progress-goal-row:not([open]) > summary b { flex-basis: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-milestone-row:not([open]) > summary .bar,
.progress-goal-row:not([open]) > summary .bar { display: none; }
.progress-summary .progress-text { white-space: nowrap; }
/* ---------- vision & project settings ---------- */
.project-settings-panel { display: grid; gap: 16px; }
.project-meta-card { padding: 16px; display: grid; gap: 12px; }
.project-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.project-status-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 10px 0 4px; border-top: 1px solid var(--rule); }
.goals-mode-card { padding: 16px; display: grid; gap: 10px; }
.goals-mode-card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.goals-mode-actions { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.goals-mode-actions .field { min-width: min(100%, 220px); flex: 1; }
.goals-mode-helps { margin: 0; padding-left: 1.15rem; display: grid; gap: 4px; }
.goals-mode-helps li { color: var(--muted); }
.goals-mode-helps li[data-current="true"] { color: var(--text); font-weight: 600; }
.project-vision-editor { padding: 16px; display: grid; gap: 12px; }
.project-vision-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.vision-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); }
.coordinator-addon-card { padding: 16px; display: grid; gap: 10px; }
.coordinator-addon-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.coordinator-addon-title { margin: 0; font-size: 15px; font-weight: 600; }
.coordinator-addon-body { box-sizing: border-box; max-width: 100%; max-height: 480px; overflow-y: auto; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; margin: 0; padding: 12px; border-radius: var(--radius-control); background: var(--raised); border: 1px solid var(--border); font-size: 13px; line-height: 1.5; }
.coordinator-addon-body[hidden] { display: none !important; }
.coordinator-addon-empty { margin: 0; font-size: 13.5px; }
.prose { max-width: 72ch; line-height: 1.6; }
.prose h1 { font-size: 20px; margin: 0 0 12px; }
.prose h2 { font-size: 16px; margin: 20px 0 8px; }
.prose h3 { font-size: 14px; margin: 16px 0 6px; }
.prose p, .prose ul, .prose ol { margin: 0 0 10px; }
.prose code { background: var(--raised); padding: 1px 4px; border-radius: 4px; }

/* ---------- detail sheet ---------- */
.overlay { position: fixed; inset: 0; background: rgb(0 0 0 / 0.28); display: flex; justify-content: flex-end; z-index: 20; }
.panel { width: min(640px, 100%); height: 100%; background: var(--surface); border-left: 1px solid var(--border); overflow: auto; padding: var(--pad); box-shadow: -12px 0 32px rgb(0 0 0 / 0.12); }
.panel .close { float: right; }
.panel h2 { font-size: 18px; margin: 0 0 4px; font-weight: 600; }
.panel h3 { font-size: 14px; margin: 20px 0 8px; font-weight: 600; }
.task-inline pre, .panel pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; overflow-x: auto; max-width: 100%; min-width: 0; background: var(--raised); border: 1px solid var(--border); padding: 12px; border-radius: 8px; font-family: var(--mono); font-size: 13px; margin: 0; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.detail-head-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-id-pill { font-weight: 600; background: var(--tint); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); }
.detail-title { margin: 0 0 12px !important; line-height: 1.3; }
.detail-meta-card { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--raised); margin-bottom: 6px; }
.detail-branch-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-radius: var(--radius-control); background: var(--surface); border: 1px solid var(--border); }
.detail-links-row { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-acceptance { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.detail-acceptance li { display: flex; align-items: flex-start; gap: 8px; padding: 6px 10px; border-radius: var(--radius-control); background: var(--raised); border: 1px solid var(--border); font-size: 13px; }
.accept-check { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--pill-positive-bg); color: var(--pill-positive-ink); font-size: 11px; font-weight: 700; flex: none; margin-top: 1px; }
.detail-deliverables-grid { border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.detail-deliverables-grid .deliv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dialog { position: fixed; inset: 0; background: rgb(0 0 0 / 0.28); display: grid; place-items: center; z-index: 30; padding: 16px; }
.dialog .box { width: min(520px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: 0 16px 40px rgb(0 0 0 / 0.18); display: grid; gap: 12px; }
.dialog h2 { margin: 0; font-size: 16px; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--primary); color: var(--primary-ink); padding: 10px 14px; border-radius: 8px; z-index: 40; max-width: calc(100% - 32px); }

/* ---------- settings / setup: stacked v0 cards (t930) ---------- */
.settings { max-width: 1152px; display: grid; gap: 16px; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); align-items: start; }
.srow-head { display: grid; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.tg-compact, .tg-store { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.tg-store code, .tg-problem { overflow-wrap: anywhere; }
.tg-link-box { padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; display: grid; gap: 10px; }
.tg-link-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; list-style-position: inside; margin: 0 !important; padding: 0 !important; }
.tg-link-steps li { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 10px 12px; font-size: 13px; line-height: 1.45; }
.storage-radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.storage-radio-card { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--raised); cursor: pointer; user-select: none; transition: border-color 150ms, background 150ms, box-shadow 150ms; }
.storage-radio-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--surface); }
.storage-radio-card[data-selected="true"] { border-color: var(--accent); background: var(--tint); box-shadow: inset 0 0 0 1px var(--accent); }
.storage-radio-card input[type="radio"] { margin: 0 0 2px 0; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.storage-card-title { font-weight: 600; font-size: 13.5px; color: var(--text); }
.storage-card-sub { line-height: 1.35; }
.vision-char-count { padding: 2px 8px; border-radius: 999px; background: var(--raised); border: 1px solid var(--border); font-size: 11.5px; }
.srow h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 0; color: var(--ink); }
.srow p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }
.spanel { background: var(--raised); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: grid; gap: 14px; min-width: 0; }
.settings-agent-abilities-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: grid; gap: 10px; }
.settings-agent-abilities-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.checks { display: grid; gap: 8px; }
.check { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; }
.check input { margin-top: 3px; }
.check .sub { color: var(--muted); font-size: 13px; }
.codeblock { position: relative; }
.codeblock pre { margin: 0; white-space: pre-wrap; word-break: break-word; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 72px 14px 14px; font: 13px/1.55 var(--mono); max-height: 520px; overflow: auto; }
.codeblock .btn { position: absolute; top: 8px; right: 8px; }
.codeblock.code-terminal pre { background: #0f172a; color: #f8fafc; border-color: #1e293b; }
.codeblock.code-terminal pre code::before { content: "$ "; color: #34d399; user-select: none; }
.codeblock.code-terminal .btn { background: #1e293b; color: #f8fafc; border-color: #334155; }

.usage-limits-table { display: grid; gap: 10px; }
.usage-limit-role-line { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 13px; line-height: 1.9; color: var(--ink); font-variant-numeric: tabular-nums; }
.permission-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.permission-row:first-child { border-top: 0; padding-top: 0; }
.permission-label { font-weight: 600; }
.permission-group { margin: 0 0 20px; }
.permission-group h4, .permission-group summary { margin: 0; font-weight: 600; }
.permission-group summary { cursor: pointer; }
.permission-group > p { margin: 6px 0 12px; }
.permission-description, .permission-reason { flex-basis: 100%; margin: 0; line-height: 1.5; }
.permission-reason { font-size: 12px; }
.permission-action .btn { flex-shrink: 0; }
.permission-action { flex: 1 1 100%; display: flex; gap: 8px; align-items: flex-start; }
.permission-action code { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.permission-toggle { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; }
input.limits-pct-input { display: inline-block; width: 58px; padding: 3px 6px; margin: 0 3px; border: 1px solid var(--border); border-radius: 6px; background: var(--raised); color: var(--ink); font: 600 13px/1.3 var(--mono); text-align: right; font-variant-numeric: tabular-nums; vertical-align: baseline; }
.srow[data-section="Team config"] textarea.code { max-height: 220px; }
.model-routing-form { display: grid; gap: 8px; }
.model-routing-explanation { margin: 6px 0 12px; color: var(--muted); }
.model-routing-error { display: none; }
.usage-limits-overrides { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: var(--raised); border: 1px dashed var(--border); border-radius: 8px; }
.usage-limit-agent { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.usage-limit-agent .agent-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.usage-limit-agent .window-list { display: grid; gap: 8px; }
.usage-limit-window { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px; background: var(--raised); border-radius: 6px; font-size: 13px; }
.usage-limit-window .window-name { font-weight: 500; min-width: 75px; }
.usage-limit-window .used-pct { font-variant-numeric: tabular-nums; }
.usage-limit-window .reset-time { color: var(--muted); font-size: 12px; flex: 1; text-align: right; }
@media (max-width: 480px) {
  .usage-limit-window { flex-wrap: wrap; gap: 8px; }
  .usage-limit-window .reset-time { text-align: left; flex-basis: 100%; }
}

.setup-card { padding: 14px 16px; display: grid; gap: 12px; }
.setup-step { display: grid; gap: 6px; }
.setup-step-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.setup-step-head .step-title { font-weight: 550; font-size: 13px; color: var(--text, var(--ink)); }
.setup-card .switcher { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.setup-card .switcher .label { font-size: 13px; margin-right: 4px; }
.setup-card .note { margin: 0; font-size: 13px; color: var(--muted); }
.agent-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.agent-checks.agent-check-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; align-items: stretch; }
.agent-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; user-select: none; min-height: 28px; padding: 2px 0; }
.agent-check.move-agent-tile { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--raised); transition: border-color 150ms, background 150ms; }
.agent-check.move-agent-tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--surface); }
.agent-check input[type="checkbox"] { margin: 0; cursor: pointer; width: 16px; height: 16px; accent-color: var(--accent); }
.agent-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.expiry-line { display: flex; align-items: center; gap: 8px; }
.expiry-countdown { font-family: var(--mono); color: var(--muted); font-size: 12px; font-weight: 500; }
.expiry-countdown.expired { color: var(--negative); font-weight: 600; }
.actions-row { display: flex; gap: 8px; align-items: center; }
.warnlist { margin: 0; padding-left: 18px; color: var(--warning); }
.form-error { color: var(--negative); font-size: 13px; line-height: 1.4; }

/* ---------- login ---------- */
.login { max-width: 440px; margin: 12vh auto; padding: 0 16px; display: grid; gap: 16px; }
.login .card { padding: 24px; display: grid; gap: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid.overview-cockpit { grid-template-columns: minmax(0, 1fr); }
  .span-8, .span-4, .span-6 { grid-column: span 12; }
  .needs-col { order: -1; }
  .agent { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .agent .meters { grid-column: span 2; }
}
@media (max-width: 760px) {
  :root { --pad: 16px; --gap: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .btn.menu-btn { display: inline-flex; }
  .only-sm { display: inline; }
  .hide-sm-inline { display: none; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; background: var(--ground); z-index: 25; transform: translateX(-100%); transition: transform 200ms var(--ease-out); border-right: 1px solid var(--border); }
  .side.open { transform: none; }
  .side-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 0.28); z-index: 24; }
  .top { flex-wrap: wrap; padding: 8px 12px; gap: 8px; border-bottom: 1px solid var(--border); background: var(--surface); }
  .top .crumbs { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top .grow { display: none; }
  .top-tabs { display: flex; order: 10; flex: 1 0 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .top-tabs::-webkit-scrollbar { display: none; }
  .top-tabs a { flex: 1; justify-content: center; }
  .sheet { margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-top: 0; }
  .title-row { flex-direction: column; }
  .agent { grid-template-columns: minmax(0, 1fr); }
  .agent .meters { grid-column: auto; }
  .agents-setup-grid { grid-template-columns: minmax(0, 1fr); }
  .vision-grid { grid-template-columns: 1fr; }
  .srow { grid-template-columns: 1fr; gap: 12px; }
  .hide-sm { display: none; }
  td { padding: 0 8px; }
  th { padding: 0 8px 8px; }
  [data-slot="tasks-body"] td { height: auto; min-height: var(--row-height); padding-top: 6px; padding-bottom: 6px; }
  [data-slot="tasks-body"] td .t, [data-slot="tasks-body"] td .s { white-space: normal; overflow-wrap: anywhere; max-width: none; }
  [data-slot="tasks-body"] td:first-child, [data-slot="tasks-body"] td:nth-child(4) { white-space: nowrap; }
}
@media (max-width: 480px) {
  td .t { max-width: 28ch; }
  td .desc { max-width: 36ch; }
  td .s { max-width: 28ch; }
  .machine-cards { grid-template-columns: minmax(0, 1fr); }
  .agent-config-grid { grid-template-columns: 1fr; }
  .agent-config-fields { flex-direction: column; align-items: stretch; }
  .agent-config-fields select,
  .agent-config-fields input { width: 100%; }
  .ability-row { flex-direction: column; align-items: stretch; }
  .ability-row .ability-meta { justify-content: space-between; margin-top: 4px; }
  .add-ability-dialog { padding: 14px; width: 100%; max-height: calc(100vh - 20px); }
  .ability-catalog-options { max-height: 60vh; }
  .ability-catalog-card { padding: 8px 10px; font-size: 13px; }
  .skill-row { flex-direction: column; align-items: stretch; }
  .skill-row .skill-meta { justify-content: space-between; margin-top: 4px; }
  .add-skill-dialog { padding: 14px; width: 100%; max-height: calc(100vh - 20px); }
  .skill-catalog-options { max-height: 60vh; }
  .skill-catalog-card { padding: 8px 10px; font-size: 13px; }
  .bug-report-dialog-box { padding: 16px; width: 100%; max-height: calc(100vh - 24px); }
  .report-title-row { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---------- deploy targets editor (t743) ---------- */
.deploy-target-card { padding: 16px; }
.targets-edit-form { padding: 16px; display: grid; gap: 14px; margin-bottom: 16px; min-width: 0; }
.targets-edit-rows { display: grid; gap: 12px; min-width: 0; }
.target-edit-row { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--raised); min-width: 0; }
.target-edit-inputs { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(200px, 2fr); gap: 10px; min-width: 0; }
.target-edit-flags { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.targets-form-error { padding: 10px 12px; border-radius: var(--radius-control); background: var(--pill-negative-bg); color: var(--pill-negative-ink); border: 1px solid var(--negative); font-size: 13px; }
.targets-edit-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.primary-targets-hint { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.primary-targets-hint code { font-family: var(--mono); font-size: 12px; }
/* t894: a long detected command and its reason wrap inside the chip; .btn's nowrap and fixed height would overflow 390px. */
.btn.target-suggestion-chip { white-space: normal; height: auto; min-height: 28px; max-width: 100%; padding: 4px 10px; flex-wrap: wrap; justify-content: flex-start; text-align: left; }
/* overflow-wrap: anywhere also lowers the min-content width, so an unbroken path or URL can shrink inside a flex row. */
.target-suggestion-chip code, .target-command { overflow-wrap: anywhere; max-width: 100%; }
@media (max-width: 480px) {
  .target-edit-inputs { grid-template-columns: 1fr; }
  .target-edit-flags { flex-direction: column; align-items: flex-start; }
  .targets-edit-actions { flex-direction: column; align-items: stretch; }
  .targets-edit-submit-group { justify-content: flex-end; }
}

/* ---------- bug reports (t665) ---------- */
.report-bug-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 12px; display: inline-block; margin-top: 4px; }
.report-bug-link:hover { color: var(--text); }
.bug-report-dialog-box { width: min(580px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: 0 16px 40px rgb(0 0 0 / 0.18); display: grid; gap: 16px; }
.bug-report-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bug-report-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.bug-report-tab { background: none; border: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; padding: 6px 12px; border-radius: var(--radius-control); transition: all 150ms ease; }
.bug-report-tab:hover { color: var(--text); background: var(--raised); }
.bug-report-tab.active { color: var(--text); background: var(--active); font-weight: 600; }
.bug-report-promise { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0; padding: 10px 12px; background: var(--raised); border-radius: var(--radius-control); border-left: 3px solid var(--accent); }
.bug-report-form { display: grid; gap: 14px; }
.form-field { display: grid; gap: 4px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.form-input, .form-textarea { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px; padding: 8px 10px; border-radius: var(--radius-control); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.consent-field { margin-top: 4px; }
.consent-label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; line-height: 1.4; color: var(--text); }
.consent-label input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }
.consent-versions { color: var(--muted); font-size: 12px; margin-left: 4px; }
.my-reports-view, .reports-list { display: grid; gap: 12px; }
.report-item { border: 1px solid var(--border); border-radius: var(--radius-control); padding: 14px; background: var(--surface); display: grid; gap: 10px; }
.report-header { display: grid; gap: 4px; }
.report-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.report-title { font-weight: 600; font-size: 14px; color: var(--text); }
.report-meta { font-size: 12px; }
.report-replies { display: grid; gap: 8px; border-top: 1px solid var(--rule); padding-top: 10px; }
.report-reply { background: var(--raised); border-radius: var(--radius-control); padding: 10px 12px; display: grid; gap: 4px; }
.reply-header { display: flex; align-items: center; justify-content: space-between; font-size: 11px; }
.reply-author { font-weight: 600; color: var(--accent); }
.reply-time { color: var(--muted); }
.reply-text { font-size: 13px; line-height: 1.4; color: var(--text); white-space: pre-wrap; }
.chip.chip-received { background: var(--pill-info-bg); color: var(--pill-info-ink); }
.chip.chip-triaged { background: var(--pill-qa-bg); color: var(--pill-qa-ink); }
.chip.chip-needs-info { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.chip.chip-planned { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.chip.chip-fixed { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.chip.chip-declined { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* t1057: agents on the left. The right column is one vertical chain: Intake above the Coordinator, Completed attached below it (t1559). */
.dispatch-canvas { position: relative; --plaque-font-size: calc(12px - 2pt); --plaque-inset: 12px; }
.dispatch-spokes { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.dispatch-grid { position: relative; z-index: 1; display: grid; --dispatch-row-gap: 12px; --dispatch-col-gap: 8px; row-gap: var(--dispatch-row-gap); column-gap: var(--dispatch-col-gap); min-width: 0; grid-template-columns: minmax(0, 64fr) minmax(0, 14fr) minmax(0, 22fr); grid-template-areas: "agents . intake" "agents . coord" "agents . done"; }
.dispatch-intake { grid-area: intake; align-self: end; z-index: 2; min-width: 0; } .dispatch-coord { grid-area: coord; min-width: 0; overflow: hidden; } .dispatch-agents { grid-area: agents; display: grid; gap: 8px; align-content: start; min-width: 0; } .dispatch-done { grid-area: done; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; width: calc(100% - var(--plaque-inset)); margin: calc(-1 * var(--dispatch-row-gap, 12px) - 1px) var(--plaque-inset) 0 0; } .dispatch-done:empty { display: none; } .dispatch-done .dispatch-bar.plaque:not(.plaque-more) { width: 100%; max-width: 240px; border-top-color: var(--surface); border-bottom-color: var(--plaque, var(--border)); border-radius: 0 0 4px 4px; } .dispatch-bar.plaque.plaque-more { cursor: pointer; font-size: var(--plaque-font-size); text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); padding: 3px 8px; width: 100%; max-width: 240px; border-radius: 4px; box-sizing: border-box; } .dispatch-bar.plaque.plaque-more:hover, .dispatch-bar.plaque.plaque-more:focus-visible { color: var(--text); border-color: var(--positive); outline: none; } .dispatch-owner-slot { grid-area: owner; min-height: 48px; min-width: 0; display: flex; flex-direction: column; position: relative; z-index: 2; } .dispatch-owner { background: var(--owner-bg); border-color: var(--owner); color: var(--text); } .dispatch-flyer { position: fixed; z-index: 30; pointer-events: none; padding: 1px 8px; font-size: 12px; white-space: nowrap; border-radius: 4px 4px 0 0; background: var(--surface); border: 1px solid var(--border); } .dispatch-flyer[data-queued="1"] { opacity: 0; } .dispatch-owner h3 { color: var(--owner-ink); }
.dispatch-node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.dispatch-node h3 { margin: 0 0 8px; font-size: 14px; }
.dispatch-badge { font-size: 11px; font-weight: 600; margin-left: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; }
.dispatch-fold, .dispatch-bar { margin: 4px 0; }
.dispatch-fold summary, .dispatch-bar summary { cursor: pointer; min-height: 44px; padding: 6px 8px; }
.dispatch-bar { border-left: 4px solid var(--phase, var(--muted)); border-radius: 6px; background: color-mix(in srgb, var(--phase, var(--muted)) 14%, var(--surface)); }
.dispatch-bar summary { padding: 4px 8px; }
.dispatch-bar-links, .dispatch-summary, .dispatch-plaque-body { margin: 4px 8px 6px; font-size: 12px; } .dispatch-summary { overflow-wrap: break-word; word-break: break-word; }
.dispatch-status { margin: 0; font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dispatch-last { margin: 2px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.dispatch-agent > .dispatch-node > h3, .dispatch-coord > h3 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; min-width: 0; } .dispatch-agent > .dispatch-node > h3 > a, .dispatch-coord > h3 > a { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dispatch-capacity { color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; margin-left: auto; }
.dispatch-model { font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.dispatch-coord > h3 > .dispatch-model, .dispatch-agent > .dispatch-node > h3 > .dispatch-model { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dispatch-model.stale { opacity: 0.75; font-style: italic; }
.dispatch-model.configured, .model-name.configured { text-decoration: underline dotted; text-underline-offset: 2px; }
.model-name.configured { color: var(--muted); }
.model-name.stale { opacity: 0.75; font-style: italic; }
.dispatch-agent[data-tone="red"] > .dispatch-node, .dispatch-coord[data-tone="red"] { border-color: var(--negative); }
.dispatch-agent[data-tone="yellow"] > .dispatch-node, .dispatch-coord[data-tone="yellow"] { border-color: var(--warning); }
.dispatch-agent[data-tone="green"] > .dispatch-node, .dispatch-coord[data-tone="green"] { border-color: var(--positive); }
.dispatch-owner[data-tone="red"] {
  background: var(--needs-urgent-bg);
  border-color: var(--needs-urgent-border);
  box-shadow: var(--needs-urgent-glow);
  animation: owner-urgent-pulse 2.5s ease-in-out infinite;
}
.dispatch-owner[data-tone="red"] h3 {
  color: var(--needs-urgent-border);
}
.dispatch-owner[data-tone="yellow"] {
  background: var(--needs-attention-bg);
  border-color: var(--needs-attention-border);
  box-shadow: var(--needs-attention-glow);
}
.dispatch-owner[data-tone="yellow"] h3 {
  color: var(--needs-attention-border);
}
.dispatch-owner[data-tone="muted"] {
  opacity: 0.85;
}
.dispatch-status[data-tone="red"] {
  color: var(--needs-urgent-border);
  font-weight: 600;
}
.dispatch-status[data-tone="yellow"] {
  color: var(--needs-attention-border);
  font-weight: 600;
}
.dispatch-bar.plaque.pulse {
  animation: plaque-urgent-pulse 2s ease-in-out infinite;
}
@keyframes owner-urgent-pulse {
  0%, 100% {
    box-shadow: var(--needs-urgent-glow);
  }
  50% {
    box-shadow: var(--needs-urgent-glow-hot);
  }
}
@keyframes plaque-urgent-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1px var(--plaque), 0 0 8px rgba(225, 29, 72, 0.4);
  }
  50% {
    box-shadow: 0 0 0 2px var(--plaque), 0 0 16px rgba(225, 29, 72, 0.7);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dispatch-owner[data-tone="red"],
  .dispatch-bar.plaque.pulse {
    animation: none;
  }
}
.dispatch-agent { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-width: 0; }
.dispatch-agent > .dispatch-node { width: 100%; }
.plaque-stack { display: flex; flex-direction: column-reverse; align-items: flex-start; width: calc(100% - var(--plaque-inset, 12px)); margin: 0 0 -1px var(--plaque-inset, 12px); position: relative; z-index: 1; max-width: 100%; min-width: 0; } .dispatch-bar { max-width: 100%; min-width: 0; }
.dispatch-intake.plaque-stack { flex-direction: column; margin-bottom: calc(-1 * var(--dispatch-row-gap, 12px) - 1px); }
.dispatch-intake.plaque-stack:empty { display: none; }
.dispatch-intake-label { display: block; margin: 0 0 2px 12px; font-size: 11px; color: var(--muted); }
.dispatch-bar.plaque { width: 240px; box-sizing: border-box; margin: 0; border: 1px solid var(--plaque, var(--border)); border-bottom-color: var(--surface); border-radius: 4px 4px 0 0; background: var(--plaque-bg, var(--surface)); }
.dispatch-bar.plaque summary { min-height: 0; padding: 1px 8px; font-size: var(--plaque-font-size); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plaque-neutral { --plaque: var(--tone-neutral-border); --plaque-bg: var(--tone-neutral-bg); }
.plaque-info { --plaque: var(--tone-info-border); --plaque-bg: var(--tone-info-bg); }
.plaque-qa { --plaque: var(--tone-qa-border); --plaque-bg: var(--tone-qa-bg); }
.plaque-merge { --plaque: var(--tone-merge-border); --plaque-bg: var(--tone-merge-bg); }
.plaque-warn { --plaque: var(--tone-warn-border); --plaque-bg: var(--tone-warn-bg); }
.plaque-pos { --plaque: var(--tone-pos-border); --plaque-bg: var(--tone-pos-bg); }
.plaque-muted { --plaque: var(--tone-muted-border); --plaque-bg: var(--tone-muted-bg); }
.plaque-surface { --plaque: var(--tone-surface-border); --plaque-bg: var(--tone-surface-bg); }
.plaque-red { --plaque: var(--negative); --plaque-bg: var(--needs-urgent-bg); }
.dispatch-bar.plaque summary .task-mark { width: 0.55em; height: 0.55em; margin-right: 0.35em; vertical-align: -0.05em; }
.plaque-phone { display: none; }
.spoke { stroke: var(--chart-muted); stroke-width: 0.7; fill: none; }
.spoke.pulse { stroke: var(--positive, #157f4b); stroke-width: 1.15; stroke-dasharray: 2 1.2; animation: dispatch-pulse 1.2s linear infinite; }
@keyframes dispatch-pulse { to { stroke-dashoffset: -8; } }
@media (prefers-reduced-motion: reduce) {
  .spoke.pulse {
    animation: none;
  }
}
.phase-running { --phase: #1b6c80; } .phase-reviewing { --phase: #7c3aed; } .phase-testing { --phase: #2f70bb; }
.phase-changes { --phase: #b45309; } .phase-blocked { --phase: #b42318; } .phase-ready { --phase: #157f4b; }
.phase-idle { --phase: #94a3b8; } .phase-done { --phase: #55636b; }
@media (min-width: 1280px) {
  .dispatch-grid { grid-template-columns: minmax(0, 64fr) minmax(0, 14fr) minmax(0, 22fr); grid-template-areas: "agents . intake" "agents . coord" "agents . done"; }
}
/* Tasks list on a phone/mobile shell (t1163, t1543): full-width plaques up to 760px. The desktop table stays. */
.task-plaques { display: none; }
.task-plaque { box-sizing: border-box; width: 100%; min-width: 0; display: grid; gap: 4px; padding: 12px; border-top: 1px solid var(--rule); cursor: pointer; background: var(--surface); }
.task-plaque-head { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; word-break: break-word; }
.task-plaque-title { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.task-plaque-reason { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.task-plaque-status { display: flex; align-items: center; min-width: 0; flex-wrap: wrap; }

@media (max-width: 760px) {
  .dispatch-grid { grid-template-columns: 1fr; grid-template-areas: "intake" "coord" "done" "owner" "agents"; }
  .dispatch-done .dispatch-bar.plaque:not(.plaque-more) { width: 240px; max-width: 100%; }
  .dispatch-bar.plaque.plaque-more { width: 240px; max-width: 100%; }
  .dispatch-grid { padding-left: 14px; }
  /* Own row so a short label such as grok4.7 is not clipped mid-glyph by the card overflow. */
  .dispatch-coord > h3 > .dispatch-model, .dispatch-agent > .dispatch-node > h3 > .dispatch-model { flex: 1 0 100%; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dispatch-intake.plaque-stack { margin-bottom: calc(-1 * var(--dispatch-row-gap, 12px) - 1px); }
  .dispatch-owner-slot:empty { display: none; min-height: 0; }
  .dispatch-fold summary, .dispatch-bar summary { min-height: 44px; }
  .dispatch-bar.plaque summary { min-height: 0; }
  [data-slot="tasks-body"] > .table-wrap table { display: none; }
  [data-slot="tasks-body"] .task-plaques { display: grid; gap: 0; }
}
@media (max-width: 480px) {
  .plaque-phone { display: inline; }
  .plaque-desk { display: none; }
  .dispatch-bar.plaque { width: min(200px, 100% - 12px); }
  .dispatch-done .dispatch-bar.plaque:not(.plaque-more) { width: min(200px, 100% - 12px); }
  .dispatch-bar.plaque.plaque-more { width: min(200px, 100% - 12px); }
}

/* Task modal (t1150): one singleton <dialog> on document.body, outside every polled slot. */
dialog.task-modal { border: 0; padding: 0; width: min(720px, calc(100% - 24px)); max-height: 90vh; background: var(--card); color: inherit; border-radius: 12px; box-shadow: 0 18px 50px rgb(0 0 0 / 0.35); }
dialog.task-modal::backdrop { background: rgb(0 0 0 / 0.45); }
.task-modal-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border, var(--line, rgb(0 0 0 / 0.12))); background: var(--card); }
.task-modal-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-modal-body { overflow: auto; padding: 0 16px 16px; max-height: calc(90vh - 53px); }
.task-modal-body pre { white-space: pre-wrap; word-break: break-word; }
@media (max-width: 520px) {
  dialog.task-modal { width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }
  .task-modal-body { max-height: none; height: calc(100% - 53px); }
}

/* Readable task text (t1152) */
.task-text { line-height: 1.6; word-break: break-word; }
.task-text p { margin: 0 0 10px; }
pre.task-code-block { font-family: "Geist Mono", monospace; font-size: 12px; line-height: 1.45; white-space: pre; overflow-x: auto; padding: 10px 14px; background: var(--raised); border: 1px solid var(--border); border-radius: 6px; margin: 10px 0; }
pre.task-code-block code { font-family: inherit; background: transparent; padding: 0; }
code.cli-token, code.path-token, code.env-token, code.inline-code { font-family: "Geist Mono", monospace; font-size: 0.9em; padding: 2px 5px; background: var(--raised); border: 1px solid var(--border); border-radius: 4px; }
a.task-id-link { font-family: "Geist Mono", monospace; font-weight: 600; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a.task-id-link:hover { color: var(--accent-hover); }
a.pr-ref-link { font-family: "Geist Mono", monospace; font-weight: 500; color: var(--chart-2); text-decoration: underline; }
.task-section-label { color: var(--text); font-weight: 600; }
.warn-token { color: var(--warning); font-weight: 600; }
.unit-token { color: var(--accent); font-weight: 500; font-family: "Geist Mono", monospace; }
.owner-msg-id { opacity: 0.65; }
.task-text-list { margin: 8px 0; padding-left: 20px; }
.task-text-list li { margin-bottom: 4px; }


.owner-action-confirm { display: flex; align-items: flex-start; gap: 8px; min-height: 44px; cursor: pointer; overflow-wrap: anywhere; }
.owner-action-confirm input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; }
.owner-action-confirm span { min-width: 0; }

.park-status { display: inline-grid; gap: 4px; justify-items: start; max-width: 28rem; white-space: normal; }
.park-reason { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
