/* lp-stations.css: weather station cards + charts (js/lp-stations.js), the Live section's current-weather
 * text (LP.currentWeather) and lift status (js/lp-lifts.js). Loaded by the modules if the page did not link it. */

/* ---- header weather line (hdrwx): one line of values under the place line ---- */
.lp-hdr-wx { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 2px; margin: 2px 0 0; font-size: 14px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.lp-hdr-wx[hidden] { display: none; }
.lp-hw-i { white-space: nowrap; }
.lp-hw-ic { font-size: 15px; margin-right: 3px; }
.lp-hw-t .lp-hw-v { font-weight: 700; }
.lp-hw-sep { color: var(--lp-muted, #5f6670); }
@media (max-width: 420px) {
  .lp-hdr-wx { font-size: 13px; column-gap: 4px; }
  .lp-hw-ic { font-size: 13px; margin-right: 2px; }
}

/* ---- stations block ---- */
.lps { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.lps-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lps-summary { font-size: 13px; color: var(--lp-muted, #5f6670); flex: 1 1 200px; }
.lps-pill {
  border: 1px solid rgba(17,24,28,.18); background: #fff; color: inherit; border-radius: 16px; padding: 0 12px;
  min-height: 32px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.lps-pill:hover { background: var(--lp-hover, #cce6ff); }
.lps-pill-main { background: var(--lp-blue-2, #6699cc); color: #fff; border-color: transparent; }
.lps-pill-main:hover { background: var(--lp-blue-2h, #4477aa); }
.lps-pill-sm { min-height: 24px; font-size: 11px; padding: 0 8px; flex: none; }
.lps-pill[hidden] { display: none; }
.lps-list { display: flex; flex-direction: column; gap: 8px; }
.lps-card { border: 1px solid rgba(17,24,28,.14); border-radius: 10px; background: rgba(255,255,255,.75); padding: 8px 10px; min-width: 0; }
.lps-folded { padding: 0; }
.lps-silent { opacity: .55; }
.lps-line, .lps-headbtn {
  display: flex; align-items: center; gap: 6px; width: 100%; min-height: 36px; padding: 0 10px 0 6px; border: 0;
  background: none; font: inherit; color: inherit; cursor: pointer; text-align: left;
}
.lps-headbtn { padding: 0; min-height: 28px; flex: 1; min-width: 0; }
.lps-line:hover .lps-line-name, .lps-headbtn:hover .lps-name { text-decoration: underline; }
.lps-chev { display: inline-block; width: 14px; flex: none; color: #8a9299; font-size: 18px; line-height: 1; transition: transform .15s; }
.lps-chev-open { transform: rotate(90deg); }
.lps-line-name, .lps-name { flex: 1 1 auto; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lps-line-name { font-size: 14px; }
.lps-name { font-size: 15px; }
.lps-line-temp { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.lps-depth { border-radius: 9px; padding: 1px 7px; min-width: 44px; text-align: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.lps-new { font-size: 12px; font-weight: 700; color: #2a78d6; white-space: nowrap; flex: none; font-variant-numeric: tabular-nums; }
.lps-new[hidden] { display: none; }
.lps-chip { flex: none; font-size: 10.5px; font-weight: 700; line-height: 16px; padding: 0 6px; border-radius: 8px; background: var(--lp-blue-3, #b3cce6); color: #1d3a5a; }
.lps-dist { font-size: 13px; flex: none; font-variant-numeric: tabular-nums; }
.lps-head-row { display: flex; align-items: center; gap: 8px; }
.lps-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lps-sub { font-size: 12px; line-height: 16px; color: var(--lp-muted, #5f6670); }
a.lps-sub { font-weight: 400; color: var(--lp-muted, #5f6670); }
a.lps-sub:hover { color: var(--lp-link, #336699); }
.lps-where { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lps-stale { font-weight: 700; color: rgba(0,0,0,.87); }
.lps-readings { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 4px; margin: 6px 0; }
.lps-rl { font-size: 10.5px; line-height: 14px; color: var(--lp-muted, #5f6670); }
.lps-rv { font-size: 14px; line-height: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lps-note { margin: 4px 0; font-size: 12px; line-height: 18px; color: var(--lp-muted, #5f6670); }
.lps-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; text-decoration: underline; color: inherit; cursor: pointer; }
.lps-loading { height: 120px; border-radius: 6px; background: linear-gradient(90deg, #eef2f6 0, #f8fafc 50%, #eef2f6 100%); background-size: 200% 100%; animation: lps-sweep 1.2s linear infinite; }
@keyframes lps-sweep { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .lps-loading { animation: none; } }
.lps-chart { min-width: 0; }
.lps-legend { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; min-height: 18px; }
.lps-lg-item { display: inline-flex; align-items: center; gap: 4px; }
.lps-lg-text, .lps-lg-stamp { font-size: 11px; line-height: 16px; color: var(--lp-muted, #5f6670); font-variant-numeric: tabular-nums; }
.lps-lg-stamp, .lps-lg-on { color: rgba(0,0,0,.87); }
.lps-lg-stamp[hidden] { display: none; }
.lps-swatch { width: 10px; height: 2.5px; border-radius: 1.5px; display: inline-block; }
.lps-plot { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: crosshair; overflow: hidden; }
.lps-plot svg { display: block; font-family: inherit; }
/* hover/scrub cursor line: the SVG draws it near-black (light theme); on the dark theme a light line (CSS beats the attributes) */
html[data-theme=dark] .lps-plot .lps-cursor { stroke: #f2f5f8; stroke-opacity: .85; stroke-width: 1.5; }
.lps-credit { margin: 0; font-size: 10.5px; line-height: 14px; color: var(--lp-muted, #5f6670); }

.lps-swatch-area { height: 8px; width: 8px; border-radius: 2px; opacity: .6; }
.lps-group { margin: 6px 0 -2px; font-size: 13px; font-weight: 700; color: var(--lp-blue, #2d5886); }
.lps-group:first-child { margin-top: 0; }

/* ---- legacy weather plot (livewx) ---- */
/* base depth: its line, legend swatch and right axis in near-black, a light grey on the dark theme */
.lpx { --lpx-depth: #11181c; }
html[data-theme=dark] .lpx { --lpx-depth: #e6eaee; }
.lpx .lps-plot path.lpx-depth { stroke: var(--lpx-depth); }
.lpx .lps-plot text.lps-ax2 { fill: var(--lpx-depth); }
/* "Updated 12 min ago" in the Live weather section header */
.lpx-upd { font-weight: 400; font-variant-numeric: tabular-nums; }
.lpx-old { font-weight: 700; }
.lpx { display: flex; flex-direction: column; gap: 4px; text-align: left; margin: 6px 0 2px; }
.lpx-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lpx-title { font-size: 14px; font-weight: 700; color: var(--lp-blue, #2d5886); }
.lpx-days { display: flex; gap: 4px; }
.lpx-chart { border: 1px solid rgba(17,24,28,.10); border-radius: 8px; background: rgba(255,255,255,.7); padding: 4px 6px 2px; }

/* ---- customize dialog ---- */
.lps-dlg-wrap { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 12px; }
.lps-dlg {
  width: min(520px, 100%); max-height: 100%; overflow: auto; background: #fff; border-radius: 10px; padding: 14px 16px;
  box-shadow: 0 6px 30px rgba(0,0,0,.35); text-align: left; outline: none; display: flex; flex-direction: column; gap: 10px;
}
.lps-dlg h3 { margin: 0; font-size: 17px; color: var(--lp-blue, #2d5886); }
.lps-dlg-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; font-size: 14px; }
.lps-dlg select { font: inherit; font-size: 14px; min-height: 32px; padding: 0 6px; }
.lps-dlg-vars { border: 1px solid rgba(17,24,28,.15); border-radius: 8px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.lps-dlg-vars legend { font-size: 12px; color: var(--lp-muted, #5f6670); padding: 0 4px; }
.lps-check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.lps-dlg-sub { font-size: 12px; color: var(--lp-muted, #5f6670); }
.lps-dlg-list { display: flex; flex-direction: column; gap: 2px; max-height: 40vh; overflow: auto; border-top: 1px solid #eee; border-bottom: 1px solid #eee; padding: 4px 0; }
.lps-dlg-row { display: flex; align-items: flex-start; gap: 8px; padding: 4px 2px; cursor: pointer; font-size: 14px; }
.lps-dlg-row input { margin-top: 3px; }
.lps-dlg-name { display: flex; flex-direction: column; min-width: 0; font-weight: 700; }
.lps-dlg-name small { font-weight: 400; font-size: 11.5px; color: var(--lp-muted, #5f6670); }
.lps-dlg-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* ---- lift status (Live, js/lp-lifts.js) ---- */
.lpl {
  text-align: left; margin-top: 10px;
  /* status colours of the wait plot's bands and its legend, and of the state dots: checked for colour-blind
     separation on the light and the dark surface (dark steps below); lp-lifts.js reads them when it draws */
  --lpl-open: #2e9e4f; --lpl-hold: #e0a100; --lpl-scheduled: #3b82f6; --lpl-closed: #9c3542; --lpl-unknown: #c24fa0; --lpl-gap: #7d8790;
  /* cell fills: a day the lift ran (light green, dark text), ran with holds, never ran */
  --lpl-c-open: #c9f2d5; --lpl-c-open-text: #12341f; --lpl-c-hold: #fcf4e0; --lpl-c-closed: #f9ecec; --lpl-c-past: #3f464d;
  /* the Lift column: names wrap inside this width */
  --lpl-name-w: 15em;
}
html[data-theme=dark] .lpl {
  --lpl-open: #2b8241; --lpl-hold: #b3820f; --lpl-scheduled: #3e8eea; --lpl-closed: #d63d57; --lpl-unknown: #c95ec9; --lpl-gap: #8a96a3;
  --lpl-c-open: #1f5a35; --lpl-c-open-text: #d6f5df; --lpl-c-hold: #382f19; --lpl-c-closed: #3a2121; --lpl-c-past: var(--lp-muted, #9ba6b2);
}
.lpl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lpl-title { margin: 0; font-size: 17px; color: var(--lp-blue, #2d5886); }
.lpl-sum { font-size: 14px; font-weight: 700; color: var(--lp-muted, #5f6670); }
.lpl-note { margin: 4px 0; font-size: 13px; color: var(--lp-muted, #5f6670); }
.lpl-warn { color: #c2410c; }
.lpl-group { margin-top: 10px; }
.lpl-ghead { margin: 6px 0 4px; }
.lpl-area { margin: 0; font-size: 15px; line-height: 1.3; }
.lpl-hint { display: block; font-size: 12px; line-height: 1.35; color: var(--lp-muted, #5f6670); }

/* One grid per lift area, the same at every width: the past days oldest first | Today | Lift.
 *   - Day columns are `1fr` tracks of a grid as wide as its content (width: max-content): each gets the width of the
 *     widest line in ANY day column, so they are all equal and every line fits whatever the text size. A cell's
 *     min-width keeps an empty column from collapsing. On a wide page (min-width: 100%) they share the room equally.
 *   - The Lift column is --lpl-name-w wide and names wrap in it; a single word longer than that widens it
 *     (minmax(min-content, ...)), it never spills. It sticks to the right edge of the scroller.
 *   - Too wide for the page: the days scroll sideways under the Lift column in .lp-scroll.rtl, which starts at its
 *     right end (Today next to the lift).
 *   - Each area's grid sizes itself; lp-lifts.js (syncCols) then gives every area the widest day and Lift column
 *     (--lpl-day-min, --lpl-name-min) so the areas line up. Without it each grid is still even and spill-free.
 * Rows and row groups are display: contents (the cells are the grid items); roles keep it a table for a screen reader. */
.lpl-scroll { scroll-padding-right: 10em; }
.lpl-grid {
  display: grid; box-sizing: border-box; width: max-content; min-width: 100%;
  grid-template-columns: repeat(var(--lpl-days, 4), 1fr) minmax(min-content, var(--lpl-name-w));
  font-size: 13px; line-height: 1.3; color: var(--lp-text, #222); background: var(--lp-surface, #fff);
  border: 1px solid var(--lp-border, #e3e3e3); border-right: 0;
}
.lpl-rg, .lpl-row { display: contents; }
.lpl-h, .lpl-c { box-sizing: border-box; border-bottom: 1px solid var(--lp-border, #e3e3e3); border-right: 1px solid var(--lp-border, #e3e3e3); }
.lpl-rg:last-child > .lpl-row:last-child > .lpl-c { border-bottom: 0; }
.lpl-h { padding: 5px 7px; background: var(--lp-th, #2d5886); color: var(--lp-th-text, #f2f2f2); border-color: var(--lp-th-border, #24496f); font-weight: 700; white-space: nowrap; }
.lpl-dh, .lpl-day { min-width: 5.6em; min-width: max(5.6em, var(--lpl-day-min, 0px)); } /* --lpl-day-min: the widest day column of all the areas (lp-lifts.js syncCols) */
.lpl-day { display: grid; font-variant-numeric: tabular-nums; }
/* a day cell is one button: its lines never wrap, the column is as wide as the longest */
.lpl-cell {
  display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; /* lines from the top, not centred */
  box-sizing: border-box; width: 100%; margin: 0; padding: 5px 7px; border: 0; border-radius: 0;
  background: none; color: inherit; font: inherit; line-height: inherit; text-align: left; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.lpl-ln { display: block; white-space: nowrap; }
.lpl-ln-st { font-weight: 700; }
/* the wait under "Open" (lp-lifts.js waitBand): bold, coloured by length */
.lpl-w { font-weight: 700; }
.lpl-w-none { color: #000; }
.lpl-w-short { color: #1565c0; }
.lpl-w-mid { color: #e67700; }
.lpl-w-long { color: #d32f2f; }
.lpl-w-vlong { color: #d6338c; }
html[data-theme="dark"] .lpl-w-none { color: #f2f4f6; }
html[data-theme="dark"] .lpl-w-short { color: #6fb3ff; }
html[data-theme="dark"] .lpl-w-mid { color: #ffa94d; }
html[data-theme="dark"] .lpl-w-long { color: #ff6b6b; }
html[data-theme="dark"] .lpl-w-vlong { color: #f783ac; }
.lpl-pd { color: var(--lpl-c-past); }
/* light green with dark text: a day the lift ran, and Today while it is open */
.lpl-d-open, .lpl-s-open { background: var(--lpl-c-open); color: var(--lpl-c-open-text); }
.lpl-d-hold { background: var(--lpl-c-hold); }
.lpl-d-closed { background: var(--lpl-c-closed); }
.lpl-s-hold { background: var(--lp-hold, #f8e9c4); }
.lpl-s-scheduled { background: var(--lp-sched, #d8e7fa); }
.lpl-s-closed { background: var(--lp-closed, #f6d6d6); }
.lpl-cell:hover { box-shadow: inset 0 0 0 1px var(--lp-accent, #2d5886); }
.lpl-cell:focus { outline: none; }
.lpl-cell:focus-visible { outline: 2px solid var(--lp-accent, #2d5886); outline-offset: -2px; }
.lpl-cell.lpl-sel, .lpl-cell.lpl-sel:hover { box-shadow: inset 0 0 0 2px var(--lp-accent, #2d5886); }
/* the Lift column */
.lpl-nh, .lpl-name { position: sticky; right: 0; z-index: 1; min-width: var(--lpl-name-min, 0px); border-left: 1px solid var(--lp-border-2, #c8c8c8); box-shadow: -6px 0 6px -6px rgba(0, 0, 0, .3); }
.lpl-nh { border-left-color: var(--lp-th-border, #24496f); }
.lpl-name { padding: 5px 7px 5px 23px; background: var(--lp-surface, #fff); font-weight: 700; overflow-wrap: break-word; }
.lpl-nm { display: block; }
/* the state dot hangs in the left padding, so a wrapped name stays in one column */
.lpl-dot { position: absolute; left: 7px; top: .65em; width: 10px; height: 10px; border-radius: 50%; background: #8a9299; } /* top: the cell's padding + half a line - half the dot */
.lpl-dot-open { background: var(--lpl-open); }
.lpl-dot-hold { background: var(--lpl-hold); }
.lpl-dot-scheduled { background: var(--lpl-scheduled); }
/* the lifts without a row */
.lpl-more { margin-top: 8px; font-size: 13px; color: var(--lp-muted, #5f6670); }
.lpl-more-sum { cursor: pointer; }
.lpl-more-list { margin: 4px 0 0; font-size: 12px; }
.lpl-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.lpl-btn { border: 0; background: var(--lp-blue-2, #6699cc); color: #fff; border-radius: 16px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.lpl-btn:hover { background: var(--lp-blue-2h, #4477aa); }
.lpl-foot { margin: 8px 0 0; font-size: 12px; color: var(--lp-muted, #5f6670); }

/* wait-time plot of one lift-day (under its area's grid; one per area) */
.lpl-plot { margin-top: 8px; padding: 8px 10px 6px; border: 1px solid var(--lp-border, #e3e3e3); border-radius: 6px; background: var(--lp-surface, #fff); }
.lpl-plot-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.lpl-plot-title { margin: 2px 0 4px; font-size: 14px; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.lpl-plot-day { font-weight: 400; color: var(--lp-muted, #5f6670); white-space: nowrap; }
.lpl-plot-sub { display: block; font-size: 12px; font-weight: 400; color: var(--lp-muted, #5f6670); }
.lpl-plot-nav { display: flex; gap: 4px; flex: none; }
.lpl-nav { width: 32px; height: 32px; border: 1px solid var(--lp-border-2, #c8c8c8); border-radius: 16px; background: var(--lp-surface, #fff); color: var(--lp-text, #222); font: inherit; font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.lpl-nav:hover:not([disabled]) { background: var(--lp-surface-2, #f7f9fb); }
.lpl-nav[disabled] { opacity: .35; cursor: default; }
.lpl-plot-chart { min-height: 180px; }
/* what the plot says under the pointer: one line, always there, so the caption below does not move */
.lpl-plot-bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin: 2px 0 0; min-height: 1.4em; font-size: 12px; line-height: 1.4; }
.lpl-plot-read { font-variant-numeric: tabular-nums; color: var(--lp-text, #222); }
.lpl-zoom { margin: 0; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--lp-link, #336699); text-decoration: underline; cursor: pointer; }
.lpl-zoom[hidden] { display: none; }
.lpl-zoom:focus-visible { outline: 2px solid var(--lp-accent, #2d5886); outline-offset: 2px; }
.lpl-plot-cap { margin: 2px 0 0; font-size: 12px; line-height: 1.5; color: var(--lp-muted, #5f6670); }
.lpl-key { display: flex; flex-wrap: wrap; gap: 0 12px; }
.lpl-key-i { white-space: nowrap; }
.lpl-cap-text { display: block; }
.lpl-sw { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin: 0 4px 0 0; vertical-align: -1px; }
.lpl-sw-open { background: var(--lpl-open); }
.lpl-sw-hold { background: var(--lpl-hold); }
.lpl-sw-scheduled { background: var(--lpl-scheduled); }
.lpl-sw-closed { background: var(--lpl-closed); }
.lpl-sw-unknown { background: var(--lpl-unknown); }
.lpl-sw-gap { background: repeating-linear-gradient(135deg, var(--lpl-gap) 0 1.5px, transparent 1.5px 4px); box-shadow: inset 0 0 0 1px var(--lpl-gap); }
.lpl-sw-line { height: 2px; border-radius: 1px; vertical-align: 3px; background: var(--lp-accent, #2d5886); }

/* phones and narrow panes: the same grid, a little smaller and tighter, a narrower Lift column */
@media (max-width: 640px) {
  .lpl { --lpl-name-w: 9.5em; }
  .lpl-grid { font-size: 12px; }
  .lpl-h, .lpl-cell { padding: 5px 5px; }
  .lpl-name { padding: 5px 5px 5px 18px; }
  .lpl-dot { left: 5px; width: 9px; height: 9px; }
  .lpl-plot { padding: 8px 6px 6px; }
}

@media (max-width: 480px) {
  /* open card header: the readings already say "+N cm 24 h"; give the name the room */
  .lps-headbtn .lps-new { display: none; }
}
