/* ==========================================================================
   Fonts (self-hosted, latin + latin-ext only)
   ========================================================================== */

/* Ubuntu 400 */
@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ubuntu-400-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ubuntu-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Ubuntu 500 */
@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ubuntu-500-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ubuntu-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Ubuntu 700 */
@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/ubuntu-700-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/ubuntu-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Ubuntu Mono 400 */
@font-face {
  font-family: 'Ubuntu Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ubuntu-mono-400-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Ubuntu Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ubuntu-mono-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Variables
   ========================================================================== */

:root {
  --font-family: "Ubuntu", sans-serif;
  --banner-height: 0px; /* announcement banner disabled 2026-07-15 (Mac app shelved). Reset to 2rem to re-enable; keep a unit — unitless 0 invalidates the --header-height calc() */
  --header-bar-height: 2.5rem;
  --header-height: calc(var(--banner-height) + var(--header-bar-height));
  --gui-width: 20rem;
  --splitter-size: 12px;
  --radius: 0.375rem;
  --radius-sm: 0.25rem;

  /* Backgrounds */
  --bg: #121119;
  --bg-raised: #1c1a28;
  --bg-surface: #232133;
  --overlay-bg: rgba(18, 17, 25, 0.6);

  /* Text */
  --white: #fff;
  --white-08: hsla(0, 0%, 100%, 0.08);
  --white-10: hsla(0, 0%, 100%, 0.1);
  --white-12: hsla(0, 0%, 100%, 0.12);
  --white-15: hsla(0, 0%, 100%, 0.15);
  --white-20: hsla(0, 0%, 100%, 0.2);
  --white-30: hsla(0, 0%, 100%, 0.3);
  --white-40: hsla(0, 0%, 100%, 0.4);
  --white-50: hsla(0, 0%, 100%, 0.5);
  --white-60: hsla(0, 0%, 100%, 0.6);
  --white-70: hsla(0, 0%, 100%, 0.7);
  --white-80: hsla(0, 0%, 100%, 0.8);
  --white-90: hsla(0, 0%, 100%, 0.9);

  /* Semantic */
  --green: #40FF9C;
  --blue: #4A40FF;
  --wind-cyan: #40EFFF;
  --status-yellow: #ffff00;
  --status-amber: #f59e0b;
  --status-red: #ef4444;
  --status-blue: #60a5fa;
  --status-green: #4ade80;
  --muted: #666;
}

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
}

/* App pages lock scroll; docs and other document pages stay scrollable */
html:has(#app-container),
body:has(#app-container) {
  overflow: hidden;
}

body {
  min-height: 100vh;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1em;
  color: var(--white);
  background: var(--bg);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

input, button, select, textarea {
  font-family: var(--font-family);
}

/* ==========================================================================
   Announcement Banner
   ========================================================================== */

#announcement-banner[hidden] { display: none; }

#announcement-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  min-height: var(--banner-height);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--white-10);
  display: flex;
  align-items: center;
  padding: 0.25rem 1rem;
  z-index: 2001;
  font-size: 0.75rem;
  color: var(--white-60);
}

#announcement-banner > span {
  flex: 1;
  min-width: 0;
}

#announcement-banner .banner-cta {
  color: var(--green);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
}
#announcement-banner .banner-cta:hover {
  opacity: 0.8;
}
#announcement-banner .banner-cta:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.banner-close {
  flex-shrink: 0;
  align-self: flex-start;
  margin-left: 0.75rem;
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--white-40);
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}
.banner-close:hover {
  color: var(--white-80);
}
.banner-close:focus-visible {
  outline: 2px solid var(--white-40);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  #announcement-banner .banner-cta,
  .banner-close {
    transition: none;
  }
}

/* ==========================================================================
   Header
   ========================================================================== */

#site-header {
  position: fixed;
  top: var(--banner-height);
  left: 0;
  right: 0;
  height: var(--header-bar-height);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--white-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 2000;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--white-90);
  font-size: 1.25rem;
  transition: color 0.2s ease;
}
.header-logo:hover { color: var(--white); }
.header-logo-text {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.logo-svg {
  height: 1.25rem;
  width: auto;
}
@media (prefers-reduced-motion: reduce) {
  .logo-svg { animation: none; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-link {
  color: var(--white-60);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 400;
  transition: color 0.2s ease;
}
.header-link:hover { color: var(--white); }

.header-share-btn {
  background: linear-gradient(to bottom, var(--white-15), transparent 60%), var(--green);
  color: var(--bg);
  border: none;
  height: 1.75rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow:
    inset 0 1px 0 var(--white-30),
    0 1px 3px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}
.header-share-btn:hover {
  background: linear-gradient(to bottom, var(--white-20), transparent 60%), var(--green);
  box-shadow:
    inset 0 1px 0 var(--white-40),
    0 1px 4px rgba(0, 0, 0, 0.45);
}
.header-share-btn:active {
  transform: scale(0.95);
  background: linear-gradient(to bottom, transparent, var(--white-08)), var(--green);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(0, 0, 0, 0.15);
}
.header-share-btn:focus-visible {
  outline: 2px solid var(--white-40);
  outline-offset: 2px;
}
.header-share-btn {
  position: relative;
}

.header-btn {
  background: none;
  border: 1px solid var(--white-20);
  border-radius: var(--radius);
  color: var(--white-60);
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.header-btn:hover {
  color: var(--white);
  border-color: var(--white-30);
}
.header-btn.locating {
  color: var(--green);
  animation: pulse-locate 1s ease-in-out infinite;
}

.header-social-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--white-60);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}
.header-social-btn:hover {
  color: var(--white);
}
.header-social-btn:focus-visible {
  outline: 2px solid var(--white-40);
  outline-offset: 2px;
}

@keyframes pulse-locate {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ==========================================================================
   Wind Status Indicator (header)
   ========================================================================== */

/* Wrapper: flex row, dot is visually primary, refresh sits to its left */
.wind-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

/* Dot: solid circle button, color keyed off parent data-state */
.wind-status-dot {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  background-color: var(--white-30);
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
  order: 2;
}
.wind-status-dot:focus-visible {
  outline: 2px solid var(--white-40);
  outline-offset: 3px;
}

/* State colors via data-state on the parent wrapper */
#wind-status[data-state="live"]                .wind-status-dot { background-color: var(--status-green); box-shadow: 0 0 6px rgba(74, 222, 128, 0.5); }
#wind-status[data-state="historical"]          .wind-status-dot { background-color: var(--status-amber); }
#wind-status[data-state="forecast"]            .wind-status-dot { background-color: var(--status-blue); }
#wind-status[data-state="no-data"]             .wind-status-dot { background-color: var(--status-red); }
#wind-status[data-state="offline"]             .wind-status-dot { background-color: var(--status-yellow); opacity: 0.6; }
#wind-status[data-state="loading"]             .wind-status-dot { background-color: var(--white-30); }

/* Refresh button: icon-only, muted, appears to the left of the dot */
.wind-status-refresh {
  appearance: none;
  background: none;
  border: none;
  padding: 0 0.25rem;
  color: var(--white-40);
  font-size: 0.75rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
  order: 1;
}
.wind-status-refresh:hover { color: var(--white); }
.wind-status-refresh:focus-visible {
  outline: 2px solid var(--white-40);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Tooltip card: hidden by default, revealed on dot hover/focus */
.wind-status-tooltip {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--white-12);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2100;
  order: 3;
}

/* Primary label */
.wind-status-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--white-90);
}

/* Secondary line (high-alt warning) — shown when not [hidden] */
.wind-status-secondary {
  display: block;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--status-red);
  margin-top: 0.25rem;
}
/* The author `display: block` above outranks the UA `[hidden]{display:none}`
   rule (equal specificity, author wins), so restore hiding explicitly. */
.wind-status-secondary[hidden] {
  display: none;
}

/* Reveal tooltip on hover (mouse) or focus-within (tap/keyboard) — scoped to the
   parent wrapper. The tooltip is a SIBLING of the dot button, so focus must be
   captured via :focus-within on the container, not a descendant selector. */
