/* ==========================================================================
   SUNNYFISH · SET 02 "RUGGED GEAR" — WEATHER MAP SURFACE
   Full-bleed MapLibre canvas + floating chrome. Everything here is scoped to
   the weather page (body.wx-page / .wx-main); core.css and pages.css are not
   touched. Geometry follows the set: 0 radius, 1px hairlines, no drop shadows,
   paper surfaces, mono labels.
   ========================================================================== */

.wx-page {
  /* The shared sticky nav sits in normal flow above the fixed map, so the map
     chrome starts one nav height down instead of under a floating bar. */
  --wx-nav-top: 0px;
  --wx-nav-h: 72px;
  --wx-top: calc(var(--wx-nav-top) + var(--wx-nav-h) + 18px);
  --wx-gutter: 20px;
  --wx-panel-w: 560px;
  --wx-bottom: 20px;

  height: 100%;
  overflow: hidden;
  background: #070C0B;
  color: var(--ink);
  font-family: var(--f-body);
  -webkit-font-smoothing: antialiased;
}

.wx-page ::selection { background: var(--green); color: var(--ink); }

.wx-main {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.wx-main #map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #070C0B;
}

/* MapLibre's own UI is not part of this system ------------------------------ */
.wx-page .maplibregl-ctrl-bottom-right { display: none; }
/* Basemap attribution stays visible; credits are required site-wide. */
.wx-page .maplibregl-ctrl-bottom-left {
  left: var(--wx-gutter);
  bottom: calc(var(--wx-bottom) + 58px);
  z-index: 45;
}
.wx-page .maplibregl-ctrl-attrib {
  background: var(--paper);
  border: 1px solid var(--line-nav);
  border-radius: 0;
  color: var(--ink);
  font: 500 10px/1.4 var(--font-mono, ui-monospace, monospace);
}
.wx-page .maplibregl-ctrl-attrib a { color: var(--ink); }

/* Basemap status chip — only appears when the Tianditu key or tiles fail. */
.basemap-note {
  position: absolute;
  left: 50%;
  bottom: var(--wx-bottom);
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(420px, calc(100vw - 40px));
  margin: 0;
  padding: 8px 12px;
  background: var(--paper-2);
  border: 1px solid var(--line-nav);
  color: var(--ink-2);
  font-family: var(--f-mono);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: .04em;
}
.basemap-note[hidden] { display: none; }

/* --------------------------------------------------------------------------
   2. SHARED SURFACE — paper, 1px rule, square, no shadow
   -------------------------------------------------------------------------- */
#left-panels .left-panel,
#search-overlay .search-input-wrapper-large,
.wx-page .search-results-container,
#weather-panel,
#settings-panel,
.wx-page .modal-panel,
#loading-chip,
.wx-page #map-controls,
.wx-page #model-tab #model-selector .segment-control {
  background: var(--paper-2);
  border: 1px solid var(--line-nav);
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--ink);
}

/* Shared small-caps label treatment */
.wx-page .panel-title,
.wx-page .section-title,
.wx-page .wp-eyebrow,
.wx-page .wp-section-head h3,
.wx-page .legend-labels span,
.wx-page .wp-model-tag {
  font-family: var(--f-mono);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   3. PLACE SEARCH (top-left, under the nav)
   -------------------------------------------------------------------------- */
.wx-page .map-search {
  position: absolute;
  top: var(--wx-top);
  left: var(--wx-gutter);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 14px;
  background: var(--paper-2);
  border: 1px solid var(--line-nav);
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.wx-page .map-search:hover { background: var(--line-soft); }
.wx-page .map-search:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.wx-page .map-search svg { width: 16px; height: 16px; flex: none; }

#search-overlay {
  top: var(--wx-top);
  left: var(--wx-gutter);
  right: auto;
  width: 420px;
  max-width: calc(100vw - 40px);
  max-height: calc(100dvh - var(--wx-top) - 16px);
  flex-direction: column;
  z-index: 120;
}
#search-overlay .search-results-container { flex: 1 1 auto; min-height: 0; }

#search-overlay .search-input-wrapper-large {
  height: 46px;
  padding: 0 14px;
  gap: 10px;
}
#search-overlay .search-input-wrapper-large i { color: var(--muted); }
#search-overlay .search-input-wrapper-large input {
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
}
#search-overlay .search-input-wrapper-large input::placeholder { color: var(--faint); }
#search-overlay .close-search { color: var(--ink-2); cursor: pointer; }

.wx-page .search-results-container {
  margin-top: 8px;
  max-height: none;
  overflow-y: auto;
  border-top: 1px solid var(--line-nav);
}
.wx-page .search-section { padding: 0; }
.wx-page .section-header {
  padding: 12px 14px 8px;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.wx-page .section-header .edit-link { color: var(--orange-2); font-family: var(--f-mono); font-size: 9px; }
.wx-page .search-item {
  padding: 11px 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink);
}
.wx-page .search-item:hover { background: var(--paper); }
.wx-page .search-item .item-icon { color: var(--muted); }
.wx-page .search-item .item-title { font-size: 14px; color: var(--ink); }
.wx-page .search-item .item-sub { color: var(--muted); font-family: var(--f-mono); font-size: 10px; }

/* --------------------------------------------------------------------------
   4. LAYER PANEL (left)
   -------------------------------------------------------------------------- */
/* The rail is anchored to the very edge of the map, not floated in the gutter:
   it reads as a strip attached to the left border, not a panel over the canvas. */
#left-panels {
  position: absolute;
  /* Sits 8px under the floating nav instead of a full nav-height + gutter below
     it: the rail reads as attached to the bar's lower edge. */
  top: calc(var(--wx-nav-top) + var(--wx-nav-h) + 8px);
  left: 0;
  width: 236px;
  z-index: 25;
  /* The rail is a 236px box but only its tiles are interactive. Without this,
     the empty right half of the box swallowed map clicks. */
  pointer-events: none;
}

#left-panels .left-panel {
  position: relative;
  right: auto;
  width: 100%;
  max-height: calc(100dvh - var(--wx-nav-top) - var(--wx-nav-h) - 8px - 104px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* No backing field at all — not faded, not narrowed, gone. The column sits
   straight on the map; legibility comes from the filled circle itself, so
   nothing here reads as a pasted card.
   Two ids so this beats the shared `#left-panels .left-panel` surface rule. */
#left-panels #layers-panel {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;
}
#layers-panel .left-panel-content {
  padding: 0;
  gap: 0;
  overflow-y: auto;
  scrollbar-width: none;
  pointer-events: none;
}
#layers-panel .left-panel-content::-webkit-scrollbar { width: 0; height: 0; }

/* Only the tiles and the expanded switch row take the pointer; the empty right
   half of the rail lets map drags and wheels through to the canvas. */
#layers-panel .layer-list { pointer-events: none; }
#layers-panel .layer-list > .menu-item { pointer-events: auto; }

