/*
 * globe.css — Space Weather Globe skin
 *
 * sw-* classes only. Never overrides Pelorus primitives directly.
 * Load order: pelorus.css → globe.css
 */

/* ═══════════════════════════════════════════════════════════
   GLOBE CONTENT AREA
   Fills remaining space below topbar, holds the Three.js canvas
   and the floating right panel.
═══════════════════════════════════════════════════════════ */

.sw-globe-content {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  background: #000;
  min-height: 0;
}

/* Globe stage — absolute fill, same pattern as .pl-map-stage on map pages */
.sw-globe-stage {
  position: absolute;
  inset: 0;
  background: #000010;
}

/* Three.js canvas mount point fills the stage */
#globeMount {
  width: 100%;
  height: 100%;
}

/* Canvas fills the mount. renderer.setSize(w, h, false) keeps the GL buffer
   in sync via ResizeObserver — so clientWidth/Height always == GL buffer. */
#globeMount canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════
   STAT GRID  (sidebar — system overview)
═══════════════════════════════════════════════════════════ */

.sw-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0;
}

.sw-summary-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 8px;
}

.sw-summary-card {
  background: transparent;
}

.sw-stat-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--pl-r-sm);
  border: 1px solid var(--pl-line-subtle);
  border-left: 3px solid var(--sw-stat-accent, transparent);
  background: rgba(0,0,0,.16);
  text-align: left;
  min-width: 0;
  transition: background var(--pl-dur-fast) var(--pl-ease),
              border-color var(--pl-dur-fast) var(--pl-ease);
}

.sw-click-card {
  appearance: none;
  font: inherit;
  color: inherit;
  width: 100%;
  cursor: pointer;
}

.sw-click-card:focus-visible {
  outline: none;
}

.sw-stat-cell:hover {
  background: rgba(0,0,0,.22);
}

.sw-stat-cell.sw-click-card:focus-visible {
  border-color: var(--pl-cyan-border);
  box-shadow: 0 0 0 1px rgba(25,181,209,0.3), 0 0 0 4px rgba(25,181,209,0.12);
}

.sw-stat-cell strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  color: var(--pl-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.sw-stat-cell span {
  display: block;
  font-size: 11px;
  color: var(--pl-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.sw-stat-cyan   { border-left-color: var(--pl-cyan);   }
.sw-stat-green  { border-left-color: var(--pl-green);  }
.sw-stat-blue   { --sw-stat-accent: var(--pl-blue);   }
.sw-stat-yellow { --sw-stat-accent: var(--pl-yellow); }
.sw-stat-red    { --sw-stat-accent: var(--pl-red);    }

.sw-kp-card {
  background: rgba(0,0,0,.16);
  border: 1px solid var(--pl-line-subtle);
  border-radius: var(--pl-r-sm);
  padding: 10px 11px;
}

.sw-kp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pl-text);
}

.sw-kp-card-header small {
  font-size: 11px;
  font-weight: 400;
  color: var(--pl-faint);
}

.sw-kp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.sw-kp-grid > button {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.sw-kp-grid > button:hover strong {
  color: #e8eef4;
}

.sw-kp-grid > button:focus-visible {
  border-radius: var(--pl-r-sm);
  box-shadow: 0 0 0 1px rgba(25,181,209,0.34), 0 0 0 4px rgba(25,181,209,0.1);
}

.sw-kp-grid span {
  display: block;
  font-size: 11px;
  color: var(--pl-faint);
}

.sw-kp-grid strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
  color: var(--pl-text);
  line-height: 1.2;
}

.sw-kp-updated {
  font-size: 11px;
  color: var(--pl-faint);
  margin-bottom: 8px;
  line-height: 1.45;
}

.sw-kp-forecast-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  margin: 8px 0 6px;
}

.sw-kp-forecast-date {
  font-size: 11px;
  color: var(--pl-faint);
}

.sw-kp-forecast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--pl-text);
}

.sw-kp-tz {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--pl-line);
}

.sw-kp-tz-btn {
  border: 0;
  background: transparent;
  color: var(--pl-muted);
  border-radius: 999px;
  font-size: 11px;
  padding: 4px 9px;
  cursor: pointer;
  transition: background var(--pl-dur-fast) var(--pl-ease),
              color var(--pl-dur-fast) var(--pl-ease);
}

.sw-kp-tz-btn:hover {
  color: var(--pl-text);
}

.sw-kp-tz-btn.is-active {
  background: var(--pl-cyan-dim);
  color: var(--pl-cyan);
}

