/* Layout and type. Colours only through the variables in theme.css.

   Sizes are the mockup's (`tools/design/Main.dc.html`, SPEC Appendix A): phone
   first at 390 wide, 8 px side margins, a 48 px header pill and a 56 px tab
   bar. On a wider screen the app keeps a phone's width, centred, rather than
   stretching stripes and lists across a desktop — except on a computer, where
   Verwachting and Radar take the room (SPEC §2, the block at the end). */

/* Every button refuses the platform's own drawing. Safari otherwise paints
   its own chrome over a button on iOS — a fault that shows only in WebKit on
   a real device (CasaFluxFE CF-GEN-018). One rule here, so a new button
   needs nothing of its own; never widen it to a bare `input`. */
button,
input[type='button'],
input[type='submit'],
input[type='reset'] {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* The window never scrolls; only `.content` does, between the header and
   the tab bar, so neither moves (installed on an iPhone the whole page
   scrolled, tab bar and all, on 2026-10-09). `overflow` must be on `html`
   too: while `html` is `visible` the browser hands `body`'s overflow to the
   viewport, and the page scrolls anyway (CasaFluxFE's style.css, top). */
html {
  height: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  /* The system font, as CasaFluxFE uses. The mockup's DM Sans was dropped on
     2026-10-09: it would need font files in the repo or a call to Google on
     every load, for a look nobody asked for. */
  font-family: system-ui, sans-serif;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}

/* --- the loading screen (index.html #boot), as CasaFluxFE's --- */

#boot {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--bg);
  color: var(--mut);
}

#boot img {
  width: 96px;
  height: 96px;
  /* iOS's own corner rounding of a home-screen icon, so the two look alike. */
  border-radius: 22.37%;
}

#boot p {
  margin: 0;
  font-size: 0.95rem;
  /* Breathing rather than spinning: a spinner claims progress it cannot
     measure, and this is a wait whose length nobody knows. */
  animation: boot-pulse 1.6s ease-in-out infinite;
}

@keyframes boot-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #boot p { animation: none; }
}

/* No rule hides #boot once the app has drawn: main.js removes it, and says
   why a `:has()` rule here was not enough in Safari (WSF-NET-14). */

/* --- the shell --- */

#app {
  display: flex;
  flex-direction: column;
  /* A phone's width; on a computer only the box widens (end of file). */
  --phone: 430px;
  max-width: var(--phone);
  /* The window's height exactly — `100%` of `body`, which is the window —
     not `min-height: 100dvh`, which let a tall tab grow the page past the
     window and scroll it as a whole. */
  height: 100%;
  margin: 0 auto;
  /* Installed on an iPhone the page runs under the status bar
     (`black-translucent`), so the top inset is the app's to clear. */
  padding-top: calc(8px + env(safe-area-inset-top));
}

.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* --- header (SPEC §2.1) --- */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  margin: 0 8px 6px;
  padding: 0 14px 0 16px;
  border-radius: 24px;
  background: var(--card);
  flex: none;
}

.city {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
}

.city-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city .chevron {
  display: flex;
  color: var(--mut);
  transition: transform 0.15s;
}

.city[aria-expanded='true'] .chevron {
  transform: rotate(180deg);
}

.now {
  display: flex;
  align-items: center;
  gap: 8px;
}

.temp {
  font-size: 17px;
  color: var(--fg2);
  margin-left: 2px;
  white-space: nowrap;
}

.symbol {
  width: 28px;
  height: 28px;
  flex: none;
}

/* The wind vane (WSF-HDR-2/3): a fixed ring with a north tick, and an arrow
   turned to where the wind blows. Arrow and number share the strength
   colour, picked by `data-strength`. */
.wind {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--wind-calm);
}

.wind[data-strength='fresh'] {
  color: var(--wind-fresh);
}

.wind[data-strength='strong'] {
  color: var(--wind-strong);
}

.vane {
  position: relative;
  width: 26px;
  height: 26px;
  flex: none;
}

.vane svg {
  position: absolute;
  inset: 0;
  width: 26px;
  height: 26px;
}

.vane-ring circle {
  fill: none;
  stroke: rgba(var(--line-rgb), 0.28);
  stroke-width: 1.2;
}

