/* Self-hosted variable fonts, latin and latin-ext subsets (SIL OFL 1.1, licences in /fonts). */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-v9-latin-ext.woff2") format("woff2");
  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: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-v9-latin.woff2") format("woff2");
  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: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-v24-latin-ext.woff2") format("woff2");
  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: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-v24-latin.woff2") format("woff2");
  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;
}

:root {
  --paper: #eef2f1;
  --paper-raised: #f8faf9;
  --ink: #16232b;
  --ink-soft: #4e5f68;
  --rule: #c9d3d2;
  --accent: #d9480f;
  --station: #1c6e8c;
  --model: #8a979d;
  --contour: rgba(22, 35, 43, 0.06);
  /* Verdict chips: fills get lighter from great to fair; poor and the not-skiable states are outlines. */
  --great-bg: #0f4c81;
  --great-ink: #ffffff;
  --good-bg: #cde4f1;
  --good-ink: #0d3a57;
  --fair-bg: #efe2c2;
  --fair-ink: #4d3b0c;

  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-data: "JetBrains Mono", ui-monospace, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
  --radius: 6px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101a20;
    --paper-raised: #16232b;
    --ink: #e6eeec;
    --ink-soft: #93a4aa;
    --rule: #2a3a42;
    --accent: #ff7a3d;
    --station: #5bb4d4;
    --model: #6b7b82;
    --contour: rgba(230, 238, 236, 0.04);
    --great-bg: #8fd0f2;
    --great-ink: #0b1a24;
    --good-bg: #1c4763;
    --good-ink: #dceef8;
    --fair-bg: #4b3f1f;
    --fair-ink: #f2e3b6;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--paper);
  /* Topographic contour lines, as on a trail map. */
  background-image:
    repeating-radial-gradient(ellipse at 85% -10%, transparent 0 38px, var(--contour) 38px 39px),
    repeating-radial-gradient(ellipse at -10% 110%, transparent 0 52px, var(--contour) 52px 53px);
  color: var(--ink);
  font: 16px/1.5 var(--font-display);
  font-weight: 300;
}

a { color: inherit; }

@media (min-width: 760px) {
  body { background-attachment: fixed; }
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-3) var(--space-6);
}

.masthead {
  display: grid;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

@media (min-width: 760px) {
  .page { padding-top: var(--space-5); }
  .masthead { margin-bottom: var(--space-5); }
}

.wordmark {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 4.8rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.tagline {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

@media (min-width: 760px) {
  .tagline { font-size: 1.1rem; }
}

.state {
  color: var(--ink-soft);
  padding: var(--space-5) 0;
}

.state.error { color: var(--accent); }

/*
 * Filters: region, country and sort as one row of selects wherever they fit (the Nordics at 375 px);
 * sort wraps to a second row when they don't (Switzerland in the country list, 320 px screens).
 */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.picker { flex: 1 1 auto; display: grid; gap: var(--space-1); min-width: 0; }

/* 16 px text: smaller makes iOS Safari zoom the page on focus. */
.picker select {
  width: 100%;
  min-height: 44px;
  padding: 0 2px 0 6px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  font: 400 1rem var(--font-display);
  cursor: pointer;
}

.picker select:hover { border-color: var(--ink-soft); }

@media (min-width: 760px) {
  .controls { gap: var(--space-3); margin-bottom: var(--space-4); }
  .picker { flex: 0 1 13rem; }
  .picker select { padding: 0 var(--space-2); }
}

.control-label {
  font: 700 0.7rem/1 var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.segmented { display: flex; gap: var(--space-1); flex-wrap: wrap; }

.segmented button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  font-weight: 300;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.segmented button:hover { border-color: var(--ink-soft); }

.segmented button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  font-weight: 800;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Resort board */

.board { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }

.board-row {
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  transform: translateY(6px);
  animation: settle 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i, 0) * 28ms);
}

@keyframes settle { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .board-row { animation: none; opacity: 1; transform: none; }
}

.board-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name depth"
    "verdict verdict"
    "meta meta";
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-2);
  text-decoration: none;
  transition: background-color 120ms ease;
}

.board-link:hover { background: var(--paper-raised); }

.resort-name { grid-area: name; font-weight: 800; font-size: 1.35rem; line-height: 1.1; overflow-wrap: break-word; }

.resort-meta { color: var(--ink-soft); font-size: 0.9rem; }

.board-link .resort-meta { grid-area: meta; font-size: 0.85rem; }

