/* ============================================================
   My Vault – Gestaltung
   Ruhig, dunkel-hell, Grün als Riegel. Space Grotesk für Titel,
   IBM Plex für Text und Technik. Alles selbst gehostet.
   Keine Inline-Styles nötig: die CSP erlaubt nur diese Datei.
   ============================================================ */

@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-display: swap; src: url('fonts/space-grotesk-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 600; font-display: swap; src: url('fonts/space-grotesk-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url('fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url('fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  --bg:          #F3F2EE;
  --card:        #FFFFFF;
  --card-2:      #FAFAF7;
  --text:        #0F1720;
  --text-2:      #4A525C;
  --sep:         #D6D4CC;
  --sep-soft:    #E8E6DF;
  --accent:      #2F6B4F;
  --accent-soft: #E3EDE7;
  --on-accent:   #FFFFFF;
  --mint:        #7FD1A8;
  --ink:         #0F1720;
  --on-ink:      #F3F2EE;
  --warn:        #8A4800;
  --warn-icon:   #B25E00;
  --warn-soft:   #FFF3E3;
  --warn-line:   #F0D2AA;
  --bad:         #A61F30;
  --bad-soft:    #FDEEF0;
  --bad-line:    #F2C4CB;
  --focus:       #2F6B4F;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --tap:  48px;

  --font-ui:      'IBM Plex Sans', -apple-system, system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, Menlo, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1720; --card: #1C2733; --card-2: #16202B; --text: #F3F2EE; --text-2: #A9B2BC;
    --sep: #34414F; --sep-soft: #26323F; --accent: #7FD1A8; --accent-soft: #1E3A2E; --on-accent: #0F1720;
    --ink: #F3F2EE; --on-ink: #0F1720;
    --warn: #F5C27F; --warn-icon: #F0AA50; --warn-soft: #33260F; --warn-line: #5C4219;
    --bad: #F59AA5; --bad-soft: #3A1A20; --bad-line: #5E2A33; --focus: #7FD1A8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1720; --card: #1C2733; --card-2: #16202B; --text: #F3F2EE; --text-2: #A9B2BC;
  --sep: #34414F; --sep-soft: #26323F; --accent: #7FD1A8; --accent-soft: #1E3A2E; --on-accent: #0F1720;
  --ink: #F3F2EE; --on-ink: #0F1720;
  --warn: #F5C27F; --warn-icon: #F0AA50; --warn-soft: #33260F; --warn-line: #5C4219;
  --bad: #F59AA5; --bad-soft: #3A1A20; --bad-line: #5E2A33; --focus: #7FD1A8;
  color-scheme: dark;
}

/* Immer dunkle Screens: Start und Entsperren */
.screen.dark {
  --bg: #0F1720; --card: #1C2733; --text: #F3F2EE; --text-2: #A9B2BC; --sep: #34414F;
  --accent: #7FD1A8; --on-accent: #0F1720; --ink: #F3F2EE; --on-ink: #0F1720; --focus: #7FD1A8;
  --warn: #F5C27F; --warn-soft: #33260F; --warn-line: #5C4219; --bad: #F59AA5; --bad-soft: #3A1A20;
  background: var(--bg);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--accent); }
