:root {
  --paper: #f2efe6;
  --paper-light: #fffdf7;
  --paper-deep: #e7e2d5;
  --ink: #18221e;
  --muted: #626b64;
  --line: #c5c2b4;
  --signal: #e9522f;
  --green: #137957;
  --blue: #2d5f86;
  --amber: #95600d;
  --display: "Songti SC", "Noto Serif CJK SC", "STSong", serif;
  --body: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  background-color: var(--paper);
  background-image: linear-gradient(rgba(24, 34, 30, .028) 1px, transparent 1px), linear-gradient(90deg, rgba(24, 34, 30, .028) 1px, transparent 1px);
  background-size: 28px 28px;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(45, 95, 134, .4);
  outline-offset: 3px;
}
button:disabled { cursor: wait; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.25fr 1fr; }
.auth-manifest {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 7vw, 110px);
  overflow: hidden;
  color: var(--paper);
  background: var(--ink);
}
.auth-manifest::after {
  content: "";
  position: absolute;
  width: 45vw;
  height: 45vw;
  right: -20vw;
  bottom: -24vw;
  border: 1px solid rgba(242, 239, 230, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 60px rgba(242, 239, 230, .025), 0 0 0 120px rgba(242, 239, 230, .02);
  pointer-events: none;
}
.brand-mark { display: grid; grid-template-columns: repeat(2, 18px); gap: 4px; margin-bottom: 32px; }
.brand-mark i { width: 18px; height: 18px; background: var(--signal); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: var(--paper); }
.brand-mark.small { grid-template-columns: repeat(2, 9px); gap: 2px; margin: 0; }
.brand-mark.small i { width: 9px; height: 9px; }
.eyebrow, .section-index { margin: 0 0 10px; font: 700 10px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.auth-manifest h1 { margin: 0; font: 800 clamp(82px, 12vw, 180px)/.85 "Avenir Next Condensed", "DIN Condensed", sans-serif; letter-spacing: -.045em; }
.auth-lede { max-width: 460px; margin: 40px 0; color: #cbd0c7; font: 20px/1.9 var(--display); }
.manifest-lines { display: flex; flex-wrap: wrap; gap: 22px; color: #aab2a9; font: 700 10px var(--mono); letter-spacing: .12em; }
.manifest-lines span::before { content: "■"; margin-right: 8px; color: var(--signal); }
.auth-form { align-self: center; width: min(420px, calc(100% - 48px)); margin: auto; padding: 44px 0; }
.auth-form h2 { margin: 0 0 12px; font: 700 38px var(--display); }
.auth-form > p:not(.section-index):not(.form-error):not(.security-note) { color: var(--muted); line-height: 1.7; }
.auth-form label { display: block; margin: 30px 0 8px; font: 700 12px var(--mono); }
.auth-form input { width: 100%; padding: 15px; border: 1px solid var(--ink); border-radius: 0; background: var(--paper-light); }
.auth-form .button { width: 100%; margin-top: 14px; }
.security-note { margin-top: 22px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.form-error { min-height: 20px; color: #ae2d1d; font-size: 13px; }

.app { min-height: 100vh; }
.topbar { min-height: 68px; padding: 13px clamp(18px, 3vw, 42px); display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--paper); background: var(--ink); }
.brand { display: flex; align-items: center; gap: 13px; }
.brand strong { display: block; font: 800 20px "Avenir Next Condensed", "DIN Condensed", sans-serif; letter-spacing: .05em; }
.brand span { display: block; margin-top: 3px; color: #aab2a9; font: 600 9px var(--mono); letter-spacing: .13em; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.connection { display: inline-flex; align-items: center; gap: 7px; margin-right: 10px; color: #d1d7cf; font: 600 11px var(--mono); }
.connection i { width: 7px; height: 7px; background: #8c938d; }
.connection.online i { background: #60d5a7; box-shadow: 0 0 10px rgba(96, 213, 167, .5); }
.connection.connecting i { background: #e6ae52; }
.button { min-height: 38px; padding: 9px 16px; border: 1px solid var(--ink); border-radius: 0; color: var(--ink); background: transparent; font: 700 12px var(--body); transition: transform .16s, box-shadow .16s, background .16s; }
.button:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 rgba(24, 34, 30, .15); }
.button:disabled { opacity: .5; transform: none; box-shadow: none; }
.button-primary { color: var(--paper); background: var(--ink); }
.button-accent { min-width: 96px; color: #fff; border-color: var(--signal); background: var(--signal); }
.button-ghost { color: var(--paper); border-color: #606a62; }
.button-ghost:hover:not(:disabled) { background: #2a3630; }

.workspace { max-width: 1560px; margin: 0 auto; padding: 18px clamp(20px, 3vw, 44px) 50px; animation: workbench-in .25s ease-out; }
@keyframes workbench-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.workspace-nav { display: flex; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.workspace-nav button { position: relative; min-width: 112px; padding: 11px 15px; border: 0; color: var(--muted); background: transparent; text-align: left; font-weight: 700; }
.workspace-nav button.active { color: var(--ink); }
.workspace-nav button.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--signal); }
.workspace-nav b { margin-left: 6px; font: 600 10px var(--mono); }
.workbench-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }

.conversation-panel { min-width: 0; height: clamp(540px, calc(100vh - 175px), 850px); display: flex; flex-direction: column; border: 1px solid var(--ink); background: var(--paper-light); box-shadow: 5px 5px 0 rgba(24, 34, 30, .07); }
.coordinator-status { flex-shrink: 0; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.coordinator-presence { display: flex; align-items: center; gap: 12px; }
.coordinator-presence > div { min-width: 0; flex: 1; }
.coordinator-presence h3 { margin: 0 0 4px; font-size: 13px; }
.coordinator-presence p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.brain-symbol { position: relative; flex-shrink: 0; width: 32px; height: 32px; border: 1px solid var(--ink); border-radius: 50%; }
.brain-symbol::before, .brain-symbol::after { content: ""; position: absolute; border-radius: 50%; }
.brain-symbol::before { inset: 7px; border: 1px solid var(--blue); }
.brain-symbol::after { width: 6px; height: 6px; top: 12px; left: 12px; background: var(--signal); }
.chat-messages { flex: 1; min-height: 0; padding: 23px 22px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: var(--line) transparent; }
.conversation-empty { padding: 24px 0; color: var(--muted); font-size: 12px; }
.chat-message { max-width: 92%; margin: 0 0 24px; }
.chat-message.own { margin-left: auto; padding: 14px 17px; color: var(--paper-light); background: var(--ink); }
.chat-message.assistant { padding-left: 14px; border-left: 2px solid var(--blue); }
.message-meta { margin: 0 0 7px; color: var(--muted); font: 600 10px var(--body); }
.own .message-meta { color: #b7c2b8; }
.message-content { margin: 0; font-size: 13px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-message { margin-top: 7px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 10px; opacity: 0; transition: opacity .15s, color .15s; }
.chat-message:hover .copy-message, .chat-message:focus-within .copy-message, .chat-activity:hover .copy-message, .chat-activity:focus-within .copy-message { opacity: 1; }
.own .copy-message { color: #b7c2b8; }
.copy-message:hover { color: var(--signal); }
@media (hover: none) { .copy-message { opacity: 1; } }
.chat-activity { margin: 22px 0; padding: 11px 0 11px 29px; position: relative; color: var(--muted); border-top: 1px solid var(--paper-deep); border-bottom: 1px solid var(--paper-deep); }
.chat-activity::before { content: ""; position: absolute; left: 9px; top: 19px; width: 6px; height: 6px; background: var(--blue); }
.chat-activity .message-content { font-size: 12px; }
.text-button { display: inline-flex; align-items: center; gap: 5px; margin: 9px 0 0; padding: 0; border: 0; border-bottom: 1px solid currentColor; color: var(--blue); background: none; font-size: 11px; line-height: 1.8; }
.text-button:hover { color: var(--signal); }
.chat-message.failed { border-left-color: var(--signal); }
.thinking { display: flex; align-items: center; gap: 5px; min-height: 24px; color: var(--muted); font-size: 11px; }
.thinking i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); animation: thinking 1.2s infinite; }
.thinking i:nth-child(2) { animation-delay: .18s; }
.thinking i:nth-child(3) { animation-delay: .36s; margin-right: 5px; }
@keyframes thinking { 0%, 70%, 100% { opacity: .3; } 35% { opacity: 1; } }

.chat-task { margin: 0 0 27px 14px; padding: 16px 17px; border: 1px solid #9fb3bf; border-left: 3px solid var(--blue); background: rgba(45, 95, 134, .045); }
.chat-task.is-complete { border-color: #80ac97; border-left-color: var(--green); background: rgba(19, 121, 87, .05); }
.chat-task-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.chat-task-top > span { color: var(--muted); font: 700 9px var(--mono); letter-spacing: .09em; }
.chat-task-title { display: block; max-width: 100%; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; font: 700 20px/1.5 var(--display); overflow-wrap: anywhere; }
.chat-task-title:hover { color: var(--blue); }
.chat-task-stage { margin: 10px 0 0; color: #4e584f; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-task .task-actions { margin-top: 8px; }
.chat-task-pending { margin: 0 0 24px 14px; padding: 16px; color: var(--muted); border: 1px dashed var(--line); font-size: 12px; }
.chat-composer { position: relative; flex-shrink: 0; padding: 15px 17px 16px; border-top: 1px solid var(--ink); background: var(--paper); }
.chat-composer textarea { display: block; width: 100%; min-height: 84px; max-height: 200px; padding: 10px 4px; resize: vertical; border: 0; color: var(--ink); background: transparent; font-size: 13px; line-height: 1.8; }
.chat-composer textarea::placeholder { color: #858b81; }
.chat-composer textarea:focus-visible { outline-offset: 5px; }
.chat-composer textarea:disabled { opacity: .6; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.button-quiet { min-height: 32px; padding: 6px 10px; color: var(--muted); border-color: var(--line); }
.button-quiet:hover:not(:disabled) { color: var(--signal); }
.composer-mentions { display: flex; flex-wrap: wrap; gap: 6px; }
.composer-mentions:not(:empty) { margin: 2px 0 10px; }
.composer-chip { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid #afc0cb; color: var(--blue); background: rgba(45, 95, 134, .045); font-size: 11px; }
.composer-chip > span { padding: 4px 3px 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-chip button { align-self: stretch; padding: 0 7px 1px; border: 0; color: var(--blue); background: transparent; font-size: 15px; }
.composer-chip button:hover { color: var(--signal); }
.mention-picker { position: absolute; z-index: 6; left: 14px; right: 14px; bottom: calc(100% - 7px); max-height: 350px; padding: 6px; overflow-y: auto; border: 1px solid var(--ink); background: var(--paper-light); box-shadow: 5px 5px 0 rgba(24, 34, 30, .14); }
.mention-group { padding: 9px 9px 5px; color: var(--muted); font: 700 9px var(--mono); letter-spacing: .09em; }
.mention-option { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 10px; border: 0; border-left: 3px solid transparent; color: var(--ink); background: transparent; text-align: left; }
.mention-option.active { border-left-color: var(--blue); background: var(--paper-deep); }
.mention-option > span { min-width: 0; }
.mention-option strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.mention-option small { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.mention-option > b { flex-shrink: 0; color: var(--blue); font: 600 10px var(--body); }
.mention-empty { padding: 20px 12px; color: var(--muted); text-align: center; font-size: 12px; }

.team-panel { min-width: 0; max-height: clamp(540px, calc(100vh - 175px), 850px); padding-right: 6px; overflow-y: auto; border-top: 2px solid var(--ink); scrollbar-color: var(--line) transparent; }
.panel-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0 11px; border-bottom: 1px solid var(--line); background: var(--paper); }
.panel-heading h2 { margin: 0; font: 700 15px var(--body); }
.workforce-summary { flex-shrink: 0; color: var(--muted); font: 10px var(--mono); }
.worker-list { display: flex; flex-direction: column; }
.worker-row { position: relative; min-width: 0; padding: 0; border-bottom: 1px solid var(--line); }
.worker-summary { display: flex; align-items: center; gap: 9px; min-height: 64px; padding: 10px 61px 10px 0; cursor: pointer; list-style: none; }
.worker-summary::-webkit-details-marker { display: none; }
.worker-summary::after { content: "+"; position: absolute; top: 21px; right: 36px; color: var(--muted); font: 14px var(--mono); }
.worker-row[open] > .worker-summary::after { content: "−"; }
.worker-summary:hover { background: rgba(255, 253, 247, .65); }
.worker-summary-text { flex: 1; min-width: 0; }
.worker-monogram { flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 26px; color: var(--paper); background: var(--blue); font: 700 8px var(--mono); }
.is-working .worker-monogram { background: var(--signal); }
.worker-name-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.worker-name-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.worker-state { display: inline-flex; flex-shrink: 0; align-items: center; gap: 4px; color: var(--muted); font-size: 9px; }
.worker-state i { width: 5px; height: 5px; background: var(--green); }
.worker-state.phase-working i, .worker-state.phase-running i, .worker-state.phase-chatting i, .worker-state.phase-planning i, .worker-state.phase-reviewing i { background: var(--blue); }
.worker-state.phase-offline i, .worker-state.phase-blocked i { background: var(--signal); }
.worker-state.phase-waiting i, .worker-state.phase-waiting_manual i, .worker-state.phase-queued i { background: var(--amber); }
.worker-description { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; line-height: 1.5; }
.worker-mention { position: absolute; z-index: 1; top: 19px; right: 0; width: 26px; height: 26px; padding: 0; border: 1px solid var(--ink); color: var(--ink); background: var(--paper-light); font: 700 14px var(--mono); }
.worker-mention:hover:not(:disabled) { color: var(--paper); background: var(--blue); }
.worker-mention:disabled { cursor: not-allowed; opacity: .35; }
.worker-details { padding: 0 0 14px 35px; }
.worker-runtime { margin: 0 0 9px; color: var(--muted); font-size: 9px; line-height: 1.6; overflow-wrap: anywhere; }
.capabilities { display: flex; flex-wrap: wrap; gap: 5px; }
.capabilities span { padding: 3px 6px; color: var(--blue); border: 1px solid #afc0cb; font-size: 9px; }
.worker-current { margin: 10px 0 0; padding: 9px 10px; border-left: 2px solid var(--blue); background: rgba(255, 253, 247, .72); }
.worker-current strong { display: block; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.worker-current p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.worker-current .text-button { font-size: 10px; }
.worker-updated { display: block; margin-top: 9px; color: var(--muted); font-size: 9px; }
.worker-output { margin-top: 10px; }
.worker-output summary { cursor: pointer; color: var(--blue); font-size: 10px; }
.worker-output pre, .evidence pre { max-height: 260px; margin: 9px 0 0; padding: 12px; overflow: auto; color: #dce7dc; border: 1px solid #445047; background: var(--ink); font: 10px/1.75 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

.status { display: inline-flex; flex-shrink: 0; align-items: center; gap: 5px; width: fit-content; padding: 3px 6px; border: 1px solid var(--line); color: #4f594f; background: var(--paper); font: 600 9px var(--body); white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; background: #858d86; }
.status-online::before, .status-succeeded::before, .status-done::before, .status-managed::before, .status-idle::before { background: var(--green); }
.status-working::before, .status-running::before, .status-in_progress::before, .status-planning::before, .status-chatting::before, .status-reviewing::before { background: var(--blue); }
.status-blocked::before, .status-failed::before, .status-offline::before, .status-cancelled::before { background: var(--signal); }
.status-waiting_manual::before, .status-waiting::before, .status-review::before, .status-queued::before, .status-ready::before { background: var(--amber); }
.status-working::before, .status-running::before, .status-in_progress::before, .status-planning::before, .status-chatting::before, .status-reviewing::before { animation: pulse 2.5s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px rgba(45, 95, 134, .13); } }
.empty-state { padding: 35px 22px; border: 1px dashed var(--line); color: var(--muted); text-align: center; line-height: 1.8; font-size: 12px; }
.empty-state p { max-width: 430px; margin: 0 auto; }

.task-board { min-height: 50vh; }
.board-toolbar { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.task-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.task-filters button { padding: 8px 10px; border: 1px solid var(--line); color: var(--muted); background: var(--paper-light); font-size: 11px; }
.task-filters button.active { color: var(--paper); border-color: var(--ink); background: var(--ink); }
.task-filters b { margin-left: 6px; font: 600 9px var(--mono); opacity: .8; }
.task-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 18px; align-items: start; }
.task-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-top: 3px solid var(--blue); background: rgba(255, 253, 247, .9); box-shadow: 3px 3px 0 rgba(24, 34, 30, .045); }
.task-card.task-ready { border-top-color: var(--amber); }
.task-card.task-attention { border-top-color: var(--signal); }
.task-card.task-done { border-top-color: var(--green); }
.task-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.task-heading > div { min-width: 0; }
.task-heading .section-index { margin-bottom: 8px; color: var(--muted); font-size: 9px; }
.task-heading h3 { margin: 0; overflow-wrap: anywhere; font: 700 21px/1.5 var(--display); }
.task-goal { margin: 13px 0; color: #4e584f; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-stage { margin: 17px 0; padding: 12px 13px; border-left: 3px solid var(--blue); background: rgba(45, 95, 134, .06); }
.task-ready .task-stage { border-left-color: var(--amber); background: rgba(149, 96, 13, .06); }
.task-attention .task-stage { border-left-color: var(--signal); background: rgba(233, 82, 47, .06); }
.task-done .task-stage { border-left-color: var(--green); background: rgba(19, 121, 87, .06); }
.task-stage span { display: block; margin-bottom: 5px; color: var(--muted); font: 600 10px var(--body); }
.task-stage p { margin: 0; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.step-progress { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.progress-track { flex: 1; height: 5px; background: var(--paper-deep); }
.progress-track i { display: block; height: 100%; background: var(--green); transition: width .4s ease; }
.step-progress > span { flex-shrink: 0; color: var(--muted); font-size: 10px; }
.direct-owner { color: var(--muted); font-size: 12px; }
.task-meta-line { display: flex; justify-content: space-between; gap: 12px; padding-top: 13px; border-top: 1px solid var(--paper-deep); color: var(--muted); font-size: 10px; }
.task-meta-line time { text-align: right; }
.task-actions { display: flex; align-items: center; gap: 18px; }
.task-actions .text-button { margin-top: 13px; }

.task-dialog { width: min(850px, calc(100vw - 32px)); max-height: calc(100vh - 64px); margin: auto; padding: 0; overflow-y: auto; border: 1px solid var(--ink); border-top: 5px solid var(--blue); border-radius: 0; color: var(--ink); background: var(--paper-light); box-shadow: 8px 8px 0 rgba(24, 34, 30, .2); }
.task-dialog::backdrop { background: rgba(24, 34, 30, .48); backdrop-filter: blur(3px); }
.dialog-heading { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: 16px; padding: 21px 24px 18px; border-bottom: 1px solid var(--line); background: var(--paper-light); }
.dialog-heading .section-index { margin-bottom: 7px; color: var(--muted); }
.dialog-heading h2 { margin: 0; overflow-wrap: anywhere; font: 700 25px/1.45 var(--display); }
.dialog-close { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); color: var(--ink); background: var(--paper); font-size: 23px; line-height: 1; }
.dialog-close:hover { color: var(--paper); background: var(--ink); }
.dialog-content { padding: 23px 24px 27px; }
.dialog-reference { margin: 25px 0 0; padding-top: 15px; border-top: 1px solid var(--paper-deep); }
.dialog-reference .text-button { margin: 0; }
.delivery-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 17px; border-bottom: 1px solid var(--ink); }
.delivery-heading h3 { margin: 0; font: 700 23px/1.4 var(--display); }
.delivery-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.delivery-heading .button { flex-shrink: 0; }
.deliverable { margin-top: 25px; padding-top: 21px; border-top: 1px solid var(--line); }
.deliverable-heading { display: flex; align-items: flex-start; gap: 12px; }
.deliverable-heading > div { flex: 1; min-width: 0; }
.deliverable-heading h4 { margin: 0; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.deliverable-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.deliverable-heading .button { flex-shrink: 0; min-height: 32px; padding: 6px 10px; }
.task-context, .execution-details { margin-top: 23px; border-top: 1px solid var(--line); }
.task-context > summary, .execution-details > summary { padding: 14px 0; cursor: pointer; font-size: 12px; font-weight: 700; }
.task-context[open] > summary, .execution-details[open] > summary { color: var(--blue); }
.task-context .task-detail-grid { padding-bottom: 8px; }
.execution-details .step-list { margin-top: 0; }
.detail-stage { margin-top: 0; }
.task-stage.task-attention { border-left-color: var(--signal); background: rgba(233, 82, 47, .06); }
.start-task { margin-top: 14px; }
.task-actions { flex-wrap: wrap; }
.task-actions .button { min-height: 32px; margin-top: 13px; padding: 6px 11px; font-size: 11px; }
.review-note.rejected { color: #9d3422; border-left-color: var(--signal); background: rgba(233, 82, 47, .06); }
.chat-activity.activity-completed { color: var(--green); background: rgba(19, 121, 87, .035); }
.chat-activity.activity-completed::before { background: var(--green); }
.chat-activity.activity-attention { color: #9d3422; }
.chat-activity.activity-attention::before { background: var(--signal); }
.markdown-body { min-width: 0; margin-top: 18px; color: #36483e; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 25px 0 10px; color: var(--ink); font-family: var(--display); line-height: 1.55; }
.markdown-body h2 { font-size: 21px; }
.markdown-body h3 { font-size: 17px; }
.markdown-body h4 { font-size: 14px; }
.markdown-body h5, .markdown-body h6 { font-size: 13px; }
.markdown-body p { margin: 11px 0; }
.markdown-body strong { color: var(--ink); font-weight: 700; }
.markdown-body ul, .markdown-body ol { margin: 12px 0; padding-left: 25px; }
.markdown-body li { margin: 5px 0; padding-left: 3px; }
.markdown-body li > p { margin: 4px 0; }
.markdown-body li > ul, .markdown-body li > ol { margin: 5px 0; }
.markdown-body blockquote { margin: 16px 0; padding: 2px 0 2px 14px; color: var(--muted); border-left: 2px solid var(--blue); }
.markdown-body blockquote p { margin: 4px 0; }
.markdown-body hr { margin: 25px 0; border: 0; border-top: 1px solid var(--line); }
.markdown-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.markdown-body code { padding: 2px 4px; background: var(--paper-deep); font: .9em/1.6 var(--mono); }
.markdown-body pre { max-width: 100%; margin: 15px 0; padding: 14px; overflow-x: auto; color: #dce7dc; background: var(--ink); font: 11px/1.8 var(--mono); white-space: pre; overflow-wrap: normal; }
.markdown-body pre code { padding: 0; color: inherit; background: transparent; }
.markdown-table { max-width: 100%; margin: 16px 0; overflow-x: auto; }
.markdown-body table { width: 100%; min-width: 430px; border-collapse: collapse; font-size: 11px; line-height: 1.75; }
.markdown-body th, .markdown-body td { padding: 10px; vertical-align: top; border-bottom: 1px solid var(--line); text-align: left; }
.markdown-body th { color: var(--ink); background: var(--paper); font-weight: 700; }
.evidence .markdown-body { font-size: 12px; }
.task-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 20px; }
.task-detail-grid section { min-width: 0; }
.task-detail-grid h4, .step-title h4 { margin: 0 0 8px; font-size: 12px; }
.task-detail-grid p, .task-detail-grid li { margin: 0; color: #4e584f; font-size: 12px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.acceptance-list { margin: 0; padding-left: 18px; }
.plan-note { margin: 22px 0 0; padding: 15px; border: 1px solid var(--paper-deep); background: var(--paper); }
.plan-note strong { font-size: 11px; }
.plan-note p { margin: 7px 0 0; color: #4e584f; font-size: 12px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.step-list { margin: 25px 0 0; padding: 0; list-style: none; }
.step-list > li { display: flex; gap: 13px; padding: 18px 0; border-top: 1px solid var(--line); }
.step-index { flex-shrink: 0; padding-top: 2px; color: var(--muted); font: 10px var(--mono); }
.step-done > .step-index { color: var(--green); }
.step-body { min-width: 0; flex: 1; }
.step-title { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.step-title h4 { margin: 0; line-height: 1.7; }
.step-body > p { margin: 8px 0 0; color: #4e584f; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.step-body .step-owner { color: var(--muted); font-size: 10px; }
.step-body .step-rationale { color: var(--muted); font-size: 11px; }
.inline-error { padding: 10px; color: #9d3422; border-left: 2px solid var(--signal); background: rgba(233, 82, 47, .06); }
.review-note { margin-top: 12px; padding: 11px 13px; color: #3f594b; border-left: 2px solid var(--green); background: rgba(19, 121, 87, .055); font-size: 12px; line-height: 1.8; }
.review-note p { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.final-review { margin-top: 20px; }
.evidence { margin-top: 12px; }
.evidence summary { cursor: pointer; color: var(--blue); font-size: 11px; }
.evidence pre { max-height: 330px; font-size: 11px; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; max-width: min(420px, calc(100vw - 44px)); padding: 13px 17px; color: var(--paper); border-left: 4px solid var(--green); background: var(--ink); box-shadow: 5px 5px 0 rgba(24, 34, 30, .18); font-size: 13px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { border-left-color: var(--signal); }

@media (min-width: 1600px) {
  .workbench-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; }
}
@media (max-width: 1120px) {
  .workbench-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
  .board-toolbar, .task-filters { justify-content: flex-start; }
}
@media (max-width: 880px) {
  .workbench-grid { grid-template-columns: 1fr; }
  .conversation-panel { height: 650px; }
  .team-panel { max-height: none; padding-right: 0; overflow: visible; }
  .worker-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 27px; }
}
@media (max-width: 780px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-manifest { min-height: 38vh; padding: 42px 30px; }
  .auth-manifest h1 { font-size: 86px; }
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .connection { width: 100%; justify-content: flex-end; margin: 0 0 2px; }
  .conversation-panel { height: 620px; }
  .task-dialog { max-height: calc(100vh - 32px); }
  .dialog-heading { padding: 18px; gap: 10px; }
  .dialog-heading h2 { font-size: 22px; }
  .dialog-content { padding: 19px 18px 23px; }
}
@media (max-width: 520px) {
  .brand strong { font-size: 17px; }
  .topbar { gap: 10px; padding: 12px 15px; }
  .button-ghost { padding: 8px 10px; }
  .workspace { padding-left: 15px; padding-right: 15px; }
  .chat-messages { padding: 19px 15px; }
  .coordinator-status { padding: 15px; }
  .coordinator-presence .status { display: none; }
  .chat-composer { padding: 12px; }
  .conversation-panel { height: calc(100vh - 190px); min-height: 500px; }
  .chat-task { margin-left: 0; padding: 14px; }
  .chat-message { max-width: 96%; }
  .mention-picker { left: 6px; right: 6px; }
  .mention-option { gap: 9px; }
  .worker-list { grid-template-columns: 1fr; }
  .worker-current strong { font-size: 12px; }
  .task-filters { gap: 5px; }
  .task-filters button { padding: 8px; font-size: 10px; }
  .task-card { padding: 17px; }
  .task-heading h3 { font-size: 20px; }
  .task-meta-line { flex-direction: column; }
  .task-meta-line time { text-align: left; }
  .dialog-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .dialog-heading > div:nth-child(2) { grid-column: 1; grid-row: 2; }
  .dialog-close { grid-column: 2; grid-row: 1; }
  .step-title { flex-direction: column; }
  .delivery-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .deliverable-heading { flex-wrap: wrap; gap: 9px; }
  .deliverable-heading .button { margin-left: 22px; }
  .markdown-body { font-size: 12px; }
  .markdown-body h2 { font-size: 19px; }
  .markdown-body h3 { font-size: 16px; }
  .markdown-body th, .markdown-body td { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