.sw-kp-timeline {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.sw-kp-forecast-slot {
  min-width: 72px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  scroll-snap-align: center;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.sw-kp-forecast-slot:focus-visible {
  outline: none;
}

.sw-kp-current-label {
  min-height: 14px;
  font-size: 10px;
  color: var(--pl-light);
}

.sw-kp-current-label.is-spacer {
  visibility: hidden;
}

.sw-kp-chip {
  width: 100%;
  border-radius: 6px;
  font-weight: 700;
  text-align: center;
  padding: 6px 4px;
  font-size: 13px;
  color: #111;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform var(--pl-dur-fast) var(--pl-ease),
              box-shadow var(--pl-dur-fast) var(--pl-ease);
}

.sw-kp-forecast-slot:hover .sw-kp-chip {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 8px 18px rgba(0,0,0,0.14);
}

.sw-kp-forecast-slot:focus-visible .sw-kp-chip {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 0 0 1px rgba(25,181,209,0.45), 0 0 0 4px rgba(25,181,209,0.12);
}

.sw-kp-forecast-slot.is-current .sw-kp-chip {
  outline: 2px solid var(--pl-cyan);
  box-shadow: 0 0 0 3px rgba(25,181,209,0.14), 0 0 10px rgba(25,181,209,0.16);
}

.sw-kp-window {
  font-size: 10px;
  text-align: center;
  line-height: 1.2;
  color: var(--pl-faint);
}

.sw-impact-card {
  background: rgba(0,0,0,.16);
  border: 1px solid var(--pl-line-subtle);
  border-radius: var(--pl-r-sm);
  padding: 10px 11px;
}

.sw-impact-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pl-text);
}

.sw-impact-card-header small {
  font-size: 11px;
  font-weight: 400;
  color: var(--pl-faint);
}

.sw-impact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.sw-impact-cell,
.sw-trend-cell {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--pl-line-subtle);
  border-radius: var(--pl-r-sm);
  padding: 9px 10px;
}

.sw-impact-cell span,
.sw-trend-cell span,
.sw-impact-coupling-label {
  display: block;
  font-size: 10px;
  color: var(--pl-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sw-impact-cell strong,
.sw-impact-coupling strong,
.sw-trend-cell strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 700;
  color: var(--pl-text);
  line-height: 1.2;
}

.sw-impact-cell small,
.sw-impact-coupling small,
.sw-trend-cell small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--pl-muted);
}

.sw-impact-coupling {
  margin-bottom: 8px;
  padding: 9px 10px;
  border-radius: var(--pl-r-sm);
  border: 1px solid var(--pl-line-subtle);
  background: rgba(255,255,255,.03);
  text-align: left;
}

.sw-impact-coupling.sw-click-card {
  width: 100%;
  border: 1px solid var(--pl-line-subtle);
}

.sw-impact-coupling.sw-click-card:hover {
  background: rgba(255,255,255,.05);
}

.sw-impact-coupling.sw-click-card:focus-visible {
  outline: none;
  border-color: var(--pl-cyan-border);
  box-shadow: 0 0 0 1px rgba(25,181,209,0.3), 0 0 0 4px rgba(25,181,209,0.12);
}

.sw-impact-trends-header {
  margin: 10px 0 6px;
  font-size: 11px;
  color: var(--pl-faint);
}

.sw-trend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.sw-trend-cell strong {
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
}

.sw-trend-cell.is-up strong { color: #9eedb4; }
.sw-trend-cell.is-down strong { color: #f8a3ab; }
.sw-trend-cell.is-flat strong { color: #c7d0db; }

.sw-impact-freshness {
  border-top: 1px solid var(--pl-line-subtle);
  padding-top: 8px;
}

.sw-impact-freshness-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: 11px;
}

.sw-impact-freshness-row span {
  color: var(--pl-faint);
}

.sw-impact-freshness-row strong {
  color: var(--pl-muted);
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

.sw-state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.sw-state-pill-neutral {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.1);
  color: var(--pl-muted);
}

.sw-state-pill-ok {
  background: var(--pl-green-dim);
  border-color: var(--pl-green-border);
  color: #9eedb4;
}

.sw-state-pill-watch {
  background: var(--pl-yellow-dim);
  border-color: var(--pl-yellow-border);
  color: #fde08a;
}

.sw-state-pill-alert {
  background: var(--pl-red-dim);
  border-color: var(--pl-red-border);
  color: #f8a3ab;
}

.sw-state-pill-scene {
  background: var(--pl-blue-dim);
  border-color: var(--pl-blue-border);
  color: #7ac4ff;
}

.sw-trust-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: var(--pl-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.sw-trust-pill-interpretive {
  color: #b6c6d8;
  border-color: rgba(122, 196, 255, 0.18);
  background: rgba(45, 140, 240, 0.12);
}

/* ═══════════════════════════════════════════════════════════
   INFO CARD  (sidebar — epoch / small data block)
═══════════════════════════════════════════════════════════ */

.sw-info-card {
  margin: 0 12px;
  background: rgba(0,0,0,.18);
  border: 1px solid var(--pl-line-subtle);
  border-radius: var(--pl-r-md);
  padding: 8px 10px;
}

.sw-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--pl-muted);
  line-height: 1.4;
}

.sw-info-row + .sw-info-row {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--pl-line-subtle);
}

/* ═══════════════════════════════════════════════════════════
   FILTER / CONTROL ROW  (sidebar)
═══════════════════════════════════════════════════════════ */

.sw-filter-row {
  display: flex;
  width: 100%;
  padding: 0 12px;
}

