html {
  font-size: 112.5%;  /* 16px → 18px */
}
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020617;
}

/* Global spacing variables */
:root {
  --app-gutter: 10px;   /* horizontal margin from edges */
  --app-bottom: 10px;   /* distance from bottom */
  --app-gap: 8px;       /* gap between UI elements */
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

/* ---------------- Menu button ---------------- */
#togglePanel {
  position: absolute;
  bottom: var(--app-bottom);
  left: var(--app-gutter);
  z-index: 11;
  min-width: 90px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,64,175,0.96));
  border: 1px solid rgba(148,163,184,0.6);
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
  padding: 0 12px;
}

#togglePanel span.icon {
  font-size: 18px;
  line-height: 1;
}

#togglePanel:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
}

/* ---------------- Left main controls panel ---------------- */
#controls {
  position: absolute;
  bottom: calc(var(--app-bottom) + 46px); /* sits above menu/timebar */
  left: var(--app-gutter);
  background: linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,64,175,0.96));
  color: #fff;
  padding: 12px 16px;
  border-radius: 16px;
  z-index: 1000;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* min-width: 400px;
  max-width: 440px; */
  width: clamp(260px, 20vw, 440px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148,163,184,0.6);
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

#controls.collapsed {
  transform: translateX(-110%);
  opacity: 0;
  pointer-events: none;
}

.controls-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #bfdbfe;
  margin-bottom: 2px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.control-row + .control-row {
  margin-top: 2px;
}

.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #cbd5f5;
  opacity: 0.9;
  margin-top: 2px;
}

#timeLabel {
  font-weight: 600;
  min-width: 60px;
  text-align: right;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

#timeHint {
  font-size: 11px;
  color: #e5e7eb;
  opacity: 0.8;
  width: 100%;
  display: none !important;  /* always hidden now */
}

#saveImageBtn .map-ctrl-label {
  font-size: 16px;
}

/* ---------------- Bottom-center time bar (desktop / tablet) ---------------- */
#timebar {
  position: absolute;
  left: 50%;
  bottom: calc(var(--app-bottom) + 8px);
  transform: translateX(-50%);
  z-index: 9;
  padding: 8px 16px 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,64,175,0.96));
  border: 1px solid rgba(148,163,184,0.7);
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
}

#timebar .section-label {
  margin-top: 0;
}

#timebar #timeSlider {
  width: 260px;
}

/* ---------------- Valid time label inside menu ---------------- */
#validTime {
  font-size: 12px;
  color: #e5e7eb;
  opacity: 0.95;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,0.85);
  border: 1px solid rgba(148,163,184,0.5);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#validTime span.label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #a5b4fc;
}

/* ---------------- External forecast datetime pill ---------------- */
#validDayBubble {
  position: absolute;
  top: var(--app-gutter);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  max-width: 350px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  color: #f9fafb;
  border: 1px solid rgba(148,163,184,0.7);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);

  white-space: nowrap;      /* keep everything one line */
  overflow: hidden;         /* optional: prevent spill */
  text-overflow: ellipsis;  /* optional: add "…" if too narrow */
}

#validDayBubble .label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: #93c5fd;
}

#validDayText {
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-weight: 500;
}

/* ---------------- Form elements ---------------- */
select {
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;
  outline: none;
}

select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56,189,248,0.6);
}

.pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.6);
  padding: 3px 10px;
  font-size: 11px;
  background: rgba(15,23,42,0.88);
  color: #e5e7eb;
  cursor: pointer;
  transition: all 0.15s ease-out;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.pill:hover {
  border-color: #38bdf8;
  background: rgba(30,64,175,0.95);
}

.pill.active {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  border-color: transparent;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(15,23,42,0.8);
}

.pill .sub {
  font-size: 10px;
  opacity: 0.85;
}

.row-label {
  min-width: 44px;
  font-size: 12px;
  color: #e5e7eb;
  opacity: 0.85;
}