.vane-tick {
  fill: none;
  stroke: var(--mut);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.vane-head {
  fill: currentColor;
}

.vane-shaft {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.bft {
  font-size: 12px;
  font-weight: 700;
}

/* --- the city list (SPEC §3), a panel under the header --- */

#app {
  position: relative;
}

.cl-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: var(--backdrop);
}

.cl-panel {
  position: absolute;
  left: 8px;
  right: 8px;
  top: calc(62px + env(safe-area-inset-top));
  z-index: 5;
  max-height: calc(100dvh - 140px);
  overflow-y: auto;
  padding: 12px 0 6px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--panel-shadow);
}

.cl-backdrop[hidden],
.cl-panel[hidden] {
  display: none;
}

.cl-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  margin: 0 12px 6px;
  padding: 0 14px;
  border-radius: 21px;
  background: var(--bg);
  color: var(--mut);
}

.cl-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 16px; /* 16 px or iOS zooms the page on focus */
}

.cl-input::placeholder {
  color: var(--mut);
}

.cl-locate {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  padding: 0 20px;
  font-size: 15px;
  color: var(--blue-text);
}

.cl-message {
  margin: 0;
  padding: 14px 20px;
  font-size: 14px;
  color: var(--mut);
}

.cl-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 6px 20px;
  border-top: 1px solid rgba(var(--line-rgb), 0.07);
  text-align: left;
}

.cl-region {
  font-size: 12px;
  color: var(--mut);
}

.cl-item {
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(var(--line-rgb), 0.07);
}

.cl-delete {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: var(--on-accent);
}

.cl-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 0 20px;
  background: var(--card);
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  transition: transform 0.15s;
}

.cl-left,
.cl-right {
  display: flex;
  align-items: center;
}

.cl-left {
  gap: 12px;
  min-width: 0;
  font-size: 16px;
}

.cl-right {
  gap: 14px;
}

.cl-check {
  display: flex;
  color: var(--now);
  opacity: 0;
}

.cl-check .icon {
  stroke-width: 3;
}

.cl-selected .cl-check {
  opacity: 1;
}

.cl-selected .cl-name {
  font-weight: 700;
}

.cl-temp {
  font-size: 15px;
  color: var(--mut2);
}

/* WSF-CTY-3: a trash button on hover, where there is hover. */
.cl-hover-delete {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 15px;
  background: var(--card2);
  align-items: center;
  justify-content: center;
  color: var(--danger-soft);
  opacity: 0;
  transition: opacity 0.15s;
}

@media (hover: hover) {
  .cl-hover-delete {
    display: flex;
  }

  .cl-row:hover .cl-hover-delete {
    opacity: 1;
  }
}

/* --- content --- */

/* The one box that scrolls (see `html`). `contain` keeps a scroll that
   reaches the end from rubber-banding the window behind it. */
.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.panel[hidden] {
  display: none;
}

/* Verwachting fits the box rather than scrolling in it (WSF-VER-13). */
.panel[data-tab='verwachting'] {
  height: 100%;
}

.placeholder {
  margin: 40px 20px;
  color: var(--mut);
  text-align: center;
}

/* --- Vanaf nu (SPEC §2.2; sizes from SPEC Appendix A) --- */

.vanaf-nu {
  margin: 0 8px;
}

.vn-heads,
.vn-row {
  display: flex;
  align-items: center;
}

.vn-heads {
  height: 24px;
  font-size: 10px;
  color: var(--mut);
}

.vn-hour {
  width: 34px;
  flex: none;
}

.vn-cell {
  width: 64px;
  height: 25px;
  flex: none;
}

.vn-temp {
  width: 44px;
  flex: none;
  text-align: center;
}

.vn-feel {
  width: 46px;
  flex: none;
  text-align: center;
}

/* 138 px at the mockup's 390-wide phone; on a narrower one (375) this is the
   column that gives way, its bar box first, so the wind column stays whole. */
