/* =========================================================================
   mujdaf.cz – vzhled prototypu
   Zásady: velké písmo, kontrast min. 7 : 1, dotykové plochy min. 48 px
   (hlavní tlačítka 64 px), vždy text + ikona, nic se neschovává.
   Světlý vzhled je záměrný – stránka se používá i venku na slunci.
   ========================================================================= */

:root {
  --ink: #0f1b2b;
  --ink-2: #33445a;
  --bg: #ffffff;
  --surface: #f2f5f9;
  --surface-2: #dfe6ef;
  --line: #5f6f85;
  --line-soft: #c3cedb;
  --brand-bg: #0b2a4a;
  --primary: #0b4ea2;
  --primary-hover: #083d80;
  --primary-dark: #08305f;
  --primary-soft: #e4eefb;
  --primary-ink: #ffffff;
  --ok: #0f5e35;
  --ok-hover: #0a4627;
  --ok-soft: #e2f3e9;
  --ok-dark: #0a4026;
  --warn-ink: #5c3a00;
  --warn-soft: #fff3d1;
  --warn-line: #a86f00;
  --danger: #a4161a;
  --danger-dark: #5c0b0e;
  --danger-soft: #fde8e8;
  --focus: #0f1b2b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 27, 43, .08), 0 6px 18px rgba(15, 27, 43, .07);
  color-scheme: light;
}

/* Vysoký kontrast – zapíná se v Pomoci, nebo podle nastavení systému */
:root[data-contrast="high"] {
  --ink: #000;
  --ink-2: #000;
  --line: #000;
  --line-soft: #000;
  --surface: #fff;
  --surface-2: #cfcfcf;
  --brand-bg: #000;
  --primary: #00327a;
  --primary-hover: #001d47;
  --primary-dark: #001d47;
  --primary-soft: #fff;
  --ok: #004d22;
  --ok-hover: #00341a;
  --ok-soft: #fff;
  --ok-dark: #00341a;
  --warn-ink: #000;
  --warn-soft: #fff;
  --warn-line: #000;
  --danger-soft: #fff;
  --shadow: none;
}
:root[data-contrast="high"] a { text-decoration-thickness: 2px; }
:root[data-contrast="high"] .option.is-checked { border-width: 5px; }

