/*
 * lazurowa13.pl — Material You–style board.
 * One hue (--h) and chroma (--c) per sky state drive every colour role; light-dark() picks the scheme.
 * Dark scheme for everyone, whatever the system preference; light only when forced by ?mode=light.
 * --lift raises the dark surfaces and secondary roles (in L% points) for a sky that must not read as night.
 */

@font-face {
  font-family: "Roboto Flex";
  src: url(fonts/roboto-flex-latin.woff2) format("woff2");
  font-weight: 100 1000;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto Flex";
  src: url(fonts/roboto-flex-latin-ext.woff2) format("woff2");
  font-weight: 100 1000;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Material Symbols Rounded";
  src: url(fonts/material-symbols-rounded.woff2) format("woff2");
  font-weight: 300 600;
  font-display: block;
}

@property --h { syntax: "<number>"; inherits: true; initial-value: 245; }
@property --c { syntax: "<number>"; inherits: true; initial-value: 0.06; }
@property --lift { syntax: "<number>"; inherits: true; initial-value: 0; }

:root {
  --h: 245; --c: 0.06; --lift: 0;
  color-scheme: dark;

  --bg:        light-dark(oklch(98.4% calc(var(--c) * .22) var(--h)), oklch(calc(16.5% + var(--lift) * 1%) calc(var(--c) * .35) var(--h)));
  --surface-1: light-dark(oklch(95.6% calc(var(--c) * .45) var(--h)), oklch(calc(21.5% + var(--lift) * 1%) calc(var(--c) * .45) var(--h)));
  --surface-2: light-dark(oklch(92.4% calc(var(--c) * .8) var(--h)),  oklch(calc(26% + var(--lift) * 1%) calc(var(--c) * .6) var(--h)));
  --surface-3: light-dark(oklch(88.8% calc(var(--c) * 1) var(--h)),   oklch(calc(31% + var(--lift) * 1%) calc(var(--c) * .7) var(--h)));
  --on:        light-dark(oklch(21% calc(var(--c) * .3) var(--h)),    oklch(94% calc(var(--c) * .2) var(--h)));
  --on-var:    light-dark(oklch(41% calc(var(--c) * .55) var(--h)),   oklch(calc(79% + var(--lift) * 1%) calc(var(--c) * .45) var(--h)));
  --primary:   light-dark(oklch(46% calc(var(--c) * 2.3) var(--h)),   oklch(calc(83% + var(--lift) * 1%) calc(var(--c) * 1.4) var(--h)));
  --on-primary: light-dark(oklch(99% 0 0),                            oklch(24% calc(var(--c) * 1.2) var(--h)));
  --p-cont:    light-dark(oklch(89% calc(var(--c) * 1.5) var(--h)),   oklch(calc(35% + var(--lift) * 1%) calc(var(--c) * 1.5) var(--h)));
  --on-p-cont: light-dark(oklch(27% calc(var(--c) * 1.8) var(--h)),   oklch(91% calc(var(--c) * .9) var(--h)));
  --outline:   light-dark(oklch(82% calc(var(--c) * .5) var(--h)),    oklch(calc(37% + var(--lift) * 1%) calc(var(--c) * .5) var(--h)));

  --ok: light-dark(oklch(42% .11 150), oklch(84% .12 150));
  --ok-cont: light-dark(oklch(91% .06 150), oklch(32% .07 150));
  --warn: light-dark(oklch(45% .12 70), oklch(85% .12 80));
  --warn-cont: light-dark(oklch(92% .07 85), oklch(33% .07 75));
  --bus: oklch(54% .19 27);
  --bus-night: oklch(30% .05 265);

  --r-xl: 28px; --r-l: 22px; --r-m: 14px; --r-s: 8px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --ease-out: cubic-bezier(.05, .7, .1, 1);

  transition: --h 1.6s var(--ease), --c 1.6s var(--ease), --lift 1.6s var(--ease);
}
:root[data-sky="dawn"]  { --h: 45;  --c: .065; }
:root[data-sky="day"]   { --h: 245; --c: .06; --lift: 5.5; }
:root[data-sky="dusk"]  { --h: 320; --c: .07; }
:root[data-sky="night"] { --h: 268; --c: .05; }
:root[data-sky="rain"]  { --h: 215; --c: .03; }
/* Preview only: ?mode= forces the scheme. */
:root[data-mode="light"] { color-scheme: light; }
:root[data-mode="dark"]  { color-scheme: dark; }
/* The night sky is dark whatever the scheme, so what sits on it (title, date, pills) keeps the dark roles.
   `color` is restated because it inherits already resolved from body. */