.vn-rain {
  flex: 1 1 138px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vn-wind {
  width: 48px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.vn-heads .vn-rain {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vn-list {
  position: relative;
}

.vn-row {
  height: 25px;
}

/* Everything but the stripe cell sits above the two layers below. */
.vn-row > :not(.vn-cell) {
  position: relative;
  z-index: 2;
}

.vn-row:first-child .vn-cell {
  border-radius: 6px 6px 0 0;
}

.vn-last .vn-cell {
  border-radius: 0 0 6px 6px;
}

/* WSF-VAN-2: the divider above 00u, across the stripe too. The row keeps its
   25 px (border-box), so its cell gives up the border's 2 px. */
.vn-divider {
  border-top: 2px solid rgba(var(--line-rgb), 0.55);
}

.vn-divider .vn-cell {
  height: 23px;
}

.vn-hh {
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--fg2);
}

.vn-day {
  display: block;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  color: var(--now);
}

.vn-row .vn-temp {
  font-size: 14px;
  font-weight: 700;
}

.vn-row .vn-feel {
  font-size: 13px;
  color: var(--mut2);
}

.vn-bar-box {
  flex: 0 1 64px;
  min-width: 40px;
  height: 17px;
  overflow: hidden;
  display: flex;
  align-items: center;
  border-left: 1px solid rgba(var(--line-rgb), 0.25);
}

.vn-bar {
  height: 12px;
  border-radius: 0 3px 3px 0;
}

.vn-rain-text {
  font-size: 11px;
  white-space: nowrap;
  color: var(--blue-text);
}

.vn-rain-text.vn-dry {
  color: var(--mut);
}

.vn-row .vn-wind {
  font-size: 11px;
  color: var(--mut2);
}

.vn-arrow {
  width: 11px;
  height: 11px;
  fill: var(--fg2);
}

/* WSF-VAN-5: the elapsed part of the current hour, dimmed, and the now line
   — over the stripe cell, under the text. */
.vn-past {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1;
  background: rgba(var(--bg-rgb), 0.5);
  pointer-events: none;
}

.vn-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 1;
  background: var(--now);
  pointer-events: none;
}

/* The sun card (WSF-VAN-7), docked (WSF-VAN-8): it sticks to the bottom of the scrolling
   box, just above the tab bar, and the rows scroll under it. The dock is
   page-coloured above the card so a row never shows between card and edge,
   and above the rows' text (z-index 2). Last in the tab, so at the end of
   the list it rests where it sticks. */
.vn-sun-dock {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding-top: 8px;
  background: var(--bg);
}

.vn-sun {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 14px;
  border-radius: 26px;
  background: linear-gradient(90deg, var(--sun-left), var(--card) 45%, var(--card) 55%, var(--sun-right));
}

.vn-sun-end {
  display: flex;
  align-items: center;
  gap: 5px;
}

.vn-sun-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vn-rise .vn-sun-icon {
  stroke: var(--sun);
}

.vn-set .vn-sun-icon {
  stroke: var(--sunset);
}

.vn-sun-time {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
}

.vn-sun-word {
  display: block;
  font-size: 9px;
  color: var(--mut);
}

.vn-sun-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vn-arc {
  width: 70px;
  height: 30px;
  overflow: visible;
}

.vn-horizon {
  fill: none;
  stroke: rgba(var(--line-rgb), 0.25);
  stroke-width: 1;
}

.vn-path {
  fill: none;
  stroke: var(--sun);
  stroke-opacity: 0.55;
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}

.vn-sun-dot {
  fill: var(--sun-down);
}

.vn-sun-dot.vn-up {
  fill: var(--sun);
}

.vn-sun-length {
  margin-top: -2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg2);
}

/* --- Verwachting (SPEC §2.4; sizes from SPEC Appendix A) --- */

/* The whole box, no scrolling (WSF-VER-13): the frame takes what the strip,
   legend and credit leave, and inside each column the stripe takes what the
   header, overview and footer leave. Those three heights come from
   verwachtingView.js as --vw-head, --vw-overview and --vw-foot. The stripe
   keeps at least 8 px an hour (the tab scrolls on a screen too short for
   that) and takes at most 20, so a tall desktop window does not stretch it. */
.verwachting {
  display: flex;
  flex-direction: column;
  height: 100%;
  --vw-fixed: calc(var(--vw-head) + var(--vw-overview) + var(--vw-foot));
  /* The hour gutter's share of the frame's width, left of the scroller. */
  --vw-gutter: 26px;
}

.verwachting > * {
  flex: none;
}

.vw-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  margin: 0 8px 6px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--card);
}

.vw-swatch {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 5px;
  border: 1.5px solid rgba(var(--line-rgb), 0.45);
}

.vw-swatch-now {
  border-color: var(--now);
}

.vw-strip-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.vw-when {
  font-size: 11px;
  color: var(--mut);
}

.vw-when-now {
  color: var(--now);
}