.wind-status:hover .wind-status-tooltip,
.wind-status:focus-within .wind-status-tooltip {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .wind-status-dot,
  .wind-status-refresh,
  .wind-status-tooltip {
    transition: none;
  }
}

.user-location-dot {
  background: var(--blue);
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: 0 0 8px rgba(74, 64, 255, 0.6);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 8px rgba(74, 64, 255, 0.6); }
  50% { box-shadow: 0 0 16px rgba(74, 64, 255, 0.9); }
}

/* ==========================================================================
   App Layout
   ========================================================================== */

#app-container {
  display: flex;
  width: calc(100vw - var(--gui-width) - var(--splitter-size));
  height: calc(100dvh - var(--header-height));
  overflow: hidden;
  flex-direction: column;
  margin: 0;
  padding: 0;
  position: fixed;
  top: var(--header-height);
  left: 0;
  transition: width 0.25s ease;
}

#map-panel {
  width: 100%;
  height: 50%;
  position: relative;
  background: var(--bg);
  min-height: 20%;
}

#canvas-panel {
  width: 100%;
  flex: 1;
  position: relative;
  min-height: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #121119;
  background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 20px 20px;
}
#canvas-panel canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

#canvas-hud {
  position: absolute;
  top: 1rem;
  left: 1rem;
  pointer-events: none;
  z-index: 5;
  max-width: calc(100vw - 2rem);
}

#leaflet-map-main {
  width: 100%;
  height: 100%;
  z-index: 1;
  background: var(--bg);
}

#leaflet-map-main .leaflet-control-attribution {
  font-size: 0.5625rem;
  opacity: 0.4;
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.7);
  padding: 0.0625rem 0.25rem;
}

#leaflet-map-main .leaflet-control-attribution a {
  color: rgba(255, 255, 255, 0.7);
}

/* Map footer bar — mirrors the PNG export's footer strip */
:root {
  --map-footer-height: 1.25rem; /* 0.25rem padding × 2 + 0.75rem line-height */
  --color-legend-height: 0.75rem; /* colour-mode gradient strip below the footer */
}

/* Footer bar (FL / location / time / model). Relocated out of #map-panel into
   the boundary slot between #map-panel and #canvas-panel (where #splitter used
   to sit). As a fixed-height flex item it lands: under the map in 2D/Both, and
   at the top of the 3D view in 3D-only mode (where #map-panel collapses to 0).
   One DOM position → adaptive across all three view modes. */
#map-footer-bar {
  position: relative;
  z-index: 400;
  flex: 0 0 var(--map-footer-height);
  width: 100%;
  background: var(--bg-raised);
  border-top: 1px solid var(--white-08);
  border-bottom: 1px solid var(--white-08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--white-90);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* When empty (no active data) the bar collapses so it takes no flex space. */
#map-footer-bar:empty {
  display: none;
}

/* Attribution no longer needs lifting — the footer bar is out of #map-panel and
   sits below the map in flow, so it no longer overlays the map bottom. */
#leaflet-map-main .leaflet-bottom {
  bottom: 0;
}

/* ==========================================================================
   Map Controls (floating overlay buttons on the map panel)
   ========================================================================== */

#map-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  pointer-events: auto;
}

.map-ctrl-btn {
  width: 2rem;
  height: 2rem;
  background: linear-gradient(to bottom, var(--white-12), transparent 60%), hsla(0, 0%, 0%, 0.5);
  border: 1px solid var(--white-20);
  border-radius: var(--radius-sm);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-shadow:
    inset 0 1px 0 var(--white-10),
    0 1px 3px rgba(0, 0, 0, 0.3);
}

.map-ctrl-btn:hover {
  background: linear-gradient(to bottom, var(--white-15), transparent 60%), hsla(0, 0%, 0%, 0.65);
  border-color: var(--white-30);
  box-shadow:
    inset 0 1px 0 var(--white-15),
    0 1px 4px rgba(0, 0, 0, 0.35);
}

.map-ctrl-btn:active {
  background: linear-gradient(to bottom, transparent, var(--white-08)), hsla(0, 0%, 0%, 0.75);
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(0, 0, 0, 0.12);
}

.map-ctrl-btn.active {
  background: hsla(210, 100%, 50%, 0.6);
  border-color: hsla(210, 100%, 70%, 0.7);
  box-shadow: 0 0 6px hsla(210, 100%, 50%, 0.4);
}

.map-ctrl-btn i { pointer-events: none; }

/* Active storms overlay — divIcon marker + Leaflet tooltip, both need
   explicit styling since divIcon/tooltip ship with generic light-theme
   defaults (white box, plain bubble) that don't match this app's dark UI. */
.storm-marker {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
  cursor: pointer;
}

.leaflet-tooltip.storm-tooltip {
  background: var(--overlay-bg);
  color: var(--white-90);
  border: 1px solid var(--white-08);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: none;
}
.leaflet-tooltip.storm-tooltip::before { display: none; } /* drop the default arrow — clashes with the blurred bg */

.map-ctrl-btn:disabled,
.map-ctrl-btn.disabled {
  opacity: 0.25;
  pointer-events: none;
  cursor: default;
}

/* Leaflet's zoom control (bottom-left, FA plus/minus — see initLeaflet()),
   restyled to match .pan-btn so the 2D map's built-in control reads as the
   same pressable button family as the 3D viewer's zoom buttons: two
   separate square buttons, side by side, not a joined stacked bar. Scoped
   under #leaflet-map-main and overrides Leaflet's own .leaflet-bar rules
   via higher specificity (no !important needed). */
#leaflet-map-main .leaflet-control-zoom {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  margin: 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#leaflet-map-main .leaflet-control-zoom a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  background: linear-gradient(to bottom, var(--white-12), transparent 60%), hsla(0, 0%, 0%, 0.5);
  border: 1px solid var(--white-20);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 var(--white-10);
  transition: all 0.2s ease;
}

#leaflet-map-main .leaflet-control-zoom a i {
  font-size: 0.875rem;
  pointer-events: none;
}

#leaflet-map-main .leaflet-control-zoom a:hover,
#leaflet-map-main .leaflet-control-zoom a:focus {
  background: linear-gradient(to bottom, var(--white-15), transparent 60%), hsla(0, 0%, 0%, 0.65);
  border-color: var(--white-30);
  box-shadow: inset 0 1px 0 var(--white-15);
}

#leaflet-map-main .leaflet-control-zoom a:active {
  background: linear-gradient(to bottom, transparent, var(--white-08)), hsla(0, 0%, 0%, 0.75);
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(0, 0, 0, 0.12);
}

#leaflet-map-main .leaflet-control-zoom a.leaflet-disabled {
  opacity: 0.25;
  pointer-events: none;
  cursor: default;
  background: hsla(0, 0%, 0%, 0.5);
  box-shadow: none;
}

/* ==========================================================================
   Splitters
   ========================================================================== */

/* View-mode split (3D / 2D / Both) — driven by the header #view-mode-group
   toggle via #app-container[data-view]. Replaces the old draggable #splitter.

   CSS state contract (styled/finalized by css-genius):
     - Hook element: #app-container, attribute data-view = "3d" | "2d" | "both"
     - Animated property: #map-panel height (0.3s). Canvas is flex:1, fills rest.
     - #map-footer-bar is a fixed-height flex item in the boundary slot between
       #map-panel and #canvas-panel.
     - .view-no-transition on #app-container suppresses the transition for the
       one-shot initial application (see ViewMode.applyInitial()). */
#map-panel { transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

#app-container[data-view="both"] #map-panel   { height: 50%; }

/* 2D mode: map fills all but the footer bar; canvas collapses to nothing */
#app-container[data-view="2d"]   #map-panel    { height: calc(100% - var(--map-footer-height) - var(--color-legend-height)); }
#app-container[data-view="2d"]   #canvas-panel { flex: 0 0 0; min-height: 0; overflow: hidden; }

/* overflow:hidden clips #map-controls and #map-loading-overlay when map is collapsed */
#app-container[data-view="3d"]   #map-panel    { height: 0; min-height: 0; overflow: hidden; }

