/* GIS workspace rhythm: Horizon insets, controls, surfaces and themes. */
.weather-map-surface {
  --weather-map-panel: color-mix(in srgb, var(--card) 91%, transparent);
  --weather-map-panel-border: color-mix(in srgb, var(--foreground) 12%, transparent);
}
.weather-map-toolbar { flex-wrap: wrap; padding: var(--space-3); gap: var(--space-3); }
.weather-map-toolbar h2 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.weather-map-time { font-size: var(--fs-xs); line-height: var(--lh-xs); }
.weather-map-actions { flex-wrap: wrap; gap: var(--space-2); }
.weather-map-actions .weather-segmented {
  display: flex; flex: 0 0 auto; width: max-content; max-width: 100%; flex-wrap: nowrap;
  padding: var(--space-1); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--muted);
}
.weather-map-actions .weather-segmented button {
  flex: 0 0 auto; min-height: var(--control-h-m); padding: var(--space-1) var(--space-3);
  font-size: var(--fs-sm); line-height: var(--lh-sm); border-radius: var(--radius-md); color: var(--foreground);
}
.weather-map-actions .weather-segmented button[aria-pressed="true"] {
  color: var(--foreground); background: var(--card); box-shadow: var(--shadow-xs);
}
#weatherMapMode, #weatherGisLink { border-radius: var(--radius-md); min-height: var(--control-h-m); }
#weatherWindCanvas, #weatherWindMotionCanvas { position: absolute; inset: 0; pointer-events: none; }
.weather-map-place, .weather-map-controls, .weather-map-legend {
  border: 1px solid var(--weather-map-panel-border); border-radius: var(--radius-lg);
  background: var(--weather-map-panel); box-shadow: var(--shadow-sm);
  backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
}
.weather-map-place {
  position: absolute; top: var(--space-3); left: var(--space-3);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: var(--space-2); width: min(20rem, calc(100% - 6rem)); padding: var(--space-3);
}
.weather-map-region { grid-column: 1 / -1; width: 100%; }
.weather-map-region .select { width: 100%; min-height: var(--control-h-m); font-size: var(--fs-body); border-radius: var(--radius-md); }
.weather-map-place p { margin: 0; font-size: var(--fs-body); line-height: var(--lh-body); font-variant-numeric: tabular-nums; }
.weather-map-controls { top: var(--space-3); right: var(--space-3); padding: var(--space-1); gap: var(--space-1); }
.weather-map-controls .icon-btn-circle { width: var(--control-h-m); height: var(--control-h-m); border-radius: var(--radius-md); }
.weather-map-controls .icon-btn-circle:hover { background: var(--muted); }
.weather-map-controls button[aria-pressed="true"] { color: var(--foreground); background: var(--muted); }
.weather-map-legend {
  inset-inline: var(--space-3); bottom: var(--space-3); gap: var(--space-2);
  max-width: calc(100% - 2 * var(--space-3)); padding: var(--space-2) var(--space-3);
  font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: 500;
}
.weather-map-playback {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: var(--space-3); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border);
}
#weatherMapPlay { width: var(--control-h-m); height: var(--control-h-m); border-radius: var(--radius-md); background: var(--muted); }
.weather-map-playback input { width: 100%; min-width: 0; height: var(--control-h-m); accent-color: var(--primary); cursor: pointer; }
.weather-map-playback output { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.weather-map-time-actions, .weather-map-time-current { display: flex; align-items: center; gap: var(--space-1); }
.weather-map-time-actions .icon-btn { width: var(--control-h-m); height: var(--control-h-m); border-radius: var(--radius-md); }
.weather-map-time-track { min-width: 0; }
#weatherMapTicks { display: flex; justify-content: space-between; gap: var(--space-2); color: var(--muted-foreground); font-size: var(--fs-2xs); }
.weather-map-inspection { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: var(--space-2); }
.weather-map-inspection > div:first-child { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.weather-map-inspection strong { color: var(--muted-foreground); font-size: var(--fs-xs); font-weight: 500; }
.weather-map-inspection p { font-size: var(--fs-xs); line-height: var(--lh-body); white-space: pre-line; }
.weather-map-place[data-view="point"] > :not(.weather-map-inspection) { display: none; }
.weather-map-place[data-view="point"] .weather-map-inspection { border: 0; padding: 0; }
.weather-map-inspection .weather-map-point-temperature { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 600; margin-block: var(--space-2); }
.weather-map-inspection > div .icon-btn { width: var(--control-h-m); height: var(--control-h-m); border-radius: var(--radius-md); flex: none; }
.weather-map-legend-title { grid-column: 1 / -1; grid-row: 1; text-align: center; color: var(--foreground); font-weight: 600; }
#weatherLegendMin, #weatherLegendBar, #weatherLegendMax { grid-row: 2; }
.weather-map-time-current output { font-size: var(--fs-sm); font-weight: 600; }
.weather-map-time-track input { margin: 0; }
.weather-map-progress { position: absolute; left: 50%; bottom: calc(var(--control-h-m) + var(--space-6)); transform: translateX(-50%); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--card); color: var(--foreground); font-size: var(--fs-xs); box-shadow: var(--shadow-sm); white-space: nowrap; }
.weather-map-note { margin: 0; padding: 0 var(--space-3) var(--space-3); color: var(--muted-foreground); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.weather-map-surface :focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
:root:is([data-theme="hc-light"], [data-theme="hc-dark"]) .weather-map-surface {
  --weather-map-panel: var(--card); --weather-map-panel-border: var(--foreground);
}
body[data-weather-view="map"] .weather-hero-layout,
body[data-weather-view="map"] .weather-forecast-surface,
body[data-weather-view="map"] .weather-calendar-section,
body[data-weather-view="map"] .weather-history-section { display: none; }
body[data-weather-view="map"] .weather-main {
  display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3);
  height: calc(100dvh - var(--main-header-height)); min-height: 34rem;
  margin-top: var(--main-header-height);
}
body[data-weather-view="map"] .weather-intro {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; padding: 0;
}
body[data-weather-view="map"] .weather-outlook-layout { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1fr); }
body[data-weather-view="map"] .weather-workspace { height: 100%; border-radius: var(--radius-lg); box-shadow: none; background: var(--card); }
body[data-weather-view="map"] .weather-map-surface { height: 100%; grid-template-rows: auto minmax(0, 1fr) auto auto; }
body[data-weather-view="map"] .weather-map-wrap { height: auto; min-height: 0; }
body[data-weather-view="map"] .weather-resolution { display: none; }
body[data-weather-view="map"] .weather-map-time { display: none; }
body[data-weather-view="map"] .weather-map-time[data-stale="true"] { display: block; }
body[data-weather-view="map"] .weather-map-toolbar { min-height: calc(var(--control-h-m) + var(--space-6)); }
body[data-weather-view="map"] .weather-source-note { flex: none; padding: 0; margin: 0; }
body[data-weather-view="map"] .weather-source-note p { margin: 0; font-size: var(--fs-2xs); line-height: var(--lh-2xs); }
@media (max-width: 640px) {
  .weather-map-toolbar { align-items: start; }
  .weather-map-actions { width: 100%; }
  .weather-map-actions .weather-segmented button { padding-inline: var(--space-3); }
  body[data-weather-view="map"] .weather-map-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  body[data-weather-view="map"] .weather-map-actions { display: contents; }
  body[data-weather-view="map"] .weather-map-actions .weather-segmented { grid-column: 1 / -1; grid-row: 2; }
  body[data-weather-view="map"] #weatherMapMode { grid-column: 2; grid-row: 1; width: auto; }
  .weather-map-playback { grid-template-columns: auto minmax(0, 1fr); gap: var(--space-2); }
  .weather-map-time-current { grid-column: 2; grid-row: 1; justify-content: end; flex-wrap: wrap; }
  .weather-map-time-current output { white-space: normal; text-align: end; font-size: var(--fs-xs); }
  .weather-map-time-track { grid-column: 1 / -1; grid-row: 2; }
  #weatherMapTicks span:nth-child(2):not(:last-child) { display: none; }
  .weather-map-place { left: var(--space-2); top: var(--space-2); padding: var(--space-2); }
  .weather-map-controls { right: var(--space-2); top: var(--space-2); }
  .weather-map-legend { grid-template-columns: auto minmax(4rem, 9rem) auto; }
  body[data-weather-view="map"] .weather-main { padding: var(--space-2); }
}