.vw-what {
  font-size: 12px;
  color: var(--fg2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vw-what b {
  font-size: 16px;
}

.verwachting > .vw-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: calc(var(--vw-fixed) + 192px);
  max-height: calc(var(--vw-fixed) + 480px);
}

.vw-gutters {
  position: absolute;
  left: 0;
  width: 21px;
  top: calc(var(--vw-head) + var(--vw-overview));
  bottom: var(--vw-foot);
}

.vw-gutter {
  position: absolute;
  right: 0;
  line-height: 12px;
  font-size: 10px;
  color: var(--mut);
}

.vw-scroll {
  position: absolute;
  left: var(--vw-gutter);
  right: 0;
  top: 0;
  bottom: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.vw-scroll::-webkit-scrollbar {
  display: none;
}

.vw-inner {
  position: relative;
  height: 100%;
}

.vw-columns {
  display: flex;
  height: 100%;
}

.vw-col {
  width: 50px;
  flex: none;
  display: flex;
  flex-direction: column;
}

.vw-odd {
  background: var(--col1);
}

.vw-even {
  background: var(--col2);
}

/* WSF-VER-10: the line at day 7/8 and before the weeks. */
.vw-sep {
  box-shadow: inset 1px 0 0 rgba(var(--line-rgb), 0.28);
}

.vw-head {
  height: var(--vw-head);
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.vw-coarse .vw-head,
.vw-coarse .vw-temps,
.vw-coarse .vw-foot {
  opacity: 0.72;
}

.vw-name {
  font-weight: 700;
  font-size: 15px;
}

.vw-date {
  font-size: 11px;
  color: var(--mut);
}

.vw-temps {
  position: relative;
  height: var(--vw-overview);
  flex: none;
}

.vw-label {
  position: absolute;
  left: 0;
  width: 50px;
  text-align: center;
  font-size: 13px;
}

.vw-stripe {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 1px;
  overflow: hidden;
  border-radius: 4px;
}

.vw-cell {
  position: absolute;
  left: 0;
  right: 0;
  cursor: pointer;
}

/* Stacking, bottom up: cells; marked cells (1), above the next cell, which
   would cover the bottom marker with its 1 px overlap (verwachtingView.js);
   today's dimmed past (2); the selected cell (3), undimmed; the now line (4). */
.vw-cell.vw-marked {
  box-shadow: inset 0 1px 0 rgba(var(--line-rgb), 0.55), inset 0 -1px 0 rgba(var(--line-rgb), 0.55);
  z-index: 1;
}

.vw-cell.vw-selected {
  box-shadow: inset 0 0 0 2px var(--fg);
  z-index: 3;
}

.vw-past {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  background: var(--past);
  pointer-events: none;
}

.vw-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--now);
  pointer-events: none;
  z-index: 4;
}

.vw-overview {
  position: absolute;
  left: 0;
  pointer-events: none;
}

.vw-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.vw-line.vw-max {
  stroke: var(--t-max);
}

.vw-line.vw-min {
  stroke: var(--t-min);
}

.vw-dot.vw-max,
.vw-band.vw-max {
  fill: var(--t-max);
}

.vw-dot.vw-min,
.vw-band.vw-min {
  fill: var(--t-min);
}

.vw-band {
  opacity: 0.3;
}

.vw-foot {
  height: var(--vw-foot);
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
}

.vw-bar-box {
  height: 34px;
  flex: none;
  display: flex;
  align-items: flex-end;
}

.vw-bar {
  width: 9px;
  border-radius: 2px 2px 0 0;
  background: var(--rain-bar);
}

.vw-axis {
  width: 34px;
  height: 1px;
  flex: none;
  background: var(--axis);
}

.vw-amount {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
}

.vw-unit {
  font-size: 10px;
  color: var(--mut);
}

.vw-arrow {
  width: 14px;
  height: 14px;
  margin-top: 6px;
  fill: var(--fg2);
}

.vw-wind {
  margin-top: 3px;
  font-size: 11px;
  color: var(--mut2);
}

/* A hint that the strip scrolls on. */
.vw-fade {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(var(--bg-rgb), 0), rgba(var(--bg-rgb), 0.85));
}

/* Nothing to scroll on to (a wide window, WSF-NAV-6): no hint either. */
.vw-fits .vw-fade {
  display: none;
}

/* --- Radar (SPEC §2.3; map 374 × 486, plot 350 × 72 in Appendix A) --- */

