/* Schriften der Website (Funnel Display / Funnel Sans, SIL OFL) – lokal eingebunden, kein Abruf bei Google */
@font-face { font-family: "Funnel Display"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/funnel-display-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Funnel Display"; font-weight: 800; font-style: normal; font-display: swap; src: url(/fonts/funnel-display-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Funnel Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/funnel-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Funnel Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/funnel-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Funnel Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/funnel-sans-latin-700-normal.woff2) format("woff2"); }
:root {
  /* Farben der Website natzius-versicherungsmakler.de */
  --violet: #322a73; --violet-d: #2b255c; --lime: #c6d522; --lime-d: #b2c11a; --green: #82b729; --link: #5d8a0f;
  --head: #322a73;
  --bg: #f7f7f7; --card: #fff; --text: #212529; --muted: #6a6f75; --line: #e4e4e4;
  --danger: #b3261e; --ok: #2e7d32; --radius: 16px;
  --font-head: "Funnel Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Funnel Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
:root[data-theme="dark"] { color-scheme: dark; --bg: #15122e; --card: #1f1b45; --text: #f1f0fa; --muted: #aaa7c6; --line: #38336b; --head: #c6d522; --link: #c6d522; }
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; --bg: #15122e; --card: #1f1b45; --text: #f1f0fa; --muted: #aaa7c6; --line: #38336b; --head: #c6d522; --link: #c6d522; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font-body); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, .brand b { font-family: var(--font-head); color: var(--head); }
h1 { font-size: 1.6rem; font-weight: 600; margin: 0 0 .25rem; line-height: 1.2; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 1.4rem 0 .5rem; }
.muted { color: var(--muted); font-size: .9rem; }
.hidden { display: none !important; }

/* Login / Auth */
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 16px; max-width: 420px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.brand img { width: 56px; height: 56px; }
.brand b { display: block; font-size: 1.15rem; font-weight: 600; }
.brand span { color: var(--muted); font-size: .85rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 14px 0 4px; }
input, select, textarea { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--lime); outline-offset: 1px; }
textarea { min-height: 120px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 24px;
  border: 0; border-radius: 50px; background: var(--lime); color: var(--violet-d); font: 700 1rem var(--font-body); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--lime-d); }
.btn.block { width: 100%; margin-top: 18px; }
.btn.lime { background: var(--lime); color: var(--violet-d); }
.btn.dark { background: var(--violet); color: #fff; }
.btn.dark:hover { background: var(--violet-d); }
.btn.ghost { background: transparent; color: var(--head); border: 2px solid var(--line); }
.btn.ghost:hover { background: transparent; border-color: var(--lime); }
.btn.small { min-height: 38px; padding: 0 16px; font-size: .92rem; }
.btn[disabled] { opacity: .6; cursor: wait; }
.error { color: var(--danger); margin: 12px 0 0; font-size: .92rem; min-height: 1.2em; }
.qr { display: block; margin: 12px auto; width: 200px; height: 200px; background: #fff; padding: 6px; border-radius: 8px; }
code.secret { display: block; text-align: center; word-break: break-all; letter-spacing: .08em; padding: 8px; background: var(--bg); border-radius: 8px; user-select: all; }
input.code { text-align: center; font-size: 1.6rem; letter-spacing: .4em; }

/* App-Rahmen */
.top { position: sticky; top: 0; z-index: 5; background: #322a73; color: #fff; padding: calc(10px + var(--safe-t)) 16px 10px;
  display: flex; align-items: center; gap: 12px; }
.top img { width: 46px; height: auto; }
.top .who { flex: 1; min-width: 0; line-height: 1.2; }
.top .who b { font-family: var(--font-head); font-weight: 600; color: #fff; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .who small { opacity: .8; }
.top button { background: transparent; border: 1px solid rgba(255,255,255,.45); color: #fff; border-radius: 50px; padding: 6px 16px; font: 600 .9rem var(--font-body); cursor: pointer; }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(90px + var(--safe-b)); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line);
  display: flex; padding-bottom: var(--safe-b); z-index: 5; }
.tabs button { flex: 1; background: none; border: 0; padding: 10px 4px 8px; color: var(--muted); cursor: pointer; font-size: .78rem; position: relative; }
.tabs button svg { display: block; margin: 0 auto 2px; width: 24px; height: 24px; }
.tabs button[aria-selected="true"] { color: var(--head); font-weight: 700; }
.tabs button[aria-selected="true"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; background: var(--lime); border-radius: 0 0 3px 3px; height: 4px; }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--danger); color: #fff; border-radius: 10px; min-width: 18px; padding: 0 5px; font-size: .7rem; line-height: 18px; }

/* Karten & Listen */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; }
.card.click { cursor: pointer; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.row .t { font-weight: 600; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.pill.lime { background: #f3f7c9; border-color: #d9e56a; color: #4a5200; }
.pill.warn { background: #fff0d6; border-color: #f0cf8c; color: #7a4d00; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0 0; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; word-break: break-word; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.chips button { white-space: nowrap; border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 14px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--lime); color: var(--violet-d); border-color: var(--lime); font-weight: 700; }
.msg.unread { border-left: 6px solid var(--lime); }
.msg .body { white-space: pre-wrap; margin: 8px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 32px 8px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + var(--safe-b)); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; z-index: 20; max-width: 90%; }
.hint { background: #fffbe0; border: 1px solid #ece08a; color: #5f4a00; border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 12px 0; }
:root[data-theme="dark"] .hint { background: #3a3114; border-color: #6d5d1f; color: #f1e3a6; } :root[data-theme="dark"] .pill.lime { background: #323a0c; border-color: #6b7a14; color: #e1ec7a; } :root[data-theme="dark"] .pill.warn { background: #3d2c0b; border-color: #6d5019; color: #f2cf8a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hint { background: #3a3114; border-color: #6d5d1f; color: #f1e3a6; } :root:not([data-theme="light"]) .pill.lime { background: #323a0c; border-color: #6b7a14; color: #e1ec7a; } :root:not([data-theme="light"]) .pill.warn { background: #3d2c0b; border-color: #6d5019; color: #f2cf8a; } }
a { color: var(--link); font-weight: 600; }
.btn, .tabs button { font-family: var(--font-body); }

/* Chat */
.chat-list { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.chat-day { align-self: center; font-size: .78rem; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 2px 12px; margin: 10px 0 4px; }
.bubble { max-width: 82%; padding: 8px 12px 6px; border-radius: 16px; word-break: break-word; }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble time { display: block; text-align: right; font-size: .7rem; opacity: .7; margin-top: 2px; }
.bubble .subj { display: block; margin-bottom: 2px; }
.bubble .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.bubble.mine { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
:root[data-theme="dark"] .bubble.mine { background: #4a3fa3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bubble.mine { background: #4a3fa3; } }
.composer { position: sticky; bottom: calc(66px + var(--safe-b)); background: var(--bg); padding: 8px 0 4px; border-top: 1px solid var(--line); }
.composer .row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 44px; max-height: 160px; resize: none; flex: 1; border-radius: 22px; padding: 11px 16px; }
.composer .send { border-radius: 22px; padding: 11px 20px; }
.composer .opts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; font-size: .9rem; }
.composer .opts select { width: auto; flex: 1; min-width: 160px; padding: 6px 10px; }
.composer .chk { display: flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; }
.composer .chk input { width: auto; }
.composer .error { margin: 4px 0 0; }
.pushbar { margin: 0 0 10px; font-size: .88rem; }
.pushbar p { margin: 0; }
button.link { background: none; border: 0; padding: 0; color: var(--link); font-weight: 600; text-decoration: underline; cursor: pointer; }
.pwbox { position: relative; }
.pwbox input { padding-right: 104px; }
.pwbox .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 8px 10px; color: var(--link); font-weight: 600; cursor: pointer; border-radius: 8px; }

.row .right { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.doccount { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--lime); color: var(--violet-d); font-size: .78rem; font-weight: 700; }
.doclist { border-top: 1px solid var(--line); margin-top: 6px; }
.docrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.docrow .t { font-weight: 600; font-size: .95rem; }

.top .theme { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; line-height: 1; }

select.assign { width: 100%; margin-top: 8px; }

/* Rechtliche Seiten (Impressum, Datenschutz) und Fußzeile */
.legal { max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; line-height: 1.55; }
.legal h1 { font-size: 1.5rem; color: var(--head); }
.legal h2 { font-size: 1.05rem; margin: 22px 0 6px; color: var(--head); }
.legal a, .legal-links a { color: var(--link); }
.legal-links { text-align: center; font-size: .82rem; color: var(--muted); margin: 14px 0 4px; }
.legal-nav { margin-top: 28px; }

.ended .card { opacity: .72; }
