/* SWERTO weather report: white, solar yellow, restrained burgundy. Scientific charts use contrast-safe ink. */
@import url("./tokens.css");
@import url("./base.css");

html { scroll-behavior: auto; scroll-padding-top: 96px; }
body { font-size: var(--text-md); line-height: 1.55; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; border: 0; background: none; cursor: pointer; }
a { text-decoration: none; }
button, input, summary, a, [tabindex] { outline-offset: 4px; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--text); }
button:disabled { opacity: .55; cursor: not-allowed; background: var(--surface-hover); }
button:active:not(:disabled), .icon-button:active { transform: translateY(1px); }
button svg, a svg, .observation-time svg, .workspace-note svg, .breadcrumbs svg, .search-field svg, .footer-mark {
  width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
h1, h2, h3 { max-width: none; line-height: 1.3; }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-md); }
p { margin: 0; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; top: -80px; left: var(--space-lg); z-index: 100; padding: var(--space-sm) var(--space-lg); background: var(--accent); color: var(--text); border-radius: var(--radius-input); }
.skip-link:focus { top: var(--space-md); }



.site-header { background: var(--surface); }
.topbar { max-width: var(--container); margin: auto; padding: 16px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 25px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.brand .brand-mark { width: 48px; height: 48px; padding: 7px; background: var(--accent); fill: none; stroke: var(--danger); stroke-width: 1.8; }
.brand-sub { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.topbar-actions time { font-size: 13px; color: var(--muted); white-space: nowrap; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-input); background: var(--surface); color: var(--text); white-space: nowrap; font-size: 13px; transition: background var(--dur-short); }
.button { padding: 10px 14px; }
.icon-button { width: 44px; flex-shrink: 0; }
.button:hover, .icon-button:hover { background: var(--accent-soft); border-color: var(--text); }
.is-refreshing svg { animation: spin 1s linear infinite; }
.navigation-band { background: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--text) 15%, var(--accent)); }
.nav-links { display: flex; gap: 30px; max-width: var(--container); margin: auto; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: thin; }
.nav-link { display: flex; align-items: center; min-height: 46px; border-bottom: 3px solid transparent; color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; }
.nav-link.active, .nav-link:hover { border-color: var(--danger); }
.dashboard { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter) 28px; }
.science-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0 20px; }
.science-header h1 { font-size: 28px; letter-spacing: -.025em; font-weight: 700; margin-bottom: 6px; }
.science-header>div>p { color: var(--muted); font-size: 13px; }
.science-header-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.forecast-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.forecast-panel { overflow: hidden; }
.forecast-panel .panel-header { padding: 20px; align-items: center; }
.forecast-panel h2 { font-size: 23px; letter-spacing: -.025em; }
.forecast-intro { margin-top: 5px; color: var(--muted); font-size: 13px; }
.model-grid { background: var(--accent); padding: 0 20px; }
.model-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr); gap: 16px; align-items: center; padding: 23px 0; }
.model-card+.model-card { border-top: 1px solid color-mix(in srgb, var(--text) 25%, var(--accent)); }
.model-heading h3 { font-size: 34px; line-height: 1; font-weight: 750; letter-spacing: -.025em; }
.model-heading h3 span { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.model-heading p { font-size: 13px; margin-top: 7px; color: var(--text); }
.model-heading .model-description { font-size: 11px; color: var(--text); opacity: .85; margin-top: 5px; }
.forecast-probabilities { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 0; }
.forecast-probability { min-width: 0; }
.forecast-probability dt { font-size: 12px; color: var(--text); }
.forecast-probability dd { color: var(--text); font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.05em; margin: 3px 0 10px; line-height: 1.1; white-space: nowrap; }
.forecast-probability dd span { font-size: 23px; font-weight: 400; margin-left: 2px; }
.forecast-probability meter { width: 100%; height: 3px; display: block; appearance: none; background: color-mix(in srgb, var(--surface) 55%, var(--accent)); border: 0; border-radius: 0; }
.forecast-probability meter::-webkit-meter-bar { border: 0; background: color-mix(in srgb, var(--surface) 55%, var(--accent)); height: 3px; border-radius: 0; }
.forecast-probability meter::-webkit-meter-optimum-value { background: var(--text); border-radius: 0; }
.forecast-probability meter::-moz-meter-bar { background: var(--text); border-radius: 0; }
.probability-missing { font-size: 11px; color: var(--text); }
.forecast-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0; padding: 12px 20px; font-size: 11px; color: var(--muted); }
.forecast-foot p { line-height: 1.6; }
.forecast-foot strong { font-weight: 400; }
.forecast-foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: underline; white-space: nowrap; }
.forecast-grid .magnetic-panel { display: flex; flex-direction: column; }
.forecast-grid .magnetic-panel .panel-header { padding: 20px 18px 12px; }
.forecast-grid .magnetic-panel h2 { font-size: 20px; font-weight: 700; }
.forecast-grid .magnetogram-view { min-height: 220px; margin: 0 12px; flex: 1; }
.forecast-grid .magnetogram-view>.plot-image { width: 100%; height: 250px; }
.forecast-grid .magnetic-legend { margin: 12px 18px; font-size: 11px; }
.forecast-grid .magnetic-timestamp { padding: 0 18px 14px; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: var(--space-2xs) var(--space-xs); border: 1px solid var(--line); border-radius: var(--radius-input); font-size: var(--text-xs); line-height: 1.5; color: var(--muted); background: var(--surface); white-space: nowrap; }
.badge-current, .badge-ready { color: var(--mint); background: var(--mint-soft); border-color: var(--mint); }
.badge-cached, .badge-stale, .badge-failed { color: var(--warning); background: var(--warning-soft); border-color: var(--warning); }
.badge-running { color: var(--blue); background: var(--info-soft); border-color: var(--blue); }
.badge-configuration_required, .badge-unavailable, .badge-disabled, .badge-waiting { color: var(--muted); border-color: var(--faint); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 var(--space-xl); border-block: 1px solid var(--line); }
.metric { min-width: 0; padding: var(--space-lg) var(--space-md); }
.metric:first-child { padding-left: 0; }
.metric+.metric { border-left: 1px solid var(--line-soft); }
.metric-label { font-size: var(--text-xs); color: var(--muted); }
.metric-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-xs); margin: var(--space-sm) 0 var(--space-xs); font-size: var(--text-display); letter-spacing: -.04em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.scientific-value { font: var(--text-2xl)/1.3 var(--mono); letter-spacing: -.06em; }
.metric-unit { font-size: var(--text-xs); font-family: var(--font-body); letter-spacing: 0; color: var(--muted); }
.metric-detail { font-size: var(--text-xs); line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }
.metric-detail span { display: block; color: var(--faint); }

