:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --text: #0f1b2d;
  --muted: #5b6b80;
  --line: #dfe5ee;
  --primary: #1652c4;
  --primary-ink: #ffffff;
  --primary-soft: #e8f0ff;
  --navy: #0f2e5c;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #8a5a00;
  --warn-soft: #fff6e0;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 6px 22px rgba(15, 27, 45, .06);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --surface: #121b2c;
    --surface-2: #172236;
    --text: #e6edf7;
    --muted: #9aa9bf;
    --line: #253249;
    --primary: #4c8dff;
    --primary-ink: #04122b;
    --primary-soft: #16274a;
    --navy: #0a1a33;
    --ok: #4ade80;
    --ok-soft: #10291b;
    --warn: #fbbf24;
    --warn-soft: #2b2209;
    --danger: #f87171;
    --danger-soft: #2e1414;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 26px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: clamp(1.25rem, 3.6vw, 1.55rem); }
h3 { font-size: 1.02rem; }
p { margin: .35rem 0 .8rem; }
.muted { color: var(--muted); }
.fine { font-size: .82rem; color: var(--muted); }
.center { text-align: center; justify-content: center; }
.grow { flex: 1; }
a { color: var(--primary); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; }

/* ---------- Header & stepper ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { border-radius: 10px; flex: none; }
.brand strong { display: block; font-size: .98rem; }
.brand span { display: block; font-size: .74rem; color: var(--muted); white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.pill-local {
  display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600;
  color: var(--ok); background: var(--ok-soft); padding: 5px 10px 5px 8px; border-radius: 999px; white-space: nowrap;
}
.pill-local svg { width: 14px; height: 14px; fill: currentColor; }
@media (max-width: 420px) { .pill-local { display: none; } }

.stepper { max-width: 980px; margin: 14px auto 0; padding: 0 16px; }
.stepper ol { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.stepper li {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 8px 10px; border-radius: 12px; color: var(--muted); font-size: .82rem; font-weight: 600;
  background: transparent; position: relative;
}
.stepper li::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px; background: var(--line); }
.stepper li span {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1.5px solid var(--line); font-size: .78rem;
}
.stepper li em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper li.done { color: var(--text); }
.stepper li.done span { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper li.done::after { background: var(--ok); }
.stepper li.current { color: var(--primary); }
.stepper li.current span { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.stepper li.current::after { background: var(--primary); }
@media (max-width: 640px) {
  .stepper li em { display: none; }
  .stepper li.current em { display: inline; }
  .stepper li { flex: 0 0 auto; padding: 8px 6px; }
  .stepper li.current { flex: 1; }
}

main { max-width: 980px; margin: 0 auto; padding: 18px 16px 24px; outline: none; }
main:focus, main:focus-visible { outline: none; }
.screen { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } * { transition: none !important; } }

/* ---------- Cards, buttons, fields ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 14px 0; box-shadow: var(--shadow);
}
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 650; font-size: .95rem; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
  user-select: none; -webkit-user-select: none;
}
.btn:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .86rem; border-radius: 10px; }
.btn.big { min-height: 54px; font-size: 1.05rem; padding: 12px 22px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 600; padding: 10px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.row { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.row.wrap { flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; min-width: 0; }
.field label, .field .label { font-weight: 650; font-size: .88rem; }
.req { color: var(--danger); font-weight: 700; }
input[type=text], input[type=date] {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px; width: 100%;
}
input[type=text]:focus, input[type=date]:focus { border-color: var(--primary); outline: 3px solid color-mix(in srgb, var(--primary) 22%, transparent); }
input.invalid { border-color: var(--danger); background: var(--danger-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- Intro ---------- */
.hero { padding: 14px 0 4px; }
.hero h1 { font-size: clamp(1.7rem, 5.6vw, 2.6rem); letter-spacing: -.025em; }
.hero h1 span { color: var(--primary); }
.lead { font-size: clamp(1rem, 2.4vw, 1.12rem); color: var(--muted); max-width: 62ch; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .features { grid-template-columns: 1fr; } }
.feature { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.feature .ico { font-size: 1.5rem; width: 42px; height: 42px; display: grid; place-items: center; background: var(--primary-soft); border-radius: 12px; flex: none; }
.feature strong { display: block; font-size: .95rem; }
.feature p { margin: 2px 0 0; font-size: .84rem; color: var(--muted); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 16px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: 14px; background: var(--surface-2); height: 100%; transition: border-color .15s, background .15s;
}
.segmented span small { color: var(--muted); font-size: .8rem; }
.segmented input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.segmented input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); }
.segmented.compact span { padding: 10px 14px; }
.how { padding-left: 1.3rem; margin: 6px 0 0; }
.how li { margin: 6px 0; }
.acc summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 1.4rem; color: var(--muted); font-weight: 400; }
.acc[open] summary::after { content: "–"; }
.acc[open] summary { margin-bottom: 10px; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-left: 28px; margin: 10px 0; font-size: .93rem; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: .75rem; font-weight: 800; display: grid; place-items: center; }
.plain { padding-left: 1.1rem; margin: 6px 0; }
.plain li { margin: 4px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }
h3.ok { color: var(--ok); } h3.no { color: var(--danger); }

