/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f1923;
  --surface: #182230;
  --surface-hover: #1e2d3d;
  --border: #2a3a4a;
  --text: #e0e6ed;
  --text-dim: #7a8a9e;
  --text-bright: #f0f4f8;
  --accent: #00d67e;
  --accent-dim: rgba(0, 214, 126, 0.15);
  --accent-hover: #00ff96;
  --danger: #ff4757;
  --warning: #ffa502;
  --info: #3b82f6;
  --shadow: rgba(0, 0, 0, 0.3);
  --glass: rgba(15, 25, 35, 0.88);
  --glass-border: rgba(255, 255, 255, 0.08);
  --radius: 8px;
  --radius-sm: 4px;
  --top-height: 48px;
  --footer-height: 26px;
}

[data-theme="light"] {
  --bg: #e8ecf1;
  --surface: #ffffff;
  --surface-hover: #f3f4f6;
  --border: #d0d7de;
  --text: #1f2937;
  --text-dim: #6b7280;
  --text-bright: #111827;
  --accent: #00a65e;
  --accent-dim: rgba(0, 166, 94, 0.1);
  --accent-hover: #00c471;
  --shadow: rgba(0, 0, 0, 0.1);
  --glass: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(0, 0, 0, 0.08);
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Full-screen map === */
#map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* === Leaflet overrides === */
.leaflet-container {
  background: var(--bg) !important;
  font-family: inherit !important;
}

.leaflet-control-attribution {
  display: none !important;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 8px var(--shadow) !important;
}

.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  font-size: 16px !important;
}

.leaflet-control-zoom a:hover {
  background: var(--surface-hover) !important;
  color: var(--accent) !important;
}

.leaflet-control-zoom-in {
  border-radius: 6px 6px 0 0 !important;
}

.leaflet-control-zoom-out {
  border-radius: 0 0 6px 6px !important;
}

.leaflet-top.leaflet-left {
  top: calc(var(--top-height) + 12px) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 4px 16px var(--shadow) !important;
  font-family: inherit !important;
}

.leaflet-popup-tip {
  background: var(--surface) !important;
}

.leaflet-popup-content {
  margin: 12px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.leaflet-popup-close-button {
  color: var(--text-dim) !important;
}

.leaflet-popup-close-button:hover {
  color: var(--danger) !important;
}

/* === Top bar === */
#top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
  gap: 12px;
}

.top-left, .top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.top-center {
  flex: 1;
  max-width: 400px;
  margin: 0 auto;
}

/* === Branding === */
.brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-icon {
  color: var(--accent);
  font-size: 16px;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-bright);
}

.brand-tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 6px;
  border-radius: 3px;
}

/* === Search === */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  transition: border-color 0.2s;
}

.search-wrap:focus-within {
  border-color: var(--accent);
}

.search-icon {
  color: var(--text-dim);
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  padding: 7px 8px;
  font-family: inherit;
  min-width: 0;
}

#search-input::placeholder {
  color: var(--text-dim);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px var(--shadow);
  max-height: 240px;
  overflow-y: auto;
  display: none;
  z-index: 10;
}

.search-results.visible {
  display: block;
}

.search-result-item {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

/* === Icon buttons === */
.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-icon.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* === Theme toggle icons === */
.icon-moon { display: none; }
.icon-sun { display: block; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* === Radar legend === */
.radar-legend {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 800;
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 10px;
  transition: opacity 0.3s;
}

.legend-title {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.legend-bar {
  display: flex;
  gap: 6px;
}

.legend-gradient {
  width: 12px;
  height: 160px;
  border-radius: 2px;
  background: linear-gradient(to top,
    #04e9e7 0%,
    #019ff4 7%,
    #0300f4 14%,
    #02fd02 22%,
    #01c501 29%,
    #008e00 36%,
    #fdf802 44%,
    #e5bc00 51%,
    #fd9500 58%,
    #fd0000 66%,
    #d40000 73%,
    #bc0000 80%,
    #f800fd 90%,
    #9854c6 100%
  );
}

.legend-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 160px;
  font-size: 9px;
  color: var(--text-dim);
  font-weight: 500;
}

/* === Layers panel (side) === */
.layers-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-left: 1px solid var(--glass-border);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.layers-panel.visible {
  transform: translateX(0);
}

.lp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.lp-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.lp-close:hover {
  color: var(--danger);
}

.lp-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.lp-section {
  padding: 10px 16px;
}

.lp-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

/* Toggle switches */
.lp-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  user-select: none;
}

.lp-toggle input { display: none; }

.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.lp-toggle input:checked + .toggle-track {
  background: var(--accent-dim);
}

.lp-toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(16px);
  background: var(--accent);
}