.sw-filter-btn {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--pl-r-sm);
  border: 1px solid var(--pl-line);
  background: var(--pl-panel-raised);
  color: var(--pl-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background var(--pl-dur-fast) var(--pl-ease),
              color      var(--pl-dur-fast) var(--pl-ease),
              border-color var(--pl-dur-fast) var(--pl-ease);
  user-select: none;
}
.sw-filter-btn:hover { background: rgba(255,255,255,.1); color: var(--pl-text); }
.sw-filter-btn.is-active {
  background: var(--pl-cyan-dim);
  border-color: var(--pl-cyan-border);
  color: var(--pl-cyan);
}

/* ═══════════════════════════════════════════════════════════
   LEGEND  (sidebar)
═══════════════════════════════════════════════════════════ */

.sw-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--pl-muted);
}

.sw-legend span { display: flex; align-items: center; gap: 6px; }

.sw-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sw-dot-sun   { background: #ffcc44; box-shadow: 0 0 4px #ffcc44; }
.sw-dot-earth { background: #2d8cf0; }
.sw-dot-mars  { background: #c7683b; }
.sw-dot-moon  { background: #b0b0b0; }
.sw-dot-cme   { background: #ff5533; opacity: .75; }

/* ═══════════════════════════════════════════════════════════
   COLLAPSIBLES  (sidebar)
═══════════════════════════════════════════════════════════ */

.sw-collapsible {
  border-top: 1px solid var(--pl-line-subtle);
  margin-top: 8px;
}

.sw-collapsible summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  color: var(--pl-muted);
  font-size: 13px;
  transition: color var(--pl-dur-fast) var(--pl-ease);
}
.sw-collapsible summary::-webkit-details-marker { display: none; }
.sw-collapsible summary:hover { color: var(--pl-text); }

.sw-collapsible-title { font-weight: 500; }
.sw-collapsible-caret {
  font-size: 9px;
  transition: transform var(--pl-dur-base) var(--pl-ease);
  color: var(--pl-faint);
}
.sw-collapsible[open] .sw-collapsible-caret { transform: rotate(90deg); }

.sw-collapsible-body {
  padding: 0 12px 12px;
}

.sw-sidebar-block {
  border-top: 1px solid var(--pl-line-subtle);
  margin-top: 8px;
}

.sw-sidebar-block-header {
  padding: 10px 16px 8px;
}

.sw-sidebar-block-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--pl-muted);
}

.sw-sidebar-block-body {
  padding: 0 12px 12px;
}

.sw-section-note {
  font-size: 11px;
  color: var(--pl-faint);
  margin-bottom: 8px;
  padding: 0 4px;
}

/* Body position list (inside collapsible) */
.sw-body-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw-body-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--pl-r-sm);
  background: rgba(0,0,0,.15);
  font-size: 12px;
}
.sw-body-name  { font-weight: 600; color: var(--pl-text); }
.sw-body-coords { font-family: "SF Mono", "Fira Code", Consolas, monospace; color: var(--pl-muted); font-size: 11px; }

/* CME data grid (inside collapsible) */
.sw-cme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.sw-cme-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 8px;
  border-radius: var(--pl-r-sm);
  background: rgba(0,0,0,.18);
  border: 1px solid var(--pl-line-subtle);
}
.sw-cme-cell span { font-size: 10px; color: var(--pl-faint); text-transform: uppercase; letter-spacing: .04em; }
.sw-cme-cell strong { font-size: 13px; color: var(--pl-text); }

/* ═══════════════════════════════════════════════════════════
   TOPBAR — epoch pill
═══════════════════════════════════════════════════════════ */

.sw-topbar-epoch {
  overflow: hidden;
}

.sw-epoch-pill {
  font-size: 11px;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  color: var(--pl-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-topbar-status-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.sw-topbar-state-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sw-topbar-state-pill {
  appearance: none;
  cursor: pointer;
  background-clip: padding-box;
}

.sw-topbar-state-pill:hover,
.sw-topbar-state-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 0 0 3px rgba(0, 229, 255, 0.10);
}

.sw-status-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(20, 27, 35, 0.96);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--pl-dur-fast) var(--pl-ease),
              transform var(--pl-dur-fast) var(--pl-ease);
  z-index: 30;
}

.sw-topbar-state-wrap:hover .sw-status-tooltip,
.sw-topbar-state-wrap:focus-within .sw-status-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.sw-status-tooltip-title {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--pl-text);
}

.sw-status-tooltip-body {
  display: block;
  font-size: 11px;
  line-height: 1.45;
  color: #b8c0ca;
}

/* ═══════════════════════════════════════════════════════════
   RIGHT PANEL  (floating overlay on globe)
═══════════════════════════════════════════════════════════ */

.sw-right-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: 240px;
  background: rgba(30, 38, 48, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--pl-line-subtle);
  border-radius: var(--pl-r-lg);
  box-shadow: var(--pl-shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  transition: opacity var(--pl-dur-base) var(--pl-ease),
              transform var(--pl-dur-base) var(--pl-ease);
}

