/* MasterBrain – Designsystem 2026: schwebende Glasflächen, weiche Farbverläufe, große Typografie,
   folgt Hell/Dunkel des Systems, respektiert „Bewegung reduzieren“ und „Transparenz reduzieren“. */
:root {
  color-scheme: light dark;
  --bg: oklch(97.2% 0.008 270); --bg-2: oklch(94% 0.014 270);
  --text: oklch(22% 0.03 270); --muted: oklch(50% 0.03 270); --faint: oklch(62% 0.02 270);
  --glass: oklch(100% 0 0 / 0.66); --glass-strong: oklch(100% 0 0 / 0.82); --glass-line: oklch(100% 0 0 / 0.75);
  --line: oklch(22% 0.03 270 / 0.09); --fill: oklch(22% 0.03 270 / 0.05); --fill-2: oklch(22% 0.03 270 / 0.08);
  --accent: oklch(58% 0.22 280); --accent-2: oklch(68% 0.15 215); --accent-ink: #fff;
  --grad: linear-gradient(135deg, oklch(60% 0.23 285), oklch(66% 0.17 235) 55%, oklch(76% 0.13 195));
  --ok: oklch(58% 0.14 155); --warn: oklch(66% 0.15 65); --bad: oklch(58% 0.2 25);
  --ok-bg: oklch(58% 0.14 155 / 0.13); --warn-bg: oklch(72% 0.15 70 / 0.16); --bad-bg: oklch(58% 0.2 25 / 0.12); --info-bg: oklch(58% 0.18 260 / 0.12);
  --shadow: 0 1px 1px oklch(20% 0.05 270 / 0.04), 0 8px 24px -6px oklch(30% 0.08 270 / 0.14);
  --shadow-lg: 0 2px 4px oklch(20% 0.05 270 / 0.05), 0 24px 48px -12px oklch(30% 0.1 270 / 0.28);
  --r-sm: 12px; --r: 20px; --r-lg: 28px; --tap: 48px;
  --blur: blur(22px) saturate(180%);
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.4, .64, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI Variable Display", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(14.5% 0.02 275); --bg-2: oklch(18% 0.025 275);
    --text: oklch(95% 0.01 270); --muted: oklch(72% 0.02 270); --faint: oklch(58% 0.02 270);
    --glass: oklch(26% 0.025 275 / 0.55); --glass-strong: oklch(24% 0.025 275 / 0.82); --glass-line: oklch(100% 0 0 / 0.1);
    --line: oklch(100% 0 0 / 0.08); --fill: oklch(100% 0 0 / 0.05); --fill-2: oklch(100% 0 0 / 0.09);
    --accent: oklch(72% 0.16 280); --accent-2: oklch(78% 0.12 210); --accent-ink: oklch(16% 0.03 275);
    --ok: oklch(78% 0.14 155); --warn: oklch(82% 0.13 75); --bad: oklch(74% 0.16 25);
    --ok-bg: oklch(70% 0.14 155 / 0.16); --warn-bg: oklch(80% 0.13 75 / 0.15); --bad-bg: oklch(70% 0.17 25 / 0.17); --info-bg: oklch(72% 0.14 260 / 0.17);
    --shadow: 0 1px 0 oklch(100% 0 0 / 0.04) inset, 0 10px 30px -10px oklch(0% 0 0 / 0.6);
    --shadow-lg: 0 1px 0 oklch(100% 0 0 / 0.06) inset, 0 30px 60px -16px oklch(0% 0 0 / 0.7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; background: var(--bg); }
body { margin: 0; font: 17px/1.47 var(--font); letter-spacing: -0.011em; color: var(--text); background: transparent; min-height: 100dvh;
       -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01";
       padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Hintergrund: ruhige, langsam treibende Farbflächen */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
           background: radial-gradient(120% 80% at 50% -10%, var(--bg-2), var(--bg) 60%); }
.ambient i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(70px); opacity: .5; animation: drift 38s ease-in-out infinite alternate; }
.ambient i:nth-child(1) { background: oklch(75% 0.14 290 / .55); top: -35vmax; left: -20vmax; }
.ambient i:nth-child(2) { background: oklch(82% 0.11 210 / .5); top: -25vmax; right: -35vmax; animation-delay: -12s; }
.ambient i:nth-child(3) { background: oklch(85% 0.09 330 / .35); bottom: -45vmax; left: 10vmax; animation-delay: -24s; }
@media (prefers-color-scheme: dark) { .ambient i { opacity: .28; } }
@keyframes drift { to { transform: translate3d(6vmax, 5vmax, 0) scale(1.08); } }

