/* Rozmery rozvrzeni. Barvy a pisma dodava themes.css. */
:root {
  --index-w:  296px;
  --detail-w: 400px;
}

/* Turistat — vizuální jazyk
   Motiv: kompoziční pruh. Stejné kódování barev se opakuje ve třech měřítkách —
   4px proužek v rejstříku, koláč na mapě, prstenec v detailu. Barva země tak
   znamená všude totéž a dá se číst bez legendy.                              */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: var(--base-size);
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }

/* ── horní lišta ──────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  height: 54px;
  padding: 0 1.1rem;
  background: var(--topbar-bg);
  color: var(--topbar-fg);
  position: relative;
  z-index: 5;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: 1.05rem;
  letter-spacing: -.005em;
  align-self: center;
}
.tagline {
  font-size: .8rem;
  color: var(--topbar-dim);
  align-self: center;
}
.controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.field {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  color: var(--topbar-dim);
}
.field select {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius);
  padding: .25rem .45rem;
  font-size: .82rem;
  color: var(--surface-3);
}
.field select option { color: var(--ink); background: var(--surface); }
.slider { display: flex; align-items: center; gap: .5rem; }
.slider input { width: 96px; accent-color: var(--signal); }
.slider output { font-size: .78rem; color: var(--surface-3); }

/* ── rozvržení ────────────────────────────────────────────────────────── */
main {
  position: relative;
  display: grid;
  grid-template-columns: var(--index-w) 1fr;
  height: calc(100% - 54px - 30px);
}
#map { position: relative; height: 100%; }

/* ── rejstřík ─────────────────────────────────────────────────────────── */
.index {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: var(--rule) solid var(--hairline);
  min-height: 0;
  z-index: 4;
}
.index-head {
  padding: .8rem .9rem .6rem;
  border-bottom: var(--rule) solid var(--hairline);
}
#q::placeholder { color: var(--muted); }
.sortrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .55rem;
  font-size: .76rem;
  color: var(--muted);
}
.sortrow select {
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: .76rem;
  padding: 0;
}