.observation-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap-columns); }
.panel { min-width: 0; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-card); scroll-margin-top: 24px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); padding: var(--space-lg); }
.panel-header>div { min-width: 0; }
.panel-header h2 { font-size: var(--text-lg); letter-spacing: -.025em; }
.instrument-name { margin-top: var(--space-2xs); color: var(--muted); font-size: var(--text-xs); }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: 0 var(--space-lg) var(--space-xs); }
.channel-controls { display: flex; gap: var(--space-md); }
.channel { display: flex; align-items: center; gap: var(--space-xs); min-height: 44px; padding: var(--space-2xs) 0; font-size: var(--text-xs); color: var(--text); white-space: nowrap; }
.channel[aria-pressed=false] { color: var(--muted); text-decoration: line-through; }
.channel:hover { color: var(--text); }
.line-key { width: 16px; height: 2px; display: block; }
.long { background: var(--chart-long); }
.short { background: var(--blue); }
.segmented { display: flex; align-items: center; gap: var(--space-2xs); padding: var(--space-2xs); background: var(--bg); border-radius: var(--radius-input); }
.segmented button { padding: var(--space-xs); min-width: 40px; min-height: 36px; font-size: var(--text-xs); color: var(--muted); border-radius: var(--radius-input); white-space: nowrap; }
.segmented button.active { background: var(--surface-hover); color: var(--text); }
.segmented button:hover { color: var(--text); }
.flare-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-xs) var(--space-sm); padding: 0 var(--space-lg) var(--space-sm); color: var(--muted); font-size: var(--text-xs); }
.flare-toolbar .segmented { width: auto; }
.flare-toolbar button { min-width: 44px; min-height: 44px; }
#flare-plot-status { flex: 1 1 160px; }
.chart-container { height: 300px; position: relative; margin: 0 var(--space-sm) 0 var(--space-2xs); }
.chart-fallback { height: 100%; }
.chart-fallback>.plot-image { width: 100%; height: 100%; object-fit: contain; }
.chart-container .empty-state { height: 100%; min-height: 220px; }
.chart-svg { width: 100%; height: 100%; overflow: visible; }
.chart-svg text { font: 11px var(--mono); fill: var(--muted); }
.chart-gridline { stroke: var(--line); stroke-width: .7; }
.chart-path { fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-path-1 { stroke: var(--chart-long); }
.chart-path-2 { stroke: var(--blue); }
.chart-area { fill: var(--chart-fill); }
.chart-cursor { stroke: var(--text); stroke-width: .7; stroke-dasharray: 3 3; pointer-events: none; }
.chart-point { fill: var(--chart-long); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.chart-hitbox { fill: transparent; cursor: crosshair; }
.flare-marker { color: var(--warning); cursor: pointer; }
.flare-marker[data-class="X"] { color: var(--danger); }
.flare-hit { fill: transparent; }
.flare-symbol { fill: var(--surface); stroke: currentColor; stroke-width: 2; pointer-events: none; }
.flare-marker:hover .flare-symbol, .flare-marker:focus-visible .flare-symbol { fill: currentColor; }
.chart-tooltip { position: absolute; top: var(--space-xs); left: var(--space-2xl); z-index: 3; pointer-events: none; padding: var(--space-sm) var(--space-md); background: var(--surface-hover); border-radius: var(--radius-input); box-shadow: var(--shadow-card); color: var(--text); font: var(--text-xs)/1.8 var(--mono); }
.chart-tooltip strong { display: block; font-weight: 400; }
.chart-tooltip small { color: var(--muted); font-size: var(--text-xs); }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); min-height: 56px; padding: var(--space-sm) var(--space-lg); border-top: 1px solid var(--line-soft); }
.observation-time { display: flex; align-items: center; gap: var(--space-xs); font-size: var(--text-xs); color: var(--muted); overflow-wrap: anywhere; }
.observation-time svg { width: 14px; height: 14px; }
.panel-tools { display: flex; align-items: center; gap: var(--space-md); }
.text-button { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 44px; color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.text-button:hover { color: var(--text); }
.chart-note { display: flex; justify-content: space-between; gap: var(--space-sm); padding: 0 var(--space-lg) var(--space-md); color: var(--muted); font-size: var(--text-xs); }
.chart-note span { max-width: 25ch; text-align: right; }
.magnetogram-view { display: flex; align-items: center; justify-content: center; min-height: 344px; position: relative; margin: 0 var(--space-md); }
.magnetogram-view>.plot-image { width: 100%; height: 344px; object-fit: contain; }
.magnetic-placeholder { display: grid; place-items: center; width: 210px; height: 210px; border: 1px solid var(--line); border-radius: 50%; position: relative; overflow: hidden; }
.magnetic-placeholder:before, .magnetic-placeholder:after { content: ""; position: absolute; border: 1px solid var(--line); border-radius: 50%; }
.magnetic-placeholder:before { width: 80px; height: 210px; }
.magnetic-placeholder:after { width: 210px; height: 80px; }
.disk-cross { position: absolute; background: var(--line); }
.horizontal { width: 100%; height: 1px; }
.vertical { height: 100%; width: 1px; }
.disk-ring { width: 150px; height: 150px; border: 1px solid var(--line); border-radius: 50%; }
.magnetic-empty { position: absolute; inset: auto 0 0; background: var(--surface); text-align: center; padding: var(--space-sm) var(--space-xs); }
.magnetic-empty strong { font-size: var(--text-sm); font-weight: 500; }
.magnetic-empty p { margin-top: var(--space-2xs); color: var(--muted); font-size: var(--text-xs); }
.magnetic-legend { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); margin: var(--space-md) var(--space-lg); color: var(--muted); font-size: var(--text-xs); }
.magnetic-legend>span { display: flex; align-items: center; gap: var(--space-xs); }
.polarity { width: 8px; height: 8px; display: inline-block; border: 1px solid var(--faint); }
.negative { background: var(--text); }
.positive { background: var(--surface); }
.source-label { color: var(--muted); font-size: var(--text-xs); }
.magnetic-timestamp { padding: 0 var(--space-lg) var(--space-md); }