/* Kopfzeile */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
       padding: calc(8px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
       background: color-mix(in oklab, var(--bg) 70%, transparent); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
       border-bottom: 1px solid transparent; transition: border-color .2s; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 17px/1 var(--font-display); letter-spacing: -0.02em; color: var(--text); margin-right: auto; }
.brand:hover { text-decoration: none; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--grad); color: #fff;
        box-shadow: 0 6px 16px -4px oklch(55% 0.22 280 / .55), inset 0 1px 0 oklch(100% 0 0 / .35); }
.logo .i { width: 20px; height: 20px; stroke-width: 1.9; }
.net { font-size: 13px; font-weight: 600; color: var(--warn); }
.net:not(:empty) { padding: 5px 10px; border-radius: 999px; background: var(--warn-bg); }
.hbtn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text); background: var(--glass);
        border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.hbtn:hover { text-decoration: none; }
.hbtn.active { color: var(--accent); }

main { max-width: 760px; margin: 0 auto; padding: 8px max(16px, env(safe-area-inset-left)) 24px; outline: none; }
main > * { animation: rise .42s var(--ease) both; }
main > *:nth-child(2) { animation-delay: .03s; } main > *:nth-child(3) { animation-delay: .06s; } main > *:nth-child(4) { animation-delay: .09s; }
main > *:nth-child(n+5) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

h1 { font: 800 32px/1.12 var(--font-display); letter-spacing: -0.03em; margin: 10px 0 14px; text-wrap: balance; }
h2 { font: 700 20px/1.25 var(--font-display); letter-spacing: -0.02em; margin: 28px 0 10px; }
h3 { font-size: 15px; font-weight: 700; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 15px; }
.eyebrow { color: var(--muted); font-size: 14px; font-weight: 600; margin: 8px 0 0; }

/* Flächen */
.card { position: relative; background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r); padding: 16px; margin: 12px 0;
        -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); }
a.card { display: block; color: inherit; transition: transform .25s var(--spring), box-shadow .25s; }
a.card:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
a.card:active { transform: scale(.985); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.warnbox, .okbox, .badbox { padding-left: 20px; }
.warnbox::before, .okbox::before, .badbox::before { content: ""; position: absolute; left: 7px; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; }
.warnbox::before { background: var(--warn); } .okbox::before { background: var(--ok); } .badbox::before { background: var(--bad); }

/* Formulare */
label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: 14px; color: var(--muted); }
input, select, textarea, button { font: inherit; color: inherit; letter-spacing: inherit; }
input[type=text], input[type=search], input[type=password], input[type=date], select, textarea {
  width: 100%; min-height: var(--tap); padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--fill);
  transition: border-color .15s, box-shadow .15s, background .15s; appearance: none; -webkit-appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
         background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--glass-strong); box-shadow: 0 0 0 4px oklch(60% 0.2 280 / .18); }
textarea { min-height: 104px; resize: vertical; }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }
input[type=range] { width: 100%; accent-color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
::placeholder { color: var(--faint); }
details > summary { cursor: pointer; list-style: none; font-weight: 600; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg); transition: transform .2s var(--ease); opacity: .6; }
details[open] > summary::after { transform: translateY(0) rotate(-135deg); }
details.card > summary { margin: -4px 0; padding: 4px 0; }
details[open].card > summary { margin-bottom: 10px; }

/* Schaltflächen */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 18px; border-radius: 999px;
       border: 1px solid var(--glass-line); background: var(--glass-strong); color: var(--text); cursor: pointer; font-weight: 650; font-size: 16px;
       box-shadow: var(--shadow); transition: transform .2s var(--spring), box-shadow .2s, background .2s; -webkit-user-select: none; user-select: none; }
.btn:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.btn:active { transform: scale(.96); }
.btn .i { width: 20px; height: 20px; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -8px oklch(55% 0.22 280 / .6), inset 0 1px 0 oklch(100% 0 0 / .3); }
.btn.danger { color: var(--bad); background: var(--bad-bg); border-color: transparent; box-shadow: none; }
.btn.small { min-height: 40px; padding: 7px 14px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--accent); }