.spacer {
  flex: 1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.checkbox-row input[type="checkbox"] {
  accent-color: #38bdf8;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.checkbox-row label {
  cursor: pointer;
  font-size: 13px;
}

/* ---------------- MapLibre nav controls ---------------- */
.maplibregl-ctrl-top-right {
  top: calc(var(--app-gutter) + 52px);  /* leave space for info button */
  right: var(--app-gutter);
}

.maplibregl-ctrl-bottom-right {
  bottom: var(--app-bottom);
  right: var(--app-gutter);
}

.maplibregl-ctrl-top-right .maplibregl-ctrl-group {
  border-radius: 999px;
  background: linear-gradient(180deg, #020617, #1d4ed8) !important;
  border: 1px solid rgba(15,23,42,0.9);
  box-shadow: 0 4px 14px rgba(15,23,42,0.55) !important;
  overflow: hidden;
}

.maplibregl-ctrl-group button {
  background: transparent !important;
  color: #ffffff !important;
  border-radius: 0;
  border: none;
  width: 32px;
  height: 32px;
  font-weight: 700;
  cursor: pointer;
}

.maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(100%) brightness(200%) !important;
}

.maplibregl-ctrl-group button + button {
  border-top: 1px solid rgba(255,255,255,0.25) !important;
}

.maplibregl-ctrl-group button:hover {
  background: rgba(96,165,250,0.85) !important;
}

.maplibregl-ctrl-group button:hover .maplibregl-ctrl-icon {
  filter: invert(100%) brightness(200%) !important;
}
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
}

.loading-overlay.hidden {
  display: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* --- PILL STYLE (matches app pills) --- */
.loading-pill {
  padding: 6px 16px;
  background: #0ea5e9;                 /* cyan-500 */
  color: white;
  font-size: 16px;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5); /* glow */
}

/* --- Spinner --- */
.loading-spinner {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 4px solid rgba(148, 163, 184, 0.45);
  border-top-color: #38bdf8; /* cyan accent */
  animation: spin 0.75s linear infinite;
}

.last-update-text {
  margin-top: 15px;
  padding-top: 10px;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-weight: 300;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: left;
  line-height: 1.3;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------- Info button (top-right) ------- */
body .info-button,
body #infoButton {
  position: fixed;                   /* <── was absolute */
  top: var(--app-gutter);
  right: var(--app-gutter);
  z-index: 1200;                     /* above panels */

  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,64,175,0.96));
  border: 1.5px solid rgba(255,255,255,0.45);
  color: #e5e7eb;
  font-size: 20px;
  font-weight: 700;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  box-shadow: 0 4px 14px rgba(0,0,0,0.45);

  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}


.info-button:hover {
  border-color: #38bdf8;
  box-shadow: 0 6px 18px rgba(15,23,42,0.7);
}

/* ------- Info modal ------- */
.info-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.70);
  backdrop-filter: blur(6px);
  display: none;                 /* hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 1100;

  /* NEW: allow scrolling if content is taller than viewport */
  overflow-y: auto;
  padding: 16px 10px;  /* small padding so content isn't glued to edges */
}

.info-modal.open {
  display: flex;
}

.info-modal-content {
  max-width: 520px;
  width: min(520px, 90vw);
  background: linear-gradient(135deg, rgba(15,23,42,0.98), rgba(30,64,175,0.98));
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.8);
  box-shadow: 0 20px 40px rgba(0,0,0,0.55);
  padding: 18px 20px 16px;
  color: #e5e7eb;

  max-height: 80vh;
  overflow-y: auto;
}

.info-modal-title {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #bfdbfe;
  margin-bottom: 4px;
}

.info-modal-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 10px;
}

.info-modal-text {
  font-size: 13px;
  line-height: 1.5;
  color: #e5e7eb;
  opacity: 0.95;
  margin-bottom: 14px;
}

/* Links inside the info modal */
.info-modal-content a {
  color: #ffffff;
  text-decoration: underline;
}

.info-modal-content a:hover {
  opacity: 0.8;
}

.info-close-pill {
  margin-top: 4px;
  padding-inline: 14px;
  font-size: 12px;
}



/* ---------------- Snow tag (single sampling flag) ---------------- */
.snow-tag-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

.snow-tag {
  background: linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,64,175,0.96));
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  color: #e5e7eb;
  font-size: 12px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.45);
  white-space: nowrap;
  cursor: pointer;
}

/* Tag bubble */
.snow-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,64,175,0.96));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.snow-tag-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  color: #bfdbfe;
}

