:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f0f3f5;
  --surface-dark: #1d2933;
  --ink: #17212b;
  --ink-soft: #42515e;
  --muted: #6f7d89;
  --line: #d9e0e5;
  --line-strong: #c5cfd6;
  --coral: #d95745;
  --coral-soft: #fff0ed;
  --teal: #087f83;
  --teal-soft: #e8f7f6;
  --gold: #a96912;
  --gold-soft: #fff5df;
  --blue: #3568b8;
  --blue-soft: #edf3ff;
  --danger: #b93847;
  --danger-soft: #fdeff1;
  --shadow: 0 7px 22px rgba(23, 33, 43, .055);
  --radius: 6px;
  --max: 1500px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink); font-family: "Aptos", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 15px; line-height: 1.5; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
.skip-link { position: absolute; left: 12px; top: -52px; z-index: 40; padding: 10px 14px; border-radius: 4px; background: var(--ink); color: #fff; text-decoration: none; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.topbar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(197, 207, 214, .9); background: rgba(245, 247, 248, .96); backdrop-filter: blur(10px); }
.topbar-inner { width: min(100% - 36px, var(--max)); min-height: 64px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; color: var(--ink); font-weight: 700; text-decoration: none; }
.brand img { display: block; width: 120px; height: auto; filter: brightness(.35); }
.brand span { padding-left: 11px; border-left: 1px solid var(--line-strong); color: var(--muted); font-size: 12px; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-link, .refresh-button, .clear-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700; text-decoration: none; transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .18s ease; }
.icon-link, .refresh-button { padding: 0 13px; }
.icon-link:hover, .refresh-button:hover, .clear-button:hover { border-color: var(--coral); background: var(--coral-soft); color: var(--coral); }
.icon-link:active, .refresh-button:active, .clear-button:active { transform: translateY(1px); }
.icon-link svg, .refresh-button svg, .clear-button svg { width: 17px; height: 17px; stroke-width: 1.9; }
.refresh-button:disabled { cursor: wait; opacity: .58; }
.refresh-button.is-loading svg { animation: spin 1s linear infinite; }
.sync-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sync-state > i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.sync-state.is-busy > i { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.sync-state.is-error > i { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }

.page-shell { width: min(100% - 36px, var(--max)); margin: 0 auto; padding: 26px 0 42px; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding: 14px 0 24px; }
.eyebrow, .section-index { margin: 0; color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: 0; }
.page-intro h1 { margin: 8px 0 5px; font-size: 34px; line-height: 1.15; letter-spacing: 0; }
.page-intro p:not(.eyebrow) { margin: 0; color: var(--ink-soft); font-size: 15px; }
.source-meta { flex: 0 0 auto; display: grid; justify-items: end; gap: 6px; color: var(--muted); font-size: 11px; text-align: right; }
.source-meta a { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-weight: 700; text-decoration: none; }
.source-meta a:hover { text-decoration: underline; }
.source-meta svg { width: 14px; height: 14px; }

.workspace-tabs { display: flex; align-items: center; gap: 26px; border-bottom: 1px solid var(--line); }
.workspace-tabs button { min-height: 48px; display: inline-flex; align-items: center; gap: 7px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; transition: color .18s ease, border-color .18s ease; }
.workspace-tabs button:hover, .workspace-tabs button.is-active, .workspace-tabs button[aria-selected="true"] { border-bottom-color: var(--coral); color: var(--ink); }
.workspace-tabs svg { width: 16px; height: 16px; stroke-width: 1.9; }
.workspace-view { padding-top: 30px; }

.daily-project-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.daily-project-toolbar label { min-width: 0; flex: 1 1 auto; display: grid; gap: 5px; }
.daily-project-toolbar label > span { color: var(--muted); font-size: 9px; font-weight: 800; }
.daily-project-toolbar select { width: 100%; min-height: 42px; padding: 0 34px 0 11px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700; }
.daily-project-actions { flex: 0 0 auto; display: flex; gap: 7px; }
.daily-project-actions button { width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--ink); transition: border-color .18s ease, background-color .18s ease, color .18s ease; }
.daily-project-actions button:hover:not(:disabled) { border-color: var(--coral); background: var(--coral-soft); color: var(--coral); }
.daily-project-actions button:disabled { cursor: not-allowed; opacity: .45; }
.daily-project-actions svg { width: 17px; height: 17px; }
.daily-project-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 26px 0 13px; border-bottom: 1px solid var(--line); }
.daily-project-heading h2 { margin: 5px 0 0; font-size: 29px; line-height: 1.2; letter-spacing: 0; }
.daily-project-heading p:not(.section-index) { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.daily-update-state { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.daily-update-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.daily-update-state.is-fresh { border-color: #acd9d7; background: var(--teal-soft); color: var(--teal); }
.daily-update-state.is-fresh i { background: var(--teal); }
.daily-update-state.is-recent { border-color: #e6c78e; background: var(--gold-soft); color: var(--gold); }
.daily-update-state.is-recent i { background: var(--gold); }
.daily-project-markers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.daily-project-marker { min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.daily-project-marker span { display: block; color: var(--muted); font-size: 9px; font-weight: 700; }
.daily-project-marker strong { display: block; margin-top: 4px; overflow: hidden; color: var(--ink); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.daily-note-panel, .daily-data-section { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.daily-section-heading { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f8fafb; }
.daily-section-heading > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.daily-section-number { color: var(--coral); font-size: 10px; font-weight: 900; }
.daily-section-heading h3 { margin: 0; color: var(--ink); font-size: 14px; }
.daily-section-heading > span:last-child { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-weight: 700; text-align: right; }
.daily-notes { display: grid; gap: 8px; padding: 12px 14px 14px; }
.daily-note { padding: 11px 12px; border-left: 3px solid var(--coral); background: var(--surface-soft); color: var(--ink-soft); font-size: 11px; line-height: 1.65; white-space: pre-line; }
.daily-note-meta { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 800; }
.daily-note-empty { margin: 0; padding: 7px 0; color: var(--muted); font-size: 11px; }
.daily-detail-loading { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 11px; }
.daily-detail-loading i { width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--coral); border-radius: 50%; animation: spin .8s linear infinite; }
.daily-section-tables { display: grid; gap: 12px; }
.daily-data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.daily-data-table th, .daily-data-table td { min-width: 0; padding: 10px 9px; border-bottom: 1px solid #e8edef; color: var(--ink-soft); font-size: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.daily-data-table th { background: #f0f3f5; color: var(--muted); font-size: 9px; font-weight: 800; }
.daily-data-table th:first-child, .daily-data-table td:first-child { width: 98px; text-align: left; }
.daily-data-table th:nth-child(2), .daily-data-table td:nth-child(2) { text-align: left; }
.daily-data-table tbody tr:last-child td { border-bottom: 0; }
.daily-data-table td { overflow-wrap: anywhere; }
.daily-data-empty { margin: 0; padding: 18px 14px; color: var(--muted); font-size: 11px; }
.daily-risk-value { color: var(--danger) !important; font-weight: 800; }
.daily-positive-value { color: var(--teal) !important; font-weight: 800; }

.current-month-heading, .source-view-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.current-month-heading h2, .source-view-heading h2 { margin: 5px 0 0; font-size: 27px; line-height: 1.2; letter-spacing: 0; }
.current-month-heading > div > p:not(.section-index), .source-view-heading > div > p:not(.section-index) { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.current-cutoff { flex: 0 0 auto; text-align: right; }
.current-cutoff span { display: block; color: var(--muted); font-size: 10px; }
.current-cutoff strong { display: block; margin-top: 4px; color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.current-metric-grid { margin-bottom: 16px; }
.current-table-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 24px 0 10px; }
.dimension-switch { min-width: 0; display: flex; align-items: center; gap: 3px; padding: 3px; border-radius: 5px; background: #e9eef1; }
.dimension-switch button { min-width: 72px; min-height: 38px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; transition: background-color .18s ease, color .18s ease, box-shadow .18s ease; }
.dimension-switch button:hover { color: var(--ink); }
.dimension-switch button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(23, 33, 43, .12); }
.current-table-tools { display: grid; grid-template-columns: minmax(190px, 260px) 140px; gap: 8px; }
.current-table-tools label:first-child { position: relative; }
.current-table-tools label:first-child svg { position: absolute; left: 11px; top: 12px; width: 16px; height: 16px; color: var(--muted); }
.current-table-tools input, .current-table-tools select { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 12px; outline: none; }
.current-table-tools input { padding: 0 11px 0 34px; }
.current-table-tools select { padding: 0 32px 0 10px; }
.current-project-table-shell { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.current-project-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.current-project-table th, .current-project-table td { min-width: 0; padding: 13px 10px; border-bottom: 1px solid #e6ebee; text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }
.current-project-table th { background: #f0f3f5; color: var(--muted); font-size: 10px; font-weight: 800; }
.current-project-table th:nth-child(1), .current-project-table td:nth-child(1) { width: 58px; text-align: center; }
.current-project-table th:nth-child(2), .current-project-table td:nth-child(2) { width: 25%; text-align: left; }
.current-project-table .current-group-row th { padding-block: 8px; border-bottom-color: var(--line-strong); background: #e7ecef; color: var(--ink-soft); text-align: center; }
.current-project-table tbody tr { cursor: pointer; transition: background-color .16s ease; }
.current-project-table tbody tr:hover, .current-project-table tbody tr:focus-within { background: var(--coral-soft); }
.current-project-table tbody tr:last-child td { border-bottom: 0; }
.current-project-link { max-width: 100%; display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: var(--ink); font-weight: 800; text-align: left; cursor: pointer; }
.current-project-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-project-link svg { flex: 0 0 auto; width: 14px; height: 14px; color: var(--coral); opacity: 0; transition: opacity .16s ease; }
.current-project-table tr:hover .current-project-link svg, .current-project-link:focus-visible svg { opacity: 1; }
.value-risk { color: var(--danger); }
.current-table-footer { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 13px; background: #fafbfc; color: var(--muted); font-size: 10px; }

.source-open-button { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; transition: border-color .18s ease, background-color .18s ease; }
.source-open-button:hover { border-color: var(--blue); background: var(--blue-soft); }
.source-open-button svg { width: 16px; height: 16px; }
.source-status-grid { display: grid; grid-template-columns: 1.4fr .7fr .7fr .8fr; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.source-status-grid > div { min-width: 0; padding: 13px 15px; }
.source-status-grid > div + div { border-left: 1px solid var(--line); }
.source-status-grid span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; }
.source-status-grid strong { display: block; margin-top: 4px; overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.source-embed-shell { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.source-embed-shell iframe { width: 100%; height: max(560px, calc(100dvh - 245px)); display: block; border: 0; background: #f8fafb; }
.source-frame-fallback { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.source-frame-fallback svg { width: 15px; height: 15px; color: var(--blue); }

.filter-bar { display: grid; grid-template-columns: minmax(330px, auto) 150px minmax(220px, 1fr) 44px; align-items: end; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.filter-field { min-width: 0; display: grid; gap: 6px; }
.filter-label { color: var(--muted); font-size: 10px; font-weight: 800; }
.segmented { min-width: 0; display: flex; align-items: center; gap: 3px; padding: 3px; border-radius: 5px; background: var(--surface-soft); }
.segmented button { min-width: 54px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; transition: background-color .18s ease, color .18s ease, box-shadow .18s ease; }
.segmented button:hover { color: var(--ink); }
.segmented button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(23, 33, 43, .12); }
.filter-field select, .table-tools select, .table-tools input { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: 12px; outline: none; }
.filter-field select, .table-tools select { padding: 0 34px 0 11px; }
.filter-field select:disabled { cursor: not-allowed; background: var(--surface-soft); color: var(--muted); }
.clear-button { width: 44px; padding: 0; }

.dashboard-section { scroll-margin-top: 78px; padding-top: 40px; }
.section-heading, .detail-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 16px; }
.section-heading h2, .detail-heading h2 { margin: 5px 0 0; font-size: 27px; line-height: 1.2; letter-spacing: 0; }
.section-heading > p, .detail-heading > div > p:not(.section-index) { max-width: 620px; margin: 0 0 3px; color: var(--muted); font-size: 11px; text-align: right; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.metric-card { min-width: 0; min-height: 116px; padding: 15px 14px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.metric-card.is-primary { border-color: #e7b2aa; background: var(--coral-soft); }
.metric-card.is-positive { border-color: #abd9d6; background: var(--teal-soft); }
.metric-card.is-warning { border-color: #e6c78e; background: var(--gold-soft); }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-label svg { width: 15px; height: 15px; color: var(--coral); }
.metric-value { display: block; margin-top: 12px; overflow-wrap: anywhere; font-size: 25px; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-card.is-primary .metric-value { color: var(--coral); }
.metric-card.is-positive .metric-value { color: var(--teal); }
.metric-card.is-warning .metric-value { color: var(--gold); }
.metric-foot { display: block; margin-top: 10px; color: var(--muted); font-size: 10px; }

.overview-grid, .analysis-grid, .detail-grid, .entity-grid { display: grid; gap: 12px; margin-top: 12px; }
.overview-grid, .detail-grid { grid-template-columns: minmax(0, 1.65fr) minmax(310px, .7fr); }
.analysis-grid { grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); }
.entity-grid { grid-template-columns: 1fr; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.trend-panel, .year-panel, .coverage-panel, .detail-trend-panel, .year-matrix-panel, .entity-panel { padding: 17px 18px 13px; }
.panel-heading { min-height: 34px; display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.panel-heading h3 { margin: 0; font-size: 15px; line-height: 1.25; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.panel-heading > span { color: var(--muted); font-size: 11px; font-weight: 700; text-align: right; }
.chart { width: 100%; height: 286px; min-height: 286px; margin-top: 8px; }
.chart-large { height: 330px; min-height: 330px; }

.insight-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.insight-item { min-width: 0; padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.insight-item::before { content: ""; width: 7px; height: 7px; display: block; margin-bottom: 9px; border-radius: 50%; background: var(--blue); }
.insight-item.is-positive::before { background: var(--teal); }
.insight-item.is-warning::before { background: var(--gold); }
.insight-item h3 { margin: 0; font-size: 14px; line-height: 1.35; }
.insight-item p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.coverage-list { display: grid; gap: 13px; margin-top: 16px; }
.coverage-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 82px; align-items: center; gap: 9px; }
.coverage-row > span { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.coverage-row > strong { color: var(--ink); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.coverage-track { height: 7px; overflow: hidden; border-radius: 4px; background: var(--surface-soft); }
.coverage-track i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.coverage-row:nth-child(2) .coverage-track i { background: var(--coral); }
.coverage-row:nth-child(3) .coverage-track i { background: var(--gold); }
.coverage-row:nth-child(4) .coverage-track i { background: var(--blue); }

.projects-heading { align-items: center; }
.table-tools { display: grid; grid-template-columns: minmax(200px, 280px) 150px; gap: 8px; }
.table-tools label:first-child { position: relative; }
.table-tools label:first-child svg { position: absolute; left: 11px; top: 12px; width: 16px; height: 16px; color: var(--muted); }
.table-tools input { padding: 0 11px 0 34px; }
.table-tools input::placeholder { color: #93a0aa; }
.project-table-shell { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.project-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.project-table th, .project-table td { min-width: 0; padding: 11px 12px; border-bottom: 1px solid #e7ecef; text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }
.project-table th { background: var(--surface-soft); color: var(--muted); font-weight: 800; }
.project-table th:nth-child(1), .project-table td:nth-child(1) { width: 64px; text-align: center; }
.project-table th:nth-child(2), .project-table td:nth-child(2) { width: 28%; text-align: left; }
.project-table th:nth-child(7), .project-table td:nth-child(7) { width: 190px; }
.project-table tbody tr { cursor: pointer; transition: background-color .16s ease; }
.project-table tbody tr:hover, .project-table tbody tr:focus-within { background: #f8fafb; }
.project-table tbody tr.is-selected { background: var(--coral-soft); }
.project-table tbody tr:last-child td { border-bottom: 0; }
.project-name-button { max-width: 100%; display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; color: var(--ink); font-weight: 800; text-align: left; cursor: pointer; }
.project-name-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-name-button svg { flex: 0 0 auto; width: 14px; height: 14px; color: var(--coral); opacity: 0; }
tr:hover .project-name-button svg, tr.is-selected .project-name-button svg { opacity: 1; }
.value-positive { color: var(--teal); }
.value-negative { color: var(--danger); }
.board-tags { display: flex; justify-content: flex-end; gap: 4px; }
.board-tag { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 9px; font-weight: 800; }
.board-tag.is-active { border-color: #afd9d7; background: var(--teal-soft); color: var(--teal); }
.empty-state { margin: 0; padding: 30px 16px; color: var(--muted); text-align: center; }
.table-pagination { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.table-pagination > div { display: flex; align-items: center; gap: 8px; }
.table-pagination button { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); transition: border-color .18s ease, background-color .18s ease; }
.table-pagination button:hover:not(:disabled) { border-color: var(--coral); background: var(--coral-soft); color: var(--coral); }
.table-pagination button:disabled { cursor: not-allowed; color: #aeb7be; background: var(--surface-soft); }
.table-pagination svg { width: 16px; height: 16px; }

.detail-heading { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.detail-heading > div > p:not(.section-index) { margin-top: 4px; text-align: left; }
.detail-total { flex: 0 0 auto; text-align: right; }
.detail-total span { display: block; color: var(--muted); font-size: 10px; }
.detail-total strong { display: block; margin-top: 3px; color: var(--coral); font-size: 27px; line-height: 1; font-variant-numeric: tabular-nums; }
.project-year-list { display: grid; gap: 8px; margin-top: 15px; }
.project-year-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) 68px; align-items: center; gap: 8px; padding: 9px 10px; background: var(--surface-soft); }
.project-year-row span { color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.project-year-row strong { overflow: hidden; font-size: 12px; text-align: right; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.project-year-row small { color: var(--muted); font-size: 9px; text-align: right; }
.section-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.section-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.section-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-card-head h3 { margin: 0; font-size: 14px; }
.section-card-head i { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); }
.section-card:nth-child(2) .section-card-head i { background: var(--coral); }
.section-card:nth-child(3) .section-card-head i { background: var(--gold); }
.section-card:nth-child(4) .section-card-head i { background: var(--blue); }
.section-main-value { display: block; margin-top: 14px; color: var(--ink); font-size: 23px; line-height: 1; font-variant-numeric: tabular-nums; }
.section-main-label { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.section-submetrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.section-submetrics span { min-width: 0; color: var(--muted); font-size: 9px; }
.section-submetrics strong { display: block; margin-top: 2px; overflow: hidden; color: var(--ink-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.entity-list { display: grid; gap: 10px; margin-top: 14px; }
.entity-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px 90px; align-items: center; gap: 9px; }
.entity-row span { overflow: hidden; color: var(--ink-soft); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.entity-row strong { color: var(--ink); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.entity-bar { height: 6px; overflow: hidden; border-radius: 3px; background: var(--surface-soft); }
.entity-bar i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.entity-panel:last-child .entity-bar i { background: var(--blue); }
.entity-empty { margin: 10px 0; color: var(--muted); font-size: 11px; }

.dashboard-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 42px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: min(430px, calc(100% - 40px)); padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--ink); box-shadow: 0 12px 32px rgba(23, 33, 43, .16); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(53, 104, 184, .38); outline-offset: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { grid-template-columns: minmax(320px, 1fr) 140px minmax(190px, .8fr) 44px; }
  .project-table th:nth-child(4), .project-table td:nth-child(4) { display: none; }
  .current-project-table thead tr:not(.current-group-row) th:nth-child(8), .current-project-table tbody td:nth-child(8) { display: none; }
}

@media (max-width: 880px) {
  .topbar-inner, .page-shell { width: min(100% - 26px, 760px); }
  .page-intro { align-items: start; flex-direction: column; gap: 12px; }
  .source-meta { justify-items: start; text-align: left; }
  .daily-project-markers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .current-table-heading { align-items: stretch; flex-direction: column; }
  .current-table-tools { grid-template-columns: minmax(0, 1fr) 150px; }
  .current-project-table thead tr:not(.current-group-row) th:nth-child(7), .current-project-table tbody td:nth-child(7) { display: none; }
  .source-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-status-grid > div + div { border-left: 0; }
  .source-status-grid > div:nth-child(even) { border-left: 1px solid var(--line); }
  .source-status-grid > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .filter-bar { grid-template-columns: 1fr 150px 44px; }
  .year-field { grid-column: 1 / -1; }
  .project-field { grid-column: 1 / 2; }
  .select-field { grid-column: 2 / 3; grid-row: 2; }
  .clear-button { grid-column: 3 / 4; grid-row: 2; }
  .overview-grid, .analysis-grid, .detail-grid, .entity-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; gap: 6px; }
  .section-heading > p { text-align: left; }
  .project-table th:nth-child(5), .project-table td:nth-child(5), .project-table th:nth-child(6), .project-table td:nth-child(6) { display: none; }
  .project-table th:nth-child(2), .project-table td:nth-child(2) { width: 42%; }
  .project-table th:nth-child(7), .project-table td:nth-child(7) { width: 150px; }
}

@media (max-width: 580px) {
  .topbar-inner, .page-shell { width: min(100% - 18px, 520px); }
  .topbar-inner { min-height: 58px; }
  .brand img { width: 100px; }
  .brand span, .sync-state, .icon-link span, .refresh-button span { display: none; }
  .icon-link, .refresh-button { width: 42px; min-height: 42px; padding: 0; }
  .page-shell { padding-top: 18px; }
  .page-intro { padding-top: 8px; }
  .page-intro h1 { font-size: 27px; }
  .page-intro p:not(.eyebrow) { font-size: 14px; }
  .workspace-tabs { gap: 4px; overflow: hidden; }
  .workspace-tabs button { min-width: 0; flex: 1 1 0; justify-content: center; font-size: 11px; }
  .workspace-tabs svg { width: 15px; height: 15px; }
  .workspace-view { padding-top: 24px; }
  .daily-project-toolbar { align-items: stretch; }
  .daily-project-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
  .daily-project-heading h2 { font-size: 24px; }
  .daily-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .daily-section-heading > span:last-child { text-align: left; }
  .daily-data-table thead th:nth-child(n + 5), .daily-data-table tbody td:nth-child(n + 5) { display: none; }
  .daily-data-table th:first-child, .daily-data-table td:first-child { width: 82px; }
  .current-month-heading, .source-view-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .current-month-heading h2, .source-view-heading h2 { font-size: 23px; }
  .current-cutoff { text-align: left; }
  .dimension-switch { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dimension-switch button { min-width: 0; padding: 0 3px; font-size: 10px; }
  .current-table-tools { grid-template-columns: minmax(0, 1fr) 122px; }
  .current-project-table th, .current-project-table td { padding: 11px 7px; }
  .current-project-table .current-group-row { display: none; }
  .current-project-table thead tr:not(.current-group-row) th:nth-child(n + 5), .current-project-table tbody td:nth-child(n + 5) { display: none; }
  .current-project-table th:nth-child(1), .current-project-table td:nth-child(1) { width: 42px; }
  .current-project-table th:nth-child(2), .current-project-table td:nth-child(2) { width: 45%; }
  .current-table-footer { align-items: flex-start; flex-direction: column; gap: 2px; }
  .source-open-button { width: 100%; justify-content: center; }
  .source-status-grid { grid-template-columns: 1fr; }
  .source-status-grid > div:nth-child(even) { border-left: 0; }
  .source-status-grid > div + div { border-top: 1px solid var(--line); }
  .source-embed-shell iframe { height: 520px; }
  .filter-bar { grid-template-columns: minmax(0, 1fr) 44px; padding: 9px; }
  .year-field { grid-column: 1 / -1; }
  .select-field, .project-field { grid-column: 1 / 2; grid-row: auto; }
  .clear-button { grid-column: 2 / 3; grid-row: 3; }
  .segmented { overflow: hidden; }
  .segmented button { min-width: 0; flex: 1 1 0; padding: 0 5px; }
  .dashboard-section { padding-top: 32px; }
  .section-heading h2, .detail-heading h2 { font-size: 23px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .current-metric-grid .metric-card:nth-child(n + 5) { display: none; }
  .metric-card { min-height: 108px; padding: 13px 11px 10px; }
  .metric-value { font-size: 21px; }
  .chart-large { height: 290px; min-height: 290px; }
  .insight-list { grid-template-columns: 1fr; }
  .projects-heading { align-items: stretch; }
  .table-tools { width: 100%; grid-template-columns: minmax(0, 1fr) 126px; }
  .project-table th, .project-table td { padding: 10px 8px; }
  .project-table th:nth-child(1), .project-table td:nth-child(1) { width: 48px; }
  .project-table th:nth-child(2), .project-table td:nth-child(2) { width: auto; }
  .project-table th:nth-child(7), .project-table td:nth-child(7) { display: none; }
  .table-pagination { padding-inline: 9px; }
  .section-card-grid { grid-template-columns: 1fr; }
  .detail-heading { align-items: start; flex-direction: column; }
  .detail-total { text-align: left; }
  .entity-row { grid-template-columns: minmax(0, 1fr) 70px 74px; }
  .dashboard-footer { align-items: start; flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