/* Sliders */
.lp-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lp-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

.lp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px var(--shadow);
}

.lp-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface);
}

.lp-slider-val {
  font-size: 12px;
  color: var(--text-dim);
  min-width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Radio buttons */
.lp-radio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lp-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.lp-radio input {
  accent-color: var(--accent);
}

/* Scrollbar */
.lp-body::-webkit-scrollbar { width: 4px; }
.lp-body::-webkit-scrollbar-track { background: transparent; }
.lp-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* === Animation controls (bottom bar) === */
#controls {
  position: absolute;
  bottom: calc(var(--footer-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px 16px;
  max-width: 92vw;
}

.ctrl-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}

.ctrl-btn:hover {
  color: var(--text-bright);
  background: var(--surface-hover);
  border-color: var(--border);
}

/* Play button — accent circle */
.ctrl-play {
  width: 42px;
  height: 42px;
  background: var(--accent) !important;
  color: #0a0e17 !important;
  border-radius: 50% !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 214, 126, 0.3);
}

.ctrl-play:hover {
  background: var(--accent-hover) !important;
  box-shadow: 0 2px 12px rgba(0, 214, 126, 0.5);
}

.ctrl-play .pause-icon { display: none; }
.ctrl-play.playing .play-icon { display: none; }
.ctrl-play.playing .pause-icon { display: block; }

/* Speed button */
.ctrl-speed {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  min-width: 36px;
  font-family: inherit;
}

/* Timeline slider */
.ctrl-timeline {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}

.timeline-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px var(--shadow);
  cursor: pointer;
  transition: transform 0.1s;
}

.timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.timeline-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px var(--shadow);
  cursor: pointer;
}

.timeline-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 8px;
  color: var(--text-dim);
  pointer-events: none;
}

/* Time display */
.ctrl-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  min-width: 72px;
}

.frame-time {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.frame-age {
  font-size: 10px;
  color: var(--text-dim);
}

/* === Loading overlay === */
.loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 2000;
  transition: opacity 0.5s ease;
}

.loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

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

/* === Footer === */
#footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--glass-border);
  z-index: 1000;
  font-size: 10px;
  color: var(--text-dim);
}

#footer a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}

#footer a:hover {
  color: var(--accent);
}

.foot-sep {
  color: var(--border);
}

.foot-attr {
  opacity: 0.7;
}

/* === Weather Panel (left side) === */
.weather-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 340px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--glass-border);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.weather-panel.visible {
  transform: translateX(0);
}

.wp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  min-height: var(--top-height);
}

.wp-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.wp-body::-webkit-scrollbar { width: 4px; }
.wp-body::-webkit-scrollbar-track { background: transparent; }
.wp-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.wp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 16px;
  color: var(--text-dim);
  font-size: 13px;
}

.wp-error {
  padding: 24px 16px;
  color: var(--warning);
  font-size: 13px;
  text-align: center;
}

.wp-prompt {
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}

.wp-no-data {
  color: var(--text-dim);
  font-size: 12px;
}

.wp-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.wp-section:last-child {
  border-bottom: none;
}

.wp-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

/* Current conditions */
.wp-current {
  padding: 14px 16px;
}

