:root {
  --bg: #f6f7f9; --card: #fff; --text: #17202b; --muted: #5b6776; --line: #dfe3e8; --accent: #1f6feb;
  /* Okabe-Ito colours: distinguishable with the common kinds of colour blindness */
  --fresh: #56b4e9; --grippy: #009e73; --soft: #e69f00; --icy: #0072b2; --wet: #d55e00; --sun: #ffd23f;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f141a; --card: #171e26; --text: #e6ebf1; --muted: #9aa7b6; --line: #2a333d; --accent: #58a6ff; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.2rem;
  background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); display: flex; gap: .45rem; align-items: center; }
.brand svg { width: 26px; height: 26px; }
.lang a { margin-left: .6rem; font-size: .9rem; }
main { max-width: 1180px; margin: 0 auto; padding: 1.2rem; }
h1 { font-size: 1.7rem; margin: .2rem 0 .2rem; }
.lead { color: var(--muted); margin: 0 0 1rem; max-width: 60rem; }
.controls { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: center; margin: .6rem 0 .8rem; }
.days, .modes { display: flex; gap: .4rem; flex-wrap: wrap; }
.days button, .modes button { border: 1px solid var(--line); background: var(--card); color: var(--text); padding: .4rem .8rem;
  border-radius: 999px; cursor: pointer; font: inherit; }
.days button[aria-pressed="true"], .modes button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.hour { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 260px; }
.hour input { flex: 1; }
.hour output { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 7.5rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 1rem; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
#map { height: 620px; border-radius: 10px; border: 1px solid var(--line); background: #e9e9e9; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; }
.card h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .9rem; margin: .7rem 0 0; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.key { width: 22px; height: 6px; border-radius: 3px; display: inline-block; }
.key.sun { background: var(--sun); } .key.shade { background: #3d4f66; }
.k-f { background: var(--fresh); } .k-g { background: var(--grippy); } .k-s { background: var(--soft); }
.k-i { background: var(--icy); } .k-w { background: var(--wet); }
.best ol { list-style: none; margin: 0; padding: 0; }
.best li { display: grid; grid-template-columns: 2.6rem 1fr; gap: .1rem .6rem; padding: .45rem 0; border-top: 1px solid var(--line); cursor: pointer; }
.best li:first-child { border-top: 0; }
.ref { font-weight: 700; text-align: center; border-radius: 5px; padding: .05rem .2rem; color: #fff; height: fit-content; }
.d-novice, .d-easy { background: #2f6fd6; } .d-intermediate { background: #c9302c; } .d-advanced, .d-expert { background: #222; }
.d-freeride { background: #e07b00; } .d- { background: #888; }
.what { font-size: .9rem; color: var(--muted); }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; margin-top: .25rem; }
.strip i { height: 10px; border-radius: 2px; position: relative; }
.strip i.now { outline: 2px solid var(--text); outline-offset: 1px; }
.strip i.lit::after { content: ""; position: absolute; left: 50%; top: -5px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--sun); }
.hours-head { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; font-size: .7rem; color: var(--muted); }
table.runs { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.runs th, table.runs td { text-align: left; padding: .35rem .4rem; border-top: 1px solid var(--line); vertical-align: middle; }
table.runs td.tl { width: 46%; }
.explain { margin-top: 1.4rem; max-width: 60rem; }
.explain h2 { font-size: 1.15rem; margin: 1.2rem 0 .3rem; }
.note { font-size: .88rem; color: var(--muted); }
.issued { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
footer { max-width: 1180px; margin: 2rem auto; padding: 0 1.2rem; font-size: .82rem; color: var(--muted); }
.leaflet-container { font: inherit; }
.season { font-size: .9rem; color: var(--muted); margin: -.4rem 0 .6rem; max-width: 60rem; }
.day-note { background: #fff4d6; color: #5a4300; border: 1px solid #e9c46a; border-radius: 8px; padding: .5rem .8rem; margin: 0 0 .8rem; }
@media (prefers-color-scheme: dark) { .day-note { background: #3a3014; color: #f3dc9a; border-color: #7a6424; } }
.best li.msg { display: block; cursor: default; color: var(--muted); }

/* phones */
@media (max-width: 640px) {
  main { padding: .8rem; }
  header.top { padding: .6rem .8rem; }
  h1 { font-size: 1.35rem; }
  .lead { font-size: .95rem; }
  .controls { gap: .6rem; }
  .days { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: .2rem; scrollbar-width: none; }
  .days button { flex: none; }
  .hour { min-width: 0; width: 100%; }
  .hour output { min-width: 6.5rem; text-align: right; }
  .hour input { height: 2rem; }
  #map { height: 430px; }
  .card { padding: .8rem .7rem; }
  table.runs thead { display: none; }
  table.runs, table.runs tbody { display: block; }
  table.runs tr { display: grid; grid-template-columns: 3rem 1fr auto; gap: .15rem .5rem; padding: .45rem 0;
    border-top: 1px solid var(--line); align-items: center; }
  table.runs td { border: 0; padding: 0; }
  table.runs td.tl { grid-column: 1 / -1; width: auto; }
  table.runs td:nth-child(3) { font-size: .82rem; color: var(--muted); }
}
.now { margin: 0 0 1rem; }
.now h2 { font-size: 1.05rem; margin: 0 0 .35rem; }
.now p { margin: .2rem 0; }
.now p.wx { font-size: .88rem; color: var(--muted); margin-top: .45rem; }
.now p.example, .example-link { font-weight: 600; }
.now p.example { color: var(--soft); }
.run-card { margin-top: .7rem; }
.play { border: 1px solid var(--line); background: var(--card); color: var(--text); width: 2.4rem; height: 2.4rem;
  border-radius: 50%; cursor: pointer; font: inherit; flex: none; }
.play:hover { border-color: var(--accent); }
main.legal { max-width: 52rem; }
main.legal h2 { font-size: 1.1rem; margin: 1.3rem 0 .3rem; }
footer a { color: var(--muted); }
ol.resorts { list-style: none; margin: 0; padding: 0; }
ol.resorts li { padding: .6rem 0; border-top: 1px solid var(--line); }
ol.resorts li:first-child { border-top: 0; }
ol.resorts a { font-weight: 700; font-size: 1.05rem; }
.share { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: .35rem; background: var(--line); max-width: 36rem; }
.share i { display: block; height: 100%; }
main.legal button { border: 1px solid var(--line); background: var(--card); color: var(--text); padding: .5rem .9rem; border-radius: 8px; cursor: pointer; font: inherit; margin: 0 .4rem .4rem 0; }
