/* Weather v3: the map across the top with its clock; below it the forecasters'
   summary and the forecast chart. Light and dark are each chosen, not inverted. */

:root {
  color-scheme: light;
  --paper: #f7f5f0; --panel: #fffefb; --ink: #1c1c1a; --ink-2: #55534d; --ink-3: #8a877f;
  --rule: #e4e0d6; --rule-2: #d3cec2;
  --temp: #eb6834; --dew: #1baf7a; --wind: #2a78d6; --gust: rgba(42, 120, 214, 0.22);
  --pop: #2a78d6; --sky: rgba(120, 118, 110, 0.2); --night: rgba(40, 46, 70, 0.055);
  --seas: rgba(27, 175, 122, 0.55); --tide: #2a78d6; --hl: rgba(235, 104, 52, 0.16); --warn: #d03b3b;
  --water: #dfe8ee; --land: #f4f1e8; --border: rgba(60, 60, 50, 0.35); --coast: rgba(40, 50, 60, 0.55);
  --isobar: rgba(30, 30, 30, 0.6); --flow: 20, 32, 52;
  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #151514; --panel: #1c1c1a; --ink: #eeece6; --ink-2: #bdbab0; --ink-3: #8c897f;
    --rule: #2e2d2a; --rule-2: #3c3a36;
    --temp: #f07a4a; --dew: #2bc48c; --wind: #5b9cf0; --gust: rgba(91, 156, 240, 0.25);
    --pop: #5b9cf0; --sky: rgba(200, 196, 186, 0.16); --night: rgba(0, 0, 0, 0.28);
    --seas: rgba(43, 196, 140, 0.5); --tide: #5b9cf0; --hl: rgba(240, 122, 74, 0.2); --warn: #ef6b6b;
    --water: #10161c; --land: #1d1f1d; --border: rgba(220, 220, 210, 0.22); --coast: rgba(220, 225, 230, 0.45);
    --isobar: rgba(235, 235, 230, 0.6); --flow: 235, 240, 248;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: inherit; text-decoration-color: var(--rule-2); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* The map: locked to the area the model covers. */
.map { position: relative; width: 100%; aspect-ratio: 1.85 / 1; max-height: 64vh; min-height: 280px; background: var(--water); touch-action: manipulation; user-select: none; -webkit-user-select: none; overflow: hidden; cursor: crosshair; }
.map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.clock { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: center; gap: 2px 10px; padding: 7px 14px 8px 8px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 3px 14px rgba(0, 0, 0, 0.1); backdrop-filter: blur(6px); cursor: default; }
#play { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule-2); background: var(--panel); cursor: pointer; font-size: 12px; padding: 0; }
.when { margin: 0; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.when .h { color: var(--ink-2); }
.track { position: relative; height: 14px; width: 260px; cursor: pointer; touch-action: none; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--rule-2); border-radius: 2px; }
.track .fill { position: absolute; left: 0; top: 6px; height: 2px; background: var(--temp); border-radius: 2px; }
.track .knob { position: absolute; top: 2px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--temp); }
.mapnote { position: absolute; left: 12px; bottom: 12px; margin: 0; font-size: 13px; background: var(--panel); border: 1px solid var(--rule-2); border-radius: 8px; padding: 6px 10px; max-width: 300px; }
.mapnote[hidden] { display: none; }
.maphint { position: absolute; right: 12px; bottom: 8px; margin: 0; font-size: 11.5px; color: var(--ink-3); background: color-mix(in srgb, var(--land) 80%, transparent); padding: 1px 6px; border-radius: 4px; pointer-events: none; }