/* One-shot transition suppression for the initial view-mode set (mirrors the
   gui-no-transition pattern) — prevents a load-time panel-height animation. */
#app-container.view-no-transition #map-panel { transition: none !important; }

#controls-splitter {
  background: var(--bg-raised);
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  position: fixed;
  z-index: 1001;
  top: var(--header-height);
  bottom: 0;
  right: var(--gui-width);
  left: auto;
  width: var(--splitter-size);
  height: auto;
  cursor: pointer;
  transition: background-color 0.2s ease, right 0.25s ease;
}
#controls-splitter:hover, #controls-splitter:active { background: var(--green); }
#controls-splitter::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--white-30);
  box-shadow: 0 -8px 0 var(--white-30), 0 8px 0 var(--white-30);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
#controls-splitter:hover::after {
  background: var(--bg);
  box-shadow: 0 -8px 0 var(--bg), 0 8px 0 var(--bg);
  opacity: 0.8;
}

/* ==========================================================================
   Loading Overlay
   ========================================================================== */

#wind-loading-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 17, 25, 0.7);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#wind-loading-overlay.visible { display: flex; }

#map-loading-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 17, 25, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#map-loading-overlay.visible { display: flex; }

.loading-spinner {
  width: 2.5rem;
  height: 2.5rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-spinner::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--white-15);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-spinner .logo-svg {
  width: 55%;
  height: 55%;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--white-80);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Pan Controls
   ========================================================================== */

#pan-controls {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  pointer-events: none;
}

.pan-btn {
  position: absolute;
  width: 2rem;
  height: 2rem;
  background: linear-gradient(to bottom, var(--white-12), var(--white-08));
  border: 1px solid var(--white-20);
  border-radius: var(--radius-sm);
  color: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  pointer-events: auto;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow:
    inset 0 1px 0 var(--white-12),
    0 1px 3px rgba(0, 0, 0, 0.3);
}
.pan-btn:hover {
  background: linear-gradient(to bottom, var(--white-15), var(--white-10));
  border-color: var(--white-30);
  box-shadow:
    inset 0 1px 0 var(--white-15),
    0 1px 4px rgba(0, 0, 0, 0.35);
}
.pan-btn:active {
  background: linear-gradient(to bottom, var(--white-08), var(--white-10));
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(0, 0, 0, 0.12);
}
.pan-btn:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}
.pan-btn i { pointer-events: none; }

.pan-up    { top: 1rem; left: 50%; transform: translateX(-50%); }
.pan-up:hover  { transform: translateX(-50%) scale(1.05); }
.pan-up:active { transform: translateX(-50%) scale(0.95); }

.pan-down    { bottom: 1rem; left: 50%; transform: translateX(-50%); }
.pan-down:hover  { transform: translateX(-50%) scale(1.05); }
.pan-down:active { transform: translateX(-50%) scale(0.95); }

.pan-left    { left: 1rem; top: 50%; transform: translateY(-50%); }
.pan-left:hover  { transform: translateY(-50%) scale(1.05); }
.pan-left:active { transform: translateY(-50%) scale(0.95); }

.pan-right    { right: 1rem; top: 50%; transform: translateY(-50%); }
.pan-right:hover  { transform: translateY(-50%) scale(1.05); }
.pan-right:active { transform: translateY(-50%) scale(0.95); }

#hide-gui-btn { position: absolute; top: 1rem; right: 1rem; }
#hide-gui-btn:hover  { transform: scale(1.05); }
#hide-gui-btn:active { transform: scale(0.95); }
#scene-reset-btn { position: absolute; top: 1rem; right: 3.5rem; }
#scene-reset-btn:hover  { transform: scale(1.05); }
#scene-reset-btn:active { transform: scale(0.95); }
#spin-toggle-btn { position: absolute; top: 1rem; right: 6rem; }
#spin-toggle-btn:hover  { transform: scale(1.05); }
#spin-toggle-btn:active { transform: scale(0.95); }
#fractal-zoom-out-btn { position: absolute; top: 1rem; right: 8.5rem; }
#fractal-zoom-out-btn:hover  { transform: scale(1.05); }
#fractal-zoom-out-btn:active { transform: scale(0.95); }

/* Hide-GUI mode: hide the 3D viewer's floating overlay buttons except the eye toggle itself.
   The toggle lives inside #pan-controls, so we hide siblings via :not(). Scoped to the 3D
   viewer only — the 2D Leaflet controls (#map-controls) stay visible regardless of this toggle. */
body.gui-hidden-overlay #pan-controls > .pan-btn:not(#hide-gui-btn),
body.gui-hidden-overlay #free-cam-tooltip { display: none !important; }

#zoom-in-btn { position: absolute; bottom: 1rem; left: 1rem; }
#zoom-in-btn:hover  { transform: scale(1.05); }
#zoom-in-btn:active { transform: scale(0.95); }

#zoom-out-btn { position: absolute; bottom: 1rem; left: 3.5rem; }
#zoom-out-btn:hover  { transform: scale(1.05); }
#zoom-out-btn:active { transform: scale(0.95); }

#view-toggle-btn { position: absolute; bottom: 1rem; right: 1rem; }
#view-toggle-btn:hover  { transform: scale(1.05); }
#view-toggle-btn:active { transform: scale(0.95); }

#free-cam-btn { position: absolute; bottom: 1rem; right: 3.5rem; }
#free-cam-btn:hover  { transform: scale(1.05); }
#free-cam-btn:active { transform: scale(0.95); }

#free-cam-tooltip {
  position: absolute;
  bottom: calc(1rem + 2rem + 0.5rem); /* above #free-cam-btn: btn bottom + btn height + gap */
  right: 2.5rem;
  background: var(--overlay-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--white-12);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 200;
  white-space: nowrap;
}
#free-cam-tooltip.visible { opacity: 1; }

.canvas-tooltip-title {
  color: var(--white-90);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.canvas-tooltip-shortcuts {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.5rem;
  row-gap: 0.125rem;
}

.canvas-tooltip-key {
  color: var(--white-60);
  font-size: 0.6875rem;
  font-weight: 500;
  text-align: right;
}

.canvas-tooltip-desc {
  color: var(--white-40);
  font-size: 0.6875rem;
  font-weight: 400;
}

@media (prefers-reduced-motion: reduce) {
  #free-cam-tooltip { transition: none; }
}

.pan-btn.active {
  background: var(--white-20);
  border-color: var(--white-50);
  box-shadow: 0 0 0 1px var(--white-30);
}

/* ==========================================================================
   Wind Visualization Elements
   ========================================================================== */

.wind-cube-cell {
  transition: opacity 0.2s ease;
}

/* ==========================================================================
   Tooltip
   ========================================================================== */

#tooltip {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.85);
  color: var(--white);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  pointer-events: none;
  z-index: 1500;
  display: none;
  white-space: nowrap;
  border: 1px solid var(--white-20);
}
#tooltip.visible { display: block; }

/* ==========================================================================
   Map Overlays
   ========================================================================== */

.state-overlay {
  cursor: pointer;
  transition: fill-opacity 0.15s ease;
}

.state-tooltip {
  font-family: var(--font-family);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

/* Wind arrow + speed-label divIcon (live 2D map).
   Wrap is a 40×28 box; iconAnchor=[20,8] anchors the geographic point at
   the triangle's geometric centroid (un-rotated). The triangle is
   absolutely positioned at the top center of the wrap and rotates about
   its base-center (wrap-(20,12), 4px below the geo anchor); the speed
   label sits below it, fixed (not rotated). MapExport mirrors this layout
   on the PNG canvas. */
.wind-arrow-map { pointer-events: none; }
.wind-arrow-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.wind-arrow-tri {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 0;
  margin-left: -4px;
  transform-origin: center bottom;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
  pointer-events: none;
}
.wind-arrow-label {
  display: block;
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 9px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  white-space: nowrap;
}

/* ==========================================================================
   GUI Panel
   ========================================================================== */

.custom-gui {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: var(--gui-width);
  background: var(--bg);
  padding: 1.5rem;
  padding-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4), -1px 0 0 var(--white-08);
  transform: translateX(0);
  transition: transform 0.25s ease;
}
.custom-gui.loading {
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}
.custom-gui::-webkit-scrollbar { width: 0.5rem; }
.custom-gui::-webkit-scrollbar-track { background: var(--white-10); }
.custom-gui::-webkit-scrollbar-thumb {
  background: var(--white-30);
  border-radius: var(--radius-sm);
}
.custom-gui::-webkit-scrollbar-thumb:hover { background: var(--white-50); }

