:root {
  color-scheme: light;
  --canvas: #f5f6f4;
  --surface: #fff;
  --surface-subtle: #f1f2ef;
  --surface-hover: #f5f6f4;
  --ink: #242b30;
  --muted: #5e686d;
  --subtle: #657067;
  --line: #e0e3df;
  --line-strong: #cbd1cc;
  --accent: #3f5f4e;
  --accent-soft: #e9efeb;
  --selected-surface: #e7eee8;
  --focus-ring: #3f7056;
  --success: #3f704f;
  --success-soft: #eff4ef;
  --warning: #866127;
  --warning-soft: #f6f2e9;
  --danger: #a04c43;
  --danger-soft: #f7efed;
  --radius: 5px;
  --radius-compact: 4px;
  --rail-width: 60px;
  --control-height: 36px;
  --row-height: 42px;
  --font-caption: 12px;
  --font-secondary: 13px;
  --font-body: 14px;
  --font-section: 16px;
  --font-page-title: 23px;
  --line-height-body: 1.55;
  --line-height-tight: 1.35;
  --border-width: 1px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --body-font: "Yu Gothic UI", Meiryo, "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  font-family: var(--body-font);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font: var(--font-body)/var(--line-height-body) var(--body-font); }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.app-shell { min-height: 100vh; }

/* Global navigation is a rail; project selection lives in the workspace bar. */
.nav-rail { align-items: center; background: #f9f9f7; border-right: 1px solid var(--line); bottom: 0; display: flex; flex-direction: column; left: 0; padding: 12px 8px 10px; position: fixed; top: 0; width: var(--rail-width); z-index: 10; }
.brand-mark { align-items: center; background: var(--accent); border-radius: 5px; color: #fff; display: flex; font-size: 14px; font-weight: 600; height: 30px; justify-content: center; margin-bottom: 23px; text-decoration: none; width: 30px; }
.rail-nav { align-items: center; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.rail-link { align-items: center; background: transparent; border: 0; border-radius: 5px; color: #67716f; display: inline-flex; height: 40px; justify-content: center; position: relative; width: 40px; }
.rail-link:hover { background: #eceeeb; color: var(--ink); }
.rail-link.is-active { background: #e9ede9; color: var(--accent); }
.rail-link.is-active::before { background: var(--accent); border-radius: 0 2px 2px 0; content: ""; height: 19px; left: -8px; position: absolute; width: 2px; }
.rail-link svg, .topbar svg, .icon-button svg, .button svg { fill: none; height: 18px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.45; width: 18px; }
.rail-count { align-items: center; background: var(--danger-soft); border-radius: 9px; color: var(--danger); display: none; font-size: 9px; height: 15px; justify-content: center; line-height: 1; min-width: 15px; padding: 0 3px; position: absolute; right: -2px; top: -1px; }
.rail-count:not(:empty) { display: inline-flex; }
.rail-divider { background: var(--line); height: 1px; margin: 13px 0; width: 27px; }
.rail-spacer { flex: 1; }
.rail-local-dot { background: var(--success); border: 2px solid #f9f9f7; border-radius: 50%; bottom: 11px; height: 9px; position: absolute; width: 9px; }

.main-area { margin-left: var(--rail-width); min-height: 100vh; min-width: 0; }
.topbar { align-items: center; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; gap: 18px; height: 50px; padding: 0 24px; position: sticky; top: 0; z-index: 8; }
.topbar-scope { flex: 0 0 205px; min-width: 150px; }
.topbar-scope select { appearance: none; background: transparent; border: 0; border-radius: 4px; color: #39443f; font-size: 13px; font-weight: 500; max-width: 100%; min-height: 34px; padding: 5px 24px 5px 7px; }
.topbar-scope select:hover { background: var(--surface-hover); }
.global-search { align-items: center; background: #f5f6f4; border: 1px solid transparent; border-radius: 5px; color: var(--muted); display: flex; gap: 8px; height: 32px; margin: 0 auto 0 0; max-width: 510px; min-width: 150px; padding: 0 8px; width: 42%; }
.global-search:focus-within { background: #fff; border-color: var(--line-strong); }
.global-search svg { flex: 0 0 17px; height: 17px; width: 17px; }
.global-search input { background: transparent; border: 0; font-size: 12px; min-width: 0; outline: 0; padding: 4px 0; width: 100%; }
.global-search kbd { border: 1px solid var(--line); border-radius: 3px; color: var(--subtle); font: 10px var(--body-font); padding: 0 5px; }
.top-actions { align-items: center; display: flex; gap: 8px; margin-left: auto; }
.button { align-items: center; background: #fff; border: var(--border-width) solid var(--line-strong); border-radius: var(--radius); display: inline-flex; font-size: var(--font-secondary); font-weight: 500; gap: 6px; justify-content: center; min-height: var(--control-height); padding: 5px 10px; white-space: nowrap; }
.button:hover { background: var(--surface-hover); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: #354c40; }
.button.subtle { background: transparent; border-color: transparent; color: #4f5a54; }
.button.danger { background: #fff; border-color: #dfc8c4; color: var(--danger); }
.button.positive { background: #fff; border-color: #cfdacf; color: var(--success); }
.button.warning { background: #fff; border-color: #e3dac7; color: var(--warning); }
.button.small { min-height: 30px; padding: 4px 9px; }
.button:disabled { color: var(--subtle); cursor: not-allowed; opacity: .58; }
.button.positive:focus-visible, .button.warning:focus-visible, .button.danger:focus-visible { outline-offset: 2px; }
.button svg { height: 15px; width: 15px; }
.utility-menu { position: relative; }
.utility-menu > summary { align-items: center; border-radius: 4px; color: var(--muted); cursor: pointer; display: flex; height: 32px; justify-content: center; list-style: none; width: 32px; }
.utility-menu > summary::-webkit-details-marker { display: none; }
.utility-menu > summary:hover { background: var(--surface-hover); }
.utility-menu > summary svg { height: 18px; width: 18px; }
.utility-popover { background: #fff; border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 5px 18px rgba(30,38,34,.1); min-width: 230px; padding: 7px; position: absolute; right: 0; top: 38px; z-index: 20; }
.utility-info { border-bottom: 1px solid var(--line); display: grid; gap: 2px; margin-bottom: 5px; padding: 8px; }
.utility-info span, .utility-popover button { font-size: 12px; }
.utility-info small { color: var(--muted); font-size: 10px; }
.utility-popover button { background: transparent; border: 0; border-radius: 4px; display: block; padding: 8px; text-align: left; width: 100%; }
.utility-popover button:hover { background: var(--surface-hover); }
.utility-popover #resetDemo { color: var(--muted); }
.workspace { margin: 0 auto; max-width: 1800px; padding: 19px 26px 36px; }
.server-alert { background: #fff; border: 1px solid #e0c9c3; border-left: 3px solid var(--danger); border-radius: 4px; color: #704a43; margin: 14px 26px 0; padding: 9px 12px; }
.server-alert button { background: none; border: 0; color: var(--accent); margin-left: 8px; text-decoration: underline; }
.loading-state { align-items: center; color: var(--muted); display: flex; gap: 10px; justify-content: center; min-height: 220px; }
.spinner { animation: spin .9s linear infinite; border: 2px solid #d9ded9; border-radius: 50%; border-top-color: var(--accent); height: 16px; width: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-head { align-items: center; display: flex; gap: 14px; justify-content: space-between; margin: 0 0 13px; min-height: 31px; }
.page-head h1, .workspace > h1 { font-size: var(--font-page-title); font-weight: 500; letter-spacing: -.02em; line-height: var(--line-height-tight); margin: 0; }
.page-head p { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 3px 0 0; }
.page-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; }
.kicker { color: var(--muted); font-size: 11px; margin: 0 0 2px; }
.section-title, .workspace-section-head { align-items: center; display: flex; gap: 12px; justify-content: space-between; margin: 0 0 9px; }
.section-title h2, .section-title h3, .workspace-section-head h2 { font-size: var(--font-section); font-weight: 500; line-height: var(--line-height-tight); margin: 0; }
.section-title p, .workspace-section-head p { color: var(--muted); font-size: 12px; margin: 2px 0 0; }
.section-gap { margin-top: 22px; }

/* Dashboard: an operational strip, a decision inbox, and one health table. */
.dashboard-page > .page-head { margin-bottom: 7px; }
.dashboard-date { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.status-strip { align-items: center; border-bottom: 1px solid var(--line-strong); border-top: 1px solid var(--line); display: flex; height: 44px; margin-bottom: 16px; overflow-x: auto; }
.status-strip-item { align-items: baseline; border-right: 1px solid var(--line); display: flex; flex: 1 0 auto; gap: 7px; min-width: max-content; padding: 0 15px; }
.status-strip-item:first-child { padding-left: 0; }
.status-strip-item:last-child { border-right: 0; }
.status-strip-item label { color: var(--muted); font-size: 12px; }
.status-strip-item strong { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 500; }
.status-strip-item small { color: var(--muted); font-size: 10px; }
.dashboard-main { display: grid; gap: 25px; grid-template-columns: minmax(0, 1.95fr) minmax(285px, .95fr); }
.dashboard-inbox, .dashboard-operations { min-width: 0; }
.dashboard-inbox .workspace-section-head { margin-bottom: 4px; }
.dashboard-inbox .workspace-section-head h2, .dashboard-operations .workspace-section-head h2 { font-size: 16px; }
.compact-project-health { margin-top: 13px; }
.compact-project-health .workspace-section-head { margin-bottom: 0; }
.compact-project-health .project-health-table th, .compact-project-health .project-health-table td { padding: 6px 8px; }
.dashboard-operations .operation-group { margin-bottom: 8px; }
.dashboard-operations .operation-row { padding-bottom: 4px; padding-top: 4px; }
.dashboard-operations .operation-row small { font-size: 11px; }
.inbox-list { border-top: 1px solid var(--line-strong); }
.review-row { align-items: center; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: inherit; column-gap: 13px; display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(150px, 1.15fr) minmax(110px, .75fr); min-height: 66px; padding: 9px 9px; text-align: left; width: 100%; }
.review-row:hover { background: var(--surface-hover); }
.review-row:focus-visible { outline-offset: -2px; }
.review-row.is-selected { background: var(--selected-surface); box-shadow: inset 3px 0 0 var(--accent); }
.review-main, .review-reason { min-width: 0; }
.review-main strong, .review-reason strong { color: var(--ink); display: block; font-size: 14px; font-weight: 500; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-main small, .review-reason small { color: var(--muted); display: block; font-size: 12px; line-height: 1.45; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-reason strong { color: #46534b; font-size: 12px; }
.review-meta { align-items: center; color: var(--muted); display: flex; gap: 7px; justify-content: flex-end; white-space: nowrap; }
.review-priority { display: none; }
.review-mini { border-left: 1px solid var(--line-strong); color: var(--muted); font-size: 12px; padding-left: 7px; }
.review-empty, .empty-state { color: var(--muted); padding: 20px 12px; }
.review-empty strong, .empty-state strong { color: var(--ink); display: block; font-size: 13px; font-weight: 500; }
.review-empty p, .empty-state p { font-size: 12px; line-height: 1.5; margin: 4px 0 0; }
.dashboard-operations { border-left: 1px solid var(--line); padding-left: 20px; }
.operation-group { margin: 0 0 13px; }
.operation-group h3 { align-items: center; color: #46534b; display: flex; font-size: 13px; font-weight: 500; gap: 7px; margin: 0 0 4px; }
.operation-group h3 .count { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }
.operation-list { border-top: 1px solid var(--line); }
.operation-row { align-items: start; border-bottom: 1px solid var(--line); color: inherit; display: grid; gap: 8px; grid-template-columns: 8px minmax(0,1fr) auto; padding: 7px 1px; text-decoration: none; }
button.operation-row { background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.operation-row:hover { background: var(--surface-hover); }
.operation-row strong { display: block; font-size: 13px; font-weight: 500; line-height: 1.45; }
.operation-row small { color: var(--muted); display: block; font-size: 12px; margin-top: 2px; }
.operation-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-dot, .risk-dot { background: var(--subtle); border-radius: 50%; display: inline-block; flex: 0 0 7px; height: 7px; margin-top: 4px; width: 7px; }
.dot-running, .dot-progress { background: #657e70; }
.dot-failed, .dot-high { background: var(--danger); }
.dot-warning, .dot-medium { background: var(--warning); }
.dot-good, .dot-low { background: var(--success); }
.project-health { margin-top: 18px; }
.project-health .workspace-section-head { border-bottom: 1px solid var(--line-strong); margin-bottom: 0; padding-bottom: 7px; }
.project-health-table, .data-table { border-collapse: collapse; font-size: 13px; width: 100%; }
.project-health-table th, .data-table th { background: #f6f7f5; border-bottom: 1px solid var(--line); color: #566166; font-size: 12px; font-weight: 500; padding: 8px 11px; text-align: left; white-space: nowrap; }
.project-health-table td, .data-table td { border-bottom: 1px solid var(--line); padding: 9px 11px; vertical-align: middle; }
.project-health-table tbody tr:hover, .data-table tbody tr:hover { background: var(--surface-hover); }
.project-health-table td:first-child { min-width: 185px; }
.project-health-name { background: transparent; border: 0; color: var(--ink); font-size: 13px; font-weight: 500; padding: 0; text-align: left; }
.project-health-name:hover, .task-title-button:hover { color: var(--accent); text-decoration: underline; }
.health-progress { align-items: center; display: flex; gap: 7px; min-width: 115px; }
.health-progress .progress-track { flex: 1; }
.health-progress strong, .tabular { font-variant-numeric: tabular-nums; }
.next-due { white-space: nowrap; }

/* Context navigation and compact PM tables. */
.project-context-head { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; margin: -3px 0 0; min-height: 43px; }
.project-context-title { align-items: baseline; display: flex; flex-wrap: wrap; gap: 9px; min-width: 0; }
.project-context-title h1, .project-context-title h2 { font-size: 20px; font-weight: 500; letter-spacing: -.01em; line-height: 1.35; margin: 0; }
.project-context-title .project-code { color: var(--muted); font-size: 12px; font-weight: 500; }
.project-context-actions { display: flex; gap: 5px; }
.project-navigation { border-bottom: 1px solid var(--line); margin: 0 0 15px; }
.project-groups { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 4px; min-height: 37px; overflow-x: auto; scrollbar-width: thin; }
.project-group { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); flex: 0 0 auto; font-size: 13px; font-weight: 500; min-height: 37px; padding: 7px 12px 6px; }
.project-group:hover { background: #f7f8f6; color: var(--ink); }
.project-group.is-active { border-bottom-color: var(--accent); color: var(--accent); }
.project-tabs { display: flex; gap: 3px; min-height: 34px; overflow-x: auto; scrollbar-width: thin; }
.project-tab { background: transparent; border: 0; border-radius: 3px; color: var(--muted); flex: 0 0 auto; font-size: 13px; min-height: 32px; padding: 5px 10px; }
.project-tab:hover { background: var(--surface-hover); color: var(--ink); }
.project-tab.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.page-actions { display: flex; gap: 6px; }
.toolbar { align-items: end; background: transparent; border: 0; display: grid; gap: 7px; grid-template-columns: minmax(180px, 1.5fr) repeat(4, minmax(90px, .8fr)) minmax(100px,1fr) auto auto; margin: 0 0 8px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { color: var(--muted); font-size: 12px; font-weight: 400; }
.field input, .field select, .field textarea, .toolbar input, .toolbar select, .inline-control { background: #fff; border: 1px solid var(--line-strong); border-radius: 4px; font-size: 13px; min-height: 32px; padding: 5px 8px; }
.field textarea { min-height: 68px; resize: vertical; }
.filter-more { align-self: center; grid-column: 1/-1; }
.filter-more summary { color: var(--muted); cursor: pointer; font-size: 12px; padding: 3px 0; width: fit-content; }
.filter-more-fields { align-items: end; display: grid; gap: 8px; grid-template-columns: repeat(5,minmax(90px,1fr)); padding-top: 7px; }
.table-wrap { border: 1px solid var(--line); border-radius: 4px; max-width: 100%; overflow: auto; }
.data-table { min-width: 890px; }
.data-table th { position: sticky; top: 0; z-index: 1; }
.data-table td { font-size: 13px; }
.task-title-button { background: transparent; border: 0; color: #334d3f; font-size: 14px; font-weight: 500; padding: 0; text-align: left; }
.task-key, .project-code { color: var(--muted); font-family: var(--body-font); font-size: 11px; font-variant-numeric: tabular-nums; }
.blocked-note { color: #7b5827; display: block; font-size: 12px; margin-top: 2px; }
.type-tag, .label-chip, .priority-text, .risk-tag, .status-tag { align-items: center; background: transparent; border-radius: 3px; color: #525d57; display: inline-flex; font-size: 12px; font-weight: 400; gap: 4px; line-height: 1.4; padding: 2px 6px; white-space: nowrap; }
.status-tag::before, .risk-tag::before { background: currentColor; border-radius: 50%; content: ""; display: inline-block; height: 5px; opacity: .72; width: 5px; }
.status-todo, .status-planned, .status-pending { color: #727a76; }
.status-in_progress, .status-active, .status-agent_running { color: #486554; }
.status-in_review, .status-waiting_human { color: var(--warning); }
.status-blocked, .status-failed, .status-rejected { color: var(--danger); }
.status-rework, .status-rework_requested, .status-held { color: #8b6b3f; }
.status-done, .status-verified, .status-accepted, .status-ready_to_ship, .status-shipped, .status-completed { color: var(--success); }
.risk-high { color: var(--danger); }
.risk-medium { color: var(--warning); }
.risk-low { color: var(--success); }
.priority-urgent, .priority-high { color: var(--danger); }
.priority-medium { color: var(--warning); }
.priority-low { color: var(--muted); }
.inline-control.status-todo, .inline-control.status-planned, .inline-control.status-in_progress, .inline-control.status-active, .inline-control.status-agent_running, .inline-control.status-in_review, .inline-control.status-waiting_human, .inline-control.status-pending, .inline-control.status-blocked, .inline-control.status-failed, .inline-control.status-rejected, .inline-control.status-rework, .inline-control.status-rework_requested, .inline-control.status-done, .inline-control.status-verified, .inline-control.status-accepted, .inline-control.status-ready_to_ship, .inline-control.status-shipped, .inline-control.status-completed, .inline-control.priority-urgent, .inline-control.priority-high, .inline-control.priority-medium, .inline-control.priority-low { background-color: #fff; }
.label-chip { background: #f1f2ef; }
.progress-track { background: #e7e9e6; border-radius: 2px; height: 4px; overflow: hidden; }
.progress-track span { background: #788a7d; border-radius: inherit; display: block; height: 100%; }

/* Master–detail workspaces preserve list context while inspecting an item. */
.master-detail { background: var(--surface); border: 1px solid var(--line); display: grid; grid-template-columns: minmax(330px, 42%) minmax(0,1fr); height: min(760px, calc(100vh - 190px)); min-height: 590px; }
.master-pane { min-width: 0; overflow: auto; }
.master-pane-head { align-items: center; background: #fafaf9; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; min-height: 42px; padding: 7px 14px; position: sticky; top: 0; z-index: 2; }
.master-pane-head h2 { font-size: 14px; font-weight: 500; margin: 0; }
.master-pane-head small { color: var(--muted); font-size: 12px; }
.master-pane .inbox-list { border-top: 0; }
.task-workspace { height: min(690px, calc(100vh - 248px)); min-height: 470px; }
.task-master-table { border: 0; border-radius: 0; overflow: auto; }
.task-master-table .data-table { min-width: 570px; }
.task-master-table .data-table th:first-child { width: 82px; }
.task-master-table .data-table th:nth-child(2) { min-width: 190px; }
.task-master-table .data-table td { padding: 8px 10px; }
.task-master-table .task-project-line, .project-repository { display: block; font-size: 12px; margin-top: 3px; }
.task-master-table tr.is-selected { background: var(--selected-surface); box-shadow: inset 3px 0 0 var(--accent); }
.task-master-table tr:focus-within { background: #f0f4f0; }
.project-index-table { min-width: 860px; }
.project-card-top { align-items: center; display: inline-flex; gap: 8px; }
.project-index-table tbody tr[data-project-open] { cursor: pointer; }
.project-index-table tbody tr[data-project-open]:hover { background: var(--surface-hover); }
.review-workspace { height: min(760px, calc(100vh - 165px)); min-height: 600px; grid-template-columns: minmax(420px, 42%) minmax(0,1fr); }
.review-workspace .master-pane { display: flex; flex-direction: column; }
.review-workspace #reviewQueue { flex: 1; overflow: auto; }
.review-workspace .review-row { align-content: center; align-items: center; border-radius: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: auto auto; min-height: 94px; row-gap: 5px; padding: 10px 13px; }
.review-workspace .review-main { grid-column: 1; grid-row: 1; }
.review-workspace .review-main strong { font-size: 14px; }
.review-workspace .review-main small { font-size: 12px; }
.review-workspace .review-meta { align-self: start; grid-column: 2; grid-row: 1; }
.review-workspace .review-reason { grid-column: 1/-1; grid-row: 2; }
.review-workspace .review-reason strong { font-size: 12px; line-height: 1.4; white-space: normal; }
.review-workspace .review-reason small { align-items: center; display: flex; gap: 5px; margin-top: 2px; }
.resolved-review-list { border-top: 1px solid var(--line); flex: 0 0 auto; max-height: 150px; overflow: auto; }
.resolved-review-list summary { background: #fafaf9; color: var(--muted); cursor: pointer; font-size: 12px; list-style-position: inside; padding: 9px 13px; position: sticky; top: 0; }
.resolved-review-row { align-items: center; background: #fff; border: 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: auto minmax(0,1fr); padding: 9px 12px; text-align: left; width: 100%; }
.resolved-review-row:hover { background: var(--surface-hover); }
.resolved-review-row strong, .resolved-review-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resolved-review-row strong { font-size: 13px; font-weight: 500; }
.resolved-review-row small { color: var(--muted); font-size: 12px; }
.detail-pane-inline { background: #fff; border-left: 1px solid var(--line); min-width: 0; overflow: auto; position: relative; }
.detail-placeholder { align-items: center; color: var(--muted); display: flex; flex-direction: column; height: 100%; justify-content: center; padding: 25px; text-align: center; }
.detail-placeholder strong { color: #3d4942; font-size: 15px; font-weight: 500; }
.detail-placeholder p { font-size: 13px; margin: 4px 0 0; }
.inline-detail-toolbar { align-items: center; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; gap: 8px; min-height: 38px; padding: 4px 16px; position: sticky; top: 0; z-index: 3; }
.inline-detail-toolbar .button { min-height: 26px; }
.inline-detail-position { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; margin-left: auto; }
.inline-detail-toolbar > div:last-child { display: flex; gap: 2px; }
.inline-detail-scroll { padding: 13px 18px 90px; }
.detail-back { display: none; }
.task-workspace { grid-template-columns: minmax(400px, 46%) minmax(0,1fr); }
.project-context-meta { color: var(--muted); font-size: 12px; font-weight: 400; max-width: min(38vw,500px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-actions-menu { position: relative; }
.project-actions-menu summary { color: var(--muted); cursor: pointer; font-size: 17px; letter-spacing: 1px; list-style: none; line-height: 28px; padding: 0 7px; }
.project-actions-menu summary::-webkit-details-marker { display: none; }
.project-actions-menu > div { background: #fff; border: 1px solid var(--line); padding: 5px; position: absolute; right: 0; top: 30px; z-index: 5; }
.project-overview-columns { display: grid; gap: 28px; grid-template-columns: minmax(0,1.2fr) minmax(280px,.8fr); }
.overview-section { border-bottom: 1px solid var(--line); min-width: 0; padding-bottom: 12px; }
.project-facts { border-top: 1px solid var(--line); margin: 0; }
.project-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.project-facts > div { border-bottom: 1px solid var(--line); display: block; min-width: 0; padding: 6px 9px 6px 0; }
.project-facts dt { color: var(--muted); font-size: 12px; }
.project-facts dd { font-size: 13px; margin: 2px 0 0; overflow-wrap: anywhere; }
.project-plan-strip { border-bottom: 1px solid var(--line); display: grid; gap: 0; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 10px; }
.project-plan-strip > div { border-right: 1px solid var(--line); min-width: 0; padding: 7px 10px; }
.project-plan-strip > div:first-child { padding-left: 0; }
.project-plan-strip > div:last-child { border-right: 0; }
.project-plan-strip span, .project-plan-strip strong, .project-plan-strip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-plan-strip span { color: var(--muted); font-size: 11px; }
.project-plan-strip strong { font-size: 13px; font-weight: 550; margin: 2px 0; }
.project-plan-strip small { color: var(--muted); font-size: 11px; }
.project-decision-history { margin-top: 17px; max-width: 760px; }
.review-workspace .review-action-box { bottom: 0; margin: 12px -18px -14px; padding: 11px 18px calc(12px + env(safe-area-inset-bottom)); position: sticky; }

/* Shared detail grammar for Task, Review, Objective and Run. */
.detail-panel { background: #fff; border-left: 1px solid var(--line); height: 100dvh; max-width: 100vw; overflow-y: auto; padding: 25px 28px 36px; position: fixed; right: 0; top: 0; transform: translateX(105%); transition: transform .18s ease; width: min(760px, 60vw); z-index: 30; }
.detail-panel.open { transform: translateX(0); }
.close-detail { position: absolute; right: 11px; top: 10px; }
.detail-kicker { color: var(--muted); font-size: 12px; margin: 0 38px 5px 0; }
.detail-title { font-size: 21px; font-weight: 500; line-height: 1.4; margin: 5px 38px 6px 0; }
.detail-lead { color: #46514b; font-size: 14px; line-height: 1.55; margin: 5px 0 13px; }
.detail-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0 11px; }
.detail-grid { display: grid; gap: 10px 20px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.detail-field { min-width: 0; }
.detail-field span { color: var(--muted); display: block; font-size: 12px; line-height: 1.4; }
.detail-field strong { display: block; font-size: 14px; font-weight: 400; line-height: 1.45; margin-top: 3px; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.detail-section { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.detail-section h3 { font-size: 16px; font-weight: 500; margin: 0 0 8px; }
.detail-section h4 { font-size: 14px; font-weight: 500; margin: 0; }
.detail-section > p { margin-top: 4px; }
.detail-list { display: flex; flex-direction: column; }
.detail-list-item { align-items: center; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: inherit; display: flex; gap: 9px; padding: 7px 3px; text-align: left; text-decoration: none; width: 100%; }
.detail-list-item:hover { background: var(--surface-hover); }
.detail-list-item > span:last-child { min-width: 0; }
.detail-list-item strong { display: block; font-size: 14px; font-weight: 500; }
.detail-list-item small { color: var(--muted); display: block; font-size: 12px; margin-top: 3px; }
.evidence-row { align-items: start; border-bottom: 1px solid var(--line); display: grid; gap: 9px; grid-template-columns: 15px minmax(0,1fr); padding: 9px 0; }
.evidence-icon { color: var(--success); font-size: 13px; }
.evidence-icon.is-pending { color: var(--warning); }
.evidence-row strong { font-size: 13px; font-weight: 500; }
.evidence-row p { color: #46514b; font-size: 12px; line-height: 1.5; margin: 3px 0; }
.muted-small { color: var(--muted); font-size: 12px; }
.decision-item { border-bottom: 1px solid var(--line); margin-bottom: 6px; padding: 8px 0; }
.decision-item strong { font-size: 13px; font-weight: 500; }
.decision-item p { color: #46514b; font-size: 12px; margin: 4px 0; }
.decision-item small { color: var(--muted); font-size: 11px; }
.timeline { border-left: 1px solid var(--line-strong); margin: 8px 0 8px 5px; padding-left: 14px; }
.timeline-item { padding: 0 0 10px; position: relative; }
.timeline-dot { background: #7b8b80; border: 2px solid #fff; border-radius: 50%; height: 8px; left: -19px; position: absolute; top: 5px; width: 8px; }
.timeline-item strong { font-size: 13px; font-weight: 500; }
.timeline-item p, .timeline-item small { color: var(--muted); font-size: 12px; margin: 3px 0; }
.review-action-box { background: #fff; border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; bottom: 0; display: grid; gap: 8px; margin: 15px -18px -14px; padding: 11px 18px calc(13px + env(safe-area-inset-bottom)); position: sticky; z-index: 2; }
.review-action-title { display: flex; flex-direction: column; font-size: 13px; font-weight: 500; gap: 1px; }
.review-action-title small { color: var(--muted); font-size: 12px; font-weight: 400; }
.review-action-fields { display: grid; gap: 8px 12px; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); }
.review-action-box .field textarea { min-height: 42px; max-height: 76px; }
.review-action-box .field label { font-size: 12px; }
.review-action-box .page-actions { display: flex; gap: 5px; }
.review-action-box .page-actions .button { flex: 1; min-height: 34px; }
.review-workspace .review-action-box .button.positive { background: var(--accent); border-color: var(--accent); color: #fff; }
.review-workspace .review-action-box .button.positive:hover { background: #344f40; }
.review-workspace .review-action-box .button.warning { background: var(--warning-soft); border-color: #ddcfb2; color: #73521f; }
.review-workspace .review-action-box .button.danger { background: #fffafa; border-color: #e1c5c1; color: #963f38; }
.review-resolved-banner { background: var(--surface-subtle); border-top: 1px solid var(--line); margin: 15px -18px -14px; padding: 12px 18px; }
.review-resolved-banner strong { font-size: 14px; font-weight: 500; }
.review-resolved-banner p { color: var(--muted); font-size: 12px; margin: 3px 0 0; }
.inline-form { align-items: end; display: flex; gap: 7px; margin-top: 7px; }
.inline-form .field { flex: 1; }
.inline-form textarea { min-height: 34px; }
.checkline { color: #4d5752; font-size: 11px; padding: 3px 0; }
.checkline.done { color: var(--success); }
.artifact-preview { border: 1px solid var(--line); border-radius: 3px; display: block; margin-top: 7px; max-height: 220px; max-width: 100%; }
.run-card { align-items: flex-start; }
.scrim { background: rgba(34,40,36,.16); inset: 0; opacity: 0; pointer-events: none; position: fixed; transition: opacity .18s ease; z-index: 29; }
.scrim.open { opacity: 1; pointer-events: auto; }
.icon-button { align-items: center; background: transparent; border: 1px solid transparent; border-radius: 4px; color: var(--muted); display: inline-flex; height: 30px; justify-content: center; width: 30px; }
.icon-button:hover { background: var(--surface-hover); border-color: var(--line); }

/* Review detail: group metadata, Git changes and verification into readable sections. */
.review-overview { border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.review-overview-grid { border-top: 1px solid var(--line); column-gap: 24px; padding: 12px 0 2px; }
.review-reason-section h4 { color: #46534b; margin: 0 0 4px; }
.review-reason-section .detail-lead { margin: 2px 0 7px; }
.review-change-section .section-title { align-items: flex-start; }
.review-change-section .section-title > div { min-width: 0; }
.review-change-section .section-title p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.review-agent-summary { border-left: 2px solid var(--line-strong); color: #46514b; font-size: 13px; line-height: 1.55; margin: 9px 0; padding: 2px 0 2px 10px; }
.review-change-summary { align-items: center; background: #f7f8f6; border: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 9px 0; padding: 8px 10px; }
.review-change-summary span { color: var(--muted); font-size: 12px; }
.review-change-summary strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 500; }
.review-change-summary .diff-add { color: var(--success); }
.review-change-summary .diff-remove { color: var(--danger); }
.review-git-grid { border-top: 1px solid var(--line); display: grid; gap: 0 20px; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0; }
.review-git-grid > div { border-bottom: 1px solid var(--line); min-width: 0; padding: 7px 0; }
.review-git-grid dt { color: var(--muted); font-size: 12px; }
.review-git-grid dd { font-size: 13px; margin: 2px 0 0; overflow-wrap: anywhere; }
.review-disclosure { border-bottom: 1px solid var(--line); padding: 7px 0; }
.review-disclosure summary { color: #46534b; cursor: pointer; font-size: 13px; }
.review-disclosure ul { margin: 7px 0 0; padding-left: 20px; }
.review-disclosure li { font-size: 12px; line-height: 1.5; margin: 3px 0; overflow-wrap: anywhere; }
.review-verification-section > h3 { margin-bottom: 6px; }
.verification-status-list { border-top: 1px solid var(--line); }
.verification-status-list .detail-list-item { min-height: 43px; padding: 8px 5px; }
.verification-status-list .detail-list-item > span:last-child { flex: 1; min-width: 0; }
.verification-status-list .detail-list-item strong { font-size: 13px; }
.verification-status-list .detail-list-item small { font-size: 12px; line-height: 1.45; }
.detail-subsection { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 9px; }
.detail-subsection .section-title { margin-bottom: 3px; }
.detail-subsection .section-title h4 { font-size: 14px; font-weight: 500; }
.missing-acceptance-list { border-top: 1px solid var(--line); list-style: none; margin: 5px 0 0; padding: 0; }
.missing-acceptance-list li { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: 8px minmax(0,1fr) auto; padding: 8px 2px; }
.missing-acceptance-list li span:nth-child(2) { font-size: 13px; }
.missing-acceptance-list li small { color: var(--muted); font-size: 12px; }
.missing-evidence-box { background: #fbf8f1; border: 1px solid #e7ddc8; color: #664f2a; margin: 9px 0; padding: 9px 11px; }
.missing-evidence-box strong { font-size: 13px; font-weight: 500; }
.missing-evidence-box ul { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 4px 0 0; padding-left: 19px; }
.missing-evidence-box li { font-size: 12px; line-height: 1.5; }
.evidence-list { border-top: 1px solid var(--line); }
.review-evidence-section .section-title p { color: var(--muted); font-size: 12px; }
.review-evidence-section .detail-list-item { align-items: flex-start; padding: 9px 3px; }
.review-evidence-section .detail-list-item > span:last-child { flex: 1; }

/* Board cards keep status editing compact and emphasize the work item. */
.board-scroll { max-width: 100%; overflow-x: auto; padding-bottom: 8px; }
.board { gap: 16px; min-height: 430px; padding: 2px 0 14px; }
.board-column { border-top: 2px solid var(--line-strong); flex-basis: 232px; min-height: 370px; padding: 0 5px; width: 232px; }
.board-column-head { margin-bottom: 8px; padding: 9px 3px; }
.board-column-head > div { align-items: center; display: flex; gap: 8px; }
.board-column-head .status-dot { background: currentColor; height: 8px; margin: 0; width: 8px; }
.board-column-head .status-in_progress, .board-column-head .status-active { color: #456a54; }
.board-column-head .status-in_review { color: var(--warning); }
.board-column-head .status-blocked, .board-column-head .status-failed { color: var(--danger); }
.board-column-head .status-done, .board-column-head .status-completed { color: var(--success); }
.board-column-head strong { font-size: 14px; }
.board-count { align-items: center; background: var(--surface-subtle); border-radius: 10px; color: #4e5953; display: inline-flex; font-size: 12px; font-variant-numeric: tabular-nums; height: 22px; justify-content: center; min-width: 24px; padding: 0 6px; }
.board-column-items { display: grid; gap: 8px; }
.task-card { border-color: #d8ded9; border-radius: 5px; margin: 0; padding: 11px 11px 9px; transition: border-color .12s ease, background .12s ease, box-shadow .12s ease; }
.task-card:hover { background: #fff; border-color: #aebbb2; box-shadow: 0 1px 3px rgba(38,48,42,.08); }
.task-card:focus-within { border-color: var(--focus-ring); box-shadow: 0 0 0 2px rgba(63,112,86,.14); }
.task-card-head { align-items: center; display: flex; justify-content: space-between; min-height: 21px; }
.task-card-head .priority-text { font-size: 12px; font-weight: 500; padding: 0; }
.task-card-title { margin: 3px 0 5px; }
.task-card .task-title-button { color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.5; }
.task-card .task-title-button:hover { color: var(--accent); }
.task-card-meta { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; font-size: 12px; gap: 4px 12px; margin-top: 4px; }
.task-card-assignee::before { background: #8b9690; border-radius: 50%; content: ""; display: inline-block; height: 6px; margin: 0 5px 1px 0; width: 6px; }
.task-card-due.is-overdue { color: var(--danger); font-weight: 500; }
.task-card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.task-card-labels .label-chip { background: #f0f3f0; color: #4f5f55; font-size: 11px; }
.task-card .blocked-note { font-size: 12px; margin-top: 7px; }
.task-card-foot { align-items: center; border-top: 1px solid var(--line); display: flex; gap: 6px; justify-content: space-between; margin-top: 9px; padding-top: 7px; }
.task-card-foot small { color: var(--muted); font-size: 11px; max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-status-control { flex: 0 0 auto; }
.board-status-select { appearance: none; background: var(--surface-subtle); border: 1px solid transparent; border-radius: 12px; color: #46534b; font-size: 12px; height: 26px; max-width: 104px; min-height: 26px; padding: 2px 8px; }
.board-status-select:hover { background: var(--accent-soft); border-color: #d1ddd4; }
.board-empty { align-content: center; color: #8a958f; display: grid; font-size: 12px; min-height: 26px; padding: 5px 3px; text-align: center; }

/* Backlog and schedule views receive clearer working surfaces and date cues. */
.backlog-section { background: #fff; border: 1px solid var(--line); margin-top: 10px; min-height: 170px; padding: 0 12px 12px; }
.backlog-section .panel-header { margin: 0 -12px 2px; padding: 10px 12px; }
.backlog-section .panel-header h2 { font-size: 15px; }
.backlog-section .panel-header .muted-small { font-size: 12px; }
.backlog-item { min-height: var(--row-height); grid-template-columns: 54px minmax(190px,1fr) 104px 145px 145px; padding: 8px; }
.backlog-item select { font-size: 12px; min-height: 31px; padding: 4px 7px; }
.backlog-order button { height: 28px; width: 28px; }
.backlog-order button:hover:not(:disabled) { background: var(--accent-soft); border-color: #c4d1c7; color: var(--accent); }
.gantt-wrap { background: #fff; border: 1px solid var(--line); }
.gantt { min-width: 1000px; position: relative; }
.gantt-axis { background: #f1f3f0; grid-template-columns: 260px repeat(var(--gantt-days),minmax(18px,1fr)); }
.gantt-axis > span { border-right-color: #e2e6e2; font-size: 11px; font-variant-numeric: tabular-nums; padding: 7px 2px; }
.gantt-axis > .gantt-axis-label { color: #4b5650; font-size: 12px; font-weight: 500; }
.gantt-axis-day.is-today { background: var(--accent); color: #fff; font-weight: 600; }
.gantt-row { grid-template-columns: 260px minmax(540px,1fr); min-height: 39px; }
.gantt-label { font-size: 13px; min-height: 39px; padding: 5px 9px; }
.gantt-track { height: 39px; }
.gantt-bar { border-radius: 3px; font-size: 11px; font-weight: 500; height: 21px; line-height: 21px; padding: 0 6px; top: 8px; }
.gantt-bar:hover { filter: brightness(.92); }
.gantt-bar.milestone-bar { background: #8b7549; font-size: 13px; height: 22px; line-height: 22px; text-align: center; top: 8px; z-index: 2; }
.gantt-today-line { border-left: 2px solid #557760; bottom: 0; pointer-events: none; position: absolute; top: 0; z-index: 2; }
.gantt-label .task-title-button { font-size: 13px; }

/* Project overview and non-master views use tables and open sections, not card stacks. */
.project-summary-intro { color: #505b54; font-size: 12px; margin: 0 0 10px; }
.project-summary-grid { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); margin-bottom: 10px; }
.summary-box { border-right: 1px solid var(--line); padding: 8px 12px; }
.summary-box:first-child { padding-left: 0; }
.summary-box:last-child { border-right: 0; }
.summary-box span, .summary-box small { color: var(--muted); display: block; font-size: 10px; }
.summary-box strong { display: block; font-size: 17px; font-variant-numeric: tabular-nums; font-weight: 500; margin: 2px 0; }
.panel, .panel-pad, .milestone-card, .sprint-card, .doc-card { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.panel-header { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 7px 0; }
.panel-header h2, .panel-header h3 { font-size: 13px; font-weight: 500; margin: 0; }
.panel-header .muted-small { display: block; }
.panel-body { padding: 8px 0; }
.panel-pad { padding: 8px 0; }
.stat-list { border-top: 1px solid var(--line); }
.stat-line { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 6px 2px; }
.stat-line span { color: var(--muted); font-size: 11px; }
.stat-line strong { font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 500; }
.project-progress { margin: 8px 0; }
.project-progress-head { align-items: baseline; display: flex; justify-content: space-between; }
.project-progress-head > span, .project-progress-head > strong { color: var(--muted); font-size: 10px; font-weight: 400; }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.split-grid { display: grid; gap: 15px 24px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.sprint-card, .milestone-card, .doc-card { border-bottom: 1px solid var(--line); padding: 10px 0; }
.sprint-card h3, .milestone-card h3, .doc-card h3 { font-size: 13px; font-weight: 500; margin: 0; }
.sprint-card p, .milestone-card p { color: var(--muted); font-size: 11px; }
.card-meta { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 10px; gap: 10px; }
.backlog-sprint { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 12px; margin-bottom: 8px; padding: 5px 0; }
.backlog-sprint .section-title { flex: 1; margin: 0; }
.backlog-sprint .section-title p { max-width: 50ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backlog-item { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: 48px minmax(190px,1fr) 95px 135px 135px; padding: 7px 8px; }
.backlog-item:hover { background: var(--surface-hover); }
.backlog-item select { background: #fff; border: 1px solid var(--line); border-radius: 4px; font-size: 10px; min-height: 28px; padding: 3px 5px; }
.backlog-order { display: flex; gap: 2px; }
.backlog-order button { background: #fff; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); height: 25px; width: 25px; }
.backlog-order button:disabled { opacity: .35; }
.board { align-items: flex-start; display: flex; gap: 14px; min-height: 390px; overflow-x: auto; padding: 1px 0 12px; }
.board-column { background: transparent; border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; flex: 0 0 226px; min-height: 300px; padding: 0 5px; width: 226px; }
.board-column-head { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; margin-bottom: 5px; padding: 8px 2px; }
.board-column-head strong { font-size: 12px; font-weight: 500; }
.board-column-head span { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.task-card { background: #fff; border: 1px solid var(--line); border-radius: 4px; margin: 5px 0; padding: 7px 8px; }
.task-card .task-title-button { font-size: 11px; line-height: 1.45; }
.task-card-meta { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 9px; gap: 5px 8px; margin-top: 5px; }
.task-card-foot { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 5px; }
.calendar-grid { background: #fff; border: 1px solid var(--line); display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.calendar-weekday { background: #f7f8f6; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; padding: 6px 8px; }
.calendar-cell { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 86px; overflow: hidden; padding: 5px 6px; }
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell.outside { background: #fafaf9; color: #a4aaa5; }
.calendar-date { display: block; font-size: 10px; font-variant-numeric: tabular-nums; margin-bottom: 3px; }
.calendar-item { appearance: none; background: #f2f4f1; border: 0; border-left: 2px solid #829487; border-radius: 2px; color: #48544c; display: block; font-size: 9px; margin: 2px 0; max-width: 100%; overflow: hidden; padding: 2px 4px; text-align: left; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.calendar-item.overdue { border-left-color: var(--danger); }
.gantt-wrap { border: 0; max-width: 100%; overflow: auto; }
.gantt-axis, .gantt-row { min-width: 1000px; }
.gantt-axis { background: #f4f5f3; display: grid; grid-template-columns: 260px repeat(30,minmax(18px,1fr)); }
.gantt-axis > span { border-bottom: 1px solid var(--line); border-right: 1px solid #eaedea; color: var(--muted); font-size: 9px; padding: 5px 2px; text-align: center; }
.gantt-axis > span:first-child { padding-left: 10px; position: sticky; left: 0; text-align: left; z-index: 2; }
.gantt-row { display: grid; grid-template-columns: 260px minmax(540px,1fr); min-height: 33px; }
.gantt-label { align-items: center; background: #fff; border-bottom: 1px solid var(--line); display: flex; font-size: 10px; gap: 3px; overflow: hidden; padding: 4px 8px; position: sticky; left: 0; text-overflow: ellipsis; white-space: nowrap; z-index: 1; }
.gantt-label.indent-1 { padding-left: 21px; }
.gantt-label.indent-2 { padding-left: 34px; }
.gantt-track { border-bottom: 1px solid var(--line); height: 33px; position: relative; }
.gantt-bar { appearance: none; background: #87968c; border: 0; border-radius: 2px; color: #fff; font-size: 9px; font-weight: 400; height: 17px; line-height: 17px; overflow: hidden; padding: 0 4px; position: absolute; text-align: left; text-overflow: ellipsis; top: 7px; white-space: nowrap; }
.gantt-bar.status-done { background: #839487; }
.gantt-bar.status-blocked { background: #a67b73; }
.gantt-bar.milestone-bar { background: #9c875e; }
.gantt-bar.status-in_progress, .gantt-bar.status-active { background: #718678; }
.doc-grid { display: grid; gap: 10px 24px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.markdown-preview { color: #525c56; font-size: 11px; margin-top: 8px; white-space: pre-wrap; }
.project-stats { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 10px; gap: 12px; margin: 7px 0; }
.project-health-table .project-progress { min-width: 95px; }
.report-grid { display: grid; gap: 20px 28px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.report-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 8px; grid-template-columns: 110px minmax(80px,1fr) 35px; padding: 6px 2px; }
.report-row > span { font-size: 11px; }
.report-row > strong { font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }
.report-bar { background: #eaede9; height: 4px; }
.report-bar i { background: #74877a; display: block; height: 100%; }

.form-dialog { border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 9px 30px rgba(30,38,34,.14); max-height: calc(100vh - 36px); max-width: min(760px,calc(100vw - 28px)); padding: 0; width: 680px; }
.form-dialog::backdrop { background: rgba(34,40,36,.22); }
.dialog-head { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 12px 16px; }
.dialog-head h2 { font-size: 16px; font-weight: 500; margin: 0; }
.dialog-content { max-height: calc(100vh - 120px); overflow: auto; padding: 15px 17px; }
.form-grid { display: grid; gap: 10px 12px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.form-grid .field.full { grid-column: 1/-1; }
.dialog-content form > .page-actions { border-top: 1px solid var(--line); justify-content: flex-end; margin-top: 12px; padding-top: 10px; }
.toast { background: #343f38; border-radius: 4px; bottom: 16px; color: #fff; font-size: 12px; left: 50%; opacity: 0; padding: 8px 13px; pointer-events: none; position: fixed; transform: translate(-50%,8px); transition: .18s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1100px) {
  .workspace { padding-left: 20px; padding-right: 20px; }
  .topbar { padding-left: 18px; padding-right: 18px; }
  .topbar-scope { flex-basis: 165px; }
  .dashboard-main { gap: 17px; grid-template-columns: minmax(0,1.7fr) minmax(250px,.95fr); }
  .review-row { column-gap: 8px; grid-template-columns: minmax(125px,1fr) minmax(110px,.9fr) auto; }
  .review-reason { display: none; }
  .review-workspace { grid-template-columns: minmax(360px,42%) minmax(0,1fr); }
  .review-workspace .review-reason { display: block; }
  .task-workspace { grid-template-columns: minmax(490px,48%) minmax(0,1fr); }
  .detail-panel { width: min(680px,64vw); }
  .project-summary-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .project-plan-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .toolbar { grid-template-columns: repeat(4,minmax(85px,1fr)); }
  .toolbar .search-field { grid-column: span 2; }
  .filter-more-fields { grid-template-columns: repeat(3,minmax(85px,1fr)); }
}
@media (max-width: 780px) {
  .dashboard-main { grid-template-columns: 1fr; }
  .dashboard-operations { border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; }
  .master-detail, .task-workspace { grid-template-columns: minmax(270px,42%) minmax(0,1fr); }
  .inline-detail-scroll { padding-left: 13px; padding-right: 13px; }
  .detail-grid { gap: 7px 10px; }
  .toolbar { grid-template-columns: repeat(3,minmax(85px,1fr)); }
  .toolbar .search-field { grid-column: span 2; }
}
@media (max-width: 620px) {
  :root { --rail-width: 0px; }
  .nav-rail { align-items: stretch; border-right: 0; border-top: 1px solid var(--line); bottom: 0; flex-direction: row; height: 57px; justify-content: space-around; left: 0; padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); right: 0; top: auto; width: 100%; }
  .brand-mark, .rail-divider, .rail-spacer, .rail-local-dot { display: none; }
  .rail-nav, .rail-nav-secondary { flex: 1 1 0; flex-direction: row; gap: 2px; justify-content: space-around; min-width: 0; width: auto; }
  .rail-link { border-radius: 5px; height: 42px; width: 42px; }
  .rail-link.is-active::before { border-radius: 2px 2px 0 0; bottom: -5px; height: 2px; left: 13px; top: auto; width: 18px; }
  .main-area { margin-left: 0; padding-bottom: 58px; }
  .topbar { gap: 6px; height: 49px; padding: 0 9px; }
  .topbar-scope { flex: 0 1 125px; min-width: 95px; }
  .topbar-scope select { font-size: 12px; max-width: 100%; padding-left: 4px; }
  .global-search { flex: 1; gap: 5px; height: 30px; min-width: 60px; padding: 0 6px; width: auto; }
  .global-search input { font-size: 12px; }
  .global-search input::placeholder { color: transparent; }
  .global-search kbd { display: none; }
  .top-actions { gap: 2px; }
  #newTask { height: 31px; min-height: 31px; padding: 4px 7px; }
  #newTask span { display: none; }
  .utility-popover { right: -3px; }
  .workspace { padding: 14px 12px 22px; }
  .page-head { align-items: flex-start; margin-bottom: 10px; }
  .page-head h1, .workspace > h1 { font-size: 21px; }
  .page-head p { font-size: 12px; }
  .status-strip { height: 42px; margin: 0 -12px 12px; padding: 0 12px; }
  .status-strip-item { gap: 5px; padding: 0 9px; }
  .status-strip-item label { font-size: 11px; }
  .status-strip-item strong { font-size: 12px; }
  .dashboard-main { gap: 14px; }
  .dashboard-operations { padding-top: 10px; }
  .review-row { grid-template-columns: minmax(0,1fr) auto; min-height: 61px; padding: 7px 5px; }
  .review-workspace .review-row { grid-template-columns: minmax(0,1fr) auto; }
  .review-workspace .review-reason { display: block; grid-column: 1/-1; grid-row: 2; }
  .review-workspace .review-main { grid-column: 1; grid-row: 1; }
  .review-workspace .review-meta { grid-column: 2; grid-row: 1 / span 2; }
  .review-workspace .review-row { min-height: 88px; }
  .review-main { grid-column: 1; }
  .review-meta { grid-column: 2; grid-row: 1 / span 2; }
  .review-mini { display: none; }
  .project-health { margin-top: 14px; }
  .project-health-table { min-width: 700px; }
  .project-health { overflow-x: auto; }
  .project-context-head { align-items: flex-start; flex-direction: column; gap: 6px; padding: 5px 0; }
  .project-context-title h1, .project-context-title h2 { font-size: 18px; }
  .project-navigation { margin-right: -12px; }
  .project-groups { gap: 0; min-height: 35px; }
  .project-group { font-size: 12px; min-height: 35px; padding-left: 10px; padding-right: 10px; }
  .project-tabs { min-height: 33px; }
  .project-tab { font-size: 12px; min-height: 31px; padding: 5px 9px; }
  .project-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .project-facts { grid-template-columns: 1fr; }
  .project-plan-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .summary-box { border-bottom: 1px solid var(--line); padding: 7px 8px; }
  .summary-box:nth-child(2n) { border-right: 0; }
  .summary-box:nth-last-child(-n+2) { border-bottom: 0; }
  .summary-box:first-child { padding-left: 8px; }
  .report-grid, .split-grid, .doc-grid { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .toolbar .search-field { grid-column: 1/-1; }
  .filter-more-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .table-wrap { overflow-x: auto; }
  .master-detail { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .master-pane { max-height: 56vh; min-height: 280px; }
  .master-detail.has-selection .master-pane { display: none; }
  .detail-pane-inline { border-left: 0; min-height: 72vh; }
  .master-detail:not(.has-selection) .detail-pane-inline { display: none; }
  .detail-back { display: inline-flex; }
  .inline-detail-scroll { padding: 10px 12px 105px; }
  .review-action-box { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .backlog-item { gap: 5px; grid-template-columns: 42px minmax(140px,1fr) 90px; }
  .backlog-item > :nth-child(4), .backlog-item > :nth-child(5) { grid-column: 2/4; }
  .backlog-sprint { align-items: flex-start; flex-direction: column; }
  .backlog-sprint .section-title { width: 100%; }
  .backlog-sprint .section-title p { white-space: normal; }
  .calendar-cell { min-height: 65px; padding: 3px; }
  .calendar-item { font-size: 10px; }
  .calendar-weekday { font-size: 11px; padding: 4px 2px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-grid .field.full { grid-column: auto; }
  .detail-panel { padding: 18px 14px 30px; width: 100vw; }
  .detail-actions .button { flex: 1; }
  .review-action-fields { grid-template-columns: 1fr; }
  .review-action-box .page-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .review-action-box .page-actions .button { min-width: 0; }
  .gantt-label { width: 260px; }
  .server-alert { margin: 9px 12px 0; }
}
@media (max-width: 360px) {
  .nav-rail { padding-left: 4px; padding-right: 4px; }
  .rail-link { width: 35px; }
  .topbar-scope { flex-basis: 94px; min-width: 84px; }
  .top-actions { flex: 0 0 auto; }
}

/* Final polish: keep readable type and consistent interaction states across views. */
:root {
  --font-caption: 12px;
  --font-secondary: 13px;
  --font-body: 14px;
  --font-section: 16px;
  --font-page-title: 23px;
  --row-height: 44px;
}
.project-context-meta,
.project-summary-intro,
.summary-box span,
.summary-box small,
.project-stats,
.stat-line span,
.stat-line strong,
.card-meta,
.markdown-preview,
.report-row > span,
.report-row > strong { font-size: 12px; }
.summary-box strong { font-size: 18px; }
.panel-header h2, .panel-header h3, .sprint-card h3, .milestone-card h3, .doc-card h3 { font-size: 15px; }
.task-master-table .data-table td { padding: 9px 10px; }
.task-master-table .data-table td, .task-master-table .data-table th { font-size: 13px; }
.task-master-table tr[data-task-row] { transition: background-color .12s ease; }
.task-master-table tr[data-task-row]:hover { background: var(--surface-hover); }
.task-master-table tr[data-task-row].is-selected { background: var(--selected-surface); }
.review-workspace .review-main small { font-size: 13px; }
.review-workspace .review-reason strong { font-size: 13px; }
.review-workspace .review-reason small { font-size: 12px; }
.review-workspace .review-row { min-height: 98px; }
.review-overview { padding-bottom: 9px; }
.review-overview-grid { column-gap: 20px; padding-top: 8px; }
.review-detail-view .detail-section { margin-top: 12px; padding-top: 9px; }
.review-change-summary { margin: 7px 0; padding: 7px 9px; }
.verification-status-list .detail-list-item { min-height: 40px; padding: 6px 5px; }
.task-workspace:not(.has-selection) { display: block; height: auto; min-height: 0; }
.task-workspace:not(.has-selection) .master-pane { max-height: none; }
.task-workspace:not(.has-selection) .detail-pane-inline { display: none; }
#workspace:has(.task-workspace.has-selection) > .page-head,
#workspace:has(.task-workspace.has-selection) > #taskFilters { display: none; }
.task-workspace.has-selection { height: min(690px, calc(100vh - 190px)); }
.task-master-table .data-table td { font-size: 14px; padding: 5px 10px; }
.task-master-table .task-project-line { display: inline; margin: 0 0 0 8px; }
@media (min-width: 1200px) {
  .task-workspace.has-selection #detailContent > .detail-grid { gap: 8px 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .task-workspace.has-selection #detailContent > .detail-grid .detail-field strong { line-height: 1.35; margin-top: 2px; }
}
.search-result-list { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.search-result { align-items: center; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); display: grid; gap: 14px; grid-template-columns: 92px minmax(0,1fr) auto; min-height: 64px; padding: 10px 14px; text-align: left; width: 100%; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--surface-hover); }
.search-result-type { color: var(--muted); font-size: 13px; }
.search-result-copy { min-width: 0; }
.search-result-copy strong, .search-result-copy small { display: block; overflow-wrap: anywhere; }
.search-result-copy strong { font-size: 14px; font-weight: 500; }
.search-result-copy small { color: var(--muted); font-size: 13px; margin-top: 3px; }
@media (max-width: 620px) {
  .search-result { gap: 7px; grid-template-columns: 74px minmax(0,1fr); }
  .search-result > .status-tag { grid-column: 2; justify-self: start; }
}
.review-action-box { gap: 6px; padding-top: 9px; }
.review-action-box .field textarea { min-height: 38px; }
.review-action-box .page-actions .button { min-height: 34px; }
.review-workspace .review-action-box { margin-top: 9px; }
.detail-section { margin-top: 13px; padding-top: 10px; }
.detail-field strong { line-height: 1.5; }
.board { gap: 10px; }
.board-column { flex-basis: 208px; min-height: 350px; padding: 0 3px; width: 208px; }
.board-column-head { padding: 8px 3px; }
.task-card { padding: 9px 9px 8px; }
.task-card .task-title-button { font-size: 14px; }
.task-card-meta { font-size: 12px; }
.task-card-foot small { font-size: 12px; }
.board-status-select { border-radius: 4px; height: 27px; min-height: 27px; }
.backlog-section { min-height: 120px; }
.backlog-item { font-size: 13px; }
.gantt-axis { grid-template-columns: 260px repeat(var(--gantt-days, 30), minmax(18px, 1fr)); }
.gantt-axis > span { font-size: 11px; }
.gantt-row { grid-template-columns: 260px minmax(540px, 1fr); min-height: 39px; }
.gantt-label { min-height: 39px; }
.gantt-track { height: 39px; }
.gantt-bar { height: 21px; line-height: 21px; top: 8px; }
.gantt-bar.milestone-bar { height: 22px; line-height: 22px; top: 8px; }
button:disabled, select:disabled, input:disabled, textarea:disabled { cursor: not-allowed; }

@media (max-width: 1100px) {
  .task-workspace { grid-template-columns: minmax(400px, 48%) minmax(0, 1fr); }
  .review-workspace { grid-template-columns: minmax(360px, 43%) minmax(0, 1fr); }
  .board-column { flex-basis: 208px; width: 208px; }
}
@media (max-width: 620px) {
  .review-workspace .review-row { min-height: 88px; }
  .board-column { flex-basis: 212px; width: 212px; }
  .gantt-axis, .gantt-row { min-width: 930px; }
}

/* Keep dependency paths in the timeline layer without letting the SVG take layout space. */
.gantt-axis { box-sizing: border-box; height: 30px; }
.gantt-dependencies {
  height: calc(var(--gantt-row-count, 1) * 39px);
  left: 260px;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  top: 30px;
  width: calc(100% - 260px);
  z-index: 0;
}
.gantt-dependencies > path {
  fill: none;
  stroke: #8b795f;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.gantt-dependencies marker path { fill: #8b795f; stroke: none; }
.gantt-bar { z-index: 1; }
.gantt-grid-lines { display: block; height: 100%; inset: 0; overflow: visible; pointer-events: none; position: absolute; width: 100%; z-index: 0; }
.gantt-grid-lines path { fill: none; stroke: #e2e8e5; stroke-width: 1px; vector-effect: non-scaling-stroke; }