/* Startseite */
.hero { margin: 4px 0 18px; }
.hero h1 { font-size: 36px; margin: 2px 0 16px; }
.search { position: relative; display: flex; gap: 8px; }
.search .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { flex: 1; font-size: 17px; border-radius: 999px; padding-left: 46px; min-height: 52px; background: var(--glass-strong); border-color: var(--glass-line);
                -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.search .btn { min-height: 52px; }
.bento, .big-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0 6px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 112px; padding: 16px; overflow: hidden;
        border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--glass-line); color: var(--text);
        -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); transition: transform .25s var(--spring), box-shadow .25s; }
.tile:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.tile:active { transform: scale(.97); }
.tile b { display: block; font: 700 17px/1.2 var(--font-display); letter-spacing: -0.015em; }
.tile small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; line-height: 1.3; }
.tile .ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--fill-2); color: var(--accent); }
.tile.hero-tile { grid-column: span 2; min-height: 150px; color: #fff; background: var(--grad); border-color: transparent;
                  box-shadow: 0 18px 40px -14px oklch(55% 0.22 280 / .7), inset 0 1px 0 oklch(100% 0 0 / .3); }
.tile.hero-tile::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%;
                         background: radial-gradient(circle, oklch(100% 0 0 / .35), transparent 70%); }