/* ---------- Scan ---------- */
.scan-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.scan-head p { margin: 0; }
.sides { display: flex; gap: 8px; }
.side-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: .84rem; font-weight: 650; cursor: pointer;
}
.side-chip .thumb { width: 46px; height: 29px; border-radius: 6px; background: var(--surface-2) center/cover no-repeat; border: 1px dashed var(--line); position: relative; }
.side-chip.has .thumb { border-style: solid; }
.side-chip.has .thumb::after { content: "✓"; position: absolute; right: -6px; top: -6px; width: 17px; height: 17px; border-radius: 50%; background: var(--ok); color: #fff; font-size: .65rem; display: grid; place-items: center; font-weight: 800; }
.side-chip.current { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.viewport {
  position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: max(280px, min(68vh, calc(100dvh - 380px))); background: #0b1220;
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); margin: 0 auto;
}
@media (min-width: 700px) { .viewport { aspect-ratio: 16 / 10; } }
@media (orientation: landscape) and (max-height: 560px) { .viewport { aspect-ratio: auto; height: 74vh; } }
.viewport video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewport canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: calc(100% - 32px);
  background: rgba(10, 18, 34, .78); color: #fff; padding: 9px 16px; border-radius: 999px; font-weight: 650; font-size: .92rem;
  text-align: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hint.good { background: rgba(21, 128, 61, .92); }
.cam-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; color: #e6edf7; background: #0b1220; }
.cam-msg .fine { color: #9aa9bf; }
.cam-msg-ico { font-size: 2.6rem; margin-bottom: 6px; }
.scan-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 14px 0 4px; }
.scan-controls > :first-child { justify-self: start; }
.scan-controls > :nth-child(3), .scan-controls > .spacer { justify-self: end; }
.shutter { width: 72px; height: 72px; border-radius: 50%; border: 4px solid var(--primary); background: var(--surface); padding: 5px; cursor: pointer; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--primary); transition: transform .1s; }
.shutter:active span { transform: scale(.9); }
#torch[aria-pressed="true"] { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.tips { margin-top: 10px; }

.crop { position: fixed; inset: 0; z-index: 40; background: rgba(5, 10, 20, .7); display: flex; align-items: center; justify-content: center; padding: 12px; }
.crop-inner { background: var(--surface); border-radius: 18px; padding: 16px; width: min(900px, 100%); max-height: 100%; overflow: auto; }
.stage { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--bg) 0 50%) 0 0 / 22px 22px; border: 1px solid var(--line); border-radius: 14px; padding: 8px; display: flex; justify-content: center; }
.stage canvas { display: block; max-width: 100%; max-height: 62vh; touch-action: none; border-radius: 6px; }
.crop .stage canvas { max-height: 58vh; }