/* One column, top to bottom, hugging the left edge. Each item is a compact
   vertical unit: a 44px circle holding the glyph, the short name centred
   underneath. The item itself has no frame and no full-width hit area — the
   9px gap is the only thing separating one entry from the next, which keeps
   all nine rows inside the 1440 rail without scrolling. */
#layers-panel .layer-list {
  --lp-gap: 9px;
  --lp-box: 44px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--lp-gap);
  width: 100%;
  padding: 10px 8px 8px;
  box-sizing: border-box;
}

#layers-panel .layer-list > .menu-item {
  min-width: 0;
  width: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

#layers-panel .menu-item > label,
#layers-panel .particles-trigger {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  width: auto;
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  cursor: pointer;
  transition: color .12s ease;
}

/* A filled disc, not a hairline frame. Solid ink is the one neutral that
   separates from both ends of this basemap — the near-white land (≈#FCFCFC)
   and the pale blue sea (≈#AAC6EE) — so the glyph keeps its edge over either.
   The glyph flips to paper because the fill is dark; the selected disc flips
   the relationship (theme green, ink glyph) so the two states read apart at a
   glance. */
#layers-panel .menu-item > label i,
#layers-panel .particles-trigger > i:not(.particles-caret) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--lp-box);
  max-width: 100%;
  height: var(--lp-box);
  flex: none;
  line-height: 1;
  text-align: center;
  color: var(--paper-2);
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  /* A paper ring drawn outside the disc: on a dark stretch of basemap the ink
     circle would otherwise melt into the imagery, while on pale land the ring
     simply disappears. It sits outside the 44px box so the glyph never shrinks,
     and it is a ring rather than a border so the checked/open states keep their
     own fills without repainting the edge. */
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .92);
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

/* One drawn set: 24px grid, 1.5 stroke, round caps — same optical weight for
   every glyph, so wind, current, rain and cloud read as one family. */
#layers-panel .lp-icon { display: flex; align-items: center; justify-content: center; }
#layers-panel .lp-icon svg {
  display: block;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* The name is centred on the disc so it reads as a label under an icon, not
   as a caption hanging off a tile corner. It keeps the disc's 44px box and a
   fixed 12px strip, so every row stays the same height; the column's left edge
   is still the disc edge at x=8.
   Weight and size carry the contrast: at 400/9px the ink colour wins 11.4:1 on
   paper, but the stems render at half coverage, so the average lit pixel only
   measures ≈3.3:1 on the pale blue sea. 600/10px keeps ink and lifts that
   rendered average to ≈5.3:1 without adding a plate or a halo. */
#layers-panel .menu-item > label span,
#layers-panel .particles-trigger > span {
  align-self: flex-start;
  width: var(--lp-box);
  height: 12px;
  padding: 0;
  margin-top: 4px;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 12px;
  letter-spacing: .02em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  white-space: nowrap;
  overflow: visible;
  /* A 1px paper halo, drawn as four axis-aligned shadows plus the corners so it
     stays crisp instead of blurring the stems. Dark ink on near-white land
     already reads; the halo is what keeps the same 10px label legible once the
     basemap goes dark, without thickening the glyphs. */
  text-shadow:
    1px 0 0 var(--white), -1px 0 0 var(--white),
    0 1px 0 var(--white), 0 -1px 0 var(--white),
    1px 1px 0 var(--white), -1px 1px 0 var(--white),
    1px -1px 0 var(--white), -1px -1px 0 var(--white);
}

#layers-panel .layer-list > .menu-item > label:hover { color: var(--ink-2); }
#layers-panel .layer-list > .menu-item > label:hover i,
#layers-panel .particles-trigger:hover > i:not(.particles-caret) {
  background: #1B1E17;
  color: var(--paper-2);
}
#layers-panel .particles-trigger:hover { color: var(--ink-2); }

/* Selected: the disc takes the theme green and the glyph drops to ink, so the
   one active layer is the only light-filled circle in the column. */
#layers-panel .layer-toggle:checked + label {
  background: none !important;
  border: 0;
  color: var(--ink);
  box-shadow: none;
}
/* The longer selector outranks the :hover rule above (1 id, 4 classes vs
   1 id, 3 classes), so a freshly clicked radio turns green while the pointer
   is still over it instead of staying the hover's dark fill until the mouse
   moves off. */
#layers-panel .layer-list > .menu-item > .layer-toggle:checked + label i {
  background: var(--green);
  border-color: var(--green);
  color: var(--ink);
}
#layers-panel .layer-toggle:checked + label span { color: var(--ink); }
#layers-panel .layer-toggle:focus-visible + label { outline: 0; }
#layers-panel .layer-toggle:focus-visible + label i {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* Particle trigger: the last item in the column. Its caret moved out of the
   disc — inside a filled circle it collided with the glyph and lost contrast —
   and now sits just to the right, vertically centred on the disc.
   The mark is a single arrow with a tail (one continuous 1.5px stroke), not a
   hairline chevron plus a separate leader: at 1:1 the two-piece version read as
   leftover marks. It keeps pointing right — the side the four switches open on
   — so when the strip is open the arrow visually leads into it; open/closed is
   carried by the strip itself and `aria-expanded`. */
#layers-panel .menu-item--particles.is-open .particles-trigger { color: var(--ink); }
#layers-panel .menu-item--particles.is-open .particles-trigger > i:not(.particles-caret) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-2);
}
#layers-panel .particles-caret {
  position: absolute;
  top: calc((var(--lp-box) - 16px) / 2);
  left: calc(var(--lp-box) + 4px);
  right: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 0;
  font-size: 8px;
  line-height: 1;
  color: var(--ink);
  transition: color .22s ease;
}
#layers-panel .menu-item--particles.is-open .particles-caret { color: var(--ink); }

/* Chosen particle animation: the trigger carries the active channel's own
   glyph and takes the selected green, matching a checked layer above it. */
#layers-panel .menu-item--particles.is-selected .particles-trigger { color: var(--ink); }
#layers-panel .menu-item--particles.is-selected .particles-trigger > i:not(.particles-caret) {
  background: var(--green);
  border-color: var(--green);
  color: var(--ink);
}
#layers-panel .menu-item--particles.is-selected .particles-caret { color: var(--ink); }

/* Particle flyout — one horizontal strip, not four rows under the column.
   The four switches leave the flow entirely and float to the right of the
   trigger on its centre line, so:
     • the column above never moves and its height is always the eight layers
       plus this one trigger (closing leaves no reserved space, because a
       `fixed` box contributes nothing to layout);
     • the panel's `overflow:hidden` and the content's scroll box cannot clip
       it — `fixed` is out of both — while `.left-panel-content` keeps its
       own vertical scrolling.
   JS measures the trigger's disc and caret and writes --pp-left / --pp-top;
   the row is top-aligned with the trigger's disc, so the four small discs
   share the trigger disc's top edge and only their names hang below it. */
