/* MEN-schine – Design 2.2 */
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #eef2f1;
  --surface-3: #e4eae8;
  --text: #0e1615;
  --text-2: #33403d;
  --muted: #6b7875;
  --line: rgba(14, 22, 21, .08);
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e0f4f1;
  --accent-soft-ink: #0b6b63;
  --grad: linear-gradient(135deg, #14b8a6 0%, #0d9488 55%, #0f766e 100%);
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fff4e0;
  --ok: #15803d;
  --shadow-sm: 0 1px 2px rgba(16, 24, 22, .05), 0 1px 1px rgba(16, 24, 22, .03);
  --shadow: 0 1px 2px rgba(16, 24, 22, .04), 0 6px 20px rgba(16, 24, 22, .07);
  --shadow-lg: 0 12px 40px rgba(16, 24, 22, .16);
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 24px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --glass: rgba(244, 246, 245, .82);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e0d;
    --surface: #131a19;
    --surface-2: #1a2321;
    --surface-3: #23302d;
    --text: #e9f0ee;
    --text-2: #c3cfcc;
    --muted: #8a9895;
    --line: rgba(255, 255, 255, .07);
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-ink: #042f2b;
    --accent-soft: rgba(45, 212, 191, .13);
    --accent-soft-ink: #5eead4;
    --grad: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 60%, #0d9488 100%);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .12);
    --ok: #4ade80;
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .05);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .6);
    --glass: rgba(10, 14, 13, .8);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15.5px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; }
body { overscroll-behavior-y: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.err { color: var(--danger); min-height: 1.2em; }
b, strong { font-weight: 650; }
h2, h3 { letter-spacing: -.02em; }

.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#app { display: flex; flex-direction: column; height: 100dvh; max-width: 820px; margin: 0 auto; position: relative; }

/* Kopfzeile */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--safe-t)) 16px 8px;
  background: var(--glass); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; letter-spacing: -.02em; }