.depth {
  grid-area: depth;
  text-align: right;
  font: 700 clamp(1.4rem, 5vw, 2rem)/1 var(--font-data);
  letter-spacing: -0.03em;
}

.depth small { font-size: 0.45em; font-weight: 400; color: var(--ink-soft); margin-left: 2px; }

.depth.none { color: var(--model); }

.depth-label {
  display: block;
  margin-bottom: 2px;
  font: 700 0.62rem/1 var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

/* Verdict: chip and label, then the facts behind it, then the snow on the way. */

.board-verdict { grid-area: verdict; display: grid; gap: var(--space-1); min-width: 0; }

.verdict-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }

.chip {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  font: 700 0.75rem/1.5 var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.chip-great { background: var(--great-bg); color: var(--great-ink); }
.chip-good { background: var(--good-bg); color: var(--good-ink); }
.chip-fair { background: var(--fair-bg); color: var(--fair-ink); }
.chip-poor { border-color: var(--ink); color: var(--ink); }
.chip-closed, .chip-no-snow, .chip-unknown { border-color: var(--ink-soft); border-style: dashed; color: var(--ink-soft); }

.verdict-label { font-weight: 800; font-size: 1.05rem; line-height: 1.2; }

/* One fact per line: a fact can hold its own " · " (base and summit), so side by side they'd run together. */
.facts {
  display: flex;
  flex-direction: column;
  font: 400 0.82rem/1.5 var(--font-data);
  color: var(--ink-soft);
}


.outlook { font-size: 0.95rem; line-height: 1.35; }

.freshness { white-space: nowrap; }

.source-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font: 700 0.68rem/1.5 var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid currentColor;
}

.source-tag.resort { color: var(--accent); }
.source-tag.station { color: var(--station); }
.source-tag.model { color: var(--model); }

@media (min-width: 760px) {
  .board-link {
    grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr) 120px;
    grid-template-areas:
      "name verdict depth"
      "meta verdict depth";
    padding: var(--space-3);
  }
  .board-link .resort-name { align-self: end; }
  .board-link .resort-meta { align-self: start; }
}

/* Resort detail */

.detail-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
}

.back, .feed-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-soft);
}

.detail-head {
  display: grid;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--ink);
}

.detail-title { display: grid; gap: var(--space-1); }
.detail-title .resort-meta { margin: 0; }

.verdict { display: grid; gap: var(--space-2); }
.verdict .chip { font-size: 0.85rem; padding: 3px 10px; }
.verdict .verdict-label { font-size: clamp(1.5rem, 5vw, 2rem); line-height: 1.1; letter-spacing: -0.01em; }
.verdict .facts { font-size: 0.9rem; }
.verdict .outlook { font-size: 1.05rem; }

.detail-depth { display: grid; gap: var(--space-1); }
.detail-depth .resort-meta { margin: 0; }

.detail-head h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
}

.detail-head .depth { grid-area: auto; text-align: left; font-size: clamp(2.8rem, 11vw, 5rem); }
.detail-head .depth-label { font-size: 0.72rem; margin-bottom: var(--space-1); letter-spacing: 0.12em; }

@media (min-width: 760px) {
  .detail-head {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title depth" "verdict depth";
    align-items: end;
  }
  .detail-title { grid-area: title; }
  .verdict { grid-area: verdict; }
  .detail-depth { grid-area: depth; justify-items: end; text-align: right; }
  .detail-head .depth { text-align: right; }
}

.section-title {
  margin: var(--space-5) 0 var(--space-3);
  font: 700 0.75rem/1 var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.sources {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

.source-card {
  padding: var(--space-3);
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: grid;
  gap: var(--space-2);
  align-content: start;
}

.source-card.used { border-color: currentColor; box-shadow: inset 4px 0 0 var(--accent); }

.source-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-1) var(--space-3);
  font: 400 0.85rem/1.4 var(--font-data);
}

.source-provider { margin: 0; font: 400 0.8rem var(--font-data); color: var(--ink-soft); }

.source-card dt { color: var(--ink-soft); }
.source-card dd { margin: 0; text-align: right; font-weight: 700; }

.source-note { margin: 0; font-size: 1rem; color: var(--ink-soft); }

.chart-wrap {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--rule); stroke-width: 1; }
.chart .tick { fill: var(--ink-soft); font: 400 11px var(--font-data); }
.chart path { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-resort { stroke: var(--accent); }
.chart .series-station { stroke: var(--station); }
.chart .series-model { stroke: var(--model); stroke-dasharray: 5 4; }
.chart .point-resort { fill: var(--accent); }
.chart .point-station { fill: var(--station); }
.chart .point-model { fill: var(--model); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  font: 400 0.8rem var(--font-data);
  color: var(--ink-soft);
}

.legend li::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 0;
  margin-right: 6px;
  vertical-align: middle;
  border-top: 2px solid var(--swatch);
}

