/* The lab (/explore) in the economic-report direction (docs/design/design-direction.md, D20).
 *
 * Loaded last in main.html, so these rules settle the shared lab components for every
 * model without rewriting each panel's own stylesheet. The lab is a working screen
 * (Impeccable's "operate" mode): the same ink, type, and model colour as the public
 * pages, applied with restraint. Each model keeps its own colour through the
 * theme.css roles (--model-accent, --model-strong, --model-soft), so Solow stays
 * green, New Keynesian violet, Intertemporal yellow, Portfolio orange, and Money &
 * Banking the site blue.
 */
:root {
    /* The report palette (--ink…, --tone…) comes from theme.css; the lab's own
       tokens (style.css) move onto it. */
    --bg: #ffffff;
    --card: #ffffff;
    --surface: var(--tone);
    --text: var(--ink);
    --muted: var(--ink-3);
    --radius: 3px;
    --shadow: none;
    --report-ease: cubic-bezier(0.16, 1, 0.3, 1);
}
html, body { background: #ffffff; color: var(--ink); }
::selection { background: color-mix(in srgb, var(--model-accent) 22%, white); color: var(--ink); }
html { scrollbar-color: var(--ink-3) var(--tone); accent-color: var(--model-accent); }
h1, h2, h3, h4 { color: var(--ink); }

/* ---------- Depth comes from tone and rules, never from shadows ---------- */
.app-container *, .info-popover, .models-menu { box-shadow: none !important; }
/* One exception: the selected chart in Country details merge mode is a state, not decoration. */
.details-merge-mode .comparison-chart-wrapper.merge-selected { box-shadow: 0 0 0 3px var(--model-accent) !important; }

/* ---------- Masthead: white, with a rule in the open model's colour ---------- */
.workspace-header { background: #ffffff; border-bottom: 3px solid var(--model-accent); }
.menu-toggle, .menu-close, .models-button, .eco-toggle { border: 2px solid var(--tone-2); border-radius: var(--radius); background: #ffffff; color: var(--ink); transition: border-color 160ms var(--report-ease), background 160ms var(--report-ease); }
.menu-toggle:hover, .menu-close:hover, .models-button:hover, .eco-toggle:hover, .models-button[aria-expanded="true"] { transform: none; border-color: var(--model-accent); background: #ffffff; }
.eco-toggle[aria-pressed="true"] { border-color: var(--model-accent); background: var(--model-accent); color: var(--model-on-accent); }
.models-dot { box-shadow: none; }
.models-caret { color: var(--ink-3); }

/* Tabs: a flat row; the open tab is filled with the model colour. */
/* The rail scrolls sideways on narrow screens; its padding keeps keyboard focus rings
   (3px + 2px offset, theme.css) from being clipped by that scroll box. */
.mode-navigation { padding: 5px; border: 0; border-radius: 0; background: transparent; }
.mode-navigation .div-buttons { gap: 2px; }
.mode-navigation .control { border: 0; border-radius: var(--radius); color: var(--ink-2); font-weight: 600; transition: background 160ms var(--report-ease), color 160ms var(--report-ease); }
.mode-navigation .control:hover { background: var(--tone); color: var(--ink); transform: none; }
.mode-navigation .control:active { transform: none; }
.mode-navigation .control.active { background: var(--model-accent); color: var(--model-on-accent); }
.rail-home { border-radius: var(--radius); color: var(--ink-2); }
.rail-home:hover { background: var(--tone); color: var(--ink); }

/* ---------- Surfaces: controls on a tone band, results on white ---------- */
.card, .box-style, .shock-sidebar, .left-panel, .right-panel, .country, .details-div, .visual-wrapper, .graph-box { border: 0; border-radius: var(--radius); }
.input-board, .shared-selection { background: var(--tone); }
.shared-selection select, .sidebar-input, select, .country-select { border: 2px solid var(--tone-2); border-radius: var(--radius); background-color: #ffffff; color: var(--ink); }
.shared-selection select:hover, select:hover { border-color: var(--ink-3); }
.primary-btn, .sidebar-btn, .shared-selection #applySelection { border-radius: var(--radius); background: var(--model-accent); color: var(--model-on-accent); }
.shared-selection #applySelection:hover:not(:disabled), .primary-btn:hover:not(:disabled) { transform: none; background: var(--model-accent-hover); }

/* Headline card: the model's rule on top, no wash. */
.result-hero, .lab-verdict { border: 0; border-top: 4px solid var(--model-accent); border-radius: 0; background: #ffffff; }
.result-hero h3 { color: var(--ink); font-weight: 700; letter-spacing: -0.015em; }
.result-hero .hero-text { color: var(--ink-2); }

/* Figures: a 3px ink rule frames every chart, story, and explanation. */
.chart-card, .lab-chart-card, .story-card, .lab-story, .explain-card, .comparison-chart-wrapper { border: 0; border-top: 3px solid var(--ink); border-radius: 0; background: #ffffff; }
.chart-card > h3, .lab-chart-heading h3, .story-card > h3, .explain-card > h3, .section-title h3 { color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }

/* A headline card that is also a figure keeps the model's rule. */
.result-hero.chart-card, .result-hero.story-card, .lab-verdict.card { border-top: 4px solid var(--model-accent); }

/* Numbers: tone bands, separated by space. */
.metric-tile, .lab-metric, .run-model-metric, .driver-card { border: 0; border-radius: 0; background: var(--tone); }
.metric-tile > strong, .lab-metric > strong, .run-model-metric strong, .driver-card .driver-value, .target-figures strong, .hero-status { font-variant-numeric: proportional-nums lining-nums; }
.metric-tile h4, .lab-metric h4 { color: var(--ink-2); }
.assumptions-card, .params-box { border: 0; border-radius: 0; background: var(--tone); }
.assumptions-card .lab-equations, .lab-chart-note { border-radius: 0; background: #ffffff; }
.time-box_div { border: 0; border-radius: 0; background: var(--model-soft); color: var(--model-strong); }

/* Empty states: plain white, the symbol on a tone square. */
.lab-empty, .summary-empty, .run-model-empty, .convergence-empty, .consumption-empty { background: #ffffff; }
.lab-empty-symbol, .summary-empty span { border-radius: var(--radius); }
.lab-empty-prompts span, .lab-model-badge, .status-pill, .run-model-source { border-radius: var(--radius); background: var(--tone); }

/* Segmented switches: flat, the chosen option filled. */
.lab-chart-toggle, .fd-choice { border-radius: var(--radius); background: var(--tone); }
.lab-chart-toggle button, .fd-choice button { border-radius: 2px; }
.lab-chart-toggle [aria-pressed="true"], .fd-choice button[aria-pressed="true"] { background: var(--model-accent); color: var(--model-on-accent); }

/* Read-with-care notes: an amber band, not a coloured left border. */
.caution-box, .caution-collapsible .caution-panel { border: 0; border-radius: 0; background: #fff4dc; color: #5c4100; }
.caution-toggle { border-radius: var(--radius); }
.lab-error { border: 0; border-radius: 0; }

/* Quotes and section breaks: rules, not side borders or hairlines. */
.details-quote { border-left: 0; border-top: 3px solid var(--model-accent); background: #ffffff; }
.section-rule { border-top: 0; margin: 12px 0; }

/* ---------- Labels: sentence case at readable size, never tiny tracked capitals ---------- */
.eyebrow, .comparison-country, .models-menu-title, .lab-footer-heading, .params-box h3, .time-box_div span,
.fd-equation figcaption, .fd-equation-name, .run-model-source,
.it-directions thead th, .mm-table thead th, .pf-table thead th { text-transform: none; letter-spacing: 0; }
.eyebrow { color: var(--model-strong); font-size: 0.875rem; font-weight: 700; }
.lab-verdict-top .eyebrow, .lab-chart-heading .eyebrow, .lab-story .eyebrow { font-size: 0.8125rem; }
.models-menu-title, .lab-footer-heading { color: var(--ink); font-size: 0.9375rem; font-weight: 700; }

/* ---------- Pop-overs and the models menu ---------- */
.info-popover { border: 2px solid var(--ink); border-radius: var(--radius); }
.models-menu-item { border: 0; border-radius: 0; background: var(--tone); }
.models-menu-open, .models-menu-overview { border-radius: 0; }
.models-menu-open:hover { background: var(--tone-2); }

/* ---------- Footer: the report's colophon ---------- */
.lab-footer { border: 0; border-top: 3px solid var(--model-accent); border-radius: 0; background: #ffffff; }
.lab-footer-scale { border: 0; border-radius: 0; padding: 0; background: none; color: var(--model-strong); font-size: 0.875rem; letter-spacing: 0; text-transform: none; }
.lab-footer-model { border: 0; border-radius: 0; background: var(--tone); }
.lab-footer-model:hover { transform: none; background: var(--tone-2); }
.lab-footer-data { background: var(--tone); border-top: 0; }
.lab-footer-data small { border-radius: 0; background: #ffffff; }
.lab-footer-rights { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 10px 28px 14px; color: var(--ink-3); font-size: .78rem; }
.lab-footer-rights a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 720px) { .lab-footer-rights { padding: 10px 18px 14px; } }

/* ---------- Small round controls stay round: one shape, chosen once ---------- */
.value-stepper button:hover:not(:disabled), .remove-button:hover, .info-toggle:hover { transform: none; }

@media (prefers-reduced-motion: reduce) {
    .menu-toggle, .menu-close, .models-button, .eco-toggle, .mode-navigation .control { transition: none; }
}

/* Digits: this face's tabular "1" carries slab serifs that read as a typewriter (it
   has no alternate "1"), so the lab uses its proportional digits, except in table
   cells, where columns of numbers must line up. This deliberately overrides the
   tabular digits some panels set on live slider readouts: each readout ends its
   label, so a change in its width moves nothing else. */
.app-container *:not(td):not(th) { font-variant-numeric: proportional-nums lining-nums; }
.app-container td, .app-container th { font-variant-numeric: tabular-nums lining-nums; }
