/* Hallmark · shape: app screen · genre: modern-minimal · theme: brand · redesign: full
 * paper: graphite #111517 · accent: amber #e9a56d · display: system sans · body: system sans
 * nav: kept research sidebar, horizontal on mobile · signature: GOES/XRS irradiance chart
 * states: cached, unavailable, failed, acquiring, configuration required · axes: dark/grotesk-sans/warm
 * posture: restrained · finish-review: subagent, 2 findings, 2 resolved, gap: none · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S5 R5 V3 · weakest: V, removed the card grid around tables to give scientific measurements a full-width ledger. */
/* Hallmark · answered F25 · scientific tables scroll horizontally on phones; the row identifier stays pinned and every measurement remains accessible. */
@import url("./tokens.css");
@import url("./base.css");

html { scroll-behavior: smooth; 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(--accent); }
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(--bg); border-radius: var(--radius-input); }
.skip-link:focus { top: var(--space-md); }

.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); padding: var(--space-xl) var(--space-md) var(--space-lg); background: var(--sidebar); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: var(--space-sm); padding: 0 var(--space-xs); margin-bottom: var(--space-3xl); font-size: var(--text-2xl); font-weight: 600; letter-spacing: .04em; line-height: 1.2; }
.brand .brand-mark { width: 36px; height: 36px; stroke: var(--accent); stroke-width: 1.4; }
.brand-sub { display: block; margin-top: var(--space-xs); color: var(--muted); font-size: var(--text-xs); font-weight: 400; letter-spacing: 0; }
.workspace-label { display: flex; justify-content: space-between; padding: 0 var(--space-sm) var(--space-sm); color: var(--faint); font-size: var(--text-xs); }
.nav-links { display: grid; gap: var(--space-2xs); }
.nav-link { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm); min-height: 44px; border-radius: var(--radius-input); color: var(--muted); font-size: var(--text-sm); white-space: nowrap; }
.nav-link:hover { color: var(--text); background: var(--surface-hover); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-bottom { margin-top: auto; padding: var(--space-3xl) var(--space-sm) 0; font-size: var(--text-xs); color: var(--muted); }
.sidebar-bottom>p { line-height: 1.9; }
.sidebar-bottom>a { display: block; font-size: 11px; white-space: nowrap; margin-top: var(--space-lg); text-decoration: underline; text-underline-offset: 4px; }
.sidebar-credit { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: var(--space-xs); color: var(--faint); }
.app-shell { margin-left: var(--sidebar-width); }
.topbar { min-height: 72px; padding: var(--space-sm) var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); background: var(--bg); border-bottom: 1px solid var(--line-soft); }
.breadcrumbs { display: flex; align-items: center; gap: var(--space-sm); color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.breadcrumbs strong { color: var(--text); font-weight: 400; }
.breadcrumbs svg, .slash { color: var(--faint); }
.topbar-actions { display: flex; align-items: center; gap: var(--space-lg); }
.topbar-actions time { color: var(--muted); font: var(--text-xs) var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.topbar-divider { height: 20px; width: 1px; background: var(--line); }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: 36px; border: 1px solid var(--faint); border-radius: var(--radius-input); background: var(--surface); color: var(--text); white-space: nowrap; font-size: var(--text-xs); }
.button { padding: var(--space-xs) var(--space-sm); }
.button:hover, .icon-button:hover { background: var(--surface-hover); }
.icon-button { width: 36px; flex-shrink: 0; }
.button svg, .icon-button svg { width: 14px; height: 14px; }
.is-refreshing svg { animation: spin 1s linear infinite; }

.dashboard { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter) var(--space-xl); }
.science-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-xl); align-items: end; padding: var(--space-xl) 0 var(--space-lg); }
.science-header h1 { font-size: var(--text-2xl); letter-spacing: -.035em; margin: 0 0 var(--space-sm); max-width: 34ch; }
.science-header p { max-width: 70ch; color: var(--muted); font-size: var(--text-sm); line-height: 1.65; }
.science-header-meta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-xs); padding-bottom: var(--space-2xs); color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.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, 1.7fr) 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: 96px; }
.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(--accent); }
.line-key { width: 16px; height: 2px; display: block; }
.long { background: var(--accent); }
.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(--accent); }
.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(--accent); }
.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(--accent); 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(--accent); }
.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(--bg); }
.positive { background: var(--text); }
.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-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(--accent); outline-offset: 2px; }
.search-field input { min-height: 32px; 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(--bg); }
.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: 0; }
.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: 96px; }
.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: 96px; }
.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(--accent); }
.toast { position: fixed; z-index: 50; left: calc(50% + var(--sidebar-width) / 2); 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); } }