#layers-panel .particles-row {
  --pp-disc: 40px;
  --pp-col: 46px;
  position: fixed;
  left: var(--pp-left, 0);
  top: var(--pp-top, 0);
  z-index: 40;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: auto;
  height: auto;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translate(-6px, 0);
  transition: opacity .16s ease, transform .2s ease, visibility 0s linear .2s;
  pointer-events: none;
}
#layers-panel #particles-item.is-open #particles-row {
  opacity: 1;
  visibility: visible;
  transform: translate(0, 0);
  pointer-events: auto;
  transition: opacity .16s ease, transform .2s ease, visibility 0s;
}

/* No separate leader: the trigger's arrow is the connector. A hairline stub
   next to it only added a second mark at 1:1. */

/* Same visual as a layer switch — filled disc, glyph, name underneath — but
   recomputed for a horizontal run: a 40px disc on a 46px column with 4px
   gaps, instead of the column's 44px/4px vertical stack. The column is set by
   the longest name (`CURRENT`, 7 glyphs of the 10px mono at .02em tracking),
   so every name sits inside its own cell instead of running into the next
   disc; the name clears the smaller disc by more than the column's 2px so its
   baseline still lines up with the trigger's own name. */
#layers-panel .particles-track {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
#layers-panel .particle-item { flex: none; width: var(--pp-col); overflow: visible; }
#layers-panel .particle-item label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: var(--pp-col);
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
}
#layers-panel .particle-item label > i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--pp-disc);
  height: var(--pp-disc);
  flex: none;
  line-height: 1;
  text-align: center;
  color: var(--paper-2);
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  /* Same paper ring as the layer discs, so the four flyout switches keep the
     same edge over both dark and pale basemap stretches. */
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .92);
  transition: background .12s ease, color .12s ease;
}
#layers-panel .particle-item .lp-icon svg { width: 21px; height: 21px; }
#layers-panel .particle-item label > span {
  width: var(--pp-col);
  height: 12px;
  margin-top: calc(2px + (var(--lp-box) - var(--pp-disc)) / 2);
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 12px;
  letter-spacing: .02em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  white-space: nowrap;
  overflow: visible;
  /* Same 1px paper halo as the layer names. */
  text-shadow:
    1px 0 0 var(--white), -1px 0 0 var(--white),
    0 1px 0 var(--white), 0 -1px 0 var(--white),
    1px 1px 0 var(--white), -1px 1px 0 var(--white),
    1px -1px 0 var(--white), -1px -1px 0 var(--white);
}
#layers-panel .particle-item label:hover > i { background: #1B1E17; color: var(--paper-2); }
#layers-panel .particle-item .layer-toggle:checked + label > i {
  background: var(--green);
  color: var(--ink);
}
#layers-panel .particle-item .layer-toggle:focus-visible + label {
  outline: 0;
}
#layers-panel .particle-item .layer-toggle:focus-visible + label > i {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* switch: square track + square knob */
.wx-page .switch {
  width: 34px;
  height: 18px;
  flex: none;
}
.wx-page .switch .slider {
  position: absolute;
  inset: 0;
  background: var(--white);
  border: 1px solid var(--line-nav);
  border-radius: 0;
  transition: background .14s ease, border-color .14s ease;
}
.wx-page .switch .slider:before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 2px;
  top: 2px;
  background: var(--muted);
  border-radius: 0;
  box-shadow: none;
  transition: transform .14s ease, background .14s ease;
}
.wx-page .switch input:checked + .slider {
  background: var(--green);
  border-color: var(--green);
}
.wx-page .switch input:checked + .slider:before {
  background: var(--ink);
  transform: translateX(16px);
}

/* collapsed layer panel — no header exists, so the list stays put */
#layers-panel.collapsed {
  max-height: none;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   5. LEGENDS (bottom left) — colour bar with the ticks set inside it
   Geometry follows the reference colour bar: one 32px ramp, 1px light rule,
   evenly spaced ticks painted on the gradient, and the unit riding on the last
   tick. Square corners are the only departure from the reference.
   -------------------------------------------------------------------------- */
#legends {
  left: var(--wx-gutter);
  bottom: var(--wx-bottom);
  gap: 6px;
  z-index: 20;
  width: 330px;
  max-width: calc(100vw - 40px);
}

#legends .legend {
  display: block;
  width: 100%;
  padding: 8px;
  background: var(--paper-2);
  border: 1px solid var(--line-nav);
  box-shadow: none;
}

#legends .legend-bar {
  position: relative;
  width: 100%;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 0;
  box-shadow: none;
  background: var(--white);
  overflow: hidden;
}

/* The ramp fills the bar exactly; the engine's inline width would outgrow it. */
#legends .gradient {
  width: 100% !important;
  height: 100%;
  background-repeat: no-repeat;
  background-size: 100% 100% !important;
}

/* Ticks sit on the ramp, spread edge to edge. Each label is a text-width box,
   so the first tick hangs off the left padding and the last one ends the row;
   no zero-width anchors, which used to let "60" drift into the wrong band. */
#legends .legend-labels {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
}

#legends .legend-labels span {
  color: var(--white);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .02em;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  white-space: nowrap;
  overflow: visible;
}


/* --------------------------------------------------------------------------
   6. BOTTOM RIGHT — model selector + map controls
   -------------------------------------------------------------------------- */
.wx-page .bottom-right-container {
  bottom: var(--wx-bottom);
  right: var(--wx-gutter);
  gap: 8px;
  z-index: 30;
  transition: right .18s ease;
}
/* The point panel is drawn above the map chrome: leave the controls where they
   are so the open panel covers them rather than shifting them aside. */
.wx-page.weather-panel-open .bottom-right-container {
  right: var(--wx-gutter);
  transform: none;
}

.wx-page #model-tab #model-selector .segment-control {
  height: 38px;
  padding: 3px;
  gap: 2px;
  min-width: 0;
}
.wx-page #model-tab #model-selector .segment-option {
  height: 30px;
  padding: 0 11px;
  border-radius: 0;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.wx-page #model-tab #model-selector .segment-option:hover:not(.active) {
  background: var(--line-soft);
  color: var(--ink);
}
.wx-page #model-tab #model-selector .segment-option.active {
  background: var(--ink);
  color: var(--white);
  box-shadow: none;
}

.wx-page #map-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 3px;
}
.wx-page .control-btn {
  width: 36px;
  height: 36px;
  border-radius: 0;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  color: var(--ink-2);
}
.wx-page .control-btn svg { width: 18px; height: 18px; }
.wx-page .control-btn:hover {
  background: var(--line-soft);
  border-color: var(--green);
  color: var(--ink);
}
.wx-page .control-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.wx-page #btn-settings.active { background: var(--ink); color: var(--white); }
.wx-page .control-divider {
  width: 100%;
  height: 1px;
  margin: 2px 0;
  background: var(--line);
}

/* --------------------------------------------------------------------------
   7. POINT FORECAST PANEL (right)
   -------------------------------------------------------------------------- */
.wx-page .weather-panel {
  position: absolute;
  top: var(--wx-top);
  right: var(--wx-gutter);
  bottom: var(--wx-bottom);
  left: auto;
  width: var(--wx-panel-w);
  height: auto;
  max-height: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
  border: 1px solid var(--line-nav);
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 40;
}
.wx-page .weather-panel.is-open { opacity: 1; visibility: visible; transform: none; }