/* ==========================================================================
   GUI Sections & Controls
   ========================================================================== */

.gui-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: fit-content;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bg-raised);
}
.gui-section:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.gui-accordion[data-accordion-open="false"]:not(:last-child) {
  padding-bottom: 0;
}

.gui-section-title {
  color: var(--white);
  font-size: 0.8rem;
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Collapse the flex gap so no phantom space appears when closed */
.gui-accordion {
  gap: 0;
}

/* Accordion trigger */
.gui-accordion-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  padding: 0.1rem 0;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}
.gui-accordion-trigger:hover {
  color: var(--white-80);
}
.gui-accordion-trigger:focus-visible {
  outline: 2px solid var(--white-40);
  outline-offset: 3px;
}

/* Chevron: an SVG-free CSS triangle rotated via transform */
.gui-accordion-chevron {
  display: inline-block;
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.6;
}
.gui-accordion[data-accordion-open="false"] .gui-accordion-chevron {
  transform: rotate(-45deg);
}

.gui-accordion-trigger .gui-accordion-chevron {
  order: 2;
}

/* Tools reset button — only visible when .has-active is set */
.gui-tools-reset {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0 0.125rem;
  color: var(--green);
  font-size: 0.6rem;
  cursor: pointer;
  opacity: 0.7;
  flex-shrink: 0;
  order: 1;
  line-height: 1;
  transition: opacity 0.15s ease;
}
.gui-tools-reset:hover {
  opacity: 1;
}
.gui-accordion-trigger.has-active .gui-tools-reset {
  display: flex;
}

/* Accordion body: slide open/close using the grid-template-rows 0fr → 1fr trick.
   .gui-accordion-body is the grid container; .gui-controls is its sole direct child.
   The child needs min-height: 0 so it can compress fully to zero.
   Spacing is applied as padding-top on the inner child so it participates in the
   clipping — no separate padding animation needed on the outer wrapper.

   overflow: hidden while closed/transitioning so the collapsing content clips cleanly.
   overflow: visible while open so range slider thumbs (which extend beyond their track)
   paint without being cut off. The thumb clipping fix lives on the input itself:
   padding-block on input[type="range"] expands the element vertically so the thumb
   paints within the input's own box — no dependency on the parent's overflow. */
.gui-accordion-body {
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  transition: grid-template-rows 0.25s ease;
}
.gui-accordion-body > .gui-controls {
  min-height: 0;
  padding-top: 0.75rem;
}
.gui-accordion[data-accordion-open="true"] .gui-accordion-body {
  overflow: visible;
}
.gui-accordion[data-accordion-open="false"] .gui-accordion-body {
  grid-template-rows: 0fr;
}
@media (prefers-reduced-motion: reduce) {
  .gui-accordion-body { transition: none; }
  .gui-accordion-chevron { transition: none; }
}

.gui-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

.gui-control {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.gui-control label {
  color: var(--white-70);
  font-size: 0.75rem;
  font-weight: 400;
}

.gui-control select,
.gui-control input[type="range"],
.gui-control input[type="text"] {
  background: var(--white-08);
  border: none;
  border-radius: var(--radius);
  color: var(--white);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  transition: all 0.2s ease;
}
.gui-control input[type="text"]:hover, .gui-control input[type="text"]:focus {
  background-color: var(--white-12);
}

.gui-control select {
  background-color: var(--white-15);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 var(--white-15);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}
.gui-control select:hover,
.gui-control select:focus {
  background-color: var(--white-20);
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 var(--white-20);
}
.gui-control select:active {
  background-color: var(--white-12);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  transform: translateY(1px);
}

.gui-control input[type="text"] {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(0, 0, 0, 0.2);
}
.gui-control input[type="text"]:hover,
.gui-control input[type="text"]:focus {
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(0, 0, 0, 0.15);
}

.gui-btn-group {
  display: flex;
  gap: 0;
  border-radius: 0.375rem;
  overflow: hidden;
}
.gui-btn-option {
  flex: 1;
  padding: 0.375rem 0.75rem;
  background: linear-gradient(to bottom, var(--white-12), var(--white-08));
  color: var(--white-70);
  border: none;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    inset 0 1px 0 var(--white-12),
    0 1px 3px rgba(0, 0, 0, 0.4);
}
.gui-btn-option:not(:last-child) {
  border-right: 1px solid var(--white-08);
}
.gui-btn-option:hover {
  background: linear-gradient(to bottom, var(--white-20), var(--white-12));
  color: var(--white-90);
}
.gui-btn-option:active {
  background: linear-gradient(to bottom, var(--white-08), var(--white-10));
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(0, 0, 0, 0.2);
  transform: translateY(1px);
}
.gui-btn-option.active {
  background: linear-gradient(to bottom, var(--white-15), var(--white-20));
  color: var(--white);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(0, 0, 0, 0.15);
}

.gui-btn-full {
  width: 100%;
  border-radius: var(--radius);
}

.gui-control select {
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='rgba(255,255,255,0.7)' d='M0 0l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  background-size: 0.625rem;
  appearance: none;
}
.gui-control select option {
  background: var(--bg-raised);
  color: var(--white);
  padding: 0.5rem;
}

.gui-control input[type="range"] {
  padding: 0;
  padding-block: 0.5rem;
  height: auto;
  appearance: none;
  background: transparent;
  border-radius: var(--radius-sm);
}
.gui-control input[type="range"]::-webkit-slider-runnable-track {
  height: 0.375rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), var(--white-15));
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
}
.gui-control input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  /* Center thumb on the track: (track-height − thumb-height) / 2 = (0.375rem − 1.125rem) / 2 */
  margin-top: calc((0.375rem - 1.125rem) / 2);
  background: linear-gradient(to bottom, #ffffff, #d0d0d8);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow:
    0 0.125rem 0.375rem rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
}
.gui-control input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow:
    0 0.25rem 0.6rem rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.gui-control input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.05);
  background: linear-gradient(to bottom, #e8e8f0, #c8c8d0);
  box-shadow:
    0 0.0625rem 0.25rem rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 0, 0, 0.2),
    inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
.gui-control input[type="range"]::-moz-range-thumb {
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  background: linear-gradient(to bottom, #ffffff, #d0d0d8);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow:
    0 0.125rem 0.375rem rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}
.gui-control input[type="range"]::-moz-range-track {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), var(--white-15));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  height: 0.375rem;
  border: none;
}

.gui-control input[type="text"] { cursor: text; }

/* Search */

.gui-search-wrapper { position: relative; }

.gui-search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0.75rem;
  color: var(--white-30);
  font-size: 0.75rem;
  pointer-events: none;
}

.gui-search-wrapper input[type="text"] {
  padding-left: 2rem;
  padding-right: 1.75rem;
  text-overflow: ellipsis;
}
@media (max-width: 768px) {
  .gui-search-wrapper input[type="text"] {
    font-size: 16px;
  }
}

.gui-search-locate {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--white-30);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.15s ease;
}
.gui-search-locate:hover { color: var(--white-80); }
.gui-search-locate.hidden { display: none; }
.gui-search-locate.locating {
  color: var(--green);
  animation: pulse-locate 1s ease-in-out infinite;
}

.gui-search-clear.hidden { display: none; }

.gui-search-clear {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--white-40);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 0.15s ease;
}
.gui-search-clear:hover { color: var(--white-80); }

.gui-search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-raised);
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.gui-search-results.visible { display: block; }