.sw-right-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--pl-line-subtle);
  flex-shrink: 0;
}
.sw-right-title { font-size: 13px; font-weight: 600; color: var(--pl-text); }
.sw-right-sub   { font-size: 11px; color: var(--pl-faint); margin-top: 2px; }
.sw-right-toggle {
  background: transparent; border: 1px solid var(--pl-line);
  border-radius: var(--pl-r-sm); padding: 3px 8px;
  font-size: 11px; color: var(--pl-muted); cursor: pointer; flex-shrink: 0;
  transition: background var(--pl-dur-fast) var(--pl-ease);
}
.sw-right-toggle:hover { background: var(--pl-line-subtle); color: var(--pl-text); }

.sw-right-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 10px 0 16px;
}

/* Restore button when panel is hidden */
.sw-show-panel-btn {
  position: absolute;
  top: 12px; right: 12px;
  padding: 7px 12px;
  background: rgba(30,38,48,.9);
  border: 1px solid var(--pl-line);
  border-radius: var(--pl-r-pill);
  font-size: 12px; color: var(--pl-muted);
  cursor: pointer; z-index: 10;
  transition: background var(--pl-dur-fast) var(--pl-ease),
              color      var(--pl-dur-fast) var(--pl-ease);
}
.sw-show-panel-btn:hover { background: var(--pl-panel-raised); color: var(--pl-text); }

/* ═══════════════════════════════════════════════════════════
   OVERLAY CARDS  (inside right panel)
═══════════════════════════════════════════════════════════ */

.sw-overlay-card {
  margin: 0 10px 10px;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--pl-line-subtle);
  border-radius: var(--pl-r-md);
  overflow: hidden;
}

.sw-overlay-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--pl-line-subtle);
  font-size: 12px; font-weight: 600;
}
.sw-overlay-card-header small { color: var(--pl-faint); font-weight: 400; }

.sw-overlay-card.sw-overlay-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  list-style: none;
  color: var(--pl-text);
  transition: color var(--pl-dur-fast) var(--pl-ease);
}

.sw-overlay-card.sw-overlay-details > summary::-webkit-details-marker { display: none; }

.sw-overlay-card.sw-overlay-details > summary:hover,
.sw-overlay-card.sw-overlay-details > summary:focus-visible {
  color: var(--pl-cyan);
  outline: none;
}

.sw-overlay-card.sw-overlay-details[open] > summary {
  border-bottom: 1px solid var(--pl-line-subtle);
}

.sw-overlay-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sw-overlay-summary-meta small {
  color: var(--pl-faint);
  font-weight: 400;
}

.sw-overlay-caret {
  font-size: 9px;
  color: var(--pl-faint);
  transition: transform var(--pl-dur-base) var(--pl-ease);
}

.sw-overlay-details[open] .sw-overlay-caret { transform: rotate(90deg); }

.sw-card-titleline-primary {
  color: var(--pl-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.sw-card-header-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sw-card-state-bubble {
  appearance: none;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.06);
  cursor: help;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 8px;
  min-height: 22px;
}

.sw-card-state-bubble:hover {
  border-color: var(--pl-cyan-border);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.12);
}

.sw-card-state-bubble:focus-visible {
  outline: none;
  border-color: var(--pl-cyan-border);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.18);
}

.sw-card-info-btn {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--pl-faint);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color var(--pl-dur-fast) var(--pl-ease),
              border-color var(--pl-dur-fast) var(--pl-ease),
              background var(--pl-dur-fast) var(--pl-ease);
}

.sw-card-info-btn:hover {
  color: var(--pl-cyan);
  border-color: var(--pl-cyan-border);
  background: var(--pl-cyan-dim);
}

.sw-card-info-btn:focus-visible {
  outline: none;
  color: var(--pl-cyan);
  border-color: var(--pl-cyan-border);
  box-shadow: 0 0 0 3px rgba(25,181,209,0.12);
}

.sw-panel-section-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 10px 8px;
}

.sw-panel-section-header > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--pl-text);
}

.sw-panel-section-header small {
  color: var(--pl-faint);
  font-size: 10px;
}

/* Toggle rows with info button */
.sw-toggle-row {
  display: flex;
  align-items: center;
  padding-left: 6px;
}
.sw-toggle-row .sw-toggle {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 2px;
}

.sw-layer-info-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--pl-faint);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color var(--pl-dur-fast) var(--pl-ease),
              border-color var(--pl-dur-fast) var(--pl-ease),
              background var(--pl-dur-fast) var(--pl-ease);
  user-select: none;
}
.sw-layer-info-btn:hover {
  color: var(--pl-cyan);
  border-color: var(--pl-cyan-border);
  background: var(--pl-cyan-dim);
}

/* Toggle rows */
.sw-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--pl-muted);
  user-select: none;
  transition: color var(--pl-dur-fast) var(--pl-ease);
}
.sw-toggle:hover { color: var(--pl-text); }

/* ── Pill toggle switch ──────────────────────────────────────────────────── */
.sw-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}
.sw-switch input { display: none; }

.sw-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.14);
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.28s;
}
.sw-slider::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 3px;
  bottom: 3px;
  background: var(--pl-muted);
  border-radius: 50%;
  transition: transform 0.28s, background 0.28s;
}
.sw-switch input:checked + .sw-slider {
  background: var(--pl-cyan);
}
.sw-switch input:checked + .sw-slider::before {
  transform: translateX(16px);
  background: #fff;
}