button { font: inherit; color: inherit; }
h1, h2 { margin: 0; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-2); }
.center { text-align: center; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Logo ---------- */
.logo-bg   { fill: var(--ink); }
.logo-ring { stroke: var(--mint); }
.logo-v    { stroke: var(--on-ink); }
.logo-dot  { fill: var(--mint); }
.screen.dark .logo-bg { fill: #1C2733; }
.screen.dark .logo-v  { stroke: #F3F2EE; }

/* ---------- Screens ---------- */
.screen {
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 20px calc(32px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.screen.with-tabs { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
.screen.centered { justify-content: center; }
#home-body, #results { display: flex; flex-direction: column; gap: 16px; }
#results:empty { display: none; }
.screen.dark { max-width: none; align-items: center; }
.screen.dark > * { width: 100%; max-width: 400px; }
.screen.dark > .badge-e2e, .screen.dark > .warn-icon { width: 64px; }
.screen.dark > .badge-e2e { width: auto; }
.screen { min-width: 0; }
.feature strong, .row-title, .alert strong { overflow-wrap: anywhere; }

.hero { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; margin: 24px 0 12px; }
.hero-title { font: 600 34px/1.1 var(--font-display); letter-spacing: -0.02em; }
.hero-sub { margin: 0; color: var(--text-2); font-size: 15px; }

.foot { margin: 8px 0 0; text-align: center; font: 11px/1.4 var(--font-mono); letter-spacing: .08em; color: var(--text-2); }

.facts { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 12px; color: var(--text-2); font-size: 14px; }
.facts li { display: flex; gap: 12px; align-items: flex-start; }
.facts svg { flex-shrink: 0; color: var(--accent); margin-top: 1px; }

/* ---------- Kopfzeile ---------- */
.topbar { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.topbar-title { flex: 1; font: 600 20px/1.2 var(--font-display); letter-spacing: -0.01em; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar.home { justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; }
.wordmark { font: 600 22px/1 var(--font-display); letter-spacing: -0.02em; }
.icon-spacer { width: 44px; flex-shrink: 0; }

.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: 1px solid var(--sep); background: var(--card);
  color: var(--text); cursor: pointer; text-decoration: none;
}
.icon-btn:disabled { opacity: .5; }

/* ---------- Knöpfe ---------- */
.btn {
  min-height: 52px; padding: 0 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 14px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: opacity .15s;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--ink); color: var(--on-ink); }
.screen.dark .btn.primary, .btn.mint { background: var(--mint); color: #0F1720; }
.btn.ghost { background: transparent; border-color: var(--sep); color: var(--text); }
.btn.danger { background: var(--bad); color: #fff; }
:root[data-theme="dark"] .btn.danger { color: #1a0a0d; }
.btn.danger-ghost { background: transparent; border-color: var(--bad-line); color: var(--bad); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; font-weight: 500; }

.link { background: none; border: 0; padding: 8px; color: var(--accent); font-size: 15px; cursor: pointer; text-decoration: none; display: block; margin: 0 auto; }

.stack { display: flex; flex-direction: column; gap: 10px; }

.spin, .spinner {
  display: inline-block; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite;
}
.spin { width: 16px; height: 16px; }
.spinner { width: 32px; height: 32px; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 0; color: var(--text-2); }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 500; color: var(--text-2); }
.input-wrap { position: relative; display: flex; }
.input {
  width: 100%; min-height: 52px; padding: 12px 14px;
  border-radius: 14px; border: 1.5px solid var(--sep); background: var(--card);
  color: var(--text); font: 400 17px/1.4 var(--font-ui);
  -webkit-appearance: none; appearance: none;
}
.input.mono { font-family: var(--font-mono); font-size: 16px; letter-spacing: .02em; }
textarea.input { resize: vertical; min-height: 96px; }
select.input { padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.input.inline { width: auto; min-height: 40px; padding: 6px 34px 6px 12px; font-size: 15px; }
.input:focus { border-color: var(--accent); outline: none; }
.input-wrap .input[type="password"], .input-wrap .input.has-reveal { padding-right: 52px; }
.reveal { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hint { margin: 0; font-size: 13px; color: var(--text-2); }
.lead { margin: 0; color: var(--text-2); font-size: 15px; }
.form-error { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bad-soft); color: var(--bad); font-size: 14px; }

.strength { width: 100%; height: 6px; border-radius: 3px; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--accent); margin: 1px 0 0; }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 20px; border-radius: var(--r-md); border: 1.5px dashed var(--sep); background: var(--card);
  color: var(--text); cursor: pointer; text-align: center; font-weight: 500;
}
.drop small { font-weight: 400; color: var(--text-2); font-size: 13px; }
.picked { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.picked li { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.picked li span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked .mono { font-size: 12px; color: var(--text-2); }
.progress { width: 100%; height: 8px; accent-color: var(--accent); }

/* ---------- Hinweise ---------- */
.note {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-md);
  background: var(--accent-soft); color: var(--text); font-size: 14px; line-height: 1.5;
}
.note > svg { flex-shrink: 0; color: var(--accent); margin-top: 1px; }
.note.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); }
.note.warn > svg { color: var(--warn-icon); }
.note.bad { background: var(--bad-soft); border: 1px solid var(--bad-line); }
.note.bad > svg { color: var(--bad); }

.badge-e2e {
  align-self: center; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font: 500 12px/1 var(--font-mono);
}
.badge-e2e svg { width: 14px; height: 14px; }
.screen.dark .badge-e2e { background: rgba(127, 209, 168, .12); }

/* ---------- Authenticator ---------- */
.steps { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 15px; display: grid; gap: 4px; }
.qr-box { align-self: center; padding: 12px; background: #fff; border-radius: var(--r-md); border: 1px solid var(--sep); }
.qr { display: block; width: 208px; height: 208px; }
.details summary { cursor: pointer; color: var(--accent); font-size: 15px; padding: 6px 0; }
.secret { font-size: 17px; letter-spacing: .06em; word-break: break-all; padding: 12px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--sep); margin: 8px 0 0; }

/* ---------- Notfallschlüssel ---------- */
.sheet { border: 1.5px solid var(--sep); border-radius: var(--r-lg); background: var(--card); padding: 20px; display: grid; gap: 16px; }
.sheet-head { display: flex; gap: 12px; align-items: center; }
.sheet-head div { display: flex; flex-direction: column; }
.sheet-head span { font-size: 13px; color: var(--text-2); }
.sheet-code { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; font-size: 18px; font-weight: 500; letter-spacing: .06em; }
.sheet-code span { text-align: center; padding: 6px 0; border-radius: 8px; background: var(--card-2); border: 1px solid var(--sep-soft); }
.sheet-foot { margin: 0; font-size: 12px; color: var(--text-2); }

/* ---------- Tresor ---------- */
.search {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--sep); color: var(--text-2);
}
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: 16px var(--font-ui); outline: none; -webkit-appearance: none; }

.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid var(--warn-line);
  color: var(--text); text-decoration: none; font-size: 15px;
}
.alert > svg { color: var(--warn-icon); flex-shrink: 0; }
.alert.is-bad { background: var(--bad-soft); border-color: var(--bad-line); }
.alert.is-bad > svg { color: var(--bad); }
.alert-more { display: block; font-size: 13px; color: var(--text-2); }

.cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cat {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--sep);
  color: var(--text); text-decoration: none; min-height: 104px;
}
.cat-icon { color: var(--accent); }
.cat-name { font-size: 14px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.cat-count { font-size: 12px; color: var(--text-2); margin-top: auto; }

.section-title { font: 500 12px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); margin: 8px 0 -4px; }

.list { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--sep); border-radius: var(--r-md); overflow: hidden; }
.list:empty { display: none; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px;
  color: var(--text); text-decoration: none; border-top: 1px solid var(--sep-soft);
}
.row:first-child { border-top: 0; }
.row > svg:last-child { color: var(--text-2); flex-shrink: 0; }
.row-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.row-icon.is-bad { background: var(--bad-soft); color: var(--bad); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--text-2); }
.row-sub.is-warn { color: var(--warn); }
.row-sub.is-bad { color: var(--bad); }
.row.static { cursor: default; }