.wx-page .wp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 12px 12px 16px;
  border-bottom: 1px solid var(--line-nav);
  background: var(--paper);
}
.wx-page .wp-heading { min-width: 0; }
.wx-page .wp-eyebrow {
  margin: 0 0 4px;
  color: var(--ink-2);
  font-size: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wx-page .wp-eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--green);
  flex: none;
}

.wx-page .wp-place {
  margin: 0;
  max-width: 340px;
  color: var(--ink);
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.wx-page .wp-coords {
  margin: 5px 0 0;
  gap: 6px;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .04em;
}
.wx-page .wp-dot { color: var(--faint); }

.wx-page .wp-head-actions { gap: 4px; }
.wx-page .wp-icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 0;
  background: var(--white);
  color: var(--ink-2);
  font-size: 11px;
}
.wx-page .wp-icon-btn:hover {
  background: var(--line-soft);
  border-color: var(--green);
  color: var(--ink);
}
.wx-page .wp-icon-btn.active { color: var(--orange-2); border-color: var(--orange-2); }

.wx-page .wp-body {
  flex: 1;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.wx-page .wp-body::-webkit-scrollbar { width: 5px; }
.wx-page .wp-body::-webkit-scrollbar-thumb { background: var(--line); }

.wx-page .wp-loading { color: var(--muted); font-family: var(--f-mono); font-size: 10px; }
.wx-page .wp-spinner {
  border: 1px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
}
.wx-page .wp-error { color: var(--muted); font-size: 12px; }
.wx-page .wp-retry {
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--white);
  font-size: 11px;
  font-family: var(--f-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* hero — temperature is the anchor, condition beside it, details below */
.wx-page .wp-hero { padding-bottom: 0; }
.wx-page .wp-hero-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.wx-page .wp-wx-icon, .wx-page .wp-wx-icon img { width: 56px; height: 56px; flex: none; }
.wx-page .wp-temp {
  margin: 0;
  gap: 3px;
  color: var(--ink);
  font-family: var(--f-disp);
  font-weight: 900;
  font-size: 48px;
  line-height: .92;
  letter-spacing: -.03em;
}
.wx-page .wp-temp small {
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}
.wx-page .wp-hero-text { min-width: 0; flex: 1; padding-top: 3px; }
.wx-page .wp-cond {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}
.wx-page .wp-hero-meta {
  margin: 5px 0 0;
  color: var(--ink-2);
  font-family: var(--f-mono);
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: .02em;
}
/* Sun times and valid time share one context rule under the hero. */
.wx-page .wp-context {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.wx-page .wp-sun {
  margin: 0;
  padding: 0;
  border-top: 0;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 9px;
  line-height: 1.45;
  letter-spacing: .02em;
}
.wx-page .wp-hero-meta.is-missing { color: var(--faint); }
.wx-page .wp-stamp {
  max-width: none;
  margin: 1px 0 0;
  padding-left: 8px;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 9px;
  line-height: 1.45;
  letter-spacing: .04em;
  text-align: right;
  white-space: nowrap;
  flex: none;
}

/* metric strip — one hairline row, no tiles */
.wx-page .wp-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.wx-page .wp-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px 9px;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line-soft);
  border-radius: 0;
}
.wx-page .wp-metric:first-child { border-left: 0; padding-left: 0; }
.wx-page .wp-metric-label {
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.wx-page .wp-metric-value {
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
}
.wx-page .wp-metric-value small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 400;
}
.wx-page .wp-metric-sub {
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 8.5px;
  line-height: 1.3;
  letter-spacing: .02em;
}
.wx-page .wp-metric.is-missing .wp-metric-value,
.wx-page .wp-metric.is-missing .wp-metric-sub { color: var(--faint); opacity: 1; }
.wx-page .wp-metric.is-missing { background: transparent; }
.wx-page .wp-arrow { color: var(--ink-2); font-size: 10px; }

.wx-page .wp-missing-note {
  margin: 8px 0 0;
  padding-left: 8px;
  border-left: 2px solid var(--line-nav);
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 8.5px;
  line-height: 1.6;
  letter-spacing: .02em;
}
.wx-page .wp-missing-note[hidden] { display: none; }

/* sections */
.wx-page .wp-section { margin-top: 16px; }
/* The daily capsules stay pinned at the top of the scrolling panel: no title,
   no separator rule, opaque background so rows pass underneath. */
.wx-page .wp-section.wp-daily {
  position: sticky;
  top: 0;
  z-index: 6;
  margin-top: -14px;
  padding: 14px 0 8px;
  background: var(--paper-2);
}
/* Tide and sky sections: compact chart cards under the hourly table. */
.wx-page .wp-chart-box {
  border: 1px solid var(--line-soft);
  background: var(--white);
  padding: 10px 10px 8px;
}
.wx-page .wp-tide-chart,
.wx-page .wp-sunmoon-chart { display: block; width: 100%; height: auto; }
.wx-page .wp-chart-note {
  margin: 6px 0 0;
  font-size: 8px;
  line-height: 1.5;
  color: var(--faint);
}
.wx-page .wp-chart-legend {
  display: flex;
  gap: 12px;
  margin-top: 7px;
  font-size: 8px;
  letter-spacing: .04em;
  color: var(--muted);
}
.wx-page .wp-chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.wx-page .wp-chart-legend i { width: 10px; height: 2px; display: inline-block; }
.wx-page .wp-dot-sun { background: #b87900; }
.wx-page .wp-dot-moon { background: #2f6f6a; }
.wx-page .wp-rise-set {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-top: 8px;
}
.wx-page .wp-rise-set__item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 4px;
  font-size: 9px;
  color: var(--muted);
}
.wx-page .wp-rise-set__item b { color: var(--ink); font-weight: 600; }
.wx-page .wp-moonphase {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  background: var(--white);
}
.wx-page .wp-moon-disc { width: 64px; height: 64px; flex: 0 0 auto; }
.wx-page .wp-moonphase__copy { display: grid; gap: 3px; }
.wx-page .wp-moonphase__name { font-size: 12px; font-weight: 600; color: var(--ink); }
.wx-page .wp-moonphase__meta { font-size: 9px; color: var(--muted); }
/* The body now opens straight on the daily block, so the first section must not
   carry the inter-section gap as top padding. */
.wx-page .wp-content > .wp-section:first-child { margin-top: 0; }
.wx-page .wp-section-head {
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.wx-page .wp-section-head h3 {
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 500;
}
.wx-page .wp-model-tag {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: .06em;
}

/* marine block — flagged with a green top rule, not a tinted card */
.wx-page .wp-marine {
  margin-top: 16px;
  padding: 11px;
  background: var(--paper);
  border: 1px solid var(--line-nav);
  border-top: 3px solid var(--green);
  border-radius: 0;
}
.wx-page .wp-marine .wp-metric { background: var(--white); border-color: var(--line-soft); }
.wx-page .wp-marine .wp-metric-label { color: var(--muted); }

/* hourly table — grouped date bands + 3-hour columns + sticky row labels */
.wx-page .wp-table-wrap {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line-soft);
  background: var(--white);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  -webkit-overflow-scrolling: touch;
}
.wx-page .wp-table-wrap::-webkit-scrollbar { height: 5px; }
.wx-page .wp-table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 0; }

/* Mini area charts sit over the rows exactly like the old panel (above the
   cells, below the sticky labels) and scroll with the table content. */
.wx-page .wp-chart-layer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: none;
  pointer-events: none;
}

