/* Grey foundations with restrained accents for navigation and primary metrics. */
:root {
  --bg: #ededed;
  --surface: #f8f8f8;
  --surface-2: #e8e8e8;
  --surface-3: #d8d8d8;
  --ink: #292929;
  --text: #292929;
  --muted: #606060;
  --line: #d2d2d2;
  --line-soft: #e2e2e2;
  --teal-soft: #e0eeec;
  --grey-nav: #e7e7e7;
  --grey-active: #e0eeec;
  --grey-hover: #dfe6e5;
  --grey-border: #b5b5b5;
  --grey-strong: #404040;
  --grey-link: #365970;
  --accent: #146e73;
  --accent-ink: #17565b;
  --accent-soft: #e0eeec;
  --accent-border: #89b7b5;
  --accent-secondary: #476d98;
}

body { background: var(--bg); color: var(--ink); }
a, .research-table a, .research-source-list a, .research-link,
.country-history a, .cost-brand-link, .bp-company-link { color: var(--grey-link); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, svg:focus-visible,
.country-history :is(select,input,button):focus-visible,
.research-nav button:focus-visible, .research-controls :is(select,input):focus-visible,
.cost-estimate-toggle input:focus-visible { outline-color: var(--accent); }
input[type=checkbox], #view-company .company-check input,
.cost-estimate-toggle input, .bp-toggle input { accent-color: var(--accent); }

.app-sidebar { background: var(--grey-nav); border-color: var(--line); }
.brand-symbol { background: var(--accent); color: var(--surface); }
.app-brand small, .sidebar-footer, .sidebar-foot-label { color: var(--muted); }
.sidebar-footer a { color: var(--grey-strong); border-color: var(--line); }
.primary-nav a { color: #505050; }
.primary-nav a:hover { background: var(--grey-hover); color: var(--ink); }
.primary-nav a[aria-current="page"] { background: var(--grey-active); color: var(--accent-ink); }
.primary-nav a[aria-current="page"]::before { background: var(--accent); }
.workspace > header { background: #f5f5f5; }
.secondary-nav a { color: var(--muted); }
.secondary-nav a:hover, .secondary-nav a[aria-current="page"] { color: var(--accent-ink); }
.secondary-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.sidebar-backdrop { background: #29292955; }

.page-heading h2, .panel-title h2, .research-section h3, .signal h3,
.news-item a, .research-signal b, .assistant-evidence > strong,
.bp-details summary, #view-company .company-detail-summary { color: var(--ink); }
.sub, .page-group, .page-heading p, .note, .source-note, .chart-legend,
.research-legend, .signal p, .definition-row span, .source-row span,
.policy-item p, .news-meta, .news-summary, .research-freshness,
.research-controls, .research-signal p, .research-note, .research-disclosure,
.assistant-section p, .assistant-save-status, .assistant-stage-nav small,
.country-history :is(.ch-note,small,label,.ch-legend,.ch-method p),
#view-company :is(.company-legend,.company-meta,.company-dataset-check,.company-empty,td small),
#view-company .company-check small, #view-company .inline-metric small,
.cost-control, .cost-benchmarks span, .cost-benchmarks small,
.bp-scope, .bp-toggle, .bp-legend, .bp-details, .bp-analysis p,
.bp-source-list small, .bp-table small, .research-table small,
.assistant-table td small, .section-update-status small { color: var(--muted); }
.page-group::after { color: #808080; }

.view > .panel, .view > .two-col > .panel, .view > .equal-col > .panel,
.view > .policy-context-grid > .panel, #chinaPolicyPanel,
.signal, .definition-row, .source-row, .policy-item, .news-grid, .news-item,
.research-section, .research-signal, .research-disclosure,
.research-source-list > div, .country-history :is(.ch-filters,details,.ch-empty) { border-color: var(--line); }
.summary-grid, .inline-metric, .research-kpis, .country-history .ch-kpis,
.cost-benchmarks, .bp-kpis { background: var(--surface); border-color: var(--line); }
.stat, .stat.primary, .inline-metrics, .research-kpi,
.country-history .ch-kpi { border-color: var(--line); }
.stat.primary, .stat.primary .stat-value, .research-kpi strong,
.country-history .ch-kpi strong, .country-history .ch-kpi:first-child strong,
.cost-benchmarks strong, .bp-kpi strong, .bp-kpi.bp-primary strong,
.update-summary b, .export-breakdown-total strong { color: var(--ink); }
.stat-label, .stat-note, .stat.primary .stat-label, .stat.primary .stat-note,
.research-kpi span, .research-kpi small, .country-history .ch-kpi span,
.bp-kpi > span, .bp-kpi small, .bp-kpi strong.bp-text,
.research-kpi strong.metric-text, .stat-value.metric-text,
#view-company .inline-metric strong.company-text { color: var(--muted); }

.controls, .bp-tabs { background: var(--surface-2); }
button.control, .icon-button, .country-history .ch-icon, .assistant-command,
.research-action.secondary, #view-company .company-actions button {
  background: var(--surface); border-color: var(--grey-border); color: var(--grey-strong);
}
.controls .control { background: transparent; color: var(--muted); }
.controls .control[aria-pressed="true"], .bp-tabs button[aria-selected=true] {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-ink);
}
.controls .control:hover, .icon-button:hover, .bp-tabs button:hover,
#view-company .company-check:hover { background: var(--grey-hover); color: var(--ink); }
.controls .control[aria-pressed="true"]:hover, .bp-tabs button[aria-selected=true]:hover {
  background: var(--accent-soft); color: var(--accent-ink);
}
.brand-filters .control[aria-pressed="true"], .news-tabs .control[aria-selected="true"],
#view-company .company-check:has(input:checked), .assistant-stage-nav button[aria-pressed=true] {
  background: var(--grey-active); border-color: var(--accent-border); color: var(--accent-ink);
}
.bp-tabs button, #view-company .company-check, .assistant-stage-nav button { color: var(--muted); }
.research-action, .research-nav button[aria-selected=true],
.research-nav button[aria-selected=true]:hover { background: var(--accent); color: var(--surface); }
.research-controls :is(select,input), .scenario-table input,
#view-company :is(input[type=search],select), .country-history :is(select,input),
.assistant-toolbar select, .assistant-field :is(input,textarea),
.cost-control :is(input,select), .bp-control select {
  background: var(--surface); border-color: var(--grey-border); color: var(--ink);
}

.chart-scroll, .research-chart, .bp-chart-frame { background: var(--surface); border-color: var(--line); }
.chart-scroll svg text, .research-chart text, #bpChart text { fill: var(--muted); }
.chart-scroll svg > line, .research-chart > line { stroke: var(--line-soft); }
.chart-tooltip { background: #363636; border-color: #686868; color: var(--surface); }
.chart-tooltip strong { color: var(--surface); }
.chart-crosshair { stroke: #777777 !important; }
.table-wrap, .research-table-wrap, .country-history .ch-table-wrap,
.assistant-table-wrap, .bp-table-wrap {
  background: var(--surface); border-color: var(--line); scrollbar-color: #b1b1b1 transparent;
}
table, .research-table, .bp-table { background: var(--surface); }
th, .research-table th, .country-history th, .assistant-table th,
.cost-table th, .bp-table thead th { background: var(--surface-2); color: #505050; border-color: var(--line); }
td, .research-table td, .country-history td, .assistant-table td { color: var(--ink); border-color: var(--line-soft); }
tbody tr:hover, .research-table tr:hover td { background: #e8e8e8; }
.bp-table caption, .cost-tool { background: #e9e9e9; color: var(--muted); }
.cost-table td .cost-amount, .cost-tool output { color: var(--ink); }
.share-track, .metric-bar { background: var(--surface-3); }
.share-fill, .metric-bar > span { background: #518e92; }
.policy-period, .signal-kind, .research-badge:not(.warn),
.cost-badge:not(.warn), .bp-badge:not(.bp-warn), .assistant-tag.view,
.update-state.neutral { background: #dedede; color: #505050; }
.section-update-status { background: transparent; color: #505050; border-color: var(--line); }
.research-empty, .empty { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.assistant-breadcrumb, .export-breakdown-total { color: var(--muted); }

/* Keep the workspace quiet, while giving the key figures a clear visual anchor. */
.page-group { color: var(--accent); }
.summary-grid, .research-kpis, .country-history .ch-kpis,
.cost-benchmarks, .bp-kpis { padding-block: 0; }
.summary-grid > .stat, .research-kpi, .country-history .ch-kpi,
.cost-benchmarks > div, .bp-kpi { padding-block: 16px; }
.summary-grid > .stat.primary, .research-kpi:first-child,
.country-history .ch-kpi:first-child, .cost-benchmarks > div:first-child,
.bp-kpi.bp-primary {
  background: var(--accent-soft);
  box-shadow: inset 0 3px var(--accent);
}
.stat.primary .stat-value:not(.positive):not(.negative),
.research-kpi:first-child strong:not(.research-positive):not(.research-negative):not(.metric-text),
.country-history .ch-kpi:first-child strong, .cost-benchmarks > div:first-child strong,
.bp-kpi.bp-primary strong { color: var(--accent); }
.inline-metric:first-child { box-shadow: inset 0 3px var(--accent); }
.inline-metric:first-child strong { color: var(--accent); }
.research-kpi:not(:first-child) strong:not(.research-positive):not(.research-negative):not(.metric-text),
.bp-kpi:not(.bp-primary) strong:not(.bp-text) { color: var(--accent-secondary); }
.news-item a:hover, .cost-brand-link:hover, .bp-company-link:hover { color: var(--accent); }

.hero { min-height: 76px; padding-block: 12px; }
main.wrap { padding-top: 20px; }
.page-heading { margin-bottom: 14px; }
.section-update-status { margin-block: -2px 8px; padding-block: 8px; }
#publicationNotice { margin: 4px 0 16px; font-size: 11px; }
.view { gap: 18px; }
.panel-head { margin-bottom: 12px; }
@media (max-width: 1250px) {
  .summary-grid { row-gap: 0; }
}
@media (max-width: 1050px) {
  .research-kpis { row-gap: 0; }
}
@media (max-width: 840px) {
  .hero { min-height: 0; padding-block: 12px; }
  main.wrap { padding-top: 16px; }
}
@media (max-width: 560px) {
  .summary-grid, #view-quality > .summary-grid { padding-block: 0; row-gap: 0; }
  .summary-grid > .stat { padding-block: 14px; }
  .summary-grid > .stat:nth-child(n+4) { padding-top: 14px; }
  .page-heading { margin-bottom: 12px; }
  #publicationNotice { line-height: 1.75; margin-bottom: 12px; }
}

/* Neutral table and KPI text must not override positive/negative data states. */
.positive, .research-positive, td.positive, td.research-positive,
.research-table td.research-positive, .research-kpi strong.research-positive,
.stat-value.positive { color: #157252; }
.negative, .research-negative, td.negative, td.research-negative,
.research-table td.research-negative, .research-kpi strong.research-negative,
.stat-value.negative { color: #b64238; }