.snow-tag-value {
  font-weight: 800;
  font-size: 12px;
  min-width: 50px;
  text-align: right;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.snow-tag-stem {
  width: 3px;
  height: 75px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
}

/* Dot at the point */
.snow-tag-dot {
  width: 15px;
  height: 15px;
  margin-top: 3px;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 0 0 rgba(56,189,248,0.9);
  animation: snowPointPulse 1.4s infinite;
}

/* --- NEW --- Close “×” button inside tag */
.snow-tag-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  background: #ffffff;
  color: #1e3a8a;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.snow-tag:hover {
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
  transition: all 0.2s ease;
}

.snow-tag-close:hover {
  background: #ff0000;
}

@keyframes snowPointPulse {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(56,189,248,0.9);
    opacity: 1;
  }
  70% {
    transform: scale(1.6);
    box-shadow: 0 0 0 8px rgba(56,189,248,0);
    opacity: 0;
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(56,189,248,0);
    opacity: 1;
  }
}

/* -------- Mobile quick filters (model/run/param) -------- */
#mobileQuickFilters {
  position: absolute;
  right: var(--app-gutter);
  bottom: 268px;
  z-index: 10;

  display: none;              /* 👈 hidden by default */
  flex-direction: column;
  gap: 6px;
}

#mobileQuickFilters select {
  width: 60px;
  height: 30px;                 /* ← exact same height as before */
  font-size: 10px;              /* readable but compact */
  line-height: 30px;            /* centers text vertically */
  padding: 0 28px 0 10px;       /* text fits, arrow has space */

  color: #f1f5f9;
  background: #141d36;

  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.45);
  box-shadow: 0 2px 4px rgba(0,0,0,0.35);

  appearance: none;
  backdrop-filter: blur(4px);

  background-image: url("data:image/svg+xml,%3Csvg fill='white' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7l5 5 5-5H5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 12px;
  background-position: right 8px center;
}



/* --- Legend container --- */
#legendContainer {
  position: absolute;
  bottom: 55px;
  right: 12px;

  /* SAME background as toggle menu */
  background: linear-gradient(135deg, rgba(15,23,42,0.96), rgba(30,64,175,0.96));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);

  padding: 12px 14px;
  border-radius: 12px;

  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}


/* Title */
#legendTitle {
  font-size: 12px;
  color: #fff;
  margin-bottom: 18px;
  letter-spacing: 0.3px;
}

/* Bar itself */
#legendBar {
  width: 16px;
  height: 187px;   /* adjust as you want */
  border-radius: 9px;
  background: linear-gradient(
    to top,
    #3f3b97,
    #434ebb,
    #4667de,
    #4681f7,
    #26bfe9,
    #18ddc2,
    #46f884,
    #9dfe40,
    #b7f735,
    #d5e735,
    #ead439,
    #fea732,
    #f56918,
    #e14109

  );
  border: 2px solid rgb(95, 95, 95);
}

/* Tick labels */
/* Arrange bar + ticks horizontally */
#legendRow {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;         /* space between bar and ticks */
}

/* Make ticks stack vertically on the right */
#legendTicks {
  display: flex;
  flex-direction: column;
  align-items: flex-start;   /* numbers align left */
  justify-content: space-between; /* distribute evenly */
  height: 195px;             /* SAME height as legendBar */
  color: white;
  font-size: 10px;
  line-height: 13px;
}

#legendTicks div {
  transform: translateY(-3px); /* micro-adjust if needed */
}
/* -------- Custom vertical control panel (top-right) -------- */
/* -------- Custom vertical control panel (top-right) -------- */
.map-control-panel {
  position: absolute;
  top: calc(var(--app-gutter) + 52px);
  right: var(--app-gutter);
  z-index: 11;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Generic hidden helper if you don't already have one */
.hidden {
  display: none !important;
}

/* Basemap zoom warning (under basemap select) */
#basemapWarning {
  margin-top: 4px;
  padding: 4px 10px;
  border-radius: 999px;

  /* Same glassy panel vibe */
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(248, 250, 252, 0.18);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);

  display: inline-flex;
  align-items: center;
  gap: 6px;

  font-size: 11px;
  line-height: 1.3;
  color: #fed7aa; /* warm amber text */

  text-transform: none;  /* keep it readable, not shouty */
}

/* Small exclamation icon chip */
#basemapWarning .icon {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 11px;
  font-weight: 700;
  background: #f97316;         /* amber-500 */
  color: #0f172a;              /* slate-900 */
}