.tile.hero-tile small { color: oklch(100% 0 0 / .85); }
.tile.hero-tile .ico { background: oklch(100% 0 0 / .2); color: #fff; width: 52px; height: 52px; border-radius: 16px; }
.tile.hero-tile .ico .i { width: 28px; height: 28px; }
.tile .go { position: absolute; right: 16px; bottom: 16px; opacity: .7; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.stat { padding: 14px; border-radius: var(--r); background: var(--glass); border: 1px solid var(--glass-line); color: var(--text);
        -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow); }
.stat:hover { text-decoration: none; }
.stat b { display: block; font: 800 28px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.stat.warn b { color: var(--warn); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section-head a { font-size: 15px; font-weight: 600; }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.list.card { padding: 4px 16px; }
.list li { border-bottom: 1px solid var(--line); padding: 13px 2px; }
.list li:last-child { border-bottom: 0; }
.list a.item { display: block; color: inherit; }
.list a.item:hover { text-decoration: none; }
.list a.item:active { opacity: .7; }
.title { font-weight: 650; letter-spacing: -0.01em; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--fill-2); font-size: 13px; font-weight: 550; margin: 3px 4px 3px 0; }
.st { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px; border-radius: 999px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-empfangen, .st-in_verarbeitung, .st-uebertragung { background: var(--info-bg); color: var(--accent); }
.st-in_verarbeitung::before, .st-uebertragung::before { animation: pulse 1.2s ease-in-out infinite; }
.st-pruefung, .st-vorgeschlagen, .st-ungeklaert, .st-aus_dokument_unbestaetigt { background: var(--warn-bg); color: oklch(52% 0.13 60); }
.st-abgelegt, .st-bestaetigt, .st-erledigt, .st-offen { background: var(--ok-bg); color: var(--ok); }
.st-fehlgeschlagen, .st-nicht_gesichert { background: var(--bad-bg); color: var(--bad); }
.st-dublette, .st-keine { background: var(--fill-2); color: var(--muted); }
@media (prefers-color-scheme: dark) { .st-pruefung, .st-vorgeschlagen, .st-ungeklaert, .st-aus_dokument_unbestaetigt { color: var(--warn); } }
@keyframes pulse { 50% { opacity: .3; } }
.snip { font-size: 15px; color: var(--muted); margin-top: 6px; }
.snip b, .snip mark { background: oklch(90% 0.14 95); color: oklch(22% 0.03 270); font-weight: 650; border-radius: 4px; padding: 0 2px; }

/* Hinzufügen */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 16px; }
.mode { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; min-height: 120px; border-radius: var(--r-lg); cursor: pointer;
        background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
        box-shadow: var(--shadow); color: var(--text); font-weight: 650; text-align: left; margin: 0; transition: transform .25s var(--spring), box-shadow .25s; }
.mode:active { transform: scale(.97); }
.mode .ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: var(--fill-2); color: var(--accent); }
.mode small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; margin-top: 2px; }
.mode.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 16px 36px -14px oklch(55% 0.22 280 / .7); }
.mode.primary .ico { background: oklch(100% 0 0 / .2); color: #fff; }
.mode.primary small { color: oklch(100% 0 0 / .85); }
.subactions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.page { border: 1px solid var(--glass-line); border-radius: var(--r); padding: 8px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
        box-shadow: var(--shadow); animation: pop .35s var(--spring) both; }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
.page .muted { font-size: 13px; font-weight: 600; padding: 0 4px 6px; }
.page img { width: 100%; height: 180px; object-fit: contain; background: var(--fill); border-radius: 12px; display: block; transition: transform .3s var(--ease); }
.page .tools { display: flex; justify-content: space-between; gap: 4px; margin-top: 8px; }
.page .tools button { display: grid; place-items: center; min-width: 40px; min-height: 40px; border-radius: 12px; border: 0; background: var(--fill-2); color: var(--text); cursor: pointer; }
.page .tools button[disabled] { opacity: .35; }
.page .tools .i { width: 18px; height: 18px; }
.scanset { padding: 14px; }
.scanset .head { display: flex; align-items: center; gap: 12px; }
.scanset .badge-pdf { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--grad); color: #fff; font: 800 12px/1 var(--font-display); letter-spacing: .02em; }
.scanset .thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 12px 2px 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.scanset .thumbs::-webkit-scrollbar { display: none; }
.scanset .thumbs button { position: relative; flex: none; width: 96px; height: 128px; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
                          background: #fff; scroll-snap-align: start; cursor: pointer; box-shadow: var(--shadow); }
.scanset .thumbs img { width: 100%; height: 100%; object-fit: contain; display: block; }
.scanset .thumbs span { position: absolute; left: 6px; bottom: 6px; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center;
                        background: oklch(20% 0.03 270 / .75); color: #fff; font-size: 12px; font-weight: 700; padding: 0 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { margin: 0; font-weight: 600; font-size: 15px; color: var(--text); border: 1px solid var(--glass-line); border-radius: 999px; padding: 9px 15px; min-height: 42px;
             background: var(--glass); cursor: pointer; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: background .2s, color .2s, transform .2s var(--spring); }
.seg label:active { transform: scale(.95); }
.seg input:checked + label { background: var(--text); color: var(--bg); border-color: transparent; }
.seg input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.progress { height: 8px; background: var(--fill-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: var(--grad); width: 0; transition: width .25s var(--ease); border-radius: inherit; }

/* Details */
.kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 10px 14px; font-size: 15px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; font-weight: 550; }
.ev { font-size: 13px; color: var(--muted); }
.msg { padding: 12px 15px; border-radius: 22px; margin: 10px 0; white-space: pre-wrap; animation: rise .3s var(--ease) both; }
.msg.user { background: var(--grad); color: #fff; margin-left: 18%; border-bottom-right-radius: 8px; }
.msg.bot { background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
           box-shadow: var(--shadow); margin-right: 6%; border-bottom-left-radius: 8px; }
.msg.bot .card { box-shadow: none; }
.thumb { width: 100%; max-height: 420px; object-fit: contain; background: var(--fill); border-radius: var(--r); box-shadow: var(--shadow); }
pre.receipt { white-space: pre-wrap; font: 13px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--fill); padding: 12px; border-radius: 14px; overflow-x: auto; }
code { font: 0.9em ui-monospace, "SF Mono", Menlo, monospace; background: var(--fill-2); padding: 1px 6px; border-radius: 6px; }

/* Lade-Platzhalter */
.skel { display: block; height: 16px; border-radius: 8px; margin: 10px 0;
        background: linear-gradient(90deg, var(--fill) 25%, var(--fill-2) 50%, var(--fill) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.skel.lg { height: 64px; border-radius: var(--r); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Schwebende Tableiste */
.tabs { position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom));
        width: min(calc(100% - 24px), 520px); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 6px;
        border-radius: 32px; background: var(--glass-strong); border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
        box-shadow: var(--shadow-lg); }
.tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: 26px;
          font-size: 11px; font-weight: 600; color: var(--muted); transition: color .2s, background .25s var(--ease), transform .25s var(--spring); }
.tabs a:hover { text-decoration: none; }
.tabs a:active { transform: scale(.92); }
.tabs a .i { width: 24px; height: 24px; }
.tabs a.active { color: var(--accent); background: var(--fill-2); }
.tabs a.active .i { stroke-width: 2.2; }
.tabs a.fab { width: 60px; height: 60px; min-height: 60px; margin: -18px auto 0; border-radius: 22px; color: #fff; background: var(--grad);
              box-shadow: 0 12px 26px -8px oklch(55% 0.22 280 / .75), inset 0 1px 0 oklch(100% 0 0 / .35); }
.tabs a.fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tabs a.fab .i { width: 28px; height: 28px; stroke-width: 2; }
.tabs a.fab.active { background: var(--grad); color: #fff; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(100px + env(safe-area-inset-bottom)); width: min(calc(100% - 32px), 520px);
         background: oklch(22% 0.03 270 / .92); color: #fff; padding: 13px 16px; border-radius: 18px; z-index: 30; font-weight: 550; font-size: 15px;
         -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-lg); animation: toast .35s var(--spring); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } }
.hidden { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 900px) {
  main { max-width: 1000px; padding-top: 16px; }
  .split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; }
  .bento { grid-template-columns: repeat(4, 1fr); }
  .tile.hero-tile { grid-row: span 2; }
}

/* ===================================================================== Scanner (immer dunkel, Vollbild) */
html.scn-open, html.scn-open body { overflow: hidden; }
.scn { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; font-family: var(--font); --g: oklch(100% 0 0 / .14); --gl: oklch(100% 0 0 / .2);
       animation: scnIn .3s var(--ease); touch-action: none; }
@keyframes scnIn { from { opacity: 0; transform: scale(1.02); } }
.scn section { position: absolute; inset: 0; display: flex; flex-direction: column; }
.scn section[hidden] { display: none; }
.scn video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.scn-ov { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scn-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.scn-flash.go { animation: flash .45s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }
.scn-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
.scn-cam .scn-top { background: linear-gradient(oklch(0% 0 0 / .55), transparent); }
.scn-hint { flex: 1; text-align: center; font-weight: 650; font-size: 15px; padding: 9px 14px; border-radius: 999px; background: oklch(0% 0 0 / .4);
            -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scn-title { flex: 1; text-align: center; font-weight: 700; font-size: 16px; }
.scn-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--gl); background: var(--g); color: #fff; cursor: pointer;
          -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); margin: 0; flex: none; }
.scn-ic[aria-pressed=true] { background: #fff; color: #000; }
.scn-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--gl); background: var(--g);
            color: #fff; font-weight: 650; font-size: 15px; cursor: pointer; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); flex: none; }