.tables-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); margin-top: var(--space-xl); }
.tables-grid>.panel { background: none; border: 0; border-radius: 0; }
.tables-grid .panel-header { padding: 0 0 var(--space-md); align-items: center; }
.count { display: inline-block; vertical-align: middle; padding: var(--space-2xs) var(--space-xs); margin-left: var(--space-xs); border-radius: var(--radius-input); background: var(--surface-hover); color: var(--muted); font: var(--text-xs) var(--mono); font-variant-numeric: tabular-nums; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: 0 0 var(--space-md); }
.table-toolbar>p { color: var(--muted); font-size: var(--text-xs); }
.search-control { display: grid; gap: 5px; max-width: 100%; }
.search-label { color: var(--muted); font-size: 12px; }
.search-field { display: flex; align-items: center; gap: var(--space-xs); border: 1px solid var(--faint); border-radius: var(--radius-input); background: var(--surface); padding: var(--space-2xs) var(--space-sm); min-height: 44px; width: 248px; max-width: 100%; color: var(--muted); }
.search-field:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.search-field input { min-height: 44px; width: 100%; min-width: 0; background: none; border: 0; color: var(--text); font-size: var(--text-sm); }
.search-field input::placeholder { color: var(--muted); }
.table-scroll { overflow: auto; max-height: 360px; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--faint) var(--bg); }
.data-table { border-collapse: separate; border-spacing: 0; width: 100%; text-align: left; white-space: nowrap; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.data-table thead { position: sticky; top: 0; z-index: 2; }
.data-table th { background: var(--surface); border-block: 1px solid var(--line); padding: var(--space-sm) var(--space-md); font-size: var(--text-xs); color: var(--muted); font-weight: 400; }
.data-table td { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--line-soft); }
.data-table th:first-child, .data-table td:first-child { padding-left: var(--space-md); }
.data-table th:last-child, .data-table td:last-child { padding-right: var(--space-md); }
.data-table tbody tr:hover { background: var(--surface); }
.data-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.data-table th:first-child { position: sticky; left: 0; z-index: 2; }
.data-table tbody tr:hover td:first-child { background: var(--surface); }
.flare-class { display: inline-block; padding: var(--space-2xs) var(--space-xs); min-width: 48px; border-radius: var(--radius-input); background: var(--warning-soft); color: var(--warning); text-align: center; font: var(--text-xs) var(--mono); }
.class-x { background: var(--danger-soft); color: var(--danger); }
.class-b, .class-a { background: var(--mint-soft); color: var(--mint); }
.cell-mono, .cell-time { font: var(--text-xs) var(--mono); }
.cell-time, .event-state { color: var(--muted); }
.event-state { font-size: var(--text-xs); }
.table-caption { padding: var(--space-sm) 0; color: var(--muted); font-size: var(--text-xs); }
.table-caption a { margin-left: var(--space-sm); text-decoration: underline; }
.region-name { display: block; font: var(--text-sm) var(--mono); }
.region-harp { display: block; margin-top: var(--space-2xs); color: var(--muted); font-size: var(--text-xs); }
.probability { font: var(--text-sm) var(--mono); }
.probability>span { margin-left: var(--space-3xs); font-size: var(--text-xs); color: var(--muted); }
.prob-elevated { background: var(--warning-soft); color: var(--warning); padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-input); }
.tables-grid .panel-foot { padding-inline: 24px; }
.empty-state { min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-sm); padding: var(--space-lg); text-align: center; }
.empty-icon { width: 28px; height: 28px; color: var(--muted); }
.empty-icon svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.2; }
.empty-state h3 { font-size: var(--text-sm); }
.empty-state p { color: var(--muted); font-size: var(--text-xs); max-width: 45ch; }
.filter-empty, .plot-error { padding: var(--space-lg); color: var(--muted); text-align: center; font-size: var(--text-sm); }

