:root {
  --snow: #f2f6fa;
  --snow-2: #e3eaf2;
  --ice: #c9d6e4;
  --ink: #14233a;
  --ink-2: #4a5a72;
  --ink-3: #7a889c;
  --sun: #ffc628;
  --sun-deep: #e6a400;
  --sky: #5d9be8;
  --sky-deep: #24518f;
  --cloud: #ffffff;
  --blue: #1d6fe0;
  --red: #e0313b;
  --black: #15171c;
  --ok: #2c9d63;
  --warn: #d9821c;
  --card: #ffffff;
  --line: #d7e0ea;
  --shadow: 0 1px 0 rgba(20, 35, 58, .06), 0 8px 24px -12px rgba(20, 35, 58, .25);
  --r-s: 6px;
  --r-m: 10px;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --text: 'Barlow', system-ui, sans-serif;
  --tabs-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--snow);
  color: var(--ink);
  font: 400 16px/1.45 var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun-deep); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: .005em; }

/* ---------- horní lišta ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--ink); color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; font: 700 22px/1 var(--display); }
.brand-mark { width: 30px; height: 30px; color: #fff; }
.beta { font: 700 13px/1 var(--display); color: var(--ink); background: var(--sun); padding: 3px 5px 4px; border-radius: 4px; letter-spacing: .03em; align-self: flex-start; margin-top: 2px; }
.seg { display: flex; background: rgba(255,255,255,.1); border-radius: var(--r-s); padding: 3px; }
.seg button {
  border: 0; background: none; color: #cfd9e6; padding: 7px 10px; border-radius: 4px;
  font: 600 15px/1 var(--display); letter-spacing: .02em; min-height: 34px;
}
.seg button[aria-selected="true"] { background: var(--sun); color: var(--ink); }

main { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
.view { max-width: 1180px; margin: 0 auto; }

/* ---------- spodní menu ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--line);
}
.tabs button {
  border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); font: 600 14px/1 var(--display); letter-spacing: .02em;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--ink); }
.tabs button[aria-current="page"] svg { stroke: var(--ink); fill: var(--sun); }
.tabs button[aria-current="page"] svg path:only-child { fill: none; }

/* ---------- doporučení ---------- */
.region-switch { display: flex; gap: 8px; padding: 14px 16px 0; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-s);
  padding: 7px 12px; font: 600 16px/1 var(--display); color: var(--ink-2); min-height: 38px;
}
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }

.hero {
  margin: 14px 16px 0; border-radius: var(--r-m); overflow: hidden; background: var(--card); box-shadow: var(--shadow);
  min-width: 0;
}
.hero-art { position: relative; aspect-ratio: 16 / 10; }
.hero-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-tag {
  position: absolute; left: 14px; top: 12px; background: var(--sun); color: var(--ink);
  font: 700 15px/1 var(--display); padding: 6px 9px; border-radius: 4px; letter-spacing: .02em;
}
.hero-body { padding: 14px 16px 16px; }
.hero h1 { font-size: clamp(34px, 9vw, 52px); }
.hero .where { color: var(--ink-2); margin: 2px 0 10px; font-weight: 500; }
.verdict { font: 600 20px/1.2 var(--display); margin: 0 0 4px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: 15px; margin: 6px 0 12px; padding: 0; list-style: none; }
.facts li { display: flex; align-items: center; gap: 5px; }
.facts .warn { color: var(--warn); font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  border: 0; border-radius: var(--r-s); padding: 12px 16px; min-height: 48px;
  font: 700 18px/1 var(--display); letter-spacing: .02em; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--sky-deep); }
.btn-ghost { background: var(--snow-2); color: var(--ink); }
.btn-ghost:hover { background: var(--ice); }
.btn svg { width: 20px; height: 20px; }