.rows { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.rows li {
  padding: .62rem .9rem .55rem;
  border-bottom: var(--rule) solid var(--hairline);
  cursor: pointer;
}
.rows li:hover { background: var(--surface-2); }
.rows li[aria-current="true"] {
  background: var(--surface-3);
  box-shadow: inset 3px 0 0 var(--ink);
}
.row-top {
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.row-name {
  font-weight: 450;
  font-size: .89rem;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-conf {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--muted);
  flex: 0 0 auto;
}
.row-sub {
  font-size: .74rem;
  color: var(--muted);
  margin-top: .1rem;
}
/* kompoziční pruh — základní motiv celého rozhraní */
.strip {
  display: flex;
  height: 4px;
  margin-top: .42rem;
  overflow: hidden;
}
.strip i { display: block; height: 100%; }
.strip[data-conf="low"] { opacity: .42; }
.strip[data-conf="mid"] { opacity: .72; }

/* ── mapové značky ────────────────────────────────────────────────────── */
.pin { cursor: pointer; line-height: 0; }
.pin svg { filter: drop-shadow(0 1px 2.5px rgba(18,35,43,.4)); }
.pin[data-conf="low"] { opacity: .45; }
.pin[data-conf="mid"] { opacity: .78; }
.pin[data-active="true"] { z-index: 1; }
.pin[data-active="true"] svg { filter: drop-shadow(0 0 4px var(--ink)) drop-shadow(0 0 8px var(--ink)) drop-shadow(0 2px 4px rgba(18,35,43,.5)); }

/* ── detail ───────────────────────────────────────────────────────────── */
.detail {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: var(--detail-w);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-left: var(--rule) solid var(--hairline);
  padding: 1.5rem 1.6rem 3rem;
  z-index: 4;
}
.close {
  position: absolute; top: .7rem; right: .9rem;
  border: 0; background: none; cursor: pointer;
  font-size: .95rem; color: var(--muted); padding: .2rem .3rem;
}
.crumb { margin: 0; font-size: .76rem; color: var(--muted); }
.detail h2 {
  margin: .15rem 0 .3rem;
  font-family: var(--font-display);
  font-size: 1.42rem;
  font-weight: var(--display-weight);
  line-height: 1.18;
  letter-spacing: var(--display-tracking);
}
.facts { margin: 0 0 1.15rem; font-size: .8rem; color: var(--muted); }

.confidence {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .6rem .75rem;
  background: var(--tint);
  border-left: 3px solid var(--signal);
  font-size: .8rem;
  line-height: 1.45;
}
.meter { display: flex; gap: 2px; padding-top: .28rem; flex: 0 0 auto; }
.meter i {
  width: 5px; height: 13px;
  background: var(--hairline);
}
.meter i.on { background: var(--signal); }
.confidence b { font-weight: 600; }

.block { margin-top: 1.85rem; }
.block h3 {
  margin: 0 0 .75rem;
  padding-bottom: .32rem;
  border-bottom: var(--rule) solid var(--hairline);
  font-size: .8rem;
  font-weight: 600;
}
.donutrow { display: flex; gap: 1.1rem; align-items: flex-start; }
.donutrow > div { flex: 0 0 auto; }

table.shares, table.sources {
  width: 100%;
  border-collapse: collapse;
  font-size: .81rem;
}
table.shares td { padding: .16rem 0; vertical-align: middle; }
table.shares td.sw { width: 14px; }
table.shares td.sw i { display: block; width: 9px; height: 9px; }
table.shares td.v {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

table.sources { font-size: .77rem; color: var(--ink-soft); }
table.sources td { padding: .3rem 0; border-bottom: 1px dotted var(--hairline); }
table.sources td.w { text-align: right; font-family: var(--font-mono); color: var(--muted); }

/* vodorovné pruhy pro věk a typ cesty */
.bars { display: grid; gap: .38rem; }
.bar {
  display: grid;
  grid-template-columns: 62px 1fr 44px;
  align-items: center;
  gap: .55rem;
  font-size: .79rem;
}
.bar .track { height: 12px; background: var(--track); }
.bar .fill { display: block; height: 100%; background: var(--ink-soft); }
.bar .v { text-align: right; font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }

/* odchylka od průměru destinace — nulová osa uprostřed */
.delta { display: grid; gap: .34rem; }
.dline {
  display: grid;
  grid-template-columns: 62px 1fr 52px;
  align-items: center;
  gap: .55rem;
  font-size: .79rem;
}
.axis { position: relative; height: 13px; background: linear-gradient(90deg,var(--track),var(--track)); }
.axis::before {
  content: ""; position: absolute; left: 50%; top: -1px; bottom: -1px;
  width: 1px; background: var(--hairline);
}
.axis i { position: absolute; top: 2px; height: 9px; }
.dline .v { text-align: right; font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }

.empty { font-size: .8rem; color: var(--muted); margin: 0; }

.loader {
  position: absolute; top: .7rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--surface-3);
  padding: .3rem .7rem; font-size: .76rem; z-index: 6;
}

/* ── patička ──────────────────────────────────────────────────────────── */
.colophon {
  display: flex;
  gap: 1.4rem;
  align-items: center;
  height: 30px;
  padding: 0 1.1rem;
  font-size: .69rem;
  color: var(--muted);
  background: var(--surface);
  border-top: var(--rule) solid var(--hairline);
  overflow: hidden;
  white-space: nowrap;
}

/* ── mobil ────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  main { grid-template-columns: 1fr; }
  .index {
    position: absolute;
    inset: auto 0 0 0;
    height: 44%;
    border-right: 0;
    border-top: var(--rule) solid var(--hairline);
  }
  .detail { width: 100%; top: auto; height: 72%; border-left: 0; border-top: var(--rule) solid var(--hairline); }
  .topbar { flex-wrap: wrap; height: auto; padding: .5rem 1rem .6rem; }
  /* Bez zalomeni prvky pretekaly mimo obrazovku — na uzkych displejich
     se lista sklada do dvou az tri radku. */
  .controls { width: 100%; margin-left: 0; gap: .55rem .9rem; flex-wrap: wrap; }
  .field { flex-wrap: wrap; max-width: 100%; }
  .field select { max-width: 100%; }
  .slider { flex: 1 1 150px; }
  .slider input { flex: 1 1 auto; width: auto; min-width: 90px; }
  .tagline { display: none; }
  .colophon { font-size: .64rem; gap: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ── ikony ────────────────────────────────────────────────────────────── */
.ic {
  width: 1em; height: 1em;
  flex: 0 0 auto;
  vertical-align: -.13em;
}
.ic-lg { width: 1.25em; height: 1.25em; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: var(--rule) solid transparent;
  border-radius: var(--radius);
  background: none; cursor: pointer;
  color: inherit;
}
.iconbtn:hover { background: rgba(127,127,127,.14); }

/* přepínač motivu */
.themes { display: flex; gap: 3px; align-items: center; }
.swatch {
  width: 20px; height: 20px;
  border: var(--rule) solid rgba(255,255,255,.28);
  border-radius: var(--radius);
  cursor: pointer; padding: 0;
  position: relative;
}
.swatch[aria-pressed="true"] { outline: 2px solid var(--topbar-fg); outline-offset: 1px; }

/* ── ceny ─────────────────────────────────────────────────────────────── */
.pricehead {
  display: flex; align-items: baseline; gap: .5rem;
  margin-bottom: .7rem;
}
.pricebig {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 500;
}
.pricenote { font-size: .74rem; color: var(--muted); }

.months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  align-items: end;
  height: 76px;
}
.months .m { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.months .col {
  display: block;
  background: var(--ink-soft);
  min-height: 2px;
}
.months .col.peak { background: var(--signal); }
.months .col.none { background: var(--track); height: 3px; }
.mlabels {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px;
  margin-top: .3rem;
  font-family: var(--font-mono);
  font-size: .6rem; color: var(--muted); text-align: center;
}
.seasons {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; margin-top: .9rem;
  background: var(--hairline);
  border: var(--rule) solid var(--hairline);
}
.seasons div {
  background: var(--surface);
  padding: .45rem .4rem;
  text-align: center;
}
.seasons .lab {
  display: flex; align-items: center; justify-content: center; gap: .25rem;
  font-size: .7rem; color: var(--muted);
}
.seasons .val {
  display: block;
  font-family: var(--font-mono);
  font-size: .92rem;
  margin-top: .15rem;
}

.searchwrap {
  display: flex; align-items: center; gap: .45rem;
  padding: .42rem .55rem;
  border: var(--rule) solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
}
.searchwrap input {
  border: 0; background: none; padding: 0; width: 100%;
  color: var(--ink);
}
.searchwrap input:focus { outline: none; }
.searchwrap:focus-within { outline: 2px solid var(--signal); outline-offset: 1px; }

.block h3 { display: flex; align-items: center; gap: .4rem; }
.block h3 .ic { color: var(--muted); }

/* ── značka ───────────────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  color: inherit;
  align-self: center;
}
.brand .mark {
  width: 26px; height: 26px;
  flex: 0 0 auto;
}
/* Ve výchozích motivech je značka jednobarevná, aby v tmavé liště
   nesoupeřila s daty. Prázdninová linka si ji bere v plné barvě. */
.mark { --brand-1: currentColor; --brand-2: currentColor;
        --brand-3: currentColor; --brand-4: currentColor;
        --brand-pole: currentColor; --brand-paper: var(--topbar-bg); }
[data-theme="riviera"] .mark {
  --brand-1: #4fc2cf; --brand-2: #f2bb63; --brand-3: #e0705f;
  --brand-4: #5fc4a6; --brand-pole: #123a47; --brand-paper: #123a47;
}

.backlink {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .8rem; text-decoration: none;
  color: var(--topbar-dim);
}
.backlink:hover { color: var(--topbar-fg); }
.backlink .ic { transform: rotate(180deg); }