.legend .model::before { border-top-style: dashed; }

/* Season chart (resort page): the normal band, last season dashed, this season solid. */
.season-line { margin: 0 0 var(--space-3); font-size: 1rem; line-height: 1.5; }
.chart .band { fill: var(--station); fill-opacity: 0.18; stroke: none; }
.chart .series-last { stroke: var(--model); stroke-dasharray: 5 4; }
.chart .series-this { stroke: var(--accent); }
.chart .point-last { fill: var(--model); }
.chart .point-this { fill: var(--accent); }
.chart .today { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 2 3; }
.legend .last::before { border-top-style: dashed; }
.legend .band::before {
  height: 10px;
  border-top: 0;
  background: color-mix(in srgb, var(--station) 18%, transparent);
}
#season-chart + .source-note { margin-top: var(--space-2); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-5) 0 var(--space-3);
}

.section-head .section-title { margin: 0; }

.section-meta { font: 400 0.8rem var(--font-data); color: var(--ink-soft); }

.cameras {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  margin-bottom: var(--space-2);
}

.camera { margin: 0; display: grid; gap: var(--space-2); }

.camera img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--rule);
}

.camera figcaption {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font: 400 0.82rem var(--font-data);
  color: var(--ink-soft);
}

.camera figcaption b { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.camera figcaption span { flex: none; }

.colophon {
  margin-top: var(--space-6);
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.7;
}

.colophon p { margin: 0 0 var(--space-2); }

/*
 * Language switch, in the masthead and the footer: three plain links. Each is a 44 px tap target;
 * the three fit on one line at 320 px ("English · Suomi · Svenska").
 */
.lang-switch {
  justify-self: start;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-1);
  color: var(--ink);
}

.lang-switch a:first-child { padding-left: 0; }

.lang-switch a[aria-current] {
  font-weight: 800;
  text-decoration: none;
}

@media (min-width: 421px) {
  .segmented button { padding: 0 var(--space-3); }
}

/* Alerts */

.tagline a { color: var(--ink); }

.follow { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); }

.telegram-offer { display: grid; gap: 0; margin: 0 0 var(--space-4); }
.telegram-offer .feed-link { color: var(--ink); text-decoration: underline; }

.page-title {
  margin: 0 0 var(--space-2);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.lede { margin: 0 0 var(--space-4); max-width: 60ch; color: var(--ink-soft); font-size: 1.05rem; }
.lede b { color: var(--ink); }

.alert-form { display: grid; gap: var(--space-4); max-width: 760px; }

.alert-form fieldset {
  /* Fieldsets default to min-width: min-content, which pushes them past the page edge on phones. */
  min-width: 0;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  display: grid;
  gap: var(--space-2);
}

.alert-form legend {
  padding: 0 var(--space-1);
  font: 700 0.75rem/1 var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.alert-resorts { align-items: start; }
.resort-group { border-bottom: 1px solid var(--rule); }
.resort-group:last-child { border-bottom: 0; }

.resort-group summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-2);
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}

.resort-group summary::-webkit-details-marker { display: none; }

.resort-group summary .control-label { color: var(--ink); }

.group-count { font: 400 0.875rem var(--font-data); color: var(--ink-soft); }

/* The open/closed state in words, not a marker glyph; the words come from the page's language (alerts.js). */
.resort-group summary::after {
  content: attr(data-show) / "";
  margin-left: auto;
  font: 700 0.75rem/1 var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: underline;
}

.resort-group[open] summary::after { content: attr(data-hide) / ""; }

.group-list { display: grid; padding-bottom: var(--space-2); }

.resort-group label { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; }

/* Checkbox and wording on one line; level selects and hints indented under the wording. */
.rule {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-height: 44px;
  padding: var(--space-1) 0;
}

.rule .rule-levels, .rule .hint { grid-column: 2; }
.rule-levels { display: flex; flex-wrap: wrap; gap: var(--space-2); }

@media (min-width: 760px) {
  .rule { grid-template-columns: auto auto minmax(0, 1fr); }
  .rule .rule-levels { grid-column: 3; }
  .rule .hint { grid-column: 2 / -1; }
}

