:root {
  color: #183449;
  background: #f5f7f4;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }

button, a { font: inherit; }

button { cursor: pointer; }

a { color: #176c64; text-underline-offset: 3px; }

a:hover { color: #0f4f49; }

.page-header { max-width: 1680px; margin: 0 auto; padding: 35px 48px 22px; }

.eyebrow { color: #217a72; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

.page-header h1 { margin: 7px 0 8px; font-size: clamp(2rem, 3vw, 3.3rem); line-height: 1.05; letter-spacing: -.04em; }

.page-header .page-intro { max-width: 62ch; margin: 0; color: #547080; line-height: 1.55; }
.issue-overview .private-repo-note { max-width: 86ch; margin: 0 0 22px; padding: 10px 14px; border-left: 3px solid #217a72; background: #eaf3ee; color: #33566a; font-size: .98rem; line-height: 1.45; }
.private-repo-note code { font-size: .95em; }

.dashboard-toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-direction: column; align-items: stretch; gap: 8px; max-width: 1584px; margin: 0 auto; padding: 8px 32px 10px; border-bottom: 1px solid #cbdcd5; background: #f5f7f4; }
.dashboard-tabs { display: flex; flex-wrap: wrap; width: 100%; min-width: 0; gap: 2px; }
.dashboard-tabs button { display: inline-flex; flex: none; align-items: center; gap: 8px; min-height: 46px; padding: 8px 13px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #547080; font-size: 1rem; font-weight: 700; white-space: nowrap; }
.dashboard-tabs button:hover { color: #176c64; background: #eaf3ee; }
.dashboard-tabs button[aria-selected="true"] { border-bottom-color: #217a72; color: #183449; }
.dashboard-tabs button svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-tabs button:focus-visible, .refresh-group button:focus-visible, .pipeline-badge:focus-visible { outline: 3px solid #217a72; outline-offset: 3px; }
/* Independent operations share a quiet utility strip above navigation. */
.operation-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.operation { min-width: 0; padding: 4px 0 6px; }
.operation + .operation { padding-left: 24px; border-left: 1px solid #cbdcd5; }
.operation-heading, .operation-action { display: flex; align-items: center; gap: 8px; }
.operation-heading svg { width: 18px; height: 18px; fill: none; stroke: #176c64; stroke-width: 1.7; flex: none; }
.operation-heading h2 { margin: 0; font-size: .95rem; font-weight: 700; }
.operation-state { display: inline-flex; align-items: center; gap: 5px; color: #547080; font-size: .8rem; white-space: nowrap; margin-left: auto; }
.operation-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #8b9da2; }
.operation-state[data-state="current"] { color: #176c64; }
.operation-state[data-state="current"]::before { background: #176c64; }
.operation-state[data-state="attention"], .operation-state[data-state="partial"] { color: #925526; }
.operation-state[data-state="attention"]::before, .operation-state[data-state="partial"]::before { background: #ad8031; }
.operation-state[data-state="in_progress"]::before { width: 9px; height: 9px; border: 1.5px solid #cbdcd5; border-top-color: #176c64; background: transparent; animation: tab-refresh-spin .9s linear infinite; }
.operation-action { justify-content: space-between; margin-top: 2px; }
.operation-action p { margin: 0; font-size: .875rem; color: #547080; }
.operation-action button { min-height: 44px; padding: 6px 14px; border: 1px solid #217a72; border-radius: 6px; background: #176c64; color: white; font-size: .83rem; font-weight: 700; flex: none; }
.operation-action button:hover { background: #0f4f49; }
.operation-action button:disabled { opacity: .6; }
.operation-action button:focus-visible, .operation-details summary:focus-visible { outline: 3px solid #217a72; outline-offset: 3px; }
.operation-summary { margin: 0; font-size: .875rem; line-height: 1.4; color: #183449; overflow-wrap: anywhere; }
.operation-context { display: inline; margin: 0; font-size: .8125rem; color: #547080; }
.operation-context:empty { display: none; }
.operation-details { display: inline; font-size: .8125rem; color: #547080; }
.operation-details summary { display: inline-block; min-height: 24px; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.operation-details summary::before { content: "+ "; }
.operation-details[open] summary::before { content: "− "; }
.operation-context:not(:empty) + .operation-details { margin-left: 12px; }
.operation-details p { margin: 4px 0 0; max-width: 72ch; font-size: .8rem; line-height: 1.5; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .operation-state[data-state="in_progress"]::before { animation: none; } }
@media (max-width: 700px) {
  .operation-strip { grid-template-columns: 1fr; gap: 8px; }
  .operation + .operation { padding: 10px 0 6px; border-left: 0; border-top: 1px solid #cbdcd5; }
  .operation-details summary { min-height: 44px; padding: 12px 0; }
}

#agents-panel, #stages-panel, #tasks-panel, #issues-panel, #docs-panel { padding-top: 14px; }
#agents-panel .agent-overview, #stages-panel .stage-overview, #tasks-panel .turn-overview, #issues-panel .issue-overview { margin-bottom: 0; }
#issues-panel .milestone-overview { margin-top: 24px; }

.map-viewport { width: 100%; overflow-x: auto; overflow-y: hidden; }

.map-canvas { position: relative; width: min(100%, 1680px); min-width: 1320px; margin: 0 auto; }

.map-canvas > img, .map-canvas > svg { display: block; width: 100%; height: auto; }

.pipeline-badge-track { position: relative; width: min(100%, 1680px); min-width: 1320px; height: 52px; margin: 0 auto; }
.pipeline-badge { position: absolute; top: 5px; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 5px 10px; border: 1px solid #b8d1c7; border-radius: 999px; background: #eaf3ee; color: #135b55; font-size: 1rem; font-weight: 700; text-align: center; text-decoration: none; white-space: nowrap; }
.pipeline-badge:hover { background: #d9ebe2; color: #0f4f49; }

.stage-hotspot { position: absolute; z-index: 1; padding: 0; border: 0; border-radius: 14px; background: transparent; color: transparent; }

.stage-hotspot:hover, .stage-hotspot:focus-visible { outline: 3px solid #217a72; outline-offset: 2px; background: rgb(33 122 114 / 7%); }

.stage-hotspot:focus-visible { box-shadow: 0 0 0 7px rgb(33 122 114 / 14%); }

.map-hint, .map-links { max-width: 1680px; margin: 0 auto; padding: 0 48px; color: #547080; font-size: .9rem; line-height: 1.5; }

.pipeline-metrics { max-width: 1680px; margin: 0 auto 26px; padding: 18px 0 20px; border-top: 1px solid #cbdcd5; border-bottom: 1px solid #cbdcd5; background: #fff; }
.pipeline-metrics-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 0 48px 10px; }
.pipeline-metrics-heading .eyebrow { margin: 0 0 5px; }
.pipeline-metrics-heading h2 { margin: 0 0 4px; font-size: 1.45rem; letter-spacing: -.02em; }
.pipeline-metrics-heading p:last-child { max-width: 72ch; margin: 0; color: #547080; line-height: 1.45; }
.pipeline-metrics-heading > p { flex: none; font-size: .9rem; }
.pipeline-metrics-scroll { overflow-x: auto; scrollbar-width: thin; }
.pipeline-metrics-track { position: relative; width: min(100%, 1680px); min-width: 1320px; height: 132px; margin: 0 auto; }
.pipeline-metric-stage { position: absolute; top: 0; display: flex; min-width: 0; height: 100%; flex-direction: column; align-items: center; padding: 5px 8px; border-left: 1px solid #e1e9e5; text-align: center; }
.pipeline-metric-stage:last-child { border-right: 1px solid #e1e9e5; }
.pipeline-metric-stage h3 { overflow: hidden; width: 100%; margin: 0 0 3px; color: #33566a; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-metric-stage > strong { min-height: 23px; color: #183449; font-size: .86rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pipeline-metric-rail { display: block; width: 100%; height: 10px; margin: 3px 0 8px; overflow: hidden; border-radius: 5px; background: #e9efec; }
.pipeline-metric-bar { display: block; height: 100%; border-radius: inherit; background: #176c64; transition: width .2s ease; }
.pipeline-metric-bar.is-duration { background: #ad8031; }
.pipeline-metric-switch { display: inline-flex; flex-wrap: nowrap; padding: 2px; border: 1px solid #cbdcd5; border-radius: 7px; background: #f5f7f4; }
.pipeline-metric-switch button { min-height: 28px; padding: 3px 6px; border: 0; border-radius: 5px; background: transparent; color: #547080; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.pipeline-metric-switch button[aria-pressed="true"] { background: #176c64; color: #fff; }
.pipeline-metric-switch button:focus-visible, .trend-filter select:focus-visible { outline: 3px solid #217a72; outline-offset: 2px; }

.map-links { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 12px; padding-bottom: 40px; }

.metrics-overview { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 32px; max-width: 1584px; margin: 0 auto 40px; padding: 28px 32px; border-top: 1px solid #cbdcd5; background: #fff; }

.metrics-overview .eyebrow { margin: 0 0 8px; }
.metrics-overview h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 2vw, 2rem); letter-spacing: -.03em; }
.metrics-overview p:last-child { max-width: 52ch; margin: 0; color: #547080; font-size: 1rem; line-height: 1.5; }
.metrics-overview dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; }
.metrics-overview dl > div { padding: 2px 0 0 16px; border-left: 2px solid #cbdcd5; }
.metrics-overview dt { color: #547080; font-size: 1rem; line-height: 1.35; }
.metrics-overview dd { margin: 7px 0 0; font-size: clamp(1.05rem, 1.3vw, 1.35rem); font-weight: 700; line-height: 1.25; }

.agent-overview, .stage-overview, .turn-overview { max-width: 1584px; margin: 0 auto 40px; padding: 28px 32px; border-top: 1px solid #cbdcd5; background: #fff; }
.docs-overview { max-width: 1584px; margin: 0 auto 40px; padding: 28px 32px; border-top: 1px solid #cbdcd5; background: #fff; }
.docs-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 76px); margin-top: 24px; }
.docs-columns h3 { margin: 0 0 14px; font-size: 1.15rem; }
.docs-list { margin: 0; padding: 0; list-style: none; }
.docs-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 11px 0; border-bottom: 1px solid #e2ebe6; line-height: 1.4; }
.docs-list li a { font-weight: 700; }
.docs-list li span, .docs-note { color: #547080; font-size: .92rem; line-height: 1.5; }
.docs-note { max-width: 78ch; margin: 14px 0 0; }
.phase-heading { margin-top: 30px; }
.phase-heading h3 { margin: 0; font-size: 1.15rem; }
.agent-overview .section-heading { margin-bottom: 14px; }
.agent-table-scroll, .metrics-table-scroll { max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.agent-table-scroll { max-height: min(68vh, 760px); }
.metrics-table-scroll { max-height: min(72vh, 820px); }
.agent-table, .metrics-detail-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 1rem; line-height: 1.45; }
.agent-table th, .agent-table td, .metrics-detail-table th, .metrics-detail-table td { padding: 11px 13px; border-bottom: 1px solid #d6e2dd; text-align: left; vertical-align: top; }
.agent-table thead th, .metrics-detail-table thead th { position: sticky; z-index: 2; top: 0; color: #33566a; background: #edf4f0; font-size: .96rem; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 0 #cbdcd5; }
.table-sort { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; margin: -5px -7px; padding: 5px 7px; border: 0; border-radius: 5px; color: inherit; background: transparent; font: inherit; text-align: left; }
.table-sort::after { content: "↕"; color: #80969a; font-size: .9em; }
th[aria-sort="ascending"] .table-sort::after { content: "↑"; color: #176c64; }
th[aria-sort="descending"] .table-sort::after { content: "↓"; color: #176c64; }
.table-sort:hover { color: #0f4f49; background: #dcebe4; }
.table-sort:focus-visible { outline: 3px solid #217a72; outline-offset: 2px; }
.agent-table tbody tr:nth-child(even), .metrics-detail-table tbody tr:nth-child(even) { background: #f8faf8; }
.agent-table tbody tr:hover, .metrics-detail-table tbody tr:hover { background: #edf6f1; }
.agent-table tbody tr:focus-within, .metrics-detail-table tbody tr:focus-within { outline: 2px solid #78a99b; outline-offset: -2px; }
.agent-table tbody th { min-width: 170px; font-weight: 700; }
.agent-table td:nth-child(n+4), .metrics-detail-table td:nth-child(n+2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.agent-main-row th:first-child::before { content: "●"; margin-right: 8px; color: #176c64; font-size: .78em; }
.agent-worker-row th:first-child::before { content: "↳"; margin-right: 8px; color: #527f9a; }
.agent-table tbody tr td:nth-child(2) { position: relative; padding-left: 28px; }
.agent-table tbody tr td:nth-child(2)::before { position: absolute; left: 13px; content: "·"; color: #87999e; font-size: 1.4rem; line-height: 1rem; }
.agent-table .agent-status-active td:nth-child(2)::before { content: "●"; color: #217a72; font-size: .75rem; }
.agent-table .agent-status-finished td:nth-child(2)::before { content: "✓"; color: #527f9a; font-size: .85rem; }
.agent-note { margin: 12px 0 0; color: #547080; font-size: 1rem; line-height: 1.45; }
.metrics-detail-table tbody th { min-width: 145px; }
.stage-row th:first-child::before { content: "◆"; margin-right: 8px; color: #217a72; font-size: .75em; }
.turn-completed td:nth-child(5)::before { content: "✓ "; color: #176c64; font-weight: 700; }
.turn-failed td:nth-child(5)::before { content: "! "; color: #a67522; font-weight: 700; }
.turn-interrupted td:nth-child(5)::before { content: "◷ "; color: #527f9a; font-weight: 700; }
.turn-table { min-width: 1740px; }
.turn-table td:first-child { min-width: 190px; }
.turn-table td:nth-child(2) { min-width: 230px; white-space: normal; }
.turn-table td:nth-child(6) { min-width: 170px; white-space: normal; }
.metrics-detail-table:not(.turn-table) { min-width: 1080px; }
.turn-filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.turn-filters label { display: grid; gap: 4px; color: #547080; font-size: 1rem; }
.turn-filters select, .turn-filters input { min-height: 38px; padding: 7px 9px; border: 1px solid #b9cdc7; border-radius: 7px; background: #fff; color: #183449; font: inherit; }
.turn-filters input { min-width: 240px; }
.turn-result { margin: 0 0 10px; color: #547080; font-size: 1rem; }

.issue-overview, .milestone-overview { max-width: 1584px; margin: 0 auto 40px; padding: 28px 32px; border-top: 1px solid #cbdcd5; background: #fff; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.section-heading .eyebrow { margin: 0 0 8px; }
.section-heading h2 { margin: 0 0 8px; font-size: clamp(1.7rem, 2.4vw, 2.3rem); letter-spacing: -.03em; }
.section-heading p:last-child { max-width: 78ch; margin: 0; color: #547080; font-size: 1rem; line-height: 1.5; }
.section-heading > a { flex: none; font-size: 1rem; }
.issue-counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
.issue-counts > div { padding: 14px 16px; border: 1px solid #d6e2dd; border-radius: 10px; background: #f5f7f4; }
.issue-counts dt { color: #547080; font-size: 1rem; }
.issue-counts dd { margin: 4px 0 0; color: #183449; font-size: 1.9rem; font-weight: 700; }
.pr-overview { max-width: 1584px; margin: 0 auto 40px; padding: 28px 32px; border-top: 1px solid #cbdcd5; background: #fff; }
.pr-counts { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
.pr-counts dd { font-size: clamp(1.35rem, 2vw, 1.9rem); }
.summary-counts { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.summary-counts dd { font-size: clamp(1.25rem, 2vw, 1.9rem); overflow-wrap: anywhere; }
.pr-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin: 12px 0 28px; }
.pr-chart { min-width: 0; overflow-x: auto; min-height: 230px; }
.pr-chart svg { display: block; width: auto; max-width: none; min-width: 420px; height: 240px; }
.pr-chart text { font: 13px system-ui, sans-serif; fill: #33566a; }
.pr-chart .value-label { font-size: 13px; font-weight: 700; }
.pr-chart .grid-line { stroke: #d6e2dd; stroke-width: 1; }
.pr-chart .series-line { fill: none; stroke-width: 2.5; }
.pr-table td:nth-child(2) { min-width: 250px; white-space: normal; }
.issue-tools { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.issue-tools label { display: flex; flex-direction: column; gap: 6px; color: #33566a; font-size: 1rem; font-weight: 700; }
.issue-tools label:last-child { flex: 1 1 330px; }
.issue-tools select, .issue-tools input { min-height: 42px; padding: 8px 12px; border: 1px solid #adc6bd; border-radius: 8px; background: #fff; color: #183449; font: inherit; font-weight: 400; }
.issue-tools input { width: 100%; }
.issue-tools select:focus-visible, .issue-tools input:focus-visible { outline: 3px solid #217a72; outline-offset: 2px; }
.issue-result { margin: 0 0 14px; color: #547080; font-size: 1rem; }
.issue-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.issue-card { min-width: 0; padding: 16px 18px; border: 1px solid #d6e2dd; border-radius: 10px; }
.issue-card-heading { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.issue-card-title { font-size: 1.08rem; font-weight: 700; line-height: 1.35; }
.issue-description { margin: 9px 0; font-size: 1rem; line-height: 1.45; }
.issue-labels { display: flex; flex-wrap: wrap; gap: 6px; }
.type-tag, .label-tag, .status-tag { display: inline-block; padding: 4px 8px; border-radius: 6px; font-size: .86rem; line-height: 1.25; }
.type-tag { color: #135b55; background: #e4f3ed; font-weight: 700; }
.label-tag { color: #496273; background: #edf2f0; }
.status-tag { flex: none; color: #496273; background: #edf2f0; }
.status-in-progress { color: #135b55; background: #d7eee4; }
.status-paused { color: #815611; background: #f9edcc; }
.issue-dates { margin: 12px 0 0; color: #547080; font-size: .86rem; line-height: 1.45; }
.issue-empty { grid-column: 1 / -1; margin: 0; padding: 24px; color: #547080; background: #f5f7f4; }
.milestone-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.milestone-item { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-top: 1px solid #d6e2dd; }
.milestone-event { align-self: start; padding: 5px 9px; border-radius: 6px; color: #135b55; background: #e4f3ed; font-size: .9rem; font-weight: 700; text-align: center; text-transform: capitalize; }
.milestone-stop .milestone-event { color: #496273; background: #edf2f0; }
.milestone-pause .milestone-event { color: #815611; background: #f9edcc; }
.milestone-body h3 { margin: 0 0 4px; font-size: 1.1rem; }
.milestone-body p { margin: 0 0 7px; color: #33566a; line-height: 1.45; }
.milestone-body time, .milestone-body a { display: inline-block; margin-right: 12px; font-size: .9rem; }
.milestone-body time { color: #547080; }

#charts-panel { max-width: 1584px; margin: 0 auto; padding: 8px 32px 48px; }
.charts-intro { padding: 20px 0 8px; }
.charts-intro .eyebrow { margin: 0 0 8px; }
.charts-intro h2 { margin: 0 0 6px; font-size: clamp(1.8rem, 2.5vw, 2.5rem); letter-spacing: -.03em; }
.charts-intro p:last-child { max-width: 78ch; margin: 0; color: #547080; font-size: 1rem; line-height: 1.5; }
.chart-section { padding: 24px 0 30px; border-top: 1px solid #cbdcd5; }
#charts-panel .chart-section { margin-top: 16px; padding: 18px 18px 16px; border: 1px solid #d7e4de; border-radius: 12px; background: #fff; }
#charts-panel .trend-grid .chart-section { margin-top: 0; }
.chart-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; margin-bottom: 14px; }
.chart-heading h3 { margin: 0; font-size: 1.35rem; letter-spacing: -.02em; }
.chart-heading p { margin: 0; color: #3e5566; font-size: .98rem; line-height: 1.4; }
.chart-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 14px; color: #547080; font-size: 1rem; }
.chart-total strong { color: #183449; font-size: clamp(1.45rem, 2vw, 1.8rem); font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.chart-view-options { display: inline-flex; flex-wrap: wrap; gap: 2px; margin: 0 0 16px; padding: 3px; border: 1px solid #cbdcd5; border-radius: 9px; background: #edf2f0; }
.chart-view-options button { min-height: 34px; padding: 5px 12px; border: 0; border-radius: 6px; color: #33566a; background: transparent; font: inherit; font-size: .94rem; font-weight: 600; cursor: pointer; }
.chart-view-options button[aria-pressed="true"] { color: #fff; background: #176c64; }
.chart-view-options button:focus-visible { outline: 3px solid #d5ad5d; outline-offset: 2px; }
.chart-track { display: flex; width: 100%; min-height: 42px; overflow: hidden; border-radius: 7px; background: #e9efec; }
.chart-track-bar { display: grid; gap: 9px; padding: 13px 16px; }
.category-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 4fr) 100px; align-items: center; gap: 14px; min-height: 27px; font-size: 1rem; }
.category-row strong { font-variant-numeric: tabular-nums; text-align: right; }
.category-rail { height: 21px; overflow: hidden; border-radius: 4px; background: #dce7e2; }
.category-bar { display: block; height: 100%; min-width: 0; border-radius: 4px; }
.chart-track-donut { display: grid; place-items: center; overflow: visible; background: transparent; }
.chart-donut { position: relative; display: grid; place-items: center; width: 180px; aspect-ratio: 1; border-radius: 50%; }
.chart-donut strong { display: grid; place-items: center; width: 112px; aspect-ratio: 1; border-radius: 50%; color: #183449; background: #fff; font-size: 1.18rem; font-variant-numeric: tabular-nums; }
.donut-data-label { position: absolute; transform: translate(-50%, -50%); color: #fff; font-size: .84rem; font-weight: 700; text-shadow: 0 1px 3px rgb(16 44 60 / 60%); font-variant-numeric: tabular-nums; }
.chart-segment { display: grid; place-items: center; min-width: 0; min-height: 42px; overflow: hidden; color: #102c3c; font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-closed, .chart-cached, .chart-main, .chart-workers { color: #fff; }
.chart-closed, .chart-cached, .chart-main { background: #176c64; }
.chart-workers { background: #527f9a; }
.chart-open, .chart-uncached { background: #86b5a7; }
.chart-progress, .chart-output { background: #d5ad5d; }
.chart-paused { background: #aebbc0; }
.chart-key { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 14px 0 0; padding: 0; list-style: none; }
.chart-key[hidden] { display: none; }
.chart-key li { display: flex; align-items: center; gap: 8px; color: #183449; font-size: 1rem; line-height: 1.35; }
.chart-key .swatch { width: 13px; height: 13px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgb(16 44 60 / 16%); }
.chart-key strong { font-variant-numeric: tabular-nums; }
.chart-key em { color: #3e5566; font-size: .95rem; font-style: normal; font-variant-numeric: tabular-nums; }
.chart-note { margin: 14px 0 0; color: #3e5566; font-size: 1rem; line-height: 1.45; }
.trend-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
/* Share card rows so wrapped metadata cannot offset the daily comparisons. */
.trend-grid { row-gap: 0; }
.trend-grid > .trend-section:not(.trend-section-wide) {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 5;
  row-gap: 0;
}
.trend-grid > .trend-section:not(.trend-section-wide) > .chart-heading { grid-row: 1; }
.trend-grid > .trend-section:not(.trend-section-wide) > .chart-total {
  grid-row: 2;
  display: grid;
  gap: 3px;
  margin: 10px 0 8px;
}
.trend-grid > .trend-section:not(.trend-section-wide) .chart-total strong {
  font-size: clamp(1.3rem, 1.6vw, 1.65rem);
  white-space: nowrap;
}
.chart-total-note { min-height: 1.3em; color: #3e5566; font-size: .85rem; line-height: 1.3; }
.trend-grid > .trend-section:not(.trend-section-wide) > .chart-view-options { grid-row: 3; justify-self: start; }
.trend-grid > .trend-section:not(.trend-section-wide) > .trend-plot { grid-row: 4; align-self: start; }
.trend-grid > .trend-section:not(.trend-section-wide) > .chart-note { grid-row: 5; }
.trend-grid > .trend-section:not(.trend-section-wide) .trend-scale,
.trend-grid > .trend-section:not(.trend-section-wide) .trend-row {
  grid-template-columns: 4.6rem minmax(0, 1fr) 6.8rem;
}
.trend-grid > .trend-section:not(.trend-section-wide) .trend-scale { height: 24px; }
.trend-grid > .trend-section:not(.trend-section-wide) .trend-scale span { white-space: nowrap; }
.trend-grid > .trend-section:not(.trend-section-wide) .trend-row { height: 32px; }
#charts-panel .trend-grid .trend-section-wide { margin-top: 16px; }
.trend-section-wide { grid-column: 1 / -1; }
.trend-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 18px 0 14px; color: #3e5566; }
.trend-filter label { color: #183449; font-weight: 700; }
.trend-filter select { min-height: 38px; padding: 6px 10px; border: 1px solid #b9cdc7; border-radius: 7px; background: #fff; color: #183449; font: inherit; }
.trend-filter span { font-size: .95rem; line-height: 1.35; }
.trend-section { min-width: 0; }
.trend-section .chart-heading { display: block; min-height: 4.6rem; }
.trend-section-wide .chart-heading { min-height: 0; }
.trend-section .chart-heading p { margin-top: 5px; color: #3e5566; font-size: .98rem; }
.trend-plot { display: grid; gap: 8px; min-width: 0; max-width: 100%; max-height: 28rem; overflow: auto; overscroll-behavior: contain; color: #3e5566; scrollbar-width: thin; }
.trend-plot:focus-visible, .chart-track:focus-visible { outline: 3px solid #217a72; outline-offset: -3px; }
.trend-plot-svg { display: block; overflow: visible; }
.trend-line-scroll, .trend-stack-scroll { min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.trend-stack-sheet { display: grid; gap: 8px; width: 100%; min-width: 17rem; }
.trend-plot-svg svg { display: block; width: 100%; height: auto; max-height: 280px; overflow: visible; }
.trend-value-label { fill: #183449; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.trend-axis, .trend-axis-y { stroke: #8aa399; stroke-width: 1.5; }
.trend-gridline { stroke: #d6e2dd; stroke-width: 1; }
.trend-tick { fill: #3e5566; font-size: 12px; font-variant-numeric: tabular-nums; }
.trend-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trend-area { opacity: .16; }
.trend-point { stroke: #fff; stroke-width: 2; }
.trend-date-axis { display: flex; justify-content: space-between; gap: 10px; padding: 0 5px; color: #3e5566; font-size: .9rem; }
.trend-scroll-hint { display: block; margin-top: 6px; color: #3e5566; font-size: .9rem; line-height: 1.35; }
.model-scroll-hint { display: none; }
.trend-scale, .trend-row { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) max-content; align-items: center; gap: 10px; }
.trend-scale { align-items: end; color: #3e5566; font-size: .82rem; font-variant-numeric: tabular-nums; }
.trend-scale-rail { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 2px; border-bottom: 1px solid #c5d7d0; }
.trend-scale-unit, .trend-row strong { text-align: right; }
.trend-row { min-height: 32px; border-radius: 6px; font-size: 1rem; font-variant-numeric: tabular-nums; }
.trend-row:hover { background: #f3f7f5; }
.trend-row time { color: #183449; font-size: .95rem; font-weight: 700; }
.trend-row strong { min-width: 5.5rem; color: #183449; font-size: 1rem; white-space: nowrap; }
.trend-rail { display: block; height: 22px; overflow: hidden; border-radius: 4px; background: #e7eeea; }
.trend-rail-stacked { display: flex; height: 26px; }
.trend-bar, .stacked-segment { display: block; height: 100%; }
.trend-bar { border-radius: inherit; }
.stacked-segment { flex: 0 0 auto; min-width: 0; }
.stacked-segment + .stacked-segment { box-shadow: inset 1px 0 0 rgb(255 255 255 / 72%); }
.trend-tokens { background: #176c64; }
.trend-runtime { background: #d5ad5d; }
.trend-features { background: #527f9a; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0 0; padding: 0; list-style: none; }
.trend-legend[hidden] { display: none; }
.trend-legend li { display: flex; align-items: baseline; gap: 8px; min-width: 0; max-width: 100%; color: #183449; font-size: 1rem; line-height: 1.35; }
.trend-legend .swatch { flex: none; width: 14px; height: 14px; align-self: center; border-radius: 3px; box-shadow: inset 0 0 0 1px rgb(16 44 60 / 18%); }
.trend-legend .series-name { min-width: 0; overflow-wrap: anywhere; }
.trend-legend strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend-section .chart-note { font-size: 1rem; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) {
  .pipeline-metric-bar { transition: none; }
  .trend-line, .trend-area, .trend-point, .trend-bar, .stacked-segment, .category-bar, .chart-segment { transition: none; animation: none; }
}

.artifact-dialog { width: min(1520px, calc(100% - 16px)); max-width: none; max-height: calc(100dvh - 16px); padding: 0; border: 1px solid #cbdcd5; border-radius: 14px; color: #183449; background: #fff; box-shadow: 0 30px 90px rgb(16 44 60 / 22%); }

.artifact-dialog::backdrop { background: rgb(16 44 60 / 58%); }

.dialog-shell { padding: clamp(12px, 1.5vw, 22px); }

.dialog-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 10px; }

.dialog-header .eyebrow { margin: 0 0 4px; }

.dialog-header h2 { margin: 0; font-size: clamp(1.4rem, 2.8vw, 2.3rem); letter-spacing: -.03em; }

.dialog-header p:last-child { max-width: 70ch; margin: 4px 0 0; color: #547080; line-height: 1.4; }
.dialog-header a { display: inline-block; margin-top: 8px; font-size: 1rem; }
.dialog-header a[hidden] { display: none; }

.close-button { flex: none; padding: 8px 11px; border: 1px solid #cbdcd5; border-radius: 9px; background: #fff; color: #183449; }

.close-button:hover, .carousel-controls button:hover { border-color: #217a72; }

.close-button span { margin-left: 6px; font-size: 1.15rem; }

.carousel { display: flex; align-items: flex-start; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scrollbar-width: none; border-top: 1px solid #d6e2dd; border-bottom: 1px solid #d6e2dd; }

.carousel::-webkit-scrollbar { display: none; }

.carousel figure { flex: 0 0 100%; width: 100%; margin: 0; scroll-snap-align: start; }

.image-viewport { width: 100%; max-height: min(67dvh, 720px); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; background: #f5f7f4; }

.image-viewport:focus-visible { outline: 3px solid #217a72; outline-offset: -3px; }

.carousel img { display: block; width: 100%; height: auto; }

.carousel figcaption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; padding: 8px 4px 10px; font-size: .9rem; line-height: 1.4; }

.carousel figcaption strong { display: block; margin-bottom: 3px; font-size: 1rem; }

.carousel figcaption span { color: #547080; }

.carousel-controls { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 8px; }

.carousel-controls button { padding: 9px 13px; border: 1px solid #cbdcd5; border-radius: 9px; background: #fff; color: #183449; }

.carousel-controls button:disabled { opacity: .45; cursor: default; }

.carousel-dots { display: flex; gap: 8px; align-items: center; }

.carousel-dots button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; }

.carousel-dots button::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #b9cdc7; }

.carousel-dots button[aria-current="true"]::after { background: #217a72; box-shadow: 0 0 0 3px rgb(33 122 114 / 13%); }

.carousel-count { margin: 4px 0 0; color: #547080; font-size: .8rem; text-align: center; }

.empty-state { padding: 58px 24px; border-top: 1px solid #d6e2dd; background: #f5f7f4; text-align: center; }

.empty-state p:first-child { margin-top: 0; font-size: 1.15rem; font-weight: 700; }

.empty-state p:last-child { max-width: 50ch; margin: 0 auto; color: #547080; line-height: 1.5; }

.noscript-note { max-width: 1680px; margin: 0 auto; padding: 20px 48px; }

@media (max-width: 680px) {
  .page-header { padding: 25px 20px 18px; }
  .dashboard-toolbar { position: static; align-items: stretch; flex-direction: column; padding: 0 20px 12px; }
  #charts-panel { padding: 8px 20px 38px; }
  .chart-heading { display: block; }
  .chart-heading p { margin-top: 5px; }
  .trend-grid { grid-template-columns: 1fr; gap: 12px; }
  .trend-grid > .trend-section:not(.trend-section-wide) { display: block; grid-row: auto; }
  .trend-grid > .trend-section:not(.trend-section-wide) .trend-scale,
  .trend-grid > .trend-section:not(.trend-section-wide) .trend-row { grid-template-columns: 4.6rem minmax(0, 1fr) 6rem; }
  .trend-section .chart-heading, .trend-section-wide .chart-heading { min-height: 0; }
  .model-scroll-hint { display: block; }
  .trend-row strong { min-width: 4.5rem; }
  .category-row { grid-template-columns: minmax(85px, 1fr) minmax(0, 2fr) 64px; gap: 8px; font-size: .9rem; }
  .map-hint, .map-links { padding-left: 20px; padding-right: 20px; }
  .pipeline-metrics { padding: 18px 0 20px; }
  .pipeline-metrics-heading { display: block; margin-right: 20px; margin-left: 20px; }
  .pipeline-metrics-heading > p { margin-top: 8px; }
  .pipeline-metrics-track { min-width: 1320px; }
  .dialog-header { gap: 12px; }
  .close-button { font-size: 0; }
  .close-button span { margin: 0; font-size: 1.3rem; }
  .image-viewport { max-height: 58dvh; }
  .carousel figcaption { display: block; }
  .carousel figcaption a { display: inline-block; margin-top: 8px; }
  .metrics-overview { grid-template-columns: 1fr; gap: 18px; margin: 0 12px 28px; padding: 22px 18px; }
  .metrics-overview dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .agent-overview, .stage-overview, .turn-overview, .issue-overview, .milestone-overview, .docs-overview, .pr-overview { margin: 0 12px 28px; padding: 22px 18px; }
  .pr-charts { grid-template-columns: 1fr; gap: 6px; }
  .docs-columns { grid-template-columns: 1fr; gap: 30px; }
  .section-heading { display: block; }
  .section-heading > a { display: inline-block; margin-top: 12px; }
  .issue-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .issue-list { grid-template-columns: 1fr; }
  .issue-card-heading { display: block; }
  .status-tag { margin-top: 8px; }
  .milestone-item { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
}

@media (min-width: 681px) and (max-width: 1100px) {
  .trend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trend-section .chart-heading { min-height: 0; }
  .trend-section-features { grid-column: 1 / -1; }
  .metrics-overview { grid-template-columns: 1fr; margin-right: 24px; margin-left: 24px; }
  .agent-overview, .stage-overview, .turn-overview, .issue-overview, .milestone-overview, .docs-overview, .pr-overview { margin-right: 24px; margin-left: 24px; }
  .pr-charts { gap: 16px; }
  .issue-list { grid-template-columns: 1fr; }
}

.audit-tree-toggle { border: 0; background: transparent; color: inherit; padding: .2rem .45rem; margin-right: .3rem; cursor: pointer; font: inherit; }
.audit-tree-toggle:focus-visible { outline: 2px solid var(--accent, #14746b); outline-offset: 2px; }
.audit-heatmap-table tr[hidden] { display: none; }
.audit-heatmap-table th { text-align: left; }

.audit-tree-name { overflow-wrap: anywhere; }
.audit-tree-total { display: inline-block; margin-left: .65rem; padding: .1rem .45rem; border-radius: .5rem; background: #e8f1ef; color: #17665e; font-variant-numeric: tabular-nums; font-size: .8em; white-space: nowrap; }
.audit-heatmap-table tbody th { min-width: 15rem; max-width: 28rem; }

/* Source freshness sits beside the tab title without competing with navigation. */
.dashboard-tabs .tab-status { width: .7rem; height: .7rem; min-width: .7rem; border-radius: 50%; display: inline-block; background: #b7791f; margin-left: .2rem; font-size: 0; overflow: hidden; }
.dashboard-tabs .tab-status[data-status="refreshed"] { background: #16816f; }
.dashboard-tabs .tab-status[data-status="in_progress"] { background: transparent; border: 2px solid #c8ddd8; border-top-color: #16816f; animation: tab-refresh-spin 1.8s linear infinite; }
@keyframes tab-refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dashboard-tabs .tab-status[data-status="in_progress"] { animation: none; } }

.dashboard-tabs .tab-status[data-status="saved"] { background: #607d8b; }