/* Data grid (solar wind values) */
.sw-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--pl-line-subtle);
}
.sw-data-grid > * {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: rgba(0,0,0,.15);
}

.sw-data-card {
  min-width: 0;
}

.sw-data-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sw-data-card-head span {
  min-width: 0;
}

.sw-data-grid > .sw-click-card {
  border: 0;
  text-align: left;
  cursor: pointer;
}

.sw-data-grid > .sw-click-card:hover {
  background: rgba(0,0,0,.22);
}

.sw-data-grid > .sw-click-card:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(25,181,209,0.34);
}
.sw-data-grid span  { font-size: 10px; color: var(--pl-faint); text-transform: uppercase; letter-spacing: .04em; }
.sw-data-grid strong { font-size: 13px; font-weight: 600; color: var(--pl-text); }

.sw-data-updated {
  padding: 6px 10px;
  font-size: 10px;
  color: var(--pl-faint);
  border-top: 1px solid var(--pl-line-subtle);
}

/* Body position list in right panel */
.sw-body-position-list {
  display: flex;
  flex-direction: column;
}
.sw-body-position-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 6px;
  align-items: baseline;
  padding: 7px 10px;
  font-size: 11px;
  border-bottom: 1px solid var(--pl-line-subtle);
}
.sw-body-position-row:last-child { border-bottom: none; }
.sw-body-position-row .name  { font-weight: 600; color: var(--pl-text); }
.sw-body-position-row .coords {
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  color: var(--pl-muted);
  font-size: 10px;
}

/* Astro / source cells */
.sw-astro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 10px 10px;
}
.sw-astro-cell {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 10px;
  background: rgba(0,0,0,.18);
  border: 1px solid var(--pl-line-subtle);
  border-radius: var(--pl-r-md);
}
.sw-astro-label { font-size: 10px; color: var(--pl-faint); margin-bottom: 2px; }
.sw-astro-cell strong { font-size: 13px; font-weight: 600; }
.sw-astro-cell small  { font-size: 10px; color: var(--pl-faint); }

.sw-epoch-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px !important;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  line-height: 1.2;
}

.sw-epoch-date,
.sw-epoch-time {
  display: block;
  white-space: nowrap;
}

.sw-epoch-time {
  color: var(--pl-muted);
  font-size: 10px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR TOGGLE — mini / closed variants
   Reuse Pelorus data-sidebar attribute
═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   SUVI SOLAR IMAGES  (right panel collapsible)
═══════════════════════════════════════════════════════════ */

/* 2-column image grid */
.sw-suvi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 8px 8px 4px;
}

.sw-suvi-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border-radius: var(--pl-r-sm);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--pl-line-subtle);
  cursor: pointer;
  appearance: none;
  text-align: left;
  font: inherit;
  transition: border-color var(--pl-dur-fast) var(--pl-ease), transform var(--pl-dur-fast) var(--pl-ease), box-shadow var(--pl-dur-fast) var(--pl-ease);
}
.sw-suvi-item:hover {
  border-color: var(--pl-cyan-border);
  transform: translateY(-1px);
}
.sw-suvi-item:focus-visible {
  outline: none;
  border-color: var(--pl-cyan);
  box-shadow: 0 0 0 1px rgba(25,181,209,0.35), 0 0 0 4px rgba(25,181,209,0.14);
}

.sw-suvi-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #000;
}

.sw-suvi-label {
  padding: 3px 4px;
  text-align: center;
  background: rgba(0,0,0,.4);
}
.sw-suvi-wave {
  display: block;
  font-size: 11px;
  font-weight: 700;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  color: var(--pl-cyan);
}
.sw-suvi-desc {
  display: block;
  font-size: 9px;
  color: var(--pl-faint);
  line-height: 1.2;
}

.sw-suvi-modal {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 18px;
  align-items: start;
}

.sw-suvi-modal-figure {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(25,181,209,0.12), transparent 48%),
    #02060b;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.sw-suvi-modal-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #000;
}

.sw-suvi-modal-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 12px;
  font-size: 11px;
  color: var(--pl-faint);
}

.sw-suvi-modal-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sw-suvi-modal-kicker {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pl-cyan);
}

.sw-suvi-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sw-suvi-modal-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--pl-text);
  font-size: 11px;
}

.sw-suvi-modal-copy p {
  margin: 0;
  color: var(--pl-muted);
  line-height: 1.6;
}

.sw-suvi-modal-section {
  padding: 12px 13px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
}

.sw-suvi-modal-section h3 {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--pl-text);
}

.sw-suvi-modal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(25,181,209,0.3);
  background: rgba(25,181,209,0.12);
  color: #7edaf1;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: background var(--pl-dur-fast) var(--pl-ease), border-color var(--pl-dur-fast) var(--pl-ease), color var(--pl-dur-fast) var(--pl-ease);
}

.sw-suvi-modal-link:hover,
.sw-suvi-modal-link:focus-visible {
  background: rgba(25,181,209,0.18);
  border-color: rgba(25,181,209,0.5);
  color: #b7f2ff;
  outline: none;
}