.wp-temp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.wp-temp {
  font-size: 44px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.wp-temp-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wp-condition {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.wp-feels {
  font-size: 12px;
  color: var(--text-dim);
}

.wp-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.wp-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.wp-metric-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.wp-metric-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}

.wp-station {
  margin-top: 10px;
  font-size: 10px;
  color: var(--text-dim);
  text-align: right;
}

/* Alerts in weather panel */
.wp-alert {
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  background: var(--surface);
}

.wp-alert:last-child {
  margin-bottom: 0;
}

.wp-alert-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
}

.wp-alert-meta {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.wp-alert-desc {
  font-size: 11px;
  color: var(--text);
  margin-top: 4px;
  line-height: 1.4;
  max-height: 60px;
  overflow: hidden;
}

.wp-alert.severity-extreme { border-left-color: #ff0000; }
.wp-alert.severity-severe { border-left-color: #ff6600; }
.wp-alert.severity-moderate { border-left-color: #ffcc00; }
.wp-alert.severity-minor { border-left-color: #3b82f6; }
.wp-alert.severity-unknown { border-left-color: #888; }

/* Hourly forecast - horizontal scroll */
.wp-hourly {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}

.wp-hourly::-webkit-scrollbar { height: 3px; }
.wp-hourly::-webkit-scrollbar-track { background: transparent; }
.wp-hourly::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.wp-hour {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 6px;
  min-width: 54px;
  border-radius: var(--radius-sm);
  scroll-snap-align: start;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s;
}

.wp-hour:hover {
  background: var(--surface-hover);
}

.wp-hour-time {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
}

.wp-hour-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.wp-hour-temp {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
}

.wp-hour-precip {
  font-size: 9px;
  color: var(--info);
  font-weight: 500;
}

.wp-hour-wind {
  font-size: 9px;
  color: var(--text-dim);
}

/* Daily forecast */
.wp-daily-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.wp-daily-row:last-child {
  border-bottom: none;
}

.wp-daily-day {
  width: 32px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.wp-daily-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  flex-shrink: 0;
}

.wp-daily-desc {
  flex: 1;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wp-daily-temps {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.wp-daily-high {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  min-width: 28px;
  text-align: right;
}

.wp-daily-low {
  font-size: 13px;
  color: var(--text-dim);
  min-width: 28px;
  text-align: right;
}

.wp-daily-precip {
  font-size: 10px;
  color: var(--info);
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* === NWS Alert popup styles === */
.alert-popup-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.alert-popup-detail {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* === Responsive === */
@media (max-width: 640px) {
  .brand-name { display: none; }
  .brand-tag { display: none; }

  .top-center {
    max-width: none;
    flex: 1;
    margin: 0 8px;
  }

  #controls {
    width: calc(100% - 20px);
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
  }

  .ctrl-timeline {
    min-width: 60px;
  }

  .ctrl-time {
    min-width: 50px;
  }

  .frame-time {
    font-size: 12px;
  }

  .radar-legend {
    right: 8px;
    padding: 6px;
  }

  .legend-gradient {
    height: 120px;
  }

  .legend-labels {
    height: 120px;
    font-size: 8px;
  }

  .layers-panel {
    width: 260px;
  }

  .weather-panel {
    width: 290px;
  }

  .foot-attr {
    display: none;
  }

  .btn-icon {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 420px) {
  .ctrl-speed {
    display: none;
  }

  .ctrl-time {
    min-width: 44px;
  }

  .weather-panel {
    width: 100%;
  }
}

/* === Tile Loading Bar === */
.tile-loading {
  position: fixed;
  top: var(--top-height);
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.tile-loading.active {
  opacity: 1;
  width: 70%;
  transition: opacity 0.2s, width 12s cubic-bezier(0.1, 0.5, 0.3, 1);
}

.tile-loading.done {
  width: 100%;
  opacity: 0;
  transition: width 0.15s ease, opacity 0.3s ease 0.15s;
}