.gui-search-results .gui-search-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--white-70);
  cursor: pointer;
  border-top: 1px solid var(--white-08);
  transition: background 0.15s ease;
}
.gui-search-results .gui-search-item:first-child { border-top: none; }
.gui-search-results .gui-search-item:hover,
.gui-search-results .gui-search-item.active {
  background: var(--white-12);
  color: var(--white);
}
.gui-search-results .gui-search-item span {
  color: var(--white-40);
  font-size: 0.7rem;
}

/* Recent searches */

.gui-recent-searches:empty { display: none; }

.gui-recent-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.375rem 0 0;
}

.gui-recent-item {
  display: flex;
  align-items: center;
  background: var(--white-08);
  border-radius: 2rem;
  overflow: hidden;
}

.gui-recent-label {
  background: none;
  border: none;
  color: var(--white-60);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0.25rem 0.375rem 0.25rem 0.625rem;
  line-height: 1;
  transition: color 0.15s ease;
  white-space: nowrap;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gui-recent-label:hover { color: var(--white); }

.gui-recent-remove {
  background: none;
  border: none;
  color: var(--white-30);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem 0.25rem 0.125rem;
  line-height: 1;
  transition: color 0.15s ease;
}
.gui-recent-remove:hover { color: var(--white-80); }

/* Control row */

.gui-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.gui-control-row label { flex-shrink: 0; }

.gui-control-value {
  color: var(--white-90);
  font-size: 0.75rem;
  text-align: right;
  min-width: 3rem;
}

/* Tip banner */

.gui-tip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white-08);
  border-radius: var(--radius-sm);
  color: var(--white-50);
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  margin: 0;
}

.gui-tip .fa-lightbulb {
  color: var(--status-amber);
  flex-shrink: 0;
}

.gui-tip-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--white-30);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.gui-tip-close:hover {
  color: var(--white-70);
}

#gui-tip-text {
  display: inline-block;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#gui-tip-text.fading {
  opacity: 0;
  transform: translateY(3px);
}

@media (prefers-reduced-motion: reduce) {
  #gui-tip-text {
    transition: opacity 0.3s ease;
  }

  #gui-tip-text.fading {
    transform: none;
  }
}

/* ==========================================================================
   Time Controls
   ========================================================================== */

.gui-time-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.gui-time-control .gui-time-value {
  flex: 1;
  background: var(--white-08);
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  text-align: center;
  color: var(--white);
  font-size: 0.875rem;
  line-height: 1.15;
  box-sizing: border-box;
}
.gui-time-control .gui-time-value.gui-date-clickable {
  cursor: pointer;
  background: linear-gradient(to bottom, var(--white-12), var(--white-08));
  box-shadow:
    inset 0 1px 0 var(--white-12),
    0 1px 3px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}
.gui-time-control .gui-time-value.gui-date-clickable:hover {
  background: linear-gradient(to bottom, var(--white-20), var(--white-12));
}
/* Scrubber position, matching the header status dot: amber = historical,
   blue = forecast, default = current hour. Tokens shared with
   #wind-status[data-state] so the two surfaces stay in step. */
.gui-time-value.date-not-today {
  color: var(--status-amber);
}
.gui-time-value.date-forecast {
  color: var(--status-blue);
}

.gui-time-control button {
  background: linear-gradient(to bottom, var(--white-12), var(--white-08));
  border: none;
  border-radius: var(--radius);
  color: var(--white);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.15;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 2.5rem;
  box-shadow:
    inset 0 1px 0 var(--white-12),
    0 1px 3px rgba(0, 0, 0, 0.4);
}
.gui-time-control button:hover {
  background: linear-gradient(to bottom, var(--white-20), var(--white-12));
  box-shadow:
    inset 0 1px 0 var(--white-15),
    0 1px 4px rgba(0, 0, 0, 0.45);
}
.gui-time-control button:active {
  transform: scale(0.95);
  background: linear-gradient(to bottom, var(--white-08), var(--white-10));
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Calendar
   ========================================================================== */

.gui-calendar {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--bg-raised);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  padding: 0.5rem;
  margin-top: 0.25rem;
}
.gui-calendar.hidden { display: none; }

.gui-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.75rem;
  color: var(--white-80);
}
.gui-cal-header button {
  background: none;
  border: none;
  color: var(--white-60);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.25rem;
}
.gui-cal-header button:hover { color: var(--white); }

.gui-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 0.6rem;
  color: var(--white-30);
  text-align: center;
  padding: 0.25rem 0;
}

.gui-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.gui-cal-day {
  text-align: center;
  padding: 0.35rem 0;
  font-size: 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--white-70);
  transition: background 0.15s ease;
}
.gui-cal-day:hover { background: var(--white-12); }
.gui-cal-day.active { background: #40EFFF; color: black; font-weight: 600; }
.gui-cal-day.today { border: 1px solid var(--white-30); }
.gui-cal-day.disabled {
  color: var(--white-15);
  cursor: default;
}
.gui-cal-day.disabled:hover { background: none; }

/* ==========================================================================
   Playback Controls
   ========================================================================== */

.gui-playback-controls {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
}
.gui-playback-controls button {
  flex: 1;
  background: linear-gradient(to bottom, var(--white-12), var(--white-08));
  border: none;
  border-radius: var(--radius);
  color: var(--white-50);
  padding: 0.35rem;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    inset 0 1px 0 var(--white-12),
    0 1px 3px rgba(0, 0, 0, 0.35);
}
.gui-playback-controls button:hover:not(:disabled) {
  background: linear-gradient(to bottom, var(--white-20), var(--white-12));
  color: var(--white);
  box-shadow:
    inset 0 1px 0 var(--white-15),
    0 1px 4px rgba(0, 0, 0, 0.4);
}
.gui-playback-controls button:active:not(:disabled) {
  transform: scale(0.95);
  background: linear-gradient(to bottom, var(--white-08), var(--white-10));
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(0, 0, 0, 0.15);
}
.gui-playback-controls button.active {
  background: linear-gradient(to bottom, rgba(64, 255, 156, 0.25), rgba(64, 255, 156, 0.15));
  color: var(--white);
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.2),
    0 0 6px rgba(64, 255, 156, 0.15);
}
.gui-playback-controls button:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ==========================================================================
   Cube Info Panel
   ========================================================================== */

#canvas-cube-info {
  display: none;
}
#canvas-cube-info.visible {
  display: flex;
}

.cube-info-more {
  height: 1.75rem;
  padding: 0 0.5rem;
  background: linear-gradient(to bottom, var(--white-15), transparent 60%), var(--wind-cyan);
  border: 1px solid var(--white-20);
  border-radius: var(--radius-sm);
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  pointer-events: auto;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow:
    inset 0 1px 0 var(--white-30),
    0 1px 3px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}
.cube-info-more:hover {
  background: linear-gradient(to bottom, var(--white-20), transparent 60%), var(--wind-cyan);
  box-shadow:
    inset 0 1px 0 var(--white-40),
    0 1px 4px rgba(0, 0, 0, 0.45);
}
.cube-info-more:active {
  transform: scale(0.95);
  background: linear-gradient(to bottom, transparent, var(--white-08)), var(--wind-cyan);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(0, 0, 0, 0.15);
}
.cube-info-more:focus-visible {
  outline: 2px solid var(--wind-cyan);
  outline-offset: 2px;
}

.gui-source-link {
  display: block;
  text-align: center;
  font-size: 0.7rem;
  color: var(--white-40);
  margin-top: 0.25rem;
  text-decoration: none;
}
.gui-source-link:hover { color: var(--white-70); }

/* ==========================================================================
   Color Legend — full-width gradient strip pinned to the 3D viewer's bottom.
   The gradient (background) is generated in JS from the active ramp array
   (Utils._WIND_SPEED_RAMP / _TEMPERATURE_RAMP / _HUMIDITY_RAMP) — the ramps
   are the single source of truth, so no hex stops live here. Collapses for
   free in 2D-only view (#canvas-panel goes to height 0, overflow hidden).
   ========================================================================== */

/* Colour-mode legend — an in-flow strip in the boundary slot directly below
   #map-footer-bar (the FL/coords/model info line). One DOM position → visible
   in 2D, 3D, and Both views, grouped with the info bar. The footer's
   border-bottom is the hairline between the info text and this gradient. */
