:root {
  --bg: #f4f1ea;
  --ink: #14213d;
  --muted: #5c6475;
  --card: #fff;
  --accent: #e63946;
  --line: #e2ddd3;
  --ok: #2a9d8f;
  --warn: #f4a261;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 64px; }
a { color: var(--ink); }
h1 { font-size: 1.6rem; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
code { background: #eee; padding: 1px 4px; border-radius: 4px; }

.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: var(--ink); color: #fff;
}
.top a, .top .link { color: #fff; }
.brand { font-weight: 700; text-decoration: none; }
.inline { display: inline; margin: 0; }

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  margin: 0 0 16px;
  box-shadow: 0 1px 6px rgba(20, 33, 61, .07);
}
.card.narrow { max-width: 380px; margin: 40px auto; }
.card.warn { border-left: 4px solid var(--warn); }
.card.row { display: flex; gap: 8px; }
.card.row input { flex: 1; min-width: 0; }

label { display: block; margin: 0 0 12px; font-weight: 600; }
label small { display: block; font-weight: 400; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
input[type=text], input[type=password], input[type=tel], input[type=number], textarea, select {
  display: block; width: 100%;
  margin-top: 4px;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
textarea { min-height: 90px; resize: vertical; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  font: inherit; font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--accent); }
button.link { background: none; border: 0; min-height: 0; padding: 0; font-weight: 400; text-decoration: underline; }
button:disabled { opacity: .35; cursor: default; }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: .9rem; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.flash { padding: 10px 14px; border-radius: 10px; background: #dff3ef; }
.flash.error, .error { color: var(--accent); }
.flash.error { background: #fde7e9; }
.muted { color: var(--muted); }
.badge { background: #ffd166; padding: 1px 6px; border-radius: 6px; font-size: .8rem; color: var(--ink); }

.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.list .title { font-weight: 700; flex: 1; text-decoration: none; }

.stops { list-style: none; padding: 0; margin: 0 0 16px; counter-reset: s; }
.stops li {
  counter-increment: s;
  display: flex; gap: 8px; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.stops li::before {
  content: counter(s);
  min-width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; border-radius: 50%;
  font-size: .85rem; font-weight: 700;
}
.stops li.current { background: #fff7d6; }
.stop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stop-main .title { font-weight: 700; text-decoration: none; }
.stop-tools { display: flex; gap: 4px; }
.stop-tools form { margin: 0; }
.stop-tools button { min-width: 40px; padding: 4px 8px; }
.type { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.type-task { color: var(--accent); }
.type-transit { color: var(--ok); }

#qr svg { width: 220px; height: 220px; display: block; }
.danger-zone { background: transparent; box-shadow: none; padding: 0; }

.map { height: 320px; border-radius: 10px; margin: 4px 0 8px; }
.coords { display: flex; gap: 8px; }
.coords label { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chips button { min-height: 36px; padding: 4px 12px; }
.chips button.on { background: var(--ink); color: #fff; }

@media (max-width: 520px) {
  .card.row { flex-direction: column; }
}

/* Sledování */
.btn.block { width: 100%; margin-bottom: 6px; }
.small { font-size: .85rem; }
.pre { white-space: pre-line; }
.help-panel { background: var(--accent); color: #fff; animation: pulse 1.2s ease-in-out infinite alternate; }
.help-panel h2 { margin: 0 0 4px; }
.help-panel p { margin: 0; }
@keyframes pulse { from { opacity: 1; } to { opacity: .8; } }
.status-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.phase { font-weight: 700; font-size: 1.1rem; }
#stopTitle { margin-top: 8px; }
.admin-tajenka { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0; }
.admin-tajenka span {
  width: 26px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: #ffd166; font-weight: 800; border-radius: 6px;
}
.admin-tajenka span.gap { background: transparent; width: 10px; }
.events { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.events li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.events .t { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }
.events .ev-help { color: var(--accent); font-weight: 700; }
.events .ev-wrong { color: var(--muted); }