/* Text part – slightly dimmer than icon */
#basemapWarning .text {
  opacity: 0.95;
}


/* Outer block (each “tile” in your screenshot) */
.map-ctrl-group {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #020617, #1d4ed8);
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.8);
  box-shadow: 0 4px 14px rgba(0,0,0,0.55);
  overflow: hidden;
}

/* Single-button blocks ( ! and bearing ) */
.map-ctrl-single {
  padding: 0;
}

/* Inner buttons ( +, -, 2D, 3D ) */
.map-ctrl-btn,
.map-ctrl-single .map-ctrl-label {
  width: 32px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

/* Make the text element inside .map-ctrl-single clickable */
.map-ctrl-single {
  cursor: pointer;
}
.map-ctrl-single .map-ctrl-label {
  font-size: 18px;
}

/* Thin white lines between stacked buttons ( + / −, 2D / 3D ) */
.map-ctrl-group .map-ctrl-btn + .map-ctrl-btn {
  border-top: 1px solid rgba(255,255,255,0.25);
}

/* 2D / 3D specific tweaks */
.map-ctrl-group-2d3d .map-ctrl-btn {
  font-size: 12px;
}

/* Use existing pill active styling for selected (blue) look */
.map-ctrl-group-2d3d .pill {
  border-radius: 0;  /* flat inside the group */
  border: none;
}
.map-ctrl-group-2d3d .pill:first-child {
  border-bottom: 1px solid rgba(255,255,255,0.25);
}
.map-ctrl-group-2d3d .pill.active {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #0f172a;
  font-weight: 700;
}


/* hover cities */
.city-hover-popup {
  font-size: 11px;
  line-height: 1.3;
}

.city-hover-popup strong {
  font-size: 12px;
}

/* Optional hover */
/* ----- HOVER: identical to the app menu buttons ----- */
.map-ctrl-group,
.map-ctrl-btn,
.map-ctrl-single {
  transition: 
    box-shadow 0.2s ease,
    filter 0.2s ease,
    border-color 0.2s ease;
}

/* Apply hover effect to groups and buttons */
.map-ctrl-group:hover,
.map-ctrl-btn:hover,
.map-ctrl-single:hover {
  border-color: #38bdf8;
  box-shadow: 0 6px 18px rgba(15,23,42,0.7);
  filter: brightness(1.15);
}

.compass-img {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.6));
  transition: transform 0.2s linear;
}
/* ---------------- Highcharts panel ---------------- */
#chartPanel {
  position: absolute;
  top: var(--app-gutter);
  left: var(--app-gutter);
  transform: none;
  z-index: 40;

  width: clamp(280px, 40vw, 700px);
  max-width: 96vw;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  height: auto;

  background: linear-gradient(135deg, rgba(15,23,42,0.97), rgba(30,64,175,0.97));
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.7);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
  display: none;
  flex-direction: column;
}

#chartPanelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 4px;
  color: #e5e7eb;
  font-size: 13px;
}

/* --- Chart-specific loading overlay (inside the diagram box) --- */
#chartPanel {
  position: absolute; /* you already have this; just make sure it's not static */
  /* ... your existing chartPanel styles ... */
}

/* Overlay that sits *inside* the chart panel, above #chartContainer but below header */
#chartLoadingOverlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  /* leave header visible: ~ header height (8px padding + ~24px line-height) */
  top: 36px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  background: radial-gradient(circle at top, rgba(15,23,42,0.85), rgba(15,23,42,0.97));
  backdrop-filter: blur(6px);

  z-index: 5;
  pointer-events: none; /* so you can still close the panel while it loads */
}

/* hidden state (JS will toggle this class) */
#chartLoadingOverlay.hidden {
  display: none;
}

/* Spinner matches app style but slightly smaller */
.chart-loading-spinner {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 3px solid rgba(148,163,184,0.45);
  border-top-color: #38bdf8; /* cyan accent like global loader */
  animation: chartSpin 0.8s linear infinite;
  margin-bottom: 6px;
}

/* Text below spinner – small, subtle */
.chart-loading-text {
  font-size: 11px;
  color: #e5e7eb;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

/* Reuse global vibe but separate keyframes name */
@keyframes chartSpin {
  to {
    transform: rotate(360deg);
  }
}

#chartTitle {
  font-weight: 500;
  color: #bfdbfe;
}