#color-legend {
  flex: 0 0 var(--color-legend-height);
  width: 100%;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
  border-bottom: 1px solid var(--white-08);
  pointer-events: none;
  /* background: linear-gradient(...) set inline via JS (data-driven) */
}

.color-legend-label {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--white);
  /* Dark halo keeps white glyphs legible over both the dark (navy/brown) and
     light (pale-white / jet-stream) ends of the gradient. */
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.95),
    0 0 4px rgba(0, 0, 0, 0.8),
    0 1px 1px rgba(0, 0, 0, 0.9);
}

.status-update-note {
  display: block;
  font-size: 0.6rem;
  color: var(--white-20);
  margin-top: 2px;
  margin-left: 10px;
}
.status-update-note a {
  color: var(--white-30);
  text-decoration: none;
}
.status-update-note a:hover { color: var(--white-60); }

/* ==========================================================================
   Radio & Checkbox
   ========================================================================== */

.gui-radio, .gui-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}
.gui-radio label, .gui-checkbox label {
  color: var(--white-90);
  font-size: 0.875rem;
  cursor: pointer;
  margin: 0;
}
.gui-radio label i, .gui-checkbox label i, .gui-control label i {
  width: 1rem;
  text-align: center;
  margin-right: 0.3rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

.gui-help-icon {
  color: var(--white-30);
  font-size: 0.75rem;
  cursor: help;
  margin-left: -0.15rem;
  line-height: 1;
}
.gui-help-icon:hover { color: var(--white-60); }

#gui-help-tooltip {
  position: fixed;
  background: var(--overlay-bg);
  color: var(--white-90);
  font-size: 0.75rem;
  font-weight: 400;
  padding: 0.4rem 0.6rem;
  border-radius: 0.35rem;
  max-width: 12rem;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--white-08);
  z-index: 9999;
}

.gui-radio input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  appearance: none;
  background: var(--white-08);
  border: none;
  border-radius: 50%;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(0, 0, 0, 0.2);
}
.gui-radio input[type="radio"]:hover {
  background: var(--white-12);
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(0, 0, 0, 0.15);
}
.gui-radio input[type="radio"]:checked {
  background: var(--green);
  box-shadow:
    0 1px 3px rgba(64, 255, 156, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.gui-radio input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0.375rem;
  height: 0.375rem;
  background: var(--bg);
  border-radius: 50%;
}

.gui-checkbox input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  appearance: none;
  background: var(--white-08);
  border: none;
  border-radius: var(--radius-sm);
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(0, 0, 0, 0.2);
}
.gui-checkbox input[type="checkbox"]:hover {
  background: var(--white-12);
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(0, 0, 0, 0.15);
}
.gui-checkbox input[type="checkbox"]:checked {
  background: var(--green);
  box-shadow:
    0 1px 3px rgba(64, 255, 156, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.gui-checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 45%;
  width: 0.3rem;
  height: 0.55rem;
  border: solid var(--bg);
  border-width: 0 0.125rem 0.125rem 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* Default-on checkboxes (Terrain, Wind Direction) use a
   muted neutral when checked so they don't compete with non-default toggles */
#gui-terrain:checked,
#gui-wind-arrows:checked {
  background: var(--white-30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Active Storms is only meaningful at current time (see TimeControls.updateDisplay) —
   dims + blocks interaction while viewing a historical/forecast date, same idea
   as radar-toggle-btn:disabled above but for a checkbox row instead of a button. */
.gui-checkbox.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ==========================================================================
   Footer & Legal Modal
   ========================================================================== */

.gui-footer {
  margin-top: auto;
  padding-top: 1rem;
}

.gui-footer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.page-footer .gui-footer-row {
  align-items: center;
}

.footer-logo .logo-svg {
  height: 2.5rem;
  width: auto;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}
.footer-logo .logo-svg path {
  fill: var(--white) !important;
}
.footer-logo:hover .logo-svg { opacity: 0.7; }

.gui-footer-right {
  display: flex;
  gap: 1.25rem;
}

.gui-footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  font-size: 0.65rem;
}
.gui-footer-links a {
  color: var(--white-30);
  text-decoration: none;
  transition: color 0.2s ease;
}
.gui-footer-links a:hover { color: var(--white-70); }

.gui-footer-social {
  color: var(--white-30);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
}
.gui-footer-social:hover { color: var(--white-70); }

.gui-footer-copyright {
  text-align: center;
  font-size: 0.6rem;
  color: var(--white-20);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--white-08);
}
.gui-footer-copyright a {
  color: var(--white-20);
  text-decoration: none;
}
.gui-footer-copyright a:hover {
  color: var(--white-50);
}

/* Page Footer (about, docs) */

.page-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--white-12);
}

.page-footer .gui-footer-links {
  flex-direction: row;
  align-items: center;
}

.page-footer .gui-footer-links a {
  color: var(--white-30);
  text-decoration: none;
}

.page-footer .gui-footer-links a:hover {
  color: var(--white-70);
  text-decoration: none;
}

.page-footer .gui-footer-copyright {
  text-align: left;
}

.page-footer .gui-footer-copyright a {
  color: var(--white-20);
  text-decoration: none;
}

.page-footer .gui-footer-copyright a:hover {
  color: var(--white-40);
  text-decoration: none;
}

/* Legal Modal */

.legal-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 17, 25, 0.85);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.legal-modal.visible { display: flex; }

.legal-modal-content {
  background: var(--bg-raised);
  border: 1px solid var(--white-15);
  border-radius: 0.5rem;
  width: 90%;
  max-width: 32rem;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.legal-modal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--white-10);
}
.legal-modal-header h2 {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white-90);
  margin: 0;
}

.legal-modal-close {
  background: none;
  border: none;
  color: var(--white-60);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}
.legal-modal-close:hover { color: var(--white); }

.legal-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--white-60);
}
.legal-modal-body h3 {
  color: var(--white-80);
  font-size: 0.8rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}
.legal-modal-body h3:first-child { margin-top: 0; }
.legal-modal-body p { margin: 0 0 0.75rem; }
.legal-modal-body ul { padding-left: 1.25rem; margin: 0 0 0.75rem; }
.legal-modal-body a {
  color: var(--green);
  text-decoration: none;
}
.legal-modal-body a:hover { text-decoration: underline; }

/* API Docs Modal */

.api-docs-content {
  max-width: 40rem;
}

.api-docs-content .legal-modal-body h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--white-08);
}

.api-docs-content .legal-modal-body h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.api-docs-content .legal-modal-body h3 i {
  color: var(--green);
  font-size: 0.7rem;
  opacity: 0.85;
  flex-shrink: 0;
}

.api-docs-content .legal-modal-body code {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.7rem;
  background: var(--white-08);
  padding: 0.125rem 0.25rem;
  border-radius: var(--radius-sm);
  color: var(--white-80);
}

.api-docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
}

.api-docs-table th {
  text-align: left;
  color: var(--white-80);
  font-weight: 600;
  padding: 0.375rem 0.5rem;
  border-bottom: 1px solid var(--white-15);
}

.api-docs-table td {
  padding: 0.375rem 0.5rem;
  border-bottom: 1px solid var(--white-08);
  color: var(--white-60);
}

/* Cube Detail Modal */

.cube-detail-content {
  max-width: 32rem;
}

.cube-detail-body {
  position: relative;
  padding: 1rem 1.25rem 1.25rem;
  overflow-y: auto;
  font-size: 0.75rem;
  line-height: 1.5;
}

.cube-detail-section {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white-30);
  padding-top: 0.75rem;
}
.cube-detail-row + .cube-detail-section {
  margin-top: 1rem;
}
.cube-detail-section:first-child {
  padding-top: 0;
  margin-top: 0;
}

.cube-detail-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--white-08);
}
.cube-detail-row:last-child,
.cube-detail-row:has(+ .cube-detail-section) {
  border-bottom: none;
}

.cube-detail-label {
  color: var(--white-40);
  flex-shrink: 0;
  min-width: 8rem;
}

