* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: -webkit-fill-available; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a2332; color: #e2e8f0;
  min-height: 100vh; min-height: -webkit-fill-available;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  overflow: hidden;
  touch-action: manipulation;
}

[x-cloak] { display: none !important; }

/* ─── Header & Navbar ─── */
#header {
  background: linear-gradient(135deg, #1e293b 0%, #1a2332 100%);
  padding: 0 24px;
  display: flex; align-items: stretch; gap: 0; flex-wrap: wrap;
  border-bottom: 1px solid #334155;
  height: 48px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  padding-right: 24px; border-right: 1px solid #334155;
}
.nav-brand h1 { font-size: 1.1rem; font-weight: 600; white-space: nowrap; }
.nav-tabs { display: flex; align-items: stretch; gap: 0; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  display: flex; align-items: center; padding: 0 18px;
  font-size: 0.82rem; color: #64748b; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s; text-decoration: none; user-select: none;
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: inherit;
}
.nav-tab:hover { color: #94a3b8; background: rgba(255,255,255,0.03); }
.nav-tab.active { color: #60a5fa; border-bottom-color: #60a5fa; }
.header-status { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.station-count { font-size: 0.75rem; color: #64748b; }
.refresh-btn {
  background: #334155; border: none; color: #94a3b8; padding: 4px 10px;
  border-radius: 6px; cursor: pointer; font-size: 0.75rem;
}
.refresh-btn:hover { background: #475569; color: #e2e8f0; }
.last-refresh { font-size: 0.65rem; color: #475569; }

/* ─── Filter bar (live view) ─── */
#filters {
  background: #1e293b; padding: 8px 24px; display: flex; gap: 8px; align-items: center;
  border-bottom: 1px solid #334155; flex-wrap: wrap;
}
#filters .filter-group { display: flex; gap: 6px; align-items: center; }
#filters .separator { width: 1px; height: 20px; background: #334155; margin: 0 8px; }
#filters label { font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-right: 2px; }
.filter-chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px; font-size: 0.72rem;
  border: 1px solid #475569; background: transparent; color: #94a3b8;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.filter-chip:hover { border-color: #64748b; color: #e2e8f0; }
.filter-chip.active { background: #334155; border-color: #60a5fa; color: #60a5fa; }
.filter-chip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ─── Views ─── */
.view { display: none; position: relative; overflow: hidden; }
.view.active { display: block; }

.map-container { height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); width: 100%; }
#live-view .map-container { height: calc(100dvh - 48px - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); } /* header + filters */

/* ─── Tooltips ─── */
.leaflet-tooltip {
  background: rgba(15, 23, 42, 0.92); color: #e2e8f0;
  border: 1px solid #334155; border-radius: 6px;
  font-size: 0.75rem; font-weight: 500; padding: 4px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3); backdrop-filter: blur(8px);
}
.leaflet-tooltip-top:before { border-top-color: rgba(15, 23, 42, 0.92); }
.leaflet-tooltip-bottom:before { border-bottom-color: rgba(15, 23, 42, 0.92); }
.leaflet-tooltip-left:before { border-left-color: rgba(15, 23, 42, 0.92); }
.leaflet-tooltip-right:before { border-right-color: rgba(15, 23, 42, 0.92); }
body[data-theme="light"] .leaflet-tooltip { background: rgba(255,255,255,0.95); color: #1e293b; border-color: #e2e8f0; }
body[data-theme="light"] .leaflet-tooltip-top:before { border-top-color: rgba(255,255,255,0.95); }
body[data-theme="light"] .leaflet-tooltip-bottom:before { border-bottom-color: rgba(255,255,255,0.95); }

/* ─── Popups ─── */
.leaflet-popup-content-wrapper {
  background: #1e293b; color: #e2e8f0; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); min-width: 280px;
  border: 1px solid #334155;
}
.leaflet-popup-tip { background: #1e293b; }
.leaflet-popup-content { margin: 0; padding: 0; }

.station-popup { padding: 16px; }
.station-popup .popup-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.station-popup h3 { font-size: 1rem; margin-bottom: 0; color: #f8fafc; flex: 1; min-width: 0; }
.station-popup .provider-badge {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 2px 8px; border-radius: 10px; font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.3px; white-space: nowrap;
}
.station-popup .provider-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.station-popup .meta { font-size: 0.72rem; color: #64748b; margin-bottom: 12px; }
.station-popup .freshness-indicator { font-size: 0.65rem; color: #94a3b8; }
.station-popup .loading { text-align: center; padding: 20px; color: #64748b; }
.station-popup .error { text-align: center; padding: 12px; color: #f87171; font-size: 0.85rem; }
.station-popup .stale { font-size: 0.65rem; color: #f59e0b; margin-bottom: 8px; }

.weather-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.weather-card {
  background: #1a2332; border-radius: 8px; padding: 10px; text-align: center;
  border: 1px solid #334155;
}
.weather-card .label { font-size: 0.65rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.weather-card .value { font-size: 1.3rem; font-weight: 700; margin-top: 2px; }
.weather-card .unit { font-size: 0.7rem; color: #94a3b8; }

.weather-card.temp .value { color: #fb923c; }
.weather-card.wind .value { color: #38bdf8; }
.weather-card.gust .value { color: #f87171; }
.weather-card.humidity .value { color: #34d399; }
.weather-card.pressure .value { color: #a78bfa; }
.weather-card.rain .value { color: #60a5fa; }
.weather-card.direction .value { color: #fbbf24; }

.timestamp { font-size: 0.7rem; color: #475569; margin-top: 10px; text-align: center; }
.wind-arrow { display: inline-block; font-size: 1.4rem; }
.ext-link {
  display: inline-block; background: #334155; color: #93c5fd;
  padding: 5px 10px; border-radius: 6px; font-size: 0.72rem;
  text-decoration: none; margin-top: 10px;
}
.ext-link:hover { background: #475569; }

/* ─── Legend ─── */
.legend {
  background: #1e293b; padding: 10px 14px; border-radius: 8px;
  border: 1px solid #334155; font-size: 0.72rem; line-height: 1.6;
  margin-bottom: 8px !important;
}
.legend h4 { margin-bottom: 4px; color: #94a3b8; }
.legend-row { display: flex; align-items: center; gap: 4px; margin: 2px 0; }
.legend-arrow { width: 16px; text-align: center; font-size: 0.85rem; }
.legend-bar {
  height: 10px; border-radius: 3px; margin: 4px 0;
  background: linear-gradient(to right, transparent, #1e3a4a, #00ff00, #fff000, #ff322c, #ff0ac8, #ff00ff, #9632ff, #3c3cff);
}
.legend-bar.legend-wind {
  background: linear-gradient(to right, transparent, #1e3a4a, #00ff00, #fff000, #ff322c, #ff0ac8, #ff00ff, #9632ff, #3c3cff);
}
.legend-bar.legend-rain {
  background: linear-gradient(to right, transparent, #78b4f0, #3264ff, #143cb4, #0a1eb4, #a028dc, #dc1450);
}
.legend-bar.legend-temp {
  background: linear-gradient(to right, #1428b4, #2850dc, #508cff, #78d2ff, #8cf098, #78ff78, #c8ff50, #fff032, #ffb41e, #ff6414, #e6280a, #b4001e);
}
.legend-bar.legend-clouds {
  background: linear-gradient(to right, transparent, #c0c3cd, #b4b9c8, #aab0be, #a0a5b0, #8c8c96);
}
.legend-labels { display: flex; justify-content: space-between; font-size: 0.6rem; color: #64748b; }

/* ─── Forecast controls ─── */
#forecast-controls {
  background: #1e293b; padding: 8px 24px; display: flex; gap: 10px; align-items: center;
  border-bottom: 1px solid #334155; flex-wrap: wrap;
}
#forecast-controls label { font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
#variable-select { font-weight: 600; }
#forecast-controls select {
  background: #334155; color: #e2e8f0; border: 1px solid #475569;
  padding: 4px 10px; border-radius: 6px; font-size: 0.78rem; font-family: inherit;
  cursor: pointer;
}
#forecast-controls select:hover { border-color: #64748b; }
#forecast-status { font-size: 0.75rem; color: #64748b; margin-left: auto; }

.theme-toggle-btn {
  background: #334155; border: 1px solid #475569; color: #94a3b8;
  padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 1rem;
  font-family: inherit; margin-left: auto; flex-shrink: 0;
}
.theme-toggle-btn:hover { border-color: #64748b; color: #e2e8f0; }
.reload-btn {
  background: #334155; border: 1px solid #475569; color: #94a3b8;
  padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 1rem;
  font-family: inherit; margin-left: 4px; flex-shrink: 0;
}
.reload-btn:hover { border-color: #64748b; color: #e2e8f0; }
#forecast-controls .theme-toggle-btn { margin-left: 0; }
.settings-toggle {
  background: #334155; border: 1px solid #475569; color: #94a3b8;
  padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 1rem;
  font-family: inherit; margin-left: 8px;
}
.settings-toggle:hover { border-color: #64748b; color: #e2e8f0; }

/* ─── Settings panel ─── */
.settings-panel {
  position: fixed; top: 100px; right: 10px; z-index: 1100;
  background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(12px);
  border: 1px solid #334155; border-radius: 10px;
  padding: 16px; width: 280px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.settings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.settings-header h4 { font-size: 0.85rem; color: #e2e8f0; }
.settings-close {
  background: none; border: none; color: #64748b; font-size: 1.2rem; cursor: pointer;
}
.settings-close:hover { color: #e2e8f0; }
.settings-section { margin-bottom: 14px; }
.settings-section h5 { font-size: 0.7rem; color: #60a5fa; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.setting-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.setting-row label { font-size: 0.7rem; color: #94a3b8; width: 70px; flex-shrink: 0; }
.setting-row input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px; background: #334155; outline: none;
}
.setting-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: #60a5fa; cursor: pointer;
}
.setting-row input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; background: #60a5fa;
  cursor: pointer; border: none;
}
.setting-value { font-size: 0.65rem; color: #64748b; width: 36px; text-align: right; }

/* Unit toggle buttons */
.unit-buttons {
  display: flex; gap: 0; border: 1px solid #475569; border-radius: 4px; overflow: hidden;
}
.unit-buttons .unit-btn {
  border: none; border-radius: 0; padding: 2px 10px;
  font-size: 0.7rem; background: transparent; color: #64748b; cursor: pointer;
}
.unit-buttons .unit-btn + .unit-btn { border-left: 1px solid #475569; }
.unit-buttons .unit-btn.active { background: #475569; color: #60a5fa; }
.unit-buttons .unit-btn:hover:not(.active) { color: #94a3b8; }

/* ─── Timeline bar (scrolling style) ─── */
#timeline-bar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.92); backdrop-filter: blur(8px);
  border-top: 1px solid #334155; padding: 6px 16px 10px;
  touch-action: pan-x;
}
.timeline-top-row {
  position: relative; display: flex; align-items: center; margin-bottom: 4px;
}
.timeline-top-row .time-display {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 8px;
}
#timeline-bar .current-time { font-size: 1rem; font-weight: 600; color: #f8fafc; }
#timeline-bar .time-range { font-size: 0.7rem; color: #64748b; margin-left: auto; }

/* Scrolling timeline area */
.timeline-scroll-area {
  position: relative;
  height: 50px;
  margin-bottom: 6px;
}
.timeline-cursor {
  position: absolute;
  left: var(--cursor-offset, 145px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: #60a5fa;
  z-index: 10;
  box-shadow: 0 0 6px rgba(96, 165, 250, 0.6);
  pointer-events: none;
}
.timeline-scroll-track {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  cursor: grab;
}
.timeline-scroll-track:active { cursor: grabbing; }
.timeline-scroll-content {
  position: absolute;
  top: 0;
  height: 100%;
  white-space: nowrap;
  /* width set dynamically */
}
.tl-now-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}
body[data-theme="light"] .tl-now-marker { background: rgba(0, 0, 0, 0.2); }
.tl-tick {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
}
.tl-tick .tl-date {
  font-size: 0.58rem;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
  margin-bottom: 1px;
  padding-top: 4px;
}
.tl-tick .tl-hour {
  font-size: 0.58rem;
  color: #64748b;
  white-space: nowrap;
  margin-bottom: 1px;
  line-height: 1.4;
}
.tl-tick .tl-line {
  width: 1px;
  height: 8px;
  background: #475569;
}

/* Controls row */
.controls-row { display: flex; align-items: center; gap: 8px; justify-content: center; }
.ctrl-btn {
  background: #334155; border: 1px solid #475569; color: #94a3b8;
  padding: 2px 10px; border-radius: 4px; cursor: pointer; font-size: 0.75rem;
  font-family: inherit; flex-shrink: 0;
}
.ctrl-btn:hover { border-color: #64748b; color: #e2e8f0; }
.ctrl-btn.active { background: #475569; border-color: #60a5fa; color: #60a5fa; }

/* ─── Loading overlay ─── */
.loading-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 999;
  background: rgba(15, 23, 42, 0.7); display: flex; align-items: center;
  justify-content: center; flex-direction: column; gap: 12px;
}
.loading-overlay .spinner {
  width: 40px; height: 40px; border: 3px solid #334155;
  border-top-color: #60a5fa; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay .loading-text { font-size: 0.85rem; color: #94a3b8; }

/* ─── Forecast wind legend ─── */
.forecast-legend {
  background: #1e293b; padding: 10px 14px; border-radius: 8px;
  border: 1px solid #334155; font-size: 0.72rem; line-height: 1.6;
  margin-bottom: 110px !important; /* clear the timeline bar */
  min-width: 0; /* match live legend sizing */
}
.forecast-legend h4 { margin-bottom: 4px; color: #94a3b8; }
.forecast-legend .legend-bar { height: 10px; border-radius: 3px; margin: 4px 0; }
.forecast-legend .legend-labels { display: flex; justify-content: space-between; font-size: 0.6rem; color: #64748b; }

/* ─── Forecast popup ─── */
.forecast-popup { padding: 14px; }
.forecast-popup h3 { font-size: 0.9rem; margin-bottom: 8px; color: #f8fafc; }
.forecast-popup-meta { font-size: 0.72rem; color: #94a3b8; margin-bottom: 10px; }
.forecast-popup-run { color: #64748b; }

/* ─── Panel views (Settings, Data Management) ─── */
.panel-view {
  max-width: 600px; margin: 0 auto; padding: 24px 16px;
  height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto; overflow-x: hidden;
}
.panel-card {
  background: #1e293b; border: 1px solid #334155; border-radius: 12px;
  padding: 20px; margin-bottom: 16px;
}
.panel-card h3 {
  font-size: 0.85rem; color: #94a3b8; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 1px solid #334155;
}
.panel-subsection {
  font-size: 0.72rem; color: #64748b; text-transform: uppercase;
  letter-spacing: 0.4px; margin: 16px 0 4px; padding-top: 12px;
  border-top: 1px solid #334155;
}
.panel-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
}
.panel-row + .panel-row { border-top: 1px solid rgba(51, 65, 85, 0.5); }
.panel-row label { font-size: 0.8rem; color: #cbd5e1; }

/* Toggle button groups */
.toggle-group { display: flex; gap: 0; }
.toggle-btn {
  background: #1a2332; border: 1px solid #334155; color: #64748b;
  padding: 5px 14px; font-size: 0.75rem; cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}
.toggle-btn:first-child { border-radius: 6px 0 0 6px; }
.toggle-btn:last-child { border-radius: 0 6px 6px 0; }
.toggle-btn:not(:first-child) { border-left: none; }
.toggle-btn:hover { color: #94a3b8; }
.toggle-btn.active { background: #334155; color: #60a5fa; border-color: #60a5fa; }
.toggle-btn.active + .toggle-btn { border-left-color: #60a5fa; }

/* Panel select dropdown */
.panel-select {
  background: #1a2332; color: #e2e8f0; border: 1px solid #334155;
  padding: 6px 12px; border-radius: 6px; font-size: 0.8rem;
  font-family: inherit; cursor: pointer;
}
.panel-select:hover { border-color: #64748b; }

/* Panel number input */
.panel-input {
  background: #1a2332; color: #e2e8f0; border: 1px solid #334155;
  padding: 5px 10px; border-radius: 6px; font-size: 0.8rem;
  font-family: inherit; width: 72px; text-align: right;
  -moz-appearance: textfield;
}
.panel-input::-webkit-inner-spin-button,
.panel-input::-webkit-outer-spin-button { opacity: 0.4; }
.panel-input:hover { border-color: #64748b; }
.panel-input:focus { outline: none; border-color: #60a5fa; }
.panel-input-group { display: flex; align-items: center; gap: 6px; }
.panel-input-unit { font-size: 0.75rem; color: #64748b; }

/* About section */
.about-text { font-size: 0.8rem; line-height: 1.8; }
.about-text p { margin: 0; }
.about-text .dim { color: #64748b; font-size: 0.72rem; }
.about-text a { color: #60a5fa; text-decoration: none; }
.about-text a:hover { text-decoration: underline; }

/* Feedback form */
.feedback-form { display: flex; flex-direction: column; gap: 8px; }
.feedback-form input,
.feedback-form textarea {
  background: #1a2332; border: 1px solid #334155; color: #e2e8f0;
  border-radius: 6px; padding: 7px 10px; font-size: 0.82rem;
  font-family: inherit; outline: none; resize: vertical;
}
.feedback-form input:focus,
.feedback-form textarea:focus { border-color: #60a5fa; }
.feedback-form input::placeholder,
.feedback-form textarea::placeholder { color: #475569; }
.feedback-actions { display: flex; align-items: center; gap: 10px; }
.feedback-status { font-size: 0.75rem; color: #64748b; }
.feedback-status.success { color: #4ade80; }
.feedback-status.error { color: #f87171; }
body[data-theme="light"] .feedback-form input,
body[data-theme="light"] .feedback-form textarea {
  background: #f8fafc; border-color: #e2e8f0; color: #1e293b;
}

/* Feedback modal overlay */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.modal-content {
  background: #1e293b; border: 1px solid #334155;
  border-radius: 12px; padding: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.modal-content h3 { margin: 0 0 12px; font-size: 1rem; color: #e2e8f0; }
body[data-theme="light"] .modal-content {
  background: #ffffff; border-color: #e2e8f0;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
body[data-theme="light"] .modal-content h3 { color: #1e293b; }

/* Data sources list */
.data-sources-list { display: flex; flex-direction: column; gap: 12px; }
.source-row {
  padding: 10px 12px; background: #1a2332; border-radius: 8px;
  border: 1px solid #1e293b;
}
.source-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.source-name { font-size: 0.8rem; color: #e2e8f0; font-weight: 500; }
.source-meta { font-size: 0.68rem; color: #64748b; margin-left: auto; }
.source-detail { font-size: 0.68rem; color: #475569; padding-left: 20px; }
.source-error { font-size: 0.68rem; color: #f87171; padding-left: 20px; margin-top: 4px; }

/* ─── Provider breakdown (inside source-row for winds.mobi) ─── */
.provider-breakdown {
  margin-top: 8px; padding: 8px 10px;
  background: #111827; border-radius: 6px;
  border: 1px solid #1e2d3d;
}
.provider-breakdown-header {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
}
.provider-breakdown-title { font-size: 0.68rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.provider-breakdown-count { font-size: 0.65rem; color: #475569; margin-left: auto; }
.provider-breakdown-toggle { font-size: 0.6rem; color: #475569; }
.provider-list { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.provider-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.provider-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.provider-name { font-size: 0.7rem; color: #cbd5e1; flex: 1; }
.provider-count { font-size: 0.65rem; color: #475569; }
.provider-cache-note { font-size: 0.62rem; color: #334155; margin-top: 4px; font-style: italic; }

body[data-theme="light"] .provider-breakdown { background: #f8fafc; border-color: #e2e8f0; }
body[data-theme="light"] .provider-name { color: #334155; }
body[data-theme="light"] .provider-count { color: #94a3b8; }
body[data-theme="light"] .provider-breakdown-count { color: #94a3b8; }

.source-refresh-btn {
  background: none; border: 1px solid #334155; color: #64748b;
  border-radius: 4px; padding: 1px 5px; font-size: 0.78rem; line-height: 1.4;
  cursor: pointer; margin-left: 6px; flex-shrink: 0; transition: color 0.15s, border-color 0.15s;
}
.source-refresh-btn:hover { color: #94a3b8; border-color: #475569; }
.source-refresh-btn:disabled { opacity: 0.45; cursor: default; }
.source-refresh-btn.source-refresh-loading { color: #60a5fa; border-color: #60a5fa; }
.source-archive-btn {
  background: none; border: 1px solid #334155; color: #64748b;
  border-radius: 4px; padding: 1px 5px; font-size: 0.78rem; line-height: 1.4;
  cursor: pointer; margin-left: 4px; flex-shrink: 0; transition: color 0.15s, border-color 0.15s;
}
.source-archive-btn:hover { color: #a78bfa; border-color: #7c3aed; }
.source-archive-btn:disabled { opacity: 0.45; cursor: default; }
.source-archive-btn.source-refresh-loading { color: #a78bfa; border-color: #7c3aed; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.status-ok { background: #34d399; }
.status-error { background: #f87171; }
.status-idle { background: #475569; }
.status-fresh { background: #60a5fa; }
.status-aging { background: #34d399; }
.status-stale { background: #f87171; }
.status-fetching { background: #60a5fa; animation: pulse-dot 1s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.status-error-text { color: #f87171; font-size: 0.75rem; }

/* Region info */
.region-detail { font-size: 0.8rem; }
.region-name { color: #e2e8f0; font-weight: 500; margin-bottom: 4px; }
.region-coords { font-size: 0.72rem; color: #64748b; }

/* ─── Light theme ─── */
body[data-theme="light"] { background: #f1f5f9; color: #1e293b; }
body[data-theme="light"] #header { background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%); border-bottom-color: #cbd5e1; }
body[data-theme="light"] .nav-brand h1 { color: #1e293b; }
body[data-theme="light"] .nav-brand { border-right-color: #cbd5e1; }
body[data-theme="light"] .nav-tab { color: #64748b; }
body[data-theme="light"] .nav-tab.active { color: #2563eb; border-bottom-color: #2563eb; }
body[data-theme="light"] .nav-tab:hover { color: #475569; background: rgba(0,0,0,0.03); }
body[data-theme="light"] .refresh-btn { background: #cbd5e1; color: #475569; }
body[data-theme="light"] #filters { background: #e2e8f0; border-bottom-color: #cbd5e1; }
body[data-theme="light"] .filter-chip { border-color: #94a3b8; color: #475569; }
body[data-theme="light"] .filter-chip.active { background: #cbd5e1; border-color: #2563eb; color: #2563eb; }
body[data-theme="light"] #forecast-controls { background: #e2e8f0; border-bottom-color: #cbd5e1; }
body[data-theme="light"] #forecast-controls select { background: #cbd5e1; color: #1e293b; border-color: #94a3b8; }
body[data-theme="light"] .theme-toggle-btn { background: #cbd5e1; border-color: #94a3b8; color: #475569; }
body[data-theme="light"] .reload-btn { background: #cbd5e1; border-color: #94a3b8; color: #475569; }
body[data-theme="light"] .settings-toggle { background: #cbd5e1; border-color: #94a3b8; color: #475569; }
body[data-theme="light"] #timeline-bar { background: rgba(241, 245, 249, 0.95); border-top-color: #cbd5e1; }
body[data-theme="light"] #timeline-bar .current-time { color: #1e293b; }
body[data-theme="light"] .ctrl-btn { background: #cbd5e1; color: #475569; border-color: #94a3b8; }
body[data-theme="light"] .ctrl-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }
body[data-theme="light"] .panel-card { background: #fff; border-color: #e2e8f0; }
body[data-theme="light"] .panel-card h3 { color: #475569; border-bottom-color: #e2e8f0; }
body[data-theme="light"] .panel-subsection { color: #94a3b8; border-top-color: #e2e8f0; }
body[data-theme="light"] .panel-row label { color: #334155; }
body[data-theme="light"] .toggle-btn { background: #f8fafc; border-color: #cbd5e1; color: #64748b; }
body[data-theme="light"] .toggle-btn.active { background: #dbeafe; color: #2563eb; border-color: #2563eb; }
body[data-theme="light"] .panel-select { background: #f8fafc; color: #1e293b; border-color: #cbd5e1; }
body[data-theme="light"] .panel-input { background: #f8fafc; color: #1e293b; border-color: #cbd5e1; }
body[data-theme="light"] .panel-input-unit { color: #94a3b8; }
body[data-theme="light"] .source-row { background: #f8fafc; border-color: #e2e8f0; }
body[data-theme="light"] .source-name { color: #1e293b; }
body[data-theme="light"] .source-refresh-btn { border-color: #cbd5e1; color: #94a3b8; }
body[data-theme="light"] .source-refresh-btn:hover { border-color: #94a3b8; color: #475569; }
body[data-theme="light"] .source-archive-btn { border-color: #cbd5e1; color: #94a3b8; }
body[data-theme="light"] .source-archive-btn:hover { border-color: #7c3aed; color: #7c3aed; }
body[data-theme="light"] .legend, body[data-theme="light"] .forecast-legend { background: #fff; border-color: #e2e8f0; }
body[data-theme="light"] .legend h4, body[data-theme="light"] .forecast-legend h4 { color: #475569; }
body[data-theme="light"] .legend-bar:not(.legend-rain):not(.legend-temp):not(.legend-clouds) {
  background: linear-gradient(to right, transparent, #67f7f1, #00ff00, #fff000, #ff322c, #ff0ac8, #ff00ff, #9632ff, #3c3cff) !important;
}
body[data-theme="light"] .legend-bar.legend-wind {
  background: linear-gradient(to right, transparent, #67f7f1, #00ff00, #fff000, #ff322c, #ff0ac8, #ff00ff, #9632ff, #3c3cff) !important;
}
body[data-theme="light"] .settings-panel { background: #fff; border-color: #e2e8f0; }
body[data-theme="light"] .settings-section h5 { color: #475569; }
body[data-theme="light"] .loading-overlay { background: rgba(241, 245, 249, 0.9); }
body[data-theme="light"] .leaflet-popup-content-wrapper { background: #f8fafc; color: #1e293b; border-color: #e2e8f0; }
body[data-theme="light"] .leaflet-popup-tip { background: #f8fafc; }
body[data-theme="light"] .station-popup h3, body[data-theme="light"] .forecast-popup h3 { color: #1e293b; }
body[data-theme="light"] .weather-card { background: #ffffff; border-color: #e2e8f0; }
body[data-theme="light"] .weather-card .label { color: #64748b; }
body[data-theme="light"] .weather-card .unit { color: #94a3b8; }
body[data-theme="light"] .weather-card .value { color: #334155; }
body[data-theme="light"] .weather-card.temp .value { color: #c2410c; }
body[data-theme="light"] .weather-card.wind .value { color: #0369a1; }
body[data-theme="light"] .weather-card.gust .value { color: #dc2626; }
body[data-theme="light"] .weather-card.humidity .value { color: #059669; }
body[data-theme="light"] .weather-card.pressure .value { color: #7c3aed; }
body[data-theme="light"] .weather-card.rain .value { color: #2563eb; }
body[data-theme="light"] .weather-card.direction .value { color: #d97706; }
body[data-theme="light"] .station-popup .meta { color: #64748b; }
body[data-theme="light"] .station-popup .meta .provider { background: #e2e8f0; color: #334155; }
body[data-theme="light"] .station-popup .stale { color: #b45309; }
body[data-theme="light"] .station-popup .loading { color: #475569; }
body[data-theme="light"] .ext-link { background: #e2e8f0; color: #1d4ed8; }
body[data-theme="light"] .ext-link:hover { background: #cbd5e1; }
body[data-theme="light"] .forecast-popup-meta { color: #475569; }
body[data-theme="light"] .forecast-popup-run { color: #64748b; }
body[data-theme="light"] .timestamp { color: #64748b; }

/* ─── Session view ─── */
.layer-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 0; cursor: pointer; font-size: 0.78rem; color: #cbd5e1;
}
.layer-toggle input[type="checkbox"] {
  accent-color: #60a5fa; width: 14px; height: 14px; cursor: pointer;
}
.layer-panel-divider {
  border-top: 1px solid #334155; margin: 8px 0 6px;
}
.wind-gust-toggle-row {
  display: flex; gap: 0; border: 1px solid #334155; border-radius: 4px; overflow: hidden;
}
.wind-gust-btn {
  flex: 1; background: transparent; border: none; color: #64748b;
  padding: 3px 8px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.5px;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.wind-gust-btn + .wind-gust-btn { border-left: 1px solid #334155; }
.wind-gust-btn:hover { color: #94a3b8; }
.wind-gust-btn.active { background: #334155; color: #60a5fa; }

/* Session controls bar (like forecast view) */
#session-controls {
  background: #1e293b; padding: 8px 24px; display: flex; gap: 10px; align-items: center;
  border-bottom: 1px solid #334155;
}
#session-controls select {
  background: #334155; color: #e2e8f0; border: 1px solid #475569;
  padding: 4px 10px; border-radius: 6px; font-size: 0.78rem; font-family: inherit;
  cursor: pointer;
}
#session-controls select:hover { border-color: #64748b; }
#session-controls .theme-toggle-btn { margin-left: auto; }
.session-ctrl-btn {
  background: #334155; border: 1px solid #475569; color: #94a3b8;
  padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 1rem;
  font-family: inherit; margin-left: 4px; flex-shrink: 0;
}
.session-ctrl-btn:hover { border-color: #64748b; color: #e2e8f0; }
.session-icon-btn { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; }
body[data-theme="light"] .session-ctrl-btn { background: #cbd5e1; border-color: #94a3b8; color: #475569; }
body[data-theme="light"] #session-controls { background: #e2e8f0; border-bottom-color: #cbd5e1; }
body[data-theme="light"] #session-controls select { background: #cbd5e1; color: #1e293b; border-color: #94a3b8; }

/* Session spot banner (top center) */
.session-spot-banner {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1100;
  background: rgba(15, 23, 42, 0.88); backdrop-filter: blur(12px);
  border: 1px solid #334155; border-radius: 20px;
  padding: 6px 18px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
  pointer-events: auto; cursor: pointer; white-space: nowrap;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.session-spot-banner.active {
  border-color: #60a5fa;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.3), 0 2px 12px rgba(0,0,0,0.35);
}
.session-spot-name {
  font-size: 0.85rem; font-weight: 700; color: #f1f5f9;
  letter-spacing: 0.3px;
}
.session-spot-time {
  font-size: 0.68rem; font-weight: 600; color: #64748b;
  letter-spacing: 0.3px;
}

/* Session corner mini-boxes */
.session-corner-box {
  position: absolute; z-index: 1100;
  background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(10px);
  border: 1px solid #334155; border-radius: 10px;
  padding: 10px 14px; width: 100px; height: 76px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  text-align: center;
  display: flex; flex-direction: column; justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.session-corner-box.active {
  border-color: #60a5fa;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.3), 0 2px 12px rgba(0,0,0,0.3);
}
.corner-top-left     { top: 10px; left: 10px; }
.corner-top-right    { top: 10px; right: 10px; }
.corner-bottom-left  { left: 10px; }
.corner-bottom-right { right: 10px; }

.corner-label {
  font-size: 0.6rem; color: #64748b; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 4px;
}
.corner-value {
  font-size: 1.3rem; font-weight: 700; color: #e2e8f0; line-height: 1.2;
}
.corner-sub {
  font-size: 0.65rem; color: #94a3b8; margin-top: 4px;
}
.corner-sub span { font-weight: 600; color: #cbd5e1; }

/* Corner-specific value colors */
.corner-top-left .corner-value { color: #38bdf8; }
.corner-top-right .corner-value { color: #fbbf24; }
.corner-bottom-left .corner-value { color: #fb923c; }
.corner-bottom-right .corner-value { color: #60a5fa; }

/* Light theme */
body[data-theme="light"] .session-spot-banner {
  background: rgba(255,255,255,0.9); border-color: #e2e8f0;
}
body[data-theme="light"] .session-spot-name { color: #1e293b; }
body[data-theme="light"] .session-spot-banner.active {
  border-color: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.2), 0 2px 8px rgba(0,0,0,0.1);
}
body[data-theme="light"] .session-corner-box {
  background: rgba(255,255,255,0.9); border-color: #e2e8f0;
}
body[data-theme="light"] .corner-value { color: #334155; }
body[data-theme="light"] .corner-label { color: #64748b; }
body[data-theme="light"] .corner-sub { color: #64748b; }
body[data-theme="light"] .corner-sub span { color: #334155; }
body[data-theme="light"] .corner-top-left .corner-value { color: #0369a1; }
body[data-theme="light"] .corner-top-right .corner-value { color: #d97706; }
body[data-theme="light"] .corner-bottom-left .corner-value { color: #c2410c; }
body[data-theme="light"] .corner-bottom-right .corner-value { color: #2563eb; }
body[data-theme="light"] .session-corner-box.active {
  border-color: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.2), 0 2px 8px rgba(0,0,0,0.1);
}

/* Station mini popup */
.station-mini-popup {
  position: absolute; z-index: 1200;
  background: rgba(15, 23, 42, 0.92); backdrop-filter: blur(12px);
  border: 1px solid #334155; border-radius: 10px;
  padding: 10px 14px; min-width: 110px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  text-align: center; pointer-events: auto;
}
.mini-popup-close {
  position: absolute; top: 4px; right: 6px;
  background: none; border: none; color: #64748b;
  cursor: pointer; font-size: 0.8rem; padding: 2px;
}
.mini-popup-close:hover { color: #e2e8f0; }
.mini-popup-name {
  font-size: 0.7rem; color: #94a3b8; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px;
}
.mini-popup-wind { font-size: 1.2rem; font-weight: 700; color: #38bdf8; line-height: 1.2; }
.mini-popup-dir { font-size: 0.85rem; color: #fbbf24; margin: 2px 0; }
.mini-popup-gust { font-size: 0.65rem; color: #94a3b8; }
body[data-theme="light"] .station-mini-popup { background: rgba(255,255,255,0.92); border-color: #e2e8f0; }
body[data-theme="light"] .mini-popup-name { color: #475569; }
body[data-theme="light"] .mini-popup-wind { color: #0369a1; }
body[data-theme="light"] .mini-popup-dir { color: #d97706; }
body[data-theme="light"] .mini-popup-gust { color: #475569; }

/* Session summary / Go-No-Go panel */
.session-summary {
  position: absolute; top: 10px; right: 10px; z-index: 1100;
  background: rgba(15, 23, 42, 0.92); backdrop-filter: blur(12px);
  border: 1px solid #334155; border-radius: 10px;
  padding: 10px 14px; min-width: 200px; max-width: 280px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.summary-header {
  display: flex; align-items: center; gap: 10px;
}
.go-indicator {
  width: 14px; height: 14px; border-radius: 50%;
  background: #475569; flex-shrink: 0;
}
.go-indicator.go-go { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.5); }
.go-indicator.go-marginal { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }
.go-indicator.go-nogo { background: #f87171; box-shadow: 0 0 8px rgba(248, 113, 113, 0.5); }
.go-label {
  font-size: 0.85rem; font-weight: 700; color: #e2e8f0;
}
.summary-expand-btn {
  background: none; border: none; color: #64748b; cursor: pointer;
  font-size: 0.7rem; margin-left: auto; padding: 2px 4px;
}
.summary-expand-btn:hover { color: #94a3b8; }
.summary-details { margin-top: 10px; }
.summary-station {
  font-size: 0.75rem; color: #94a3b8; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid #334155;
}
.summary-conditions { margin-bottom: 8px; }
.cond-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.72rem; color: #cbd5e1; padding: 2px 0;
}
.cond-row span { color: #64748b; }
.cond-row strong { color: #e2e8f0; }
.cond-divider {
  font-size: 0.62rem; color: #60a5fa; text-transform: uppercase;
  letter-spacing: 0.5px; margin: 6px 0 4px; padding-top: 6px;
  border-top: 1px solid #334155;
}
.summary-reasons { margin-bottom: 8px; }
.reason-row {
  font-size: 0.68rem; color: #fbbf24; padding: 1px 0;
}
.go-go ~ .summary-details .reason-row { color: #34d399; }
.summary-thresholds { border-top: 1px solid #334155; padding-top: 8px; }
.summary-thresholds h5 {
  font-size: 0.62rem; color: #64748b; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
}
.threshold-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.threshold-row label {
  font-size: 0.68rem; color: #94a3b8; width: 65px; flex-shrink: 0;
}
.thresh-input {
  background: #1a2332; border: 1px solid #334155; color: #e2e8f0;
  border-radius: 4px; padding: 2px 6px; font-size: 0.72rem;
  width: 55px; font-family: inherit;
}
.thresh-input:focus { border-color: #60a5fa; outline: none; }
.thresh-unit { font-size: 0.62rem; color: #475569; }

/* ── Atmospheric cross-section slice ── */
.session-atmo-slice {
  position: absolute;
  left: 0;
  right: 0;
  height: 162px;
  display: flex;
  flex-direction: row;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border-top: 1px solid #334155;
  z-index: 800;
  overflow: visible;
  padding: 0 16px;
  transition: height 0.2s ease;
}

.atmo-resize-handle {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 112px;
  height: 10px;
  background: rgba(51, 65, 85, 0.9);
  border-radius: 5px 5px 0 0;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  touch-action: none;
}

/* Enlarged touch target */
.atmo-resize-handle::before {
  content: '';
  position: absolute;
  top: -14px;
  left: -16px;
  right: -16px;
  bottom: -8px;
}

.atmo-resize-handle::after {
  content: '';
  width: 24px;
  height: 0;
  border-top: 1px solid #64748b;
}

.atmo-slice-labels {
  width: 20px;
  position: relative;
  padding: 0 2px;
  flex-shrink: 0;
  border-right: 1px solid #334155;
}

.atmo-slice-labels-right {
  width: 20px;
  position: relative;
  padding: 0 2px;
  flex-shrink: 0;
  border-left: 1px solid #334155;
}
.atmo-label-right {
  left: 0;
  right: 0;
}

.atmo-unit-btn {
  position: absolute;
  top: 0;
  left: -15px;
  right: 0;
  height: 30%;
  background: transparent;
  border: none;
  color: transparent;
  cursor: pointer;
  font-size: 0;
  z-index: 1001;
}
.atmo-slice-labels-right .atmo-unit-btn {
  left: 0;
  right: -15px;
}

.atmo-label {
  font-size: 0.75rem;
  color: #64748b;
  text-align: center;
  letter-spacing: 0.3px;
  left: 0;
  right: 0;
}
.atmo-unit-label {
  font-size: 0.58rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.3px;
  left: 0;
  right: 0;
  width: 100%;
  display: block;
}
.atmo-label-tick {
  position: absolute;
  width: 6px;
  height: 1px;
  background: #475569;
  right: -7px;
  top: 50%;
}
.atmo-label-right .atmo-label-tick {
  right: auto;
  left: -7px;
}

.atmo-slice-track {
  flex: 1;
  position: relative;
  overflow: hidden;
  touch-action: pan-x;
}

#atmo-slice-canvas {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  pointer-events: none;
}

.atmo-slice-cursor {
  position: absolute;
  left: var(--cursor-offset, 145px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(96, 165, 250, 0.8);
  z-index: 2;
  pointer-events: none;
}

.session-attribution {
  font-size: 0.6rem;
  color: #64748b;
  margin-left: auto;
  white-space: nowrap;
  padding-right: 8px;
}

/* Light theme overrides */
body[data-theme="light"] .session-atmo-slice {
  background: rgba(241, 245, 249, 0.92);
  border-top-color: #cbd5e1;
  border-bottom-color: #cbd5e1;
}

body[data-theme="light"] .atmo-slice-labels {
  border-right-color: #cbd5e1;
}
body[data-theme="light"] .atmo-slice-labels-right {
  border-left-color: #cbd5e1;
}

body[data-theme="light"] .atmo-label {
  color: #475569;
}
body[data-theme="light"] .atmo-label-tick {
  background: #94a3b8;
}

body[data-theme="light"] .atmo-slice-cursor {
  background: rgba(37, 99, 235, 0.8);
}

body[data-theme="light"] .session-attribution {
  color: #64748b;
}

body[data-theme="light"] .atmo-resize-handle {
  background: rgba(203, 213, 225, 0.95);
}

body[data-theme="light"] .atmo-resize-handle::after {
  border-top-color: #94a3b8;
  border-bottom-color: #94a3b8;
}

body[data-theme="light"] .logs-col-header { border-bottom-color: #cbd5e1; }
body[data-theme="light"] .logs-col-header-cell { color: #94a3b8; }
body[data-theme="light"] .logs-resize-handle::after { background: #cbd5e1; }
body[data-theme="light"] .logs-resize-handle:hover::after,
body[data-theme="light"] .logs-resize-handle.dragging::after { background: #2563eb; }

/* Anchor marker: small red triangle at the top of the timeline bar */
.tl-anchor-marker {
  position: absolute;
  top: 0;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #ef4444;
  transform: translateX(-5px);
  z-index: 9999;
  pointer-events: none;
}
/* Session timeline bar */
.session-timeline-bar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.92); backdrop-filter: blur(8px);
  border-top: 1px solid #334155; padding: 6px 16px 10px;
  touch-action: pan-x;
}
/* Session cursor: draggable, extended through full timeline bar for visual continuity with atmo slice */
.session-timeline-bar .controls-row { display: none; }
.session-timeline-bar .timeline-scroll-area {
  margin-left: 32px; /* roughly align with atmo-slice-track; cursor offset fine-tunes */
}
.session-timeline-bar .timeline-cursor {
  top: -6px;
  bottom: -10px;
  width: 26px;
  margin-left: -13px;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  cursor: col-resize;
  touch-action: none;
}
.session-timeline-bar .timeline-cursor::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: rgba(96, 165, 250, 0.8);
  box-shadow: 0 0 6px rgba(96, 165, 250, 0.6);
}
.session-timeline-top {
  position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 2px; margin-top: 2px; min-height: 0;
}
.session-time-label {
  display: none;
}
.session-model-select {
  background: #334155; color: #e2e8f0; border: 1px solid #475569;
  padding: 3px 8px; border-radius: 6px; font-size: 0.72rem; font-family: inherit;
  cursor: pointer;
}
.session-model-select:hover { border-color: #64748b; }

/* ─── Session light theme ─── */
body[data-theme="light"] .layer-toggle { color: #334155; }
body[data-theme="light"] .session-summary { background: rgba(255,255,255,0.92); border-color: #e2e8f0; }
body[data-theme="light"] .go-label { color: #1e293b; }
body[data-theme="light"] .summary-station { color: #475569; border-bottom-color: #e2e8f0; }
body[data-theme="light"] .cond-row { color: #334155; }
body[data-theme="light"] .cond-row span { color: #64748b; }
body[data-theme="light"] .cond-row strong { color: #1e293b; }
body[data-theme="light"] .cond-divider { border-top-color: #e2e8f0; }
body[data-theme="light"] .summary-thresholds { border-top-color: #e2e8f0; }
body[data-theme="light"] .thresh-input { background: #f8fafc; border-color: #cbd5e1; color: #1e293b; }
body[data-theme="light"] .session-timeline-bar { background: rgba(241, 245, 249, 0.95); border-top-color: #cbd5e1; }
body[data-theme="light"] .session-spot-time { color: #94a3b8; }
body[data-theme="light"] .session-time-label { color: #475569; }
body[data-theme="light"] .session-model-select { background: #cbd5e1; color: #1e293b; border-color: #94a3b8; }

/* ─── Region selector in header ─── */
.header-right {
  display: flex; align-items: center; padding: 0 12px; border-left: 1px solid #334155;
}
.region-selector {
  background: #1e293b; color: #94a3b8; border: 1px solid #334155;
  padding: 3px 8px 3px 6px; border-radius: 6px; font-size: 0.72rem;
  font-family: inherit; cursor: pointer; outline: none;
  height: 26px; max-width: 160px;
}
.region-selector:hover { border-color: #475569; color: #cbd5e1; }
.region-selector:focus { border-color: #60a5fa; }

/* ─── Spots view layout ─── */
#spots-view {
  height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  position: relative;
}
/* Override generic .view.active display:block for flex layout */
#spots-view.active { display: flex !important; flex-direction: row; }

.spots-map {
  flex: 1 1 auto;
  min-width: 0;
  height: 100% !important;
}

/* ─── Spots side panel ─── */
.spots-panel {
  width: 280px; flex-shrink: 0;
  background: #111827; border-left: 1px solid #334155;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.spots-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; border-bottom: 1px solid #334155;
  flex-shrink: 0;
}
.spots-panel-header h3 {
  font-size: 0.85rem; font-weight: 600; color: #e2e8f0;
}
.spots-header-actions { display: flex; gap: 6px; }
.spots-list {
  flex: 1 1 auto; overflow-y: auto; padding: 8px 0;
}
.spots-empty {
  padding: 20px 16px; font-size: 0.78rem; color: #475569; text-align: center;
}

/* ─── Spot list item ─── */
.spot-list-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-bottom: 1px solid rgba(51,65,85,0.4);
  transition: background 0.15s;
}
.spot-list-item:hover { background: rgba(255,255,255,0.03); }
.spot-list-item.spot-favorite .spot-list-name { color: #fbbf24; }
.spot-list-info { flex: 1 1 auto; min-width: 0; cursor: pointer; }
.spot-list-name {
  display: block; font-size: 0.8rem; color: #e2e8f0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.spot-list-meta { font-size: 0.65rem; color: #64748b; }
.spot-list-actions { display: flex; gap: 4px; flex-shrink: 0; }
.spot-fav-star { color: #fbbf24; font-size: 0.85em; }

/* ─── Spot popup ─── */
.spot-popup { padding: 14px; min-width: 200px; }
.spot-popup-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.spot-popup-name { font-size: 0.95rem; font-weight: 600; color: #f8fafc; }
.spot-popup-desc { font-size: 0.75rem; color: #94a3b8; margin-bottom: 8px; line-height: 1.4; }
.spot-popup-meta {
  font-size: 0.72rem; color: #cbd5e1; margin-bottom: 3px;
}
.spot-popup-meta.dim { color: #475569; margin-top: 4px; }
.spot-meta-label {
  font-size: 0.62rem; color: #64748b; text-transform: uppercase;
  letter-spacing: 0.4px; margin-right: 4px;
}
.spot-popup-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ─── Go/No-Go legend (map overlay, bottom-right) ─── */
.spots-legend {
  position: absolute; bottom: 28px; right: 10px; z-index: 1000;
  background: rgba(15,23,42,0.88); backdrop-filter: blur(6px);
  border: 1px solid #334155; border-radius: 8px;
  padding: 8px 12px; font-size: 0.7rem; line-height: 1.7;
  pointer-events: none;
}
.spots-legend-title {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: #94a3b8; margin-bottom: 4px; font-weight: 600;
}
.spots-legend-item {
  display: flex; align-items: center; gap: 6px; color: #cbd5e1;
}
.spots-legend-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.25);
}

/* ─── Spot popup conditions section ─── */
.spot-popup-conditions {
  margin: 8px 0; padding: 8px 10px;
  background: rgba(255,255,255,0.05); border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
}
.spot-cond-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700; margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.spot-cond-go    { color: #22c55e; }
.spot-cond-marginal { color: #f59e0b; }
.spot-cond-nogo  { color: #ef4444; }
.spot-cond-unknown { color: #64748b; }
.spot-cond-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.spot-cond-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px;
}
.spot-cond-row {
  font-size: 0.68rem; color: #cbd5e1;
}
.spot-cond-row strong { color: #f8fafc; }
.spot-cond-unavailable {
  font-size: 0.68rem; color: #64748b; font-style: italic;
}

/* ─── Map hint overlay ─── */
.spots-map-hint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(15,23,42,0.88); backdrop-filter: blur(6px);
  border: 1px solid #60a5fa; color: #60a5fa;
  padding: 6px 14px; border-radius: 20px;
  font-size: 0.78rem; z-index: 1200; pointer-events: none; white-space: nowrap;
}

/* ─── Modal overlay ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-content {
  background: #1e293b; border: 1px solid #334155; border-radius: 12px;
  padding: 24px; width: 100%; max-width: 440px;
  max-height: calc(100dvh - 40px); overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
.modal-content h3 {
  font-size: 1rem; font-weight: 600; color: #f8fafc;
  margin-bottom: 18px;
}

/* ─── Spot form ─── */
#spot-form { display: flex; flex-direction: column; gap: 10px; }
#spot-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.72rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.4px;
}
#spot-form input[type="text"],
#spot-form input[type="number"],
#spot-form textarea {
  background: #1a2332; border: 1px solid #334155; color: #e2e8f0;
  border-radius: 6px; padding: 7px 10px; font-size: 0.82rem;
  font-family: inherit; outline: none; resize: vertical;
}
#spot-form input[type="text"]:focus,
#spot-form input[type="number"]:focus,
#spot-form textarea:focus { border-color: #60a5fa; }
#spot-form fieldset {
  border: 1px solid #334155; border-radius: 8px;
  padding: 10px 12px; margin: 0;
}
#spot-form fieldset legend {
  font-size: 0.68rem; color: #94a3b8; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 0 4px;
}

/* ─── Checkbox grid ─── */
.checkbox-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px; margin-top: 6px;
}
.checkbox-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.78rem; color: #cbd5e1; cursor: pointer;
  text-transform: none; letter-spacing: 0;
}
.checkbox-label input[type="checkbox"] {
  accent-color: #60a5fa; width: 13px; height: 13px; cursor: pointer;
  flex-shrink: 0;
}
.checkbox-label-standalone {
  font-size: 0.82rem !important; color: #e2e8f0 !important;
  text-transform: none !important; letter-spacing: 0 !important;
}

/* ─── Modal actions ─── */
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px;
}

/* ─── Button styles ─── */
.btn-small {
  background: #334155; border: 1px solid #475569; color: #94a3b8;
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
  font-size: 0.72rem; font-family: inherit; white-space: nowrap;
}
.btn-small:hover { border-color: #64748b; color: #e2e8f0; }

.btn-primary {
  background: #2563eb; border: 1px solid #3b82f6; color: #fff;
  padding: 7px 18px; border-radius: 6px; cursor: pointer;
  font-size: 0.8rem; font-family: inherit; font-weight: 500;
}
.btn-primary:hover { background: #1d4ed8; border-color: #2563eb; }

.btn-secondary {
  background: #334155; border: 1px solid #475569; color: #94a3b8;
  padding: 7px 14px; border-radius: 6px; cursor: pointer;
  font-size: 0.8rem; font-family: inherit;
}
.btn-secondary:hover { border-color: #64748b; color: #e2e8f0; }

.btn-danger {
  background: transparent; border: 1px solid #475569; color: #f87171;
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
  font-size: 0.72rem; font-family: inherit;
}
.btn-danger:hover { border-color: #f87171; background: rgba(248,113,113,0.1); }

/* ─── Spots light theme ─── */
body[data-theme="light"] .header-right { border-left-color: #cbd5e1; }
body[data-theme="light"] .region-selector {
  background: #e2e8f0; color: #334155; border-color: #94a3b8;
}
body[data-theme="light"] .region-selector:hover { border-color: #64748b; color: #1e293b; }
body[data-theme="light"] .region-selector:focus { border-color: #2563eb; }

body[data-theme="light"] .spots-panel { background: #f8fafc; border-left-color: #e2e8f0; }
body[data-theme="light"] .spots-panel-header { border-bottom-color: #e2e8f0; }
body[data-theme="light"] .spots-panel-header h3 { color: #1e293b; }
body[data-theme="light"] .spots-list { background: #f8fafc; }
body[data-theme="light"] .spot-list-item { border-bottom-color: rgba(203,213,225,0.5); }
body[data-theme="light"] .spot-list-item:hover { background: rgba(0,0,0,0.03); }
body[data-theme="light"] .spot-list-name { color: #1e293b; }
body[data-theme="light"] .spot-list-meta { color: #64748b; }
body[data-theme="light"] .spots-empty { color: #94a3b8; }

body[data-theme="light"] .spot-popup-name { color: #1e293b; }
body[data-theme="light"] .spot-popup-desc { color: #475569; }
body[data-theme="light"] .spot-popup-meta { color: #334155; }
body[data-theme="light"] .spot-popup-meta.dim { color: #94a3b8; }
body[data-theme="light"] .spots-legend { background: rgba(255,255,255,0.92); border-color: #e2e8f0; }
body[data-theme="light"] .spots-legend-title { color: #64748b; }
body[data-theme="light"] .spots-legend-item { color: #334155; }
body[data-theme="light"] .spot-popup-conditions { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }
body[data-theme="light"] .spot-cond-row { color: #475569; }
body[data-theme="light"] .spot-cond-row strong { color: #1e293b; }

body[data-theme="light"] .modal-content {
  background: #fff; border-color: #e2e8f0;
}
body[data-theme="light"] .modal-content h3 { color: #1e293b; }
body[data-theme="light"] #spot-form label { color: #64748b; }
body[data-theme="light"] #spot-form input[type="text"],
body[data-theme="light"] #spot-form input[type="number"],
body[data-theme="light"] #spot-form textarea {
  background: #f8fafc; border-color: #cbd5e1; color: #1e293b;
}
body[data-theme="light"] #spot-form fieldset { border-color: #e2e8f0; }
body[data-theme="light"] #spot-form fieldset legend { color: #64748b; }
body[data-theme="light"] .checkbox-label { color: #334155; }
body[data-theme="light"] .checkbox-label-standalone { color: #1e293b !important; }

body[data-theme="light"] .btn-small { background: #e2e8f0; border-color: #94a3b8; color: #334155; }
body[data-theme="light"] .btn-small:hover { border-color: #64748b; color: #1e293b; }
body[data-theme="light"] .btn-secondary { background: #e2e8f0; border-color: #94a3b8; color: #475569; }
body[data-theme="light"] .btn-secondary:hover { border-color: #64748b; color: #1e293b; }
body[data-theme="light"] .btn-danger { border-color: #fca5a5; color: #dc2626; }
body[data-theme="light"] .btn-danger:hover { background: rgba(220,38,38,0.08); border-color: #dc2626; }

/* Mobile adjustments */
@media (max-width: 768px) {
  #header {
    height: 40px; padding: 0 12px; flex-wrap: nowrap; overflow: visible;
  }
  .nav-brand { padding-right: 12px; }
  .nav-brand h1 { font-size: 0.85rem; }
  .nav-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-shrink: 1; min-width: 0; }
  .nav-tab { padding: 0 8px; font-size: 0.7rem; flex-shrink: 0; white-space: nowrap; }
  .header-status { gap: 6px; }
  .station-count { font-size: 0.65rem; display: none; }
  .last-refresh { display: none; }
  .refresh-btn { padding: 3px 8px; font-size: 0.65rem; }

  #filters { padding: 4px 12px; gap: 4px; }
  .filter-chip { padding: 2px 8px; font-size: 0.62rem; }
  #filters label { font-size: 0.6rem; }

  .map-container { height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  #live-view .map-container { height: calc(100dvh - 40px - 30px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }

  /* Forecast view */
  #forecast-controls { padding: 4px 12px; gap: 8px; }
  #forecast-controls label { font-size: 0.6rem; }
  #forecast-controls select { font-size: 0.7rem; padding: 3px 6px; }
  #forecast-status { font-size: 0.6rem; }
  #forecast-controls { padding: 3px 12px; }
  #forecast-status { display: none; }
  #forecast-container { height: calc(100dvh - 40px - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important; }

  .legend, .forecast-legend { font-size: 0.6rem; padding: 6px 8px; }
  .forecast-legend { margin-bottom: 95px !important; }

  #timeline-bar { padding: 4px 8px 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  #timeline-bar .current-time { font-size: 0.8rem; }
  .timeline-scroll-area { height: 40px; }
  .ctrl-btn { padding: 2px 6px; font-size: 0.6rem; }
  .controls-row { gap: 4px; }

  .settings-panel { width: 220px; top: 5px; right: 5px; padding: 12px; }
  .settings-panel h4 { font-size: 0.75rem; }
  .settings-section h5 { font-size: 0.6rem; }
  .setting-row label { font-size: 0.6rem; width: 60px; }

  /* Session view on mobile */
  #session-controls { padding: 4px 12px; gap: 8px; }
  #session-controls select { font-size: 0.7rem; padding: 3px 6px; }
  #session-container { height: calc(100dvh - 40px - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important; }
  .layer-toggle { font-size: 0.68rem; padding: 2px 0; }
  .layer-toggle input[type="checkbox"] { width: 12px; height: 12px; }
  .session-summary { top: 6px; right: 6px; padding: 8px 10px; min-width: 160px; max-width: 220px; }
  .session-corner-box { padding: 6px 10px; width: 85px; height: 66px; }
  .corner-value { font-size: 1rem; }
  .corner-top-left { top: 6px; left: 6px; }
  .corner-top-right { top: 6px; right: 6px; }
  .corner-bottom-left { left: 6px; }
  .corner-bottom-right { right: 6px; }
  .session-spot-banner { top: 6px; padding: 4px 12px; }
  .session-spot-name { font-size: 0.75rem; }
  .go-label { font-size: 0.75rem; }
  .go-indicator { width: 12px; height: 12px; }
  .session-timeline-bar { padding: 4px 8px 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .session-time-label { font-size: 0.8rem; }
  .session-model-select { font-size: 0.65rem; padding: 2px 6px; }
  .session-atmo-slice { height: 112px; }
  .atmo-resize-handle { width: 48px; height: 20px; }
  .atmo-slice-labels { width: 22px; }
  .atmo-slice-labels-right { width: 22px; }
  .atmo-label { font-size: 0.675rem; }
  .atmo-slice-cursor { left: var(--cursor-offset, 145px); }

  /* Panel views on mobile */
  .panel-view { padding: 16px 12px; height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  #logs-view .panel-view { max-width: none; width: 100%; margin: 0; }
  .panel-card { padding: 14px; }
  .panel-card h3 { font-size: 0.75rem; }
  .panel-row label { font-size: 0.72rem; }
  .toggle-btn { padding: 4px 10px; font-size: 0.68rem; }

  /* Region selector on mobile */
  .header-right { padding: 0 6px; }
  .region-selector { font-size: 0.65rem; padding: 2px 6px; max-width: 100px; height: 24px; }

  /* Spots view — bottom drawer layout on mobile */
  #spots-view.active { flex-direction: column !important; }
  .spots-map { flex: none; height: calc(100dvh - 40px - 200px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important; }
  .spots-legend { font-size: 0.62rem; padding: 6px 8px; bottom: 20px; }
  .spots-panel {
    width: 100%; height: 200px; flex-shrink: 0;
    border-left: none; border-top: 1px solid #334155;
  }
  .spots-panel-header { padding: 8px 12px; }
  .spots-panel-header h3 { font-size: 0.78rem; }
  .spot-list-item { padding: 6px 12px; }
  .spot-list-name { font-size: 0.75rem; }

  .modal-content { padding: 16px; }
  .modal-content h3 { font-size: 0.9rem; margin-bottom: 12px; }
  #spot-form { gap: 8px; }
  .checkbox-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .checkbox-label { font-size: 0.72rem; }

  /* Logs view on mobile */
  .logs-log-entry {
    grid-template-columns: var(--logs-col-ts, 120px) var(--logs-col-lvl, 40px) 1fr;
    gap: 4px;
    padding: 4px 6px;
    font-size: 11px;
  }
  .logs-ts { font-size: 10px; white-space: nowrap; }
  .logs-lvl { font-size: 10px; }
  .logs-caddy-entry {
    grid-template-columns: var(--logs-col-ts, 120px) var(--logs-col-lvl, 40px) 1fr var(--logs-col-status, 50px) var(--logs-col-dur, 50px);
    gap: 4px;
    padding: 4px 6px;
    font-size: 11px;
  }
  .logs-col-header.app-header {
    grid-template-columns: var(--logs-col-ts, 120px) var(--logs-col-lvl, 40px) 1fr;
  }
  .logs-col-header.caddy-header {
    grid-template-columns: var(--logs-col-ts, 120px) var(--logs-col-lvl, 40px) 1fr var(--logs-col-status, 50px) var(--logs-col-dur, 50px);
  }
  .logs-col-header-cell { font-size: 9px; }
  .logs-log-list { height: 350px; }
}

/* ─── Logs View ─── */
#logs-view .panel-view { max-width: none; width: 100%; padding: 24px; margin: 0; box-sizing: border-box; }

.logs-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid #334155;
  margin-bottom: 16px;
}
.logs-tab-btn {
  background: none;
  border: none;
  color: #64748b;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.logs-tab-btn:hover { color: #e2e8f0; }
.logs-tab-btn.active { color: #60a5fa; border-bottom-color: #60a5fa; }
.logs-tabs-spacer { flex: 1; }
.logs-download-btn {
  background: #334155;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.logs-download-btn:hover { background: #475569; color: #e2e8f0; text-decoration: none; }

.logs-tab-panel { display: none; }
.logs-tab-panel.active { display: block; }

.logs-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.logs-toolbar select,
.logs-toolbar input[type="text"] {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.logs-toolbar select:focus,
.logs-toolbar input[type="text"]:focus { border-color: #60a5fa; }
.logs-toolbar input[type="text"] { width: 220px; }
.logs-auto-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.logs-auto-label input[type="checkbox"] { accent-color: #60a5fa; cursor: pointer; }
.logs-spacer { flex: 1; }
.logs-entry-count { color: #64748b; font-size: 12px; }

.logs-log-list {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  height: 420px;
  overflow-y: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
}
.logs-log-list::-webkit-scrollbar { width: 6px; }
.logs-log-list::-webkit-scrollbar-track { background: transparent; }
.logs-log-list::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

.logs-log-entry {
  display: grid;
  grid-template-columns: var(--logs-col-ts, 180px) var(--logs-col-lvl, 60px) 1fr;
  gap: 8px;
  padding: 4px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: baseline;
  line-height: 1.5;
}
.logs-log-entry:hover { background: rgba(255,255,255,0.03); }
.logs-ts  { color: #64748b; white-space: nowrap; }
.logs-lvl { font-weight: 600; text-transform: uppercase; font-size: 11px; }
.logs-msg { color: #e2e8f0; word-break: break-word; white-space: pre-wrap; }
.lvl-error { color: #ef5350; }
.lvl-warn  { color: #ffb74d; }
.lvl-info  { color: #60a5fa; }
.lvl-http  { color: #b39ddb; }
.lvl-debug { color: #757575; }

.logs-caddy-entry {
  display: grid;
  grid-template-columns: var(--logs-col-ts, 180px) var(--logs-col-lvl, 60px) 1fr var(--logs-col-status, 80px) var(--logs-col-dur, 70px);
  gap: 8px;
  padding: 4px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: baseline;
  line-height: 1.5;
}
.logs-caddy-entry:hover { background: rgba(255,255,255,0.03); }

/* Column header row — mirrors the entry grid so cells align */
.logs-col-header {
  display: grid;
  gap: 8px;
  padding: 4px 10px;
  border-bottom: 1px solid #334155;
  position: relative;
  user-select: none;
}
.logs-col-header.app-header {
  grid-template-columns: var(--logs-col-ts, 180px) var(--logs-col-lvl, 60px) 1fr;
}
.logs-col-header.caddy-header {
  grid-template-columns: var(--logs-col-ts, 180px) var(--logs-col-lvl, 60px) 1fr var(--logs-col-status, 80px) var(--logs-col-dur, 70px);
}
.logs-col-header-cell {
  position: relative;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: inherit;
  white-space: nowrap;
  overflow: visible;
}
.logs-col-header-cell.align-right { text-align: right; }

/* Resize handle — absolutely positioned over the right edge of each resizable column header cell */
.logs-resize-handle {
  position: absolute;
  top: -4px;
  right: -6px;
  width: 12px;
  bottom: -4px;
  cursor: col-resize;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.logs-resize-handle::after {
  content: '';
  display: block;
  width: 2px;
  height: 60%;
  background: #334155;
  border-radius: 1px;
  transition: background 0.15s;
}
.logs-resize-handle:hover::after,
.logs-resize-handle.dragging::after {
  background: #60a5fa;
}

.logs-method { color: #b39ddb; font-weight: 600; }
.logs-path   { color: #e2e8f0; word-break: break-all; }
.logs-status { font-weight: 600; text-align: right; }
.logs-dur    { color: #64748b; text-align: right; }
.status-2xx { color: #66bb6a; }
.status-3xx { color: #ffb74d; }
.status-4xx, .status-5xx { color: #ef5350; }

.logs-empty {
  padding: 40px;
  text-align: center;
  color: #64748b;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
}

.logs-file-list {
  margin-top: 14px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  overflow: hidden;
}
.logs-file-list-header {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #334155;
}
.logs-file-item {
  display: flex;
  justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid #334155;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
}
.logs-file-item:last-child { border-bottom: none; }
.logs-fname { color: #e2e8f0; }
.logs-fsize { color: #64748b; }

.logs-config-section {
  margin-top: 20px;
  border: 1px solid #334155;
  border-radius: 6px;
  overflow: hidden;
}
.logs-config-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #1e293b;
  cursor: pointer;
  user-select: none;
}
.logs-config-toggle h3 {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-transform: none;
  letter-spacing: 0;
  border: none;
  padding: 0;
  margin: 0;
}
.logs-chevron {
  color: #64748b;
  font-size: 11px;
  transition: transform 0.2s;
}
.logs-config-toggle.open .logs-chevron { transform: rotate(180deg); }
.logs-config-body {
  display: none;
  padding: 16px;
  background: #1e293b;
  border-top: 1px solid #334155;
}
.logs-config-body.open { display: block; }

.logs-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.logs-config-field label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}
.logs-config-field select,
.logs-config-field input[type="number"] {
  width: 100%;
  background: #1a2332;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.logs-config-field select:focus,
.logs-config-field input[type="number"]:focus { border-color: #60a5fa; }
.logs-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.logs-toggle-row input { accent-color: #60a5fa; }

.logs-config-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logs-apply-btn {
  background: #60a5fa;
  color: #000;
  border: none;
  padding: 7px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}
.logs-apply-btn:hover { opacity: 0.85; }
.logs-apply-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.logs-config-status { font-size: 12px; color: #64748b; }
.logs-config-status.ok  { color: #66bb6a; }
.logs-config-status.err { color: #ef5350; }
.logs-buffer-info { font-size: 12px; color: #64748b; margin-left: auto; }


.dev-dashboard {
  padding: 16px 20px;
  max-width: 1400px;
  margin: 0 auto;
  overflow-y: auto;
  height: calc(100vh - 52px);
}

.dev-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  background: #1e293b;
  border-radius: 6px;
  border: 1px solid #334155;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.dev-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.dev-toggle-switch {
  display: inline-flex;
  align-items: center;
  width: 34px;
  height: 18px;
  border-radius: 9px;
  background: #334155;
  border: 1px solid #475569;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.dev-toggle-switch.dev-toggle-on {
  background: #16a34a;
  border-color: #22c55e;
}
.dev-toggle-thumb {
  position: absolute;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #94a3b8;
  transition: left 0.2s, background 0.2s;
}
.dev-toggle-on .dev-toggle-thumb {
  left: 18px;
  background: #fff;
}

.dev-toolbar-info {
  font-size: 0.72rem;
}

/* Worker status badge */
.worker-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.03em;
}
.worker-status-badge.status-offline { background: #334155; color: #94a3b8; }
.worker-status-badge.status-paused  { background: #78350f; color: #fbbf24; }
.worker-status-badge.status-fetching { background: #1e3a5f; color: #60a5fa; }
.worker-status-badge.status-running { background: #14532d; color: #4ade80; }

/* Worker queue display */
.worker-queue {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.78rem;
  flex-wrap: wrap;
}
.queue-item { display: inline-flex; align-items: center; gap: 6px; }
.queue-item.fetching { color: #60a5fa; }
.queue-item.pending  { color: #94a3b8; }

/* Inline spinner for queue */
.worker-queue .spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(96, 165, 250, 0.3);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Small toggle variant for source cards */
.dev-toggle-sm {
  width: 24px;
  height: 13px;
  border-radius: 7px;
}
.dev-toggle-sm .dev-toggle-thumb {
  width: 9px;
  height: 9px;
}
.dev-toggle-sm.dev-toggle-on .dev-toggle-thumb {
  left: 13px;
}

/* Source toggle label (inline in card header) */
.source-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-left: auto;
  margin-right: 4px;
}

/* Disabled source card */
.dev-source-card.source-disabled {
  opacity: 0.5;
}

.dev-section {
  margin-bottom: 24px;
}

.dev-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 10px;
  border-bottom: 1px solid #334155;
  padding-bottom: 6px;
}

/* Sources grid */
.dev-sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.dev-source-card {
  background: #1e293b;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #334155;
}

.dev-source-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dev-source-name {
  font-weight: 600;
  font-size: 0.85rem;
  flex: 1;
}

.dev-source-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.75rem;
}

.dev-source-meta > div {
  display: flex;
  gap: 6px;
}

.dev-source-meta-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #334155;
}

.dev-meta-tag {
  font-size: 0.65rem;
  background: #334155;
  color: #94a3b8;
  padding: 1px 6px;
  border-radius: 3px;
}

body[data-theme="light"] .dev-source-meta-extra { border-color: #e2e8f0; }
body[data-theme="light"] .dev-meta-tag { background: #f1f5f9; color: #64748b; }

.dev-label {
  color: #64748b;
  min-width: 80px;
  flex-shrink: 0;
}

.dev-value {
  color: #cbd5e1;
}

.dev-error {
  color: #f87171;
}

/* Timeline container */
.dev-timeline-container {
  background: #1a2332;
  border-radius: 8px;
  border: 1px solid #334155;
  padding: 12px;
  overflow-x: auto;
}

.dev-timeline-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding: 0 4px;
}

.dev-timeline-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dev-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  color: #94a3b8;
}

.dev-legend-diamond {
  width: 8px;
  height: 8px;
  background: #a78bfa;
  transform: rotate(45deg);
  flex-shrink: 0;
}

.dev-legend-triangle {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #38bdf8;
  flex-shrink: 0;
}

.dev-legend-nowline {
  width: 2px;
  height: 12px;
  background: #ef4444;
  flex-shrink: 0;
}

.dev-legend-bar {
  width: 20px;
  height: 8px;
  border-radius: 2px;
  opacity: 0.7;
  flex-shrink: 0;
}

.dev-timeline-zoom-hint {
  font-size: 0.65rem;
  color: #64748b;
}

.dev-timeline-header {
  display: flex;
  align-items: flex-end;
  height: 32px;
  margin-bottom: 2px;
}

.dev-timeline-label-col {
  width: 180px;
  min-width: 180px;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #64748b;
  padding-right: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dev-timeline-axis {
  flex: 1;
  flex-shrink: 0;
  position: relative;
  height: 32px;
  border-bottom: 1px solid #334155;
  min-width: 100%;
}

.dev-axis-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 8px;
  background: #475569;
}

.dev-axis-tick.dev-axis-day {
  height: 14px;
  background: #64748b;
}

.dev-axis-label {
  position: absolute;
  bottom: 10px;
  left: 2px;
  font-size: 0.65rem;
  color: #64748b;
  white-space: nowrap;
}

.dev-axis-day .dev-axis-label {
  font-weight: 600;
  color: #94a3b8;
  bottom: 16px;
}

.dev-timeline-row {
  display: flex;
  align-items: center;
  min-height: 28px;
  border-bottom: 1px solid #1e293b;
}

.dev-timeline-row .dev-timeline-label-col {
  gap: 1px;
}

.dev-model-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: #e2e8f0;
}

.dev-model-meta {
  font-size: 0.65rem;
}

.dev-timeline-track {
  flex: 1;
  flex-shrink: 0;
  position: relative;
  height: 24px;
  overflow: hidden;
  min-width: 100%;
}

/* Coverage bar */
.dev-coverage-bar {
  position: absolute;
  top: 4px;
  height: 16px;
  border-radius: 3px;
  opacity: 0.6;
}

.dev-cache-fresh { background: #22c55e; }
.dev-cache-aging { background: #eab308; }
.dev-cache-stale { background: #ef4444; }
.dev-cache-expired { background: #ef4444; }

/* Frame tick marks */
.dev-frame-tick {
  position: absolute;
  top: 6px;
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
}

/* Now marker (vertical red line) */
.dev-now-marker {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #ef4444;
  z-index: 2;
}

.dev-now-label {
  position: absolute;
  top: -14px;
  left: -8px;
  font-size: 0.6rem;
  color: #ef4444;
  font-weight: 600;
}

/* Model run marker (diamond) */
.dev-run-marker {
  position: absolute;
  top: 8px;
  width: 8px;
  height: 8px;
  background: #a78bfa;
  transform: translateX(-4px) rotate(45deg);
  z-index: 3;
}

/* Last fetch marker (small triangle) */
.dev-fetch-marker {
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #38bdf8;
  transform: translateX(-4px);
  z-index: 3;
}

/* Model detail cards */
.dev-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.dev-model-card {
  background: #1e293b;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #334155;
}

.dev-model-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dev-model-card-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.dev-cache-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  color: #1a2332;
  font-weight: 600;
}

.dev-cache-badge.dev-cache-expired {
  color: #fecaca;
  background: #991b1b;
}

.dev-model-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.75rem;
  margin-bottom: 8px;
}

.dev-model-details > div {
  display: flex;
  gap: 6px;
}

.dev-model-card-actions {
  display: flex;
  gap: 8px;
}

.dev-model-card-actions .source-refresh-btn {
  font-size: 0.75rem;
  padding: 4px 8px;
}

/* Download status messages */
.dev-status-msg {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.dev-status-downloading {
  color: #38bdf8;
  animation: dev-blink 1s ease-in-out infinite;
}

.dev-status-error {
  color: #ef4444;
}

.dev-status-done {
  color: #22c55e;
}

@keyframes dev-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Light theme overrides */
body[data-theme="light"] .dev-dashboard { color: #1e293b; }
body[data-theme="light"] .dev-section-title { color: #64748b; border-color: #e2e8f0; }
body[data-theme="light"] .dev-source-card,
body[data-theme="light"] .dev-model-card { background: #ffffff; border-color: #e2e8f0; }
body[data-theme="light"] .dev-timeline-container { background: #f8fafc; border-color: #e2e8f0; }
body[data-theme="light"] .dev-legend-item { color: #64748b; }
body[data-theme="light"] .dev-timeline-zoom-hint { color: #94a3b8; }
body[data-theme="light"] .dev-label { color: #94a3b8; }
body[data-theme="light"] .dev-value { color: #334155; }
body[data-theme="light"] .dev-model-name { color: #1e293b; }
body[data-theme="light"] .dev-frame-tick { background: rgba(0, 0, 0, 0.15); }
body[data-theme="light"] .dev-axis-tick { background: #cbd5e1; }
body[data-theme="light"] .dev-axis-tick.dev-axis-day { background: #94a3b8; }
body[data-theme="light"] .dev-timeline-row { border-color: #e2e8f0; }
body[data-theme="light"] .dev-cache-badge.dev-cache-expired { color: #991b1b; background: #fee2e2; }
body[data-theme="light"] .dev-toolbar { background: #ffffff; border-color: #e2e8f0; }

/* ─── Zoom Slider control ─── */
.zoom-slider-control {
  display: none;
  flex-direction: column;
  align-items: center;
  background: rgba(30, 30, 46, 0.9);
  border-radius: 6px;
  padding: 4px;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.zoom-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.zoom-btn:hover { background: rgba(255,255,255,0.1); }
.zoom-btn:active { background: rgba(255,255,255,0.15); }

.zoom-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
}

.zoom-slider {
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  writing-mode: bt-lr;
  width: 20px;
  height: 104px;
  cursor: pointer;
  accent-color: #60a5fa;
  background: transparent;
  margin: 0;
}

.zoom-ticks {
  position: absolute;
  right: -2px;
  top: 4px;
  bottom: 4px;
  width: 6px;
  pointer-events: none;
}

.zoom-tick {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(148, 163, 184, 0.35);
  border-radius: 1px;
}

/* Light theme */
body[data-theme="light"] .zoom-slider-control {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
body[data-theme="light"] .zoom-btn { color: #334155; }
body[data-theme="light"] .zoom-btn:hover { background: rgba(0,0,0,0.06); }
body[data-theme="light"] .zoom-slider { accent-color: #3b82f6; }
body[data-theme="light"] .zoom-tick { background: rgba(100, 116, 139, 0.3); }

/* ─── Worker Management Dashboard ─── */

/* Utility: muted text (used throughout dev dashboard) */
.dim { color: #64748b; }
body[data-theme="light"] .dim { color: #94a3b8; }

/* Worker Header Bar */
.worker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.worker-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.worker-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}
.worker-uptime {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* Power toggle */
.worker-power-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.power-label {
  font-size: 0.82rem;
  font-weight: 600;
}
.power-switch {
  display: inline-block;
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: #334155;
  border: 2px solid #475569;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.power-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #64748b;
  transition: left 0.2s, background 0.2s;
}
.power-switch.power-on {
  background: #15803d;
  border-color: #22c55e;
}
.power-switch.power-on::after {
  left: 25px;
  background: #fff;
}
.power-switch.power-off {
  background: #78350f;
  border-color: #d97706;
}
.power-switch.power-off::after {
  left: 3px;
  background: #fbbf24;
}

/* Status pill */
.worker-status-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.pill-offline  { background: #334155; color: #94a3b8; }
.pill-paused   { background: #78350f; color: #fbbf24; }
.pill-running  { background: #14532d; color: #4ade80; }
.pill-fetching {
  background: #1e3a5f;
  color: #60a5fa;
  animation: pill-pulse 1.4s ease-in-out infinite;
}
@keyframes pill-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Activity Panel */
.activity-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: #1a2332;
  border: 1px solid #334155;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.78rem;
  min-height: 42px;
}
.activity-fetching {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.activity-source {
  font-weight: 600;
  color: #60a5fa;
  font-variant-numeric: tabular-nums;
}
.activity-detail {
  color: #94a3b8;
  font-family: ui-monospace, 'Cascadia Code', monospace;
}
.activity-elapsed { font-size: 0.72rem; }
.activity-queue {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.queue-chip {
  background: #334155;
  color: #94a3b8;
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 500;
}
.activity-idle { color: #64748b; }
.activity-paused { font-size: 0.75rem; font-style: italic; }

/* Activity spinner */
.activity-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(96, 165, 250, 0.25);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

/* Progress bar (activity panel) */
.progress-bar-container {
  position: relative;
  height: 6px;
  background: #334155;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-bar {
  height: 100%;
  background: #3b82f6;
  border-radius: 3px;
  transition: width 0.3s ease;
  min-width: 4px;
}
.progress-text {
  position: absolute;
  right: 6px;
  top: -14px;
  font-size: 0.65rem;
  color: #64748b;
}

/* Source Cards Grid */
.worker-sources-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 700px) {
  .worker-sources-grid { grid-template-columns: 1fr; }
}

.worker-source-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.2s, opacity 0.2s;
}
.worker-source-card.source-disabled { opacity: 0.5; }
.worker-source-card.source-fetching {
  border-left: 3px solid #3b82f6;
}

/* Source card header */
.source-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.source-card-name {
  font-weight: 600;
  font-size: 0.85rem;
  flex: 1;
}
.source-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Source status dot */
.source-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.dot-ok       { background: #34d399; }
.dot-error    { background: #f87171; }
.dot-fetching { background: #60a5fa; animation: dot-blink 1s ease-in-out infinite; }
.dot-disabled { background: #334155; }
.dot-idle     { background: #475569; }
@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Small toggle for source card */
.source-toggle-sm {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.toggle-track {
  display: inline-flex;
  align-items: center;
  width: 28px;
  height: 15px;
  border-radius: 8px;
  background: #334155;
  border: 1px solid #475569;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.toggle-track.toggle-on {
  background: #16a34a;
  border-color: #22c55e;
}
.toggle-thumb {
  position: absolute;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #64748b;
  transition: left 0.2s, background 0.2s;
}
.toggle-on .toggle-thumb {
  left: 15px;
  background: #fff;
}

/* Source card body: label/value rows */
.source-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.74rem;
}
.source-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.source-label {
  color: #64748b;
  min-width: 72px;
  flex-shrink: 0;
  font-size: 0.72rem;
}
.source-value {
  color: #cbd5e1;
  word-break: break-word;
}
.source-status-ok       { color: #34d399; }
.source-status-error    { color: #f87171; }
.source-status-fetching { color: #60a5fa; }
.source-status-idle,
.source-status-unknown,
.source-status-disabled { color: #64748b; }
.source-error-row { margin-top: 4px; padding-top: 4px; border-top: 1px solid #334155; }
.source-error-text { color: #f87171; font-size: 0.72rem; }

/* Mini progress bar inside source card */
.source-progress {
  margin-top: 10px;
  height: 3px;
  background: #334155;
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-mini {
  height: 100%;
  background: #3b82f6;
  border-radius: 2px;
  transition: width 0.3s ease;
  min-width: 4px;
}

/* Cache Files Breakdown */
.cache-files-section {
  margin-bottom: 20px;
}
.cache-total-badge {
  font-size: 0.7rem; color: #38bdf8; margin-left: 8px;
  background: rgba(56, 189, 248, 0.1); padding: 2px 8px; border-radius: 4px;
}
.cache-files-detail { margin-top: 8px; }
.cache-group { margin-bottom: 12px; }
.cache-group-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; border-bottom: 1px solid #1e293b; margin-bottom: 4px;
}
.cache-group-name {
  font-size: 0.72rem; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.cache-group-size { font-size: 0.7rem; }
.cache-file-row {
  display: grid; grid-template-columns: 1fr 80px 56px 64px;
  align-items: center; gap: 8px; padding: 3px 0;
  font-size: 0.72rem; font-family: ui-monospace, 'Cascadia Code', monospace;
}
.cache-file-name { color: #cbd5e1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cache-file-bar-bg { height: 6px; background: #1e293b; border-radius: 3px; overflow: hidden; }
.cache-file-bar { height: 100%; border-radius: 3px; transition: width 0.3s; }
.cache-file-bar.cache-bar-fresh  { background: #4ade80; }
.cache-file-bar.cache-bar-recent { background: #38bdf8; }
.cache-file-bar.cache-bar-aging  { background: #fbbf24; }
.cache-file-bar.cache-bar-stale  { background: #f87171; }
.cache-file-size { text-align: right; color: #94a3b8; }
.cache-file-age  { text-align: right; color: #64748b; }

/* Light theme overrides for new worker dashboard components */
body[data-theme="light"] .worker-header { background: #ffffff; border-color: #e2e8f0; }
body[data-theme="light"] .activity-panel { background: #f8fafc; border-color: #e2e8f0; }
body[data-theme="light"] .worker-source-card { background: #ffffff; border-color: #e2e8f0; }
body[data-theme="light"] .source-label { color: #94a3b8; }
body[data-theme="light"] .source-value { color: #334155; }
body[data-theme="light"] .cache-total-badge { background: rgba(56, 189, 248, 0.08); }
body[data-theme="light"] .cache-group-header { border-color: #e2e8f0; }
body[data-theme="light"] .cache-file-name { color: #334155; }
body[data-theme="light"] .cache-file-bar-bg { background: #e2e8f0; }
body[data-theme="light"] .cache-file-size { color: #64748b; }
body[data-theme="light"] .toggle-track { background: #e2e8f0; border-color: #cbd5e1; }
body[data-theme="light"] .toggle-thumb { background: #94a3b8; }
body[data-theme="light"] .queue-chip { background: #e2e8f0; color: #64748b; }
body[data-theme="light"] .progress-bar-container { background: #e2e8f0; }
body[data-theme="light"] .source-progress { background: #e2e8f0; }
body[data-theme="light"] .source-error-row { border-color: #e2e8f0; }

/* ─── MeteoSwiss Dev View ─── */
.meteoswiss-dashboard { padding: 1rem; max-width: 900px; }
.meteoswiss-meta { margin-bottom: 1rem; font-size: 0.8rem; }

.meteoswiss-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.meteoswiss-file-card {
  background: #1e293b;
  border: 2px solid #334155;
  border-radius: 8px;
  padding: 0.75rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.meteoswiss-file-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.meteoswiss-file-name { font-weight: 600; font-size: 0.85rem; }
.meteoswiss-file-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.meteoswiss-file-filename { font-size: 0.7rem; word-break: break-all; margin-bottom: 0.25rem; font-family: monospace; }
.meteoswiss-file-time { font-size: 0.7rem; }

/* Card border colors */
.ms-file-done     { border-color: #34d399; }
.ms-file-fetching { border-color: #60a5fa; animation: dev-blink 1s ease-in-out infinite; }
.ms-file-pending  { border-color: #f59e0b; }
.ms-file-stale    { border-color: #f87171; }
.ms-file-error    { border-color: #f87171; }

/* Badge colors */
.ms-badge-done     { background: rgba(52, 211, 153, 0.2); color: #34d399; }
.ms-badge-fetching { background: rgba(96, 165, 250, 0.2); color: #60a5fa; }
.ms-badge-pending  { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.ms-badge-stale    { background: rgba(248, 113, 113, 0.2); color: #f87171; }
.ms-badge-error    { background: rgba(248, 113, 113, 0.2); color: #f87171; }

/* Legend */
.meteoswiss-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.5rem;
}
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.legend-done     { background: #34d399; }
.legend-fetching { background: #60a5fa; animation: dev-blink 1s ease-in-out infinite; }
.legend-pending  { background: #f59e0b; }
.legend-stale    { background: #f87171; }

/* Light theme */
body[data-theme="light"] .meteoswiss-file-card { background: #f8fafc; border-color: #e2e8f0; }
body[data-theme="light"] .ms-file-done     { border-color: #10b981; }
body[data-theme="light"] .ms-file-fetching { border-color: #3b82f6; }
body[data-theme="light"] .ms-file-pending  { border-color: #f59e0b; }
body[data-theme="light"] .ms-file-stale    { border-color: #ef4444; }

/* ─── MeteoSwiss Station Picker ─── */
.ms-station-picker { margin-top: 2rem; max-width: 100%; overflow: hidden; }
.ms-station-picker h2 { font-size: 1rem; margin-bottom: 0.75rem; }
.ms-station-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.ms-station-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  padding: 2px 8px;
  border-radius: 10px;
}
.ms-search-input {
  flex: 1;
  min-width: 150px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: inherit;
  padding: 6px 10px;
  font-size: 0.8rem;
}
.ms-save-btn {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.ms-save-btn.dirty { opacity: 1; }
.ms-save-btn:disabled { cursor: not-allowed; }
.ms-save-status { font-size: 0.75rem; color: #34d399; }
.ms-save-status.error { color: #f87171; }

.ms-station-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #334155;
  border-radius: 8px;
}
.ms-station-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 6px 10px;
  font-size: 0.8rem;
  border-bottom: 1px solid #1e293b;
  cursor: pointer;
  transition: background 0.15s;
}
.ms-station-item:last-child { border-bottom: none; }
.ms-station-item:hover { background: rgba(96, 165, 250, 0.08); }
.ms-station-item.active { background: rgba(52, 211, 153, 0.08); }
.ms-station-item input[type="checkbox"] { accent-color: #34d399; }
.ms-station-fav {
  cursor: pointer;
  font-size: 0.9rem;
  color: #475569;
  transition: color 0.15s;
  user-select: none;
}
.ms-station-fav.on { color: #fbbf24; }
.ms-station-fav:hover { color: #f59e0b; }
.ms-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.ms-bulk-btn {
  background: #334155;
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 5px;
  padding: 4px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}
.ms-bulk-btn:hover { background: #475569; }
/* Overview box */
.ms-overview {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 1rem;
}
.ms-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: #94a3b8;
}
.ms-overview-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.ms-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ms-stat-value {
  font-size: 1rem;
  font-weight: 700;
  font-family: monospace;
  color: #e2e8f0;
}
.ms-stat-label {
  font-size: 0.7rem;
  color: #64748b;
}
/* Traffic lights */
.ms-traffic-light {
  display: flex;
  gap: 3px;
  align-items: center;
  width: 2.5rem;
  justify-content: center;
}
.ms-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.15;
}
.ms-light.green { background: #22c55e; }
.ms-light.orange { background: #f59e0b; }
.ms-light.red { background: #ef4444; }
.ms-light.on { opacity: 1; }

.ms-station-header-row { border-bottom: 2px solid #334155 !important; cursor: default; }
.ms-station-header-row:hover { background: transparent !important; }
.ms-filter-toggle {
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.4;
  user-select: none;
  width: 1.1rem;
  text-align: center;
  transition: opacity 0.15s;
}
.ms-filter-toggle:hover { opacity: 0.7; }
.ms-filter-toggle.active { opacity: 1; color: #60a5fa; }
.ms-station-code { font-family: monospace; font-weight: 600; width: 3ch; }
.ms-station-name { flex: 1; }
.ms-station-alt { font-size: 0.7rem; color: #94a3b8; min-width: 45px; text-align: right; }
.ms-station-rows { font-size: 0.7rem; color: #94a3b8; min-width: 30px; text-align: right; font-family: monospace; }
.ms-station-size { font-size: 0.7rem; color: #94a3b8; min-width: 35px; text-align: right; font-family: monospace; }

/* Light theme */
body[data-theme="light"] .ms-search-input { background: #f8fafc; border-color: #e2e8f0; }
body[data-theme="light"] .ms-station-list { border-color: #e2e8f0; }
body[data-theme="light"] .ms-station-item { border-bottom-color: #f1f5f9; }
body[data-theme="light"] .ms-station-item:hover { background: rgba(59, 130, 246, 0.06); }
body[data-theme="light"] .ms-station-item.active { background: rgba(16, 185, 129, 0.06); }
body[data-theme="light"] .ms-overview { background: #f8fafc; border-color: #e2e8f0; }
body[data-theme="light"] .ms-stat-value { color: #1e293b; }
body[data-theme="light"] .ms-bulk-btn { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
body[data-theme="light"] .ms-bulk-btn:hover { background: #cbd5e1; }
body[data-theme="light"] .ms-station-fav { color: #cbd5e1; }

/* ─── Source selector dropdown (station monitor) ─── */
.source-selector {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #e2e8f0;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
  cursor: pointer;
  appearance: auto;
}

/* Source health bar */
.source-health-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 8px 14px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}
.source-health-status {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.source-health-status.status-fresh { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.source-health-status.status-cached { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.source-health-status.status-stale { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.source-health-status.status-error { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.source-health-status.status-empty { background: rgba(100, 116, 139, 0.15); color: #64748b; }
.source-health-detail {
  color: #94a3b8;
  font-family: monospace;
  font-size: 0.75rem;
}

/* Provider chips */
.source-provider-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.provider-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 0.7rem;
  color: #94a3b8;
}
.provider-chip.small {
  padding: 1px 6px;
  font-size: 0.65rem;
  border: none;
  background: rgba(96, 165, 250, 0.1);
  color: #60a5fa;
}
.provider-chip-name { font-weight: 500; }
.provider-chip-count {
  font-family: monospace;
  font-weight: 600;
  color: #e2e8f0;
}

/* Unified source station row (all sources) */
.source-header-row, .source-station-row {
  display: grid;
  grid-template-columns: 1fr 5.5rem 3rem 2rem;
  gap: 0.3rem;
  align-items: center;
}
.source-station-row { cursor: default; }
.source-station-row:hover { background: rgba(96, 165, 250, 0.04); }
.src-col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-col-provider { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-col-age {
  font-family: monospace;
  font-size: 0.75rem;
  text-align: right;
  color: #94a3b8;
}
.src-col-status { text-align: center; }

/* Light theme overrides for source selector */
body[data-theme="light"] .source-selector { background: #f8fafc; border-color: #e2e8f0; color: #334155; }
body[data-theme="light"] .source-health-bar { background: #f8fafc; border-color: #e2e8f0; }
body[data-theme="light"] .provider-chip { background: #f1f5f9; border-color: #e2e8f0; }
body[data-theme="light"] .provider-chip-count { color: #334155; }

/* ─── Server Monitor View ─── */

.server-monitor {
  padding: 16px 20px;
  max-width: 920px;
  margin: 0 auto;
  overflow-y: auto;
  height: calc(100dvh - 52px);
}
.srv-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}

/* Gauges row */
.srv-gauges-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.srv-gauge-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.srv-gauge {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: conic-gradient(#334155 0% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease;
}
.srv-gauge-inner {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.srv-gauge-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e2e8f0;
  font-family: monospace;
}
.srv-gauge-unit {
  font-size: 0.65rem;
  color: #64748b;
  align-self: flex-end;
  margin-bottom: 8px;
}
.srv-gauge-label {
  margin-top: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.srv-gauge-detail {
  font-size: 0.68rem;
  margin-top: 3px;
  font-family: monospace;
  min-height: 1em;
}
.srv-sparkline {
  margin-top: 10px;
  width: 100%;
  height: 36px;
  display: block;
  border-radius: 4px;
}

/* Network card */
.srv-network-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.srv-network-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.srv-net-stats {
  display: flex;
  gap: 14px;
  font-size: 0.82rem;
  font-family: monospace;
  font-weight: 600;
}
.srv-net-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.srv-net-badge.rx { color: #3b82f6; }
.srv-net-badge.tx { color: #22c55e; }
.srv-net-canvas {
  width: 100%;
  height: 80px;
  display: block;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.4);
}
.srv-net-legend {
  display: flex;
  gap: 16px;
  font-size: 0.7rem;
  margin-top: 6px;
}

/* Processes table */
.srv-processes-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.srv-proc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.srv-proc-table th {
  text-align: left;
  color: #64748b;
  font-weight: 500;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 6px 8px;
  border-bottom: 1px solid #334155;
}
.srv-proc-table td {
  padding: 5px 8px;
  color: #cbd5e1;
}
.srv-proc-table .row-alt { background: rgba(51, 65, 85, 0.3); }
.srv-proc-table .mono { font-family: monospace; }
.srv-proc-table .val-hot { color: #f59e0b; font-weight: 600; }
.srv-proc-table .proc-name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Info cards row */
.srv-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.srv-info-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px 16px;
}
.srv-info-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}
.srv-info-row-item:last-child { border-bottom: none; }
.srv-info-row-item label { color: #94a3b8; font-weight: 500; }

/* Mobile */
@media (max-width: 768px) {
  .srv-gauges-row { grid-template-columns: repeat(2, 1fr); }
  .srv-info-row { grid-template-columns: 1fr; }
  .server-monitor { padding: 12px 14px; }
}
@media (max-width: 420px) {
  .srv-gauges-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .srv-gauge { width: 90px; height: 90px; }
  .srv-gauge-inner { width: 66px; height: 66px; }
  .srv-gauge-value { font-size: 1.2rem; }
  .srv-proc-table .proc-name { max-width: 120px; }
}

/* Light theme */
body[data-theme="light"] .srv-gauge-card,
body[data-theme="light"] .srv-network-card,
body[data-theme="light"] .srv-processes-card,
body[data-theme="light"] .srv-info-card { background: #fff; border-color: #e2e8f0; }
body[data-theme="light"] .srv-gauge-inner { background: #fff; }
body[data-theme="light"] .srv-gauge-value { color: #1e293b; }
body[data-theme="light"] .srv-proc-table td { color: #334155; }
body[data-theme="light"] .srv-proc-table .row-alt { background: rgba(241, 245, 249, 0.7); }
body[data-theme="light"] .srv-net-canvas { background: rgba(241, 245, 249, 0.5); }
body[data-theme="light"] .srv-info-row-item { border-bottom-color: #e2e8f0; }
