/* Locate weather: one regional map, with readings in a compact, opaque panel. */
.weather-panel {
  --weather-surface: #15171a;
  --weather-raised: #25282d;
  --weather-muted: #b4becb;
  position: absolute;
  z-index: 1050;
  left: 16px;
  bottom: max(28px, env(safe-area-inset-bottom));
  width: 380px;
  max-width: calc(100vw - 32px);
  border-radius: 16px;
  background: var(--weather-surface);
  color: var(--text-main, #f8fafc);
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.weather-panel[hidden], .weather-panel [hidden] { display: none !important; }
.weather-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 0;
}
.weather-title { flex: 1; min-width: 0; }
.weather-title h2 { font-size: 15px; font-weight: 600; line-height: 1.4; }
.weather-scope, .weather-note, .weather-stamp, .weather-credit {
  font-size: 12px;
  color: var(--weather-muted);
}
.weather-panel button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  background: var(--weather-raised);
  min-height: 36px;
  padding: 6px 10px;
}
.weather-panel button:hover { background: #33373e; }
.weather-panel button:focus-visible,
.weather-panel input:focus-visible,
.weather-panel a:focus-visible {
  outline: 2px solid var(--primary, #38bdf8);
  outline-offset: 3px;
}
.weather-panel button:disabled { color: #b4becb; cursor: default; }
.weather-panel button[aria-pressed="true"] { background: #f8fafc; color: #15171a; }
.weather-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px !important; }
.weather-toggle svg { width: 14px; height: 14px; }
.weather-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.weather-current { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 16px 12px; }
.weather-temperature { font-size: 30px; line-height: 1.25; font-weight: 500; }
.weather-description { font-size: 12px; color: var(--weather-muted); }
.weather-conditions { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.weather-conditions .weather-note { color: var(--weather-muted); }
.weather-modes { display: grid; grid-template-columns: 1fr 1fr 1fr 1.5fr; gap: 4px; padding: 0 12px 12px; }
.weather-modes button { padding-inline: 5px; font-size: 12px; min-height: 40px; }
.weather-message { padding: 0 16px 12px; font-size: 12px; color: var(--weather-muted); }
.weather-message button { padding: 4px 7px; margin-left: 6px; font-size: 12px; }
.weather-map-info { padding: 0 16px 12px; }
.weather-legend { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: var(--weather-muted); }
.weather-legend span[data-swatch] { width: 16px; height: 8px; display: inline-block; }
.weather-radar-controls { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.weather-radar-controls input { flex: 1; min-width: 0; accent-color: #38bdf8; cursor: pointer; }
.weather-radar-controls output { min-width: 42px; font-size: 12px; text-align: right; }
.weather-radar-controls button { flex: none; min-width: 62px; font-size: 12px; }
.weather-detail {
  border-top: 1px solid #30343a;
  padding: 12px 16px 14px;
  max-height: min(350px, calc(100dvh - 340px));
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.weather-detail h3 { font-size: 14px; font-weight: 600; margin: 2px 0 8px; }
.weather-detail table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 12px; }
.weather-detail th, .weather-detail td { text-align: right; padding: 7px 0; vertical-align: middle; }
.weather-detail th:first-child, .weather-detail td:first-child { text-align: left; width: 21%; }
.weather-detail th { font-weight: 400; color: var(--weather-muted); }
.weather-detail td { border-top: 1px solid #272b31; }
.weather-detail td small { display: block; color: var(--weather-muted); font-size: 11px; }
.weather-stamp { margin: 0 0 10px; }
.weather-credit { padding: 0 16px 10px; }
.weather-credit a { color: inherit; text-underline-offset: 3px; }
.weather-point { background: none; border: 0; }
.weather-point-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 54px;
  min-height: 32px;
  padding: 4px 7px;
  border-radius: 8px;
  color: #fff;
  background: #15171a;
  font: 600 14px/1.2 'Plus Jakarta Sans', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  border: 1px solid #8594a6;
}
.weather-point-value svg { width: 18px; height: 18px; color: #38bdf8; flex: none; }
.weather-point-temperature { color: #7dd3fc; }
.weather-point-value small { font-size: 11px; font-weight: 400; }
.weather-map-caption {
  background: #15171a;
  color: #f8fafc;
  padding: 7px 10px;
  border-radius: 8px;
  font: 12px/1.4 'Plus Jakarta Sans', system-ui, sans-serif;
}
@media (max-width: 640px) {
  /* 16px + (viewport - 32px) + 16px. Map controls sit above the weather sheet. */
  .weather-panel { width: calc(100vw - 32px); bottom: max(24px, env(safe-area-inset-bottom)); }
  .weather-panel button { min-height: 44px; }
  .weather-top { padding-top: 10px; }
  .weather-current { padding-top: 8px; padding-bottom: 10px; }
  .weather-modes { padding-bottom: 10px; }
  body.has-weather .fab-container { bottom: calc(var(--weather-panel-height, 170px) + 40px); }
  body.weather-expanded .fab-container { display: none; }
  .weather-detail { max-height: min(280px, calc(100dvh - 390px)); }
}
@media (prefers-reduced-motion: reduce) {
  .weather-panel *, .weather-point-value * { transition: none !important; }
}