@media (max-width: 860px) {
  .sw-suvi-modal {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR TOGGLE — mini / closed variants
   Reuse Pelorus data-sidebar attribute
═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   FLARE ALERT CARD
   Floats bottom-left of the globe area; slides in on M/X events.
═══════════════════════════════════════════════════════════ */

.sw-flare-alert {
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: 300px;
  background: rgba(20, 24, 32, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--pl-r-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.65);
  padding: 12px 14px 10px;
  z-index: 20;
  /* Hidden by default — slide in when .is-visible is added */
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.sw-flare-alert.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sw-flare-alert-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sw-flare-alert-badge {
  font-size: 22px;
  font-weight: 800;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  line-height: 1;
  flex-shrink: 0;
  /* color set by JS per flare class */
}

.sw-flare-alert-text {
  flex: 1 1 auto;
  min-width: 0;
}
.sw-flare-alert-title {
  font-size: 12px;
  font-weight: 600;
  color: #e8eef4;
}
.sw-flare-alert-time {
  font-size: 10px;
  color: var(--pl-faint);
  margin-top: 2px;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
}

.sw-flare-alert-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #606878;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--pl-r-sm);
  line-height: 1;
  transition: color var(--pl-dur-fast) var(--pl-ease);
  align-self: flex-start;
}
.sw-flare-alert-close:hover { color: #e8eef4; }

.sw-flare-alert-desc {
  margin-top: 8px;
  font-size: 12px;
  color: #b0bac4;
  line-height: 1.5;
}

.sw-flare-alert-detail {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: #707a88;
  line-height: 1.5;
}

/* Colour variants for left border accent */
.sw-flare-alert.sw-flare-c { border-left: 3px solid #4fc3f7; }
.sw-flare-alert.sw-flare-m { border-left: 3px solid #f2b705; }
.sw-flare-alert.sw-flare-x { border-left: 3px solid #e63b4a; }

.sw-bz-drawer {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: min(860px, calc(100% - 380px));
  min-width: 360px;
  padding: 14px 16px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(15, 20, 28, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 44px rgba(0,0,0,0.48);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  z-index: 18;
  transition: opacity 180ms ease, transform 180ms ease;
}

.sw-bz-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.sw-bz-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.sw-bz-drawer-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pl-cyan);
}

.sw-bz-drawer-title {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--pl-text);
}

.sw-bz-drawer-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: var(--pl-faint);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: color var(--pl-dur-fast) var(--pl-ease),
              border-color var(--pl-dur-fast) var(--pl-ease),
              background var(--pl-dur-fast) var(--pl-ease);
}

.sw-bz-drawer-close:hover,
.sw-bz-drawer-close:focus-visible {
  color: var(--pl-text);
  border-color: var(--pl-cyan-border);
  background: rgba(25,181,209,0.12);
  outline: none;
}

.sw-bz-drawer-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--pl-faint);
}

.sw-bz-drawer-chart-wrap {
  position: relative;
  margin-top: 12px;
  min-height: 252px;
}

.sw-bz-chart {
  min-height: 252px;
}

.sw-bz-drawer-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  color: var(--pl-faint);
  font-size: 12px;
  z-index: 1;
}

.sw-bz-drawer-status.is-hidden {
  display: none;
}

@media (max-width: 1200px) {
  .sw-bz-drawer {
    width: min(760px, calc(100% - 220px));
  }
}