/* Velikost písma: 20 px / 23 px / 26 px (v % – respektuje nastavení prohlížeče) */
html { font-size: 125%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[data-size="l"] { font-size: 143.75%; }
html[data-size="xl"] { font-size: 162.5%; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* atribut hidden musí vždy vyhrát nad display: flex */

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: .15em; }
a:hover { color: var(--primary-hover); }

h1 { font-size: 1.5rem; line-height: 1.25; margin: .3rem 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; line-height: 1.3; margin: 1.5rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: 0 0 .8rem; }
ul, ol { margin: 0 0 .8rem; padding-left: 1.3rem; }

.small { font-size: .85rem; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
h1:focus, main:focus { outline: none; }

.ico { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Přeskočit na obsah, pruhy nahoře ---------- */
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: #fff; color: var(--ink); padding: .6rem 1rem; border-radius: 8px; }

.netbar {
  background: var(--ink);
  color: #fff;
  padding: .5rem 16px;
  font-weight: 700;
  font-size: .85rem;
  text-align: center;
}

/* ---------- Horní lišta ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem;
  padding: .45rem 16px;
  background: var(--brand-bg);
  color: #fff;
}
/* Lišta roste s písmem jen mírně (clamp), aby na telefonu nezabrala půl displeje. */
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none;
  font-weight: 800; font-size: clamp(16px, .95rem, 20px); line-height: 1.1;
  min-height: 48px;
}
.brand:hover { color: #fff; }
.brand:focus-visible { outline-color: #fff; }
.brand small { display: block; font-weight: 500; font-size: clamp(12px, .68rem, 14px); opacity: .92; margin-top: .1rem; }
.brand-mark {
  width: clamp(38px, 2.1rem, 46px); height: clamp(38px, 2.1rem, 46px); border-radius: 9px;
  background: #fff; color: var(--brand-bg);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.brand-mark svg { width: 70%; height: 70%; }
.topbar-tools { display: flex; gap: 6px; flex: none; margin-left: auto; }
.tool {
  min-height: 48px; min-width: 48px;
  padding: .25em .6em;
  display: inline-flex; align-items: center; justify-content: center; gap: .35em;
  border: 2px solid rgba(255, 255, 255, .75); border-radius: 10px;
  background: transparent; color: #fff;
  font: inherit; font-size: clamp(15px, .78rem, 18px); font-weight: 700;
  cursor: pointer;
}
.tool:hover { background: rgba(255, 255, 255, .12); }
.tool:focus-visible { outline-color: #fff; }
.tool .ico { width: 1.35em; height: 1.35em; }
.tool-aa { font-weight: 800; font-size: 1em; letter-spacing: -.02em; }
.tool-aa span { font-size: 1.3em; }

/* Úzký telefon: nejdřív zmizí podtitulek, pak text loga. „Pomoc“ zůstává vždy čitelné. */
@media (max-width: 480px) { .brand small { display: none; } }
@media (max-width: 370px) { .brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (max-width: 340px) {
  .topbar { padding-inline: 12px; }
  .topbar-tools { gap: 4px; }
  .tool { padding: .2em .4em; gap: .25em; }
}
@media (max-width: 480px) {
  html[data-size] .brand-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---------- Obsah ---------- */
main { max-width: 38rem; margin: 0 auto; padding: .8rem 16px 2rem; }
body[data-view="wide"] main { max-width: 56rem; }

/* ---------- Tlačítka ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3.2rem;
  padding: .6rem 1.2rem;
  border-radius: var(--radius);
  border: 3px solid transparent;
  font: inherit; font-weight: 800; font-size: 1.05rem; line-height: 1.2;
  text-align: center; text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: var(--ok-hover); color: #fff; }
.btn-secondary { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary-soft); color: var(--primary-hover); }
.btn-block { width: 100%; }
.btn-sm { min-height: 48px; font-size: .9rem; padding: .35rem .9rem; border-width: 2px; border-radius: 11px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.stack { display: grid; gap: .8rem; }

.linkbtn {
  background: none; border: 0; padding: .4rem .2rem; min-height: 44px;
  font: inherit; font-weight: 700; color: var(--primary);
  text-decoration: underline; text-underline-offset: .15em;
  cursor: pointer;
}
.linkbtn.danger { color: var(--danger); }

@media (forced-colors: active) {
  .btn, .option, .tool, .chip, .shot, .tile, .pcard { border-color: ButtonText; }
}

/* ---------- Navigace kroků ---------- */
.stepnav {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin: 0 0 .4rem;
}
.btn-back {
  min-height: 48px;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .8rem .3rem .45rem;
  margin-left: -.45rem;
  background: none; border: 2px solid transparent; border-radius: 10px;
  color: var(--primary);
  font: inherit; font-weight: 800; font-size: 1rem;
  text-decoration: none; cursor: pointer;
}
.btn-back:hover { background: var(--primary-soft); }
.stepcount { font-weight: 700; color: var(--ink-2); font-size: .9rem; white-space: nowrap; }
.progress { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 1rem; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s ease; }
.flowname { font-size: .85rem; font-weight: 700; color: var(--ink-2); margin: 0; }
.hint { color: var(--ink-2); }


/* Spodní lišta s hlavním tlačítkem zůstává vždy na stejném místě */
.actions {
  position: sticky; bottom: 0; z-index: 5;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--bg) 1.2rem);
  padding: 1.4rem 0 calc(.8rem + env(safe-area-inset-bottom));
  margin-top: .8rem;
  pointer-events: none;            /* průhledný přechod nesmí zachytávat dotyky (např. při podpisu) */
}
.actions > * { pointer-events: auto; }
.actions-static { position: static; background: none; padding-top: .4rem; }
.actions .stack { gap: .6rem; }

/* ---------- Formulářová pole ---------- */
.label { display: block; font-weight: 800; margin: 1.1rem 0 .35rem; }
.label:first-child { margin-top: 0; }
.opt { font-weight: 400; color: var(--ink-2); }
.input {
  width: 100%; min-height: 3.2rem;
  padding: .55rem .8rem;
  font: inherit; font-size: 1.15rem; color: var(--ink);
  background: #fff;
  border: 2px solid var(--line); border-radius: 12px;
  -webkit-appearance: none; appearance: none;
}
.input:focus { border-color: var(--primary); }
.input[aria-invalid="true"] { border-color: var(--danger); border-width: 3px; background: var(--danger-soft); }
.input::placeholder { color: #6b7789; }
textarea.input { min-height: 7rem; resize: vertical; line-height: 1.45; }
.input-plate {
  font-size: 1.7rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; text-align: center;
}
.input-big { font-size: 1.7rem; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.input-code {
  font-size: 2.1rem; font-weight: 800; letter-spacing: .55em; text-indent: .55em;
  text-align: center; font-variant-numeric: tabular-nums;
  max-width: 13rem; display: block; margin: 0 auto;
}
.with-unit { display: flex; align-items: center; gap: .6rem; }
.with-unit .unit { font-weight: 800; font-size: 1.3rem; }
.tip {
  display: flex; gap: .6rem; align-items: flex-start;
  font-size: .9rem; color: var(--ink-2);
  margin: .6rem 0 0;
}
.tip .ico { margin-top: .15rem; }
.echo { margin: .7rem 0 0; font-size: 1rem; }
.echo strong { font-size: 1.15rem; }

/* ---------- SPZ jako tabulka ---------- */
.plate {
  display: inline-flex; align-items: stretch;
  height: 2.3em;
  border: 3px solid #111; border-radius: 8px;
  background: #fff; color: #111;
  font-weight: 800; font-size: 1.5rem; line-height: 1;
  overflow: hidden; vertical-align: middle;
}
.plate-eu {
  background: #003399; color: #fff;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 .28em .28em; min-width: 1.8em;
  font-size: .48em; letter-spacing: .02em;
}
.plate-txt {
  display: flex; align-items: center;
  padding: 0 .5em; min-width: 4.6em;
  letter-spacing: .07em; white-space: nowrap;
  font-family: "DIN Alternate", "Arial Narrow", Arial, sans-serif;
}
.plate-sm { font-size: .95rem; border-width: 2px; border-radius: 6px; }
.plate-lg { font-size: 1.7rem; }

/* ---------- Volby (radio / checkbox jako velké karty) ---------- */
.options { border: 0; padding: 0; margin: 0; display: grid; gap: .7rem; min-width: 0; }
.option {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .85rem;
  min-height: 3.6rem; padding: .8rem 1rem;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.option:hover { border-color: var(--primary); }
.option input {
  width: 1.55rem; height: 1.55rem; flex: none; margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.option-text { display: flex; flex-direction: column; flex: 1 1 6rem; min-width: 0; overflow-wrap: break-word; }
.option-text small { font-weight: 400; color: var(--ink-2); font-size: .88rem; line-height: 1.35; margin-top: .1rem; }
.option.is-checked {
  border-color: var(--primary); border-width: 3px;
  background: var(--primary-soft);
  padding: calc(.8rem - 1px) calc(1rem - 1px);
}
.option-ok.is-checked { border-color: var(--ok); background: var(--ok-soft); }

/* Ukazatel paliva */
.gauge {
  display: inline-grid; grid-template-columns: repeat(4, clamp(12px, .85rem, 16px)); gap: 3px;
  height: clamp(26px, 1.6rem, 32px); padding: 3px; flex: none;
  border: 2px solid var(--ink); border-radius: 6px; background: #fff;
}
.gauge i { background: var(--surface-2); border-radius: 2px; }
.gauge i.on { background: var(--ink); }

/* ---------- Fotky ---------- */
.file-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 0;
}

/* ---------- Kontrola údajů ---------- */
.summary { margin: 0; border: 2px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.summary-row {
  display: grid; grid-template-columns: 1fr auto; gap: .15rem .8rem;
  padding: .8rem 1rem; border-bottom: 2px solid var(--line-soft);
}
.summary-row:last-child { border-bottom: 0; }
.summary dt { grid-column: 1; font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.summary dd { grid-column: 1; margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.summary .btn-edit { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.btn-edit {
  min-height: 48px; padding: .3rem .8rem;
  display: inline-flex; align-items: center; gap: .3rem;
  border: 2px solid var(--primary); border-radius: 11px;
  background: #fff; color: var(--primary);
  font: inherit; font-size: .88rem; font-weight: 800;
  cursor: pointer;
}
.btn-edit:hover { background: var(--primary-soft); }

/* ---------- Upozornění ---------- */
.alert {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .85rem 1rem; margin: 0 0 .7rem;
  border: 2px solid; border-radius: 12px;
  font-weight: 700; line-height: 1.4;
}
.alert .ico { width: 1.5rem; height: 1.5rem; margin-top: .05rem; }
.alert p { margin: 0; }
.alert p + p { margin-top: .4rem; }
.alert-error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-dark); }
.alert-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.alert-info { background: var(--primary-soft); border-color: var(--primary); color: var(--ink); }
.alert-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-dark); }
.msg { margin-top: 1rem; }
.msg:empty { display: none; }
.msg .alert { margin: 0; }

/* ---------- Úvodní stránka ---------- */
.staff-link { text-align: center; margin: 1.6rem 0 0; }
.staff-link a { display: inline-flex; align-items: center; gap: .4rem; min-height: 48px; font-weight: 700; font-size: .9rem; color: var(--ink-2); }

/* ---------- Hotovo ---------- */
.done-hero { text-align: center; padding: .6rem 0 .4rem; }
.done-check {
  width: 5.5rem; height: 5.5rem; margin: .4rem auto 1rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--ok); color: #fff;
}
.done-check .ico { width: 3.2rem; height: 3.2rem; stroke-width: 3; }
.card {
  border: 2px solid var(--line-soft); border-radius: 16px;
  padding: 1rem; margin: 1rem 0;
  background: #fff;
}
.ordcard { text-align: center; }
.ordcard .small { margin: .6rem 0 0; }
/* ---------- Štítky stavu ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .65rem;
  border: 2px solid; border-radius: 99px;
  font-size: .8rem; font-weight: 800; line-height: 1.3;
  max-width: 100%;
}
.tone-info { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
.tone-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.tone-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-dark); }

/* ---------- Dispečink ---------- */
.staff-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.staff-head h1 { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr)); gap: .7rem; margin: 1rem 0; }
.tile {
  text-align: left;
  min-height: 4.6rem; padding: .7rem .9rem;
  border: 2px solid var(--line-soft); border-radius: 14px;
  background: #fff; color: var(--ink);
  font: inherit; cursor: pointer;
}
.tile:hover { border-color: var(--primary); }
.tile strong { display: block; font-size: 1.8rem; line-height: 1.1; }
.tile span { font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.tile[aria-pressed="true"] { border-color: var(--primary); border-width: 3px; background: var(--primary-soft); padding: calc(.7rem - 1px) calc(.9rem - 1px); }
.orders { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .6rem; }
.order-card {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .9rem;
  padding: .8rem 1rem;
  border: 2px solid var(--line-soft); border-radius: 14px;
  background: #fff; color: var(--ink);
  text-decoration: none;
}
.order-card:hover { border-color: var(--primary); color: var(--ink); }
.order-main { flex: 1 1 10rem; min-width: 0; }
.order-main strong { display: block; }
.order-main span { display: block; font-size: .85rem; color: var(--ink-2); }
.empty { text-align: center; color: var(--ink-2); padding: 1.5rem 0; }

.panel { border: 2px solid var(--line-soft); border-radius: 16px; padding: 1rem; margin: 1rem 0; }
.panel h2 { margin-top: 0; }
.kv { display: grid; grid-template-columns: minmax(6.5rem, max-content) 1fr; gap: .4rem 1rem; margin: 0; }
.kv dt { color: var(--ink-2); font-weight: 700; font-size: .9rem; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.thumbs { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
.thumbs figure { margin: 0; }
.thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-soft); }
.thumbs figcaption { font-size: .75rem; color: var(--ink-2); margin-top: .15rem; }
.log { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.log li { padding: .35rem 0; border-bottom: 1px solid var(--line-soft); }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--ink-2); font-weight: 700; margin-right: .4rem; }

/* ---------- Protokol ---------- */
.protocol { border: 2px solid var(--line-soft); border-radius: 12px; padding: 1.2rem; font-size: .9rem; background: #fff; }
.protocol-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-start; border-bottom: 3px solid var(--ink); padding-bottom: .7rem; margin-bottom: .8rem; }
.protocol-head h1 { font-size: 1.2rem; margin: .2rem 0 0; }
.protocol-brand { margin: 0; font-weight: 700; color: var(--ink-2); font-size: .85rem; }
.protocol-no { font-size: .85rem; white-space: nowrap; }
.protocol-no strong { font-size: 1.15rem; }
.protocol h2 { font-size: 1rem; margin: 1.1rem 0 .4rem; }
.ptable { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ptable th, .ptable td { overflow-wrap: break-word; }
.ptable th, .ptable td { text-align: left; vertical-align: top; padding: .4rem .5rem; border-bottom: 1px solid var(--line-soft); }
.ptable th { width: 36%; color: var(--ink-2); font-weight: 700; }
.protocol-foot { margin-top: 1.2rem; font-size: .75rem; color: var(--ink-2); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }

/* ---------- Dialog (Pomoc, informace) ---------- */
dialog {
  width: min(34rem, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 0;
  border: 0; border-radius: 18px;
  color: var(--ink); background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: rgba(11, 27, 43, .6); }
dialog:not([open]) { display: none; }
.dialog-inner { padding: 1.2rem 1rem 1rem; display: grid; gap: .8rem; }
.dialog-inner h2 { margin: 0; font-size: 1.35rem; }
.dialog-inner h3 { margin: .4rem 0 0; }
.dialog-inner p { margin: 0; }
.dialog-inner ul { margin: 0; }
.dialog-inner li { margin-bottom: .4rem; }
.seg { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg legend { font-weight: 800; padding: 0; margin-bottom: .4rem; }
.seg-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.5rem), 1fr)); gap: .4rem; }
.seg .option { justify-content: center; padding: .5rem .3rem; min-height: 3.2rem; gap: .4rem; font-size: .85rem; }
.seg .option.is-checked { padding: calc(.5rem - 1px) calc(.3rem - 1px); }
.seg .option input { width: 1.2rem; height: 1.2rem; }
.switch {
  display: flex; align-items: center; gap: .8rem;
  min-height: 3.4rem; padding: .6rem .9rem;
  border: 2px solid var(--line); border-radius: 12px;
  font-weight: 800; cursor: pointer;
}
.switch input { width: 1.55rem; height: 1.55rem; accent-color: var(--primary); flex: none; }
hr { border: 0; border-top: 2px solid var(--line-soft); margin: .4rem 0; width: 100%; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: 4.6rem; z-index: 60;
  transform: translate(-50%, -12px);
  max-width: calc(100% - 32px);
  padding: .8rem 1.1rem;
  border-radius: 12px;
  background: var(--ink); color: #fff;
  font-weight: 700; text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================================
   Předávání vozu mezi řidiči
   ========================================================================= */
.input-center { text-align: center; }
.label-gap { margin-top: 1.4rem; }
.btn-gap { margin-top: .8rem; }
.center { text-align: center; }
.stack > .small { margin: -.4rem 0 0; }

/* Přihlašovací stránky: prázdné, jen jedno políčko */
body[data-bare] { background: #f3f5f9; }
body[data-bare] .topbar, body[data-bare] .skip { display: none; }
body[data-bare] main { padding-top: min(30vh, 12rem); }
.bare-form { max-width: 28rem; margin: 0 auto; }
.bare-row { display: flex; align-items: center; gap: .55rem; }
.bare-num { flex: none; font-size: min(1.7rem, 9vw); font-weight: 800; line-height: 1; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bare-row .input { flex: 1 1 auto; min-width: 0; }
.bare-form .input {
  min-height: 4.6rem; padding: .6rem .8rem;
  font-size: min(1.6rem, 8.5vw); font-weight: 700; letter-spacing: .03em;   /* celé číslo se vejde i na úzký telefon */
  background: #fff; border: 2px solid #7d8a9c; border-radius: 22px;   /* obrys min. 3 : 1 */
  box-shadow: 0 1px 2px rgba(15, 27, 43, .06), 0 14px 36px rgba(15, 27, 43, .10);
  caret-color: var(--primary);
  transition: border-color .15s, box-shadow .15s;
}
.bare-form .input::placeholder { font-weight: 500; letter-spacing: 0; text-transform: none; color: #687587; }
.bare-form .input:focus-visible { outline: none; }
.bare-form .input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 5px rgba(11, 78, 162, .20), 0 14px 36px rgba(15, 27, 43, .10);
}
.bare-form .input[aria-invalid="true"] {
  border-width: 2px; border-color: var(--danger); background: #fff;
  box-shadow: 0 0 0 5px rgba(164, 22, 26, .16), 0 14px 36px rgba(15, 27, 43, .10);
}
.bare-form .msg { margin-top: 1.2rem; }
.bare-form .msg .alert {
  background: none; border: 0; padding: 0 .4rem;
  justify-content: center; text-align: left; font-weight: 600; color: var(--danger-dark);
}
:root[data-contrast="high"] body[data-bare] { background: #fff; }
:root[data-contrast="high"] .bare-form .input { border: 3px solid #000; box-shadow: none; }
:root[data-contrast="high"] .bare-form .input:focus-visible { outline: 4px solid #000; outline-offset: 3px; }
.mine-head { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; }

/* Profil vozu */
.veh-head { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; margin-top: .2rem; }
.veh-head h1 { margin: 0; }
.veh-head p { margin: .1rem 0 0; color: var(--ink-2); }
.veh-status { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: .8rem 0 .3rem; }
.pcard { border: 2px solid var(--line-soft); border-radius: 16px; padding: 1rem; margin: 1rem 0; background: #fff; }
.pcard h2 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-size: 1.05rem; color: var(--ink-2); }
.pcard h2 .ico { width: 1.4em; height: 1.4em; color: var(--primary); }
.pcard .stack { margin-top: .8rem; }
.pcard .alert { margin: .8rem 0 0; }
.pcard-keys { border: 3px solid var(--primary); background: var(--primary-soft); }
.pbig { margin: 0 0 .5rem; font-size: 1.25rem; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.levels { margin: 0; }
.level { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line-soft); }
.level:last-child { border-bottom: 0; }
.level dt { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.level dd { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; font-weight: 700; }
.level.is-low { margin: .2rem -.6rem; padding-inline: .6rem; border: 2px solid var(--warn-line); border-radius: 10px; background: var(--warn-soft); }
.low-tag { display: inline-flex; align-items: center; gap: .25rem; color: var(--warn-ink); }
.note-tags { list-style: none; padding: 0; margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.note-tags li { padding: .25rem .75rem; border: 2px solid var(--warn-line); border-radius: 99px; background: var(--warn-soft); color: var(--warn-ink); font-weight: 700; font-size: .9rem; }
.note-tags li.is-ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok-dark); }
.pnote { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.damage-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.damage-list li { display: flex; align-items: flex-start; gap: .8rem; }
.damage-list li > div { min-width: 0; overflow-wrap: anywhere; }
.damage-list .thumb-btn { width: 5.5rem; flex: none; }
.no-thumb { width: 3rem; height: 3rem; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--warn-soft); color: var(--warn-ink); }
.thumb-btn { display: block; width: 100%; padding: 0; border: 0; border-radius: 8px; background: none; cursor: zoom-in; }
.thumb-btn img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--surface); }
.photo-full { width: 100%; min-height: 8rem; border-radius: 10px; background: var(--surface); }

/* Fotky bez omezení počtu */
.photo-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); gap: .7rem; }
.btn-photo-big { position: relative; flex-direction: column; gap: .15rem; min-height: 4.6rem; padding: .5rem; }
.btn-photo-big .ico { width: 1.8rem; height: 1.8rem; }
.btn-photo-big:focus-within { outline: 4px solid var(--focus); outline-offset: 3px; }
.photo-count { margin: .9rem 0 .6rem; }
.shots { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.shot { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: .8rem; align-items: start; padding: .6rem; border: 2px solid var(--line-soft); border-radius: var(--radius); }
.shot.is-damage { border: 3px solid var(--danger); padding: calc(.6rem - 1px); background: var(--danger-soft); }
.shot-img { position: relative; display: block; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--surface); cursor: zoom-in; }
.shot-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.shot-no { position: absolute; left: .3rem; top: .3rem; min-width: 1.7rem; padding: .05rem .4rem; border-radius: 99px; background: rgba(15, 27, 43, .85); color: #fff; font-weight: 800; font-size: .8rem; text-align: center; }
.shot-flag { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: .25rem; padding: .15rem; background: var(--danger); color: #fff; font-weight: 800; font-size: .75rem; }
.shot-flag .ico { width: 1em; height: 1em; }
.shot-side { display: grid; gap: .4rem; align-content: start; min-width: 0; }
.shot-side .linkbtn { justify-self: start; font-size: .9rem; }
.damage-toggle { display: flex; align-items: center; gap: .6rem; min-height: 48px; font-weight: 800; line-height: 1.2; cursor: pointer; }
.damage-toggle input { width: 1.6rem; height: 1.6rem; flex: none; accent-color: var(--danger); }
.input-sm { min-height: 48px; padding: .4rem .6rem; font-size: 1rem; }
.damage-toggle span { min-width: 0; overflow-wrap: anywhere; }
/* Úzký telefon + větší písmo: fotka nad volbami, menší SPZ v kartách */
@media (max-width: 400px) { html[data-size] .shot { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 380px) { html[data-size] .card .plate { font-size: 1.1rem; } }

/* Zaparkování */
.quick { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chip {
  min-height: 48px; padding: .45rem .9rem;
  border: 2px solid var(--primary); border-radius: 99px;
  background: #fff; color: var(--primary);
  font: inherit; font-weight: 700; font-size: .92rem; line-height: 1.25; text-align: left;
  cursor: pointer;
}
.chip:hover { background: var(--primary-soft); }
.gps-out:not(:empty) { margin-top: .8rem; }
.gps-out .alert { margin: 0; }

/* Hotovo */
.checklist { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: .5rem; }
.checklist li { display: flex; align-items: flex-start; gap: .6rem; font-weight: 700; }
.checklist .ico { color: var(--ok); stroke-width: 3; margin-top: .1rem; }

/* Dispečink */
.tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin: .8rem 0 0; border-bottom: 2px solid var(--line-soft); }
.tabs a {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 48px; padding: .3rem .9rem; margin-bottom: -2px;
  border-bottom: 4px solid transparent;
  color: var(--ink-2); font-weight: 800; text-decoration: none;
}
.tabs a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.warn-line { display: inline-flex; align-items: center; gap: .3rem; color: var(--warn-ink); font-weight: 700; }
.order-main .warn-line { display: flex; color: var(--warn-ink); }
.order-card.is-off { background: var(--surface); }
.rec-thumbs li.is-damage img { border: 3px solid var(--danger); }

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

/* ---------- Tisk protokolu ---------- */
@media print {
  .topbar, .netbar, .no-print, .toast, .skip, dialog { display: none !important; }
  html, html[data-size] { font-size: 11pt; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .protocol { border: 0; padding: 0; font-size: 10pt; }
  .thumbs { grid-template-columns: repeat(5, 1fr); }
  .thumbs img { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Napojení na server: načítání, blokace, dispečeři ---------- */
.loading { display: flex; align-items: center; justify-content: center; gap: .7rem; padding: 3rem 0; color: var(--ink-2); font-weight: 600; }
.spinner { width: 1.6rem; height: 1.6rem; border: 3px solid var(--line-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bare-form .input.is-busy { border-color: var(--primary); background-image: linear-gradient(90deg, transparent 0, rgba(11,78,162,.10) 50%, transparent 100%);
  background-size: 200% 100%; background-repeat: no-repeat; animation: busy 1s linear infinite; }
@keyframes busy { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.bare-form .input:disabled { opacity: .6; }
@media (prefers-reduced-motion: reduce) { .spinner, .bare-form .input.is-busy { animation-duration: 3s; } }
.form-narrow { max-width: 30rem; }
.staff-me { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.tabs a.tab-alert { color: var(--danger); }
.btn-row { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.blocks { list-style: none; padding: 0; margin: .6rem 0 1.2rem; display: grid; gap: .8rem; }
.block-card { border: 2px solid var(--line-soft); border-radius: 16px; padding: .9rem 1rem; background: var(--bg); }
.block-card.is-active { border-color: var(--danger); background: var(--danger-soft); }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; margin-bottom: .4rem; overflow-wrap: anywhere; }
.block-tries { list-style: none; padding: 0; margin: 0 0 .7rem; font-size: .92rem; }
.block-tries li { padding: .25rem 0; overflow-wrap: anywhere; }
.tag { display: inline-block; padding: .05rem .45rem; border-radius: 6px; background: var(--surface-2); font-size: .78rem; font-weight: 700; color: var(--ink-2); }