.pill { display: inline-block; font: 500 12px/1 var(--font-ui); padding: 5px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.is-warn { background: var(--warn-soft); color: var(--warn); }
.pill.is-bad { background: var(--bad-soft); color: var(--bad); }

.group { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--sep); border-radius: var(--r-md); overflow: hidden; }
.usage { width: 100%; height: 8px; margin-top: 8px; }

.fab {
  position: fixed; right: max(20px, calc(50% - 260px)); bottom: calc(100px + env(safe-area-inset-bottom));
  width: 60px; height: 60px; border-radius: 20px;
  background: var(--ink); color: var(--mint);
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  box-shadow: 0 8px 24px rgba(15, 23, 32, .25);
}

.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 48px 8px; }
.empty h2 { font: 600 22px/1.2 var(--font-display); }
.empty p { margin: 0; color: var(--text-2); max-width: 340px; }

/* ---------- Eintrag ---------- */
.item-title { font: 600 28px/1.15 var(--font-display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.files { display: grid; gap: 10px; }
.file { border: 1px solid var(--sep); border-radius: var(--r-md); background: var(--card); overflow: hidden; }
.file-preview { display: none; background: var(--card-2); border-bottom: 1px solid var(--sep-soft); }
.file-preview.open { display: block; }
.file-preview img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.file-preview video { display: block; width: 100%; max-height: 70vh; background: #000; }
.file-preview audio { display: block; width: calc(100% - 24px); margin: 12px; }
.file-preview iframe { display: block; width: 100%; height: 70vh; border: 0; background: #fff; }
.file-preview p { padding: 16px; margin: 0; }
.file-bar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; }
.file-name { flex: 1; min-width: 0; font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 12px; color: var(--text-2); }
.file-bar .icon-btn { border: 0; }

.facts-list { margin: 0; background: var(--card); border: 1px solid var(--sep); border-radius: var(--r-md); }
.facts-list div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--sep-soft); }
.facts-list div:first-child { border-top: 0; }
.facts-list dt { color: var(--text-2); }
.facts-list dd { margin: 0; text-align: right; font-weight: 500; }
.note-text p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--sep); border-radius: var(--r-md); padding: 14px 16px; }


