/* Light theme overrides for #panel, export modal, meteogram, donation, status.
   Load AFTER styles.css. Does not cover topbar/layer-dock/step controls/legends. */
:root {
  --panel-bg: #ffffff;
  --panel-surface: #f4f6f9;
  --panel-surface-raised: #ffffff;
  --panel-border: rgba(15, 23, 42, 0.10);
  --panel-border-strong: rgba(15, 23, 42, 0.16);
  --panel-text: #1d2733;
  --panel-muted: #5f6b7a;
  --panel-accent: #2f7de1;
  --panel-accent-strong: #2f7de1;
  --glass-border: rgba(15, 23, 42, 0.12);
  --glass-shadow: 0 8px 28px rgba(15, 23, 42, 0.16);
}

/* ---------- Panel ---------- */
#panel {
  background: rgba(255, 255, 255, 0.94) !important;
  color: var(--panel-text);
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.18) !important;
  scrollbar-color: #b8c2cf transparent;
}
#panel::-webkit-scrollbar-thumb { background: #b8c2cf; }
#panel h1.panel-h1 { color: var(--panel-text); }
#panel hr { border-top-color: rgba(15, 23, 42, 0.10); }
#panel label { color: #3b4756; }
.field-label > span { color: #2c3846; }
.toggle-copy strong, .map-tools-copy strong, .section-heading strong { color: #1d2733; }
.toggle-copy small, .map-tools-copy small, .section-heading small { color: var(--panel-muted); }
.panel-card {
  background: #f4f6f9;
  border-color: var(--panel-border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.pane-block { background: #f4f6f9; border-color: rgba(15, 23, 42, 0.10); }

#panel select, #panel input[type=number], #panel input[type=range] {
  background: #fff; color: var(--panel-text); border: 1px solid rgba(15, 23, 42, 0.18);
}
#panel select:hover, #panel input[type=number]:hover { background: #fff; border-color: rgba(15, 23, 42, 0.32); }
#panel select:focus-visible, #panel input:focus-visible, #panel button:focus-visible,
#panel summary:focus-visible, #panel a:focus-visible {
  border-color: var(--panel-accent); box-shadow: 0 0 0 3px rgba(47, 125, 225, 0.2);
}
#panel button { background: #fff; color: var(--panel-text); border: 1px solid rgba(15, 23, 42, 0.16); }
#panel button:hover { background: #eef2f7; border-color: rgba(15, 23, 42, 0.28); }

/* Sections */
.section { background: var(--panel-surface); border-color: var(--panel-border); box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06); }
.section > summary::before, .map-tools-chevron, .data-health-chevron {
  border-right-color: #6b7787; border-bottom-color: #6b7787;
}
.section > summary:hover, .data-health > summary:hover, .map-tools > summary:hover { background: rgba(15, 23, 42, 0.04); }
.section[open] > summary, .data-health[open] > summary, .map-tools[open] > summary {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}
.section-icon { color: #1f6fd0; background: rgba(47, 125, 225, 0.10); border-color: rgba(47, 125, 225, 0.25); }

/* Map tools */
.map-tools { background: #fff; border-color: rgba(15, 23, 42, 0.10); }
.map-tools > summary:focus-visible { outline-color: rgba(47, 125, 225, 0.8); }
.map-tools-icon, .map-tool-symbol { color: #5f6b7a; background: rgba(15, 23, 42, 0.06); }
.map-tools[open] .map-tools-icon, .map-tools.has-active .map-tools-icon,
.map-tool-row:has(input:checked) .map-tool-symbol { color: #1f6fd0; background: rgba(47, 125, 225, 0.12); }
.map-tools-count { color: #1f6fd0; background: rgba(47, 125, 225, 0.12); }
#panel label.settings-toggle.map-tool-row:hover { background: rgba(15, 23, 42, 0.04); }

/* Data health */
.data-health { background: #fff; border-color: var(--panel-border); }
.data-health-dot { background: #8a96a5; box-shadow: 0 0 0 3px rgba(138, 150, 165, 0.18); }
.data-health[data-state="ready"] .data-health-dot { background: #1f9d57; box-shadow: 0 0 0 3px rgba(31, 157, 87, 0.16); }
.data-health[data-state="syncing"] .data-health-dot { background: #2f7de1; box-shadow: 0 0 0 3px rgba(47, 125, 225, 0.16); }
.data-health[data-state="degraded"] .data-health-dot, .data-health[data-state="stale"] .data-health-dot {
  background: #d98a0b; box-shadow: 0 0 0 3px rgba(217, 138, 11, 0.18);
}
.data-health[data-state="unavailable"] .data-health-dot { background: #d64545; box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.16); }
.data-health-summary strong, .health-model-head strong { color: #1d2733; }
.data-health-ensemble, .health-area-status, .health-run, .health-note, .health-area-note { color: #4d5967; }
.data-health-ensemble, .health-area-status { background: rgba(15, 23, 42, 0.06); }
.health-run { background: rgba(15, 23, 42, 0.05); }
.health-model { background: #f4f6f9; border-color: rgba(15, 23, 42, 0.10); }
.health-badge { background: #e3e8ee; color: #3b4756; }
.health-badge.ready, .health-area-status.ready { color: #17784a; background: rgba(31, 157, 87, 0.12); }
.health-badge.syncing, .health-area-status.syncing { color: #1d62b8; background: rgba(47, 125, 225, 0.12); }
.health-badge.degraded, .health-badge.stale,
.health-area-status.degraded, .health-area-status.stale, .health-area-status.provisional { color: #8a5a00; background: rgba(217, 138, 11, 0.14); }
.health-badge.unavailable, .health-badge.error,
.health-area-status.unavailable, .health-area-status.error { color: #b02a2a; background: rgba(214, 69, 69, 0.12); }
.health-row span:last-child, .health-area-head { color: #2c3846; }
.health-progress { background: #e3e8ee; }
.health-area { background: rgba(15, 23, 42, 0.03); }
.health-note.warning, .health-area-note.warning { color: #8a5a00; }

/* Layer toggles */
.pane-layer-toggle { background: #fff; border-color: rgba(15, 23, 42, 0.10); }
.pane-layer-toggle:hover { background: #f4f6f9; border-color: rgba(15, 23, 42, 0.20); }
.pane-layer-toggle:has(input:checked) { background: rgba(47, 125, 225, 0.07); border-color: rgba(47, 125, 225, 0.40); }
.pane-layer-toggle-title { color: #1d2733; }
.pane-layer-toggle:has(input:checked) .pane-layer-toggle-title { color: #1d62b8; }
.pane-layer-toggle-sub { color: #5f6b7a; }
.ios-toggle, #panel label.ios-toggle, .ios-toggle.inline-toggle .ios-label { color: #2c3846; }
.ios-slider, .pane-layer-toggle .ios-slider { background: #c3ccd8; border: 1px solid rgba(15, 23, 42, 0.10); }
.ios-slider::before, .pane-layer-toggle .ios-slider::before { background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35); }
.ios-toggle input:checked + .ios-slider, .pane-layer-toggle input:checked + .ios-slider {
  background: #2f7de1; border-color: #2a70cc;
}
.ios-toggle input:focus-visible + .ios-slider, .pane-layer-toggle input:focus-visible + .ios-slider {
  box-shadow: 0 0 0 3px rgba(47, 125, 225, 0.25);
}

/* Filters */
.filter-section { border-top-color: rgba(15, 23, 42, 0.10); }
.filter-section > summary { color: #5f6b7a; }
.filter-section[open] > summary { color: #2c3846; }
.filter-chips .chip-row-label { color: #6b7787; }
#panel .filter-chip { background: #fff; border-color: rgba(15, 23, 42, 0.18); color: #3b4756; }
#panel .filter-chip:hover { background: #eef2f7; border-color: rgba(15, 23, 42, 0.30); }
#panel .filter-chip.active { background: #c98a3a; border-color: #b87820; color: #fff; }
#panel .filter-chip.active:hover { background: #b87820; }

/* Export launch */
.export-launch {
  color: var(--panel-text); border-color: rgba(47, 125, 225, 0.35);
  background: linear-gradient(135deg, rgba(47, 125, 225, 0.12), rgba(47, 125, 225, 0.04));
}
.export-launch small { color: var(--panel-muted); }
.export-launch:hover {
  border-color: rgba(47, 125, 225, 0.6);
  background: linear-gradient(135deg, rgba(47, 125, 225, 0.18), rgba(47, 125, 225, 0.07));
}

/* ---------- Export modal ---------- */
.export-modal { background: rgba(15, 23, 42, 0.38); }
.export-dialog {
  color: var(--panel-text); border-color: rgba(15, 23, 42, 0.14);
  background: #fff; box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}
.export-dialog-header { border-bottom-color: rgba(15, 23, 42, 0.10); }
.export-dialog-kicker { color: #1f6fd0; }
.export-dialog-close { border-color: rgba(15, 23, 42, 0.16); color: #3b4756; background: #f4f6f9; }
.export-choice > p, .export-config-intro { color: #4d5967; }
.export-choice-options button, .export-format-options button {
  border-color: rgba(15, 23, 42, 0.14); color: #1d2733; background: #f4f6f9;
}
.export-choice-options button:hover { border-color: #2f7de1; background: rgba(47, 125, 225, 0.09); }
.export-choice-options small, .export-format-options small, .export-view-hint,
.export-result-heading small, .export-more-actions span { color: #5f6b7a; }
.export-choice-icon { color: #1f6fd0; background: rgba(47, 125, 225, 0.12); }
.export-working-icon { border-color: rgba(47, 125, 225, 0.18); border-top-color: #2f7de1; }
.export-working.is-error .export-working-icon { border-color: rgba(214, 69, 69, 0.35); }
.export-working.is-error .export-working-icon::after { color: #b02a2a; }
.export-working p { color: var(--panel-muted); }
#export-progress { accent-color: #2f7de1; }
.export-format-options button.is-selected {
  border-color: #2f7de1; background: rgba(47, 125, 225, 0.10); box-shadow: inset 0 0 0 1px rgba(47, 125, 225, 0.25);
}
.export-range-controls label, .export-fps-control { color: #3b4756; }
.export-range-controls select, .export-fps-control input { border-color: rgba(15, 23, 42, 0.18); color: #1d2733; background: #fff; }
.export-config-actions button, .export-result-actions button, .export-more-actions button {
  border-color: rgba(15, 23, 42, 0.16); color: #1d2733; background: #fff;
}
#export-go, .export-share-primary { border-color: #2a70cc !important; color: #fff !important; background: #2f7de1 !important; }
.export-result-check { color: #17784a; background: rgba(31, 157, 87, 0.15); }
.export-preview {
  border-color: rgba(15, 23, 42, 0.14);
  background:
    linear-gradient(45deg, #e6ebf1 25%, transparent 25%), linear-gradient(-45deg, #e6ebf1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e6ebf1 75%), linear-gradient(-45deg, transparent 75%, #e6ebf1 75%), #f7f9fb;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px;
}
.export-more-actions { border-top-color: rgba(15, 23, 42, 0.10); }

/* ---------- Status ---------- */
#status { color: #5f6b7a; }
.status-popup-body { color: #fff; background: #c0282f; border-color: rgba(255, 255, 255, 0.22); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25); }

/* ---------- Meteogram ---------- */
.meteogram-panel {
  color: #1d2733; background: rgba(255, 255, 255, 0.97); border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.22);
}
.meteogram-subtitle, .meteogram-time-control, .meteogram-members { color: #5f6b7a; }
.meteogram-status { color: #4d5967; }
.meteogram-status.is-error { color: #b02a2a; }
#meteogram-close, .meteogram-export { border-color: rgba(15, 23, 42, 0.16); color: #1d2733; background: #f4f6f9; }
#meteogram-close:hover, .meteogram-export:hover:not(:disabled) { background: #e6ebf1; }
.meteogram-grid { stroke: rgba(15, 23, 42, 0.10); }
.meteogram-lane-background { fill: rgba(15, 23, 42, 0.03); }
.meteogram-lane-separator { stroke: rgba(15, 23, 42, 0.22); }
.meteogram-baseline { stroke: rgba(15, 23, 42, 0.22); }
.meteogram-axis-time, .meteogram-axis-value { fill: #5f6b7a; }
.meteogram-lane-name { fill: #1d2733; }
.meteogram-wind-arrow { fill: #3b4f68; }
.meteogram-crosshair { stroke: rgba(15, 23, 42, 0.65); }
.meteogram-time-control input { accent-color: #2f7de1; }
.ens-chip, .ens-seg-btn, .ens-step, .ens-none { border-color: rgba(15, 23, 42, 0.18); color: #1d2733; background: #f4f6f9; }
.ens-chip:hover, .ens-seg-btn:hover, .ens-step:hover, .ens-none:hover { background: #e6ebf1; }
.ens-chip[aria-pressed="true"], .ens-seg-btn[aria-pressed="true"] { color: #fff; background: #2f7de1; border-color: #2f7de1; }
.ens-member-label, .ens-legend { color: #5f6b7a; }
.ens-settings-toggle, .ens-info-toggle { border-color: rgba(15, 23, 42, 0.16); color: #1d2733; background: #f4f6f9; }
.ens-settings-toggle[aria-expanded="true"], .ens-info-toggle[aria-expanded="true"] { color: #fff; background: #2f7de1; border-color: #2f7de1; }
@media (max-width: 900px) {
  .ens-toolbar-body { background: #fff; border-color: rgba(15, 23, 42, 0.1); box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2); }
  .ens-mg.settings-open .ens-scrim { background: rgba(15, 23, 42, 0.22); }
  .ens-sheet-sum, .ens-sec-label { color: #6b7685; }
  .ens-mg.show-legend .ens-legend:not([hidden]) { background: #f1f4f8; }
  .ens-reset { color: #2f7de1; }
  .ens-reset:disabled { color: #9aa4b2; }
  .ens-card + .ens-card { border-top-color: rgba(15, 23, 42, 0.08); }
  .meteogram-panel.is-ens .meteogram-detail.is-ens { border-top-color: rgba(15, 23, 42, 0.1); }
}
.ens-ext.is-on { color: #fff; background: #d11fa0; border-color: #d11fa0; }
.ens-member-input { border-color: rgba(15, 23, 42, 0.18); color: #1d2733; background: #fff; }
.ens-card { --ens-card-bg: #fff; }
.ens-grip, .ens-tool, .ens-resize { color: #7b8797; }
.ens-grip:hover, .ens-tool:hover { background: rgba(47, 125, 225, 0.12); color: #2f7de1; }
.ens-card-ph { border-color: #2f7de1; background: rgba(47, 125, 225, 0.06); }
.ens-thr { background: #fff; color: #1d2733; border-color: #e2e8f0; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18); }
.ens-thr-dir, .ens-thr-val { background: #fff; border-color: #e2e8f0; }
.ens-thr-btn, .ens-thr-del { border-color: #e2e8f0; }
.ens-thr-unit, .ens-thr-u, .ens-thr-note { color: #5f6b7a; }
.ens-thr-done, .ens-thr-done:hover:not(:disabled) { color: #fff; }
.ens-card.is-dragging { background: #fff; box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22); }
@media (min-width: 901px) {
  .meteogram-panel.is-ens .ens-card { border-color: rgba(15, 23, 42, 0.12); background: #fff; }
}
.meteogram-detail { color: #2c3846; }
.meteogram-detail strong { color: #0f1824; }
.meteogram-panel.is-loading .meteogram-chart {
  background: linear-gradient(90deg, rgba(15,23,42,0.03), rgba(15,23,42,0.09), rgba(15,23,42,0.03));
  background-size: 220% 100%;
}
@media (max-width: 900px) {
  #panel { box-shadow: 4px 0 18px rgba(15, 23, 42, 0.2) !important; }
  .meteogram-crosshair-handle { fill: #fff; stroke: #2f7de1; }
}

/* ---------- Donation ---------- */
.donation-prompt {
  color: #1d2733; background: rgba(255, 255, 255, 0.98); border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.22);
}
.donation-prompt-icon { color: #9a5b0a; background: rgba(201, 138, 58, 0.18); }
.donation-prompt-copy p { color: #3b4756; }
.donation-prompt-copy small { color: #5f6b7a; }
.donation-prompt-close { color: #5f6b7a; }
.donation-prompt-close:hover { color: #1d2733; background: rgba(15, 23, 42, 0.06); }
.donation-prompt-donate { border-color: #b87820; color: #fff; background: #c98a3a; }
.donation-prompt-donate:hover { background: #b87820; }
.donation-prompt-actions button { border-color: rgba(15, 23, 42, 0.16); color: #3b4756; background: #fff; }
.donation-prompt-actions button:hover { color: #1d2733; background: #eef2f7; }
#donation-prompt-never { border-color: transparent; background: transparent; color: #6b7787; }
.donation-toast {
  border-color: rgba(15, 23, 42, 0.14); color: #1d2733; background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
}