@media (max-width: 860px) {
  .sw-bz-drawer {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    min-width: 0;
    transform: translateY(18px);
  }

  .sw-bz-drawer.is-open {
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════
   LAYER INFO PANELS  (jsPanel 4 — dark theme override)
═══════════════════════════════════════════════════════════ */

.jsPanel.sw-info-panel {
  background: #1e2630 !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
}

/* Header */
.jsPanel.sw-info-panel .jsPanel-hdr {
  background: #1e2630 !important;
  border-bottom: 1px solid rgba(255,255,255,0.10) !important;
}
.jsPanel.sw-info-panel .jsPanel-hdr .jsPanel-title {
  color: #e8eef4 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

/* Header control buttons (close, etc.) */
.jsPanel.sw-info-panel .jsPanel-btn svg,
.jsPanel.sw-info-panel .jsPanel-btn span {
  color: #8090a0 !important;
  fill: #8090a0 !important;
}
.jsPanel.sw-info-panel .jsPanel-btn:hover svg,
.jsPanel.sw-info-panel .jsPanel-btn:hover span {
  color: #e8eef4 !important;
  fill: #e8eef4 !important;
}

/* Content area */
.jsPanel.sw-info-panel .jsPanel-content {
  background: #141b23 !important;
  color: #c8d0d8 !important;
}

/* Content body — text styles */
.sw-info-panel-body {
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.65;
  color: #c8d0d8;
}
.sw-info-panel-body p {
  margin: 0 0 10px;
  color: #b0bac4;
}
.sw-info-panel-body p:first-child {
  color: #c8d0d8;
}
.sw-info-panel-body h4 {
  margin: 12px 0 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #00e5ff;
}

/* Notification button badge */
.sw-notif-btn { position: relative; }
.sw-notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: #e63b4a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

/* Notification panel */
.sw-notif-panel { max-height: 70vh; overflow-y: auto; }
.sw-notif-empty { color: #6a7a8a; font-style: italic; padding: 8px 0; }
.sw-notif-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sw-notif-item:last-child { border-bottom: none; }
.sw-notif-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.sw-notif-title { font-weight: 600; font-size: 12.5px; }
.sw-notif-age   { font-size: 11px; color: #5a6a7a; white-space: nowrap; flex-shrink: 0; }
.sw-notif-detail { font-size: 12px; color: #8a9aaa; line-height: 1.5; }
.sw-notif-aurora {
  margin-top: 6px;
  padding: 7px 10px;
  background: rgba(0, 180, 130, 0.10);
  border-left: 2px solid #00b482;
  border-radius: 0 4px 4px 0;
  font-size: 12px;
  color: #a0d4c0;
  line-height: 1.55;
}
.sw-notif-aurora-icon { margin-right: 5px; }

.sw-info-panel-body.sw-datasources h4:first-child { margin-top: 0; }
.sw-datasources ul {
  margin: 0 0 10px;
  padding-left: 18px;
}
.sw-datasources li {
  margin-bottom: 5px;
  color: #b0bac4;
  font-size: 12.5px;
}
.sw-datasources a {
  color: #4fc3f7;
  text-decoration: none;
}
.sw-datasources a:hover {
  color: #81d4fa;
  text-decoration: underline;
}
.sw-datasources code {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11.5px;
  color: #a5d6a7;
}

/* When sidebar is closed, globe expands to full width */
.pl-shell[data-sidebar="closed"] {
  grid-template-columns: 0 1fr;
}
.pl-shell[data-sidebar="mini"] {
  grid-template-columns: 54px 1fr;
}

/* ═══════════════════════════════════════════════════════════
   SOLAR WIND MONITOR PANEL LAYOUT
   .sw-mon-* — structural classes for the jsPanel content area.
═══════════════════════════════════════════════════════════ */

/* Panel chrome — override jsPanel's default white-theme inline styles */
#sw-monitor-panel { box-shadow: 0 12px 40px rgba(0,0,0,0.65) !important; }
#sw-monitor-panel .jsPanel-hdr-toolbar .jsPanel-btn svg { fill: rgba(255,255,255,0.45) !important; }
#sw-monitor-panel .jsPanel-btn:hover { background: rgba(255,255,255,0.08) !important; }

/* Content wrapper */
.sw-mon-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 8px 10px 6px;
  box-sizing: border-box;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  color: #f2f4f7;
  overflow-y: auto;
  background: #2d343c;
}

/* Status / controls bar */
.sw-mon-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sw-mon-aurora {
  font-size: 10px;
  padding: 2px 9px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.sw-mon-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sw-mon-mode-grp {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 2px;
}
._swMode {
  padding: 3px 11px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  border: none;
  background: transparent;
  color: #7a8694;
  transition: all 100ms;
}
._swMode:hover { background: rgba(255,255,255,0.07); color: #f2f4f7; }
._swMode.active {
  background: rgba(25,181,209,0.18);
  color: #19b5d1;
  box-shadow: inset 0 0 0 1px rgba(25,181,209,0.3);
}
.sw-mon-refresh {
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  color: #19b5d1;
  transition: background 100ms;
}
.sw-mon-refresh:hover { background: rgba(25,181,209,0.12); }

/* Legend row */
.sw-mon-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Footer */
.sw-mon-footer {
  margin-top: 4px;
  font-size: 9px;
  color: #7a8694;
  text-align: right;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Loading spinner */
.sw-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: #19b5d1;
  border-radius: 50%;
  animation: sw-spin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes sw-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
   BILLBOARD.JS DARK THEME
   Overrides default white/light styles for the sw-monitor charts.
   Scoped to .sw-bb-chart so unrelated bb instances are unaffected.
═══════════════════════════════════════════════════════════ */

/* Frame / card that wraps each chart label + SVG */
.sw-chart-frame {
  background: rgba(30, 38, 48, 0.92);   /* matches right-panel sidebar */
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  margin: 0 0 5px;
  overflow: hidden;
}

/* Chart title label above each chart */
.sw-chart-label {
  font-size: 9px;
  color: #b8c0ca;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  padding: 6px 0 0 54px;
}

/* SVG backgrounds */
.sw-bb-chart .bb svg { background: transparent !important; }
.sw-bb-chart .bb-chart { background: transparent; }

/* Axis lines and tick marks */
.sw-bb-chart .bb-axis path,
.sw-bb-chart .bb-axis line { stroke: rgba(255,255,255,0.08) !important; }

/* Axis tick labels */
.sw-bb-chart .bb-axis text {
  fill: #7a8694 !important;
  font-size: 9px !important;
  font-family: "SF Mono", "Fira Code", Consolas, monospace !important;
}

/* Default grid lines (off, but just in case) */
.sw-bb-chart .bb-ygrid line,
.sw-bb-chart .bb-xgrid line { stroke: rgba(255,255,255,0.04); }

/* Named threshold / reference lines (grid.y.lines) */
.sw-bb-chart .bb-ygrid-line line       { stroke-width: 0.8; stroke-dasharray: 5,3; }
.sw-bb-chart .bb-ygrid-line text       { font-size: 8px !important; font-family: "SF Mono","Fira Code",Consolas,monospace !important; }
.sw-bb-chart .bb-ygrid-line.sw-ref-zero line    { stroke: rgba(255,255,255,0.05); stroke-dasharray: 2,2; }
.sw-bb-chart .bb-ygrid-line.sw-ref-mod line     { stroke: #f2b705; }
.sw-bb-chart .bb-ygrid-line.sw-ref-mod text     { fill: #f2b705 !important; }
.sw-bb-chart .bb-ygrid-line.sw-ref-strong line  { stroke: #e63b4a; }
.sw-bb-chart .bb-ygrid-line.sw-ref-strong text  { fill: #e63b4a !important; }
.sw-bb-chart .bb-ygrid-line.sw-ref-fast line    { stroke: #2d8cf0; }
.sw-bb-chart .bb-ygrid-line.sw-ref-fast text    { fill: #2d8cf0 !important; }
.sw-bb-chart .bb-ygrid-line.sw-ref-den line     { stroke: #f2b705; }
.sw-bb-chart .bb-ygrid-line.sw-ref-den text     { fill: #f2b705 !important; }
.sw-bb-chart .bb-ygrid-line.sw-ref-away-band line   { stroke: rgba(231,59,74,0.25); stroke-dasharray: 2,2; }
.sw-bb-chart .bb-ygrid-line.sw-ref-toward-band line { stroke: rgba(25,181,209,0.25); stroke-dasharray: 2,2; }

.sw-bb-chart .bb-ygrid-line.sw-flare-base line { stroke: rgba(255,255,255,0.08); stroke-dasharray: 2,2; }
.sw-bb-chart .bb-ygrid-line.sw-flare-base text { fill: rgba(255,255,255,0.46) !important; }
.sw-bb-chart .bb-ygrid-line.sw-flare-b line { stroke: rgba(147,161,179,0.55); stroke-dasharray: 4,3; }
.sw-bb-chart .bb-ygrid-line.sw-flare-b text { fill: #93a1b3 !important; }
.sw-bb-chart .bb-ygrid-line.sw-flare-c line { stroke: rgba(57,208,173,0.6); stroke-dasharray: 4,3; }
.sw-bb-chart .bb-ygrid-line.sw-flare-c text { fill: #39d0ad !important; }
.sw-bb-chart .bb-ygrid-line.sw-flare-m line { stroke: rgba(255,178,74,0.68); stroke-dasharray: 4,3; }
.sw-bb-chart .bb-ygrid-line.sw-flare-m text { fill: #ffb24a !important; }
.sw-bb-chart .bb-ygrid-line.sw-flare-x line { stroke: rgba(255,107,107,0.72); stroke-dasharray: 4,3; }
.sw-bb-chart .bb-ygrid-line.sw-flare-x text { fill: #ff6b6b !important; }

/* Storm event and data gap regions */
.sw-bb-chart .bb-region.sw-evt-strong   rect { fill: #e63b4a; opacity: 0.10; }
.sw-bb-chart .bb-region.sw-evt-moderate rect { fill: #f2b705; opacity: 0.09; }
.sw-bb-chart .bb-region.sw-evt-fast     rect { fill: #2d8cf0; opacity: 0.07; }
.sw-bb-chart .bb-region.sw-gap          rect { fill: rgba(255,255,255,0.02); stroke: rgba(255,255,255,0.06); stroke-width: 0.5; }

/* Tooltip — billboard positions .bb-tooltip-container outside .sw-bb-chart,
   so these rules must be global (no .sw-bb-chart scope). */
.bb-tooltip-container .bb-tooltip {
  background: #2d343c !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  font-family: "SF Mono","Fira Code",Consolas,monospace;
  font-size: 10px;
}
.bb-tooltip-container .bb-tooltip th {
  background: #353d46 !important;
  color: #f2f4f7 !important;
  padding: 3px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.bb-tooltip-container .bb-tooltip td {
  background: transparent !important;
  color: #f2f4f7 !important;
  padding: 2px 8px;
}
.bb-tooltip-container .bb-tooltip td.name  { color: #b8c0ca !important; }
.bb-tooltip-container .bb-tooltip td.value { color: #f2f4f7 !important; font-weight: 500; }

/* Focus / crosshair line */
.sw-bb-chart .bb-xgrid-focus line { stroke: rgba(25,181,209,0.55); stroke-width: 1px; }

.sw-bb-chart .sw-history-stems line {
  stroke-width: 1.15;
  pointer-events: none;
}

.sw-bb-chart .sw-history-stems line.is-b { stroke: #93a1b3 !important; }
.sw-bb-chart .sw-history-stems line.is-c { stroke: #39d0ad !important; }
.sw-bb-chart .sw-history-stems line.is-m { stroke: #ffb24a !important; }
.sw-bb-chart .sw-history-stems line.is-x { stroke: #ff6b6b !important; }
.sw-bb-chart .sw-history-stems line.is-default { stroke: #ffb24a !important; }