/* ---------- Data ---------- */
.progress-wrap { display: flex; gap: 14px; align-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3.5px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 8px; transition: width .3s; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 650; padding: 5px 10px; border-radius: 999px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.data-list { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 12px 0 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.data-list dt, .data-list dd { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.data-list dt { color: var(--muted); background: var(--surface-2); font-weight: 600; }
.data-list dd { display: flex; justify-content: space-between; gap: 8px; align-items: center; overflow-wrap: anywhere; }
.data-list dt:nth-last-of-type(1), .data-list dd:last-of-type { border-bottom: 0; }
.copy { border: 0; background: none; color: var(--primary); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.copy:hover { background: var(--primary-soft); }
@media (max-width: 480px) { .data-list { grid-template-columns: 1fr; } .data-list dt { border-bottom: 0; padding-bottom: 2px; } }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .thumbs { grid-template-columns: 1fr; } }
.thumb-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.thumb-card img { width: 100%; display: block; border-radius: 8px; }
.thumb-card .row { margin: 8px 0 0; justify-content: space-between; font-size: .86rem; font-weight: 650; }

/* ---------- Redact ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; margin: 6px 0 10px; }
.tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 650; font-size: .9rem; padding: 8px 14px; border-radius: 9px; cursor: pointer; min-height: 38px; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.redact-stage canvas { cursor: crosshair; }
.tools { margin-top: 10px; }
.legend { display: inline-flex; gap: 6px; align-items: center; font-size: .8rem; color: var(--muted); }
.lg { width: 16px; height: 12px; border-radius: 3px; display: inline-block; }
.lg.on { background: #0f172a; border: 2px solid #dc2626; }
.lg.off { border: 2px dashed #f59e0b; margin-left: 8px; }
.r-list { display: grid; gap: 8px; }
.r-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.r-item.active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.r-item input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: #0f172a; flex: none; }
.r-item strong { display: block; font-size: .92rem; }
.r-item small { display: block; color: var(--muted); font-size: .8rem; }
.r-item .tag { font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); margin-left: 6px; vertical-align: middle; }
.note { border-radius: 12px; padding: 12px 14px; font-size: .9rem; margin: 14px 0; }
.note.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.note.info { background: var(--primary-soft); color: var(--primary); }

/* ---------- Watermark & export ---------- */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px 8px 8px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-size: .88rem; font-weight: 600; min-height: 44px; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.sw { width: 22px; height: 22px; border-radius: 50%; display: inline-block; }
.sw.blue { background: linear-gradient(135deg, #153c8c, #0e7490); }
.sw.slate { background: linear-gradient(135deg, #28303e, #5a6476); }
.sw.wine { background: linear-gradient(135deg, #801834, #a8461e); }
.preview-wrap { margin: 14px 0; }
.preview-wrap canvas, .export-previews img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.export-previews { display: grid; gap: 12px; margin: 14px 0; }
.export-previews figure { margin: 0; }
.export-previews figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.actions { margin: 16px 0; }
.done-card { border-color: color-mix(in srgb, var(--danger) 25%, var(--line)); }

/* ---------- Bottom bar, chips, toast ---------- */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 10px; justify-content: space-between;
  padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.bottom-bar .btn { min-width: 120px; min-height: 50px; }
.bottom-bar #btnNext { flex: 1; max-width: 360px; margin-left: auto; }
@media (min-width: 980px) { .bottom-bar { padding-left: calc((100vw - 948px) / 2); padding-right: calc((100vw - 948px) / 2); } }
.ocr-chip {
  position: fixed; right: 14px; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 25;
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 12px; font-size: .78rem; font-weight: 600; color: var(--muted); box-shadow: var(--shadow);
}
.ocr-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: pulse 1.2s ease-in-out infinite; }
.ocr-chip.ready .dot { background: var(--ok); animation: none; }
@keyframes pulse { 50% { opacity: .3; } }
.toast {
  position: fixed; left: 50%; top: calc(76px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 60;
  background: #0f1b2d; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: .92rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: min(520px, calc(100vw - 32px)); text-align: center;
}
.toast.ok { background: #14532d; }
.toast.warn { background: #78350f; }
.foot { max-width: 980px; margin: 8px auto 0; padding: 0 16px 24px; font-size: .78rem; color: var(--muted); text-align: center; }
body.step-scan .foot, body.step-scan .ocr-chip, body.step-scan .bottom-bar { display: none !important; }
body.step-scan, body.step-intro { padding-bottom: env(safe-area-inset-bottom); }
.scan-links { display: flex; justify-content: space-between; gap: 10px; }

#wmPreview { touch-action: none; cursor: grab; }
#wmPreview:active { cursor: grabbing; }
.range-field input[type=range] { width: 100%; max-width: 420px; accent-color: var(--primary); min-height: 32px; }

/* ---------- Namjena (eVisitor / druga) ---------- */
[data-mode="evisitor"] .custom-only, [data-mode="custom"] .evisitor-only, [data-mode="document"] .evisitor-only,
[data-mode="document"] .id-only, :root:not([data-mode="document"]) .doc-only { display: none !important; }
.mode-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 6px; }
@media (max-width: 860px) { .mode-choice { grid-template-columns: 1fr; } }
.mode-choice label { position: relative; cursor: pointer; }
.mode-choice input { position: absolute; opacity: 0; pointer-events: none; }
.mode-choice span { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; padding: 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface-2); height: 100%; transition: border-color .15s, background .15s, box-shadow .15s; }
.mode-choice i { grid-row: 1 / 3; font-style: normal; font-size: 1.5rem; width: 44px; height: 44px; display: grid; place-items: center; background: var(--surface); border-radius: 12px; border: 1px solid var(--line); }
.mode-choice b { font-size: 1rem; }
.mode-choice small { color: var(--muted); font-size: .84rem; }
.mode-choice input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.mode-choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); }
.custom-setup { margin-top: 14px; padding: 16px; border: 1px dashed color-mix(in srgb, var(--primary) 40%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--primary-soft) 40%, transparent); }
.doc-q { margin-top: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .82rem; font-weight: 600; padding: 6px 11px; border-radius: 999px; cursor: pointer; min-height: 34px; }
.chip:hover, .chip.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.chips.toggles label { position: relative; cursor: pointer; }
.chips.toggles input { position: absolute; opacity: 0; pointer-events: none; }
.chips.toggles span { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); font-size: .84rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; min-height: 36px; color: var(--muted); }
.chips.toggles span::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid currentColor; }
.chips.toggles input:checked + span { background: #0f172a; border-color: #0f172a; color: #fff; }
.chips.toggles input:checked + span::before { content: "✓"; border-color: transparent; font-size: .75rem; line-height: 14px; text-align: center; }
.chips.toggles input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); }

/* ---------- Dokumenti ---------- */
.drop { border: 2px dashed color-mix(in srgb, var(--primary) 45%, var(--line)); border-radius: 18px; background: var(--surface); padding: 28px 16px; text-align: center; transition: background .15s, border-color .15s; }
.drop.over { background: var(--primary-soft); border-color: var(--primary); }
.drop-ico { font-size: 2.4rem; }
.d-head { display: flex; align-items: baseline; gap: 10px; margin-top: 18px; }
.d-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.d-page { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.d-page img { width: 100%; display: block; border-radius: 6px; background: #fff; }
.d-page figcaption { display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.d-page figcaption span { flex: 1; }
.icon-btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font: inherit; }
.icon-btn:hover { border-color: var(--primary); }
.term-row input { flex: 1; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; font-size: .9rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.chip.term { background: #0f172a; color: #fff; border-color: #0f172a; }
.d-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.d-thumb { flex: none; width: 74px; border: 2px solid var(--line); border-radius: 8px; padding: 0; background: #fff; cursor: pointer; position: relative; scroll-snap-align: start; }
.d-thumb img { width: 100%; display: block; border-radius: 6px; }
.d-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.d-thumb.skipped img { opacity: .3; }
.d-badge { position: absolute; left: 4px; bottom: 4px; background: rgba(15,23,42,.85); color: #fff; font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.d-review { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 860px) { .d-review { grid-template-columns: 1fr; } }
.d-review .stage canvas { max-height: 78vh; }
.d-side { margin: 0; }
.d-group { margin: 10px 0; }
.d-group-head { display: flex; gap: 10px; align-items: center; padding: 6px 2px; cursor: pointer; }
.d-group-head input { width: 20px; height: 20px; accent-color: #0f172a; }
.d-group .r-item { margin: 4px 0 4px 18px; padding: 8px 10px; }
.wm-toggle { margin: 0 0 6px; }
.busy { position: fixed; inset: 0; z-index: 45; background: rgba(5, 10, 20, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.busy-card { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: 16px; padding: 18px; width: min(460px, 100%); box-shadow: var(--shadow); }
.ext-card { display: flex; gap: 14px; align-items: flex-start; margin-top: 16px; }
.ext-ico { font-size: 1.6rem; width: 46px; height: 46px; flex: none; display: grid; place-items: center; background: var(--primary-soft); border-radius: 12px; }
.ext-card .btn { margin-top: 4px; }
