/* Vzhled mapy Baťova kanálu – čistý firemní styl (přebíjí pixelový style.css jen na této stránce) */
body.kanal {
  --bg: #ffffff;
  --bg-2: #f4f6f9;
  --bg-3: #eaf0f6;
  --fg: #16212e;
  --muted: #5f6d7d;
  --line: #dfe5ec;
  --ink: #f4f6f9;
  --accent: #0b5cad;
  --accent-2: #0b5cad;
  --accent-fg: #ffffff;
  --brand: #0b3d6e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 33, 54, .06), 0 8px 28px rgba(16, 33, 54, .16);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
  background: #dfe4e8;
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- boxy a tlačítka ---------- */
.kanal .px-box { background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(16, 33, 54, .06); }
.kanal .px-btn {
  font: inherit; font-weight: 500; color: var(--fg); background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px; box-shadow: 0 1px 2px rgba(16, 33, 54, .05);
  transition: background-color .15s, border-color .15s, color .15s;
}
.kanal .px-btn:hover { background: var(--bg-2); border-color: #cdd6e0; }
.kanal .px-btn:active { transform: none; box-shadow: none; background: var(--bg-3); }
.kanal .px-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kanal .px-btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.kanal .px-btn.accent:hover { background: #094d91; border-color: #094d91; }
.kanal .px-btn.sq { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; color: var(--muted); }
.kanal .px-btn.sq:hover { color: var(--fg); }

.si { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.kanal .px-btn.sq .si { width: 18px; height: 18px; }

/* ---------- panel ---------- */
.kanal .panel { width: 360px; overflow: hidden; transition: transform .25s ease, opacity .25s ease; }
.kanal .panel-toggle { width: 44px; height: 44px; padding: 0; border-radius: 10px; box-shadow: var(--shadow); }
.kanal .panel-toggle.collapsed { color: var(--brand); }

.kanal .panel-head { padding: 14px 14px 14px 16px; background: var(--brand); color: #fff; gap: 10px; }
.kanal .panel-head h1 { display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.kanal .brand-mark {
  width: 36px; height: 36px; border-radius: 9px; background: rgba(255, 255, 255, .14);
  display: grid; place-items: center; flex: none;
}
.kanal .brand-mark svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kanal .brand-text small { display: block; font-size: 12px; font-weight: 400; color: rgba(255, 255, 255, .72); letter-spacing: 0; }
.kanal .panel-head .px-btn.sq { background: transparent; border-color: transparent; box-shadow: none; color: rgba(255, 255, 255, .8); }
.kanal .panel-head .px-btn.sq:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.kanal .panel-head .px-btn:focus-visible { outline-color: #fff; }

.kanal .tabs { grid-template-columns: repeat(5, 1fr); gap: 0; padding: 0 6px; border-bottom: 1px solid var(--line); background: #fff; }
.kanal .tabs button {
  font: inherit; font-size: 12px; font-weight: 500; color: var(--muted); background: transparent; box-shadow: none;
  padding: 10px 2px 9px; gap: 4px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.kanal .tabs button:hover { background: transparent; color: var(--fg); }
.kanal .tabs button.on { background: transparent; color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.kanal .tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }

.kanal .panes { padding: 4px 16px 16px; }
.kanal h2 { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; color: var(--muted); margin: 18px 0 8px; }
.kanal .pane > h2:first-child { margin-top: 14px; }
.kanal .hint { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.sub.top { margin: 14px 0 0; padding: 10px 12px; background: var(--bg-2); border-radius: 8px; color: var(--fg); font-size: 13px; }
.sub.top + h2 { margin-top: 18px; }

/* ---------- seznamy zastávek a lodí ---------- */
.stops { list-style: none; margin: 0 -8px; padding: 0; }
.stops li {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px;
  padding: 7px 8px; cursor: pointer; position: relative; border-radius: 8px;
}
.stops li + li { margin-top: 1px; }
.stops li:hover, .stops li:focus-visible { background: var(--bg-2); outline: 0; }
.stops li:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.stop-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c); }
.stop-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stops li .nm { line-height: 1.25; font-weight: 500; min-width: 0; }
.stops li .nm small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 1px; }
.stops li .km { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; }
.stops li.lock .nm { color: var(--fg); }
#lock-list li .km { font-weight: 500; color: var(--muted); background: var(--bg-2); padding: 2px 8px; border-radius: 999px; font-size: 11.5px; }
.stops li.plan { opacity: .55; }
.stops li.branch::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: #c3cdd8;
}

.boat-list li { grid-template-columns: 40px 1fr auto; }
.boat-ico { display: grid; place-items: center start; }
.boat-ico svg { display: block; }
.boat-list li.on { background: var(--bg-3); box-shadow: inset 3px 0 0 var(--accent); }
.boat-list .km { font-size: 11.5px !important; font-weight: 500 !important; padding: 2px 8px; border-radius: 999px; background: #e6f4ea; color: #1e7a3c !important; }
.boat-list .km.moor { background: var(--bg-2); color: var(--muted) !important; }
.boat-list .km.lock { background: #fdf0e6; color: #b5541e !important; }
.boat-legend { display: grid; gap: 8px; font-size: 13px; color: var(--fg); }
.boat-legend span { display: flex; align-items: center; gap: 10px; }
.boat-legend .boat-ico { width: 40px; }

/* ---------- formuláře a ovládání ---------- */
.field { display: grid; gap: 5px; margin-top: 10px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.field select {
  font: inherit; font-size: 14px; color: var(--fg); background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 10px;
}
.field select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 92, 173, .15); }

.kanal .seg { gap: 2px; background: var(--bg-2); padding: 3px; border-radius: 9px; }
.kanal .seg button { font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); padding: 6px 2px; border-radius: 7px; }
.kanal .seg button:hover { color: var(--fg); }
.kanal .seg button.on { background: #fff; color: var(--fg); box-shadow: 0 1px 3px rgba(16, 33, 54, .14); }

.kanal .row { gap: 10px; margin-top: 10px; font-size: 14px; }
.kanal .row output { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.kanal input[type="checkbox"] {
  appearance: none; width: 34px; height: 20px; border-radius: 999px; background: #cdd5de; box-shadow: none;
  position: relative; flex: none; transition: background-color .15s; display: block;
}
.kanal input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s;
}
.kanal input[type="checkbox"]:checked { background: var(--accent); box-shadow: none; }
.kanal input[type="checkbox"]:checked::after { width: 16px; height: 16px; background: #fff; transform: translateX(14px); }
.kanal input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kanal .btn-row { gap: 6px; }
.kanal .btn-row .px-btn { padding: 8px 4px; font-size: 13px; }

/* ---------- plánovač a simulace ---------- */
.plan-out { margin-top: 14px; }
.plan-out .big { display: flex; gap: 8px; }
.plan-out .big div { flex: 1; background: var(--bg-2); padding: 9px 11px; border-radius: 8px; }
.plan-out .big small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.plan-out .big b { font-size: 16px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-out ol { margin: 12px 0 0; padding-left: 20px; font-size: 13.5px; }
.plan-out ol li { margin: 3px 0; }
.plan-out ol li small { color: var(--muted); }
.plan-out .px-btn { margin-top: 12px; }

.clock { display: flex; justify-content: space-between; align-items: center; background: var(--brand); color: #fff; padding: 10px 14px; margin-bottom: 10px; border-radius: 10px; }
.clock span { color: rgba(255, 255, 255, .75); font-size: 12.5px; font-weight: 500; }
.clock b { font-size: 22px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.boat-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.boat-stats div { background: var(--bg-2); padding: 8px; text-align: center; border-radius: 8px; }
.boat-stats b { display: block; font-size: 19px; font-weight: 700; color: var(--brand); }
.boat-stats small { color: var(--muted); font-size: 11.5px; }
.follow-btn { margin-top: 12px; }

/* ---------- plovoucí štítek a dialog ---------- */
.follow-chip {
  position: absolute; z-index: 4; left: 50%; transform: translateX(-50%);
  top: max(14px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px;
  white-space: nowrap; max-width: calc(100vw - 32px); border-radius: 999px !important; font-size: 13.5px;
}
.follow-chip[hidden] { display: none; }
.follow-chip span { overflow: hidden; text-overflow: ellipsis; }
.follow-chip b { color: var(--brand); }
.follow-chip .px-btn.sq { border-radius: 50%; width: 30px; height: 30px; }

.kanal .dialog { padding: 24px 26px; border: 0; }
.kanal .dialog::backdrop { background: rgba(16, 33, 54, .45); backdrop-filter: blur(2px); }
.kanal .dialog h2 { font-size: 19px; font-weight: 700; color: var(--brand); }
.kanal .sources li { margin-bottom: 6px; }
.kanal a { color: var(--accent); }

/* ---------- mapové prvky ---------- */
.kanal .maplibregl-ctrl-group { border-radius: 8px !important; box-shadow: var(--shadow) !important; overflow: hidden; }
.kanal .maplibregl-popup-content {
  background: #fff; color: var(--fg); border-radius: var(--radius); padding: 14px 16px; font: 13.5px/1.45 var(--font);
  box-shadow: var(--shadow); min-width: 230px;
}
.kanal .maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #fff; }
.kanal .maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: #fff; }
.kanal .maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: #fff; }
.kanal .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: #fff; }
.kanal .maplibregl-popup-close-button { font-family: var(--font); color: var(--muted); font-size: 20px; padding: 2px 8px; border-radius: 0 var(--radius) 0 8px; }
.kanal .maplibregl-popup-close-button:hover { background: var(--bg-2); }
.kanal .pop h3 { font-size: 16px; font-weight: 700; color: var(--brand); }
.kanal .pop .kind { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kanal .pop dl { font-size: 13px; gap: 4px 12px; }
.pop .state { margin-top: 10px; padding: 7px 10px; background: var(--bg-2); border-radius: 8px; font-size: 13px; }
.pop .state b { color: var(--brand); }
.pop .px-btn { margin-top: 12px; font-size: 13.5px; padding: 8px 10px; }
.pop .note { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

@media (max-width: 640px) {
  .kanal .panel { border-radius: 16px 16px 0 0; }
  .kanal .tabs button { font-size: 11px; }
  .follow-chip { top: auto; bottom: calc(18px + env(safe-area-inset-bottom)); }
}

/* Google podklad: logo a copyright (podmínka Map Tiles API) */
.g-attrib {
  display: flex; align-items: center; gap: 6px; clear: both;
  font: 11px/1.3 system-ui, sans-serif; color: #fff; text-shadow: 0 0 2px #000, 0 0 3px #000;
  pointer-events: none;
}
.g-attrib[hidden] { display: none; }
.g-attrib .g-logo { font: 600 15px/1 Arial, sans-serif; letter-spacing: -.02em; }
.g-attrib .g-copy:empty { display: none; }
