body.weather-active { overflow: hidden; }
.weather-place-label { color: var(--nc-color-text-primary); text-align: center; font-size: 11px; line-height: 20px; white-space: nowrap; text-shadow: 0 1px 3px var(--nc-color-deep-navy), 0 0 5px var(--nc-color-deep-navy); pointer-events: none; }
body.weather-active .topbar { display: none; }
body.weather-active .app-shell { padding-top: 0; }
.screen.route-weather-screen.active {
  display: flex; flex-direction: column; position: fixed;
  inset: max(8px, var(--safe-top)) max(0px, env(safe-area-inset-right)) calc(108px + var(--safe-bottom)) max(0px, env(safe-area-inset-left));
  color: var(--nc-color-text-primary); background: var(--nc-color-canvas); min-width: 0; overflow: hidden; align-items: stretch;
}
body.weather-active .screen.route-weather-screen.active { gap: 0; }
body.weather-active .route-weather-screen > .module-heading { flex: 0 0 auto; margin: 0 !important; padding: 4px 14px 8px; min-height: 48px; }
.route-weather-screen *, .route-weather-screen *::before, .route-weather-screen *::after { box-sizing: border-box; letter-spacing: 0; }
.route-weather-screen [hidden] { display: none !important; }
.route-weather-screen :focus-visible { outline: 2px solid var(--nc-color-accent-blue); outline-offset: -2px; }
.route-weather-screen button { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; font-weight: 600; }
.route-weather-screen button:disabled { opacity: 0.5; cursor: default; }
.weather-workspace { flex: 1 1 auto; position: relative; min-height: 0; min-width: 0; width: 100%; isolation: isolate; background: var(--nc-color-canvas); }
.weather-map { position: absolute; inset: 0; z-index: 0; background: var(--nc-color-canvas); }
.weather-terrain-tiles { filter: brightness(0.62) saturate(0.65); }
.weather-tile-unavailable { background: repeating-linear-gradient(135deg, transparent 0 12px, color-mix(in srgb, var(--nc-color-text-secondary) 25%, transparent) 12px 13px); }
.weather-forecast-canvas { position: absolute; pointer-events: none; }
.weather-map-top { position: absolute; z-index: 2; top: 10px; left: 12px; right: 12px; max-width: 430px; pointer-events: none; }
.weather-map-top > button { width: 100%; pointer-events: auto; padding: 8px 12px; border: 1px solid var(--nc-color-border); background: color-mix(in srgb, var(--nc-color-deep-navy) 92%, transparent); color: var(--nc-color-text-primary); }
.weather-map-top strong { flex: 1; min-width: 0; text-align: left; font-size: 16px; overflow-wrap: anywhere; }
.weather-map-top p { font-size: 12px; line-height: 1.4; margin: 5px 0 0; padding: 5px 9px; width: fit-content; max-width: 100%; border-radius: 5px; background: color-mix(in srgb, var(--nc-color-deep-navy) 90%, transparent); }
.weather-map-tools { position: absolute; z-index: 2; top: 104px; right: 12px; display: grid; gap: 7px; }
.weather-map-tools button { width: 44px; height: 44px; border: 1px solid var(--nc-color-border); background: color-mix(in srgb, var(--nc-color-deep-navy) 94%, transparent); color: var(--nc-color-text-primary); }
.weather-map-tools button[aria-pressed="true"] { color: var(--nc-color-accent-blue); border-color: var(--nc-color-accent-blue); }
.weather-map-notice { position: absolute; top: 104px; left: 12px; max-width: min(300px, calc(100% - 82px)); z-index: 1; pointer-events: none; padding: 6px 9px; border-radius: 5px; background: color-mix(in srgb, var(--nc-color-deep-navy) 94%, transparent); color: var(--nc-color-text-secondary); font-size: 12px; line-height: 1.45; }
.weather-map-credit { position: absolute; z-index: 1; left: 12px; right: 70px; bottom: var(--weather-bottom-height, 164px); display: flex; align-items: end; flex-wrap: wrap; gap: 6px 12px; pointer-events: none; padding-bottom: 6px; color: var(--nc-color-text-primary); text-shadow: 0 1px 3px var(--nc-color-deep-navy); font-size: 10px; }
#routeWeatherScale { display: block; flex: 0 0 auto; text-align: center; border: solid var(--nc-color-text-primary); border-width: 0 1px 2px; padding: 2px 0; line-height: 1.2; }
.weather-bottom { position: absolute; z-index: 4; bottom: 0; left: 8px; right: 8px; max-height: 82%; display: flex; flex-direction: column; min-width: 0; }
.weather-timeline { flex: 0 0 auto; padding: 6px 9px 0; background: color-mix(in srgb, var(--nc-color-deep-navy) 94%, transparent); border: 1px solid var(--nc-color-border); border-radius: 8px 8px 0 0; min-width: 0; }
.weather-time-heading { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px 44px; align-items: center; gap: 2px; }
.weather-time-heading label { text-align: center; font-size: 12px; line-height: 1.4; color: var(--nc-color-text-primary); min-width: 0; }
.weather-timeline button { color: var(--nc-color-text-primary); background: transparent; border: 0; padding: 3px; font-size: 20px; }
.weather-timeline input { width: 100%; min-height: 28px; display: block; margin: 0; accent-color: var(--nc-color-accent-blue); }
.route-weather-screen input[type="range"] { appearance: none; -webkit-appearance: none; touch-action: none; min-height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; cursor: pointer; }
.route-weather-screen input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--nc-color-text-secondary); }
.route-weather-screen input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border: 2px solid var(--nc-color-text-primary); border-radius: 50%; background: var(--nc-color-accent-blue); }
.route-weather-screen input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--nc-color-text-secondary); }
.route-weather-screen input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 2px solid var(--nc-color-text-primary); border-radius: 50%; background: var(--nc-color-accent-blue); }
.route-weather-screen input[type="range"]:disabled { opacity: 0.5; cursor: default; }
.weather-sheet[data-dragging="true"] { will-change: transform; }
.weather-hour-strip { display: flex; overflow-x: auto; overscroll-behavior-x: contain; gap: 5px; position: relative; padding-bottom: 4px; }
.weather-hour-strip button { flex: 0 0 58px; flex-direction: column; gap: 0; font-size: 12px; border-bottom: 2px solid transparent; border-radius: 0; }
.weather-hour-strip small { font-size: 10px; color: var(--nc-color-text-secondary); }
.weather-hour-strip button[data-available="false"] { color: var(--nc-color-text-secondary); border-bottom-style: dashed; border-bottom-color: var(--nc-color-border); }
.weather-timeline button[aria-pressed="true"] { color: var(--nc-color-accent-blue); border-color: var(--nc-color-accent-blue); }
.weather-sheet { min-height: 44px; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--nc-color-border); border-radius: 8px 8px 0 0; background: var(--nc-color-surface); overflow: hidden; }
.weather-sheet-handle { flex: 0 0 48px; position: relative; width: 100%; padding: 10px 12px 4px; border: 0; background: transparent; color: var(--nc-color-text-primary); font-size: 13px; touch-action: none; }
.weather-sheet-handle > span:nth-child(2) { flex: 1; text-align: left; }
.weather-drag-handle { position: absolute; top: 4px; left: calc(50% - 18px); width: 36px; height: 3px; border-radius: 2px; background: var(--nc-color-text-secondary); }
.weather-sheet-handle[aria-expanded="true"] .button-icon { transform: rotate(180deg); }
.weather-sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 14px 18px; min-height: 0; }
.weather-bottom:has(.weather-sheet-handle[aria-expanded="true"]) .weather-timeline { display: none; }
.weather-route-form, .weather-layer-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 10px; }
.route-weather-screen .weather-sheet label { display: grid; gap: 6px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--nc-color-text-secondary); }
.route-weather-screen input:not([type="range"]), .route-weather-screen select { width: 100%; min-width: 0; min-height: 46px; margin: 0; padding: 10px 8px; border: 1px solid var(--nc-color-border); border-radius: 8px; color: var(--nc-color-text-primary); background: var(--nc-color-surface-elevated); font: 400 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.weather-route-form { --weather-route-label-size: 12px; --weather-route-input-size: 16px; --weather-route-action-size: 13px; gap: 8px; }
.route-weather-screen .weather-route-form > label { gap: 4px; font-size: var(--weather-route-label-size); font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
/* Keep text inputs at least 16px to avoid iOS focus zoom. */
.route-weather-screen .weather-route-form :is(input, select) { min-height: 44px; padding: 8px; font-size: var(--weather-route-input-size); line-height: 1.25; }
.route-weather-screen .weather-route-form select { height: 44px; }
.route-weather-screen .weather-route-form > button { min-width: 0; min-height: 44px; padding: 8px 10px; font-size: var(--weather-route-action-size); line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
.weather-route-form + .weather-status { margin: 6px 0 0; font-size: var(--weather-route-status-size, 12px); line-height: 1.4; }
.weather-route-form + .weather-status:empty { display: none; }
.large-text .weather-route-form { --weather-route-label-size: 15px; --weather-route-input-size: 18px; --weather-route-action-size: 16px; }
.large-text .weather-route-form + .weather-status { --weather-route-status-size: 15px; }
.weather-layer-bar { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); margin: 12px 0; }
.weather-opacity { grid-template-columns: 1fr auto; align-items: center; margin-bottom: 12px; }
.weather-opacity input { grid-column: 1 / -1; width: 100%; min-height: 36px; accent-color: var(--nc-color-accent-blue); margin: 0; }
.weather-status, .weather-meta, .weather-coverage { font-size: 13px; line-height: 1.5; margin: 10px 0; overflow-wrap: anywhere; color: var(--nc-color-text-secondary); }
.weather-coverage { border-left: 2px solid var(--nc-color-accent-gold); padding-left: 10px; }
.weather-map-legend { font-size: 13px; margin: 12px 0; }
.weather-map-legend > strong { display: block; margin-bottom: 6px; }
.weather-color-scale { display: flex; gap: 4px; }
.weather-color-stop { flex: 1; min-width: 0; text-align: center; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.weather-color-stop::before { content: ""; display: block; height: 5px; margin-bottom: 4px; background: var(--weather-swatch); }
.weather-disclosure { border-top: 1px solid var(--nc-color-border); padding: 4px 0; }
.weather-disclosure summary { min-height: 44px; padding: 12px 0; font-size: 14px; font-weight: 600; cursor: pointer; }
.weather-disclosure summary small { font-weight: 400; color: var(--nc-color-text-secondary); margin-left: 6px; }
.weather-disclosure p, .weather-disclosure li { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.weather-disclosure small { color: var(--nc-color-text-secondary); }
.weather-saved-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; padding: 6px 0; }
.weather-saved-row button { padding: 8px; color: var(--nc-color-text-primary); background: var(--nc-color-surface-elevated); border: 1px solid var(--nc-color-border); }
.weather-saved-row button:first-child { display: grid; text-align: left; justify-content: start; font-size: 14px; overflow-wrap: anywhere; }
.weather-saved-row small { font-size: 12px; }
.weather-sources { border-top: 1px solid var(--nc-color-border); font-size: 12px; line-height: 1.6; color: var(--nc-color-text-secondary); }
.weather-sources a { color: var(--nc-color-accent-gold-text); }
.weather-map .leaflet-bar a { background: var(--nc-color-surface); color: var(--nc-color-text-primary); min-width: 44px; min-height: 44px; line-height: 44px; }
.weather-map .leaflet-bottom.leaflet-right { bottom: var(--weather-bottom-height, 164px); }
.weather-map .leaflet-tooltip, .weather-map .leaflet-popup-content-wrapper, .weather-map .leaflet-popup-tip { color: var(--nc-color-text-primary); background: var(--nc-color-surface); border-color: var(--nc-color-border); }
.weather-map .leaflet-tooltip { font-size: 12px; font-weight: 600; }
.weather-map .leaflet-popup-content { max-width: 240px; max-height: 220px; overflow-y: auto; font-size: 14px; overflow-wrap: anywhere; }
.weather-map a.leaflet-popup-close-button { width: 44px; height: 44px; line-height: 44px; }
.weather-wind-symbol { pointer-events: none; }
.weather-wind-arrow { display: block; width: 28px; height: 28px; line-height: 28px; text-align: center; font-size: 22px; color: var(--nc-color-text-primary); text-shadow: 0 1px 2px var(--nc-color-deep-navy); }
/* Light text tokens need an opaque light backing above map imagery. Keep
   deep-navy unchanged: the map renderer also uses it for geographic layers. */
[data-theme-tone="light"] .screen.route-weather-screen.active,
[data-theme-tone="light"] .route-weather-screen :is(.weather-map-top > button, .weather-map-top > p, .weather-map-tools button, .weather-map-notice, .weather-timeline) {
  background: var(--nc-color-surface);
}
[data-theme-tone="light"] body:not(.entry-mode) .screen.route-weather-screen:not(#homeScreen) .back-to-main .back-to-main-icon {
  color: var(--nc-color-accent-gold-text);
}
@media (min-width: 900px) {
  .weather-bottom { max-width: 500px; left: max(12px, calc(50% - 250px)); right: 12px; }
  .weather-map-top { max-width: 370px; }
}
@media (max-height: 620px) {
  .weather-hour-strip { display: none; }
  .weather-map-tools { grid-template-columns: 44px 44px; top: 94px; gap: 5px; }
  .weather-map-notice { top: 94px; max-width: calc(100% - 124px); }
  .weather-map .leaflet-control-zoom { display: none; }
}
@media (orientation: landscape) and (max-height: 620px) {
  .route-weather-screen > .module-heading { min-height: 38px; padding-bottom: 2px; }
  .weather-map-top { max-width: 300px; top: 4px; }
  .weather-map-top p { font-size: 11px; }
  .weather-map-tools { top: 8px; grid-template-columns: repeat(4, 44px); }
  .weather-map-notice { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .weather-bottom { max-width: 300px; left: 12px; max-height: 90%; }
  .weather-sheet-handle { flex-basis: 44px; }
  .weather-map-credit { bottom: 6px !important; left: 330px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .route-weather-screen *, .route-weather-screen *::before, .route-weather-screen *::after { transition: none !important; animation: none !important; }
}
