/* QR-Čtečka – vzhled (moderní webová verze)
   ---------------------------------------------------------------------------
   Mobil první (od 320 px), plynule přechází na tablet (~640 px) a desktop
   (~1024 px). Jednotná identita: tmavý brand v hlavičce, světlé karty,
   jemné stíny a zaoblení. Průvodce (wizard) provádí uživatele krok za krokem.

   Tiskové styly pro QR štítky (kapitola 11.6) zůstávají na konci souboru. */

:root {
  --bg: #eef2f8;
  --bg-soft: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef2ff;
  --dark: #0b1220;
  --ok: #15803d;
  --warn: #b45309;
  --err: #b91c1c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow: 0 12px 32px rgba(15, 23, 42, .09);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, .18);
  --ring: 0 0 0 3px rgba(79, 70, 229, .30);
  --maxw: 100%;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { justify-content: flex-end; }
.nowrap { white-space: nowrap; }
.noscript { padding: 16px; background: #fee2e2; color: #991b1b; font-weight: 600; }
/* ------------------------------- přihlášení ------------------------------- */
.login-view {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(1100px 560px at 12% -10%, #e0e7ff 0%, transparent 60%),
    radial-gradient(900px 520px at 110% 112%, #ede9fe 0%, transparent 55%),
    var(--bg);
}
.login-shell {
  width: 100%; max-width: 1000px; background: var(--card);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  display: grid; grid-template-columns: 1fr;
}
.login-hero {
  background: linear-gradient(160deg, var(--dark), #1e1b4b 58%, #312e81);
  color: #e2e8f0; padding: 30px 24px; display: flex; flex-direction: column; gap: 18px;
}
.hero-top { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 800; letter-spacing: .5px; flex: 0 0 auto;
}
.logo-lg { width: 56px; height: 56px; font-size: 1.15rem; }
.hero-top h1 { margin: 0; font-size: 1.15rem; }
.hero-top p { margin: 2px 0 0; color: #a5b4fc; font-size: .85rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; color: var(--brand-2); font-weight: 700; }
.login-hero .eyebrow { color: #a5b4fc; }
.hero-body h2 { margin: 8px 0 6px; font-size: 1.45rem; line-height: 1.22; }
.hero-body .lead { margin: 0; color: #cbd5e1; font-size: .95rem; }
.hero-features { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.hero-features li { display: grid; gap: 2px; padding-left: 14px; border-left: 3px solid var(--brand-2); }
.hero-features b { font-size: .95rem; }
.hero-features span { color: #94a3b8; font-size: .85rem; }
.hero-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; color: #94a3b8; font-size: .82rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; flex: 0 0 auto; }

.login-card { padding: 26px 22px; display: grid; gap: 14px; align-content: start; }
.login-head h2 { margin: 6px 0 4px; }
.login-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.login-error { margin: 0; padding: 10px 12px; background: #fee2e2; color: var(--err); border-radius: 10px; font-size: .9rem; }
.login-note { margin: 0; padding: 10px 12px; background: #fef3c7; color: #92400e; border-radius: 10px; font-size: .85rem; }
.login-foot { margin: 0; display: grid; gap: 4px; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; text-align: left; cursor: pointer; text-decoration: underline; }

/* --------------------------------- pole ---------------------------------- */
.field { display: grid; gap: 6px; }
.field-label { font-size: .82rem; font-weight: 600; color: #334155; }
input, select, textarea {
  font: inherit; padding: 12px 13px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--ink); width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 74px; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[disabled], select[disabled], button[disabled] { opacity: .55; cursor: not-allowed; }

/* -------------------------------- tlačítka -------------------------------- */
.btn {
  font: inherit; font-weight: 600; padding: 11px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--bg-soft); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 8px 20px rgba(79, 70, 229, .30); }
.btn.primary:hover { filter: brightness(1.06); border-color: transparent; }
.btn.big { padding: 13px 18px; font-size: 1rem; }
/* „Ghost" = obrysové tlačítko – čitelné na bílých kartách. */
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--bg-soft); border-color: var(--line-strong); }
.btn.danger { background: #fff; color: var(--err); border-color: #fecaca; box-shadow: none; }
.btn.danger:hover { background: #fef2f2; border-color: #fca5a5; }
.btn.small { padding: 8px 12px; min-height: 38px; font-size: .88rem; }
.file-btn { display: inline-flex; align-items: center; cursor: pointer; }

/* Dvojice přehledových tabulek vedle sebe (na úzké obrazovce pod sebou). */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
/* --------------------------------- aplikace -------------------------------- */
.topbar {
  background: linear-gradient(120deg, var(--dark), #171532 70%, #241c4d);
  color: #e2e8f0;
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-text h1 { margin: 0; font-size: 1rem; }
.brand-text p { margin: 2px 0 0; color: #94a3b8; font-size: .8rem; }
.company-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.company-switch { max-width: 260px; padding: 5px 9px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #e2e8f0; font-size: .8rem; }
.company-switch.hidden { display: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { padding: 5px 10px; border-radius: 999px; background: rgba(124, 58, 237, .28); color: #ddd6fe; font-size: .78rem; white-space: nowrap; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #1e293b; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: 0 0 auto; }
.user-meta { display: grid; line-height: 1.2; }
#userName { font-size: .85rem; }
.role-badge { font-size: .72rem; color: #a5b4fc; }
/* Tlačítka v tmavé hlavičce – světlý obrys. */
.topbar .btn.ghost { background: rgba(255,255,255,.07); color: #e2e8f0; border-color: rgba(255,255,255,.22); }
.topbar .btn.ghost:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); }

/* --------------------------- navigace / průvodce -------------------------- */
.app-nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
.tabs { display: flex; gap: 8px; flex: 1 1 auto; overflow-x: auto; padding: 2px; scrollbar-width: none; touch-action: pan-x; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font: inherit; font-weight: 600; padding: 10px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
  white-space: nowrap; min-height: 44px; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tab:hover { border-color: var(--line-strong); color: var(--ink); }
.tab.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(79, 70, 229, .26); }

/* Kroky průvodce (1 → 4) */
.tab-step { padding: 7px 16px 7px 8px; gap: 10px; }
.tab-num {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: .85rem;
}
.tab-text { display: grid; line-height: 1.15; text-align: left; }
.tab-text b { font-size: .88rem; color: var(--ink); font-weight: 700; }
.tab-text small { font-size: .72rem; color: var(--muted); }
.tab.active .tab-num { background: rgba(255, 255, 255, .24); color: #fff; }
.tab.active .tab-text b { color: #fff; }
.tab.active .tab-text small { color: rgba(255, 255, 255, .85); }

/* Rozbalovací menu „Nastavení" s doplňkovými záložkami */
.nav-more { position: relative; flex: 0 0 auto; }
.nav-more-trigger {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-weight: 600; color: var(--ink); white-space: nowrap; min-height: 44px;
}
.nav-more-trigger::-webkit-details-marker { display: none; }
.nav-more-trigger:hover { border-color: var(--line-strong); }
.nav-more[open] .nav-more-trigger { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.nav-more-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 40;
  min-width: 236px; max-width: calc(100vw - 28px);
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 8px; display: grid; gap: 4px;
}
.nav-more-menu .tab { justify-content: flex-start; border-radius: 10px; min-height: 42px; padding: 9px 12px; box-shadow: none; }
.nav-more.has-active:not([open]) .nav-more-trigger { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ------------------------------ průvodce (bar) ---------------------------- */
/* Pevně ukotvená lišta dole – je vždy vidět a nikdy nezakryje obsah
   (místo pro ni si rezervuje body.wizard-on přes padding-bottom). */
.wizard-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; justify-content: center;
  padding: 0 14px calc(12px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.wizard-bar-inner {
  pointer-events: auto;
  width: 100%; max-width: var(--maxw); min-width: 0;
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: #fff;
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 10px 12px;
}
body.wizard-on { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
.wizard-mid { display: grid; justify-items: center; gap: 5px; flex: 1 1 auto; min-width: 0; }
.wizard-progress { font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-width: 0; }
.wizard-bar .btn { flex: 0 0 auto; white-space: nowrap; }
.wizard-dots { display: flex; gap: 6px; }
.wizard-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); display: block; transition: background .2s ease, transform .2s ease; }
.wizard-dots i.on { background: var(--brand); transform: scale(1.25); }
.wizard-dots i.done { background: var(--brand-2); }
/* --------------------------------- obsah ---------------------------------- */
main { padding: 14px 14px 24px; display: grid; gap: 14px; max-width: var(--maxw); margin: 0 auto; }
.panel { display: none; }
.panel.active { display: grid; gap: 16px; min-width: 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm); min-width: 0;
}
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 1.08rem; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: .85rem; }
.step {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: .95rem;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row + .row { margin-top: 10px; }
.grow { flex: 1 1 220px; min-width: 0; }
.sub { margin: 16px 0 8px; font-size: .95rem; }
.subhead { margin: 18px 0 6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.todo { margin: 10px 0 0; padding-left: 20px; color: #334155; display: grid; gap: 6px; font-size: .92rem; }
.steps { padding-left: 20px; display: grid; gap: 6px; font-size: .92rem; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.checkbox input, .radio input { width: auto; min-height: 0; }
.radio { flex-direction: row; align-items: center; gap: 8px; font-size: .88rem; }
.map-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .map-grid { grid-template-columns: 1fr 1fr; } }
.map-row { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); min-width: 0; }
.map-row b { font-size: .85rem; }
.map-row span { color: var(--muted); font-size: .78rem; }
.err-list { display: grid; gap: 6px; margin: 8px 0; }
.err-list .err { background: #fef2f2; color: var(--err); border-radius: 8px; padding: 8px 10px; font-size: .85rem; }
.err-list .ok { background: #f0fdf4; color: var(--ok); border-radius: 8px; padding: 8px 10px; font-size: .85rem; }
.batch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; font-size: .85rem;
}
.banner { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: .92rem; }
.banner.ok { background: #dcfce7; color: var(--ok); }
.banner.warn { background: #fef3c7; color: var(--warn); }
.banner.err { background: #fee2e2; color: var(--err); }
.banner.flash { animation: qrflash .45s 2; }
.banner-info { background: #eef2ff; border: 1px solid #c7d2fe; color: var(--brand); border-radius: 12px; }
/* Chybová řádka (upravaFaziCline.md) – chyby mimo popup, text lze kopírovat. */
.error-line { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; padding: 10px 12px; border: 1px solid #fecaca; border-radius: 12px; background: #fef2f2; color: var(--err); }
.error-text { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; white-space: pre-wrap; word-break: break-word; user-select: text; -webkit-user-select: text; }
.error-line .btn { flex: 0 0 auto; }
/* Rozbalovací sekce hromadných úprav uvnitř Přehledu majetku. */
.bulk-details { margin: 12px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.bulk-details > summary { cursor: pointer; font-weight: 600; list-style: none; }
.bulk-details > summary::-webkit-details-marker { display: none; }
.bulk-details > summary::before { content: '▸ '; color: var(--muted); }
.bulk-details[open] > summary::before { content: '▾ '; }
.bulk-details[open] > summary { margin-bottom: 4px; }
@keyframes qrflash { 50% { opacity: .3; } }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); min-width: 0; }
.kpi-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: .8rem; color: var(--muted); }
.code-block { margin: 8px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #0f172a; color: #e2e8f0; overflow-x: auto; font-size: .82rem; line-height: 1.55; }
#apiNewKey code { display: block; word-break: break-all; font-size: .85rem; }
/* --------------------------------- tabulky -------------------------------- */
.table-wrap { overflow-x: auto; margin-top: 10px; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-soft); }
tbody tr:hover { background: #f8fafc; }
th.check, td.check { width: 34px; text-align: center; }
td.check input, th.check input { width: auto; min-height: 18px; }
tr.blocked td { background: #fff7ed; }
td.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-wrap td input:not([type="checkbox"]) { min-width: 120px; min-height: 34px; padding: 4px 8px; font-size: .85rem; }
.pill { padding: 3px 9px; border-radius: 999px; background: #eef2ff; color: var(--brand); font-size: .75rem; font-weight: 600; white-space: nowrap; display: inline-block; }
.pill.found { background: #dcfce7; color: var(--ok); }
.pill.not_found { background: #fee2e2; color: var(--err); }
.pill.moved { background: #fef3c7; color: var(--warn); }
.pill.surplus { background: #e0e7ff; color: #3730a3; }

/* --------------------------- terén, foto, skener -------------------------- */
.progress { height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin: 12px 0 6px; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .3s; }
.scanner { margin-top: 12px; border-radius: 12px; overflow: hidden; background: #000; }
.scanner video { width: 100%; display: block; }
.foto-list { display: grid; gap: 8px; margin-top: 12px; }
.foto-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.foto-thumb { flex: 0 0 72px; width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 8px; background: #000; color: #fff; font-size: .8rem; }
.foto-thumb img { width: 100%; height: 100%; object-fit: cover; }
.foto-meta { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.foto-meta span { word-break: break-word; }
.state-btn { min-height: 44px; }
.state-btn.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }
.reg-form { max-height: 82vh; overflow-y: auto; }

/* Registrace – vzdušnější vzhled jako dialog pro nové heslo (jedno pole na řádek). */
#regForm .row { flex-direction: column; align-items: stretch; }
#regForm .row .grow { flex: none; }
#regForm .row .btn { width: 100%; }
#regForm .row.radio-row { gap: 8px; }
#regForm .field.radio { align-items: center; }
.platform-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* ------------------------------ zápatí a hlášení -------------------------- */
.foot { padding: 12px 16px 30px; text-align: center; color: var(--muted); font-size: .8rem; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.legal-links a { font-size: .82rem; }
.foot-links { display: block; margin-top: 6px; }
.foot-links a { color: var(--brand); margin: 0 8px; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px);
  background: var(--dark); color: #fff; padding: 12px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .25s; font-size: .9rem; z-index: 60;
  box-shadow: var(--shadow-lg); max-width: calc(100vw - 24px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--err); }
body.wizard-on .toast { bottom: 96px; }

/* --------------------------- dialog a hlášení --------------------------- */
.dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 520px; width: calc(100% - 24px); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(15, 23, 42, .5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.dialog form { padding: 20px; display: grid; gap: 12px; }
.dialog h2 { margin: 0; font-size: 1.1rem; }

/* Právní dokument v modálu (bez opuštění aplikace) – obsah v iframe. */
.legal-dialog { max-width: 880px; width: calc(100% - 24px); }
.legal-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.legal-dialog-head h2 { font-size: 1.05rem; }
.legal-frame { display: block; width: 100%; height: 72vh; border: 0; background: #fff; border-radius: 0 0 var(--radius) var(--radius); }

/* ------------------------ náhled archu se štítky (FR-20) ------------------ */
.sheet-preview { overflow: auto; padding: 6px 0; }
.sheet-wrap { position: relative; width: calc(210mm * .42); height: calc(297mm * .42); }
.sheet {
  position: absolute; top: 0; left: 0; width: 210mm; height: 297mm;
  background: #fff; border: 1px solid var(--line);
  transform: scale(.42); transform-origin: top left;
}
.sheet-label {
  position: absolute; border: 1px dashed #cbd5e1; overflow: hidden;
  padding: 1mm; font-size: 5.5pt; line-height: 1.15; color: #0f172a;
}
.sheet-label .variant { color: #64748b; font-size: 4.5pt; letter-spacing: .04em; }
.sheet-label .code { font-weight: 700; font-size: 6.5pt; }
.sheet-label .title { font-size: 5.5pt; }
.sheet-label .subtitle { color: #64748b; font-size: 5pt; }
.sheet-label canvas { display: block; }
.sheet-label .row-label { display: flex; gap: 1mm; align-items: flex-start; }
/* -------------------------------- responzivita ------------------------------ */
/* Tablet a větší (od 640 px) – obsah se zúží a vycentruje, hlavička drží krok. */
@media (min-width: 640px) {
  :root { --maxw: 720px; }
  main { padding: 18px 18px 26px; }
  .topbar-inner { padding: 12px 18px; }
  .app-nav-inner { padding: 12px 18px; }
  .wizard-bar { padding-left: 18px; padding-right: 18px; }
  .card { padding: 18px; }
  .login-hero { padding: 34px 30px; }
  .login-card { padding: 34px 30px; }
}
/* Větší tablet / malý notebook – o něco širší sloupec. */
@media (min-width: 900px) { :root { --maxw: 860px; } }
/* Desktop (od 1024 px) */
@media (min-width: 1024px) {
  main { padding: 22px 22px 30px; gap: 16px; }
  .wizard-bar { padding-left: 22px; padding-right: 22px; }
  .hero-body h2 { font-size: 1.65rem; }
}
/* Velký desktop – obsah zůstává v pohodlném sloupci. */
@media (min-width: 1200px) { :root { --maxw: 1000px; } }
/* Přihlášení dvousloupcové na širších obrazovkách */
@media (min-width: 860px) {
  .login-shell { grid-template-columns: 1fr 1fr; }
}
/* Kompaktnější kroky na tabletech a telefonech – vejdou se všechny 4 kroky. */
@media (max-width: 899px) {
  .tab-text small { display: none; }
  .tab-step { padding: 7px 13px 7px 7px; gap: 8px; }
}
@media (max-width: 480px) {
  .wizard-bar-inner { gap: 8px; padding: 9px 10px; }
  .wizard-bar .btn { padding: 10px 12px; }
  .wizard-progress { font-size: .74rem; }
}
@media (max-width: 420px) {
  .topbar-right { width: 100%; justify-content: space-between; }
  .brand-text p { display: none; }
}

/* ----------------------------------- tisk ---------------------------------- */
@media print {
  .topbar, .app-nav, .foot, .toast, .btn, .dialog, .wizard-bar { display: none !important; }
  body { background: #fff; }
  body.wizard-on { padding-bottom: 0 !important; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  @page { margin: 0; }
}
