/* Weather: Home's card, the full forecast and the rain radar (app/views/weather.js).
   The two chart colours were checked with the data-viz validator on every
   theme's surface: blue for rain, amber for temperature. */
:root[data-tone="dark"] { --wx-rain: #3987e5; --wx-temp: #c98500; }
:root, [data-tone="light"] { --wx-rain: #2563eb; --wx-temp: #b7791f; }

.weather-body { padding: 14px 16px 14px; }
.weather-now { display: flex; align-items: center; gap: 12px; }
.weather-ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.weather-ic.big { width: 62px; height: 62px; border-radius: 16px; }
.weather-temp { border: none; background: none; padding: 0; font-family: var(--font); font-weight: 650; font-size: 42px; line-height: 1; color: var(--text); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.weather-temp.big { font-size: 56px; }
.weather-label { font-weight: 600; text-transform: capitalize; }

/* Is it raining? */
.wx-rain { display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 550;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.wx-rain.now { background: color-mix(in srgb, var(--wx-rain) 16%, var(--surface)); border-color: color-mix(in srgb, var(--wx-rain) 40%, transparent); color: var(--text); }
.wx-rain.now svg, .wx-rain.soon svg { color: var(--wx-rain); }
.wx-rain.soon { color: var(--text); }
.wx-rain .tiny { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* The next twelve hours, side by side. */
.segmented.sm button { height: 28px; padding: 0 10px; font-size: 12.5px; }
.wx-hours { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(46px, 1fr); gap: 2px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.wx-hours::-webkit-scrollbar { display: none; }
.wx-hour { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px 6px; border-radius: 10px; color: var(--text-2); }
.wx-hour:first-child { background: var(--surface-2); }
.wx-hour b { color: var(--text); font-variant-numeric: tabular-nums; }
.wx-pop { display: flex; align-items: flex-end; width: 8px; height: 18px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.wx-pop i { display: block; width: 100%; background: color-mix(in srgb, var(--wx-rain) 55%, var(--surface-3)); border-radius: 2px 2px 0 0; }
.wx-pop.on i { background: var(--wx-rain); }
.wx-pop-n { min-height: 15px; color: var(--wx-rain); font-weight: 600; font-variant-numeric: tabular-nums; }

/* The week, in the card. */
.wx-days-mini { display: flex; flex-direction: column; margin-top: 8px; }
.wx-day-mini { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border: none; background: none; border-radius: 8px; color: var(--text); text-align: left; }
.wx-day-mini:hover { background: var(--hover); }
.wx-rainp { color: var(--wx-rain); font-weight: 600; min-width: 34px; display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.wx-range { position: relative; flex: 0 0 72px; height: 5px; border-radius: 5px; background: var(--surface-3); }
.wx-range i { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: linear-gradient(90deg, #6cb4ff, #f5bf4f); }

/* ---- The full forecast ---- */
.wx-dialog .dialog-body { padding-top: 6px; }
.wx-top { display: flex; flex-direction: column; }
.wx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.wx-stat { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.wx-stat b { font-size: 16px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .wx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.wx-days { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.wx-day + .wx-day { border-top: 1px solid var(--border); }
.wx-day-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: none; background: none; color: var(--text); text-align: left; }
.wx-day-row:hover { background: var(--hover); }
.wx-day-name { width: 96px; font-weight: 600; font-size: 13.5px; }
.wx-day-label { flex: 1; min-width: 0; text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-day .wx-range { flex-basis: 110px; }
.wx-chev { color: var(--text-3); transition: transform .2s var(--ease-out); }
.wx-day.open .wx-chev { transform: rotate(180deg); }
.wx-day.open { background: var(--surface-2); }
.wx-day-more { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 2px 14px 14px; }
.wx-day-more > span { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 640px) { .wx-day-label { display: none; } .wx-day-name { width: 72px; } .wx-day .wx-range { flex-basis: 60px; } .wx-day-more { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* The hourly chart: one axis of time, two small charts. */
.wx-chart-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; padding: 10px 4px 2px; background: var(--surface); }
.wx-svg { display: block; overflow: visible; font-family: var(--font); }
.wx-svg:focus { outline: none; }
.wx-svg:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
.wx-temp-line { stroke: var(--wx-temp); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wx-temp-dot { fill: var(--wx-temp); stroke: var(--surface); stroke-width: 2; }
.wx-rain-bar { fill: var(--wx-rain); opacity: .85; }
.wx-rain-bar.hot { opacity: 1; }

/* ---- Radar ---- */
.radar { display: flex; flex-direction: column; gap: 8px; }
.radar-map { position: relative; height: min(420px, 56vh); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); cursor: grab; touch-action: none; user-select: none; }
.radar-map:active { cursor: grabbing; }
.radar-map img { position: absolute; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.radar-layer { position: absolute; inset: 0; opacity: 0; transition: opacity .25s ease; }
.radar-layer.on { opacity: .8; }
.radar-me { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--accent); border: 2.5px solid #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent), 0 1px 4px rgba(0, 0, 0, .4); }
.radar-zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; }
.radar-zoom .icon-btn { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.radar-credit { position: absolute; right: 0; bottom: 0; padding: 2px 8px; font-size: 10.5px; background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--text-3); border-top-left-radius: 8px; }
.radar-credit a { color: var(--text-2); }
.radar-bar { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.radar-scrub { accent-color: var(--accent); }
.radar-time { min-width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.radar-key { display: flex; align-items: center; gap: 8px; }
.radar-key i { width: 90px; height: 6px; border-radius: 6px; background: linear-gradient(90deg, #9be1ff, #38a3f0, #1158d6, #f9e14a, #f2603a); }
@media (prefers-reduced-motion: reduce) { .radar-layer { transition: none; } }