.cube-detail-value {
  color: var(--white-80);
  margin-left: auto;
  text-align: right;
  font-family: 'Ubuntu Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* Turbulence / icing severity colors */
.cube-detail-value[data-severity="none"]     { color: var(--white-40); }
.cube-detail-value[data-severity="light"]    { color: var(--status-yellow); }
.cube-detail-value[data-severity="moderate"] { color: var(--status-amber); }
.cube-detail-value[data-severity="severe"]   { color: var(--status-red); }
.cube-detail-value[data-severity="extreme"]  { color: var(--status-red); font-weight: 700; }

/* Share Modal */

.share-url-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.share-url-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--white-80);
  padding: 0.5rem 0.75rem;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  outline: none;
  cursor: text;
  user-select: all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(0, 0, 0, 0.2);
}
.share-url-input:focus {
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(0, 0, 0, 0.15);
  outline: 2px solid var(--white-15);
  outline-offset: -2px;
}

.share-copy-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--green);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.875rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.1s ease;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.share-copy-btn:hover { opacity: 0.85; }
.share-copy-btn:active { transform: translateY(1px); }
.share-copy-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .share-copy-btn { transition: none; }
}

@media screen and (max-width: 760px) {
  .share-url-row {
    flex-direction: column;
  }
  .share-url-input {
    width: 100%;
  }
  .share-copy-btn {
    width: 100%;
    justify-content: center;
  }
  .share-social-btn {
    width: 2.5rem;
    height: 2.5rem;
  }
}

.share-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--white-08);
}

.share-detail-row {
  display: grid;
  grid-template-columns: 1rem 1fr auto;
  align-items: baseline;
  column-gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--white-08);
}
.share-detail-row:last-child { border-bottom: none; }

.share-detail-icon {
  color: var(--white-30);
  font-size: 0.7rem;
  text-align: center;
  line-height: 1.6;
}

.share-detail-label {
  color: var(--white-40);
  font-size: 0.75rem;
  white-space: nowrap;
}

.share-detail-value {
  color: var(--white-80);
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}

.share-social-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--white-08);
}

.share-social-label {
  color: var(--white-40);
  font-size: 0.75rem;
  white-space: nowrap;
  margin-right: 0.25rem;
}

.share-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  background: var(--bg-surface);
  color: var(--white-50);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.1s ease;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 var(--white-08);
}
/* Prevent authored display from overriding the UA [hidden] attribute */
.share-social-btn[hidden] { display: none; }

.share-social-btn:hover {
  color: var(--white-80);
  background: var(--bg-raised);
}
.share-social-btn:active {
  transform: translateY(1px);
  color: var(--white-80);
}
.share-social-btn:focus-visible {
  outline: 2px solid var(--white-15);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .share-social-btn { transition: none; }
}

/* Brand assets grid */

.brand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.brand-item { text-align: center; }

.brand-preview {
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.brand-preview img { width: 100%; display: block; }
.brand-preview.brand-preview-dark {
  background: #1a1a2e;
  padding: 1.5rem;
}
.brand-preview.brand-preview-dark img {
  height: 60px;
  width: auto;
  margin: 0 auto;
}

.brand-download {
  color: #40EFFF;
  font-size: 0.85rem;
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.not-found {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: var(--bg);
  color: var(--white);
  text-align: center;
  padding: 2rem;
  overflow: hidden;
}
.not-found__bg {
  position: absolute;
  width: 80vmin;
  height: 80vmin;
  opacity: 0.06;
  pointer-events: none;
}
.not-found__code {
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--white-15);
}
.not-found__message {
  font-size: 0.875rem;
  color: var(--white-60);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.not-found__link {
  display: inline-block;
  background: var(--white-08);
  border: 1px solid var(--white-20);
  border-radius: var(--radius);
  color: var(--white);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.not-found__link:hover {
  background: var(--white-12);
  border-color: var(--white-30);
}

.gui-separator {
  height: 1px;
  background: var(--white-10);
  margin: 0;
}

/* ==========================================================================
   Docs Page
   ========================================================================== */

.docs-page {
  background: var(--bg);
}

.docs-container {
  max-width: 64rem;
  margin: 0 auto;
  padding: calc(var(--header-height) + 2.5rem) 2rem 5rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--white-60);
}

.docs-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--white-90);
  margin: 0 0 1rem;
}

.docs-lead {
  font-size: 0.9rem;
  color: var(--white-50);
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--white-12);
  line-height: 1.7;
}

.docs-container h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white-90);
  margin: 2.5rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--white-12);
}

.docs-container h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.docs-container h2 i {
  color: var(--green);
  font-size: 0.7rem;
  opacity: 0.85;
  flex-shrink: 0;
}

.docs-container p {
  margin: 0 0 0.75rem;
}

.docs-container ul {
  padding-left: 1.5rem;
  margin: 0 0 0.75rem;
}

.docs-container a {
  color: var(--green);
  text-decoration: none;
}

.docs-container a:hover {
  text-decoration: underline;
}

.docs-container code {
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.7rem;
  background: var(--white-08);
  padding: 0.125rem 0.25rem;
  border-radius: var(--radius-sm);
  color: var(--white-80);
}

.docs-container pre {
  background: var(--white-08);
  border: 1px solid var(--white-12);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--white-80);
}

.docs-container iframe {
  display: block;
  width: 100%;
  height: 500px;
  border: 1px solid var(--white-12);
  border-radius: var(--radius);
  margin: 1rem 0;
  background: var(--white-08);
}

.docs-container pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.docs-container .api-docs-table th,
.docs-container .api-docs-table td {
  padding: 0.5rem 0.75rem;
}

@media screen and (max-width: 760px) {
  .docs-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ==========================================================================
   About Page
   ========================================================================== */

/* about-container is About-only; docs-container stays unchanged for terms/privacy */
.about-container {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 2rem 5rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--white-60);
}

/* Banner — true viewport full-bleed via 100vw trick.
   overflow-x: hidden on .about-page (ancestor) prevents horizontal scrollbar. */
.about-banner-wrap {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-bottom: 1rem;
  padding-top: var(--header-height);
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

.about-banner-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    var(--bg) 95%
  );
  pointer-events: none;
}

.about-banner {
  width: 100%;
  height: 8rem;
  background-image: url('/assets/images/banner.jpg');
  background-position: center 40%;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Hero */
.about-hero {
  text-align: center;
  max-width: 64rem;
  margin: 0 auto 3rem;
}

.about-hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--white-90);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.about-hero-lead {
  font-size: 1.05rem;
  color: var(--white-50);
  line-height: 1.75;
  margin: 0 auto;
  max-width: 42rem;
  text-wrap: balance;
}

/* Screenshot */
.about-screenshot-wrap {
  margin: 0 0 5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--white-12);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5);
}

.about-screenshot {
  display: block;
  width: 100%;
  height: auto;
}

/* Feature sections */
.about-features {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.about-feature {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  align-items: start;
  gap: 0 1.5rem;
  padding: 3rem 0;
  border-top: 1px solid var(--white-08);
}

/* Paired row (How It Works + Data) — two rounded containers side by side
   instead of stacked rows. The row owns the outer border-top/padding
   (matching the stacked-row rhythm below it); each child feature becomes
   its own subtle rounded box, so the gap between them is what separates
   the pair — no extra divider needed. */
.about-feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2rem;
  align-items: stretch;
  padding: 3rem 0;
}

.about-feature-row .about-feature {
  grid-template-columns: 1fr;
  align-content: start;
  gap: 0.75rem 0;
  padding: 2rem;
  border: 1px solid var(--white-08);
  border-radius: var(--radius);
}

.about-feature-row .about-feature-icon-col {
  justify-content: flex-start;
  padding-top: 0;
}

/* The rounded containers above already provide their own visual close
   (border + padding), so the stacked-row hairline immediately after them
   would be a redundant seam. */
.about-feature-row + .about-feature {
  border-top: none;
}

.about-feature-icon-col {
  display: flex;
  justify-content: center;
  padding-top: 0.25rem;
}