.pipeline-section { margin-top: var(--space-2xl); scroll-margin-top: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); padding-bottom: var(--space-lg); }
.section-heading h2 { font-size: var(--text-xl); }
.subtle-label { display: flex; gap: var(--space-xs); flex-wrap: wrap; color: var(--muted); font-size: var(--text-xs); }
.pipeline-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-columns); }
.source-card { min-width: 0; padding: var(--space-lg); border-top: 1px solid var(--line); background: var(--surface); color: var(--text); scroll-margin-top: 24px; }
.source-card-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); }
.source-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.source-card>p { color: var(--muted); font-size: var(--text-sm); margin-top: var(--space-xs); line-height: 1.7; max-width: 65ch; }
.source-card dl { margin: var(--space-lg) 0 0; font-size: var(--text-xs); }
.source-card dl>div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); padding: var(--space-xs) 0; }
.source-card dt { color: var(--muted); }
.source-card dd { text-align: right; margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }
.source-note { margin-top: var(--space-md); padding-top: var(--space-sm); border-top: 1px solid var(--line); font-size: var(--text-xs); color: var(--muted); }
.source-card>.source-diagnostic { color: var(--warning); font-size: var(--text-xs); overflow-wrap: anywhere; }
.methodology { grid-column: 1 / -1; background: none; padding: var(--space-lg) 0 0; }
.methodology h3 { font-size: var(--text-lg); }
.methodology details { margin-top: var(--space-md); }
.methodology summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); cursor: pointer; min-height: 44px; font-size: var(--text-sm); color: var(--text); list-style: none; border-bottom: 1px solid var(--line); }
.methodology summary::after { content: "+"; font-size: var(--text-lg); }
.methodology details[open] summary::after { content: "−"; }
.methodology summary svg { display: none; }
.methodology summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.methodology-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg); padding-top: var(--space-lg); color: var(--muted); font-size: var(--text-sm); line-height: 1.75; }
.methodology-content p { max-width: 65ch; }
.methodology-content a { white-space: nowrap; color: var(--text); text-decoration: underline; }
.workspace-note { display: flex; align-items: flex-start; gap: var(--space-sm); margin-top: var(--space-xl); font-size: var(--text-xs); line-height: 1.8; color: var(--muted); }
#main>.workspace-note { margin: var(--space-lg) var(--gutter) 0; }
.workspace-note>svg { margin-top: var(--space-2xs); }
.workspace-note>p { flex: 1; max-width: 75ch; }
.workspace-note>span { margin-left: auto; white-space: nowrap; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); max-width: var(--container); margin: auto; border-top: 1px solid var(--line-soft); padding: var(--space-lg) var(--gutter); color: var(--muted); font-size: var(--text-xs); }
.footer>span:first-child { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; }
.footer-mark { color: var(--text); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: var(--space-lg); transform: translate(-50%, 12px); max-width: calc(100% - 48px); padding: var(--space-sm) var(--space-lg); background: var(--surface-hover); color: var(--text); border: 1px solid var(--faint); border-radius: var(--radius-card); font-size: var(--text-sm); opacity: 0; pointer-events: none; transition: opacity var(--dur-short), transform var(--dur-short); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
dialog { width: 94%; max-width: 1200px; max-height: 92dvh; border: 1px solid var(--line); padding: var(--space-lg); border-radius: var(--radius-card); background: var(--surface); color: var(--text); box-shadow: none; }
dialog::backdrop { background: var(--overlay); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); margin-bottom: var(--space-lg); }
dialog>img { max-height: 70dvh; object-fit: contain; margin: auto; }
dialog>p { font-size: var(--text-xs); margin-top: var(--space-md); }
body.dialog-open { overflow: hidden; }
@keyframes spin { to { transform: rotate(360deg); } }