@media (min-width: 760px) {
  /* Same specificity as .alert-form fieldset's gap, so it has to be spelled out here. */
  .alert-form .alert-resorts { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-2) var(--space-4); }
  /* Columns of unequal length: a rule above each group, none below, so short groups leave no stray line. */
  .resort-group, .resort-group:last-child { border-bottom: 0; }
  .resort-group summary { border-top: 1px solid var(--rule); }
}

.alert-form input[type="checkbox"], .alert-form input[type="radio"] { width: 18px; height: 18px; accent-color: var(--ink); }

/* 16 px text in form fields: smaller text makes iOS Safari zoom the page on focus. */
.alert-form select, .alert-form input[type="email"], .alert-form input[type="url"] {
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem var(--font-data);
}

.field { display: grid; gap: var(--space-1); }
.field input { width: 100%; }

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
}

.radio-pill:has(input:checked) { border-color: var(--ink); font-weight: 800; }

.hint { margin: 0; color: var(--ink-soft); font-size: 1rem; }

button.primary, button.danger {
  justify-self: start;
  min-height: 48px;
  padding: 0 var(--space-4);
  border-radius: var(--radius);
  font: 800 1rem var(--font-display);
  cursor: pointer;
}

button.primary { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); }
button.danger { border: 1px solid var(--accent); background: transparent; color: var(--accent); }
button:disabled { opacity: 0.6; cursor: progress; }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.form-status { margin: 0; min-height: 1.5em; color: var(--accent); }

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}

.notice p { margin: 0; }

/* Page-wide notices under the masthead: data shown from the offline copy, a new version ready. */
.site-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.site-notice[hidden] { display: none; }
.site-notice p { margin: 0; }
.site-notice button.primary { min-height: 44px; }

.device-alerts { margin-bottom: var(--space-4); }
.device-alerts .section-title { margin-top: 0; }
.device-alerts ul { margin: 0; padding: 0; list-style: none; }
.device-alerts a { display: flex; align-items: center; min-height: 44px; }

.field[hidden] { display: none; }

.secret { font-family: var(--font-data); overflow-wrap: anywhere; }
.warn { color: var(--accent); }

/* Current conditions */

.conditions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
}

