/* Shared visual language from the Green Winter home page.
   Loaded after tool styles so their layout and interactions remain independent. */
:root,
.catalogue-site {
  color-scheme: light;
  --bg-primary: #f7f7ef;
  --bg-secondary: #f0f2e7;
  --bg-tertiary: #e8eddd;
  --bg-card: #fcfcf7;
  --border: #d9dfd2;
  --border-highlight: #718557;
  --text-primary: #173b2e;
  --text-secondary: #465c4b;
  --text-muted: #667468;
  --accent: #173b2e;
  --accent-hover: #295440;
  --accent-strong: #295440;
  --accent-green: #50733c;
  --accent-red: #b42335;
  --green: #50733c;
  --green-bg: #e8eddd;
  --green-border: #bbc9a8;
  --red: #b42335;
  --orange: #a8650a;
  --purple: #7658a1;
}
html { background: var(--bg-primary); }
body,
body.dashboard-page,
body.catalogue-site { color: var(--text-primary); background: var(--bg-primary) !important; background-size: auto !important; }
h1, h2, h3, .hero-title, .menu-title { font-family: "Inter", system-ui, sans-serif; }
* { scrollbar-color: #aebaa2 #f0f2e7; }
::-webkit-scrollbar-track,
.catalogue-site::-webkit-scrollbar-track { background: #f0f2e7 !important; }
::-webkit-scrollbar-thumb,
.catalogue-site::-webkit-scrollbar-thumb { background: #aebaa2 !important; }
::selection { color: #173b2e; background: #dce7cb; }
:focus-visible { outline: 2px solid #718557; outline-offset: 3px; }

/* A quiet, compact header leaves room for the tools. */
.app-header, .site-header, body > .top-bar,
body.visualiser-active .top-bar,
.catalogue-site > .top-bar {
  background: #f7f7ef !important;
  border-color: #d9dfd2 !important;
  box-shadow: none !important;
}
.site-header::after, .app-header::after,
body.visualiser-active .top-bar::after { display: none; }
.brand-mark, .hero-logo { filter: none; }
.brand-divider, .catalogue-site .brand-divider { background: #d9dfd2; }
.logo-btn.brand-lockup { gap: 5px; text-decoration: none; }
.brand-wordmark, .brand-wordmark-project,
.catalogue-site .brand-wordmark-project { color: #173b2e; }
.brand-wordmark-name, .catalogue-site .brand-wordmark-name { color: #667468; }
.site-header h1, .site-header-title, body > .top-bar > h1,
.app-header .nav-title { color: #465c4b !important; }
.site-header-title:hover, .site-header-title:focus-visible,
.site-header-title.is-active { color: #173b2e !important; background: #e8eddd; }
.site-header-title:hover::after, .site-header-title:focus-visible::after,
.site-header-title.is-active::after { background: #718557; box-shadow: none; }
body.visualiser-active .toolbar { background: #f0f2e7; border-color: #d9dfd2; }
.site-footer, .catalogue-site .site-footer { color: #465c4b; background: #eef1e4; border-color: #d9dfd2; box-shadow: none; }
.footer-brand, .catalogue-site .footer-brand { color: #173b2e; }
.footer-copy, .catalogue-site .footer-copy { color: #667468; }
.footer-links a, .catalogue-site .footer-links a { color: #465c4b; }
.footer-links a:hover, .footer-links a:focus-visible,
.catalogue-site .footer-links a:hover, .catalogue-site .footer-links a:focus-visible { color: #173b2e; }

/* Forms, tables, and application surfaces. */
.btn, .toolbar button, select, input, textarea, .sql-input,
.app-header .back-btn {
  color: #173b2e !important;
  background-color: #fcfcf7 !important;
  border-color: #d9dfd2 !important;
  accent-color: #50733c;
}
input::placeholder, textarea::placeholder { color: #7b877a; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: #718557 !important; box-shadow: 0 0 0 3px rgba(113, 133, 87, .13); }
input[type="checkbox"] { accent-color: #50733c !important; }
.wizard-step .step-num { background: #173b2e !important; }
.btn:hover, .toolbar button:hover, .file-card:hover,
.recent-item:hover, .upload-area:hover { color: #173b2e !important; border-color: #91a378 !important; }
.btn-go, .btn-run, .toolbar button.active,
.btn.btn-run { color: #fff !important; background: #173b2e !important; border-color: #173b2e !important; box-shadow: none; }
.btn-go:hover, .btn-run:hover, .toolbar button.active:hover { background: #295440 !important; }
.wizard-step, .file-card, .recent-item, #chart, .sidebar, .modal,
.content blockquote, .content pre {
  color: #465c4b;
  background: #fcfcf7 !important;
  border-color: #d9dfd2 !important;
  box-shadow: none;
}
.main, .main-panel, .tab-content, .sql-editor, .data-wrap { color: #465c4b; background: #f7f7ef !important; }
.sidebar { background: #f0f2e7 !important; }
.tabs { background: #f0f2e7 !important; border-color: #d9dfd2 !important; }
.tab.active { color: #173b2e !important; background: #e8eddd; border-bottom-color: #718557 !important; }
.table-item.active { color: #173b2e !important; border-left-color: #718557 !important; }
.table-item:hover, .table-item.active, .group-menu .gm-item:hover,
.data-table tr:hover td { background: #e8eddd !important; }
.schema-table th, .data-table th { color: #465c4b !important; background: #e8eddd !important; border-color: #d9dfd2 !important; }
.schema-table td, .data-table td { color: #173b2e !important; border-color: #d9dfd2 !important; }
.content h1 { color: #173b2e !important; }
.content h2 { color: #50733c !important; }
.content p, .content li { color: #465c4b; }
.sql-error { color: #b42335 !important; background: #fff1f2 !important; border-color: #e5bac0 !important; }
.loading-overlay { background: rgba(247, 247, 239, .9) !important; }

/* Dashboard: ink traces and sage ranges on a paper canvas. */
.dashboard-panel, .weekly-summary-panel, .market-dynamics,
.weekly-summary-card, .dynamics-card {
  background: #fcfcf7; border-color: #d9dfd2; box-shadow: none;
}
.dashboard-panel::before { display: none; }
.dashboard-control-bar h3 { background: #fcfcf7; color: #173b2e; }
.view-controls button, .week-arrow, .chart-legend button,
.date-range-picker button { color: #465c4b; background: #f7f7ef; border-color: #d9dfd2; box-shadow: none; }
.view-controls button:hover, .view-controls button:focus-visible,
.view-controls button.is-active, .week-arrow:hover:not(:disabled),
.week-arrow:focus-visible, .chart-legend button:hover,
.chart-legend button.is-active, .date-range-picker button:hover,
.date-range-picker button:focus-visible, .date-mode-tabs button.is-active {
  color: #173b2e; background: #e8eddd; border-color: #aebf97; box-shadow: none;
}
.date-range-picker, .date-range-separator, .chart-legend { color: #667468; }
.date-mode-tabs, .date-mode-tabs button { border-color: #d9dfd2; }
/* Clear chart canvas and quiet reference layers. */
.weekly-price-panel { background: #fff; border-color: #e1e7ed; }
.weekly-chart-scroll, .period-metrics-scroll { background: #fff; background-image: none; border-color: #e1e7ed; border-radius: 6px; scrollbar-color: #cbd5df transparent; }
.weekly-chart-scroll { overflow-y: auto; }
.day-band { fill: none; }
.day-guide { stroke: #e1e7ed; stroke-width: .7; }
.price-grid-line { stroke: #eaf0f4; stroke-width: .7; }
.midday-guide { stroke: #e4ebf0; stroke-width: .6; stroke-dasharray: 2 6; }
.weekday-label, .axis-price-label { fill: #48596b; letter-spacing: 0; }
.axis-price-label { stroke: #fff; }
.hour-label { fill: #8b99a7; letter-spacing: 0; }
.zero-axis-label { fill: #b84c58; }
.price-chart .zero-reference-line { stroke: #b84c58; stroke-width: .8; opacity: .45; }
.positive-price-area { fill: rgba(24, 117, 86, .025); }
.negative-price-area { fill: rgba(195, 63, 78, .035); }
.metric-box-bg { fill: #fff; stroke: #e1e7ed; stroke-width: .7; }
.metric-significance-title, .metric-label { fill: #33485a; }
.metric-rank-label, .metric-incomplete { fill: #7a8998; }
.metric-significance-box { fill: transparent; stroke: #cbd7df; stroke-width: .65; }
.metric-vertical-rank-bar:not(.is-filled), .metric-rank-bar:not(.is-filled) { fill: #edf2f6; }
.metric-rank-bar.is-filled { fill: #278268; }
.metric-vertical-rank-bar.is-filled.quality-1 { fill: #ce5965; }
.metric-vertical-rank-bar.is-filled.quality-2 { fill: #ce6e66; }
.metric-vertical-rank-bar.is-filled.quality-3 { fill: #c78366; }
.metric-vertical-rank-bar.is-filled.quality-4 { fill: #b89668; }
.metric-vertical-rank-bar.is-filled.quality-5 { fill: #9b9f6c; }
.metric-vertical-rank-bar.is-filled.quality-6 { fill: #7da477; }
.metric-vertical-rank-bar.is-filled.quality-7 { fill: #60a784; }
.metric-vertical-rank-bar.is-filled.quality-8 { fill: #43a68c; }
.metric-vertical-rank-bar.is-filled.quality-9 { fill: #2c9b85; }
.metric-vertical-rank-bar.is-filled.quality-10 { fill: #20866e; }
.hover-line, .latest-value-line { stroke: #55788b; }
.chart-tooltip { color: #233e4e; background: rgba(255, 255, 255, .98); border-color: #dbe4eb; box-shadow: 0 4px 16px rgba(25, 48, 68, .08); }
.chart-tooltip span { color: #728291; }
.chart-legend [data-region]::before { background: #187556; }
.expected-range-band.expected-p1-p99 { fill: #f6f9fc; }
.expected-range-band.expected-p5-p95 { fill: #edf4f9; }
.expected-range-band.expected-p20-p80 { fill: #e0edf6; }
.expected-range-band.expected-p40-p60 { fill: #cbdfea; }
.price-chart .actual-price-line { stroke: #187556; stroke-width: 1.7px; }
.price-chart .actual-price-line.is-within-expected { stroke-width: 1.7px; }
.price-chart .actual-price-line.is-outside-expected { stroke: #46677c; stroke-width: 1.5px; }
.price-chart polyline.comparison-line { stroke-width: 1.25px; opacity: .8; filter: none; }
.price-chart .actual-range-segment { stroke-width: 2px; }
.spike-tier-reference { stroke: #a7b8c5; stroke-width: .8; opacity: .7; filter: none; }
.spike-tier-label { fill: #6e8293; stroke: #fff; }
.metric-direction-divider { stroke: #b9c8d2; }
.chart-legend [data-expected]::before { border-color: #c8d9e5; background: linear-gradient(90deg, #f6f9fc 0 25%, #edf4f9 25% 50%, #e0edf6 50% 75%, #cbdfea 75%); }
.weekly-summary-heading h4, .weekly-summary-section h5,
.market-dynamics-heading h3, .dynamics-card h4,
.weekly-summary-label, .dynamics-card strong { color: #173b2e; }
.weekly-summary-heading span, .weekly-summary-pending,
.market-dynamics-heading p, .dynamics-card > p,
#weekly-distribution-detail { color: #667468; }
.weekly-summary-section + .weekly-summary-section { border-color: #d9dfd2; }
.weekly-summary-score i { background: #dce2d3; }
.distribution-axis { stroke: #a6b39b; }
.distribution-axis-label { fill: #667468; }
.distribution-normal-curve { stroke: #50733c; }
.distribution-bar { fill: #bdcba9; }
.distribution-mean-line { stroke: #173b2e; }
.weather-day-icon { color: #667468; filter: none; }

/* Documents, code, and the conceptual model. */
.documents-sidebar, .code-sidebar { background: #f0f2e7; border-color: #d9dfd2; }
.documents-sidebar-toggle { color: #465c4b; background: #fcfcf7; border-color: #d9dfd2; }
.documents-sidebar-toggle:hover, .documents-sidebar-toggle:focus-visible { color: #173b2e; background: #e8eddd; }
.documents-sidebar-heading strong, .catalogue-hero h1, .catalogue-content h3,
.code-sidebar-heading strong, .metric-document h1 { color: #173b2e; }
.catalogue-hero h1, .metric-document h1 { font-weight: 500; letter-spacing: -.045em; }
.documents-kicker, .documents-pages-heading, .catalogue-eyebrow,
.code-sidebar-heading span, .code-sidebar-label, .code-eyebrow,
.document-page-icon { color: #718557; }
.documents-pages > a, .code-metric-nav a { color: #465c4b; }
.documents-pages > a:hover, .documents-pages > a.is-active,
.code-metric-nav a:hover, .code-metric-nav a:focus-visible,
.code-metric-nav a.is-active { color: #173b2e; background: #e8eddd; border-color: #c5d1b7; }
.code-metric-nav a span, .code-metric-nav a.is-active span { color: #718557; }
.catalogue-hero > p, .catalogue-content p, .catalogue-content li,
.metric-document > p:not(.code-eyebrow) { color: #667468; }
.catalogue-content h2 { color: #50733c; }
.data-model-groups li { background: #f0f2e7; border-color: #d9dfd2; }
.data-model-groups li::before { color: #718557; }
.data-model-groups code, .catalogue-content code { color: #173b2e; background: #e8eddd; }
.catalogue-content blockquote { color: #465c4b; background: #eef1e4 !important; border-color: #aebf97 !important; }
.catalogue-table-wrap, .catalogue-table-wrap.is-methods { background: #fcfcf7; border-color: #d9dfd2; }
.catalogue-content th, .catalogue-table-wrap.is-unified th { color: #465c4b; background: #e8eddd; border-color: #d9dfd2; }
.catalogue-content td { color: #173b2e; border-color: #d9dfd2; }
.catalogue-content tbody tr:hover td { background: #eef1e4; }
.catalogue-content td:first-child, .catalogue-table-wrap.is-unified .entry-name { color: #50733c; }
.catalogue-filter-toolbar, .catalogue-table-wrap.is-unified .catalogue-filter-row th { color: #667468; background: #f0f2e7; border-color: #d9dfd2; }
.catalogue-clear-filters { color: #465c4b; background: #fcfcf7; border-color: #d9dfd2; }
.catalogue-clear-filters:hover, .catalogue-clear-filters:focus-visible { color: #173b2e; border-color: #91a378; }
.catalogue-table-wrap.is-unified .entry-category strong { color: #173b2e; }
.catalogue-table-wrap.is-unified .entry-category span,
.catalogue-table-wrap.is-unified .entry-number,
.catalogue-table-wrap.is-unified .entry-granularity { color: #667468; }
.catalogue-table-wrap.is-unified tbody tr:has(.entry-category) td { border-color: #bdc9b1; }
.metric-document pre { color: #eef2df; background: #173b2e; border-color: #39563d; border-radius: 5px; box-shadow: none; scrollbar-color: #658165 #173b2e; }
.conceptual-model-field, .conceptual-model-status { color: #667468; }
.conceptual-model-reset { color: #173b2e; background: #fcfcf7; border-color: #d9dfd2; }
.conceptual-model-reset:hover { color: #50733c; border-color: #91a378; }
.conceptual-model-count { color: #173b2e; }
.conceptual-model-legend .legend-root { background: #173b2e; }
.conceptual-model-legend .legend-package { background: #718557; }
.conceptual-model-legend .legend-public { background: #50733c; }
.conceptual-model-stage { background: #fcfcf7; background-size: auto; border-color: #d9dfd2; box-shadow: none; }
.conceptual-model-detail { color: #465c4b; background: rgba(247, 247, 239, .97); border-color: #d9dfd2; box-shadow: 0 8px 24px rgba(23, 59, 46, .1); }
.conceptual-model-detail strong, .conceptual-model-detail .detail-meta { color: #173b2e; }

/* Supporting pages echo the home page's editorial type and restrained cards. */
.feature-eyebrow, .feature-card-kicker, .contact-eyebrow, .hero-eyebrow { color: #718557; }
.features-intro h1, .coming-soon-panel h1,
.contact-intro h2, .hero-title { color: #173b2e; font-family: "Inter", system-ui, sans-serif; font-weight: 500; letter-spacing: -.045em; text-shadow: none; }
.features-intro > p:last-child, .coming-soon-panel > p:not(.feature-eyebrow),
.feature-card-copy, .contact-intro > p:not(.contact-eyebrow), .hero-copy { color: #667468; }
.feature-card, .coming-soon-panel, .form-card,
.menu-card { background: #f0f2e7 !important; border-color: #d9dfd2 !important; border-radius: 5px; box-shadow: none; }
.feature-card::before, .coming-soon-panel::before,
.menu-card::before, .landing-shell::before, .landing-shell::after { display: none; }
.feature-card:hover, .feature-card:focus-visible,
.menu-card:hover { border-color: #91a378 !important; box-shadow: none !important; }
.feature-card strong, .menu-title { color: #173b2e !important; font-family: "Inter", system-ui, sans-serif; font-weight: 500; }
.feature-card-action, .back-to-features, .menu-card::after { color: #173b2e; }
.back-to-features:hover, .back-to-features:focus-visible { color: #50733c; }
.coming-soon-badge, .coming-soon-banner { color: #50733c; background: #e8eddd; border-color: #c5d1b7; }
.menu-card { border-radius: 5px !important; }
.menu-icon { color: #50733c; background: #e8eddd; border-color: #c5d1b7; }
.menu-desc { color: #667468 !important; }
.email-card a { color: #173b2e; }
#contact-submit, .auth-submit { color: #fff; background: #173b2e; border-color: #173b2e; border-radius: 3px; box-shadow: none; }
#contact-submit:hover, .auth-submit:hover { background: #295440; }
.form-row input:focus, .form-row textarea:focus,
.auth-form input:focus { border-color: #718557 !important; box-shadow: 0 0 0 3px rgba(113, 133, 87, .13); }

/* Sign-in remains consistent whichever page opens it. */
.auth-trigger, .catalogue-site .auth-trigger { color: #173b2e; background: transparent; border-color: #d9dfd2; border-radius: 3px; }
.auth-trigger:hover, .catalogue-site .auth-trigger:hover { color: #173b2e; border-color: #91a378; }
.auth-trigger.authenticated { color: #50733c; background: #e8eddd; border-color: #c5d1b7; }
.auth-modal-overlay { background: rgba(23, 59, 46, .4); }
.auth-modal, .catalogue-site .auth-modal { color: #173b2e; background: #f7f7ef; border-color: #d9dfd2; border-radius: 8px; box-shadow: 0 24px 60px rgba(23, 59, 46, .2); }
.auth-kicker { color: #718557; }
.auth-copy { color: #667468; }
.auth-close:hover { color: #173b2e; background: #e8eddd; }

/* Five-minute sidebar: paper cards, forest ink and compact metric marks. */
.weekly-content-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 25%); gap: 12px; }
.dashboard-sidebar { height: 100%; align-content: start; grid-template-rows: max-content max-content; gap: 10px; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #c3ceb9 transparent; }
.dashboard-sidebar .weekly-summary-panel { padding: 12px; border-radius: 12px; background: #fcfcf7; }
.weekly-summary-heading { align-items: center; margin-bottom: 10px; }
.weekly-summary-heading h4 { font: 600 15px Georgia, serif; }
.dashboard-sidebar .weekly-summary-grid { grid-template-columns: repeat(5, 28px); gap: 6px; justify-content: start; }
.dashboard-sidebar .weekly-summary-score { width: 28px; height: 28px; }
.dashboard-sidebar .weekly-summary-label { font-size: 7.25px; line-height: 1.2; margin-top: 3px; }
.period-comparison { margin-top: 12px; padding-top: 12px; border-top: 1px solid #d9dfd2; }
.period-comparison-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.period-comparison-heading h5 { margin: 0; color: #173b2e; font: 600 14px Georgia, serif; }
.period-comparison-heading select { max-width: 120px; padding: 4px 5px; border: 1px solid #d9dfd2; border-radius: 5px; color: #465c4b; background: #f3f5ec; font: 500 10px Inter, sans-serif; }
#period-comparison-scope { margin: 6px 0 9px; font: 500 9px/1.4 Inter, sans-serif; color: #667468; }
.period-comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.period-move-card { min-width: 0; padding: 9px; border: 1px solid #e1e6d9; border-radius: 8px; background: #f6f7ef; }
.period-move-card h6 { margin: 0 0 5px; font: 500 9px/1.4 Inter, sans-serif; color: #667468; }
.period-move-value { display: block; font: 500 21px/1.15 Georgia, serif; letter-spacing: -.025em; color: #173b2e; overflow-wrap: anywhere; }
.period-move-delta { display: inline-block; margin-top: 5px; font: 600 9px/1.5 Inter, sans-serif; overflow-wrap: anywhere; }
.period-move-hero { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: center; background: #eef3e5; }
.period-move-hero h6 { grid-column: 1 / -1; }
.period-move-hero .period-move-value { font-size: 29px; }
.period-move-hero .period-move-delta { margin: 0 0 0 8px; padding: 4px 6px; border-radius: 5px; background: #fcfcf7; text-align: right; max-width: 145px; font-size: 11px; }
.move-up { color: #23734d; }
.move-down { color: #aa423a; }
.move-flat, .move-unavailable { color: #768071; }
.period-comparison-key { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; font: 500 8px/1.4 Inter, sans-serif; color: #84917d; }
.weekly-distribution { margin-top: 12px; padding-top: 12px; border-color: #d9dfd2; }
.weekly-distribution-heading h5 { color: #173b2e; font: 600 14px Georgia, serif; margin-bottom: 8px; }
.distribution-layout { display: grid; grid-template-columns: minmax(94px, .8fr) minmax(0, 1.5fr); gap: 6px; align-items: stretch; }
.distribution-statistics { margin: 0; display: grid; align-content: space-between; gap: 8px; }
.distribution-statistics dt { font: 500 9px/1.3 Inter, sans-serif; color: #667468; }
.distribution-statistics dd { margin: 3px 0 0; font: 600 19px/1.1 Georgia, serif; letter-spacing: -.02em; color: #173b2e; }
#weekly-distribution-chart { width: 100%; height: 145px; overflow: visible; }
.distribution-axis-label { font-size: 10px; fill: #667468; }
#weekly-distribution-detail { font-size: 9px; margin-top: 9px; }
.dashboard-sidebar .market-dynamics { display: block; padding: 0; border: 0; background: transparent; }
.market-dynamics-grid { display: grid; grid-template-rows: none; gap: 10px; margin: 0; }
.dashboard-sidebar .dynamics-card { padding: 12px 12px 8px; border: 1px solid #d9dfd2; border-radius: 12px; background: #fcfcf7; }
.dynamics-card h4 { display: flex; align-items: center; gap: 7px; font: 600 11px/1.3 Inter, sans-serif; }
.dynamics-card h4 > span { font: 500 9px Inter, sans-serif; color: #84917d; }
.dynamics-card .dynamics-headline { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: start; gap: 7px; margin-top: 8px; }
.dynamics-headline strong { color: #173b2e; font: 500 28px/1 Georgia, serif; letter-spacing: -.035em; }
.dynamics-headline > span { font: 500 9px/1.3 Inter, sans-serif; color: #667468; }
.dynamics-card > p { font-size: 9px; line-height: 1.45; min-height: 13px; margin: 6px 0 2px; color: #667468; }
.dashboard-sidebar .dynamics-card svg { display: block; width: 100%; height: auto; min-height: 120px; flex: none; overflow: visible; }
.diagnostic-axis { font: 500 10px Inter, sans-serif; fill: #667468; }
.diagnostic-unit { font: 600 10px Inter, sans-serif; fill: #465c4b; }
.diagnostic-grid { stroke: #e0e5d9; stroke-width: .7; }
.diagnostic-zero { stroke: #a9b89c; stroke-width: .8; stroke-dasharray: 3 3; }
.diagnostic-future { fill: #f1f3ea; }
.diagnostic-trace { fill: none; stroke-width: 1.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.diagnostic-change { stroke: #a2afa0; opacity: .9; }
.diagnostic-volatility { stroke: #173b2e; stroke-width: 1.8; }
.diagnostic-fit { stroke: #173b2e; stroke-width: 2.2; }
.diagnostic-price { stroke: #465c4b; stroke-width: 1; }
.diagnostic-mean { stroke: #173b2e; stroke-width: 1.3; stroke-dasharray: 3 2; }
.regime-band { opacity: .45; }
.regime-mean_reverting { fill: #b4ca9e; }
.regime-directional { fill: #ddb880; }
.regime-mixed { fill: #bbc0a2; }
.regime-uncertain { fill: #d9ded6; }
.regime-insufficient, .regime-constant { fill: #eef0e8; }
.dynamics-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-left: 38px; color: #667468; font-size: 8px; line-height: 1.4; }
.dynamics-legend span::before { content: ''; display: inline-block; width: 8px; height: 2px; margin-right: 4px; vertical-align: middle; background: #a2afa0; }
.dynamics-legend .volatility-key::before, .dynamics-legend .trend-key::before { background: #173b2e; }
.regime-legend { gap: 6px; }
.regime-legend span::before { height: 6px; }
.regime-legend .reverting-key::before { background: #b4ca9e; }
.regime-legend .directional-key::before { background: #ddb880; }
.regime-legend .mixed-key::before { background: #bbc0a2; }
.regime-legend .uncertain-key::before { background: #d9ded6; }
.sidebar-methods { padding: 10px 12px; color: #667468; font-size: 10px; line-height: 1.6; }
.sidebar-methods summary { color: #465c4b; cursor: pointer; }
.sidebar-methods p { margin: 8px 0; }
@media (max-width: 1050px) and (min-width: 721px) {
  .weekly-content-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 8px; }
}
@media (max-width: 720px) {
  .weekly-content-layout { display: flex; flex-direction: column; gap: 12px; }
  .dashboard-sidebar { height: auto; overflow: visible; grid-template-columns: 1fr; gap: 10px; padding: 0 5px 12px; }
  .dashboard-sidebar .dynamics-card svg { max-height: 190px; }
  .distribution-statistics dd { font-size: 23px; }
  #weekly-distribution-chart { height: 170px; }
  .dynamics-headline strong { font-size: 32px; }
}

/* Compact panel type with an 8px minimum for responsive chart labels. */
#dashboard-sidebar,
#dashboard-sidebar * { font-size: 8px !important; }
#dashboard-sidebar svg text { font-size: max(8px, var(--sidebar-chart-font-size, 8px)) !important; }
.dashboard-sidebar .weekly-summary-grid { grid-template-columns: repeat(auto-fit, 56px); }
.dashboard-sidebar .weekly-summary-label { top: 0; min-height: 18px; line-height: 1.3; }
.dashboard-sidebar .period-comparison-heading select { max-width: 160px; min-width: 0; }

/* Volatility anatomy follows the displayed period within the right sidebar. */
.dynamics-legend .shock-key::before { background: #b42335; }
.volatility-panel { min-width: 0; margin-top: 14px; padding-top: 12px; border-top: 1px solid #d9dfd2; color: #173b2e; }
.volatility-panel-head { margin-bottom: 10px; }
.volatility-panel-head h5 { margin: 4px 0 0; font: 600 15px/1.4 Georgia, serif; }
.volatility-eyebrow { margin: 0; color: #718557; font: 600 15px/1.4 Inter, sans-serif; letter-spacing: .025em; }
.volatility-panel button, .volatility-panel input, .volatility-panel select { min-width: 0; max-width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid #c3ceb9; border-radius: 6px; background: #f7f7ef; color: #173b2e; font: 500 15px/1.4 Inter, sans-serif; }
.volatility-panel button { cursor: pointer; }
.volatility-panel button:disabled { opacity: .5; cursor: wait; }
.volatility-panel input, .volatility-panel select { width: 100%; }
.volatility-panel button:focus-visible, .volatility-panel input:focus-visible, .volatility-panel select:focus-visible { outline: 2px solid #718557; outline-offset: 2px; }
.volatility-panel-controls { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; margin: 12px 0 10px; }
.volatility-panel-controls label { grid-column: 1 / -1; display: grid; min-width: 0; gap: 5px; font: 500 15px/1.4 Inter, sans-serif; }
.volatility-panel-controls > span { color: #667468; font: 400 15px/1.4 Inter, sans-serif; }
#volatility-reference, #volatility-validation, #volatility-point-status { color: #667468; font: 400 15px/1.5 Inter, sans-serif; overflow-wrap: anywhere; }
#volatility-point-status { min-height: 22px; margin: 10px 0; color: #173b2e; }
.volatility-point-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 10px 0 14px; }
.volatility-point-stat { min-width: 0; padding: 9px; border-radius: 7px; background: #eef1e4; }
.volatility-point-stat span { display: block; color: #667468; font: 500 15px/1.35 Inter, sans-serif; overflow-wrap: anywhere; }
.volatility-point-stat strong { display: block; margin-top: 6px; color: #173b2e; font: 500 15px/1.4 Georgia, serif; overflow-wrap: anywhere; }
.volatility-panel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.volatility-pane { min-width: 0; padding: 10px 8px; border: 1px solid #d9dfd2; border-radius: 8px; }
.volatility-pane h6 { margin: 0 0 6px; font: 600 15px/1.4 Inter, sans-serif; }
.volatility-pane > p { margin: 0 0 8px; color: #667468; font: 400 15px/1.5 Inter, sans-serif; }
.dashboard-sidebar .volatility-pane svg { width: 100%; display: block; height: auto; min-height: 0; max-height: none; touch-action: pan-y; }
.volatility-key { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; color: #667468; font: 500 15px/1.45 Inter, sans-serif; }
.volatility-key span::before { content: ''; display: inline-block; width: 10px; height: 3px; margin-right: 4px; vertical-align: middle; background: #718557; }
path.layer-price { stroke: #9aaba0; stroke-width: 1; }
path.layer-seasonal { stroke: #447fb0; stroke-width: 1.7; }
path.layer-expected { stroke: #173b2e; stroke-width: 1.6; stroke-dasharray: 4 2; }
path.layer-level { stroke: #a8650a; stroke-width: 1.7; }
path.layer-carry { stroke: #7658a1; stroke-width: 1.2; }
path.layer-ordinary { stroke: #50733c; stroke-width: 1.5; }
path.layer-shock { stroke: #b42335; stroke-width: 1.2; }
.volatility-key .layer-price::before { background: #9aaba0; }
.volatility-key .layer-seasonal::before { background: #447fb0; }
.volatility-key .layer-expected::before { background: #173b2e; }
.volatility-key .layer-level::before { background: #a8650a; }
.volatility-key .layer-carry::before { background: #7658a1; }
.volatility-key .layer-ordinary::before { background: #50733c; }
.volatility-key .layer-shock::before { background: #b42335; }
.volatility-cursor { stroke: #465c4b; stroke-dasharray: 3 3; stroke-width: .8; pointer-events: none; }
.volatility-band-low { fill: #bbc9a8; }
.volatility-band-typical { fill: #718557; }
.volatility-band-elevated { fill: #a8650a; }
.volatility-band-high { fill: #c86b49; }
.volatility-band-extreme { fill: #b42335; }
.volatility-panel details { margin-top: 12px; padding-top: 10px; border-top: 1px solid #d9dfd2; color: #667468; font: 400 15px/1.6 Inter, sans-serif; }
.volatility-panel details summary { cursor: pointer; color: #173b2e; font-weight: 600; line-height: 1.45; }
.volatility-panel details p { margin: 9px 0; overflow-wrap: anywhere; }
.volatility-panel details a { color: #447fb0; }
.volatility-regime-band { opacity: .13; }
.volatility-band-unassessed { fill: #d9ded6; }
path.layer-shock-carry { stroke: #b42335; stroke-width: 1.4; stroke-dasharray: 5 3; }
.volatility-key .layer-shock-carry::before { background: #b42335; }

.volatility-key .rank-low::before { background: #bbc9a8; height: 8px; }
.volatility-key .rank-typical::before { background: #718557; height: 8px; }
.volatility-key .rank-elevated::before { background: #a8650a; height: 8px; }
.volatility-key .rank-high::before { background: #c86b49; height: 8px; }
.volatility-key .rank-extreme::before { background: #b42335; height: 8px; }

#volatility-point-status { position: sticky; top: 0; z-index: 1; padding: 8px 0; background: #fcfcf7; }

.dashboard-sidebar { padding: 0; gap: 0; }
.normalised-volatility-card { min-width: 0; padding: 0; border: 0; border-radius: 0; color: #173b2e; font-size: 15px; }
.normalised-volatility-card h4 { margin: 0; font-size: 15px; line-height: 18px; font-weight: 600; }
.normalised-volatility-card p { margin: 0; font-size: 15px; color: #667468; }
.normalised-volatility-scroll { min-width: 0; overflow: hidden; padding: 0; }
#normalised-volatility-chart { display: block; width: 100%; max-width: 100%; height: 156px; }
#normalised-volatility-chart text { font-size: 15px !important; }
#weekly-volatility-signal-chart { display: block; width: 100%; max-width: 100%; height: 276px; }
#weekly-volatility-signal-chart text { font-size: 15px !important; }
.weekly-volatility-signal-line { fill: none; stroke: #b42335; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.weekly-spike-signal-line { fill: none; stroke: #2563eb; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.volatility-signal-distribution { opacity: .5; }
.volatility-signal-distribution-middle { fill: #829a72; opacity: .15; }
.volatility-signal-reference { fill: none; stroke-width: 1; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.volatility-signal-reference-label { font-family: Inter, sans-serif; paint-order: stroke; stroke: #fcfcf7; stroke-width: 3; }
path.reference-p5 { stroke: #718557; }
text.reference-p5 { fill: #718557; }
path.reference-p95 { stroke: #a8650a; }
text.reference-p95 { fill: #a8650a; }
.normalised-volatility-bar { fill: #173b2e; }
.normalised-volatility-value { fill: #173b2e; font-family: Inter, sans-serif; }

#normalised-volatility-detail:empty { display: none; }

/* Signed weekly price attribution uses the sidebar's existing width. */
#weekly-price-components { min-width: 0; overflow-x: hidden; }
.price-component-chart { display: block; width: 100%; max-width: 100%; touch-action: pan-y; }
.price-component-chart:focus-visible { outline: 1px solid #718557; outline-offset: -1px; }
.price-component-key { display: flex; flex-wrap: wrap; column-gap: 8px; line-height: 18px; }
.price-component-key span { display: inline-flex; align-items: center; gap: 4px; }
.price-component-key i, .price-component-table i { display: inline-block; width: 8px; height: 8px; flex: none; }
.price-component-table i { margin-right: 4px; }
.price-point-values { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 4px; line-height: 19px; }
.price-point-values span { min-width: 0; overflow-wrap: anywhere; }
.price-point-values strong { text-align: right; font-weight: 600; }
.price-component-table { width: 100%; table-layout: fixed; border-collapse: collapse; line-height: 19px; }
.price-component-table th { font-weight: 600; text-align: right; }
.price-component-table th:first-child { width: 46%; text-align: left; }
.price-component-table td, .price-component-table th { padding: 0; vertical-align: top; overflow-wrap: anywhere; }
.price-component-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.price-component-total { border-top: 1px solid #d9dfd2; font-weight: 600; }
.price-component-method { line-height: 19px; }
.price-component-method summary { cursor: pointer; }
.price-component-method p { margin: 0 0 6px; color: #173b2e; overflow-wrap: anywhere; }

.dashboard-sidebar { grid-auto-rows: max-content; overflow-x: hidden; }
#weekly-price-components { overflow-x: clip; }

.dashboard-sidebar { grid-template-rows: max-content; }

.price-component-explanation { font-weight: 400; color: #667468; overflow-wrap: anywhere; }

.weekly-content-layout.has-collapsible-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 8px minmax(0, var(--sidebar-width, 50%)); gap: 0; }
.weekly-content-layout.has-collapsible-sidebar.is-sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
#dashboard-sidebar { height: 100%; padding: 0 4px; box-sizing: border-box; grid-template-rows: 18px minmax(0, 1fr); overflow: hidden; }
#dashboard-sidebar[hidden] { display: none; }

.dashboard-sidebar-heading { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 0; background: #fcfcf7; }
#dashboard-sidebar .dashboard-sidebar-heading h4 { margin: 0; font-size: 10px !important; font-weight: 600; line-height: 18px; }
.dashboard-sidebar-resizer { position: relative; min-width: 0; cursor: col-resize; touch-action: none; background: #e8eddd; }
.dashboard-sidebar-resizer::after { content: ""; position: absolute; top: 50%; left: 3px; width: 2px; height: 36px; border-radius: 1px; background: #91a378; }
.dashboard-sidebar-resizer:hover, .dashboard-sidebar-resizer:focus-visible { background: #c5d1b7; outline: none; }
.dashboard-sidebar-resizer[hidden] { display: none; }
.weekly-content-layout.is-sidebar-resizing, .weekly-content-layout.is-sidebar-resizing * { cursor: col-resize !important; user-select: none; }

.dashboard-sidebar-edge-toggle { position: fixed; right: 0; top: 32px; z-index: 90; display: flex; align-items: center; justify-content: center; width: auto; height: 28px; gap: 4px; padding: 0 8px; font-size: 12px; line-height: 16px; white-space: nowrap; border: 1px solid #b9c8aa; border-right: 0; border-radius: 8px 0 0 8px; color: #173b2e; background: #fcfcf7; box-shadow: -2px 0 8px #173b2e18; cursor: pointer; touch-action: manipulation; }
.dashboard-sidebar-edge-toggle:hover { background: #e8eddd; }
.dashboard-sidebar-edge-toggle:focus-visible { outline: 2px solid #173b2e; outline-offset: -3px; }
.dashboard-sidebar-edge-toggle svg { display: block; }
.dashboard-sidebar-edge-toggle[aria-expanded="false"] svg { transform: rotate(180deg); }
#dashboard-sidebar { padding-right: 4px; }

/* Fit all six components into the panel's available height. */
#weekly-price-components { height: 100%; min-height: 0; overflow: hidden; }
#weekly-price-component-plots { display: grid; height: 100%; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 2px; }
#dashboard-sidebar .price-component-card { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
#dashboard-sidebar .price-component-card h4 { flex: 0 0 auto; margin: 0; font-size: 9px !important; line-height: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dashboard-sidebar .price-component-explanation { display: inline; font-size: 8px !important; line-height: inherit; }
#dashboard-sidebar .price-component-chart { flex: 1 1 0; min-height: 0; width: 100%; overflow: hidden; }
#dashboard-sidebar .price-component-chart text { font-size: 8px !important; }

@media (max-width: 1050px) {
  .weekly-content-layout.has-collapsible-sidebar { grid-template-columns: minmax(0, 1fr); }
  .dashboard-sidebar-resizer { display: none; }
  #dashboard-sidebar { position: fixed; inset: 0; z-index: 70; width: 100%; height: 100dvh; background: #fcfcf7; }
}

.dashboard-freshness { margin-right: 0; }
@media (max-width: 1050px) {
  .weekly-chart-scroll { overflow-y: auto; }
}
.dashboard-period-controls { position: sticky; top: 0; z-index: 80; display: flex; align-items: center; flex: 0 0 auto; min-height: 36px; min-width: 0; box-sizing: border-box; padding: 4px 148px 4px 4px; background: #fcfcf7; }
.dashboard-period-controls .week-navigation { display: flex; flex: 1; min-width: 0; font-size: 12px; }
.dashboard-period-controls .period-arrows { flex: 0 0 auto; }
.dashboard-period-controls #week-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1050px) {
  .dashboard-period-controls { min-height: 44px; }
  .dashboard-sidebar-edge-toggle { height: 36px; }
}

/* The phone panel is attached to the page root, outside the chart layout. */
@media (max-width: 1050px) {
  body > #dashboard-sidebar { position: fixed; inset: 0; width: 100vw; width: 100dvw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding-left: 4px; border: 0; border-radius: 0; z-index: 400; background: #fcfcf7; overflow: hidden; }
  html.mobile-components-open, body.mobile-components-open { overflow: hidden; }
  .mobile-components-open .dashboard-sidebar-edge-toggle { z-index: 410; }
  body > #dashboard-sidebar { top: var(--components-panel-top, 92px); height: calc(100vh - var(--components-panel-top, 92px)); height: calc(100dvh - var(--components-panel-top, 92px)); }
}