/* Below the map: the summary and the chart. */
.below { max-width: 1320px; margin: 0 auto; padding: 18px 20px 24px; display: grid; grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.45fr); gap: 28px; align-items: start; }
.pill input { width: 100%; max-width: 280px; font-size: 15px; padding: 7px 14px; border: 1px solid var(--rule-2); border-radius: 99px; background: var(--panel); color: var(--ink); }
.place { margin: 14px 0 6px; font: 600 26px/1.15 var(--serif); letter-spacing: -0.01em; }
.alerts:empty { display: none; }
.alerts details { border-left: 3px solid var(--warn); background: var(--panel); padding: 6px 10px; border-radius: 0 8px 8px 0; margin: 0 0 8px; font-size: 14px; }
.alerts summary { cursor: pointer; font-weight: 600; }
.alerts summary span { font-weight: 400; color: var(--ink-2); }
.alerts p { margin: 6px 0; white-space: pre-line; font-size: 13.5px; }
.text { font: 18px/1.55 var(--serif); }
.text p { margin: 0 0 0.8em; }
.text ul { margin: 0 0 0.6em; padding-left: 1.05em; }
.text li { margin: 0 0 0.65em; }
.text li::marker { color: var(--temp); }
.text .loading, .text .note { font: 14px var(--sans); color: var(--ink-3); }
.text .err { font: 14px var(--sans); color: var(--warn); }
.by { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }
.by:empty, .more:empty { display: none; }
.more { margin: 10px 0 0; font-size: 14px; }
.t { all: unset; cursor: pointer; text-decoration: underline dotted var(--ink-3); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.card { position: fixed; z-index: 20; max-width: 320px; background: var(--panel); border: 1px solid var(--rule-2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); padding: 10px 12px; font-size: 14px; }

/* The chart (v2's meteogram). */
.chart { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 12px 6px; }
.chart-head { display: flex; justify-content: flex-end; gap: 8px; margin: 0 4px 4px; }
.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 7px; overflow: hidden; font-size: 13px; }
.seg button { border: 0; background: none; padding: 4px 9px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--ink); color: var(--paper); }
.readout { min-height: 44px; margin: 2px 4px 4px; font-size: 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; }
.readout b { color: var(--ink); font-weight: 600; }
.readout .rtime { width: 100%; color: var(--ink); font-weight: 600; }
.readout .hint { color: var(--ink-3); }
.mgwrap { width: 100%; touch-action: pan-y; }
.mg { display: block; font-family: var(--sans); }
.mg-night { fill: var(--night); }
.mg-midnight { stroke: var(--rule-2); stroke-width: 1; }
.mg-day { font-size: 12px; fill: var(--ink-2); font-weight: 600; }
.mg-hl { fill: var(--hl); stroke: var(--temp); stroke-width: 1; stroke-opacity: 0.6; }
.mg-label { font-size: 12px; fill: var(--ink-2); }
.mg-legend { font-size: 12px; fill: var(--ink-2); }
.mg-unit { fill: var(--ink-3); }
.mg-key-wave { fill: var(--dew); }
.mg-grid { stroke: var(--rule); stroke-width: 1; }
.mg-axis { stroke: var(--rule-2); stroke-width: 1; }
.mg-tick { font-size: 11px; fill: var(--ink-3); }
.mg-temp { fill: none; stroke: var(--temp); stroke-width: 2.2; stroke-linejoin: round; }
.mg-dew { fill: none; stroke: var(--dew); stroke-width: 2; stroke-linejoin: round; }
.mg-temp-lab { font-size: 12px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.mg-sky { fill: var(--sky); }
.mg-pop { fill: var(--pop); opacity: 0.75; }
.mg-tstm { fill: #6250d6; }
.mg-wind { fill: none; stroke: var(--wind); stroke-width: 2; stroke-linejoin: round; }
.mg-gustband { fill: var(--gust); }
.mg-wave { fill: none; stroke: var(--dew); stroke-width: 2; }
.mg-arrow { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mg-now { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.mg-nowlab { font-size: 11px; fill: var(--ink-3); }
.mg-mark { stroke: var(--temp); stroke-width: 2; }
.mg-cross { stroke: var(--ink-2); stroke-width: 1; }
.mg-dot { stroke: var(--panel); stroke-width: 2; fill: var(--ink); }
.mg-dot-temp { fill: var(--temp); } .mg-dot-sky { fill: var(--pop); } .mg-dot-wind { fill: var(--wind); } .mg-dot-wave { fill: var(--dew); }
.mg-key-temp { fill: var(--temp); } .mg-key-dew { fill: var(--dew); } .mg-key-sky { fill: var(--ink-3); } .mg-key-pop { fill: var(--pop); }
.mg-key-wind { fill: var(--wind); } .mg-key-gust { fill: var(--gust); }
.chart-foot { font-size: 12.5px; color: var(--ink-3); margin: 4px 4px 6px; }

.foot { max-width: 1320px; margin: 0 auto; padding: 4px 20px 30px; color: var(--ink-3); font-size: 12.5px; }
.foot p { margin: 0; }

@media (max-width: 900px) {
  .below { grid-template-columns: 1fr; gap: 18px; padding: 14px 14px 20px; }
  .map { aspect-ratio: 1.35 / 1; }
  .track { width: 180px; }
  .when { font-size: 14px; }
  .place { font-size: 23px; }
  .text { font-size: 17px; }
}

/* Phones: inputs at 16px so iOS does not zoom on focus, and controls big enough to tap. */
@media (max-width: 600px), (pointer: coarse) {
  .pill input { font-size: 16px; min-height: 44px; }
  #play { width: 42px; height: 42px; }
  .seg button { min-height: 40px; min-width: 44px; }
  .t { padding: 10px 0; }
}

/* Credit (DB-0202/1 B): the words and the † open a one-line note; on paper the note prints at the foot. */
.credit summary { display: inline-block; cursor: pointer; list-style: none; }
.credit summary::-webkit-details-marker { display: none; }
.credit summary::marker { content: ""; }
.credit sup { line-height: 0; margin-left: .15em; font-size: 1.05em; }
.credit .cnote { display: block; line-height: 1.4; }
.credit .cnote a { color: inherit; }
.cfoot { display: none; }
.story .credit { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-3); max-width: 30rem; }
.story .credit summary { padding: 4px 0; }
.story .credit sup { color: var(--ink-2); }
.story .credit .cnote { margin: 2px 0 0; padding: 8px 11px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); color: var(--ink-2); font-size: 13.5px; }
@media print { .credit .cnote { display: none; } .cfoot { display: block; font-size: 9pt; color: #333; border-top: 1px solid #999; padding-top: .5em; margin-top: 2em; } }