:root[data-sky="night"] .top { color-scheme: dark; color: var(--on); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--outline) var(--bg); }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg); color: var(--on);
  font: 400 1rem/1.45 "Roboto Flex", system-ui, sans-serif;
  font-variation-settings: "opsz" 16;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--p-cont); color: var(--on-p-cont); }
a { color: var(--primary); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
small { font-size: .8125rem; }

.i {
  font-family: "Material Symbols Rounded"; font-weight: 450; font-style: normal;
  font-size: 1.25em; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; vertical-align: -.22em; white-space: nowrap; direction: ltr;
  font-feature-settings: "liga"; -webkit-font-feature-settings: "liga";
  font-variation-settings: "FILL" 0, "wght" 450, "opsz" 24;
}

/* ── KPO strip: logos must sit on white, in full colour, in every scheme ─────────── */
.kpo-bar {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; padding: 6px 4vw 4px; text-decoration: none;
  border-bottom: 1px solid oklch(90% .01 260);
}
.kpo-bar img { display: block; width: min(92vw, 640px); height: auto; }
.kpo-more { font-size: .75rem; font-weight: 500; color: #233a7a; display: inline-flex; align-items: center; }
.kpo-more .i { font-size: 1.1rem; }
.kpo-bar:hover .kpo-more { text-decoration: underline; }

/* ── Sky header ──────────────────────────────────────────────────────────────── */
.top {
  position: relative; isolation: isolate;
  padding: 18px 16px 16px;
  display: flex; align-items: flex-end;
}
.top::before {
  content: ""; position: absolute; inset: 0 0 -220px; z-index: -1; pointer-events: none;
  mask-image: linear-gradient(#000 55%, transparent);   /* no hard edge where the sky meets the ground */
  background: var(--sky); transition: opacity 1.6s var(--ease);
}
:root            { --sky: linear-gradient(180deg, light-dark(oklch(83% .085 240), oklch(36% .07 250)), var(--bg)); }
:root[data-sky="dawn"]  { --sky: linear-gradient(180deg, light-dark(oklch(84% .075 25), oklch(34% .07 30)), light-dark(oklch(91% .06 75), oklch(24% .04 60)) 45%, var(--bg)); }
:root[data-sky="dusk"]  { --sky: linear-gradient(180deg, light-dark(oklch(68% .12 295), oklch(30% .09 295)), light-dark(oklch(83% .09 40), oklch(26% .06 30)) 50%, var(--bg)); }
:root[data-sky="rain"]  { --sky: linear-gradient(180deg, light-dark(oklch(74% .025 230), oklch(28% .02 230)), var(--bg)); }
:root[data-sky="night"] {
  --sky: radial-gradient(1.5px 1.5px at 12% 22%, #fff9 50%, transparent 51%),
         radial-gradient(1px 1px at 33% 12%, #fff8 50%, transparent 51%),
         radial-gradient(1.5px 1.5px at 58% 30%, #fff6 50%, transparent 51%),
         radial-gradient(1px 1px at 76% 16%, #fffa 50%, transparent 51%),
         radial-gradient(1px 1px at 88% 34%, #fff7 50%, transparent 51%),
         radial-gradient(120% 45% at 50% 55%, oklch(32% .07 255 / .5), transparent 70%),
         linear-gradient(180deg, oklch(28% .085 270), oklch(22% .06 268) 55%, var(--bg));
}
.title h1 { font-size: 2.25rem; line-height: 1.05; font-weight: 760; letter-spacing: -.02em; font-variation-settings: "opsz" 48; }
.title .date { margin-top: 6px; color: var(--on-var); font-weight: 500; text-wrap: balance; }
.glance { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.glance .g {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px 6px 10px; border-radius: 999px;
  background: color-mix(in oklch, var(--surface-1) 78%, transparent); color: var(--on); text-decoration: none;
  font-weight: 560; font-size: .9375rem; backdrop-filter: blur(8px);
  transition: background .2s var(--ease);
}
.glance .g:hover { background: var(--surface-2); }
.glance .g .i { color: var(--primary); font-variation-settings: "FILL" 1, "wght" 500, "opsz" 24; }
.aq-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--aq, var(--outline)); }
.aq-dot[data-level="1"] { --aq: oklch(62% .15 150); } .aq-dot[data-level="2"] { --aq: oklch(72% .16 130); }
.aq-dot[data-level="3"] { --aq: oklch(82% .15 95); }  .aq-dot[data-level="4"] { --aq: oklch(72% .16 60); }
.aq-dot[data-level="5"] { --aq: oklch(60% .19 30); }  .aq-dot[data-level="6"] { --aq: oklch(45% .15 10); }
:root[data-sky="dusk"] .title .date, :root[data-sky="night"] .title .date { color: var(--on); opacity: .85; }

.arc {
  position: absolute; right: 18px; top: 16px; width: 96px; height: 48px;
  border: 1.5px dashed color-mix(in oklch, var(--on) 28%, transparent);
  border-bottom: 0; border-radius: 66px 66px 0 0;
}
.orb {
  position: absolute; width: 18px; height: 18px; border-radius: 50%;
  left: calc(var(--p, .5) * 100%); bottom: calc(sin(var(--p, .5) * 180deg) * 100%);
  translate: -50% 50%; transition: left 1.2s var(--ease), bottom 1.2s var(--ease);
}
.orb.sun { background: oklch(86% .16 85); box-shadow: 0 0 0 5px oklch(86% .16 85 / .3), 0 0 22px 6px oklch(86% .16 85 / .45); }
.orb.moon { background: oklch(94% .02 260); box-shadow: inset -5px -2px 0 0 oklch(78% .03 260), 0 0 16px 3px oklch(94% .02 260 / .3); }

/* ── Board layout ────────────────────────────────────────────────────────────── */
.board {
  position: relative; z-index: 1;   /* above the sky that bleeds out of the header */
  display: grid; gap: 12px; padding: 0 12px 12px;
  grid-template-columns: 1fr;
  max-width: 1240px; margin: 0 auto;
}
/* Reading order on phone and tablet; .side dissolves so its cards take part in the board grid. */
.side { display: contents; }
#buses { order: 1; } #weather { order: 2; } #solar { order: 3; } #waste { order: 4; } #today { order: 5; }
#meeting { order: 6; } #impact { order: 7; } #premises { order: 8; } #nearby { order: 9; } .stack { order: 10; }
@media (min-width: 680px) {
  .board {
    grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 20px 20px;
    grid-template-areas: "buses buses" "weather solar" "weather waste" "today meeting" "impact impact" "premises premises" "nearby nearby" "stack stack";
  }
  .top { padding: 36px 28px 24px; min-height: 160px; }
}
@media (min-width: 1040px) {
  .board {
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
      "buses buses weather"
      "solar waste side"
      "solar meeting side"
      "nearby nearby side";
    grid-template-rows: auto auto auto 1fr;
  }
  .side { display: flex; flex-direction: column; gap: 16px; grid-area: side; align-self: start; }
  .side > *, .side > .stack, .side .card { align-self: stretch; }   /* the grid's align-self:start would shrink-wrap flex children */
  .top { padding: 44px max(28px, calc((100vw - 1240px) / 2 + 20px)) 28px; min-height: 176px; }
  .title h1 { font-size: 2.75rem; }
}
@media (min-width: 680px) {
  .card { align-self: start; }
  #buses, #weather, #solar, #waste, #meeting { align-self: stretch; }   /* neighbours share bottom edges */
  .arc { width: 132px; height: 66px; top: 22px; right: 22px; }
  #buses { grid-area: buses; } #weather { grid-area: weather; } #solar { grid-area: solar; }
  #waste { grid-area: waste; } #today { grid-area: today; } #meeting { grid-area: meeting; } #impact { grid-area: impact; }
  #premises { grid-area: premises; } #nearby { grid-area: nearby; } .stack { grid-area: stack; align-self: start; }
}

/* Water + administrator travel together: one continuous column beside "W okolicy". */
.stack { display: grid; gap: 12px; }   /* explicit: its parent .side has no gap of its own on phone */
@media (min-width: 680px) { .stack { gap: 16px; } }
@media (min-width: 680px) and (max-width: 1039px) { .stack { grid-template-columns: 1fr 1fr; } }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface-1); border-radius: var(--r-l); padding: 18px 18px 20px;
  min-width: 0;
}
.card.hero { background: var(--surface-2); border-radius: var(--r-xl); padding: 20px 20px 16px; }
.card.tonal { background: var(--p-cont); color: var(--on-p-cont); }
.card h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.0625rem; font-weight: 640; letter-spacing: .005em; margin-bottom: 14px;
}
.card h2 .i { font-size: 1.4rem; color: var(--primary); font-variation-settings: "FILL" 1, "wght" 500, "opsz" 24; }
.card.tonal h2 .i { color: var(--on-p-cont); }
.card h3 { font-size: .8125rem; font-weight: 640; letter-spacing: .06em; text-transform: uppercase; color: var(--on-var); margin: 18px 0 8px; display: flex; gap: 6px; align-items: center; }
.card h3:first-child { margin-top: 0; }
.meta { color: var(--on-var); font-size: .875rem; }
.card.tonal .meta { color: inherit; opacity: .8; }
.big-line { font-size: 1.25rem; font-weight: 560; line-height: 1.3; margin-bottom: 4px; }
.empty { color: var(--on-var); display: flex; gap: 8px; align-items: center; padding: 8px 0; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: .75rem; font-weight: 560; line-height: 1; padding: 6px 10px; border-radius: 999px;
  background: var(--surface-3); color: var(--on-var);
}
.chip .i { font-size: 1rem; }
.chip.ok { background: var(--ok-cont); color: var(--ok); }
.chip.warn { background: var(--warn-cont); color: var(--warn); }

/* Buses */
#buses .body { display: grid; gap: 4px 20px; }
@media (min-width: 680px) { #buses .body { grid-template-columns: 1fr 1fr; } }
.stop h3 { margin: 4px 0 6px; }
.deps { display: grid; }
.dep {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px;
  min-height: 52px; border-top: 1px solid var(--outline);
  transition: opacity .35s var(--ease), translate .35s var(--ease);
}
.dep:first-child { border-top: 0; }
.dep.more, .dep.spare { display: none; }   /* spare: never shown until promoted to "more" when a row departs */
#buses.expanded .dep.more { display: grid; }
@media (min-width: 680px) { #buses .dep.more { display: grid; } #buses .more-btn { display: none; } }
.line {
  justify-self: start; min-width: 48px; text-align: center; padding: 6px 8px; border-radius: var(--r-s);
  background: var(--bus); color: #fff; font-weight: 700; font-size: 1rem; letter-spacing: .01em;
}
.line.night { background: var(--bus-night); outline: 1px solid oklch(60% .05 265 / .5); }
.dir { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.when { display: grid; justify-items: end; line-height: 1.1; }
.when .min { font-size: 1.25rem; font-weight: 700; font-variation-settings: "opsz" 32; }
.when small { color: var(--on-var); }
.dep.soon .min { color: var(--primary); }
.dep.leaving { opacity: 0; translate: -24px 0; }
.none { color: var(--on-var); padding: 12px 0; }
.more-btn {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 4px;
  font: inherit; font-size: .875rem; font-weight: 600; color: var(--primary);
  background: none; border: 0; padding: 10px 12px 10px 6px; border-radius: 999px; cursor: pointer;
}
.more-btn:hover { background: color-mix(in oklch, var(--primary) 9%, transparent); }
.more-btn .i { transition: rotate .25s var(--ease); }
#buses.expanded .more-btn .i { rotate: 90deg; }

/* Weather + air */
.now { display: flex; align-items: center; gap: 14px; }
.sky-icon { font-size: 3rem; color: var(--primary); font-variation-settings: "FILL" 1, "wght" 400, "opsz" 48; }
.temp { font-size: 4.25rem; line-height: 1; font-weight: 300; letter-spacing: -.03em; font-variation-settings: "opsz" 144; }
.temp span { font-size: 1.5rem; font-weight: 400; letter-spacing: 0; vertical-align: .9em; margin-left: 2px; color: var(--on-var); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 16px 0 12px; }
.facts dt { font-size: .8125rem; color: var(--on-var); display: flex; gap: 6px; align-items: center; }
.facts dt .i { font-size: 1.05rem; }
.facts dd { font-size: 1.0625rem; font-weight: 600; padding-left: 23px; }
.wind { rotate: var(--deg); font-size: 1rem; margin-right: 4px; vertical-align: -.15em; color: var(--primary); }
.air { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--outline); }
.air-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.aq { font-weight: 650; padding: 6px 12px 6px 28px; border-radius: 999px; position: relative; background: var(--surface-3); }
.aq::before { content: ""; position: absolute; left: 10px; top: 50%; translate: 0 -50%; width: 10px; height: 10px; border-radius: 50%; background: var(--aq, var(--outline)); }
.aq[data-level="1"] { --aq: oklch(62% .15 150); } .aq[data-level="2"] { --aq: oklch(72% .16 130); }
.aq[data-level="3"] { --aq: oklch(82% .15 95); }  .aq[data-level="4"] { --aq: oklch(72% .16 60); }
.aq[data-level="5"] { --aq: oklch(60% .19 30); }  .aq[data-level="6"] { --aq: oklch(45% .15 10); }
.pm { font-size: .9375rem; } .pm small { color: var(--on-var); }
.advice { margin-top: 8px; font-size: .875rem; color: var(--on-var); max-width: 60ch; }

/* Solar */
#solar { --sun: light-dark(oklch(55% .15 75), oklch(86% .15 85)); }
.solar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.solar .big { font-size: 2.75rem; font-variation-settings: "FILL" 1, "wght" 400, "opsz" 48; }
.solar[data-state="sun"] .big { color: var(--sun); }
.solar .state { font-size: 1.375rem; font-weight: 640; line-height: 1.2; }
.solar .power { display: grid; justify-items: end; line-height: 1.1; }
.solar .power b { font-size: 1.25rem; font-weight: 700; font-variation-settings: "opsz" 32; }
.solar .power small { font-size: .875rem; opacity: .8; }
/* The card is a column and the curve takes the height the grid gives it (96px up to the cap), so the facts stay at the bottom.
   The cap matters when a neighbour card (waste "Jak segregować?") grows the shared grid row. */
#solar { display: flex; flex-direction: column; }
#solar .body { flex: 1; display: flex; flex-direction: column; }
.curve { flex: 1; max-height: 260px; display: flex; flex-direction: column; margin: 16px 0 0; }
.plot { position: relative; flex: 1; min-height: 96px; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.curve .area { fill: currentColor; fill-opacity: .16; }
.curve .trace { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.curve .load { stroke: currentColor; stroke-opacity: .6; stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.curve .here { position: absolute; box-sizing: border-box; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--sun); border: 2px solid var(--p-cont); }
.curve figcaption { display: flex; justify-content: space-between; margin-top: 4px; font-size: .8125rem; opacity: .8; }
.key { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.key .dash { flex: none; width: 18px; border-top: 1px dashed currentColor; }
.facts.three { grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 4px 12px; margin: auto 0 10px; padding-top: 16px; }
.facts.three dt { display: block; }
.facts.three dd { padding-left: 0; }

/* Metro headways, at the bottom of the departures card */
.metro { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--outline); }
.metro:empty { display: none; }
.mrows { display: grid; }
.mrow { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--outline); }
.mrow:first-child { border-top: 0; }
.metro .meta { margin-top: 4px; font-size: .8125rem; }
@media (min-width: 680px) {
  .metro { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .metro h3, .metro .meta { grid-column: 1 / -1; }
  .mrows { display: contents; }
  .mrow { border-top: 0; }
}

/* Environmental benefits */
.impact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.impact li { display: grid; justify-items: center; align-content: start; gap: 6px; }
.impact svg { width: 64px; height: 64px; }
.impact .a { fill: var(--primary); }
.impact .a.s { fill-opacity: .55; }
.impact .b { fill: currentColor; fill-opacity: .3; }
.impact .d { fill: currentColor; fill-opacity: .7; }
.impact .w { fill: var(--surface-1); }
.impact b { font-size: 1.25rem; font-weight: 700; line-height: 1.1; white-space: nowrap; font-variation-settings: "opsz" 32; }
.impact span { font-size: .8125rem; line-height: 1.25; color: var(--on-var); text-wrap: balance; }
#impact .body > .meta { margin-top: 14px; font-size: .8125rem; }

/* Waste */
.pickups li { display: grid; grid-template-columns: 86px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--outline); align-items: baseline; }
.pickups li:first-child { border-top: 0; }
.pickups .day { font-weight: 650; color: var(--on-var); }
.sorting { margin-top: 14px; border-top: 1px solid var(--outline); padding-top: 6px; }
.sorting summary { cursor: pointer; font-weight: 600; color: var(--primary); padding: 8px 0; list-style: none; display: inline-flex; align-items: center; gap: 4px; }
.sorting summary::-webkit-details-marker { display: none; }
.sorting summary .i { transition: rotate .25s var(--ease); }
.sorting[open] summary .i { rotate: 90deg; }
.note { display: flex; gap: 8px; align-items: center; font-size: .875rem; color: var(--on-var); background: var(--surface-3); border-radius: var(--r-m); padding: 8px 12px; margin-bottom: 8px; }
@media (min-width: 680px) { #buses .note { grid-column: 1 / -1; } }
.rules { display: grid; gap: 12px; font-size: .875rem; padding: 6px 0 4px; }
.rules h4 { font-size: .9375rem; margin-bottom: 2px; }
.rules p { color: var(--on-var); }

/* Today, meeting, water, manager */
.names { margin: 6px 0; text-wrap: pretty; }
.links { display: grid; gap: 8px; margin-top: 12px; font-size: .9375rem; }
.links a, .links span { display: inline-flex; align-items: center; gap: 8px; }
.links .i { color: var(--primary); }
.links a { text-decoration: none; }   /* underline the words only, never the icon beside them */
.links a .t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.links a:hover .t { text-decoration-thickness: 2px; }

/* Premises */
.units li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; min-height: 48px; border-top: 1px solid var(--outline); }
.units li:first-child { border-top: 0; }
.code { font-weight: 700; font-size: .8125rem; text-align: center; padding: 6px 0; border-radius: var(--r-s); background: var(--surface-3); color: var(--on-var); }
.units .nm { display: flex; flex-direction: column; font-weight: 520; }
.units .nm small { color: var(--on-var); font-weight: 400; }
.units a { color: var(--on); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.units a:hover { color: var(--primary); }
.units .ext { font-size: 1rem; color: var(--on-var); }
.units .free .code { background: var(--primary); color: var(--on-primary); }
.units .free .nm { color: var(--primary); font-weight: 650; }

/* Nearby */
@media (min-width: 1040px) { #nearby .body { columns: 2; column-gap: 28px; } #nearby h3 { break-after: avoid; } .spots li { break-inside: avoid; } }
.spots li { display: grid; grid-template-columns: 62px 1fr; grid-template-areas: "d n" ". c"; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--outline); }
.spots li:last-child { border-bottom: 0; }
.spots .dist { grid-area: d; text-align: center; font-weight: 700; font-size: .9375rem; }
.spots .nm { grid-area: n; display: flex; flex-direction: column; min-width: 0; }
.spots .nm b { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.spots .nm small { color: var(--on-var); }
.spots .chip { grid-area: c; justify-self: start; margin-top: 6px; white-space: normal; line-height: 1.25; }
.pi { color: var(--primary); font-size: 1.05rem; }
.spots .hours { grid-area: c; font-size: .8125rem; color: var(--on-var); margin-top: 4px; }
/* Column breaks cannot be detected in CSS, so the two-column layout separates rows by space, not rules. */
@media (min-width: 1040px) { #nearby .spots li { border-bottom: 0; padding: 8px 0 12px; } }

/* Footer */
.foot { max-width: 1240px; margin: 8px auto 0; padding: 18px 20px 40px; color: var(--on-var); font-size: .8125rem; display: grid; gap: 6px; }

/* Value refresh: one quiet crossfade when polled data replaces a section. */
[data-section].refreshing { animation: refresh .6s var(--ease-out); }
@keyframes refresh { from { opacity: .35; filter: blur(2px); } to { opacity: 1; filter: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
