:root {
  color-scheme: light;
  --bg: #EEF1F3;
  --card: #FFFFFF;
  --card-2: #F6F8F9;
  --ink: #14212B;
  --ink-2: #4A5A66;
  --ink-3: #7B8A95;
  --line: #D6DDE2;
  --accent: #F2B705;          /* Signalgelb */
  --accent-ink: #14212B;
  --accent-soft: #FDF3CF;
  --eu: #1F4AA8;              /* EU-Band am Kennzeichen */
  --ok: #1E8A57;
  --ok-soft: #DDF2E7;
  --warn: #B86E00;
  --warn-soft: #FBEBD2;
  --danger: #B8322A;
  --danger-soft: #F8DEDB;
  --topbar: #14212B;
  --topbar-ink: #F4F6F7;
  --shadow: 0 1px 2px rgba(20, 33, 43, .06), 0 4px 16px rgba(20, 33, 43, .06);
  --radius: 14px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-cond: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0D151B;
    --card: #15212A;
    --card-2: #1B2933;
    --ink: #E7EDF0;
    --ink-2: #A9B7C0;
    --ink-3: #7D8D98;
    --line: #283843;
    --accent-soft: #3A3210;
    --ok: #4CC08A;
    --ok-soft: #173427;
    --warn: #F0A53A;
    --warn-soft: #3A2A12;
    --danger: #F0776E;
    --danger-soft: #3D1C1A;
    --topbar: #0A1116;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D151B;
  --card: #15212A;
  --card-2: #1B2933;
  --ink: #E7EDF0;
  --ink-2: #A9B7C0;
  --ink-3: #7D8D98;
  --line: #283843;
  --accent-soft: #3A3210;
  --ok: #4CC08A;
  --ok-soft: #173427;
  --warn: #F0A53A;
  --warn-soft: #3A2A12;
  --danger: #F0776E;
  --danger-soft: #3D1C1A;
  --topbar: #0A1116;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
img, video { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px;
  background: var(--topbar); color: var(--topbar-ink);
}
.topbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-inline: 4px; }
.topbar-title strong { font: 700 20px/1.1 var(--font-cond); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title small { color: #9FB0BC; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: inherit;
  display: grid; place-items: center;
}
.icon-btn:active { background: rgba(255,255,255,.1); }

.app { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(120px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 600; font-size: 16px; text-decoration: none;
  transition: transform .08s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-danger { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Kennzeichen ---------- */
.plate {
  display: inline-flex; align-items: stretch; height: 34px; border: 2px solid #111; border-radius: 6px;
  background: #fff; color: #111; overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,.15); max-width: 100%;
}
.plate-eu {
  background: var(--eu); color: #fff; width: 20px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  font: 700 11px/1 var(--font); padding-bottom: 3px; position: relative; flex: none;
}
.plate-eu::before {
  content: ""; position: absolute; top: 5px; left: 50%; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%;
  border: 1.5px dotted #FFD400;
}
.plate-txt { font: 600 24px/30px var(--font-cond); letter-spacing: .06em; padding: 0 10px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate-lg { height: 48px; border-width: 2.5px; border-radius: 8px; }
.plate-lg .plate-eu { width: 28px; font-size: 14px; }
.plate-lg .plate-eu::before { width: 15px; height: 15px; margin-left: -7.5px; top: 7px; }
.plate-lg .plate-txt { font-size: 36px; line-height: 43px; padding-inline: 10px 14px; }

.vin { font: 600 14px/1.3 var(--font-mono); letter-spacing: .08em; color: var(--ink-2); word-break: break-all; }
.vin-missing { font: 500 14px var(--font); color: var(--ink-3); }

/* ---------- Liste ---------- */
.list-head { display: flex; gap: 12px; align-items: center; }
.search { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.case-list { display: flex; flex-direction: column; gap: 10px; }
.case-card {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: center;
  padding: 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 0; text-align: left; width: 100%;
}
.case-card .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-3); font-size: 14px; }
.case-card .date { color: var(--ink-3); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.pips { display: flex; gap: 4px; align-items: center; }
.pip { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.pip.on { background: var(--ok); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

.empty { text-align: center; padding: 40px 16px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty-art { width: 120px; height: 72px; }
.empty h2 { font: 700 24px/1.15 var(--font-cond); text-transform: uppercase; letter-spacing: .02em; color: var(--ink); }
.empty p { margin: 0; max-width: 34ch; }
.steps-preview { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; text-align: left; font-size: 15px; }
.steps-preview li { display: flex; gap: 10px; align-items: baseline; }
.steps-preview b { font: 700 15px var(--font-cond); color: var(--ink); width: 18px; }

/* ---------- Fall-Ansicht ---------- */
.vehicle {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.vehicle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 15px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

.progress-line { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.progress-line .pips { flex: none; }

.step {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.step-head { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.step-no {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font: 700 22px/1 var(--font-cond); background: var(--card-2); color: var(--ink-2); border: 2px solid var(--line);
}
.step.done .step-no { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done .step-no svg { width: 20px; height: 20px; stroke-width: 3; }
.step-head h2 { font: 700 20px/1.15 var(--font-cond); text-transform: uppercase; letter-spacing: .02em; }
.step-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 14.5px; }
.step-head .opt { color: var(--ink-3); font-weight: 500; text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 14px; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.thumb {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--card-2);
  border: 0; padding: 0; max-width: 100%;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .tag {
  position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px;
  background: rgba(10, 17, 22, .72); color: #fff; font: 600 11px/1.5 var(--font); letter-spacing: .03em;
}
.thumb .note-dot { position: absolute; right: 5px; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; }
.thumb .note-dot svg { width: 12px; height: 12px; stroke: #14212B; stroke-width: 2.5; }
.thumb .vid-icon { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.thumb .vid-icon svg { width: 34px; height: 34px; fill: rgba(0,0,0,.45); stroke: #fff; stroke-width: 1.5; }

.step-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.step-actions .btn-primary { flex: 1 1 160px; }
.step-actions .btn:not(.btn-primary) { flex: 1 1 auto; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 13px; color: var(--ink-3); }
.field .hint.bad { color: var(--warn); }
.field .hint.good { color: var(--ok); }
.input, .textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card-2); font-size: 16px;
}
.textarea { min-height: 88px; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-mono { font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.input-plate { font: 600 24px var(--font-cond); letter-spacing: .06em; text-transform: uppercase; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 48px; font-variant-numeric: tabular-nums; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; }

.danger-zone { display: flex; justify-content: center; padding-top: 8px; }

/* ---------- Untere Leiste ---------- */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.bottombar-inner { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; }
.bottombar-inner .btn { flex: 1; }

/* ---------- Dialoge ---------- */
.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 640px; max-height: 92dvh;
  border-radius: 20px 20px 0 0; background: var(--card); color: var(--ink);
}
.sheet::backdrop { background: rgba(8, 14, 18, .55); }
.sheet[open] { animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 20px; } }
.sheet-body { padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font: 700 22px/1.15 var(--font-cond); text-transform: uppercase; letter-spacing: .02em; }
.sheet-head .icon-btn { color: var(--ink-2); }
.sheet-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sheet-actions .btn { flex: 1 1 140px; }
.sheet-small .sheet-body p { margin: 0; color: var(--ink-2); }
.media-view { background: #000; border-radius: 12px; overflow: hidden; display: grid; place-items: center; max-height: 55dvh; }
.media-view img, .media-view video { max-height: 55dvh; width: auto; margin: 0 auto; }
.media-meta { font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 12px; font-variant-numeric: tabular-nums; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0; }
.switch span small { display: block; color: var(--ink-3); font-size: 13px; }
.switch input { width: 48px; height: 28px; accent-color: var(--ok); flex: none; }
.storage { font-size: 13px; color: var(--ink-3); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 100; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

/* ---------- Kamera ---------- */
.cam { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; overflow: hidden; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.cam video.mirror { transform: scaleX(-1); }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: flash .25s ease-out; }
@keyframes flash { from { opacity: .8; } to { opacity: 0; } }

.cam-top {
  position: absolute; left: 0; right: 0; top: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 28px;
  background: linear-gradient(rgba(0,0,0,.65), transparent);
}
.cam-title { text-align: center; min-width: 0; }
.cam-title strong { display: block; font: 700 18px/1.2 var(--font-cond); text-transform: uppercase; letter-spacing: .03em; }
.cam-title small { display: block; font-size: 13px; color: #D5DDE2; }
.cam-pill {
  min-height: 40px; padding: 0 14px; border-radius: 99px; border: 0; background: rgba(255,255,255,.18);
  color: #fff; font-weight: 600; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.cam-pill.on { background: var(--accent); color: #14212B; }
.cam-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 36px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: linear-gradient(transparent, rgba(0,0,0,.7));
}
.cam-controls { width: 100%; max-width: 420px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.cam-controls > :first-child { justify-self: start; }
.cam-controls > :last-child { justify-self: end; }
.shutter {
  width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px;
}
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: all .15s ease; }
.shutter:active span { transform: scale(.9); }
.shutter.video span { background: #E0352B; }
.shutter.recording span { border-radius: 8px; transform: scale(.5); background: #E0352B; }
.cam-round, .cam-last {
  width: 54px; height: 54px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff;
  display: grid; place-items: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  background-size: cover; background-position: center; font: 700 16px var(--font);
}
.cam-last { border-radius: 12px; border: 2px solid #fff; }
.cam-last span { background: rgba(0,0,0,.55); padding: 1px 7px; border-radius: 99px; font-size: 14px; }
.cam-modes { display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: rgba(0,0,0,.45); }
.cam-modes button {
  min-height: 34px; padding: 0 14px; border-radius: 99px; border: 0; background: transparent; color: #fff;
  font: 700 14px var(--font-cond); letter-spacing: .06em; text-transform: uppercase;
}
.cam-modes button[aria-selected="true"] { background: var(--accent); color: #14212B; }
.cam-zoom { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 360px; font-size: 13px; font-variant-numeric: tabular-nums; }
.cam-zoom input { flex: 1; accent-color: var(--accent); }
.cam-rec {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 72px); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 99px; background: #E0352B;
  font: 600 15px var(--font-mono); font-variant-numeric: tabular-nums;
}
.cam-rec .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* Hilfslinien */
.cam-guide { position: absolute; inset: 0; pointer-events: none; }
.grid-lines { position: absolute; inset: 0; }
.grid-lines::before, .grid-lines::after { content: ""; position: absolute; border-color: rgba(255,255,255,.28); border-style: solid; }
.grid-lines::before { left: 33.33%; right: 33.33%; top: 0; bottom: 0; border-width: 0 1px; }
.grid-lines::after { top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-width: 1px 0; }
.plate-guide {
  position: absolute; left: 50%; top: 62%; width: 34%; max-width: 240px; aspect-ratio: 4.7 / 1; transform: translate(-50%, -50%);
  border: 2px dashed rgba(242, 183, 5, .9); border-radius: 6px;
}
.plate-guide::after {
  content: "Kennzeichen"; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 6px;
  font: 700 12px var(--font-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); white-space: nowrap;
  text-shadow: 0 1px 2px #000;
}
.vin-slot {
  position: absolute; left: 50%; top: 44%; width: 92%; max-width: 720px; aspect-ratio: 5.5 / 1; transform: translate(-50%, -50%);
  border: 3px solid var(--accent); border-radius: 10px;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .62);
}
.vin-slot::before, .vin-slot::after {
  position: absolute; left: 0; right: 0; text-align: center; font-size: 14px; text-shadow: 0 1px 2px #000; padding-inline: 8px;
}
.vin-slot::before { content: "FIN (17 Zeichen) in den Rahmen bringen"; bottom: 100%; margin-bottom: 10px; font: 700 15px var(--font-cond); letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.vin-slot::after { content: "Frontscheibe unten links · schräg halten gegen Spiegelung · ggf. Licht einschalten"; top: 100%; margin-top: 10px; color: #E3E9EC; }
.km-slot, .part-slot {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  border: 3px solid var(--accent); border-radius: 10px;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .62);
}
.km-slot { width: 70%; max-width: 480px; aspect-ratio: 3.5 / 1; }
.part-slot { width: 92%; max-width: 720px; aspect-ratio: 5 / 1; }
.km-slot::before, .km-slot::after, .part-slot::before, .part-slot::after {
  position: absolute; left: 0; right: 0; text-align: center; font-size: 14px; text-shadow: 0 1px 2px #000; padding-inline: 8px;
}
.km-slot::before, .part-slot::before { bottom: 100%; margin-bottom: 10px; font: 700 15px var(--font-cond); letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.km-slot::after, .part-slot::after { top: 100%; margin-top: 10px; color: #E3E9EC; }
.km-slot::before { content: "Kilometerstand in den Rahmen bringen"; }
.km-slot::after { content: "Nur die Gesamt-km, nicht den Tageszähler · Zündung an"; }
.part-slot::before { content: "Teilenummer in den Rahmen bringen"; }
.part-slot::after { content: "Eine Zeile · nah heran · ohne Spiegelung"; }

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

/* ---------- Scannen ---------- */
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.btn-scan { flex: none; padding: 0 12px; gap: 6px; }
@media (max-width: 380px) { .btn-scan span { display: none; } }
.btn-narrow { flex: 0 0 auto !important; }
.vehicle-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scan-preview { width: 100%; max-height: 140px; object-fit: contain; background: #000; border-radius: 10px; }

.plate-slot {
  position: absolute; left: 50%; top: 42%; width: 84%; max-width: 560px; aspect-ratio: 4.7 / 1; transform: translate(-50%, -50%);
  border: 3px solid var(--accent); border-radius: 10px;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .55);
}
.plate-slot::before, .plate-slot::after {
  position: absolute; left: 0; right: 0; text-align: center; text-shadow: 0 1px 2px #000; padding-inline: 8px;
}
.plate-slot::before { content: "Kennzeichen in den Rahmen bringen"; bottom: 100%; margin-bottom: 10px; font: 700 15px var(--font-cond); letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.plate-slot::after { content: "Blaues EU-Feld links an den Rahmen · gerade von vorn"; top: 100%; margin-top: 10px; font-size: 14px; color: #E3E9EC; }
.eu-mark { position: absolute; left: 0; top: 0; bottom: 0; width: 7%; background: rgba(31, 74, 168, .45); border-radius: 6px 0 0 6px; }
.scan-line {
  position: absolute; left: 4%; right: 4%; height: 2px; top: 50%; background: var(--accent); opacity: .8;
  box-shadow: 0 0 10px var(--accent); animation: scanline 1.6s ease-in-out infinite alternate;
}
@keyframes scanline { from { top: 12%; } to { top: 88%; } }
/* Wert erkannt: Balken füllt sich in einer Sekunde, solange der Code ruhig gehalten wird */
.hold-bar { position: absolute; left: 0; bottom: 0; height: 5px; width: 0; background: var(--ok); border-radius: 0 3px 3px 0; opacity: 0; }
.holding { border-color: var(--ok) !important; }
.holding .scan-line { opacity: 0; }
.holding .hold-bar { opacity: 1; animation: holdfill 1s linear forwards; }
@keyframes holdfill { from { width: 0; } to { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .holding .hold-bar { width: 100%; } }
.scan-status {
  position: absolute; left: 50%; top: calc(100% + 64px); transform: translateX(-50%); white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
  padding: 6px 14px; border-radius: 99px; background: rgba(0, 0, 0, .7); color: #fff; font: 600 15px var(--font-mono); letter-spacing: .04em;
}
.shutter.scan span { background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card-2); font: 600 18px var(--font-cond); letter-spacing: .05em; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Anmeldung, Konto, Sync ---------- */
.auth { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; max-width: 460px; width: 100%; margin: 8px auto 0; }
.auth h2 { font: 700 26px/1.1 var(--font-cond); text-transform: uppercase; letter-spacing: .02em; }
.auth p { margin: 0; color: var(--ink-2); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; margin: 0 -10px; }
.auth-links .btn { min-height: 40px; padding: 0 10px; font-size: 15px; }
.notice { padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok) !important; font-size: 15px; font-weight: 500; }
.notice.bad { background: var(--danger-soft); color: var(--danger) !important; }
.hint-muted { font-size: 14px; color: var(--ink-3) !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.account { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--card-2); }
.account small { display: block; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.account b { font-weight: 600; }
.account span { display: block; font-size: 14px; color: var(--ink-3); }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sync-state {
  flex: none; min-width: 44px; height: 32px; padding: 0 10px; border-radius: 99px; border: 0;
  background: rgba(255,255,255,.1); color: var(--topbar-ink); font: 600 14px var(--font); font-variant-numeric: tabular-nums;
}
.sync-ok { color: #7FD8A8; }
.sync-offline { background: rgba(240,165,58,.2); color: #F5C07A; }
.sync-error { background: rgba(240,119,110,.25); color: #F7A49D; }
.progress { height: 10px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }

/* ---------- QR-Code-Anmeldung, Geräte ---------- */
.qr-slot {
  position: absolute; left: 50%; top: 44%; width: min(70vw, 60vh, 360px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border: 3px solid var(--accent); border-radius: 16px;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .55);
}
.qr-box { background: #fff; padding: 14px; border-radius: 14px; width: min(300px, 78vw); margin: 0 auto; }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-meta { text-align: center; color: var(--ink-2); font-size: 15px; }
.qr-meta b { font-variant-numeric: tabular-nums; }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.device-list { display: flex; flex-direction: column; gap: 8px; }
.device { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--card-2); }
.device div { flex: 1; min-width: 0; }
.device b { display: block; font-weight: 600; }
.device small { color: var(--ink-3); font-size: 13px; }
/* QR-Code: die allgemeine Icon-Linienstärke (2) würde die Module verschmieren */
.qr-box svg, .qr-box svg path { stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; }
.qr-box svg path[fill] { stroke: none; }

/* ---------- Einrichtung Home-Bildschirm (iPhone) ---------- */
.install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.install-steps li { display: flex; gap: 12px; align-items: flex-start; }
.install-steps li > span { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 16px var(--font-cond); }
.install-steps small { display: block; color: var(--ink-3); font-size: 13px; }
.install-steps svg { width: 18px; height: 18px; vertical-align: -3px; }

/* ---------- Archiv ---------- */
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: var(--card-2); }
.tab { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: 600 15px var(--font); }
.tab.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.badge-muted { background: var(--card-2); color: var(--ink-3); }
.archived-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius); background: var(--card-2); color: var(--ink-2); font-weight: 600; }
.danger-zone { gap: 8px; flex-wrap: wrap; }
.archive-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.badge-type { background: var(--accent-soft); color: var(--ink); }
.badge-versicherung { background: var(--card-2); color: var(--ink-2); }
.badge-known { background: var(--accent-soft); color: var(--ink); }
.history { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--card-2); }
.history h3 { margin: 0 0 6px; font: 700 14px var(--font-cond); letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.history-item { display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; width: 100%; padding: 8px 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font: 500 14px var(--font); text-align: left; cursor: pointer; }
.history-item:first-of-type { border-top: 0; }
.tabs-sm { display: inline-flex; padding: 3px; gap: 4px; border-radius: 10px; }
.tabs-sm .tab { min-height: 32px; padding: 0 12px; font-size: 14px; border-radius: 8px; white-space: nowrap; }
.pips-many .pip { width: 12px; }

/* ---------- Zwei-Faktor-Anmeldung (Superadmin) ---------- */
.mfa-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
.mfa-manual summary { cursor: pointer; color: var(--ink-2); font-size: 14px; }
.mfa-manual p { margin: 8px 0 4px; font-size: 14px; color: var(--ink-3); }
.mfa-secret { display: block; padding: 10px 12px; border-radius: 10px; background: var(--card-2); font: 600 15px/1.5 var(--font-mono, ui-monospace, monospace); letter-spacing: .06em; word-break: break-all; user-select: all; }
.input-code { font: 600 24px var(--font-mono, ui-monospace, monospace); letter-spacing: .3em; text-align: center; }
.mfa-codes { list-style: none; margin: 0; padding: 12px; border-radius: 12px; background: var(--card-2); display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; font: 600 16px var(--font-mono, ui-monospace, monospace); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--ok); flex: none; }
.adm-card.mfa-card { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.mfa-card > div { flex: 1 1 260px; min-width: 0; }
.mfa-card p { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; }