#chartClose {
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 16px;
  cursor: pointer;
}

#chartClose:hover {
  color: #f97316;
}

#chartContainer {
  flex: 1;
  min-height: 380px;
  padding: 4px 10px 10px;
}

/* ---------------- MOBILE: Menu + compact timebar + responsive panels ---------------- */
@media (max-width: 768px) {
  body.show-mobile-quick-menu #mobileQuickFilters {
    display: flex;            /* 👈 show only with this class */
  }
  /* Menu button */
  #togglePanel {
    position: absolute;
    bottom: var(--app-bottom);
    left: var(--app-gutter);
    width: 96px;
    min-width: 96px;
    height: 36px;
    padding: 0 10px;
    z-index: 11;
  }

  /* Timebar: same height, right next to menu */
  #timebar {
    position: absolute;
    bottom: var(--app-bottom);
    left: calc(var(--app-gutter) + 96px + var(--app-gap));
    right: var(--app-gutter);
    height: 34px;
    padding: 0 10px;
    border-radius: 12px;

    display: flex;
    align-items: center;
    transform: none;
  }

  /* Hide title and tick labels completely */
  #timebar .section-label,
  #timeHint {
    display: none !important;
  }

  /* Single row inside bar: [ slider ][ label ] */
  #timebar .control-row {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 8px;
  }

  /* Hide “T+” */
  #timebar .row-label {
    display: none;
  }

  /* Slider fills the bar */
  #timebar #timeSlider {
    flex: 1;
    width: auto;
  }

  /* Only this label is shown: lead time (0h, 3h, 6h, …) */
  #timeLabel {
    display: block;
    font-size: 12px;
    min-width: 32px;
    text-align: right;
    margin-left: 4px;
  }

  /* Controls panel spans between gutters */
  #controls {
    /* left: var(--app-gutter);
    right: var(--app-gutter);
    min-width: 0;
    max-width: none;
    width: auto;
    bottom: calc(var(--app-bottom) + 46px); */
    left: var(--app-gutter);
    right: auto; /* avoid full-width stretch */
    width: clamp(220px, 60vw, 340px);
  }

  /* Chart panel also respects gutters */
  #chartPanel {
    top: var(--app-gutter);
    left: var(--app-gutter);
    right: var(--app-gutter);
    width: auto;
    max-width: none;
  }

  #chartContainer {
    flex: 1;
    min-height: 295px;
    padding: 4px 10px 10px;
  }

  /* Slightly constrain the top bubble text */
  #validDayBubble {
    max-width: calc(200vw - 2 * var(--app-gutter));
    font-size: 12px;
    padding: 5px 10px;
  }

  #legendContainer {
    bottom: 55x;          /* tweak position if needed */
    right: 8px;
    transform: scale(0.8); /* 80% of original size */
    transform-origin: bottom right;
  }

}

/* MOBILE + LANDSCAPE LAYOUT */
@media (max-width: 768px) and (orientation: landscape) {
  /* Hide side / floating stuff */
  #mobileQuickFilters,
  #legendContainer,
  #chartPanel,
  #basemapWarning {
    display: none !important;
  }

  /* Top-right custom panel: hide everything by default... */
  .map-control-panel .map-ctrl-group {
    display: none;
  }

  /* ...except: zoom group and 2D/3D group */
  .map-control-panel .map-ctrl-group-zoom,
  .map-control-panel .map-ctrl-group-view {
    display: flex;
  }

  /* Main menu: resize to FIT screen and scroll if needed */
  #controls {
    left: var(--app-gutter);
    right: var(--app-gutter);
    width: auto;

    top: var(--app-gutter);
    bottom: auto;

    max-height: calc(72vh - var(--app-gutter) - var(--app-bottom));
    overflow-y: auto;

    opacity: 1;
    transform: none;       /* ignore .collapsed translateX */
    pointer-events: auto;  /* just in case */
  }

  /* Optional: hide toggle button in landscape (panel always visible) */

}




body, #controls, #timebar, #togglePanel, #validDayBubble, #chartPanel, #chartPanelHeader, #chartPanelTitle, #chartContainer
select, .pill, .row-label, .section-label, .control-row, #timeLabel,#snow-tag, #legendContainer, #legendBar
.checkbox-row label {
    font-size: calc(1em - 0.8px) !important;
}

