:root {
  --ground: #F4F5F2;
  --card: #FFFFFF;
  --ink: #16191C;
  --muted: #5B6168;
  --line: #E3E5E0;
  --line-soft: #EEF0EC;
  --field: #D5D8D2;
  --accent: #0B6B6B;
  --accent-dark: #084F4F;
  --accent-soft: #E2F1EE;
  --accent-text: #0B5A5A;
  --mint: #3FD1B8;
  --warn: #C2410C;
  --warn-soft: #FDEBDD;
  --warn-text: #9A3412;
  --warn-bar: #E8834E;
  --dark: #16191C;
  --dark-2: #22272B;
  --dark-3: #2A2F34;
  --dark-text: #C9CDD1;
  --radius: 16px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.3px; }
.hidden { display: none !important; }

#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; position: relative; padding-bottom: calc(96px + var(--safe-bottom)); }
.wrap { padding: 0 20px; display: flex; flex-direction: column; gap: 14px; }

/* Kopfzeilen */
.top { padding: 28px 20px 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.top small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.top h1 { font-size: 32px; font-weight: 700; }
.bar { padding: 20px 12px 6px; display: flex; align-items: center; gap: 6px; }
.bar h1 { font-size: 20px; font-weight: 600; }
.bar .sub { font-size: 12px; color: var(--muted); }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; flex-shrink: 0; text-decoration: none; color: var(--ink); }
.icon-btn.plain { border: none; background: transparent; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 4px; background: var(--warn); }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Karten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.link { cursor: pointer; text-decoration: none; color: inherit; }
.card.alert { border: 1.5px solid var(--warn); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row.top-align { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.title { font-family: var(--display); font-size: 18px; font-weight: 600; }
.t15 { font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.section-h { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.section-h h2 { font-size: 20px; font-weight: 600; }
.label-caps { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.7px; }

.plate { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 8px; border: 1.5px solid var(--ink); letter-spacing: 0.5px; white-space: nowrap; }
.plate.light { background: #fff; color: var(--ink); border: none; }

.badge { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px; }
.badge.ok { background: var(--accent-soft); color: var(--accent-text); }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); }
.badge.plain { background: var(--line-soft); color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--accent-soft); }
.tile .k { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent-text); }
.tile .v { font-size: 15px; font-weight: 600; }
.tile .s { font-size: 12px; color: var(--accent-text); }
.tile.warn { background: var(--warn-soft); }
.tile.warn .k, .tile.warn .s { color: var(--warn-text); }
.tile.empty { background: var(--line-soft); }
.tile.empty .k, .tile.empty .s { color: var(--muted); }

.progress { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.progress.warn > span { background: var(--warn-bar); }

/* Hero */
.hero { background: var(--dark); color: #fff; border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.hero .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: #F6B48A; }
.hero .eyebrow.ok { color: var(--mint); }
.hero .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--dark-3); display: flex; align-items: center; justify-content: center; color: #F6B48A; flex-shrink: 0; }
.hero .ico.ok { color: var(--mint); }
.hero .htitle { font-family: var(--display); font-size: 19px; font-weight: 600; }
.hero .hsub { font-size: 13px; color: var(--dark-text); }
.hero .progress { height: 6px; background: var(--dark-3); }
.hero .progress > span { background: #F6B48A; }
.hero .progress.ok > span { background: var(--mint); }
.hero .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--dark-text); }

/* Buttons */
.btn { height: 48px; border-radius: 14px; border: none; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.block { width: 100%; height: 52px; font-size: 16px; }
.btn.light { background: #fff; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--field); }
.btn.ghost-dark { background: transparent; color: #fff; border: 1px solid #3A4046; }
.btn.danger { background: transparent; color: var(--warn-text); border: 1px solid #F0C4A8; }
.btn.sm { height: 36px; border-radius: 10px; font-size: 13px; padding: 0 12px; }
.btn.mint { background: var(--mint); color: #0F1214; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

.fab { position: fixed; right: max(20px, calc(50% - 260px)); bottom: calc(96px + var(--safe-bottom)); height: 52px; padding: 0 20px; border-radius: 26px; background: var(--accent); color: #fff; display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 15px; box-shadow: 0 8px 20px rgba(11, 107, 107, 0.3); z-index: 5; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { color: var(--ink); height: 36px; padding: 0 13px; border-radius: 18px; border: 1px solid var(--field); background: #fff; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: #E7E9E4; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { height: 40px; border-radius: 9px; border: none; background: transparent; font-weight: 500; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea { height: 44px; border-radius: 12px; border: 1px solid var(--field); background: #fff; padding: 0 12px; font-size: 15px; font-weight: 600; width: 100%; min-width: 0; }
.field textarea { height: 84px; padding: 10px 12px; font-weight: 500; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field.unsure label { color: var(--warn-text); font-weight: 600; }
.field.unsure input { border: 1.5px solid var(--warn); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; min-height: 32px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex-shrink: 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 14px; background: #C9CDC5; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

.info { display: flex; align-items: flex-start; gap: 10px; background: var(--accent-soft); border-radius: 14px; padding: 10px 12px; font-size: 13px; color: #0B4A4A; line-height: 1.4; }
.info.warn { background: var(--warn-soft); color: var(--warn-text); }

.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.months div { height: 22px; border-radius: 4px; background: var(--line-soft); }
.months div.on { background: var(--accent); }
.months-l { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; font-size: 10px; color: var(--muted); text-align: center; }
.months-l .on { color: var(--accent); font-weight: 700; }

/* Datenliste */
.dl { background: #fff; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.dl .r { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.dl .r:last-child { border-bottom: none; }
.dl .r span:first-child { color: var(--muted); }
.dl .r span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* Fahrzeug-Kopf */
.vhead { background: var(--dark); color: #fff; padding: 20px 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.vhead .icon-btn { background: var(--dark-3); border: none; color: #fff; }
.vhead h1 { font-size: 26px; font-weight: 700; }
.vhead .muted { color: var(--dark-text); }
.vhead .kmbox { display: flex; align-items: center; justify-content: space-between; background: var(--dark-2); border-radius: 14px; padding: 10px 12px; }
.tabs { display: flex; gap: 6px; padding: 14px 20px 4px; overflow-x: auto; }

/* Untere Navigation */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 10; padding-bottom: var(--safe-bottom); }
.nav-in { max-width: 560px; margin: 0 auto; height: 68px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; }
.nav a.on { color: var(--accent); font-weight: 600; }

.footer-action { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ground); border-top: 1px solid var(--line); padding: 14px 20px calc(20px + var(--safe-bottom)); z-index: 10; }
.footer-action > div { max-width: 520px; margin: 0 auto; }

/* Scan */
.scan { background: #0F1214; color: #fff; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: 32px; }
.scan .icon-btn { background: var(--dark-2); border: none; color: #fff; }
.scan .frame { margin: 20px 20px 0; border-radius: 24px; background: #1A1F23; position: relative; min-height: 380px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.scan .frame img { max-width: 100%; max-height: 460px; display: block; }
.scan .corner { position: absolute; width: 36px; height: 36px; border-color: var(--mint); border-style: solid; border-width: 0; }
.scan .c1 { top: 14px; left: 14px; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 14px; }
.scan .c2 { top: 14px; right: 14px; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 14px; }
.scan .c3 { bottom: 14px; left: 14px; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 14px; }
.scan .c4 { bottom: 14px; right: 14px; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 14px; }
.scan .doc { width: 76%; aspect-ratio: 3 / 4; border-radius: 10px; background: #D9E4D2; opacity: 0.18; }
.scan .status { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); background: #0F1214; border-radius: 16px; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--mint); white-space: nowrap; }
.scan .hint { padding: 0 24px; text-align: center; font-size: 14px; color: var(--dark-text); line-height: 1.45; }
.scan .controls { display: flex; align-items: center; justify-content: space-around; padding: 26px 24px 0; }
.scan .side { width: 68px; height: 64px; border-radius: 16px; background: var(--dark-2); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; cursor: pointer; border: none; text-decoration: none; }
.scan .shutter { width: 78px; height: 78px; border-radius: 39px; border: 4px solid #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; background: transparent; }
.scan .shutter span { width: 60px; height: 60px; border-radius: 30px; background: #fff; }
.scan .private { margin: 18px 20px 0; display: flex; align-items: center; gap: 10px; background: #1A1F23; border-radius: 14px; padding: 10px 12px; font-size: 12px; color: var(--dark-text); line-height: 1.4; }

/* Sheet / Dialog */
.sheet-bg { position: fixed; inset: 0; background: rgba(15, 18, 20, 0.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out; }
.sheet { background: var(--ground); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 18px 20px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 14px; max-height: 92dvh; overflow-y: auto; animation: up .2s ease-out; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #C9CDC5; margin: 0 auto 2px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0.6; } }

.toast { position: fixed; left: 50%; bottom: calc(110px + var(--safe-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; z-index: 100; max-width: calc(100% - 40px); box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.toast.err { background: var(--warn-text); }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty svg.i { width: 44px; height: 44px; color: #A8AEA4; }

.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; gap: 22px; max-width: 420px; margin: 0 auto; }
.auth .logo { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.auth .logo svg.i { width: 30px; height: 30px; }
.err-text { color: var(--warn-text); font-size: 13px; font-weight: 500; }

.list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; }
.list-item + .list-item { border-top: 1px solid var(--line-soft); }

@media (min-width: 700px) {
  #app { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