.hours { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; margin: 4px 0 14px; }
.hour {
  border: 0; padding: 6px 0 5px; border-radius: 4px; text-align: center; font: 600 14px/1.1 var(--display);
  background: var(--snow-2); color: var(--ink);
}
.hour .hi { display: block; height: 18px; margin-top: 3px; color: #6b7c93; }
.hour .hi svg { display: block; margin: 0 auto; }
.hour[aria-pressed="true"] { outline: 2.5px solid var(--ink); outline-offset: -2.5px; }

.k-sun { background: #ffe28a; }
.k-inversion { background: linear-gradient(180deg, #ffe28a 0 55%, #dfe6ee 55%); }
.k-partly { background: #d6e7fb; }
.k-overcast { background: #cbd5e1; }
.k-fog { background: #e8ecf1; color: var(--ink-3); }
.k-snow { background: #b9c7e8; }

.list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 22px 16px 8px; }
.list-head h2 { font-size: 26px; }
.list-head p { margin: 0; color: var(--ink-3); font-size: 14px; }

.rank { list-style: none; margin: 0; padding: 0 16px 24px; display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center;
  background: var(--card); border-radius: var(--r-m); padding: 10px 12px 10px 10px; box-shadow: var(--shadow);
  border: 0; width: 100%; text-align: left;
}
.row:hover { box-shadow: 0 0 0 2px var(--ice), var(--shadow); }
.row-art { width: 76px; height: 64px; border-radius: var(--r-s); overflow: hidden; }
.row-art svg { width: 100%; height: 100%; display: block; }
.row h3 { font-size: 22px; }
.row .sub { color: var(--ink-3); font-size: 14px; margin: 1px 0 6px; }
.meter { display: flex; align-items: center; gap: 8px; font: 600 15px/1 var(--display); }
.meter .bar { flex: 1; height: 6px; background: var(--snow-2); border-radius: 3px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--sun-deep); border-radius: 3px; }
.mini-hours { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; margin-top: 7px; }
.mini-hours span { height: 7px; border-radius: 2px; }

.note { margin: 0 16px 20px; padding: 12px 14px; border-radius: var(--r-m); background: var(--snow-2); color: var(--ink-2); font-size: 15px; }
.note b { color: var(--ink); }

/* ---------- kamery ---------- */
.cams-wrap { padding: 16px 16px 24px; }
.cams-wrap h2 { font-size: 26px; margin: 4px 0 4px; }
.cams-wrap > p { margin: 0 0 14px; color: var(--ink-3); font-size: 14px; }
.cam-group h3 { font-size: 20px; margin: 18px 0 8px; }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cam { position: relative; border: 0; padding: 0; background: var(--ink); border-radius: var(--r-m); overflow: hidden; aspect-ratio: 783 / 408; }
.cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(10, 20, 35, .78)); display: flex; justify-content: space-between; align-items: end; gap: 8px;
  font: 600 16px/1.1 var(--display);
}
.badge { font: 700 14px/1 var(--display); padding: 5px 7px; border-radius: 4px; background: #fff; color: var(--ink); white-space: nowrap; }
.badge.clear { background: var(--sun); }
.badge.partly { background: #d6e7fb; }
.badge.overcast { background: #cbd5e1; }
.badge.fog, .badge.snowing { background: #e8ecf1; }
.badge.dark, .badge.unknown { background: #6b778a; color: #fff; }
.cam-missing { display: grid; place-items: center; color: #b8c4d4; font-size: 14px; height: 100%; }

.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(8, 15, 28, .92); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: var(--r-m); }
.lb-cap { color: #fff; font: 600 18px/1.2 var(--display); text-align: center; }
.lb-close { position: absolute; top: calc(env(safe-area-inset-top) + 10px); right: 12px; width: 48px; height: 48px; border: 0; border-radius: var(--r-s); background: rgba(255,255,255,.15); color: #fff; font-size: 30px; line-height: 1; }

/* ---------- mapa a trasa ---------- */
#v-map { max-width: none; position: relative; height: calc(100dvh - var(--tabs-h) - env(safe-area-inset-bottom) - 56px - env(safe-area-inset-top)); }
#map { position: absolute; inset: 0; }
.maplibregl-ctrl-top-right { top: 68px !important; }
.map-tools { position: absolute; right: 12px; top: 12px; z-index: 5; display: grid; gap: 8px; }
.maplibregl-ctrl-group button { width: 36px; height: 36px; }
.round { width: 48px; height: 48px; border-radius: var(--r-m); border: 0; background: #fff; box-shadow: var(--shadow); color: var(--ink); display: grid; place-items: center; }
.round svg { width: 26px; height: 26px; }
.round.on { background: var(--blue); color: #fff; }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
  background: #fff; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 30px -12px rgba(20,35,58,.35);
  max-height: 50%; display: flex; flex-direction: column;
}
.sheet.small { max-height: 132px; }
.grip { border: 0; background: none; padding: 8px 0 2px; width: 100%; display: grid; place-items: center; }
.grip::before { content: ''; width: 44px; height: 5px; border-radius: 3px; background: var(--ice); }
.sheet-head { padding: 4px 16px 10px; }
.sheet-head h2 { font-size: 26px; }
.sheet-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }
.sheet-body { overflow: auto; padding: 0 16px 16px; -webkit-overflow-scrolling: touch; }
.sheet select {
  width: 100%; min-height: 46px; border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; background: #fff;
  font: 600 18px/1 var(--display);
}
.avoid { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; align-items: center; }
.avoid span { color: var(--ink-2); font-size: 15px; margin-right: 2px; }
.toggle { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 7px 11px; min-height: 42px; background: #fff; font: 600 16px/1 var(--display); }
.toggle i { width: 10px; height: 14px; border-radius: 2px; display: inline-block; margin-right: -4px; }
.toggle i:last-of-type { margin-right: 2px; }
.toggle[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.from { display: flex; gap: 8px; margin: 10px 0 12px; flex-wrap: wrap; }

.steps { list-style: none; margin: 6px 0 0; padding: 0; position: relative; }
.step { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--snow-2); }
.step:last-child { border-bottom: 0; }
.step .ic { width: 34px; height: 34px; border-radius: var(--r-s); display: grid; place-items: center; color: #fff; }
.step .ic svg { width: 20px; height: 20px; }
.step .ic.lift { background: var(--sun); color: var(--ink); }
.step b { font: 600 18px/1.1 var(--display); display: block; }
.step small { color: var(--ink-3); font-size: 14px; }
.step .t { font: 600 16px/1 var(--display); color: var(--ink-2); }
.step.endpoint .ic { background: var(--ink); }
.total { display: flex; gap: 14px; flex-wrap: wrap; font: 600 18px/1.2 var(--display); margin: 4px 0 6px; }
.alert { background: #fff4dd; border-left: 4px solid var(--warn); padding: 9px 12px; border-radius: 0 var(--r-s) var(--r-s) 0; margin: 8px 0; font-size: 15px; }

.maplibregl-popup-content { font: 500 15px/1.3 var(--text); border-radius: var(--r-s); padding: 9px 12px; }
.maplibregl-popup-content b { font: 600 18px/1.1 var(--display); display: block; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(29,111,224,.25); }
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--ink); border: 3px solid #fff; box-shadow: var(--shadow); }
.pin.end { background: var(--sun); }

/* ---------- ubytování ---------- */
.set-wrap { padding: 18px 16px 30px; max-width: 640px; }
.set-wrap h2 { font-size: 30px; margin-bottom: 4px; }
.set-wrap > p { color: var(--ink-2); margin: 0 0 16px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font: 600 17px/1 var(--display); }
.field-row { display: flex; gap: 8px; }
.field input { flex: 1; min-width: 0; min-height: 48px; border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; background: #fff; font-size: 17px; }
.field input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(255,198,40,.6); }
.results { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.results button { width: 100%; text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-s); padding: 10px 12px; font-size: 15px; }
.results button:hover { border-color: var(--ink); }
.saved { background: #fff; border-radius: var(--r-m); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 16px; }
.saved b { font: 600 20px/1.2 var(--display); display: block; }
.saved small { color: var(--ink-3); }
.muted { color: var(--ink-3); font-size: 14px; }
.or { margin: 6px 0 12px; color: var(--ink-3); font-size: 15px; }

.loading { padding: 40px 16px; color: var(--ink-3); text-align: center; }
.error { margin: 16px; padding: 14px 16px; border-radius: var(--r-m); background: #fde8e8; color: #8b1c1c; }

/* ---------- větší obrazovky ---------- */
@media (min-width: 900px) {
  .top { padding-left: 28px; padding-right: 28px; }
  #v-today.view { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0 24px; padding: 0 12px; align-items: start; }
  #v-today .region-switch, #v-today .note-wide { grid-column: 1 / -1; }
  .hero { position: sticky; top: 76px; }
  .hero-art { aspect-ratio: 16 / 9; }
  .list-head { padding-top: 14px; }
  .sheet { left: 16px; right: auto; bottom: 16px; width: 420px; border-radius: 14px; max-height: calc(100% - 32px); }
  .sheet.small { max-height: 140px; }
  .tabs { left: 50%; right: auto; transform: translateX(-50%); bottom: 14px; width: 520px; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); height: var(--tabs-h); padding: 0; }
  main { padding-bottom: 96px; }
  #v-map { height: calc(100dvh - 60px); }
  #v-map ~ * {}
}

@media (prefers-reduced-motion: no-preference) {
  .hero-art .sunray { transform-origin: center; animation: spin 60s linear infinite; }
  .row, .btn, .chip, .hour { transition: background-color .15s, box-shadow .15s, color .15s; }
  .sheet { transition: max-height .25s ease; }
  @keyframes spin { to { transform: rotate(360deg); } }
}