.wx-page .wp-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 10px;
}

.wx-page .wp-table th,
.wx-page .wp-table td {
  width: 46px;
  min-width: 46px;
  height: 26px;
  padding: 0 4px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-soft);
}

.wx-page .wp-table thead th { background: var(--paper); }
.wx-page .wp-table tr:last-child th,
.wx-page .wp-table tr:last-child td { border-bottom: 0; }

.wx-page .wp-table-date {
  height: 22px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-left: 1px solid var(--line-nav);
}
.wx-page .wp-table-time {
  height: 22px;
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 400;
  cursor: pointer;
}
.wx-page .wp-table-time.is-day-start { border-left: 1px solid var(--line-nav); }

.wx-page .wp-table tbody th,
.wx-page .wp-table tbody td { height: 30px; }
.wx-page .wp-table tbody td.has-level { height: 40px; }
/* wave / swell carry a stacked arrow under the value, so they need one more line */
.wx-page .wp-table tbody tr[data-row="wave"] td,
.wx-page .wp-table tbody tr[data-row="swell"] td { height: 50px; }

.wx-page .wp-table-label {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 104px;
  min-width: 104px;
  padding: 0 9px;
  background: var(--paper-2);
  border-right: 1px solid var(--line-nav);
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: .02em;
  text-align: left;
  white-space: nowrap;
}
.wx-page .wp-table-label--head { z-index: 4; background: var(--paper); }

.wx-page .wp-table-cell {
  color: var(--ink-2);
  cursor: pointer;
  background-clip: padding-box;
}
.wx-page .wp-table-temp b { color: var(--ink); font-size: 11px; font-weight: 600; }
.wx-page .wp-table-icon { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
.wx-page .wp-table-sst { color: #9a6b00; }
.wx-page .wp-table-tide { color: #0b6f8f; }
.wx-page .wp-table-cell .wp-arrow { margin-left: 1px; font-size: 8px; }
/* wave / swell stack the arrow under the value, as in the old table */
.wx-page .wp-table-cell .wp-arrow--below {
  display: block;
  margin: 1px auto 0;
  font-size: 9px;
  line-height: 1;
}
.wx-page .wp-table td.is-wet { color: #0b6f8f; font-weight: 600; }
.wx-page .wp-table-val { display: inline-block; line-height: 1.15; white-space: nowrap; }
.wx-page .wp-table-level {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.1;
  letter-spacing: .01em;
  white-space: normal;
}

/* Column emphasis is hover-only, matching the old table. A capsule click adds
   a short-lived flash so the jump target is still visible, then clears.
   Hover paints the column with a flat wash only: the earlier 1px ring around
   every cell drew a horizontal rule above and below each row, which lit up the
   whole grid on hover. The green caps stay, because they mark where the hovered
   column starts and stops. */
.wx-page .wp-table td.col-hover,
.wx-page .wp-table th.wp-table-time.col-hover { background-image: linear-gradient(rgba(16, 24, 20, .06), rgba(16, 24, 20, .06)); }
.wx-page .wp-table .col-hover-top { box-shadow: inset 0 1px 0 var(--green); }
.wx-page .wp-table .col-hover-bottom { box-shadow: inset 0 -1px 0 var(--green); }
.wx-page .wp-table th.col-hover { color: var(--ink); }

@keyframes wp-col-flash {
  0%   { box-shadow: inset 0 0 0 2px var(--green); }
  20%  { box-shadow: inset 0 0 0 2px var(--green); }
  40%  { box-shadow: inset 0 0 0 2px transparent; }
  60%  { box-shadow: inset 0 0 0 2px var(--green); }
  80%  { box-shadow: inset 0 0 0 2px var(--green); }
  100% { box-shadow: inset 0 0 0 2px transparent; }
}
.wx-page .wp-table .col-flash { animation: wp-col-flash 1.4s ease-out both; }

/* daily capsules — replaces the old 7-day rows */
.wx-page .wp-daily-rail {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 3px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.wx-page .wp-daily-rail::-webkit-scrollbar { height: 0; }
.wx-page .wp-capsule {
  flex: 0 0 64px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 8px 9px;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 0;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.wx-page .wp-capsule:hover { background: var(--paper); border-color: var(--green); }
.wx-page .wp-capsule:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.wx-page .wp-capsule.is-selected { background: var(--ink); border-color: var(--ink); }
.wx-page .wp-capsule-day {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.wx-page .wp-capsule-day b { font-size: 10px; font-weight: 500; color: var(--ink-2); }
.wx-page .wp-capsule.is-selected .wp-capsule-day,
.wx-page .wp-capsule.is-selected .wp-capsule-day b { color: rgba(255, 255, 255, .72); }
/* The shipped icons are drawn for dark surfaces: their cloud body is a near-white
   gradient (#F3F7FE → #DEEAFB) with a #E6EFFC stroke, which is 1.1:1 on the white
   card and reads as a smear. There is no dark variant in the sprite set, and the
   SVGs are shared with the map, so the correction is a render-time filter instead
   of new assets: brightness pulls the cloud down to a slate that clears 3:1 on
   white, saturation keeps the blue drops from going grey. On the selected card the
   surface flips to ink, where the untouched light cloud is the legible one, so the
   filter is dropped there. */
.wx-page .wp-capsule-icon { width: 24px; height: 24px; object-fit: contain; filter: brightness(.55) saturate(1.35); }
.wx-page .wp-capsule.is-selected .wp-capsule-icon { filter: none; }

.wx-page .wp-source {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-family: var(--f-mono);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: .02em;
}

/* --------------------------------------------------------------------------
   8. SETTINGS / MODALS
   -------------------------------------------------------------------------- */
#settings-panel,
.wx-page .modal-panel {
  position: fixed;
  top: var(--wx-top);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - var(--wx-top) - 28px);
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  z-index: 200;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
#settings-panel { padding: 14px 16px 16px; }
.wx-page .modal-panel { padding: 0 0 4px; }

#settings-panel.active { display: flex; flex-direction: column; }
.wx-page .modal-panel.active { display: block; }

.wx-page .search-header {
  margin-bottom: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-nav);
}
#settings-panel .search-header { margin: 0 -16px 16px; }
.wx-page .search-header h2 {
  gap: 8px;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.wx-page .search-header h2 i { color: var(--green); font-size: 12px; }
.wx-page .search-header .close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 11px;
  cursor: pointer;
}
.wx-page .search-header .close-btn:hover { background: var(--line-soft); }

.wx-page .section-title {
  margin: 0 0 8px;
  padding-left: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .14em;
}

.wx-page .settings-section {
  margin-bottom: 18px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 0;
}
.wx-page .setting-group { margin-bottom: 14px; }
.wx-page .setting-label {
  gap: 8px;
  margin-bottom: 8px;
  padding-left: 0;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 500;
}
.wx-page .setting-label i { width: 16px; color: var(--muted); font-size: 12px; }

.wx-page .segment-control {
  padding: 3px;
  gap: 2px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 0;
}
.wx-page .segment-option {
  padding: 6px 0;
  border-radius: 0;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .04em;
}
.wx-page .segment-option:hover:not(.active) { background: var(--line-soft); color: var(--ink); }
.wx-page .segment-option.active {
  background: var(--ink);
  color: var(--white);
  font-weight: 500;
  box-shadow: none;
}

/* modal bodies */
.wx-page .modal-panel .panel-content { padding: 6px 16px 16px; }
.wx-page .modal-panel .panel-content::-webkit-scrollbar { width: 0; }

/* download */
.wx-page .download-content { padding-top: 4px; }
.wx-page .app-logo-wrapper { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.wx-page .app-icon { width: 46px; height: 46px; border: 1px solid var(--line); }
.wx-page .app-title-group h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--f-disp);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}
.wx-page .app-description {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.wx-page .store-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wx-page .store-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line-nav);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
}
.wx-page .store-btn .brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--ink) !important;
  color: var(--white);
  font-size: 12px;
}
.wx-page .store-btn .btn-text { display: flex; flex-direction: column; line-height: 1.2; }
.wx-page .store-btn .btn-text span { color: var(--muted); font-size: 8px; letter-spacing: .04em; }
.wx-page .store-btn .btn-text strong { font-size: 11px; font-weight: 500; }

/* about */
.wx-page .about-content { padding: 4px 16px 16px; }
.wx-page .about-head { text-align: center; margin-bottom: 18px; }
.wx-page .about-mark {
  width: 56px; height: 56px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
}
.wx-page .about-mark img { width: 38px; height: 38px; object-fit: contain; }
.wx-page .about-head h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--f-disp);
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
}
.wx-page .about-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .06em;
}
.wx-page .feature-list { display: grid; gap: 0; }
.wx-page .feature-item {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}
.wx-page .feature-icon {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: var(--ink);
  font-size: 12px;
  flex: none;
}
.wx-page .feature-text h4 {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}
.wx-page .feature-text p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.wx-page .about-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-nav);
}
.wx-page .social-links { display: flex; gap: 6px; }
.wx-page .social-link {
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 11px;
}
.wx-page .social-link:hover { background: var(--line-soft); }
.wx-page .about-copy { color: var(--faint); font-family: var(--f-mono); font-size: 8px; letter-spacing: .04em; }