.scn-pill .i { width: 18px; height: 18px; }
.scn-pill[aria-pressed=true] { background: #fff; color: #000; }
.scn-pill[aria-pressed=false] { opacity: .75; }
.scn-pill.accent { background: var(--grad); border-color: transparent; }
.scn-torch { position: absolute; z-index: 2; right: 14px; top: calc(70px + env(safe-area-inset-top)); }
.scn-bottom { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between;
              padding: 24px 28px calc(24px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, oklch(0% 0 0 / .6)); }
.scn-bottom.dim .scn-shutter { opacity: .3; pointer-events: none; }
.scn-shutter { position: relative; width: 80px; height: 80px; border: 0; padding: 0; background: none; cursor: pointer; }
.scn-shutter svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.scn-shutter .ring-bg { fill: none; stroke: oklch(100% 0 0 / .9); stroke-width: 4; }
.scn-shutter .ring { fill: none; stroke: #7cf0c4; stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .12s linear; }
.scn-shutter span { position: absolute; inset: 9px; border-radius: 50%; background: #fff; transition: transform .15s var(--spring); }
.scn-shutter:active span { transform: scale(.88); }
.scn-stack { position: relative; width: 56px; height: 66px; border: 0; padding: 0; background: none; cursor: pointer; color: #fff; }
.scn-stack[disabled] { opacity: .35; }
.scn-thumbs { position: absolute; inset: 0; }
.scn-thumbs img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 2px solid #fff; background: #fff;
                  box-shadow: 0 6px 16px oklch(0% 0 0 / .5); animation: pop .35s var(--spring) both; }
.scn-thumbs img:nth-last-child(2) { transform: rotate(-6deg) translate(-3px, 2px); }
.scn-thumbs img:nth-last-child(3) { transform: rotate(6deg) translate(3px, 2px); }
.scn-count { position: absolute; right: -8px; top: -8px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--grad);
             display: grid; place-items: center; font-size: 13px; z-index: 2; }
.scn-nocam { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; padding: 24px; }
.scn-nocam[hidden] { display: none; }
.scn-nocard { max-width: 340px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.scn-nocard > .i { width: 48px; height: 48px; opacity: .7; }
.scn-sub { color: oklch(100% 0 0 / .7); font-size: 14px; }
.scn-edit { background: oklch(13% 0.015 275); }
.scn-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; padding: 8px 16px; }
.scn-view { display: block; border-radius: 6px; box-shadow: 0 20px 50px oklch(0% 0 0 / .6); touch-action: none; background: #fff; }
.scn-view:focus-visible { outline: 3px solid var(--accent); }
.scn-loupe { position: absolute; top: 12px; left: 12px; width: 120px; height: 120px; border-radius: 50%; pointer-events: none; box-shadow: 0 10px 30px oklch(0% 0 0 / .6); }
.scn-loupe.right { left: auto; right: 12px; }
.scn-busy { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scn-busy[hidden] { display: none; }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid oklch(100% 0 0 / .25); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scn-panel { padding: 6px 0 calc(10px + env(safe-area-inset-bottom)); background: oklch(17% 0.02 275 / .9); border-top: 1px solid oklch(100% 0 0 / .08); }
.scn-filters { display: flex; gap: 10px; overflow-x: auto; padding: 8px 16px; scrollbar-width: none; }
.scn-filters::-webkit-scrollbar, .scn-strip::-webkit-scrollbar { display: none; }
.scn-filters button { flex: none; display: grid; justify-items: center; gap: 6px; padding: 4px; border: 2px solid transparent; border-radius: 14px; background: none; color: #fff;
                      font-size: 13px; font-weight: 650; cursor: pointer; }
.scn-filters button canvas { width: 64px; height: 84px; object-fit: contain; border-radius: 8px; background: #fff; }
.scn-filters button[aria-checked=true] { border-color: #8f9cff; background: oklch(100% 0 0 / .06); }
.scn-adjust { display: grid; gap: 4px; padding: 6px 20px 10px; }
.scn-adjust[hidden], .scn-cropbar[hidden], .scn-filters[hidden], .scn-tools[hidden], .scn-strip[hidden] { display: none; }
.scn-adjust label { color: oklch(100% 0 0 / .85); margin: 4px 0; font-size: 13px; }
.scn-adjust .scn-pill { justify-self: start; min-height: 36px; font-size: 14px; }
.scn-cropbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; }
.scn-cropbar .scn-sub { flex: 1 1 100%; }
.scn-tools { display: grid; grid-template-columns: repeat(6, 1fr); padding: 2px 8px; }
.scn-tools button { display: grid; justify-items: center; gap: 3px; min-height: 56px; padding: 6px 2px; border: 0; border-radius: 14px; background: none; color: oklch(100% 0 0 / .8);
                    font-size: 11px; font-weight: 600; cursor: pointer; }
.scn-tools button[aria-pressed=true] { color: #fff; background: oklch(100% 0 0 / .1); }
.scn-tools .i { width: 24px; height: 24px; }
.scn-strip { display: flex; gap: 8px; overflow-x: auto; padding: 6px 16px 2px; }
.scn-strip button { position: relative; flex: none; width: 46px; height: 60px; padding: 0; border-radius: 8px; border: 2px solid transparent; overflow: hidden; background: #fff; cursor: pointer; }
.scn-strip button.on { border-color: #8f9cff; }
.scn-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scn-strip span { position: absolute; right: 2px; bottom: 2px; font-size: 10px; font-weight: 800; color: #fff; background: oklch(0% 0 0 / .6); border-radius: 6px; padding: 0 4px; }
.scn-strip .add { display: grid; place-items: center; background: oklch(100% 0 0 / .1); color: #fff; border: 1px dashed oklch(100% 0 0 / .4); }
.scn .btn.primary { color: #fff; }

/* Barrierefreiheit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ambient i { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: var(--bg-2); --glass-strong: var(--bg-2); }
  .ambient { display: none; }
}
@media (prefers-contrast: more) {
  :root { --line: oklch(40% 0.03 270 / .5); --glass-line: oklch(40% 0.03 270 / .5); --muted: var(--text); }
}

/* Menü „Mehr“ */
.menu a.item { gap: 14px; flex-wrap: nowrap; }
.menu a.item > .i:last-child { color: var(--faint); width: 18px; height: 18px; }
.tile-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--fill-2); color: var(--accent); flex: none; }

/* Korrekturen nach Sichtprüfung */
[hidden] { display: none !important; }
main:focus, main:focus-visible { outline: none; }
.menu a.item { display: flex; align-items: center; }
.row:has(> input[type=checkbox]) { flex-wrap: nowrap; align-items: flex-start; }
.row > input[type=checkbox] + label { margin: 0; font-weight: 500; color: var(--text); font-size: 15px; }

/* Lange Wörter (Dateinamen, Adressen) dürfen umbrechen statt aus der Karte zu laufen */
main, .card, .list li, .title, h1, h2, dd, .snip, .msg { overflow-wrap: anywhere; word-break: normal; }
.row > .grow { min-width: 0; }