.conditions div {
  padding: var(--space-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.conditions dt {
  font: 700 0.7rem/1.3 var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.conditions dd {
  margin: var(--space-2) 0 0;
  font: 700 1.4rem/1 var(--font-data);
  letter-spacing: -0.02em;
}

@media (min-width: 560px) {
  .conditions { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--space-3); }
  .conditions dd { font-size: 1.6rem; }
}

.conditions dd small { font-size: 0.55em; font-weight: 400; color: var(--ink-soft); }
.conditions dd.label { font: 800 1.15rem/1.2 var(--font-display); letter-spacing: 0; }

.warn-notice { margin: var(--space-4) 0 0; color: var(--ink); }

/* Avalanche danger, in the EAWS scale colours; text stays dark for contrast. */

.danger {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font: 700 0.72rem/1.6 var(--font-data);
  letter-spacing: 0.04em;
  color: #16232b;
}

.danger-1 { background: #ccff66; }
.danger-2 { background: #ffff00; }
.danger-3 { background: #ff9900; }
.danger-4 { background: #ff3b30; color: #fff; }
.danger-5 { background: repeating-linear-gradient(45deg, #b00000 0 6px, #16232b 6px 12px); color: #fff; }

.avalanche-level { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0 0 var(--space-2); font-size: 1.2rem; }
.avalanche-level .danger { font-size: 0.875rem; padding: 4px 10px; }

@media (min-width: 480px) {
  .avalanche-level .danger { font-size: 1rem; padding: 4px 12px; }
}
.avalanche-day { display: inline-block; min-width: 9ch; font-size: 0.9rem; color: var(--ink-soft); }

/* One day's bulletin: level, elevation split, problems with their aspect rose, tendency and validity. */
.avalanche-bulletin { margin: 0 0 var(--space-4); }
.avalanche-bulletin .source-note { margin-bottom: var(--space-2); }
.avalanche-problems { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: grid; gap: var(--space-2); }
.avalanche-problem { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.problem-text { display: grid; gap: 2px; min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
.problem-text b { font-weight: 800; }
.problem-text span { color: var(--ink-soft); }
.problem-aspects { font: 700 0.85rem/1.4 var(--font-data); letter-spacing: 0.04em; }
.aspect-rose { display: block; width: 40px; height: 40px; }
.aspect-rose .on { fill: var(--ink); stroke: var(--paper-raised); stroke-width: 1; }
.aspect-rose .off { fill: var(--paper-raised); stroke: var(--ink-soft); stroke-width: 1; }
.aspect-rose .north { stroke: var(--ink); stroke-width: 2; }
/* An expired bulletin: greyed, the level badge too, with a note that says so in words. */
.avalanche-bulletin.expired { opacity: 0.6; filter: grayscale(1); }
.expired-note { margin: 0 0 var(--space-1); font-weight: 700; color: var(--ink); }

/* Where to go: the region's resorts ranked for one day. */

.where-link {
  display: grid;
  gap: 2px;
  min-height: 44px;
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-raised);
  text-decoration: none;
  transition: background-color 120ms ease;
}

.where-link b { font-weight: 800; font-size: 1.15rem; line-height: 1.2; text-decoration: underline; text-underline-offset: 3px; }
.where-link span { color: var(--ink-soft); font-size: 1rem; line-height: 1.3; }
.where-link:hover { background: var(--paper); }

.where-controls .picker { flex: 0 1 13rem; }

/* Three tabs sized to their words, so the longest weekday ("Wednesday") fits whole at 320 px. */
.day-tabs {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.day-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--space-1);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
}

.day-tab:hover { border-color: var(--ink-soft); }

.day-tab[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 800; }

.where-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }

.where-card { border-bottom: 1px solid var(--rule); }

.where-card-link {
  display: grid;
  grid-template-columns: 2.4ch minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  text-decoration: none;
  transition: background-color 120ms ease;
}

.where-card-link:hover { background: var(--paper-raised); }

.where-rank { font: 700 1.6rem/1.1 var(--font-data); letter-spacing: -0.03em; text-align: right; }

.where-body { display: grid; gap: var(--space-2); min-width: 0; }
/* One column on phones; .resort-name carries the board's grid area, which would make a second. */
.where-body > * { grid-area: auto; }
.where-body .resort-name { line-height: 1.15; }
.where-body .resort-meta { font-size: 0.85rem; }

/* One reason per line: a reason can hold its own " · " (base and summit). */
.reasons {
  display: flex;
  flex-direction: column;
  font: 400 0.9rem/1.5 var(--font-data);
}

.show-all {
  min-height: 44px;
  margin-top: var(--space-3);
  padding: 0 var(--space-4);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 800 1rem var(--font-display);
  cursor: pointer;
}

.show-all:hover { background: var(--paper-raised); }

.where-footnote { margin: var(--space-4) 0 var(--space-2); color: var(--ink-soft); }

.where-method { max-width: 60ch; }

@media (min-width: 760px) {
  .where-link { justify-self: start; display: inline-grid; margin-bottom: var(--space-4); }
  .day-tabs { grid-template-columns: repeat(3, minmax(0, 11rem)); margin-bottom: var(--space-4); }
  .where-card-link { grid-template-columns: 3ch minmax(0, 1fr); gap: var(--space-4); padding: var(--space-3); }
  .where-rank { font-size: 2rem; }
  .where-body {
    grid-template-columns: minmax(220px, 1fr) minmax(0, 1.3fr);
    grid-template-areas: "name reasons" "verdict reasons" "meta reasons";
    align-content: start;
    gap: var(--space-1) var(--space-4);
  }
  .where-body .resort-name { grid-area: name; }
  .where-body .verdict-line { grid-area: verdict; }
  .where-body .reasons { grid-area: reasons; align-self: center; }
  .where-body .resort-meta { grid-area: meta; }
}

/*
 * Data quality (#/quality): stacked rows per resort, one block per figure (base, summit, fresh
 * snow), never a table that scrolls sideways. On a phone each figure is label and value, then its
 * source and the Report link, then any fallback or held reading.
 */

.quality-link { margin: 0 0 var(--space-3); }
.quality-link a { display: inline-flex; align-items: center; min-height: 44px; }
.colophon .quality-link { margin: 0; }

.quality-how {
  margin-bottom: var(--space-4);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.quality-how summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.quality-how summary::-webkit-details-marker { display: none; }

/* The open/closed state in words, as on the alert form's resort groups. */
.quality-how summary::after {
  content: attr(data-show) / "";
  margin-left: auto;
  font: 700 0.75rem/1 var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: underline;
}

.quality-how[open] summary::after { content: attr(data-hide) / ""; }
.quality-how p { margin: 0 0 var(--space-3); max-width: 65ch; }

.quality-runs { list-style: none; margin: 0; padding: 0; display: grid; border-top: 2px solid var(--ink); }

.quality-run { padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.quality-run p { margin: 0; }
.quality-run-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.quality-run-head b { font-weight: 800; }
.quality-run-facts { display: flex; flex-direction: column; font: 400 0.82rem/1.5 var(--font-data); color: var(--ink-soft); }
.quality-run-error { font: 400 0.82rem/1.4 var(--font-data); overflow-wrap: anywhere; }

/* The run's state in words; colour only repeats it. */
.run-state {
  padding: 0 6px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font: 700 0.68rem/1.5 var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.run-ok { color: var(--station); }
.run-partial { color: var(--accent); border-style: dashed; }
.run-failed { background: var(--accent); border-color: var(--accent); color: var(--paper); }

.quality-report-note { margin-bottom: var(--space-3); max-width: 65ch; }

.quality-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }

.quality-resort { padding: var(--space-3) 0; border-bottom: 1px solid var(--rule); min-width: 0; }

.quality-resort-name { margin: 0 0 var(--space-1); font-weight: 800; font-size: 1.35rem; line-height: 1.15; overflow-wrap: break-word; }
.quality-resort-name a { text-underline-offset: 3px; }
.quality-resort-name .resort-meta { font-weight: 300; font-size: 0.9rem; }

.quality-figures { margin: 0; display: grid; }

.quality-figure {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "source report"
    "flags flags";
  align-items: center;
  column-gap: var(--space-2);
  padding-top: var(--space-2);
}

.quality-figure + .quality-figure { margin-top: var(--space-1); border-top: 1px dashed var(--rule); }

.quality-figure dt {
  grid-area: label;
  font: 700 0.7rem/1.2 var(--font-data);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.quality-figure dd { margin: 0; min-width: 0; }

.quality-value { grid-area: value; text-align: right; font: 700 1.3rem/1.1 var(--font-data); letter-spacing: -0.02em; }
.quality-value small { font-size: 0.6em; font-weight: 400; color: var(--ink-soft); }
.quality-value.none { font: 400 0.85rem/1.3 var(--font-data); color: var(--model); }

.quality-source { grid-area: source; font: 400 0.82rem/1.5 var(--font-data); color: var(--ink-soft); overflow-wrap: break-word; }
.quality-source span { color: var(--ink); }
.quality-source .quality-age { color: var(--ink-soft); white-space: nowrap; }

.quality-report { grid-area: report; justify-self: end; }
.quality-report a { display: inline-flex; align-items: center; justify-content: flex-end; min-height: 44px; min-width: 44px; font-size: 0.95rem; }

.quality-flags { grid-area: flags; display: grid; gap: var(--space-1); padding-bottom: var(--space-1); }
.quality-flag { margin: 0; padding-left: var(--space-2); border-left: 3px solid var(--model); font-size: 0.95rem; line-height: 1.35; }
.quality-flag.held { border-left-color: var(--accent); }

@media (min-width: 760px) {
  .quality-runs { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: var(--space-4); }
  .quality-figures { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
  .quality-figure { padding-top: 0; }
  .quality-figure + .quality-figure { margin-top: 0; border-top: 0; }
}

/* The resort's name gets its own column once three figures beside it still have room. */
@media (min-width: 1080px) {
  .quality-resort { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: var(--space-4); }
  .quality-resort-name .resort-meta { display: block; margin-top: var(--space-1); }
}

/* The server's summary of the page (src/pages.ts), shown until the app's own view replaces it. */
.page-summary { display: grid; gap: var(--space-2); max-width: 720px; overflow-wrap: anywhere; }
.page-summary h1 { margin: 0; font-family: var(--font-display); line-height: 1.1; }
.page-summary h2 { margin: var(--space-2) 0 0; font-family: var(--font-display); }
.page-summary p { margin: 0; }
.page-summary ul.facts, .page-summary .summary-list { margin: 0; padding: 0; list-style: none; }
.page-summary .summary-list { display: grid; gap: var(--space-1); }
.page-summary ol.summary-list { list-style: decimal inside; }
.page-summary .summary-list a, .page-summary .summary-back a { display: inline-block; min-height: 44px; padding-block: 10px; }
.summary-figures { display: grid; gap: var(--space-1); margin: 0; }
.summary-figures div { display: grid; grid-template-columns: minmax(6rem, auto) 1fr; gap: var(--space-2); }
.summary-figures dt { font-weight: 700; }
.summary-figures dd { margin: 0; font-family: var(--font-data); font-size: 0.9rem; }