.radar {
  margin: 0 8px;
  /* The map's shape: the area it shows is fixed (radarMap.js). */
  --rd-map-w: 374;
  --rd-map-h: 486;
}

.rd-map {
  position: relative;
  aspect-ratio: var(--rd-map-w) / var(--rd-map-h);
  max-height: 56vh;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: var(--map-bg);
  color: var(--map-text);
}

.rd-down {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rd-message {
  margin: 0 24px;
  text-align: center;
  color: var(--map-muted);
}

/* The basemap's canvas, the frame and the pin, stacked in that order. */
.rd-layers,
.rd-basemap {
  position: absolute;
  inset: 0;
}

.rd-basemap-canvas {
  width: 100%;
  height: 100%;
}

.rd-frame {
  position: absolute;
  max-width: none;
  opacity: 0.85;
  pointer-events: none;
}

/* The map did not come up, and why (WSF-RAD-17): small, out of the time
   label's corner, readable over radar colours. */
.rd-map-note {
  position: absolute;
  right: 10px;
  top: 10px;
  max-width: 60%;
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  text-align: right;
  color: var(--map-text);
  text-shadow: 0 1px 4px var(--map-shadow);
  pointer-events: none;
}

.rd-map-note[hidden] {
  display: none;
}

.rd-pin {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2.5px solid var(--map-pin);
  pointer-events: none;
}

.rd-when {
  position: absolute;
  left: 14px;
  top: 10px;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  text-shadow: 0 1px 5px var(--map-shadow);
}

.rd-time {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.rd-tag {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--tag-past);
}

.rd-tag[data-kind='now'] {
  color: var(--now);
}

.rd-tag[data-kind='future'] {
  color: var(--tag-future);
}

.rd-legend {
  position: absolute;
  left: 12px;
  bottom: 10px;
  width: 120px;
  pointer-events: none;
}

.rd-legend-bar {
  display: block;
  height: 6px;
  border-radius: 3px;
}

.rd-legend-words {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 9px;
  color: var(--tag-past);
  text-shadow: 0 0 3px var(--map-shadow);
}

.rd-credit {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 8px;
  font-size: 9px;
  text-shadow: 0 0 3px var(--map-shadow);
}

.rd-credit a {
  color: var(--map-muted);
  text-decoration: none;
}

.rd-credit a[hidden] {
  display: none;
}

.rd-card {
  margin-top: 8px;
  padding: 10px 12px 6px;
  border-radius: 14px;
  background: var(--card);
}

.rd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 40px;
}

.rd-read {
  min-width: 0;
}

.rd-read-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.rd-word {
  font-size: 17px;
  font-weight: 700;
}

.rd-value {
  font-size: 13px;
  color: var(--mut2);
}

.rd-summary {
  margin-top: 1px;
  font-size: 11px;
  color: var(--mut);
}

.rd-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.rd-nu {
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--card2);
  color: var(--now);
  font-size: 12px;
  font-weight: 700;
}

.rd-nu[hidden] {
  display: none;
}

.rd-play {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rd-play svg {
  width: 16px;
  height: 16px;
  fill: var(--fg);
}

.rd-chart {
  position: relative;
  height: 72px;
  margin-top: 6px;
}

.rd-grid {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(var(--line-rgb), 0.14);
}

.rd-g0 { top: 0; }
.rd-g1 { top: 24px; }
.rd-g2 { top: 48px; }

.rd-base {
  top: 72px;
  background: rgba(var(--line-rgb), 0.4);
}

.rd-level {
  position: absolute;
  left: 2px;
  font-size: 9px;
  color: var(--mut);
  pointer-events: none;
}

.rd-l0 { top: 2px; }
.rd-l1 { top: 26px; }
.rd-l2 { top: 50px; }

.rd-plot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 72px;
  pointer-events: none;
}

.rd-past {
  fill: var(--rain-bar);
}

.rd-future {
  fill: var(--rain-bar);
  fill-opacity: 0.5;
}