/* Forecast-page hierarchy: one lead outlook, compact conditions, then detailed reports. */
h1, h2, h3 { font-weight: 700; }
.panel { border-color: var(--line); }
.panel-header h2 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.badge { border: 0; border-radius: 0; padding: 2px 0; color: var(--muted); background: none; font-size: 11px; }
.badge-current, .badge-ready { color: var(--text); background: none; }
.badge-current::before, .badge-ready::before { content: ""; width: 6px; height: 6px; background: var(--text); margin-right: 6px; }
.badge-cached, .badge-stale { color: var(--muted); background: none; }
.badge-running, .badge-waiting, .badge-disabled, .badge-configuration_required, .badge-unavailable { color: var(--muted); background: none; }
.badge-failed { color: var(--danger); background: none; }
.panel-foot { min-height: 45px; padding: 8px 20px; }
.observation-time, .source-label { font-size: 11px; }
.observation-time svg { display: none; }
.metrics { margin: 20px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
.metric { padding: 18px 20px; }
.metric:first-child { padding-left: 20px; }
.metric-label { color: var(--text); font-size: 12px; font-weight: 600; }
.metric-value { margin: 7px 0 3px; font-size: 30px; font-weight: 700; }
.metric-unit { font-size: 11px; font-weight: 400; }
.metric-detail { font-size: 11px; }
.tables-grid { margin-top: 20px; gap: 20px; }
.tables-grid>.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.tables-grid .panel-header { padding: 18px 20px 10px; }
.tables-grid .table-toolbar { padding: 0 20px 12px; }
.tables-grid .table-caption { padding: 10px 20px; font-size: 11px; }
.tables-grid .panel-foot { padding-inline: 20px; }
.utov-regions .panel-header { border-top: 4px solid var(--accent); }
.region-table .d-column, .region-table .r-column { color: var(--text); background: var(--accent-soft); }
.header-detail { display: block; font-size: 10px; font-weight: 400; margin-top: 3px; }
.diagnostic-d, .diagnostic-r { color: var(--text); font-size: 16px; font-weight: 700; }
.data-table th { font-weight: 600; }
.data-table tbody tr:nth-child(even) { background: #fafafa; }
.data-table tbody tr:hover, .data-table tbody tr:hover td:first-child { background: var(--accent-soft); }
.region-table td:first-child { font-weight: 600; }
.prob-elevated { background: var(--accent-soft); color: var(--text); font-weight: 700; border-radius: 0; }
.count { border-radius: 0; background: none; color: var(--muted); padding: 0; font-family: var(--font-body); font-weight: 400; }
.count::before { content: "("; }
.count::after { content: ")"; }
.observation-grid { margin-top: 20px; }
.chart-container { height: 300px; }
.chart-path-2 { stroke-dasharray: 5 3; }
.short { background: none; border-top: 2px dashed var(--blue); }
.segmented { background: none; border-radius: 0; padding: 0; gap: 0; }
.segmented button { border: 1px solid var(--line); border-radius: 0; min-height: 44px; padding-inline: 12px; }
.segmented button+button { border-left: 0; }
.segmented button.active { background: var(--accent); color: var(--text); border-color: var(--line); font-weight: 700; }
.segmented button:hover { background: var(--accent-soft); color: var(--text); }
.flare-class { color: var(--text); background: none; font-weight: 700; border-radius: 0; padding-inline: 0; min-width: 40px; text-align: left; }
.class-x { color: var(--danger); background: none; }
.chart-tooltip { border: 1px solid var(--line); }
.text-button { color: var(--text); text-decoration: underline; }
.text-button:hover, .channel:hover { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; }
.search-field { border-color: var(--line); }
.search-field:focus-within { outline-color: var(--text); }
.pipeline-section { margin-top: 28px; }
.pipeline-grid { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); gap: 0; }
.source-card { border: 0; background: none; padding: 20px; }
.source-card+.source-card:not(.methodology) { border-left: 1px solid var(--line); }
.source-card>p { font-size: 12px; }
.methodology { border-top: 1px solid var(--line); padding: 20px; }
.methodology h3 { font-size: 18px; }
.methodology>p { font-size: 12px; }
.methodology-content { font-size: 12px; }
.workspace-note { margin-top: 20px; font-size: 11px; }
.footer { font-size: 11px; }
.footer-mark { color: var(--text); }
.toast { border-radius: 2px; }
.offline-page { max-width: 560px; margin: 12vh auto; padding: 28px; display: grid; gap: 20px; }
.offline-page h1 { font-size: 32px; }
.offline-page p { color: var(--muted); }
.offline-page .button { background: var(--accent); width: fit-content; border-color: var(--accent); }
@media (max-width: 1100px) {
  .forecast-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
  .model-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); gap: 12px; }
  .forecast-probabilities { gap: 16px; }
  .forecast-probability dd { font-size: 38px; }
  .model-heading p { font-size: 12px; }
  .model-heading .model-description { display: none; }
  .forecast-panel .panel-header { flex-wrap: wrap; gap: 4px; }
  .forecast-foot { gap: 12px; flex-wrap: wrap; }
  .forecast-grid .magnetic-panel .panel-header { padding-inline: 14px; }
  .forecast-grid .magnetic-panel h2 { font-size: 19px; }
  .forecast-grid .magnetogram-view>.plot-image { height: 230px; }
}
@media (max-width: 800px) {
  .forecast-grid { grid-template-columns: minmax(0, 1fr); }
  .forecast-grid .magnetogram-view { min-height: 280px; }
  .forecast-grid .magnetogram-view>.plot-image { height: 280px; }
  .forecast-grid .magnetic-panel .panel-header { padding-inline: 20px; }
  .science-header { align-items: flex-start; gap: 16px; }
  .science-header h1 { font-size: 25px; }
  .science-header-meta { align-items: flex-end; font-size: 11px; }
  .forecast-panel .panel-header { flex-wrap: nowrap; }
  .model-heading .model-description { display: block; }
  .forecast-probability dd { font-size: 44px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .pipeline-grid, .methodology-content { grid-template-columns: minmax(0, 1fr); }
  .source-card+.source-card:not(.methodology) { border-left: 0; border-top: 1px solid var(--line); }
  .table-toolbar { align-items: flex-start; gap: 12px; }
  .table-toolbar>p { max-width: 40ch; }
  .footer { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .topbar { padding-block: 12px; }
  .brand { font-size: 22px; gap: 10px; }
  .brand .brand-mark { width: 42px; height: 42px; padding: 6px; }
  .brand-sub { font-size: 11px; }
  .topbar-actions time { display: none; }
  .topbar-actions { gap: 8px; }
  #install-app { padding-inline: 10px; font-size: 12px; }
  .button-small { width: 44px; padding: 8px; }
  .button-small>span { display: none; }
  .nav-links { gap: 22px; }
  .nav-link { min-height: 44px; font-size: 13px; }
  .science-header { flex-wrap: wrap; padding: 20px 0 16px; gap: 10px; }
  .science-header h1 { font-size: 25px; line-height: 1.1; }
  .science-header-meta { flex-direction: row; align-items: center; gap: 10px; }
  .forecast-panel .panel-header { padding: 16px; flex-wrap: wrap; gap: 4px; }
  .forecast-panel h2 { font-size: 22px; }
  .forecast-panel .text-button { font-size: 12px; }
  .model-grid { padding-inline: 16px; }
  .model-card { grid-template-columns: minmax(0, .8fr) minmax(0, 1.8fr); gap: 12px; padding: 20px 0; }
  .model-heading h3 { font-size: 30px; }
  .model-heading h3 span { font-size: 13px; }
  .model-heading p { font-size: 11px; line-height: 1.4; max-width: 14ch; }
  .model-heading .model-description { display: none; }
  .forecast-probabilities { gap: 14px; }
  .forecast-probability dt { font-size: 11px; }
  .forecast-probability dd { font-size: clamp(24px, 6.8vw, 38px); margin-bottom: 9px; }
  .forecast-probability dd span { font-size: 16px; margin-left: 1px; }
  .forecast-foot { padding: 12px 16px; gap: 0; }
  .forecast-foot a { min-height: 44px; }
  .panel-foot { flex-wrap: wrap; padding-inline: 16px; }
  .forecast-grid .magnetic-panel .panel-header { padding-inline: 16px; }
  .forecast-grid .magnetic-timestamp { padding-inline: 16px; }
  .metric { padding: 16px; }
  .metric:first-child { padding-left: 16px; }
  .metric-label { font-size: 11px; min-height: 30px; }
  .metric-value { font-size: 26px; }
  .metric-unit { font-size: 10px; }
  .metric-detail { font-size: 10px; }
  .tables-grid .panel-header { padding: 16px 16px 10px; }
  .tables-grid .table-toolbar { padding-inline: 16px; }
  .tables-grid .table-caption { padding-inline: 16px; }
  .tables-grid .panel-foot { padding-inline: 16px; }
  .panel-header h2 { font-size: 20px; }
  .table-toolbar, .section-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .search-control, .search-field { width: 100%; }
  .search-field input { font-size: 16px; }
  .chart-toolbar { flex-wrap: wrap; padding-inline: 16px; }
  .flare-toolbar { padding-inline: 16px; }
  .chart-container { height: 260px; }
  .chart-tooltip { left: 16px; right: 8px; font-size: 11px; padding: 8px; }
  .chart-note { flex-wrap: wrap; padding-inline: 16px; }
  .chart-note span { text-align: left; max-width: none; }
  .source-card, .methodology { padding: 16px; }
  .source-card dl>div { flex-wrap: wrap; }
  .workspace-note { flex-wrap: wrap; }
  .workspace-note>p { flex-basis: 80%; }
  .workspace-note>span { margin-left: 24px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
