/* Local Work keeps the shared shell scale and the canonical board underneath. */
.manager-work { min-width: 0; max-width: 1920px; margin: 0 auto; }
.manager-work *, .mw-editor * { min-width: 0; }
.mw-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; min-width: 0; }
body[data-route="work"] .module-actions { max-width: 100%; }
.mw-toolbar .team-tabs { flex: 0 0 auto; }
.mw-toolbar .team-command { white-space: nowrap; }
.mw-view-tabs { margin-bottom: 12px; max-width: 100%; }
.mw-view-tabs button { flex: 1 1 0; }
.mw-filters { margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.mw-filter-primary, .mw-filter-facets { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.mw-filter-primary { margin-bottom: 10px; }
.mw-filter-toggle { display: none; }
.mw-filter-primary > .mw-filter-field { flex: 1 1 240px; max-width: 400px; }
.mw-filter-primary .team-search { flex: 2 1 220px; width: auto; max-width: none; margin: 0; }
.mw-filter-field { display: grid; gap: 4px; flex: 1 1 130px; min-width: 0; }
.mw-filter-field > span { color: var(--muted); font-size: 11px; }
.mw-filter-field select, .mw-card-move { width: 100%; min-width: 0; font: inherit; font-size: 12px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; text-overflow: ellipsis; }
.mw-filter-field select:focus-visible, .mw-card-move:focus-visible, .mw-card-toggle:focus-visible, .mw-card-open:focus-visible { outline: 2px solid var(--module-accent); outline-offset: 2px; }
.mw-filter-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; color: var(--muted); font-size: 11px; margin-top: 10px; }
.mw-filter-summary [role=status] { color: var(--text); }
.mw-counts { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.mw-board { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; align-items: start; }
.mw-column { min-height: 180px; border-top: 1px solid var(--line); padding-top: 10px; }
.mw-column > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 12px; }
.mw-column h2 { font-size: 13px; line-height: 20px; font-weight: 600; margin: 0; }
.mw-column > header > span { font-size: 12px; color: var(--muted); }
.mw-column > header > button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 2px 0; font: inherit; color: var(--text); background: none; border: 0; cursor: pointer; text-align: left; }
.mw-column > header > button > span:last-child { margin-left: auto; font-size: 12px; color: var(--muted); }
.mw-column.is-drop-target { outline: 2px dashed var(--module-accent); outline-offset: 4px; border-radius: 4px; background: var(--surface-2); }
.mw-card.is-dragging { opacity: .45; }
.mw-cards { display: grid; gap: 10px; }
.mw-cards[hidden], .mw-card-extra[hidden] { display: none; }
.mw-card { display: flex; flex-direction: column; width: 100%; text-align: left; padding: 12px; gap: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.mw-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.mw-card:focus-visible { outline: 2px solid var(--module-accent); outline-offset: 2px; }
.mw-card > header, .mw-card > footer { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.mw-card > header { justify-content: space-between; }
.mw-card h3 { font-size: 14px; line-height: 21px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.mw-card-open { font: inherit; text-align: left; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; width: 100%; }
.mw-card[data-expanded=false] h3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mw-card-toggle { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; padding: 0; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; }
.mw-card-toggle:hover { color: var(--text); border-color: var(--line); }
.mw-card-extra { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.mw-card-move { padding: 4px 6px; color: var(--muted); font-size: 11px; cursor: pointer; }
.mw-card > footer .mw-checklist-count { white-space: nowrap; }
.mw-card p { font-size: 12px; color: var(--muted); line-height: 18px; margin: 0; overflow-wrap: anywhere; }
.mw-card > footer > span { flex: 1; overflow-wrap: anywhere; }
.mw-card > footer > svg { width: 14px; height: 14px; flex-basis: 14px; }
.mw-card small { color: var(--muted); font-size: 11px; }
.mw-empty { margin: 0; padding: 12px 4px; color: var(--muted); font-size: 12px; }
.mw-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,260px),1fr)); gap: 12px; }
.mw-dependencies { border-top: 1px solid var(--line); padding-top: 8px; font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.mw-history { max-width: 1000px; }
.mw-event { padding: 14px 0; border-bottom: 1px solid var(--line); }
.mw-event header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.mw-event-card { text-align: left; font: inherit; font-weight: 600; color: var(--text); background: transparent; border: 0; padding: 4px 0; overflow-wrap: anywhere; cursor: pointer; }
.mw-event p { margin: 4px 0 8px; color: var(--muted); font-size: 12px; }
.mw-event small { font-size: 11px; color: var(--muted); }
.mw-note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 21px; margin: 8px 0; }
.mw-pending { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; color: var(--muted); font-size: 12px; }
.mw-editor { width: min(680px,calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); }
.mw-editor > header, .mw-editor > footer { padding: 14px 18px; }
.mw-editor > header h2 { font-size: 18px; line-height: 26px; margin: 0; }
.mw-editor > header { display: flex; align-items: center; justify-content: space-between; }
.mw-editor .team-icon, .manager-work .team-icon, body[data-route="work"] #moduleActions .team-icon { width: 18px; height: 18px; flex-basis: 18px; }
.mw-editor .modal-scroll { padding: 16px 18px; overflow-y: auto;  }
.mw-editor .field { gap: 6px; margin-bottom: 12px; }
.mw-editor .field > span { font-size: 12px; color: var(--muted); }
.mw-editor input, .mw-editor textarea, .mw-model-policy select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; width: 100%; padding: 8px 10px; }
.mw-editor textarea { resize: vertical; line-height: 1.5; }
.mw-sprint-record { overflow-wrap: anywhere; }
.mw-sprint-record h3 { font-size: 16px; margin: 16px 0 8px; }
.mw-sprint-record h4 { font-size: 13px; }
.mw-editor .field-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; }
.mw-editor .select-menu { max-height: 220px; }
.mw-editor .select-button { min-height: 36px; padding: 8px 10px; }
.mw-model-policy fieldset { border: 0; margin: 0; padding: 0; }
.mw-model-policy legend { font-size: 12px; color: var(--muted); padding: 0 0 6px; }
.mw-model-toggle { display: flex; gap: 10px; align-items: start; padding: 8px 0; cursor: pointer; }
.mw-model-toggle input[type=checkbox] { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; padding: 0; accent-color: var(--module-accent); }
.mw-model-toggle b { display: block; font-size: 13px; font-weight: 600; }
.mw-model-toggle small { display: block; font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.mw-model-rules { border-top: 1px solid var(--line); margin: 10px 0; padding-top: 6px; }
.mw-budget-settings { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.mw-budget-settings h3 { font-size: 13px; margin: 0 0 8px; }
.mw-budget-settings .field { margin-bottom: 8px; }
.mw-model-policy footer { flex-wrap: wrap; }
.mw-observed-catalog ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mw-observed-catalog li { overflow-wrap: anywhere; }
.mw-observed-catalog li small { display: block; color: var(--muted); line-height: 1.5; }
.mw-model-route { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.mw-model-route dd { overflow-wrap: anywhere; }
.mw-route-status { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.mw-detail-facts.mw-route-facts > div { grid-template-columns: 76px minmax(0,1fr); }
.mw-route-facts dd { overflow-wrap: anywhere; }
.mw-route-observed { display: block; font-size: 11px; color: var(--muted); line-height: 18px; }
.mw-card .mw-card-route { font-size: 11px; line-height: 16px; overflow-wrap: anywhere; }
.mw-agent-routing { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; font-size: 12px; }
.mw-agent-route + .mw-agent-route { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.mw-agent-route > header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 8px; margin-bottom: 5px; font-size: 11px; color: var(--muted); }
.mw-agent-route > header > span { overflow-wrap: anywhere; min-width: 0; }
.mw-agent-route > header > b { font-weight: 500; }
.mw-agent-routing .mw-help, .mw-model-route .mw-help { margin: 5px 0 0; }
.mw-agent-route[data-route-status="queued"] > header > b { color: var(--warning); }
.mw-agent-route[data-route-status="applied"] > header > b { color: var(--accent); }
.mw-detail-group[data-group="execution"] > summary > small { float: none; display: block; margin-left: 18px; overflow-wrap: anywhere; font-weight: 400; }
.mw-model-catalog { margin: 0 0 12px; }
.mw-editor .mw-execution-fields { grid-template-columns: repeat(3,minmax(0,1fr)); }
.mw-execution-fields .select-menu button { grid-template-columns: minmax(0,1fr); gap: 3px; }
.mw-execution-fields .select-menu small { font-size: 11px; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 620px) { .mw-editor .mw-execution-fields { grid-template-columns: minmax(0,1fr); } }
.mw-related { border-top: 1px solid var(--line); padding: 12px 0; }
.mw-related summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.mw-related fieldset { border: 0; margin: 0; padding: 12px 0 0; }
.mw-related label { display: flex; gap: 8px; align-items: start; font-size: 12px; margin-top: 8px; overflow-wrap: anywhere; }
.mw-related input[type=checkbox] { width: 14px; height: 14px; flex: 0 0 14px; padding: 0; accent-color: var(--module-accent); }
.mw-related [data-documents] { max-height: 220px; overflow-y: auto;  }
.mw-team-link { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; margin: 10px 0; }
.mw-team-link, .mw-lane-links a { color: var(--module-accent); text-decoration: none; text-underline-offset: 3px; }
.mw-team-link:hover, .mw-lane-links a:hover { text-decoration: underline; }
.mw-card-state { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.mw-card-state .field { flex: 1; max-width: 260px; }
.mw-card-history { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.mw-card-history h3 { font-size: 14px; margin: 0; }
.mw-card-history [data-card-history] { max-height: 260px; overflow-y: auto;  margin-bottom: 12px; }
.mw-error { padding: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 6px; font-size: 12px; margin-bottom: 12px; }
@media (max-width: 1100px) { .mw-board { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 560px) {
  .mw-view-tabs button { padding: 8px 5px; font-size: 12px; }
  .mw-filter-toggle { display: inline-flex; }
  .mw-filter-facets { margin-top: 10px; }
  .mw-filter-facets[data-open=false] { display: none; }
  .mw-filters { padding: 10px; }
  .mw-filter-primary > .mw-filter-field { flex-basis: 100%; max-width: none; }
  .mw-filter-facets .mw-filter-field { flex-basis: calc(50% - 10px); }
  .mw-toolbar { flex-wrap: wrap; gap: 8px; }
  .mw-toolbar .team-tabs { flex-basis: 100%; }
  .mw-toolbar .team-tabs button { flex: 1; padding: 8px 5px; font-size: 12px; }
  .mw-toolbar .team-search { flex: 1 1 100px; width: 100px; }
  .mw-board { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .mw-column { min-height: 80px; }
  .mw-editor .field-grid { grid-template-columns: minmax(0,1fr); }
  .mw-editor > header, .mw-editor > footer, .mw-editor .modal-scroll { padding: 12px; }
  .mw-editor > footer { flex-wrap: wrap; gap: 8px; }
}

/* Flow status. Colors carry meaning only; layout stays on the neutral shared scale. */
.mw-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 20px; padding: 0 7px; border-radius: 4px; font-size: 11px; line-height: 20px; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.mw-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 6px; }
.mw-chip[data-status="ready"], .mw-chip[data-status="queued"] { color: var(--accent-2); }
.mw-chip[data-status="running"], .mw-chip[data-status="starting"], .mw-chip[data-status="working"] { color: #91c7a2; }
.mw-chip[data-status="review"] { color: var(--warning); }
.mw-chip[data-status="blocked"] { color: var(--danger); }
.mw-chip[data-status="done"] { color: #7fb08e; }
.mw-chip[data-status="running"]::before { animation: mw-pulse 1.6s ease-in-out infinite; }
@keyframes mw-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .mw-chip[data-status="running"]::before { animation: none; } }
.mw-card[data-status="running"], .mw-card[data-status="starting"] { border-color: #4f6f59; }
.mw-card[data-status="blocked"] { border-color: #7a4d55; }
.mw-card[data-status="review"] { border-color: #75663f; }
.mw-card[data-status="done"] h3 { color: var(--muted); }
.mw-card-tags { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 0; }
.mw-tag, .mw-priority { font-size: 11px; color: var(--muted); }
.mw-priority[data-priority="critical"] { color: var(--danger); }
.mw-priority[data-priority="high"] { color: var(--warning); }
.mw-flow-line { color: var(--text); opacity: .85; }
.mw-agent.is-live { color: #91c7a2; }

/* Automation control in the shared band. */
.mw-automation { display: inline-flex; align-items: center; gap: 2px; }
.mw-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px; white-space: nowrap; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; }
.mw-switch i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.mw-switch[aria-checked="true"] { color: var(--text); border-color: #4f6f59; }
.mw-switch[aria-checked="true"] i { background: #91c7a2; }
.mw-automation[data-status="attention"] .mw-switch[aria-checked="true"] i { background: var(--warning); }
.mw-automation-state { margin-left: auto; }
.mw-counts { align-items: center; }
.mw-progress { flex: 1 0 100%; height: 3px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.mw-progress i { display: block; height: 100%; background: #91c7a2; }
.mw-alert { padding: 8px 10px; margin-bottom: 12px; font-size: 12px; color: var(--warning); border: 1px solid var(--line-strong); border-radius: 6px; }
.mw-help { margin: 0 0 12px; font-size: 12px; line-height: 18px; color: var(--muted); }

/* Agents: who holds what, and what comes next for each of them. */
.mw-agents { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,340px),1fr)); gap: 12px; align-items: start; }
.mw-agents > .empty, .mw-list > .empty { grid-column: 1 / -1; }
.mw-lane { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.mw-lane[data-kind="pool"] { background: transparent; }
.mw-lane > header { display: flex; justify-content: space-between; gap: 12px; }
.mw-lane h3 { margin: 0; font-size: 14px; line-height: 21px; font-weight: 600; overflow-wrap: anywhere; }
.mw-lane > header p { margin: 0; font-size: 12px; line-height: 18px; color: var(--muted); }
.mw-lane > header small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.mw-lane-tools { display: inline-flex; align-items: flex-start; gap: 4px; }
.mw-lane-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 0; font-size: 12px; }
.mw-card-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; }
.mw-lane-sessions { margin: 2px 0 0; font-size: 12px; line-height: 18px; color: #91c7a2; overflow-wrap: anywhere; }
.mw-lane-now { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; margin-top: 10px; border-top: 1px solid var(--line); }
.mw-lane-now p { flex: 1 0 100%; margin: 0; font-size: 12px; line-height: 18px; color: var(--muted); overflow-wrap: anywhere; }
.mw-idle { font-size: 12px; color: var(--muted); }
.mw-mini { max-width: 100%; padding: 4px 8px; font-size: 12px; line-height: 18px; text-align: left; color: var(--text); background: var(--surface-2); border: 1px solid transparent; border-radius: 4px; overflow-wrap: anywhere; }
.mw-mini:hover { border-color: var(--line-strong); }
.mw-mini.is-now { font-weight: 600; }
.mw-lane-group { padding-top: 8px; }
.mw-lane-group h4 { margin: 0 0 6px; font-size: 11px; font-weight: 400; color: var(--muted); }
.mw-lane-group > div { display: flex; flex-wrap: wrap; gap: 6px; }
.mw-connect { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr) auto; align-items: center; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.mw-connect h3 { margin: 0; font-size: 13px; font-weight: 600; }
.mw-connect p { margin: 2px 0 0; font-size: 12px; line-height: 18px; color: var(--muted); }
.mw-connect code { font-family: Consolas, monospace; font-size: 12px; line-height: 18px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow-wrap: anywhere; }

/* Sprint network: one column per step, edges drawn from the real node positions. */
.mw-network-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.mw-network-head h2 { margin: 0; font-size: 14px; line-height: 21px; font-weight: 600; }
.mw-network-head p { margin: 2px 0 0; font-size: 12px; line-height: 18px; color: var(--muted); max-width: 720px; }
.mw-network-head dl { display: flex; gap: 24px; margin: 0; }
.mw-network-head dt { margin: 0; font-size: 11px; color: var(--muted); }
.mw-network-head dd { margin: 0; font-size: 14px; font-weight: 600; }
.mw-graph { position: relative; overflow: auto; padding-bottom: 8px; }
.mw-edges { position: absolute; left: 0; top: 0; pointer-events: none; }
.mw-edges path { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.mw-edges path[data-satisfied="true"] { stroke: #4f6f59; }
.mw-levels { position: relative; display: inline-flex; align-items: flex-start; gap: 56px; min-width: 100%; }
.mw-level { display: grid; gap: 12px; width: 220px; flex: 0 0 220px; }
.mw-level h3 { margin: 0; font-size: 11px; font-weight: 400; color: var(--muted); }
.mw-node { position: relative; display: grid; gap: 6px; width: 100%; padding: 10px; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.mw-node:hover { border-color: var(--line-strong); background: var(--surface-2); }
.mw-node[data-critical="true"] { border-left: 2px solid var(--warning); }
.mw-node[data-status="running"], .mw-node[data-status="starting"] { border-color: #4f6f59; }
.mw-node[data-status="blocked"] { border-color: #7a4d55; }
.mw-node[data-status="done"] { opacity: .72; }
.mw-node b { font-size: 13px; line-height: 19px; font-weight: 600; overflow-wrap: anywhere; }
.mw-node > span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.mw-after { display: none; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.mw-states { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.mw-states summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.mw-state-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 32px; margin-top: 12px; }
.mw-state-grid h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; }
.mw-state-grid p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 6px; font-size: 12px; line-height: 18px; }
.mw-state-grid p b { font-weight: 600; }
.mw-state-grid p span:not(.mw-chip) { color: var(--muted); }

/* Run panel inside the card. */
.mw-editor > header { gap: 12px; }
.mw-editor > header h2 { flex: 1; }
.mw-run { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.mw-run dl { display: grid; gap: 6px; margin: 0 0 10px; }
.mw-run dl > div { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 8px; font-size: 12px; line-height: 18px; }
.mw-run dt, .mw-run dd { margin: 0; line-height: 18px; }
.mw-run dt { color: var(--muted); }
.mw-run dd { overflow-wrap: anywhere; }
.mw-locked { color: var(--warning); }
.mw-legend i { display: inline-block; align-self: center; width: 2px; height: 14px; background: var(--warning); }
.mw-return { padding: 10px; margin-bottom: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.mw-return h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; }
.mw-return p { margin: 0 0 6px; font-size: 13px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mw-return small { display: block; font-size: 12px; line-height: 18px; color: var(--muted); overflow-wrap: anywhere; }
.mw-return small[data-check="failed"] { color: var(--danger); }
.mw-run-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mw-automation-fields { margin-top: 12px; }

@media (max-width: 560px) {
  .mw-wide { display: none; }
  .mw-toolbar .team-tabs { order: 0; }
  .mw-toolbar .team-command { padding: 6px 9px; }
  .mw-toolbar .team-search { flex: 1 1 60px; width: 60px; padding: 0 8px; gap: 6px; }
  .mw-switch { padding: 6px 9px; }
}
@media (max-width: 370px) {
  .mw-toolbar .team-search { order: 1; flex: 1 1 100%; width: 100%; }
  .mw-toolbar .team-command { margin-left: auto; }
}
@media (max-width: 860px) { .mw-connect { grid-template-columns: minmax(0,1fr) auto; } .mw-connect > div { grid-column: 1 / -1; } }
@media (max-width: 620px) {
  .mw-levels { display: grid; gap: 16px; width: 100%; }
  .mw-level { width: 100%; }
  .mw-edges { display: none; }
  .mw-after { display: block; }
  .mw-state-grid { grid-template-columns: minmax(0,1fr); }
  .mw-automation-state { margin-left: 0; }
}

/* Work owns card execution truth; Codex plans and Goals are live readbacks. */
.mw-checklist { margin: 8px 0; min-width: 0; }
.mw-checklist > header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mw-checklist h3 { font-size: 13px; margin: 0; }
.mw-checklist [data-checklist-count], .mw-checklist-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mw-checklist [data-checklist-add] { margin-left: auto; }
.mw-checklist ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mw-checklist-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px; padding: 0 0 8px; border-bottom: 1px solid var(--line); min-width: 0; }
.mw-checklist-row > textarea { width: 100%; min-width: 0; min-height: 36px; max-height: 72px; padding: 6px 8px; resize: vertical; overflow: auto; overflow-wrap: anywhere; field-sizing: content; }
.mw-checklist-tools { display: flex; align-items: center; gap: 4px; min-width: 0; }
.mw-checklist-tools [data-checklist-status] { width: 126px; font-size: 12px; }
.mw-checklist-tools .custom-select > details > summary { min-height: 36px; padding: 6px 8px; }
.mw-checklist-tools .team-icon-button { width: 28px; height: 28px; min-width: 28px; padding: 4px; }
.mw-checklist-row [data-checklist-up] svg { transform: rotate(90deg); }
.mw-checklist-row [data-checklist-down] svg { transform: rotate(-90deg); }
.mw-checklist-row[data-status="completed"] > textarea { color: var(--muted); }
.mw-checklist-row[data-status="in_progress"] [data-checklist-status] summary { color: var(--accent); }

/* Cards open as documents; editing is an explicit action. */
.mw-reference { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; margin: 0; }
.mw-card-detail > header { gap: 8px; padding-block: 12px; }
.mw-card-detail > header h2 { font-size: 16px; }
form.mw-editor > .modal-scroll { gap: 8px; }
.mw-card-detail .modal-scroll { padding-block: 12px; gap: 0; }
.mw-detail-overview { margin-bottom: 12px; }
.mw-detail-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mw-detail-title { margin: 8px 0; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.mw-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.mw-detail-progress { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.mw-detail-progress progress { flex: 1; height: 4px; max-width: 140px; }
.mw-detail-progress span { font-variant-numeric: tabular-nums; }
.mw-assignee-warning { color: var(--warning); font-size: 12px; margin: 8px 0 0; }
.mw-detail-group { border-top: 1px solid var(--line); }
.mw-detail-group > summary { cursor: pointer; padding: 12px 0; font-size: 13px; line-height: 20px; }
.mw-detail-group > summary > span { margin-left: 4px; font-weight: 600; }
.mw-detail-group > summary > small { float: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.mw-detail-group > summary:focus-visible { outline: 2px solid var(--module-accent); outline-offset: -2px; border-radius: 4px; }
.mw-detail-body { padding-bottom: 12px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.mw-rendered-text { white-space: pre-wrap; }
.mw-detail-body h4 { margin: 12px 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.mw-detail-body h4:first-child { margin-top: 0; }
.mw-detail-body ul { padding-left: 20px; margin: 4px 0 8px; }
.mw-detail-body a { color: var(--module-accent); }
.mw-detail-body .mw-run { border: 0; padding: 0; margin: 12px 0 0; }
.mw-detail-body .mw-event:first-child { padding-top: 0; }
.mw-detail-body .mw-event { padding-block: 8px; }
.mw-detail-facts { display: grid; gap: 4px; margin: 0; }
.mw-detail-facts > div { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 8px; }
.mw-detail-facts dt, .mw-detail-facts dd { margin: 0; line-height: 20px; }
.mw-detail-facts dt { color: var(--muted); }
.mw-checklist-read { list-style: none; margin: 0; padding: 0; }
.mw-checklist-read li { display: grid; grid-template-columns: 16px minmax(0,1fr) auto; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mw-checklist-read li:last-child { border: 0; }
.mw-checklist-read small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.mw-checklist-read .mw-task-route { display: block; white-space: normal; overflow-wrap: anywhere; margin-top: 3px; line-height: 1.4; }
.mw-item-indicator { color: var(--muted); }
.mw-checklist-read [data-status="in_progress"] .mw-item-indicator { color: var(--accent); }
.mw-checklist-read [data-status="completed"] .mw-item-indicator { color: var(--success); }
@media (max-width: 620px) {
  .mw-checklist-row { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .mw-checklist-tools [data-checklist-status] { margin-right: auto; }
  .mw-checklist-read li { grid-template-columns: 16px minmax(0,1fr); gap: 4px 8px; }
  .mw-checklist-read small { grid-column: 2; }
}
.mw-card > progress { width: 100%; height: 4px; accent-color: var(--accent); }
.live-plan{margin:12px 0 0;padding:11px 12px;border:1px solid #284459;border-radius:10px;background:#0b141e}
.live-plan header{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px;color:#9fc7ff}
.live-plan header span{font-variant-numeric:tabular-nums;color:var(--muted)}
.live-plan p{display:grid;grid-template-columns:18px minmax(0,1fr);gap:7px;margin:6px 0;color:var(--muted);line-height:1.4}
.live-plan p i{font-style:normal;text-align:center}
.live-plan p.completed{color:#76d5bd}.live-plan p.inProgress{color:var(--text)}.live-plan p.inProgress i{color:#8bb8ff}
.live-plan.is-compact{padding:7px 9px;margin-top:9px}.live-plan.is-compact header{margin:0}.live-plan.is-compact p{margin:5px 0 0;font-size:12px}
.work-goals{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:10px;margin-top:10px}
.goal-card{padding:16px}.goal-card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:13px}.goal-card h3{margin:3px 0 0;font-size:17px}.goal-card .status{padding:4px 9px;border:1px solid var(--line);border-radius:99px;color:var(--muted)}
.goal-card .status.active{border-color:#2e7163;color:#79d7bf}.goal-card .status.blocked,.goal-card .status.budgetLimited,.goal-card .status.usageLimited{border-color:#7c4a50;color:#ffabb4}
.goal-card .field{margin:0}.goal-controls{display:grid;grid-template-columns:minmax(150px,1fr) minmax(130px,.7fr) auto auto;align-items:end;gap:10px;margin-top:10px}.goal-usage{display:flex;gap:10px;align-items:center;height:42px;color:var(--muted);white-space:nowrap}.goal-usage b{color:var(--text)}
.goal-card.is-unavailable{border-color:#5f3f45}.goal-card.is-unavailable>p{color:var(--muted);margin-bottom:0}

@media(max-width:620px){
  .work-goals{grid-template-columns:1fr}.goal-card{padding:13px}.goal-controls{grid-template-columns:1fr 1fr}.goal-usage{height:auto}.goal-save{justify-self:end}
}

.room-members{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0;padding:10px;border:1px solid var(--line);border-radius:11px}.room-members legend{padding:0 6px;color:var(--muted);font-size:13px}.room-members label{display:flex;align-items:center;gap:8px;padding:8px;border-radius:8px}.room-members label:hover{background:#121b27}.room-members input{accent-color:var(--accent)}
@media(max-width:620px){
  .room-members{grid-template-columns:1fr}
}