/* --------------------------------------------------------------------------
   9. LOADING CHIP + MARKER
   -------------------------------------------------------------------------- */
.wx-page #loading-chip {
  bottom: 28px;
  padding: 8px 12px;
  gap: 8px;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  z-index: 120;
}
.wx-page .spinner-small {
  width: 12px; height: 12px;
  border: 1px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
}
.wx-page .ripple-marker .dot {
  background-color: var(--green);
  border: 1px solid var(--ink);
}

/* --------------------------------------------------------------------------
   10. RESPONSIVE
   -------------------------------------------------------------------------- */
/* The shared nav drops to 60px at this width; the map chrome follows it. */
@media (max-width: 760px) {
  .wx-page { --wx-nav-h: 60px; }
}

@media (max-width: 1280px) {
  .wx-page { --wx-panel-w: 500px; }
}

@media (max-width: 1100px) {
  .wx-page { --wx-panel-w: 440px; }
}

@media (max-width: 1024px) {
  .wx-page { --wx-panel-w: 400px; --wx-gutter: 14px; }
  .wx-page .map-search span { display: none; }
  .wx-page .map-search { width: 42px; padding: 0; justify-content: center; }
  #left-panels { width: 214px; }
  #left-panels .left-panel { max-height: calc(100dvh - var(--wx-top) - 54px - 96px); }
  #legends { max-width: 200px; }
  .wx-page .wp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wx-page .wp-metric:nth-child(odd) { border-left: 0; padding-left: 0; }
  .wx-page .wp-metric:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}

/* Narrow desktop: the shifted control column would graze the legend card,
   so fold the legend away while the point panel is open. */
@media (min-width: 769px) and (max-width: 800px) {
  body.wx-page.weather-panel-open #legends { display: none; }
}

@media (max-width: 768px) {
  .wx-page { --wx-gutter: 12px; --wx-bottom: 12px; }

  .wx-page .map-search { top: var(--wx-top); left: var(--wx-gutter); width: 42px; height: 42px; }
  #search-overlay { width: calc(100vw - 24px); max-width: none; left: 12px; }

  /* Base styles stretch the legend across the top of the viewport on mobile;
     keep it as a compact card in the bottom-left stack instead. */
  #legends {
    position: absolute !important;
    top: auto !important;
    left: var(--wx-gutter) !important;
    right: auto !important;
    bottom: 12px !important;
    width: 208px !important;
    max-width: 208px;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    align-items: stretch;
    gap: 0;
    z-index: 24;
    pointer-events: none;
  }
  /* The engine's own phone rules shrink this bar to a sliver; the tick labels
     sit inside it, so it keeps the same 32px ramp as the desktop card. */
  #legends .legend-bar { height: 32px !important; }
  #legends .legend-labels { padding: 0 8px; }
  #legends .legend { pointer-events: auto; }
  #legends .legend-labels { gap: 0; }
  #legends .legend-labels span { font-size: 8px; letter-spacing: 0; white-space: nowrap; }

  #left-panels {
    top: auto;
    bottom: 104px;
    left: 0;
    width: 204px;
  }
  /* Nine rows in one column are tall by nature: keep the whole rail visible and
     let it scroll only when the viewport is too short for all nine. */
  #left-panels .left-panel { max-height: none; }

  /* No header, no collapse state: keep the column square and fixed-size. */
  #left-panels #layers-panel {
    border-radius: 0 !important;
    box-shadow: none;
  }
  /* Same single column as desktop, a touch smaller for the narrower panel. */
  #layers-panel .layer-list { --lp-gap: 9px; --lp-box: 40px; padding: 10px 6px 8px; }
  #layers-panel .menu-item > label .lp-icon svg { width: 21px; height: 21px; }
  #layers-panel .menu-item > label span { margin-top: 2px; letter-spacing: .02em; }
  #layers-panel .particles-trigger > .lp-icon svg { width: 21px; height: 21px; }
  #layers-panel .particles-trigger > span { margin-top: 2px; }

  /* The flyout keeps the row on one line at 390: 36px discs on 38px columns
     end at ≈243px from the left edge, so nothing reaches the screen edge and
     no horizontal scrolling is needed. */
  #layers-panel .particles-row { --pp-disc: 36px; --pp-col: 44px; gap: 5px; }
  #layers-panel .particles-track { gap: 4px; }
  #layers-panel .particle-item .lp-icon svg { width: 19px; height: 19px; }

  /* The point card is a near-full-screen bottom sheet on phones: the layer
     bar and legend would sit on top of it, so fold them away while it is open. */
  body.wx-page.weather-panel-open #left-panels,
  body.wx-page.weather-panel-open #legends,
  body.wx-page.weather-panel-open .bottom-right-container { display: none; }

  #legends {
    left: var(--wx-gutter);
    bottom: 12px;
    max-width: 208px;
  }

  .wx-page .maplibregl-ctrl-attrib {
    font-size: 9px;
    line-height: 1.3;
  }

  /* Credit sits under the floating nav on phones; the bottom strip belongs to
     the legend and the control column. */
  .wx-page .maplibregl-ctrl-bottom-left {
    top: 74px;
    bottom: auto;
    left: var(--wx-gutter);
  }

  .wx-page .bottom-right-container { bottom: 12px; right: var(--wx-gutter); gap: 8px; }
  .wx-page .control-btn { width: 34px; height: 34px; }

  .wx-page .weather-panel {
    top: auto;
    left: var(--wx-gutter);
    right: var(--wx-gutter);
    bottom: 8px;
    width: auto;
    max-height: 78dvh;
  }
  .wx-page .wp-place { max-width: 220px; font-size: 10px; }
  .wx-page .wp-temp { font-size: 40px; }
  .wx-page .wp-wx-icon, .wx-page .wp-wx-icon img { width: 46px; height: 46px; }
  .wx-page .wp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wx-page .wp-metric-value { font-size: 15px; }
  .wx-page .wp-metric-value small { font-size: 8px; }
  .wx-page .wp-metric-label { font-size: 7.5px; letter-spacing: .08em; }
  .wx-page .wp-table-label { width: 96px; min-width: 96px; }
  .wx-page .wp-hero-main { gap: 8px; }
  /* The stamp repeats the table's first column; drop it on phones so the
     condition, feels-like and sun line stay on one screen. */
  .wx-page .wp-stamp { display: none; }

  #settings-panel,
  .wx-page .modal-panel {
    top: auto;
    bottom: 8px;
    width: calc(100vw - 24px);
    max-height: 78dvh;
    transform: none;
    left: 12px;
  }
  .wx-page .search-header { padding: 10px 12px; }
}

