/* Weather widgets (includes/weather_widgets.php, assets/js/weather-widgets.js): Now, Next 12 Hours, Best Window,
   10-Day Forecast, Soil/ET/UV, Rain Since Last Service, the Dashboard alert bar and the alert toast.
   Nothing wraps: long text ends in "…". Phones (≤700px) get one column and slimmer rows. */
.wxw-arr { vertical-align: -3px; color: var(--blue); flex: none; }
.wxw-legend { font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; margin: -4px 0 6px; }
.wxw-legend a { color: var(--muted); text-decoration: underline dotted; }
.wxw-asof { font-size: .72rem; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wxw-asof .sx-dot { width: 8px; height: 8px; }
.wxw-asof-paused { color: var(--ink); font-weight: 600; }

/* Now */
.wxw-hero { display: flex; flex-direction: column; min-width: 0; }
.wxw-main { display: flex; align-items: center; gap: 10px; white-space: nowrap; min-width: 0; }
.wxw-ico { font-size: 2.6rem; line-height: 1; flex: none; }
.wxw-temp { font-size: 3rem; font-weight: 750; line-height: 1; letter-spacing: -2px; flex: none; font-variant-numeric: tabular-nums; }
.wxw-sub { display: flex; flex-direction: column; min-width: 0; }
.wxw-sub b, .wxw-sub > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wxw-sub b { font-size: .95rem; }
.wxw-sub > span { color: var(--muted); font-size: .82rem; }
.wxw-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 10px 0 6px; border-top: 1px solid var(--paper); padding-top: 8px; }
.wxw-stats div { min-width: 0; white-space: nowrap; overflow: hidden; }
.wxw-stats span { display: block; font-size: .7rem; color: var(--muted); }
.wxw-stats b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.wxw-stats small { font-size: .7rem; color: var(--muted); font-weight: 400; }
.wxw-wide { flex-direction: row; align-items: center; gap: 18px; }
.wxw-wide .wxw-main { flex: 0 1 auto; }
.wxw-wide .wxw-stats { flex: 1; margin: 0; border: 0; padding: 0 0 0 16px; border-left: 1px solid var(--paper); }
.wxw-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; white-space: nowrap; min-width: 0; padding-top: 4px; }
.wxw-foot .badge { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wxw-sun { font-size: .74rem; color: var(--muted); margin-left: auto; flex: none; }
.wxw-s .wxw-temp { font-size: 2.4rem; }
.wxw-s .wxw-ico { font-size: 2rem; }
.wxw-hero.wxw-s { flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; }
.dw[data-key=weather] .dw-in > .dw-days:last-child { margin-top: 10px; }

/* Next 12 hours */
.wxw-strip { position: relative; flex: 1; min-height: 0; overflow: hidden; container-type: inline-size; }
/* Hours share the card's width (Oct 17, 2026: no control row scrolls sideways): the later hours step out as the card narrows
   (12 at 600px+, 9, 7, then 5), and the temperature line, drawn for all 12, hides once any hour is out. */
.wxw-hcols { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); height: 100%; }
@container (max-width: 599px) { .wxw-hc:nth-of-type(n+10), .wxw-spark { display: none; } }
@container (max-width: 459px) { .wxw-hc:nth-of-type(n+8) { display: none; } }
@container (max-width: 319px) { .wxw-hc:nth-of-type(n+6) { display: none; } }
.wxw-spark { position: absolute; left: 0; right: 0; top: 64px; height: 14px; width: 100%; pointer-events: none; opacity: .5; }
.wxw-hc { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2px; white-space: nowrap; border-left: 1px solid var(--paper); padding: 2px; min-width: 0; }
.wxw-hc:first-of-type { border-left: 0; }
.wxw-hc.now { background: #F3F8FF; border-radius: 8px; border-left: 0; }
.wxw-ht { font-size: .7rem; color: var(--muted); font-weight: 650; }
.wxw-hc i { font-style: normal; font-size: 1.15rem; line-height: 1.1; }
.wxw-hc b { font-size: .95rem; margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.wxw-hw { font-size: .74rem; display: flex; align-items: center; gap: 1px; font-variant-numeric: tabular-nums; }
.wxw-hw small { color: var(--muted); }
.wxw-hw.bad, .wxw-hw.bad small { color: var(--red); font-weight: 700; }
.wxw-hp { width: 8px; height: 24px; background: var(--paper); border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; margin-top: 2px; }
.wxw-hp em { display: block; width: 100%; background: var(--blue); border-radius: 4px; }
.wxw-hpn { font-size: .68rem; color: var(--blue); }
.wxw-ha { font-size: .64rem; color: var(--muted); min-height: .9em; }

/* Best window */
.dw[data-key=wx_window] .dw-in { justify-content: space-evenly; }
.wxw-wrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 170px; gap: 12px; align-items: center; margin: 3px 0; white-space: nowrap; min-width: 0; }
.wxw-wl { font-size: .78rem; font-weight: 650; color: var(--muted); overflow: hidden; }
.wxw-wbar { position: relative; height: 28px; min-width: 0; }
.wxw-segs { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 2px; height: 100%; }
.wxw-segs i, .wxw-key i { border-radius: 5px; background: #9FE08A; }
.wxw-segs i.warn, .wxw-key i.warn { background: #FFC987; }
.wxw-segs i.bad, .wxw-key i.bad { background: #F6A8A1; }
.wxw-segs i.none { background: var(--paper); }
.wxw-segs i.past { opacity: .35; filter: grayscale(.6); }
.wxw-segs i:first-child { border-radius: 8px 5px 5px 8px; }
.wxw-segs i:last-child { border-radius: 5px 8px 8px 5px; }
.wxw-sunm { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #F08A24; border-radius: 2px; }
.wxw-nowm { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--ink); }
.wxw-nowm span { position: absolute; top: -13px; left: -10px; font-size: .62rem; font-weight: 400; }
.wxw-best { font-weight: 750; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wxw-best.none { color: var(--red); }
.wxw-ticks { position: relative; height: 14px; min-width: 0; }
.wxw-ticks span { position: absolute; transform: translateX(-50%); font-size: .64rem; color: var(--muted); }
.wxw-ticks span:first-child { transform: none; }
.wxw-ticks span:last-child { transform: translateX(-100%); }
.wxw-key { font-weight: 400; font-size: .7rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.wxw-key i { width: 12px; height: 8px; border-radius: 3px; display: inline-block; flex: none; }
.wxw-key i + i, .wxw-key i:not(:first-child) { margin-left: 6px; }

/* 10-day */
.wxw-frows { display: flex; flex-direction: column; flex: 1; justify-content: space-between; min-height: 0; }
button.wxw-fr, .wxw-fr {
  display: grid; grid-template-columns: 58px 24px 38px 34px minmax(50px, 1fr) 34px 70px 10px; gap: 8px; align-items: center;
  height: auto; min-height: 0; padding: 3px 6px 3px 8px; border: 0; border-left: 3px solid transparent; border-radius: 8px;
  background: none; color: var(--ink); font: inherit; font-weight: inherit; white-space: nowrap; cursor: pointer; text-align: left; min-width: 0;
  box-shadow: none; justify-content: stretch;
}
/* Beat the global solid-blue button:hover so lows, gusts and the bar stay readable. */
button.wxw-fr:hover, button.wxw-fr:focus-visible, .wxw-fr:hover, .wxw-fr:focus-visible {
  background: rgba(30, 144, 255, .07); color: var(--ink); border-color: transparent; border-left-color: rgba(30, 144, 255, .55); outline: none; box-shadow: none;
}
button.wxw-fr.open, .wxw-fr.open {
  background: rgba(30, 144, 255, .12); color: var(--ink); border-left-color: var(--blue);
}
button.wxw-fr:hover .wxw-fl, button.wxw-fr:focus-visible .wxw-fl, button.wxw-fr.open .wxw-fl,
button.wxw-fr:hover .wxw-fg, button.wxw-fr:focus-visible .wxw-fg, button.wxw-fr.open .wxw-fg { color: var(--muted); }
button.wxw-fr:hover .wxw-fg.bad, button.wxw-fr:focus-visible .wxw-fg.bad, button.wxw-fr.open .wxw-fg.bad { color: var(--red); }
button.wxw-fr:hover .wxw-fp, button.wxw-fr:focus-visible .wxw-fp, button.wxw-fr.open .wxw-fp { color: var(--blue); }
button.wxw-fr:hover .wxw-fp.z, button.wxw-fr:focus-visible .wxw-fp.z, button.wxw-fr.open .wxw-fp.z { color: var(--line); }
button.wxw-fr:hover .wxw-fh, button.wxw-fr:focus-visible .wxw-fh, button.wxw-fr.open .wxw-fh,
button.wxw-fr:hover .wxw-fd, button.wxw-fr:focus-visible .wxw-fd, button.wxw-fr.open .wxw-fd { color: var(--ink); }
button.wxw-fr:hover .wxw-frg, button.wxw-fr:focus-visible .wxw-frg, button.wxw-fr.open .wxw-frg { background: var(--paper); }
button.wxw-fr:hover .wxw-chev, button.wxw-fr:focus-visible .wxw-chev, button.wxw-fr.open .wxw-chev { color: var(--line); }
.wxw-fd { font-weight: 650; overflow: hidden; white-space: nowrap; }
.wxw-fr i { font-style: normal; font-size: 1.1rem; text-align: center; }
.wxw-fp { color: var(--blue); font-size: .75rem; text-align: right; }
.wxw-fp.z { color: var(--line); }
.wxw-fl { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.wxw-fh { font-weight: 750; font-variant-numeric: tabular-nums; }
.wxw-frg { position: relative; height: 6px; background: var(--paper); border-radius: 3px; }
.wxw-frg em { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #5BB8FF, #F5C342, #F08A24); }
.wxw-fg { font-size: .74rem; color: var(--muted); text-align: right; overflow: hidden; }
.wxw-fg.bad { color: var(--red); font-weight: 650; }
.wxw-chev { color: var(--line); }
.dw.w4 .wxw-fr, .dw[data-w="4"] .wxw-fr { grid-template-columns: 50px 22px 34px 28px minmax(30px, 1fr) 30px 10px; gap: 6px; }

/* Soil, ET & UV: four readings, a 2x2 grid, a colored edge instead of a box */
.dw-soil.dw-soil4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; flex: 1; align-content: space-evenly; }
.dw-soil.dw-soil4 div { background: none; border-radius: 0; border-left: 3px solid #E7F9E1; padding: 0 0 0 8px; }
.dw-soil.dw-soil4 div:nth-child(2) { border-color: #FFF1E2; }
.dw-soil.dw-soil4 div:nth-child(3) { border-color: #E3F1FF; }
.dw-soil.dw-soil4 div:nth-child(4) { border-color: #FFF6D6; }

/* Rain since last Service */
.wxw-rs { display: flex; gap: 12px; align-items: center; white-space: nowrap; margin-bottom: 4px; min-width: 0; }
.wxw-rs > b { font-size: 2rem; line-height: 1; flex: none; font-variant-numeric: tabular-nums; }
.wxw-rs > span { font-size: .76rem; color: var(--muted); line-height: 1.7; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wxw-rs .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.wxw-rempty { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.wxw-rempty p { margin: 0; }
@media (max-width: 700px) { .wxw-rempty { justify-content: flex-start; } }
.wxw-rin { margin-left: auto; flex: none; font-size: .85rem; font-variant-numeric: tabular-nums; }

/* Alert bar above the Dashboard (always shows while NWS has an alert out) */
.wxw-alerts { display: flex; gap: 8px; margin: 0 0 14px; min-width: 0; }
.wxw-alerts[hidden] { display: none; }
.wxw-ab { flex: 1 1 0; min-width: 0; display: flex; gap: 10px; align-items: center; padding: 9px 14px; border: 0; border-radius: 10px; color: #fff; background: #6A6E74; font: inherit; white-space: nowrap; cursor: pointer; text-align: left; }
.wxw-ab.sev { background: var(--red); }
.wxw-ab.mod { background: #C9661A; }
.wxw-ab b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wxw-ab span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
.wxw-ab u { margin-left: auto; flex: none; }
.wxw-ab.hit { box-shadow: 0 0 0 3px rgba(226, 59, 47, .35); }

/* Alert toast (the shared toast bar, a red edge) */
.toast.wxw-toast { border-left: 5px solid var(--red); }
.toast.wxw-toast-mod { border-left-color: #C9661A; }
.toast.wxw-toast small { opacity: .85; }
.toast.wxw-toast a { color: inherit; text-decoration: underline; font-weight: 700; white-space: nowrap; }

/* Day detail and alert detail (a side sheet; full width on phones) */
.wxw-shade { position: fixed; inset: 0; background: rgba(17, 17, 17, .35); z-index: 200; }
.wxw-sheet { position: fixed; right: 0; top: 0; bottom: 0; width: 460px; max-width: 100vw; background: #fff; z-index: 201; padding: 14px 16px 24px; overflow-y: auto; overflow-x: hidden; box-shadow: -8px 0 28px rgba(0, 0, 0, .18); box-sizing: border-box; }
.wxw-sh { display: flex; align-items: center; gap: 8px; white-space: nowrap; margin-bottom: 8px; min-width: 0; }
.wxw-sh b { font-size: 1.1rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wxw-sh button { color: var(--muted); } /* shared X close (Tracker 880) */
.wxw-sab { background: #FDE7E5; color: #8E1D16; border-radius: 8px; padding: 6px 10px; font-size: .85rem; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wxw-sum { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; white-space: nowrap; }
.wxw-sum i { font-style: normal; font-size: 2.2rem; }
.wxw-sum b { font-size: 2rem; }
.wxw-sum small { font-size: 1.1rem; color: var(--muted); font-weight: 400; }
.wxw-sx { font-size: .86rem; color: #333; margin: 0 0 10px; }
.wxw-s4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 10px; border-top: 1px solid var(--paper); border-bottom: 1px solid var(--paper); padding: 8px 0; }
.wxw-s4 div { min-width: 0; white-space: nowrap; overflow: hidden; }
.wxw-s4 span { display: block; font-size: .7rem; color: var(--muted); }
.wxw-s4 b { font-size: 1rem; }
.wxw-dh, .wxw-dr { display: grid; grid-template-columns: 48px 24px 40px minmax(0, 1fr) 40px 40px 40px 10px; gap: 6px; align-items: center; white-space: nowrap; font-size: .82rem; }
.wxw-dh { font-size: .7rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.wxw-dr { padding: 4px 0; border-bottom: 1px solid var(--paper); }
.wxw-dr i { font-style: normal; }
.wxw-dr em { width: 8px; height: 8px; border-radius: 50%; background: #9FE08A; }
.wxw-dr em.bad { background: #F6A8A1; }
.wxw-dr em.warn { background: #FFC987; }
.wxw-dr em.none { background: var(--paper); }
.wxw-dr .bad { color: var(--red); font-weight: 650; }
.wxw-shint { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; align-items: flex-start; font-size: .82rem; }
.wxw-shint .badge { white-space: normal; }
.wxw-at { white-space: pre-line; font-size: .88rem; color: #333; }

@media (max-width: 1100px) and (min-width: 701px) { .wxw-wrow { grid-template-columns: 44px minmax(0, 1fr) 140px; } }
@media (max-width: 700px) {
  .wxw-temp { font-size: 2.6rem; }
  .wxw-ico { font-size: 2.2rem; }
  .wxw-wide { flex-direction: column; align-items: stretch; gap: 0; }
  .wxw-wide .wxw-stats { margin: 10px 0 6px; border-left: 0; border-top: 1px solid var(--paper); padding: 8px 0 0; }
  .wxw-stats b { font-size: .95rem; }
  .wxw-wrow { grid-template-columns: 34px minmax(0, 1fr); gap: 8px; }
  .wxw-wrow .wxw-best { grid-column: 2; font-size: .82rem; margin-top: -2px; }
  .wxw-ax .wxw-best { grid-column: 1 / -1; justify-content: flex-end; margin-top: 2px; }
  .wxw-fr, .dw.w4 .wxw-fr { grid-template-columns: 56px 22px 32px 28px minmax(36px, 1fr) 30px 10px; gap: 5px; padding: 3px 2px; }
  .wxw-fg { display: none; }
  .wxw-alerts { flex-direction: column; gap: 6px; }
  .wxw-ab { padding: 8px 12px; flex: none; }
  .wxw-sheet { width: 100vw; }
  .wxw-dh, .wxw-dr { grid-template-columns: 44px 22px 34px minmax(0, 1fr) 34px 34px 10px; }
  .wxw-dh > :nth-child(7), .wxw-dr > :nth-child(7) { display: none; }
}
@media (max-width: 380px) { .wxw-sun { display: none; } .wxw-fr, .dw.w4 .wxw-fr { grid-template-columns: 56px 20px 30px 26px minmax(30px, 1fr) 28px 8px; gap: 4px; } }

/* Weather Now in a narrow card (a 4-column widget on an 820px tablet, Oct 18 2026): no smaller fonts; the less important
   bits step out instead. Gusts and Dew Point leave the stats row (Wind and Humidity stay), and sunrise/sunset leaves the
   foot (with the As Of line, which only fits as a cut-off "as") so Good to Spray keeps its room and nothing runs past the card. */
.dw-k-weather { container: wxnow / inline-size; }
@container wxnow (max-width: 260px) {
  .wxw-stats { grid-template-columns: max-content max-content; justify-content: space-between; gap: 8px; }
  .wxw-stats > div:nth-child(2), .wxw-stats > div:nth-child(4) { display: none; }
  .wxw-sun, .wxw-foot .wxw-asof { display: none; }
}
