:root {
  color-scheme: light;
  --ink: #1a1a1a;
  --ink-soft: #363532;
  --muted: #706e68;
  --paper: #f5f3ee;
  --panel: #ffffff;
  --surface-subtle: #ece9e2;
  --line: #ceccc5;
  --line-strong: #9d9a92;
  --agent: #3157d5;
  --agent-soft: #e8ecfb;
  --green: #23745b;
  --green-dark: #18513f;
  --green-soft: #e3f0ea;
  --warning: #b85c22;
  --warning-soft: #faeadf;
  --coral: #a63a2a;
  --coral-soft: #f6e4df;
  --focus: #e4552f;
  --scroll-thumb: #85827a;
  --scroll-track: #e8e5de;
  --shadow-layer: 0 24px 80px rgba(26, 26, 26, 0.2);
  --z-sticky: 120;
  --z-backdrop: 500;
  --z-dialog: 600;
  --z-sheet: 700;
  --z-toast: 900;
  --font-display: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
  --font-utility: SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-family: var(--font-display);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  scrollbar-width: thin;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--scroll-track); }
*::-webkit-scrollbar-thumb { border: 2px solid var(--scroll-track); background: var(--scroll-thumb); }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-soft); }
*::-webkit-scrollbar-thumb:active { background: var(--ink); }

html { min-width: 320px; background: var(--paper); scroll-padding-top: 24px; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(90deg, rgba(26, 26, 26, 0.025) 1px, transparent 1px) 0 0 / 25% 100%, var(--paper);
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
/* Utility state must win over component display declarations. */
.hidden { display: none !important; }
.modal-open { overflow: hidden; }

.skip-link { position: fixed; left: 18px; top: -70px; z-index: var(--z-toast); padding: 12px 16px; color: white; background: var(--ink); border: 1px solid white; }
.skip-link:focus { top: 18px; }
.app-shell { width: min(1920px, 100%); margin: 0 auto; padding: 0 30px 64px; }
.topbar { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--line); }

.brand-lockup, .topbar-meta, .connection-pill, .revision-pill, .legend span, .board-toolbar, .view-toggle, .task-card-footer, .modal-footer, .merge-section-title, .merge-footer, .toast, .confirm-actions { display: flex; align-items: center; }
.brand-lockup { gap: 16px; }
.brand-lockup h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.045em; text-transform: uppercase; }
.brand-mark { display: block; width: 50px; height: 50px; flex: none; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-family: var(--font-utility); font-size: 10px; font-weight: 600; letter-spacing: 0.105em; line-height: 1.3; text-transform: uppercase; }

.topbar-meta { justify-content: flex-end; gap: 0; }
.demo-nav { flex: none; display: flex; gap: 0; padding: 3px; border: 1px solid var(--line); background: var(--panel); }
.demo-nav a { padding: 7px 11px; color: var(--muted); font-family: var(--font-utility); font-size: 9px; font-weight: 600; letter-spacing: 0.025em; text-decoration: none; }
.demo-nav a + a { border-left: 1px solid var(--line); }
.demo-nav a.active { color: white; background: var(--ink); }
.connection-pill, .revision-pill { min-height: 40px; gap: 9px; padding: 0 15px; border-left: 1px solid var(--line); color: var(--muted); font-family: var(--font-utility); font-size: 10px; letter-spacing: 0.025em; }
.connection-pill { border-width: 0 0 0 1px; border-color: var(--line); background: transparent; cursor: pointer; text-align: left; }
.connection-pill:hover { color: var(--ink); background: var(--surface-subtle); }
.connection-action { margin-left: 2px; color: var(--ink); font-size: 12px; }
.revision-pill strong { color: var(--ink); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); box-shadow: 0 0 0 3px var(--surface-subtle); }
.connection-pill.is-connected .status-dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.connection-pill.is-partial .status-dot { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }

.button, .icon-button, .choice-button, .view-toggle, .add-task-button, .search-clear { min-height: 40px; border: 1px solid transparent; border-radius: 2px; cursor: pointer; transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.button { position: relative; padding: 10px 16px; font-size: 12px; font-weight: 650; letter-spacing: -0.01em; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { color: white; background: var(--ink); border-color: var(--ink); }
.button-primary:hover:not(:disabled) { background: var(--focus); border-color: var(--focus); }
.button-dark { color: white; background: var(--ink); border-color: var(--ink); }
.button-dark:hover:not(:disabled) { background: var(--agent); border-color: var(--agent); }
.button-quiet { background: transparent; border-color: var(--line); }
.button-quiet:hover:not(:disabled) { border-color: var(--ink); background: var(--panel); }
.button-warning { color: var(--warning); background: transparent; border-color: #d8a07c; }
.button-warning:hover:not(:disabled) { color: white; background: var(--warning); border-color: var(--warning); }
.button-danger { color: var(--coral); background: var(--coral-soft); border-color: #dba79d; }
.button-restore { color: var(--green-dark); background: var(--green-soft); border-color: #91bba9; }
.button-commit { min-width: 164px; color: white; background: var(--ink); border-color: var(--ink); }
.button:disabled { opacity: 0.4; cursor: not-allowed; }

.form-alert { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 11px 12px; color: var(--warning); background: var(--warning-soft); border: 1px solid #d8a07c; font-size: 11px; line-height: 1.45; }
.form-alert .button { min-width: max-content; color: var(--warning); background: var(--panel); border-color: #d8a07c; }
.form-alert .button:hover { color: white; background: var(--warning); border-color: var(--warning); }

.button:focus-visible, .connection-pill:focus-visible, .icon-button:focus-visible, .choice-button:focus-visible, .task-card:focus-visible, .view-toggle:focus-visible, .add-task-button:focus-visible, .search-clear:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.hero { min-height: 440px; display: grid; grid-template-columns: minmax(410px, 0.86fr) minmax(540px, 1.14fr); margin-top: 26px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); animation: hero-in 420ms cubic-bezier(.22,.75,.28,1) both; }
@keyframes hero-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hero-copy { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 28px 34px 30px; border-right: 1px solid var(--line); }
.hero-meta, .hero-stage-heading, .demo-card-heading, .column-heading, .section-heading, .modal-header, .merge-header, .conflict-heading { display: flex; justify-content: space-between; gap: 18px; }
.hero-meta span, .hero-stage-heading, .demo-card-heading { font-family: var(--font-utility); font-size: 9px; letter-spacing: 0.075em; text-transform: uppercase; }
.hero-copy h2 { margin: 30px 0; font-size: clamp(72px, 9.5vw, 156px); font-weight: 500; letter-spacing: -0.085em; line-height: 0.76; }
.hero-intro { display: grid; grid-template-columns: 36px minmax(0, 430px); gap: 20px; align-items: start; }
.hero-intro > span { padding-top: 4px; font-family: var(--font-utility); font-size: 10px; }
.hero-intro p { margin: 0; font-size: 15px; line-height: 1.55; }
.hero-stage { position: relative; min-width: 0; overflow: hidden; color: white; background: var(--ink); }
.hero-stage-heading { position: absolute; z-index: 2; inset: 26px 28px auto; color: #c6c3bc; }
.merge-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.merge-map-grid { fill: none; stroke: rgba(255,255,255,0.09); stroke-width: 1; }
.merge-path { fill: none; stroke-width: 2; }
.human-path { stroke: #f5f3ee; }
.agent-path { stroke: #6f88e6; stroke-dasharray: 8 8; }
.merge-node { stroke: var(--ink); stroke-width: 3; }
.human-node { fill: #f5f3ee; }
.agent-node { fill: #6f88e6; }
.commit-node { fill: var(--focus); }
.merge-map text { fill: #aba8a1; font-family: var(--font-utility); font-size: 9px; letter-spacing: 0.08em; }

.demo-card { position: absolute; z-index: 3; left: 28px; right: 28px; bottom: 26px; padding: 19px 20px 18px; color: var(--ink); background: rgba(245, 243, 238, 0.97); border: 1px solid rgba(255,255,255,0.28); }
.demo-card-heading { color: var(--muted); }
.step-kicker { color: var(--agent); font-weight: 700; }
.demo-card-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 0.78fr); gap: 20px; margin-top: 16px; }
.demo-step { min-width: 0; }
.demo-card h3 { margin: 0 0 5px; font-size: 18px; letter-spacing: -0.035em; }
.demo-card p { max-width: 630px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.agent-prompt { display: grid; gap: 4px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line); }
.agent-prompt span, .tool-trace-heading, .tool-trace-row span { font-family: var(--font-utility); font-size: 8px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.agent-prompt span { color: var(--muted); }
.agent-prompt code { overflow: hidden; color: var(--ink); font-family: var(--font-utility); font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.demo-actions { margin-top: 16px; display: flex; gap: 8px; }
.tool-trace-panel { min-width: 0; padding-left: 16px; border-left: 1px solid var(--line); }
.tool-trace-heading { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.tool-trace-heading strong { color: var(--agent); font-weight: 700; }
.tool-trace-list { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.tool-trace-item, .tool-trace-empty { min-width: 0; padding: 7px 0; border-top: 1px solid var(--line); }
.tool-trace-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tool-trace-row code { min-width: 0; overflow: hidden; font-family: var(--font-utility); font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.tool-trace-row span { flex: none; color: var(--green-dark); }
.tool-trace-item.is-running .tool-trace-row span { color: var(--agent); }
.tool-trace-item.is-error .tool-trace-row span { color: var(--coral); }
.tool-trace-item.is-guided .tool-trace-row span { color: var(--muted); }
.tool-trace-item p { margin-top: 2px; overflow: hidden; font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.tool-trace-empty { display: grid; gap: 2px; color: var(--muted); font-size: 9px; }
.tool-trace-empty strong { color: var(--ink); font-size: 10px; }

.branch-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 76px; margin: 18px 0 26px; padding: 12px 16px; border: 1px solid var(--line); background: rgba(255,255,255,0.64); }
.branch-strip.is-active { border-color: #9faee6; background: var(--agent-soft); }
.branch-strip.is-merged { border-color: #97b9aa; background: var(--green-soft); }
.branch-icon { width: 44px; height: 44px; display: grid; place-items: center; color: white; background: var(--ink); font-size: 22px; }
.branch-copy { min-width: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; }
.branch-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.branch-copy > span:last-child { grid-column: 1 / -1; margin-top: 4px; color: var(--muted); font-size: 11px; }
.branch-label { color: var(--agent); font-family: var(--font-utility); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.branch-actions { display: flex; gap: 8px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.board-section, .activity-panel { border: 1px solid var(--line); background: var(--panel); }
.board-section { min-width: 0; padding: 22px; overflow: hidden; }
.activity-panel { position: sticky; top: 18px; max-height: calc(100vh - 36px); padding: 22px 18px; overflow: hidden; color: white; background: var(--ink); border-color: var(--ink); }
.section-heading { align-items: flex-end; margin-bottom: 20px; }
.section-heading.compact { align-items: center; }
.section-heading h2 { margin: 0; font-size: 30px; font-weight: 550; letter-spacing: -0.05em; }
.board-sync { min-height: 17px; display: flex; align-items: center; gap: 6px; margin: 7px 0 0; color: var(--muted); font-family: var(--font-utility); font-size: 9px; letter-spacing: 0.025em; }
.board-sync-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.board-sync.is-remote-update { color: var(--green-dark); }
.board-sync.is-remote-update .board-sync-dot { animation: sync-pulse 700ms ease-out; }
.board-sync.is-limited { color: var(--warning); }
.board-sync.is-limited .board-sync-dot { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.board-sync-separator { color: var(--line-strong); }
@keyframes sync-pulse { 50% { box-shadow: 0 0 0 7px rgba(35, 116, 91, 0.13); } }
.activity-panel .eyebrow, .activity-panel .section-heading { color: #aaa7a0; }
.activity-panel .section-heading h2 { color: white; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 10px; }
.legend span { gap: 6px; }
.legend-dot { width: 10px; height: 2px; background: var(--ink); }
.legend-dot.agent { background: var(--agent); }
.count-badge { min-width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #595752; font-family: var(--font-utility); font-size: 10px; }

.board-toolbar { min-height: 58px; gap: 0; margin-bottom: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.search-control { position: relative; width: min(340px, 36%); min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 14px 0 4px; border-right: 1px solid var(--line); color: var(--muted); }
.search-control:focus-within { box-shadow: inset 0 -2px var(--focus); }
.search-icon { position: relative; width: 15px; height: 15px; flex: none; border: 1.5px solid currentColor; border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.5px; right: -5px; bottom: -2px; background: currentColor; transform: rotate(45deg); }
.search-control input { width: 100%; min-width: 0; padding: 12px 4px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-control input::-webkit-search-cancel-button { appearance: none; }
.search-clear { min-width: 30px; min-height: 30px; padding: 0; background: transparent; border-color: var(--line); line-height: 1; }
.search-clear:hover { color: white; background: var(--ink); border-color: var(--ink); }
.board-metrics { flex: 1; display: flex; align-items: stretch; overflow-x: auto; }
.metric-pill { flex: none; display: grid; place-items: center; min-width: 88px; padding: 9px 12px; border-right: 1px solid var(--line); color: var(--muted); font-family: var(--font-utility); font-size: 8px; letter-spacing: 0.05em; text-align: center; text-transform: uppercase; }
.metric-pill strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 15px; line-height: 1.1; }
.view-toggle { flex: none; gap: 10px; min-height: 56px; padding: 0 14px; background: transparent; border-width: 0 0 0 1px; border-color: var(--line); font-size: 11px; font-weight: 600; }
.view-toggle strong { min-width: 24px; height: 24px; display: grid; place-items: center; color: white; background: var(--ink); font-family: var(--font-utility); font-size: 9px; }
.view-toggle:hover, .view-toggle.is-active { color: white; background: var(--ink); }
.view-toggle:hover strong, .view-toggle.is-active strong { color: var(--ink); background: white; }
.board-empty { margin: 18px 0 0; padding: 52px 20px; border: 1px dashed var(--line-strong); text-align: center; }
.board-empty p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 10px; overflow-x: auto; padding: 0 0 12px; scrollbar-gutter: stable; }
.board.is-archive-view { grid-template-columns: 1fr; }
.board-column { min-height: 550px; padding: 12px; border: 1px solid #ddd9d1; background: var(--surface-subtle); }
.column-heading { align-items: center; padding: 1px 2px 14px; border-bottom: 1px solid var(--line); }
.column-heading > div p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.column-heading h3 { margin: 0; font-size: 12px; font-weight: 650; letter-spacing: -0.01em; }
.column-heading span { color: var(--muted); font-family: var(--font-utility); font-size: 9px; }
.column-cards { min-height: 460px; padding-top: 10px; }
.column-cards.is-drop-target { outline: 2px solid var(--agent); outline-offset: -2px; background: rgba(49,87,213,0.06); }
.archived-column { min-height: 190px; }
.archived-column .column-cards { min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 10px; }
.archived-column .task-card { margin-bottom: 0; }

.task-card { position: relative; min-height: 146px; margin-bottom: 9px; padding: 13px 13px 12px; border: 1px solid #d6d2ca; border-top: 2px solid var(--ink); border-radius: 2px; background: var(--panel); cursor: pointer; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.task-card:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: 4px 4px 0 rgba(26,26,26,0.13); }
.task-card:active { transform: translateY(0); box-shadow: none; }
.task-card.is-dragging { opacity: 0.42; }
.task-card.is-proposal, .task-card.has-proposal { border: 1px dashed var(--agent); border-top: 2px solid var(--agent); background: #f7f8fe; }
.task-card.is-proposal { opacity: 0.84; cursor: default; }
.task-card.is-proposal:hover { transform: none; box-shadow: none; }
.task-card.is-archived { opacity: 0.76; border-style: dashed; }
.task-card.is-critical { border-left: 3px solid var(--coral); }
.task-card-topline { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.priority-chip, .proposal-chip { font-family: var(--font-utility); font-size: 8px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.priority-chip { color: var(--muted); }
.priority-chip[data-priority="critical"] { color: var(--coral); }
.priority-chip[data-priority="high"] { color: var(--agent); }
.proposal-chip { padding: 3px 5px; color: var(--agent); border: 1px solid #a8b6eb; background: var(--agent-soft); }
.task-card h3 { margin: 12px 0 6px; font-size: 14px; line-height: 1.25; letter-spacing: -0.025em; }
.task-description { margin: 0; overflow: hidden; color: var(--muted); font-size: 10.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.proposal-diff { margin-top: 10px; padding: 7px; color: #2342ad; background: var(--agent-soft); font-size: 9px; line-height: 1.4; }
.task-card-footer { justify-content: space-between; margin-top: 14px; }
.avatar { width: 25px; height: 25px; display: grid; place-items: center; color: white; background: var(--avatar-color, #74716b); font-family: var(--font-utility); font-size: 8px; font-weight: 700; }
.avatar.is-unassigned { color: var(--muted); background: transparent; border: 1px dashed var(--line-strong); }
.due-date { color: var(--muted); font-family: var(--font-utility); font-size: 8px; }
.due-date.is-overdue { color: var(--coral); font-weight: 700; }
.add-task-button { width: 100%; min-height: 36px; padding: 8px 4px; color: var(--muted); background: transparent; border: 0; text-align: left; font-size: 10px; }
.add-task-button:hover { color: var(--ink); padding-left: 9px; }

.activity-list { position: relative; max-height: calc(100vh - 130px); margin: 0; padding: 0 2px 10px 0; overflow-y: auto; list-style: none; scrollbar-gutter: stable; }
.activity-list::before { content: ""; position: absolute; top: 7px; bottom: 7px; left: 6px; width: 1px; background: #4b4945; }
.activity-item { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 0 0 22px; }
.activity-marker { position: relative; z-index: 1; width: 9px; height: 9px; margin: 4px 0 0 2px; border: 2px solid var(--ink); background: #8c8982; box-shadow: 0 0 0 1px #8c8982; }
.actor-agent .activity-marker { background: #7087e1; box-shadow: 0 0 0 1px #7087e1; }
.actor-human .activity-marker { background: #f0ede5; box-shadow: 0 0 0 1px #f0ede5; }
.actor-system .activity-marker { background: #63a78c; box-shadow: 0 0 0 1px #63a78c; }
.activity-time { float: right; color: #85817a; font-family: var(--font-utility); font-size: 8px; }
.activity-item strong { display: block; padding-right: 30px; color: white; font-size: 11px; line-height: 1.35; }
.activity-item p { margin: 4px 0 0; color: #aaa7a0; font-size: 10px; line-height: 1.45; }

.modal-backdrop, .confirm-backdrop { position: fixed; inset: 0; z-index: var(--z-dialog); display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: rgba(18, 18, 18, 0.7); backdrop-filter: blur(7px); }
.modal-card, .confirm-card { width: min(600px, 100%); max-height: min(780px, calc(100dvh - 40px)); overflow-y: auto; padding: 26px; background: var(--panel); border: 1px solid var(--ink); box-shadow: var(--shadow-layer); animation: dialog-in 220ms ease-out both; }
.confirm-card { width: min(460px, 100%); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-header, .merge-header { align-items: flex-start; }
.modal-header { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.modal-header h2, .confirm-card h2 { margin: 0; font-size: 30px; font-weight: 550; letter-spacing: -0.055em; }
.confirm-card > p:not(.eyebrow) { margin: 16px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.confirm-actions { justify-content: flex-end; gap: 8px; }
.icon-button { width: 40px; min-width: 40px; padding: 0; display: grid; place-items: center; background: transparent; border-color: var(--line); font-size: 21px; }
.icon-button:hover { color: white; background: var(--ink); border-color: var(--ink); transform: rotate(2deg); }
.task-form label { display: grid; gap: 7px; margin-bottom: 16px; color: var(--muted); font-family: var(--font-utility); font-size: 9px; font-weight: 600; letter-spacing: 0.055em; text-transform: uppercase; }
.task-form input, .task-form select, .task-form textarea { width: 100%; min-height: 44px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 2px; color: var(--ink); background: white; outline: none; font-family: var(--font-display); font-size: 13px; letter-spacing: normal; text-transform: none; }
.task-form textarea { min-height: 100px; resize: none; line-height: 1.5; }
.task-form input:hover, .task-form select:hover, .task-form textarea:hover { border-color: var(--ink); }
.task-form input[aria-invalid="true"] { border-color: var(--coral); box-shadow: inset 3px 0 var(--coral); }
.field-error { min-height: 0; color: var(--coral); font-family: var(--font-display); font-size: 11px; letter-spacing: normal; line-height: 1.35; text-transform: none; }
.field-error:empty { display: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.modal-footer { justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.modal-spacer { flex: 1; }

.board-heading-actions { display: flex; align-items: center; gap: 16px; }
.site-tools-card { width: min(660px, 100%); }
.site-tools-state { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 14px; padding: 16px; border: 1px solid var(--line); background: var(--surface-subtle); }
.site-tools-state .status-dot { margin-top: 5px; }
.site-tools-state.is-connected .status-dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.site-tools-state.is-partial .status-dot { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.site-tools-state strong { display: block; font-size: 14px; }
.site-tools-state p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.site-tools-steps { margin: 18px 0; padding-left: 22px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.site-tools-steps strong { color: var(--ink); }
.site-tools-result { margin-top: 18px; padding: 12px 14px; border-left: 3px solid var(--agent); color: var(--ink-soft); background: var(--agent-soft); font-size: 12px; line-height: 1.5; }
.site-tools-catalog { margin-top: 14px; border: 1px solid var(--line); }
.site-tools-catalog summary { padding: 12px 14px; cursor: pointer; font-family: var(--font-utility); font-size: 9px; font-weight: 700; letter-spacing: 0.055em; text-transform: uppercase; }
.site-tools-catalog code { display: block; max-height: 190px; padding: 0 14px 14px; overflow: auto; color: var(--muted); font-size: 10px; line-height: 1.7; white-space: pre-wrap; }
.site-tools-actions { align-items: stretch; }

.merge-overlay { position: fixed; inset: 0; z-index: var(--z-sheet); }
.merge-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(17,17,17,0.68); backdrop-filter: blur(6px); }
.merge-drawer { position: absolute; inset: 0 0 0 auto; width: min(720px, 100%); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--ink); box-shadow: -24px 0 70px rgba(0,0,0,0.2); animation: slide-in 260ms ease-out; }
@keyframes slide-in { from { transform: translateX(32px); opacity: 0.45; } }
.merge-header { padding: 26px 30px 20px; border-bottom: 1px solid var(--line); }
.merge-header h2 { margin: 0; font-size: 36px; font-weight: 550; letter-spacing: -0.06em; }
.merge-equation { margin: 9px 0 0; color: var(--agent); font-family: var(--font-utility); font-size: 9px; font-weight: 700; letter-spacing: 0.055em; }
.merge-header-actions { display: flex; align-items: center; gap: 9px; }
.human-gate { padding: 8px 9px; border: 1px solid var(--line); color: var(--muted); font-family: var(--font-utility); font-size: 8px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.merge-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.merge-stat { min-height: 90px; padding: 16px 18px; border-right: 1px solid var(--line); background: var(--panel); }
.merge-stat:last-child { border-right: 0; }
.merge-stat strong { display: block; font-size: 30px; font-weight: 500; line-height: 1; }
.merge-stat span { color: var(--muted); font-family: var(--font-utility); font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; }
.stat-safe { box-shadow: inset 0 3px var(--green); }
.stat-safe strong { color: var(--green-dark); }
.stat-same { box-shadow: inset 0 3px var(--agent); }
.stat-same strong { color: var(--agent); }
.stat-conflict { box-shadow: inset 0 3px var(--coral); }
.stat-conflict strong { color: var(--coral); }
.merge-body { flex: 1; overflow-y: auto; padding: 8px 30px 130px; scrollbar-gutter: stable; }
.merge-body section { margin-top: 25px; }
.merge-section-title { justify-content: space-between; align-items: baseline; margin-bottom: 11px; }
.merge-section-title h3 { margin: 0; font-size: 16px; }
.merge-section-title span { color: var(--muted); font-family: var(--font-utility); font-size: 9px; }
.safe-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.safe-item { display: grid; grid-template-columns: 23px 1fr; gap: 9px; align-items: start; padding: 10px; border: 1px solid #bdd1c8; background: #f4faf7; }
.safe-check { width: 21px; height: 21px; display: grid; place-items: center; color: white; background: var(--green); font-size: 10px; }
.safe-item strong { display: block; font-size: 11px; }
.safe-item p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.safe-more { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.conflict-list { display: grid; gap: 11px; }
.conflict-card { padding: 15px; border: 1px solid #d9a095; border-left: 3px solid var(--coral); background: #fff9f7; transition: border-color 180ms ease, background-color 180ms ease; }
.conflict-card.is-resolved { border-color: #9fc2b3; border-left-color: var(--green); background: #f7fbf9; }
.conflict-heading { align-items: flex-start; }
.conflict-heading span { color: var(--coral); font-family: var(--font-utility); font-size: 8px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.conflict-heading h4 { margin: 4px 0 0; font-size: 14px; }
.conflict-type { padding: 4px 6px; border: 1px solid #e5b8ae; background: var(--coral-soft); }
.base-value { display: flex; gap: 9px; margin: 13px 0 9px; padding: 8px 9px; border-left: 2px solid var(--line-strong); background: var(--surface-subtle); font-size: 9px; }
.base-value span { color: var(--muted); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice-button { display: grid; gap: 4px; padding: 11px; background: white; border-color: var(--line); text-align: left; }
.choice-button:hover { border-color: var(--ink); }
.choice-button.is-selected { border-color: var(--green); box-shadow: inset 3px 0 var(--green); background: var(--green-soft); }
.choice-button span { color: var(--muted); font-family: var(--font-utility); font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; }
.choice-button strong { font-size: 11px; }
.consequence { display: flex; gap: 6px; margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.consequence span { color: var(--coral); }
.merge-footer { position: absolute; inset: auto 0 0; justify-content: space-between; gap: 18px; padding: 18px 30px; border-top: 1px solid var(--line); background: rgba(255,255,255,0.96); }
.merge-footer strong, .merge-footer span { display: block; }
.merge-footer strong { font-size: 12px; }
.merge-footer span { margin-top: 4px; color: var(--muted); font-size: 9px; }

.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: var(--z-toast); display: grid; gap: 8px; width: min(400px, calc(100% - 48px)); }
.toast { justify-content: space-between; gap: 14px; padding: 14px 15px; color: white; background: var(--ink); border: 1px solid #55524d; box-shadow: var(--shadow-layer); opacity: 0; transform: translateY(10px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: none; }
.toast strong { display: block; font-size: 12px; }
.toast p { margin: 4px 0 0; color: #b9b6af; font-size: 10px; line-height: 1.4; }
.toast-actions { flex: none; display: flex; align-items: center; gap: 6px; }
.toast button { min-width: 34px; min-height: 34px; padding: 0 7px; border: 1px solid #62605b; color: white; background: transparent; cursor: pointer; }
.toast button:hover { color: var(--ink); background: white; }
.toast-success { border-left: 4px solid #63a78c; }
.toast-error { border-left: 4px solid #e27a67; background: #4d211b; }

/* Video-safe composition: one 16:9 frame keeps the proof, split revisions, and board together. */
.is-presenter .app-shell { padding-bottom: 28px; }
.is-presenter .topbar { min-height: 72px; }
.is-presenter .brand-mark { width: 42px; height: 42px; }
.is-presenter .hero { min-height: 258px; grid-template-columns: minmax(250px, 0.44fr) minmax(700px, 1.56fr); margin-top: 14px; }
.is-presenter .hero-copy { padding: 18px 22px 20px; }
.is-presenter .hero-copy h2 { margin: 16px 0; font-size: clamp(48px, 5.4vw, 88px); line-height: 0.78; }
.is-presenter .hero-intro { grid-template-columns: 24px 1fr; gap: 10px; }
.is-presenter .hero-intro p { font-size: 11px; line-height: 1.45; }
.is-presenter .hero-stage-heading { inset: 18px 20px auto; }
.is-presenter .merge-map { opacity: 0.42; }
.is-presenter .demo-card { left: 20px; right: 20px; bottom: 16px; padding: 14px 16px; }
.is-presenter .demo-card-grid { grid-template-columns: minmax(0, 1.06fr) minmax(280px, 0.94fr); gap: 18px; margin-top: 11px; }
.is-presenter .demo-card h3 { font-size: 16px; }
.is-presenter .demo-actions { margin-top: 11px; }
.is-presenter .demo-actions .button { min-height: 36px; padding: 8px 12px; font-size: 10px; }
.is-presenter .agent-prompt { margin-top: 7px; padding-top: 7px; }
.is-presenter .branch-strip { min-height: 62px; margin: 10px 0 12px; padding-block: 8px; }
.is-presenter .branch-icon { width: 38px; height: 38px; }
.is-presenter .workspace { grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; }
.is-presenter .board-section { padding: 16px; }
.is-presenter .section-heading { margin-bottom: 12px; }
.is-presenter .section-heading h2 { font-size: 24px; }
.is-presenter .board-toolbar { min-height: 48px; margin-bottom: 12px; }
.is-presenter .search-control, .is-presenter .view-toggle { min-height: 46px; }
.is-presenter .metric-pill { padding-block: 6px; }
.is-presenter .board-column { min-height: 430px; }
.is-presenter .column-cards { min-height: 340px; }
.is-presenter .activity-panel { top: 12px; max-height: calc(100vh - 24px); padding: 16px 14px; }
.is-presenter .activity-list { max-height: calc(100vh - 100px); }
.is-presenter .toast-region { top: 84px; bottom: auto; }
.is-presenter .merge-drawer { width: min(840px, 100%); }
.is-presenter .merge-header { padding: 18px 22px 14px; }
.is-presenter .merge-header h2 { font-size: 31px; }
.is-presenter .merge-stat { min-height: 72px; padding: 12px 15px; }
.is-presenter .merge-stat strong { font-size: 26px; }
.is-presenter .merge-body { padding: 0 22px 92px; }
.is-presenter .merge-body section { margin-top: 14px; }
.is-presenter .safe-list { display: none; }
.is-presenter .safe-section { padding: 10px 12px; border: 1px solid #bdd1c8; background: #f4faf7; }
.is-presenter .safe-section .merge-section-title { margin: 0; }
.is-presenter .conflict-list { gap: 7px; }
.is-presenter .conflict-card { padding: 10px 12px; }
.is-presenter .conflict-heading h4 { margin-top: 2px; font-size: 12px; }
.is-presenter .base-value { margin: 7px 0 6px; padding: 5px 7px; }
.is-presenter .choice-button { min-height: 36px; padding: 7px 9px; }
.is-presenter .consequence { margin-top: 6px; }
.is-presenter .merge-footer { padding: 12px 22px; }

@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(380px, 0.9fr) minmax(480px, 1.1fr); }
  .hero-copy h2 { font-size: clamp(70px, 10vw, 120px); }
  .workspace { grid-template-columns: 1fr; }
  .activity-panel { position: static; max-height: 420px; }
  .activity-list { max-height: 320px; }
}

@media (max-width: 900px) {
  .app-shell { padding-inline: 18px; }
  .topbar { align-items: flex-start; flex-wrap: wrap; padding: 18px 0; }
  .topbar-meta { flex-wrap: wrap; }
  .hero { grid-template-columns: 1fr; }
  .is-presenter .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 390px; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-copy h2 { font-size: clamp(84px, 18vw, 148px); }
  .hero-stage { min-height: 440px; }
  .is-presenter .hero-copy { min-height: 250px; }
  .is-presenter .hero-stage { min-height: 370px; }
  .is-presenter .workspace { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { background: var(--paper); }
  .app-shell { padding: 0 12px 40px; }
  .topbar { min-height: 82px; gap: 12px; }
  .brand-mark { width: 42px; height: 42px; }
  .brand-lockup .eyebrow { display: none; }
  .brand-lockup h1 { font-size: 16px; }
  .demo-nav { order: 3; width: 100%; justify-content: center; }
  .topbar-meta { gap: 4px; }
  .connection-pill { max-width: 150px; padding-inline: 9px; border: 1px solid var(--line); }
  #connection-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .revision-pill { display: none; }
  .topbar .button { min-height: 38px; padding-inline: 10px; }
  .hero { min-height: 0; margin-top: 14px; }
  .hero-copy { min-height: 330px; padding: 20px 18px; }
  .hero-meta > span { display: none; }
  .hero-copy h2 { margin: 28px 0; font-size: clamp(68px, 25vw, 106px); line-height: 0.8; }
  .hero-intro { grid-template-columns: 24px 1fr; gap: 12px; }
  .hero-intro p { font-size: 13px; }
  .hero-stage { min-height: 430px; }
  .hero-stage-heading { inset: 20px 18px auto; }
  .merge-map { height: 300px; }
  .demo-card { left: 14px; right: 14px; bottom: 14px; padding: 16px; }
  .demo-card-grid, .is-presenter .demo-card-grid { grid-template-columns: 1fr; }
  .tool-trace-panel { padding: 12px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .agent-prompt code { white-space: normal; }
  .demo-card h3 { margin-top: 16px; }
  .branch-strip { grid-template-columns: auto minmax(0, 1fr); margin: 12px 0 18px; }
  .branch-copy { grid-template-columns: 1fr; }
  .branch-copy strong { white-space: normal; }
  .branch-label { margin-bottom: 3px; }
  .branch-actions { grid-column: 1 / -1; }
  .branch-actions .button { flex: 1; }
  .board-section { padding: 16px 12px; }
  .section-heading h2 { font-size: 26px; }
  .board-sync { flex-wrap: wrap; }
  .board-heading-actions { gap: 8px; }
  .legend { display: none; }
  .board-toolbar { align-items: stretch; flex-wrap: wrap; border-bottom: 0; }
  .search-control { width: calc(100% - 94px); border-bottom: 1px solid var(--line); }
  .view-toggle { width: 94px; justify-content: space-between; border-bottom: 1px solid var(--line); }
  .board-metrics { order: 3; flex-basis: 100%; border-bottom: 1px solid var(--line); }
  .metric-pill { flex: 1; min-width: 76px; }
  .board { grid-template-columns: repeat(5, 248px); }
  .board.is-archive-view { grid-template-columns: 1fr; }
  .archived-column .column-cards { grid-template-columns: 1fr; }
  .activity-panel { padding: 18px 14px; }
  .safe-list, .choice-grid { grid-template-columns: 1fr; }
  .merge-header, .merge-body, .merge-footer { padding-left: 18px; padding-right: 18px; }
  .merge-header h2 { font-size: 30px; }
  .merge-stat { min-height: 78px; padding: 13px 10px; }
  .merge-stat strong { font-size: 25px; }
  .merge-footer { align-items: stretch; flex-direction: column; }
  .button-commit { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-backdrop, .confirm-backdrop { padding: 10px; }
  .modal-card { max-height: calc(100dvh - 20px); padding: 20px 16px; }
  .modal-footer { flex-wrap: wrap; }
  .form-alert { align-items: stretch; flex-direction: column; }
  .modal-footer .button-primary { order: 4; flex-basis: 100%; }
  .site-tools-actions .button { flex: 1 1 100%; }
  .toast-region { right: 12px; bottom: 12px; width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  /* Accessibility override: remove motion everywhere while preserving state changes. */
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

@media (forced-colors: active) {
  * { scrollbar-color: auto; }
  .status-dot, .activity-marker, .legend-dot, .merge-node { forced-color-adjust: auto; }
}