.rd-line {
  fill: none;
  stroke: var(--blue-text);
  stroke-width: 1.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.rd-nowline {
  position: absolute;
  top: 0;
  height: 72px;
  border-left: 1.5px dashed rgba(var(--line-rgb), 0.7);
  pointer-events: none;
}

.rd-selline {
  position: absolute;
  top: -4px;
  height: 80px;
  width: 2px;
  margin-left: -1px;
  background: var(--fg);
  pointer-events: none;
}

.rd-touch {
  position: absolute;
  left: -6px;
  right: -6px;
  top: -8px;
  bottom: -8px;
  cursor: ew-resize;
  touch-action: none;
}

.rd-ticks {
  position: relative;
  height: 22px;
  margin-top: 2px;
}

.rd-tick {
  position: absolute;
  top: 4px;
  width: 44px;
  margin-left: -22px;
  text-align: center;
  font-size: 11px;
  color: var(--mut);
}

.rd-tick-now {
  color: var(--now);
}

.rd-bubble {
  position: absolute;
  top: 2px;
  width: 44px;
  height: 17px;
  margin-left: -22px;
  border-radius: 6px;
  background: var(--bubble);
  color: var(--on-accent);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  pointer-events: none;
}

/* The data credit under a tab's content (WSF-FMT-6): small, muted, a link. */
.credit {
  display: block;
  margin: 10px 0 4px;
  font-size: 10px;
  color: var(--mut);
  text-align: center;
  text-decoration: none;
}

/* The stripe legend (WSF-FMT-7), one line above the credit. */
.legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--mut);
  white-space: nowrap;
}

.lg-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lg-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.lg-bar {
  width: 44px;
  height: 6px;
  border-radius: 3px;
}

.lg-word {
  font-size: 9px;
}

/* --- Instellingen (SPEC §2.5) --- */

/* The title and, in its top corner, the versions (WSF-SET-7). The padding
   that was the h1's is the row's, so the title sits where it always did. */
.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
}

.settings h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

/* Deliberately quiet: a thing to look up when something seems wrong, not to
   read on every visit (CasaFluxFE's settings badge, same reasoning). Same
   size as `.note`, the page's other say-it-once text. */
.settings-versions {
  font-size: 12px;
  line-height: 1.35;
  color: var(--mut);
  text-align: right;
}

/* Two columns, so the figures line up under one another however wide the
   names are: comparing the running release with the served one is the
   point, and a ragged pair is harder to compare than a column. */
.settings-version-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 6px;
  justify-content: end;
}

/* Tabular figures, or a proportional "1" throws the alignment off again. */
.settings-version-value {
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

.settings-version-note {
  margin-top: 2px;
  color: var(--fg);
}

.settings h2 {
  margin: 0;
  padding: 14px 20px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--mut);
}

.card {
  margin: 0 8px;
  padding: 14px;
  border-radius: 16px;
  background: var(--card);
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 22px;
  background: var(--bg);
}

.segmented button {
  flex: 1;
  height: 38px;
  border-radius: 19px;
  font-size: 14px;
  font-weight: 700;
  color: var(--fg2);
}

.segmented button[aria-checked='true'] {
  background: var(--fg);
  color: var(--bg);
}

.note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--mut);
}

.settings h2 + .card ~ h2 {
  padding-top: 22px;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-text {
  min-width: 0;
}

.account-title {
  font-size: 16px;
  font-weight: 700;
}

.account-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--mut);
}

.account-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--line-rgb), 0.07);
}

.account-note {
  margin: 0;
  font-size: 13px;
  color: var(--mut2);
}

/* The sync switch (mockup): 50 × 30, a white knob that slides right when on. */
.switch {
  position: relative;
  width: 50px;
  height: 30px;
  flex: none;
  border-radius: 15px;
  background: var(--card2);
}

.switch[aria-checked='true'] {
  background: var(--switch-on);
}

.switch:disabled {
  opacity: 0.45;
  cursor: default;
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--on-accent);
  transition: left 0.15s;
}

.switch[aria-checked='true'] .switch-knob {
  left: 23px;
}

.pill {
  margin-top: 10px;
  height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  background: var(--card2);
  font-size: 14px;
  font-weight: 700;
}

.pill[hidden] {
  display: none;
}

/* --- tab bar (SPEC §2, WSF-NAV-4: at the bottom, within thumb reach) --- */

/* Not sticky: it is outside the scrolling box, so it cannot move. */
.tabbar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 56px;
  /* Below it: the home indicator's safe area plus 8px, so a thumb on a tab
     does not catch the app-switch line (Nicolas, 2026-10-09). The inset is
     0 in a browser tab, where 8px is the whole margin. */
  margin: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-radius: 28px;
  background: var(--card);
  flex: none;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 24px;
  font-size: 10px;
  color: var(--fg2);
}