.about-feature-icon {
  font-size: 2rem;
  color: var(--green);
  opacity: 0.85;
}

.about-feature-text-col {
  display: flex;
  flex-direction: column;
}

.about-feature-headline {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--white-90);
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.about-feature-body {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--white-50);
  margin: 0;
}

.about-feature-body a {
  color: var(--green);
  text-decoration: none;
}

.about-feature-body a:hover {
  text-decoration: underline;
}

/* Palette row (inside How It Works feature) */
.about-palette-row {
  margin-top: 1.5rem;
}

/* Contact CTA — full-width rounded container at the bottom of the
   features list, centered content with the email as the focal point. */
.about-contact-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  margin-top: 3rem;
  padding: 3rem 2rem;
  border: 1px solid var(--white-08);
  border-radius: var(--radius);
}

.about-contact-cta-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white-50);
  margin: 0;
}

.about-contact-cta-email {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.about-contact-cta-email:hover {
  text-decoration: underline;
}

@media screen and (max-width: 760px) {
  .about-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .about-banner {
    height: 8rem;
    background-size: auto 240%;
  }

  .about-hero-title {
    font-size: 2.25rem;
  }

  .about-hero-lead {
    font-size: 0.95rem;
  }

  .about-feature {
    grid-template-columns: 1fr;
    gap: 0.75rem 0;
  }

  .about-feature-row {
    grid-template-columns: 1fr;
    row-gap: 1.5rem;
  }

  .about-feature-row .about-feature {
    padding: 1.5rem;
  }

  .about-feature-icon-col {
    justify-content: flex-start;
    padding-top: 0;
  }

  .about-feature-icon {
    font-size: 1.5rem;
  }

  .about-feature-headline {
    font-size: 1.25rem;
  }

  .about-screenshot-wrap {
    margin-bottom: 3rem;
  }

  .about-contact-cta {
    margin-top: 1.5rem;
    padding: 2rem 1.5rem;
  }

  .about-contact-cta-email {
    font-size: 1.25rem;
  }
}

#dot-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.about-page {
  position: relative;
  z-index: 1;
  background: transparent;
  overflow-x: hidden;
}

.wind-palette-strip {
  display: inline-flex;
  gap: 1px;
  vertical-align: middle;
  margin: 0 0.25rem;
}

.wind-sw {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
}

.wind-sw-0 { background: #0a1a3a; }
.wind-sw-1 { background: #1c5fb8; }
.wind-sw-2 { background: #18b0c8; }
.wind-sw-3 { background: #2fb23f; }
.wind-sw-4 { background: #e6d12a; }
.wind-sw-5 { background: #f08000; }
.wind-sw-6 { background: #d62020; }
.wind-sw-7 { background: #d030b0; }
.wind-sw-8 { background: #8a2be2; }
.wind-sw-9 { background: #f5f5f5; }

.wind-sw[data-speed-range] {
  position: relative;
  cursor: help;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wind-sw[data-speed-range]:hover {
  transform: scale(1.35);
  box-shadow: 0 0 0 1px var(--white-20);
  z-index: 1;
}

.wind-sw[data-speed-range]::after {
  content: attr(data-speed-range);
  position: absolute;
  bottom: calc(100% + 0.25rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--overlay-bg);
  color: var(--white-90);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--white-08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.wind-sw[data-speed-range]:hover::after {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .wind-sw[data-speed-range],
  .wind-sw[data-speed-range]::after {
    transition: none;
  }
}

/* ==========================================================================
   Mobile
   ========================================================================== */

@media screen and (max-width: 760px) {
  :root {
    --banner-height: 0px; /* announcement banner disabled 2026-07-15 (Mac app shelved). Reset to 3rem to re-enable; keep a unit for the calc() */
  }

  #announcement-banner {
    line-height: 1.4;
  }

  #app-container {
    width: 100vw;
    height: calc((100svh - var(--header-height) - var(--splitter-size)) / 2);
    top: var(--header-height);
  }

  #map-panel {
    height: 50%; /* data-view rules take over once JS sets the attribute */
    min-height: 0;
  }

  #canvas-panel { min-height: 0; }

  .custom-gui {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: calc((100svh - var(--header-height) - var(--splitter-size)) / 2);
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  #controls-splitter {
    top: auto;
    bottom: calc((100svh - var(--header-height) - var(--splitter-size)) / 2);
    left: 0;
    right: 0;
    width: auto;
    height: var(--splitter-size);
    cursor: pointer;
  }
  #controls-splitter::after {
    box-shadow: -8px 0 0 var(--white-30), 8px 0 0 var(--white-30);
  }
  #controls-splitter:hover::after, #controls-splitter:active::after {
    box-shadow: -8px 0 0 var(--bg), 8px 0 0 var(--bg);
  }

  .cube-detail-content {
    width: 92%;
    max-width: none;
  }

  .cube-detail-label {
    min-width: 6.5rem;
  }
}

/* ==========================================================================
   GUI Hidden State (sidebar toggle)
   ========================================================================== */

body.gui-hidden .custom-gui {
  transform: translateX(100%);
}

body.gui-hidden #app-container {
  width: calc(100vw - var(--splitter-size));
}

body.gui-hidden #controls-splitter {
  right: 0;
}

/* Flip the indicator dot to hint at open direction */
body.gui-hidden #controls-splitter::after {
  opacity: 0.5;
}

/* Mobile — vertical layout, toggle slides panel down off-screen */
@media screen and (max-width: 760px) {
  body.gui-hidden .custom-gui {
    transform: translateY(100%);
  }

  body.gui-hidden #app-container {
    width: 100vw;
    height: calc(100svh - var(--header-height) - var(--splitter-size));
  }

  body.gui-hidden #controls-splitter {
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    height: var(--splitter-size);
  }
}

/* One-shot transition suppression: when a &gui=0 load applies `gui-hidden`
   before the renderer/map are sized, we must not animate the #app-container
   width — the 250ms transition would stretch the canvas during load. The
   class is removed on the next frame so manual toggles still animate. */
body.gui-no-transition .custom-gui,
body.gui-no-transition #app-container,
body.gui-no-transition #controls-splitter {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .custom-gui,
  #app-container,
  #map-panel,
  #controls-splitter {
    transition: none;
  }
}

/* ==========================================================================
   View-mode toggle (header segmented 3D / 2D / Both)
   Matches .gui-btn-group / .gui-btn-option exactly — same gradients, shadows,
   sizing, and active treatment. Visually indistinguishable from the settings
   tab bars.
   ========================================================================== */

/* Container: mirrors .gui-btn-group */
.view-mode-group {
  display: inline-flex;
  gap: 0;
  border-radius: 0.375rem;
  overflow: hidden;
}

/* Segment: mirrors .gui-btn-option */
.view-mode-btn {
  appearance: none;
  border: none;
  border-radius: 0;
  padding: 0.375rem 0.75rem;
  background: linear-gradient(to bottom, var(--white-12), var(--white-08));
  color: var(--white-70);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    inset 0 1px 0 var(--white-12),
    0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Divider: mirrors .gui-btn-option:not(:last-child) */
.view-mode-btn:not(:last-child) {
  border-right: 1px solid var(--white-08);
}

/* Hover: mirrors .gui-btn-option:hover */
.view-mode-btn:hover {
  background: linear-gradient(to bottom, var(--white-20), var(--white-12));
  color: var(--white-90);
}

/* Press: mirrors .gui-btn-option:active */
.view-mode-btn:active {
  background: linear-gradient(to bottom, var(--white-08), var(--white-10));
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(0, 0, 0, 0.2);
  transform: translateY(1px);
}

/* Active segment: mirrors .gui-btn-option.active — recessed brighter-white */
.view-mode-btn.active {
  background: linear-gradient(to bottom, var(--white-15), var(--white-20));
  color: var(--white);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(0, 0, 0, 0.15);
}

/* Focus ring: inward so it's visible inside overflow:hidden */
.view-mode-btn:focus-visible {
  outline: 2px solid var(--white-40);
  outline-offset: -2px;
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .view-mode-btn {
    transition: none;
  }
}