@media (max-width: 480px) {
  .wx-page .wp-metric { padding: 7px 8px; }
  .wx-page .wp-metric-value { font-size: 14px; }
  .wx-page .wp-hour { flex-basis: 56px; }
  .wx-page .store-buttons { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .wx-page .weather-panel,
  .wx-page .control-btn,
  .wx-page .wp-hour,
  .wx-page .map-search { transition: none; }
}

/* --------------------------------------------------------------------------
   11. POINT PANEL STRUCTURE
   The engine's .wp-* layout lives in the embed stylesheet on the real site;
   this block reproduces that structure with the set's spacing and geometry.
   -------------------------------------------------------------------------- */
.wx-page #weather-panel [hidden] { display: none !important; }

.wx-page .wp-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
}
.wx-page .wp-spinner { animation: wp-spin .8s linear infinite; }
@keyframes wp-spin { to { transform: rotate(360deg); } }

.wx-page .wp-error {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 44px 10px;
  text-align: center;
}

.wx-page .wp-hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding-bottom: 2px;
}
.wx-page .wp-hero-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.wx-page .wp-temp { display: flex; align-items: flex-start; }

.wx-page .wp-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wx-page .wp-metrics { margin-top: 14px; }

/* Narrow panels: four across cannot hold "1011.9 hPa", so pair them up. */
@media (max-width: 1024px) {
  .wx-page .wp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.wx-page .wp-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wx-page .wp-metric-value { white-space: nowrap; }
.wx-page .wp-metric-sub {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wx-page .wp-arrow {
  display: inline-block;
  line-height: 1;
  transform-origin: 50% 50%;
}

.wx-page .wp-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.wx-page .wp-section-head h3 { margin: 0; }
.wx-page .wp-model-tag { white-space: nowrap; }

.wx-page .wp-hours {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.wx-page .wp-hour {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.wx-page .wp-hour-icon { object-fit: contain; }
.wx-page .wp-hour-wind { display: flex; align-items: center; gap: 1px; line-height: 1.3; }
.wx-page .wp-hour-wave { line-height: 1.3; }

.wx-page .wp-days {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wx-page .wp-day {
  display: grid;
  grid-template-columns: 52px 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 8px;
}
.wx-page .wp-day:last-child { border-bottom: 0; }
.wx-page .wp-day-name { display: flex; flex-direction: column; line-height: 1.3; }
.wx-page .wp-day-icon { object-fit: contain; }
.wx-page .wp-day-cond { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wx-page .wp-day-temp { display: flex; gap: 6px; white-space: nowrap; }
.wx-page .wp-day-meta {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.3;
}
.wx-page .wp-day-meta span { display: inline-flex; align-items: center; gap: 2px; }

/* ==========================================================================
   POINT FORECAST PANEL — VISUAL PASS
   Warmer, higher-contrast text ramp, calmer rules, larger type and more air.
   Colours are panel-local so the map chrome keeps its own tokens.
   ========================================================================== */
.wx-page {
  --wp-text-strong: #22271f;
  --wp-text: #343a30;
  --wp-text-2: #555c4e;
  --wp-text-3: #6b7162;
  --wp-rule: #e3e4df;
  --wp-surface: #ffffff;
  --wp-surface-2: #f7f7f4;
}

/* header */
.wx-page .wp-head { padding: 16px 14px 14px 18px; border-bottom: 0; }
.wx-page .wp-place { font-size: 12px; letter-spacing: .1em; color: var(--wp-text-strong); }
.wx-page .wp-coords { margin-top: 6px; font-size: 10px; letter-spacing: .03em; color: var(--wp-text-2); }
.wx-page .wp-dot { color: var(--wp-text-3); }
.wx-page .wp-icon-btn { width: 30px; height: 30px; color: var(--wp-text-2); border-color: var(--wp-rule); }
.wx-page .wp-icon-btn:hover { color: var(--wp-text-strong); border-color: var(--green); }

/* rhythm */
.wx-page .wp-body { padding: 0 14px 20px; background: var(--paper-2); }
.wx-page .wp-section { margin-top: 22px; }
.wx-page .wp-section-head { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--wp-rule); }
.wx-page .wp-section-head h3 { color: var(--wp-text-2); font-size: 10px; font-weight: 600; letter-spacing: .12em; }
.wx-page .wp-model-tag { color: var(--wp-text-3); font-size: 9px; letter-spacing: .05em; }

/* daily rail */
.wx-page .wp-section.wp-daily {
  margin-top: 0;
  padding: 0 0 8px;
  background: var(--paper-2);
  box-shadow: 0 10px 16px -14px rgba(20, 24, 18, .55);
}
.wx-page .wp-daily-rail { gap: 7px; padding-bottom: 2px; }
.wx-page .wp-capsule { flex-basis: 70px; gap: 8px; padding: 9px 9px 10px; border-color: var(--wp-rule); align-items: center; text-align: center; }
.wx-page .wp-capsule:hover { background: var(--wp-surface-2); border-color: var(--green); }
.wx-page .wp-capsule.is-selected { background: #23281f; border-color: #23281f; }
.wx-page .wp-capsule-day { color: var(--wp-text-3); font-size: 9px; letter-spacing: .05em; justify-content: center; width: 100%; }
.wx-page .wp-capsule-day b { color: var(--wp-text-strong); font-size: 11px; font-weight: 600; }
.wx-page .wp-capsule.is-selected .wp-capsule-day,
.wx-page .wp-capsule.is-selected .wp-capsule-day b { color: rgba(255, 255, 255, .8); }
.wx-page .wp-capsule-icon { width: 27px; height: 27px; filter: brightness(.55) saturate(1.7) contrast(1.06); }

/* hourly table */
.wx-page .wp-table { font-size: 11px; }
.wx-page .wp-table thead th { background: var(--wp-surface-2); }
.wx-page .wp-table-date { height: 26px; color: var(--wp-text-2); font-size: 9px; letter-spacing: .06em; }
.wx-page .wp-table-time { height: 26px; color: var(--wp-text); font-size: 10px; }
.wx-page .wp-table tbody th,
.wx-page .wp-table tbody td { height: 32px; }
.wx-page .wp-table tbody td.has-level { height: 44px; }
.wx-page .wp-table tbody tr[data-row="wave"] td,
.wx-page .wp-table tbody tr[data-row="swell"] td { height: 56px; }
.wx-page .wp-table th.wp-table-label,
.wx-page .wp-table td.wp-table-label {
  width: 106px;
  min-width: 106px;
  padding: 0 10px;
  color: var(--wp-text-2);
  font-size: 10px;
  letter-spacing: .01em;
  text-align: right;
}
.wx-page .wp-table-label--head { background: var(--wp-surface-2); color: var(--wp-text-2); }
.wx-page .wp-table-cell { color: var(--wp-text); }
.wx-page .wp-table-temp b { font-size: 12px; font-weight: 650; }
.wx-page .wp-table-sst { color: #6e4c00; }
.wx-page .wp-table-tide { color: #0b5f7a; }
.wx-page .wp-table-level { color: var(--wp-text-3); font-size: 8.5px; }
.wx-page .wp-table-icon { width: 24px; height: 24px; filter: brightness(.6) saturate(1.65) contrast(1.05); }
.wx-page .wp-table td.is-wet { color: #0a5f7a; }

/* chart cards */
.wx-page .wp-chart-box { padding: 12px 12px 10px; border-color: var(--wp-rule); background: var(--wp-surface); }
.wx-page .wp-chart-note { margin-top: 8px; font-size: 9px; line-height: 1.55; color: var(--wp-text-3); }
.wx-page .wp-chart-legend {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 9px;
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--wp-text-3);
}
.wx-page .wp-chart-legend span { gap: 6px; }
.wx-page .wp-chart-legend i { width: 16px; height: 2px; }
.wx-page .wp-key--sun i { background: #b8781f; }
.wx-page .wp-key--moon i { background: #566b78; opacity: .72; }
.wx-page .wp-rise-set {
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 10px;
  border-top: 1px solid var(--wp-rule);
}
.wx-page .wp-rise-set__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 3px;
  padding: 8px 10px;
  border-top: 0;
  font-family: var(--f-mono);
  font-size: 7.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--wp-text-3);
}
.wx-page .wp-rise-set__item:nth-child(odd) { border-right: 1px solid var(--wp-rule); padding-left: 0; }
.wx-page .wp-rise-set__item:nth-child(even) { padding-right: 0; }
.wx-page .wp-rise-set__item:nth-child(-n + 2) { border-bottom: 1px solid var(--wp-rule); }
.wx-page .wp-rise-set__item b { color: var(--wp-text-strong); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.wx-page .wp-moonphase { padding: 12px; gap: 14px; border-color: var(--wp-rule); background: var(--wp-surface); }
.wx-page .wp-moon-disc { width: 68px; height: 68px; }
.wx-page .wp-moonphase__name { font-size: 13px; color: var(--wp-text-strong); }
.wx-page .wp-moonphase__meta { font-size: 10px; color: var(--wp-text-2); }
.wx-page .wp-source { margin-top: 18px; font-size: 9px; line-height: 1.6; color: var(--wp-text-3); }

/* Inline panel icons: no image filter, the SVG carries its own palette. */
.wx-page .wp-capsule-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 28px;
  height: 28px;
  filter: none;
}
.wx-page .wp-capsule-icon svg { display: block; width: 100%; height: 100%; }
.wx-page .wp-capsule.is-selected .wp-capsule-icon { filter: brightness(1.5) saturate(1.1); }
.wx-page .wp-table-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  vertical-align: middle;
  filter: none;
}
.wx-page .wp-table-icon svg { display: block; width: 100%; height: 100%; }

/* Panels dock to the map edges: no floating gutters, no gap between the
   search field and its result list. */
.wx-page .weather-panel {
  top: calc(var(--wx-top) - 18px);
  right: 0;
  bottom: 0;
  border-right: 0;
  border-bottom: 0;
}
#search-overlay {
  top: calc(var(--wx-top) - 18px);
  left: 0;
  max-height: calc(100dvh - (var(--wx-top) - 18px));
}
#search-overlay .search-input-wrapper-large { border-top: 0; border-left: 0; }
.wx-page .search-results-container { margin-top: 0; border-top: 0; }
#settings-panel {
  top: calc(var(--wx-top) - 18px);
  bottom: 0;
  max-height: none;
  border-top: 0;
  border-bottom: 0;
}
@media (max-width: 768px) {
  .wx-page .weather-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 84dvh;
    border-left: 0;
  }
  #search-overlay {
    left: 0;
    width: 100vw;
    max-width: none;
    top: calc(var(--wx-top) - 18px);
  }
  #settings-panel {
    width: 100vw;
    max-width: none;
  }
}

/* Rain amount keeps the numeric value and gains a 1–3 drop strength mark. */
.wx-page .wp-rain-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.wx-page .wp-rain-icon { display: inline-flex; align-items: flex-end; gap: 1px; }
.wx-page .wp-rain-icon svg { width: 5px; height: 8px; display: block; }

/* Hard dock: inline positioning from the map runtime must not reintroduce
   gutters on narrow screens. */
.wx-page .search-results-container { margin-top: -1px !important; border-top: 0 !important; }
@media (max-width: 768px) {
  .wx-page .weather-panel {
    top: calc(var(--wx-top) - 18px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    max-height: none !important;
  }
  #search-overlay {
    position: fixed !important;
    top: calc(var(--wx-top) - 18px) !important;
    left: 0 !important;
    right: auto !important;
    width: 100vw !important;
    max-width: none !important;
  }
  #settings-panel {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    transform: none !important;
    top: calc(var(--wx-top) - 18px) !important;
    bottom: 0 !important;
  }
}