.logo { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); color: #fff; display: inline-grid; place-items: center; box-shadow: 0 4px 12px rgba(13, 148, 136, .35); }
.logo .ic { width: 18px; height: 18px; }
.logo.big { width: 64px; height: 64px; border-radius: 20px; }
.logo.big .ic { width: 34px; height: 34px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; display: inline-block; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.dot.off { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
.topactions { display: flex; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow-sm); display: inline-grid; place-items: center; color: var(--text-2); padding: 0; transition: transform .12s ease, background .15s; }
.icon-btn:active { transform: scale(.94); }
.icon-btn .ic { width: 20px; height: 20px; }
.icon-btn.sos { background: var(--danger-soft); color: var(--danger); box-shadow: none; }

main { flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 96px; }
#view-chat { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
#view-chat.hidden { display: none; }
.page { padding: 8px 16px 40px; animation: fade .22s ease; }
.page > h2 { font-size: 30px; font-weight: 780; margin: 8px 0 4px; }
.page > h2 + .muted, .page > h2 + p { margin-top: 0; }
.page h3 { font-size: 17px; font-weight: 700; margin: 26px 0 10px; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Navigation */
.tabbar { position: absolute; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); z-index: 6; display: flex; padding: 6px;
  background: var(--surface); border-radius: 26px; box-shadow: var(--shadow-lg); }
@media (prefers-color-scheme: dark) { .tabbar { background: rgba(26, 35, 33, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); } }
.tabbar button { flex: 1; background: none; border: 0; padding: 6px 0 5px; font-size: 10.5px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 20px; letter-spacing: .01em; }
.tabbar button span { width: 48px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background .18s, color .18s; }
.tabbar button .ic { width: 21px; height: 21px; }
.tabbar button.active { color: var(--accent-soft-ink); }
.tabbar button.active span { background: var(--accent-soft); }
.tabbar button.active .ic { stroke-width: 2.2; }

.banner { margin: 0 12px 6px; padding: 10px 14px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; border-radius: var(--r-sm); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Chat */
.chatbar { display: flex; align-items: center; gap: 10px; padding: 4px 16px 8px; }
.chat-title { flex: 1; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; font-size: 14px; color: var(--text-2); }
.messages { flex: 1; overflow-y: auto; padding: 8px 14px 14px; display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: 22px; word-wrap: break-word; overflow-wrap: anywhere; animation: pop .2s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.msg.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 7px; white-space: pre-wrap; box-shadow: 0 4px 14px rgba(13, 148, 136, .22); }
@media (prefers-color-scheme: dark) { .msg.user { color: #042f2b; } }
.msg.model { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 7px; max-width: 100%; box-shadow: var(--shadow); line-height: 1.55; }
.msg.model p { margin: .4em 0; }
.msg.model h3, .msg.model h4, .msg.model h5 { margin: .8em 0 .3em; font-size: 1em; font-weight: 700; }
.msg.model ul, .msg.model ol { margin: .35em 0; padding-left: 1.3em; }
.msg.model li { margin: .2em 0; }
.msg.model li::marker { color: var(--muted); }
.msg.model code { background: var(--surface-2); padding: 1px 6px; border-radius: 7px; font-size: .92em; font-family: inherit; font-weight: 600; }
.msg.model hr { border: 0; border-top: 1px solid var(--line); margin: .7em 0; }
.msg.model blockquote { margin: .5em 0; padding: 6px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; color: var(--text-2); }
.tbl { overflow-x: auto; margin: .5em 0; border-radius: 12px; border: 1px solid var(--line); }
.msg table { border-collapse: collapse; font-size: .9em; width: 100%; }
.msg th { background: var(--surface-2); font-weight: 650; }
.msg th, .msg td { border-bottom: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.msg tr:last-child td { border-bottom: 0; }
.msg .meta { display: flex; gap: 4px 12px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.msg.user .meta { color: rgba(255, 255, 255, .78); justify-content: flex-end; }
@media (prefers-color-scheme: dark) { .msg.user .meta { color: rgba(4, 47, 43, .7); } }
.msg .meta button { background: var(--surface-2); border: 0; color: var(--text-2); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.msg .err { color: var(--danger); background: var(--danger-soft); padding: 8px 10px; border-radius: 12px; margin-top: 6px; font-size: 14px; }
.msg .att { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.msg .att img { width: 96px; height: 96px; object-fit: cover; border-radius: 14px; }
.msg .att .file { background: rgba(255, 255, 255, .2); border-radius: 10px; padding: 5px 10px; font-size: 13px; }
.typing:empty::after, .typing::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; vertical-align: middle; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

.empty-chat { margin: auto 0; padding: 20px 6px; text-align: center; }
.empty-chat h2 { font-size: 28px; font-weight: 780; margin: 14px 0 4px; }
.empty-chat > p { margin: 0 0 20px; }
.hero-mark { display: flex; justify-content: center; }
.suggest { display: grid; gap: 10px; text-align: left; }
.sg { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; background: var(--surface); border: 0; border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); text-align: left; transition: transform .12s; }
.sg:active { transform: scale(.98); }
.sg-i { grid-row: span 2; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-soft-ink); display: grid; place-items: center; }
.sg b { font-size: 15px; }
.sg small { color: var(--muted); font-size: 13px; }

.composer { padding: 6px 12px calc(92px + var(--safe-b)); }
.composer-card, .inputrow { background: var(--surface); border-radius: 26px; box-shadow: var(--shadow-lg); }
.inputrow { display: flex; align-items: flex-end; gap: 2px; padding: 6px; }
.inputrow .icon-btn { background: transparent; box-shadow: none; width: 40px; height: 40px; color: var(--muted); }
.inputrow .icon-btn.big { min-width: 0; min-height: 0; font-size: inherit; padding: 0; }
#input { flex: 1; resize: none; border: 0; border-radius: 18px; padding: 9px 8px; font: inherit; font-size: 16px; max-height: 150px; background: transparent; color: var(--text); outline: none; }
#input::placeholder { color: var(--muted); }
.send-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; flex: none; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(13, 148, 136, .35); transition: transform .12s; }
.send-btn:active { transform: scale(.92); }
@media (prefers-color-scheme: dark) { .send-btn { color: #042f2b; } }
.send-btn .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.send-btn .i-stop { display: none; }
.send-btn.stop { background: var(--danger); box-shadow: none; }
.send-btn.stop .i-send { display: none; }
.send-btn.stop .i-stop { display: block; }
.quick { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-sm); transition: transform .12s, background .15s; }
.chip:active { transform: scale(.96); }
.chip.primary, .chip.hot { background: var(--accent-soft); color: var(--accent-soft-ink); box-shadow: none; }
.quick .chip.hot { background: var(--grad); color: #fff; }
@media (prefers-color-scheme: dark) { .quick .chip.hot { color: #042f2b; } }
.pending, .ctx-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pending:empty, .ctx-chips:empty { display: none; }
.pending { padding: 0 2px 10px; }
.ctx-chips { padding: 0 2px 8px; }
.pend { position: relative; }
.pend img { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; display: block; box-shadow: var(--shadow); }
.pend .file { height: 64px; display: flex; align-items: center; padding: 0 12px; background: var(--surface); border-radius: 14px; font-size: 13px; max-width: 180px; overflow: hidden; box-shadow: var(--shadow); }
.pend .x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--bg); background: var(--text); color: var(--bg); font-size: 10px; line-height: 18px; padding: 0; }
.ctx { font-size: 12.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent-soft-ink); border-radius: 999px; padding: 5px 12px; }
.ctx button { border: 0; background: none; padding: 0 0 0 6px; color: inherit; }

/* Karten & Listen */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card > b:first-child { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 4px; }
.card.alarm { background: var(--danger-soft); box-shadow: none; }
.card.alarm > b:first-child { color: var(--danger); }
.setup { margin: 6px 14px; }
.setup ol { padding-left: 1.2em; margin: 8px 0 0; }
.setup li { margin: 10px 0; }
.setup .done { color: var(--muted); text-decoration: line-through; }
.list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.item { background: var(--surface); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.item .t { font-weight: 650; font-size: 15.5px; }
.item .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.item .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.item.sel { box-shadow: 0 0 0 2px var(--accent); }
.badge { display: inline-block; font-size: 11px; font-weight: 650; background: var(--accent-soft); color: var(--accent-soft-ink); border-radius: 999px; padding: 2px 9px; margin-left: 8px; vertical-align: 2px; }

/* Buttons & Formulare */
.btn { border: 0; background: var(--surface-2); color: var(--text); border-radius: 14px; padding: 11px 16px; font-size: 14.5px; font-weight: 600; min-height: 44px; transition: transform .12s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; }
.card .btn, .item .btn { background: var(--surface-2); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(13, 148, 136, .28); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #042f2b; box-shadow: none; } }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-outline { background: var(--danger-soft); color: var(--danger); }
.btn.small { padding: 7px 12px; min-height: 34px; font-size: 13px; border-radius: 11px; }
.btn.wide { width: 100%; margin-top: 12px; }
.row { display: flex; align-items: center; }
.gap { gap: 8px; }
.wrap { flex-wrap: wrap; }
.field { width: 100%; border: 1.5px solid transparent; border-radius: 14px; padding: 12px 14px; font: inherit; font-size: 16px; background: var(--surface-2); color: var(--text); margin: 6px 0 12px; transition: border-color .15s, background .15s; }
.field:focus { outline: none; border-color: var(--accent); background: var(--surface); }
input[type=search].field { background: var(--surface); box-shadow: var(--shadow-sm); }
select.field { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 8px; letter-spacing: .01em; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0; font-size: 15px; }
.check input { width: 22px; height: 22px; margin-top: 0; flex: none; accent-color: var(--accent); }
.prompt-area { width: 100%; min-height: 45vh; border: 0; border-radius: var(--r); padding: 14px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface); color: var(--text); margin-top: 8px; box-shadow: var(--shadow); }
.prompt-area:focus { outline: 2px solid var(--accent); }
.sticky-actions { position: sticky; bottom: 84px; padding: 10px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.stats { font-size: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv b { font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); font-weight: 600; }
.warn { color: var(--warn); }
.settings-sec { background: var(--surface); border-radius: var(--r-lg); padding: 4px 16px 16px; margin: 0 0 14px; box-shadow: var(--shadow); }
.settings-sec h3 { margin: 14px 0 6px; }

/* Heute */
.counter { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.counter:first-of-type { border-top: 0; }
.counter .cname { flex: 1; font-weight: 650; font-size: 15px; min-width: 0; }
.counter .s { font-weight: 500; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.counter .bar { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.counter .bar i { display: block; height: 100%; border-radius: 3px; background: var(--grad); transition: width .25s ease; }
.counter.full .s { color: var(--warn); font-weight: 650; }
.counter.full .bar i { background: #f59e0b; }
.counter.over .s { color: var(--danger); font-weight: 700; }
.counter.over .bar i { background: var(--danger); }
.cbtn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface-2); font-size: 20px; font-weight: 500; line-height: 1; color: var(--text); transition: transform .1s; }
.cbtn:last-child { background: var(--accent-soft); color: var(--accent-soft-ink); }
.cbtn:active { transform: scale(.9); }
.diary-line { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }

/* Notfall */
.nf-head { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; border-radius: var(--r-lg); padding: 22px 16px; text-align: center; box-shadow: 0 10px 30px rgba(220, 38, 38, .3); }
.nf-head h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: .04em; }
.nf-warn { font-size: 18px; font-weight: 700; background: var(--danger-soft); color: var(--danger); border-radius: var(--r); padding: 14px 16px; margin: 12px 0; white-space: pre-wrap; }
.nf-sec { background: var(--surface); border-radius: var(--r); padding: 14px 16px; margin: 10px 0; box-shadow: var(--shadow); }
.nf-sec h4 { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.nf-sec div { white-space: pre-wrap; font-size: 16.5px; }
.nf-call { display: block; text-align: center; font-size: 18px; font-weight: 700; padding: 16px; background: var(--danger); color: #fff; border-radius: var(--r); text-decoration: none; margin: 12px 0; }

/* Overlays */
.overlay { position: fixed; inset: 0; background: var(--bg); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.lockbox { width: 100%; max-width: 380px; text-align: center; }
.lockbox h2 { font-size: 26px; margin: 16px 0 4px; }
.lockicon { display: flex; justify-content: center; }
.modal-bg { position: fixed; inset: 0; background: rgba(5, 10, 9, .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: bgin .18s ease; }
@keyframes bgin { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 640px) { .modal-bg { align-items: center; } }
.modal { background: var(--surface); width: 100%; max-width: 560px; max-height: 90dvh; overflow-y: auto; border-radius: 28px 28px 0 0; padding: 10px 18px calc(18px + var(--safe-b)); box-shadow: var(--shadow-lg); animation: up .24s cubic-bezier(.2, .8, .2, 1); }
.modal::before { content: ''; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 0 auto 12px; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) { .modal { border-radius: 28px; } .modal::before { display: none; } }
.modal h3 { margin: 4px 0 12px; font-size: 20px; font-weight: 750; }
.modal .btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.modal .btns .btn { flex: 1 1 auto; }
.modal pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: var(--surface-2); padding: 12px; border-radius: 14px; max-height: 55dvh; overflow: auto; }
.modal .msg.model { box-shadow: none; background: var(--surface-2); max-width: 100%; }
.modal .item { box-shadow: none; background: var(--surface-2); }
.modal .field { background: var(--surface-2); }
.viewer img { max-width: 100%; border-radius: 14px; }
.viewer iframe { width: 100%; height: 65dvh; border: 0; background: #fff; border-radius: 14px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(100px + var(--safe-b)); background: rgba(14, 22, 21, .92); color: #fff; padding: 11px 18px; border-radius: 16px; z-index: 70; font-size: 14px; font-weight: 500; max-width: 90vw; text-align: center; box-shadow: var(--shadow-lg); backdrop-filter: blur(10px); animation: pop .2s ease; }
@media (prefers-color-scheme: dark) { .toast { background: rgba(233, 240, 238, .95); color: #0a0e0d; } }

/* Diff */
.diff { font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; max-height: 60dvh; overflow: auto; background: var(--surface-2); border-radius: 14px; padding: 8px; }
.diff div { white-space: pre-wrap; word-break: break-word; padding: 1px 6px; border-radius: 6px; }
.d-add { background: rgba(22, 163, 74, .14); color: #15803d; }
.d-del { background: rgba(220, 38, 38, .12); color: #b91c1c; text-decoration: line-through; }
.d-skip { color: var(--muted); font-style: italic; text-align: center; }
@media (prefers-color-scheme: dark) { .d-add { color: #4ade80; } .d-del { color: #f87171; } }

/* Live-Scan */
.scan-box { position: relative; border-radius: 20px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 10%; right: 10%; top: 26%; bottom: 26%; border-radius: 16px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .45); border: 2.5px solid rgba(255, 255, 255, .95); }
.scan-frame::after { content: ''; position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #2dd4bf; box-shadow: 0 0 12px #2dd4bf; animation: scanline 1.6s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { transform: translateY(-28px); } 50% { transform: translateY(28px); } }

/* Diagramm */
.chart { width: 100%; height: auto; display: block; touch-action: manipulation; margin-top: 4px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10.5px; font-family: inherit; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hl { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-cap { color: var(--text); font-weight: 600; margin-top: 4px; min-height: 1.4em; }

/* Feinschliff */
.card .chip, .modal .chip { background: var(--surface-2); box-shadow: none; }
.card .chip.hot { background: var(--accent-soft); color: var(--accent-soft-ink); }
.card .row.wrap .btn { flex: 1 1 auto; }
#input { min-height: 40px; }
.msg.model ol { padding-left: 1.4em; }

/* 2.3: Wiederherstellung, Biometrie, APK-Download */
.btn.ghost { background: transparent; color: var(--accent, #0d9488); margin-top: 14px; }
.btn .ic { width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; }
.reccode { font: 700 clamp(13px, 4.1vw, 20px)/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .5px; text-align: center; padding: 16px 8px; margin: 12px 0; border-radius: 14px; background: var(--surface-2); border: 1.5px dashed var(--border, rgba(0,0,0,.15)); word-break: break-all; user-select: all; }
.warn-text { color: var(--warn, #b45309); }
.apk-card { display: flex; flex-direction: column; gap: 10px; }
.apk-card .meta { font-size: 13px; color: var(--muted, #64748b); }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