/* ---------- Vorsorge ---------- */
.progress-card { background: var(--ink); color: var(--on-ink); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 12px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.progress-head .mono { color: var(--mint); }
:root[data-theme="dark"] .progress-head .mono { color: var(--accent); }
.progress-card meter { width: 100%; height: 8px; }
.progress-link { display: flex; justify-content: space-between; color: inherit; opacity: .85; text-decoration: none; font-size: 14px; }
.progress-link span { color: var(--mint); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .progress-link span, :root:not([data-theme="light"]) .progress-head .mono { color: #2F6B4F; } }
:root[data-theme="dark"] .progress-link span { color: #2F6B4F; }

.check-dot { width: 26px; height: 26px; border-radius: 13px; border: 2px dashed var(--warn-icon); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.check-dot.on { border: 0; background: var(--accent); color: var(--on-accent); }

.feature { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--text); text-decoration: none; }
.feature > svg:first-child { color: var(--accent); flex-shrink: 0; }
.feature > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.feature small { color: var(--text-2); font-size: 13px; }
.feature > svg:last-child { color: var(--accent); }
.feature.static > svg:last-child { color: var(--accent); }

.share-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--sep); background: var(--card); }
.share-row > svg { color: var(--text-2); flex-shrink: 0; }
.share-row.on { background: var(--accent-soft); border-color: transparent; }
.share-row.on > svg { color: var(--accent); }
.share-row > span { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.share-row small { color: var(--text-2); font-size: 13px; }

.fp-box { display: grid; gap: 8px; }
.fp { margin: 0; font-size: 22px; letter-spacing: .08em; text-align: center; padding: 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--sep); }

.warn-icon { width: 64px; height: 64px; border-radius: 20px; background: rgba(240, 170, 80, .15); color: #F0AA50; display: flex; align-items: center; justify-content: center; margin-top: 40px; }
.warn-icon svg { width: 32px; height: 32px; }
.warn-title { font: 600 28px/1.15 var(--font-display); letter-spacing: -0.02em; }
.hero-sub.left { text-align: left; }
.countdown { background: #1C2733; border: 1px solid #34414F; border-radius: var(--r-lg); padding: 20px; display: grid; gap: 14px; }
.countdown-head { display: flex; justify-content: space-between; align-items: baseline; color: #A9B2BC; font-size: 14px; }
.countdown-head strong { font: 600 30px/1 var(--font-display); color: #F0AA50; }
.countdown meter { width: 100%; height: 8px; }
.countdown-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: #8C96A1; flex-wrap: wrap; }
.countdown.light { background: var(--card); border-color: var(--sep); }
.countdown.light .countdown-head { color: var(--text-2); }
.countdown.light .countdown-head strong { color: var(--warn-icon); }
.countdown.light .countdown-foot { color: var(--text-2); }
.push-down { margin-top: auto; }

.sheet-text { margin: 0; font-size: 15px; }
.sheet-steps { margin: 0; padding-left: 20px; font-size: 14px; display: grid; gap: 4px; }

/* ---------- Navigation ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--sep);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; color: var(--text-2); text-decoration: none; font-size: 12px;
}
.tab.active { color: var(--accent); font-weight: 600; }
.tabbar-brand, .tabbar-foot { display: none; }

/* ---------- Toast und Dialog ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 14px;
  background: var(--ink); color: var(--on-ink); font-size: 15px; transition: all .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }

.dialog-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 32, .5); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.dialog { width: 100%; max-width: 420px; background: var(--card); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 10px; }
.dialog h2 { font: 600 20px/1.2 var(--font-display); }
.dialog p { margin: 0; color: var(--text-2); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }

/* ---------- Breite Bildschirme: Seitenleiste ---------- */
@media (min-width: 900px) {
  .screen.with-tabs { margin-left: 240px; margin-right: 0; padding-left: 48px; padding-right: 48px; max-width: none; padding-bottom: 48px; }
  .tabbar {
    top: 0; right: auto; width: 240px; display: flex; flex-direction: column; gap: 4px;
    padding: 24px 16px; border-top: 0; border-right: 1px solid var(--sep);
    background: #0F1720;
  }
  .tabbar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; color: #F3F2EE; }
  .tabbar-brand .logo-bg { fill: #1C2733; }
  .tabbar-brand .logo-v { stroke: #F3F2EE; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 12px; font-size: 15px; color: #D3D8DD; border-radius: 10px; min-height: 44px; }
  .tab.active { background: #7FD1A8; color: #0F1720; }
  .tabbar-foot { display: block; margin-top: auto; padding: 0 8px; font: 11px var(--font-mono); letter-spacing: .08em; color: #8C96A1; }
  .cats { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .topbar.home .brand .logo { display: none; }
  .fab { right: 40px; bottom: 40px; }
  .toast { bottom: 40px; }
  .dialog-wrap { align-items: center; }
}

/* ---------- Druck: nur der Notfallschlüssel ---------- */
@media print {
  body { background: #fff; color: #000; }
  .screen.recovery-screen > *:not(.form), .form > *:not(.sheet), .tabbar, .toast { display: none !important; }
  .sheet { border: 2px solid #000; color: #000; background: #fff; }
  .sheet-code span { border-color: #999; background: #fff; }
  .sheet-head span, .sheet-foot { color: #333; }
  .logo-bg { fill: #000; } .logo-v { stroke: #fff; } .logo-ring { stroke: #888; } .logo-dot { fill: #888; }
}

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

/* ---------- Scanner ---------- */
html.scanning, html.scanning body { overflow: hidden; }
.scanner {
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column;
  background: #0F1720; color: #F3F2EE;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.scan-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.scan-title { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.scan-title strong { font: 600 17px/1.2 var(--font-display); }
.scan-title span { font-size: 13px; color: #A9B2BC; }
.scan-count { width: 44px; text-align: right; font: 500 13px var(--font-mono); color: #7FD1A8; }
.scan-icon { width: 44px; height: 44px; border-radius: 12px; border: 0; background: #1C2733; color: #F3F2EE; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.scan-stage { flex: 1; position: relative; min-height: 0; }
.scan-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.scan-intro, .scan-busy { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px; text-align: center; color: #A9B2BC; }
.scan-intro p, .scan-busy p { max-width: 320px; margin: 0; }
.scan-frame { position: relative; width: min(56vw, 240px); aspect-ratio: 1 / 1.414; }
.scan-frame i { position: absolute; width: 34px; height: 34px; border: 3px solid #7FD1A8; }
.scan-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.scan-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.scan-frame i:nth-child(3) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.scan-frame i:nth-child(4) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.scan-preview { display: flex; align-items: center; justify-content: center; padding: 16px; }
.scan-result { max-width: 100%; max-height: 100%; background: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .45); }
.scan-modes { display: flex; justify-content: center; gap: 6px; padding: 4px 16px 8px; }
.scan-modes button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid #34414F; background: transparent; color: #D3D8DD; font: 500 14px var(--font-ui); cursor: pointer; }
.scan-modes button.on { background: #7FD1A8; border-color: #7FD1A8; color: #0F1720; }
.scan-thumbs { display: flex; gap: 10px; padding: 8px 16px; overflow-x: auto; }
.scan-thumb { position: relative; flex-shrink: 0; }
.scan-thumb img { display: block; height: 72px; border-radius: 6px; background: #fff; }
.scan-thumb span { position: absolute; left: 4px; bottom: 4px; font: 500 11px var(--font-mono); background: rgba(15, 23, 32, .8); color: #fff; padding: 1px 5px; border-radius: 4px; }
.scan-thumb button { position: absolute; right: -8px; top: -8px; width: 28px; height: 28px; border-radius: 14px; border: 2px solid #0F1720; background: #F59AA5; color: #1a0a0d; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.scan-thumb button svg { width: 14px; height: 14px; }
.scan-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 10px; padding: 12px 16px 16px; }
.scan-foot.capture { grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); }
.scan-btn { min-height: 52px; padding: 0 10px; width: 100%; white-space: nowrap; border-radius: 14px; border: 1.5px solid #34414F; background: transparent; color: #F3F2EE; font: 600 15px var(--font-ui); display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.scan-btn.mint { background: #7FD1A8; border-color: #7FD1A8; color: #0F1720; }
.scan-btn:disabled { opacity: .5; }
.scan-shutter { width: 76px; height: 76px; border-radius: 38px; border: 4px solid #F3F2EE; background: #7FD1A8; color: #0F1720; display: flex; align-items: center; justify-content: center; cursor: pointer; justify-self: center; }
.scan-spacer { display: block; }
.scan-foot.capture > .scan-btn { width: auto; max-width: 100%; }
.scan-foot.capture > :first-child { justify-self: start; }
.scan-foot.capture > :last-child { justify-self: end; }
.topbar-actions { display: flex; gap: 8px; }
.icon-btn.small { width: 32px; height: 32px; border: 0; background: transparent; }
.picked li .icon-btn.small svg { width: 16px; height: 16px; }
@media (max-width: 380px) { .scan-btn { font-size: 14px; gap: 6px; } .scan-btn svg { display: none; } }