@media (min-width: 1600px) { .chart-container { height: 360px; } .magnetogram-view, .magnetogram-view>.plot-image { height: 404px; } }
@media (max-width: 1200px) {
  .brand { font-size: var(--text-xl); gap: var(--space-xs); }
  .brand .brand-mark { width: 28px; height: 28px; }
  .brand-sub { font-size: 11px; }
  .nav-link { padding-inline: var(--space-xs); font-size: 13px; }
  .science-header { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
  .science-header-meta { flex-direction: row; align-items: center; flex-wrap: wrap; gap: var(--space-sm); }
  .scientific-value { font-size: var(--text-xl); }
  .panel-header { padding: var(--space-md); flex-wrap: wrap; }
  .chart-toolbar { padding-inline: var(--space-md); flex-wrap: wrap; gap: var(--space-xs); }
  .flare-toolbar { padding-inline: var(--space-md); }
  .panel-foot { padding-inline: var(--space-md); flex-wrap: wrap; }
  .chart-note { padding-inline: var(--space-md); flex-wrap: wrap; }
  .chart-note span { max-width: none; text-align: left; }
  .magnetic-legend { margin-inline: var(--space-md); }
}
@media (max-width: 960px) {
  .sidebar { position: static; width: 100%; padding: var(--space-md) var(--gutter) 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0 0 var(--space-md); padding: 0; width: fit-content; font-size: var(--text-xl); }
  .brand .brand-mark { width: 32px; height: 32px; }
  .brand-sub { display: inline; margin-left: var(--space-sm); font-size: var(--text-xs); }
  .workspace-label, .sidebar-bottom { display: none; }
  .nav-links { display: flex; gap: var(--space-xs); overflow-x: auto; padding: var(--space-2xs) var(--space-2xs) var(--space-md); scrollbar-width: thin; }
  .nav-link { padding: var(--space-sm); font-size: var(--text-sm); flex-shrink: 0; }
  .topbar { min-height: 64px; }
  .observation-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .metric { padding: var(--space-md) var(--space-sm); }
  .metric-value { font-size: var(--text-2xl); }
  .scientific-value { font-size: var(--text-xl); }
  .panel-header h2 { font-size: var(--text-md); }
  .magnetogram-view { min-height: 354px; }
  .magnetogram-view>.plot-image { height: 310px; }
  .footer { flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .observation-grid { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3) { border-left: 0; padding-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .science-header h1 { font-size: var(--text-2xl); max-width: 27ch; }
  .pipeline-grid { grid-template-columns: minmax(0, 1fr); }
  .methodology-content { grid-template-columns: minmax(0, 1fr); }
  .section-heading { flex-direction: column; align-items: flex-start; gap: var(--space-sm); }
  .magnetogram-view { min-height: 320px; }
  .magnetogram-view>.plot-image { height: 320px; }
  .panel-header { flex-wrap: nowrap; }
  .chart-toolbar { flex-wrap: nowrap; }
  .table-toolbar { align-items: flex-start; flex-direction: column; gap: var(--space-sm); }
  .search-field { width: 100%; }
  .search-field input { font-size: var(--text-md); }
  .workspace-note { flex-wrap: wrap; }
  .workspace-note>p { flex-basis: 80%; }
  .workspace-note>span { margin-left: var(--space-lg); }
}
@media (max-width: 480px) {
  .breadcrumbs { gap: var(--space-xs); }
  .breadcrumbs>svg, .breadcrumbs>span:first-of-type, .breadcrumbs .slash { display: none; }
  .topbar-actions { gap: var(--space-sm); }
  .topbar-divider { display: none; }
  .topbar-actions time { font-size: 11px; }
  .button-small>span { display: none; }
  .button-small { width: 44px; min-height: 44px; padding: var(--space-xs); }
  .science-header { padding-top: var(--space-lg); }
  .science-header h1 { font-size: var(--text-xl); letter-spacing: -.025em; }
  .science-header-meta { align-items: flex-start; flex-direction: column; white-space: normal; }
  .brand-sub { display: block; margin-left: 0; margin-top: var(--space-2xs); }
  .metric-value { font-size: var(--text-2xl); }
  .scientific-value { font-size: 20px; }
  .metric-label { min-height: 36px; }
  .metric-unit { font-size: 11px; }
  .panel-header { padding: var(--space-md); gap: var(--space-xs); flex-wrap: wrap; }
  .chart-toolbar { flex-wrap: wrap; padding-bottom: var(--space-sm); }
  .channel-controls { gap: var(--space-lg); }
  .channel { font-size: var(--text-sm); }
  .segmented { width: 100%; }
  .segmented button { flex: 1; font-size: var(--text-sm); min-height: 40px; }
  .chart-container { height: 260px; }
  .chart-note { flex-direction: column; gap: var(--space-2xs); }
  .chart-tooltip { left: var(--space-lg); right: var(--space-xs); font-size: 11px; padding: var(--space-xs); }
  .magnetogram-view, .magnetogram-view>.plot-image { height: 280px; min-height: 280px; }
  .magnetic-legend { gap: var(--space-2xs); font-size: 11px; }
  .source-card { padding: var(--space-md); }
  .source-card dl>div { flex-wrap: wrap; }
  .footer { align-items: flex-start; flex-direction: column; gap: var(--space-sm); }
  .footer>span:first-child { gap: var(--space-2xs); }
  .dialog-header { gap: var(--space-sm); }
}
@media (pointer: coarse) {
  .icon-button { width: 44px; min-height: 44px; }
  .button, .segmented button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