.tab[aria-current='page'] {
  background: var(--card2);
  color: var(--fg);
}

/* --- old data (WSF-NET-2): dimmed, never hidden, and dated under the header --- */

.stale-banner {
  flex: none;
  margin: 0 8px 6px;
  padding: 6px 14px;
  border-radius: 14px;
  background: var(--card2);
  color: var(--fg2);
  font-size: 12px;
  text-align: center;
}

.stale-banner[hidden] {
  display: none;
}

/* --- no connection (WSF-NET-15), as CasaFluxFE's indicator --- */

/* Hung from the header and floating just under it, over the content, so
   nothing moves when it comes and goes — it shows briefly at every launch.
   `pointer-events: none`: it is not a control and must not take a tap meant
   for what is under it. */
.header {
  position: relative;
}

.conn-note {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 16px);
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--card2);
  color: var(--fg2);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  box-shadow: var(--panel-shadow);
}

.conn-note[hidden] {
  display: none;
}

.conn-spinner {
  flex: none;
  width: 10px;
  height: 10px;
  border: 2px solid var(--axis);
  border-top-color: var(--fg2);
  border-radius: 50%;
  animation: conn-spin 1s linear infinite;
}

@keyframes conn-spin {
  to { transform: rotate(360deg); }
}

/* Less motion still has to show the app is alive, so it pulses instead. */
@media (prefers-reduced-motion: reduce) {
  .conn-spinner { animation: conn-pulse 2s ease-in-out infinite; }
}

@keyframes conn-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.content.stale .panel {
  opacity: 0.55;
}

/* --- a new version of the app (WSF-UPD-1 to WSF-UPD-5) --- */

.vd {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--backdrop);
}

.vd[hidden] {
  display: none;
}

.vd-panel {
  max-width: 320px;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--card);
  color: var(--fg);
  box-shadow: var(--panel-shadow);
}

.vd-message {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

/* What is about to happen, quieter than the question above it. */
.vd-countdown {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--fg2);
  font-variant-numeric: tabular-nums;
}

.vd-countdown[hidden] {
  display: none;
}

.vd-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.vd-actions:empty {
  display: none;
}

.vd-actions .pill {
  margin-top: 14px;
}

.vd-primary {
  background: var(--rain-bar);
  color: var(--on-accent);
}

/* --- on a computer (SPEC §2, WSF-NAV-5 to WSF-NAV-7) --- */

/* A mouse or trackpad, not a finger: a wheel cannot scroll Verwachting
   sideways, and the room is there. The app box takes the window; everything
   but Verwachting and Radar keeps a phone's width, centred, so `.content` —
   the one scroll box — scrolls under the wheel anywhere in the window. A
   touch screen of any size keeps the phone layout above. */
@media (hover: hover) and (pointer: fine) {
  #app {
    --phone-margin: max(8px, (100% - var(--phone)) / 2 + 8px);
    max-width: none;
  }

  .header,
  .stale-banner,
  .tabbar {
    margin-left: var(--phone-margin);
    margin-right: var(--phone-margin);
  }

  .cl-panel {
    left: var(--phone-margin);
    right: var(--phone-margin);
  }

  .panel {
    max-width: var(--phone);
    margin: 0 auto;
  }

  /* As wide as the gutter and the columns need (--vw-columns comes from
     verwachtingView.js), or the window if that is less. */
  .panel[data-tab='verwachting'] {
    max-width: none;
  }

  .verwachting {
    max-width: calc(var(--vw-gutter) + var(--vw-columns, 0px));
    margin: 0 auto;
  }
}

/* The map as tall as the content area, the card beside it — once the window
   has room for both at a sensible size; narrower, the phone's stack. The
   map keeps its shape (the area it shows is fixed, radarMap.js), so its
   width follows from the height, and the window's width caps it. */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .panel[data-tab='radar'] {
    max-width: none;
    height: 100%;
    container-type: size;
  }

  .radar {
    --rd-card-width: calc(var(--phone) - 16px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
  }

  .rd-map {
    flex: none;
    width: min(100cqh * var(--rd-map-w) / var(--rd-map-h), 100cqw - 16px - 8px - var(--rd-card-width));
    max-height: none;
  }

  .rd-card {
    flex: none;
    width: var(--rd-card-width);
    margin-top: 0;
  }
}
