:root {
  --bg: #f3f5f9; --card: #fff; --text: #1b2230; --muted: #667085; --line: #e3e7ee;
  --brand: #1f5eff; --brand-ink: #fff; --ok: #12805c; --warn: #b54708; --bad: #c4320a;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f131a; --card: #171c25; --text: #e7eaf0; --muted: #98a2b3; --line: #2a3140; --brand: #5b8cff; --shadow: none; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
main { max-width: 1200px; margin: 0 auto; padding: 16px; padding-bottom: 80px; }
h1 { font-size: 22px; margin: 4px 0 16px; } h2 { font-size: 17px; margin: 0 0 12px; }
.top { position: sticky; top: 0; z-index: 10; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; }
nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; }
nav a.on { background: var(--brand); color: var(--brand-ink); }
.who { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.narrow { max-width: 520px; margin: 0 auto; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 140px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
label > input, label > select, label > textarea { margin-top: 4px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit;
  background: var(--bg); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.big { width: 100%; padding: 16px; font-size: 18px; border-radius: 14px; }
button.small { padding: 5px 10px; font-size: 13px; }
button.link { border: 0; background: none; color: var(--brand); padding: 0; font-weight: 500; }
button:disabled { opacity: .5; cursor: default; }
.inline { display: flex; gap: 8px; } .inline > input { flex: 1; } .inline > button { flex: 0 0 auto; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 4px 0 10px; }
.seg label { flex: 1; margin: 0; text-align: center; }
.seg input { display: none; }
.seg span { display: block; padding: 10px; color: var(--text); font-size: 15px; }
.seg input:checked + span { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.stat { font-size: 13px; color: var(--muted); } .stat b { display: block; font-size: 24px; color: var(--text); }
.live { text-align: center; }
.live .km { font-size: 64px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.live .unit { font-size: 20px; color: var(--muted); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg); border: 1px solid var(--line); }
.pill.biz { color: var(--brand); } .pill.priv { color: var(--warn); } .pill.act { color: var(--ok); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.on { background: var(--ok); animation: pulse 1.6s infinite; } .dot.bad { background: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--bg); }
.alert { padding: 10px 12px; border-radius: 10px; background: rgba(181,71,8,.1); color: var(--warn); margin-bottom: 12px; font-size: 14px; }
.alert.info { background: rgba(31,94,255,.08); color: var(--brand); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #1b2230; color: #fff;
  padding: 12px 18px; border-radius: 12px; z-index: 100; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.err { background: var(--bad); }
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 640px; width: calc(100% - 24px); background: var(--card); color: var(--text); }
dialog::backdrop { background: rgba(10,14,20,.5); }
dialog form { padding: 20px; max-height: 90vh; overflow: auto; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.map { height: 280px; border-radius: 10px; margin: 8px 0 12px; }
.history { font-size: 13px; color: var(--muted); } .history div { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.login { max-width: 380px; margin: 10vh auto; }
@media (max-width: 640px) {
  main { padding: 12px; } .hide-m { display: none; } .live .km { font-size: 56px; }
  .top { padding: 8px 12px; gap: 6px; }
  .brand { flex: 1; }
  nav { order: 3; flex: 0 0 100%; gap: 4px; }
  nav a { white-space: nowrap; padding: 5px 10px; font-size: 14px; }
}
tr.void td { color: var(--muted); text-decoration: line-through; }
tr.void td:last-child { text-decoration: none; }
.photo { display: block; border: 2px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center; color: var(--text); font-weight: 600; cursor: pointer; }
.photo input { margin-top: 8px; }
.rcpt-prev { max-width: 100%; max-height: 260px; border-radius: 10px; margin: 0 auto 12px; display: block; }
.rcpt-prev[hidden] { display: none; }
[hidden] { display: none !important; }

/* ---------------- 0.4: vodičovské UI (nástenka, nová jazda, karty, spodná lišta) ---------------- */
:root { --blue: #3b82f6; --blue-bg: rgba(59,130,246,.12); --green: #22a06b; --red: #e5484d; --chip: #e9eef8; }
@media (prefers-color-scheme: dark) { :root { --bg: #111318; --card: #1c1f26; --line: #343944; --blue-bg: rgba(59,130,246,.16); --chip: #2a2f39; } }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: -4px; }
.ic.big { width: 30px; height: 30px; }
.blue { color: var(--blue); } .green { color: var(--green); } .red { color: var(--red); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; background: none; color: var(--text); border-radius: 10px; cursor: pointer; }
.iconbtn .ic { width: 24px; height: 24px; }
.iconbtn:hover { background: var(--bg); }
.iconbtn.spin .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.who { display: flex; align-items: center; gap: 4px; }

.hello { font-size: 30px; font-weight: 500; margin: 8px 0 2px; }
.company { display: flex; align-items: center; gap: 10px; margin: 16px 0; padding: 12px 16px; border-radius: 14px; background: var(--chip); border: 1px solid var(--line); font-weight: 600; letter-spacing: .02em; }
.newtrip { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 20px; padding: 26px; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: 24px; font-weight: 600; text-decoration: none; box-shadow: 0 8px 24px rgba(59,130,246,.3); }
.newtrip .ic { width: 30px; height: 30px; }
.badge { position: absolute; right: -6px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: var(--red);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 26px; box-shadow: 0 4px 12px rgba(0,0,0,.3); }

.tcard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; cursor: pointer; }
.tcard.void { opacity: .55; }
.tc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tc-title { flex: 1; } .tc-title b { font-size: 18px; }
.ic-box { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: var(--blue-bg); color: var(--blue); flex: 0 0 auto; }
.ic-box.priv { background: rgba(181,71,8,.12); color: var(--warn); }
.ic-box .ic { width: 24px; height: 24px; }
.tc-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; flex-wrap: wrap; }
.tc-row .muted .ic { width: 16px; height: 16px; }

.pagehead { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; }
.pagehead h1 { margin: 0; font-weight: 500; font-size: 26px; flex: 0 1 auto; }
.pagehead .back { color: var(--text); display: inline-flex; padding: 6px; }
.pagehead .back .ic { width: 28px; height: 28px; }
.typechip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--blue); border-color: var(--blue); color: #fff; font-size: 14px; }
.typechip.priv { background: var(--warn); border-color: var(--warn); }
.typechip:disabled { opacity: 1; cursor: default; }
.typechip .ic { width: 16px; height: 16px; }
.lbl { font-weight: 600; margin: 14px 0 8px; }

.vcard { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; padding: 16px; margin-bottom: 12px; border-radius: 18px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text); font-weight: 400; }
.vcard .ic-box { width: 64px; height: 64px; border-radius: 14px; background: #f1f3f6; }
.vcard .ic-box .ic { width: 34px; height: 34px; }
.vc-body { flex: 1; display: flex; flex-direction: column; gap: 3px; color: var(--muted); }
.vc-body b { color: var(--text); font-size: 18px; }
.vc-body .red, .vc-body .green { font-weight: 600; font-size: 13px; letter-spacing: .03em; }
.vc-body .ic { width: 16px; height: 16px; }
.vcard.locked { opacity: .55; border-color: var(--red); background: color-mix(in srgb, var(--card) 70%, #888); }
.vcard.sel { border: 2px solid var(--blue); background: var(--blue-bg); padding: 10px 14px; }
.vcard.sel .ic-box { width: 46px; height: 46px; background: var(--blue); color: #fff; }

.checkcard { border: 2px solid var(--blue); background: var(--blue-bg); border-radius: 18px; padding: 16px 20px; margin: 18px 0; color: var(--blue); }
.ck-title { font-weight: 800; font-size: 19px; letter-spacing: .06em; display: flex; align-items: center; gap: 10px; }
.ck-title .ic { width: 26px; height: 26px; fill: var(--blue); stroke: #fff; }
.ck-sub { margin: 10px 0 8px; font-weight: 600; }
.odo { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 10px; padding: 10px 16px; border-radius: 12px; border: 3px solid #555;
  background: repeating-linear-gradient(90deg, #15171c 0 14px, #1d2026 14px 18px); color: #fff; }
.odo .ic { width: 26px; height: 26px; }
.odo input { width: 6.4ch; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; font-size: 34px; font-weight: 800; text-align: right; letter-spacing: .04em; }
.odo input:focus { outline: none; }
.odo span { font-size: 34px; font-weight: 800; color: #fff; }
.checkcard .small { color: var(--muted); }

.rowbox { display: flex; align-items: center; gap: 10px; padding: 16px; border: 1.5px solid var(--line); border-radius: 14px; color: var(--muted); }
.rowbox b { color: var(--text); font-size: 17px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.placebox { position: relative; min-height: 110px; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; background: var(--card); }
.placebox.info { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); }
.placebox .iconbtn { position: absolute; top: 4px; right: 4px; color: inherit; }
.placebox textarea { border: 0; background: transparent; padding: 2px 40px 0 0; resize: none; min-height: 84px; color: var(--text); }
.placebox textarea:focus { outline: none; }
.pb-text { margin-top: 6px; line-height: 1.5; }
.bigin { font-size: 18px; padding: 16px; border-radius: 14px; }
.startbtn { width: 100%; margin: 22px 0 8px; padding: 20px; border-radius: 999px; border: 0; background: var(--blue); color: #fff; font-size: 22px; font-weight: 700; letter-spacing: .04em;
  display: flex; align-items: center; justify-content: center; gap: 12px; }
.startbtn .ic { fill: currentColor; width: 24px; height: 24px; }
.startbtn:disabled { background: var(--chip); color: var(--muted); opacity: 1; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: none; justify-content: space-around; background: var(--card);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 8px; color: var(--muted); text-decoration: none; font-size: 12px; min-width: 64px; }
.tabbar a .ic { width: 26px; height: 26px; }
.tabbar a.on { color: var(--blue); }
.subnav { display: none; }
.mob { display: none; }
@media (max-width: 768px) {
  .tabbar { display: flex; } .tabbar[hidden] { display: none !important; }
  main { padding-bottom: 96px; }
  #nav, #who { display: none; }
  .top { position: sticky; }
  .subnav:not(:empty) { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
  .subnav a { white-space: nowrap; padding: 5px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 14px; }
  .subnav a.on { background: var(--blue); color: #fff; }
  .mob { display: block; } .desk { display: none; }
  .odo input, .odo span { font-size: 30px; }
}
.tabbar a, .tabbar a.on { background: none; border-radius: 0; font-weight: 500; }
.tabbar a.on { color: var(--blue); }
.odo input { text-align: center; }
@media (max-width: 400px) { .placebox { min-height: 120px; font-size: 14px; } .odo input, .odo span { font-size: 28px; } }
