/* THERIQ Patienten-App – Gestaltung „Ruhige Präzision“ */
@font-face { font-family: 'Manrope'; font-weight: 400; font-display: swap; src: url(fonts/manrope-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: 'Manrope'; font-weight: 600; font-display: swap; src: url(fonts/manrope-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: 'Manrope'; font-weight: 700; font-display: swap; src: url(fonts/manrope-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: 'Manrope'; font-weight: 800; font-display: swap; src: url(fonts/manrope-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
@font-face { font-family: 'Manrope'; font-weight: 400; font-display: swap; src: url(fonts/manrope-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-weight: 600; font-display: swap; src: url(fonts/manrope-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-weight: 700; font-display: swap; src: url(fonts/manrope-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-weight: 800; font-display: swap; src: url(fonts/manrope-latin-ext-800-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Saira'; font-weight: 800; font-display: swap; src: url(fonts/saira-latin-800-normal.woff2) format('woff2'); }

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f1f1ee;
  --surface-3: #e8e8e4;
  --line: #e4e4df;
  --line-strong: #d2d2cc;
  --ink: #18181b;
  --text: #18181b;
  --text-2: #3f3f46;
  --muted: #6b6b73;
  --faint: #9a9aa2;
  --lime: #b2e80a;
  --lime-strong: #9bcc00;
  --lime-ink: #1d2600;
  --lime-soft: #f1fbd2;
  --red: #dc2626;
  --red-soft: #fdecec;
  --amber: #b45309;
  --amber-soft: #fdf3e2;
  --blue: #2563eb;
  --blue-soft: #e8effd;
  --green: #15803d;
  --green-soft: #e5f5ea;
  --violet: #7c3aed;
  --violet-soft: #f1eafe;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --surface: #18181b;
    --surface-2: #202024;
    --surface-3: #2a2a2f;
    --line: #2a2a2f;
    --line-strong: #3a3a40;
    --ink: #f4f4f5;
    --text: #f4f4f5;
    --text-2: #d4d4d8;
    --muted: #a1a1aa;
    --faint: #71717a;
    --lime-soft: #232e07;
    --lime-ink: #1d2600;
    --red: #f87171;
    --red-soft: #3a1717;
    --amber: #fbbf24;
    --amber-soft: #36270b;
    --blue: #7aa2ff;
    --blue-soft: #18233f;
    --green: #4ade80;
    --green-soft: #12301d;
    --violet: #b794f6;
    --violet-soft: #2a1c45;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
#root { min-height: 100%; }

/* ── Knöpfe ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: 700; font-size: 15px;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.lime { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.btn.danger { color: var(--red); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.link { background: none; border: 0; padding: 8px; color: var(--muted); font-weight: 600; }

/* ── Marke ── */
.marke { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #18181b; color: var(--lime); font: 800 21px/1 'Saira', sans-serif; }
.marke.gross { width: 64px; height: 64px; border-radius: 18px; font-size: 38px; }

/* ── Einstieg (Code, Einwilligung, Push) ── */
.einstieg { max-width: 440px; margin: 0 auto; padding: calc(48px + env(safe-area-inset-top)) 24px 32px; display: flex; flex-direction: column; gap: 18px; }
.einstieg h1 { font-size: 26px; font-weight: 800; }
.einstieg .muted { color: var(--muted); }
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.feld input {
  height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 20px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
}
.feld input:focus, .eingabe textarea:focus { outline: 2px solid var(--lime); outline-offset: 1px; }
.fehler { color: var(--red); font-weight: 600; font-size: 14px; min-height: 1em; }
.oder { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.oder::before, .oder::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.punkte { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.punkte h3 { font-size: 14px; font-weight: 800; }
.punkte p { font-size: 14px; color: var(--text-2); }
.haken { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; font-weight: 600; }
.haken input { width: 22px; height: 22px; accent-color: var(--lime-strong); flex: none; margin: 0; }
.rechts { font-size: 13px; color: var(--muted); }

/* ── Hauptansicht ── */
.kopf {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.kopf .titel { flex: 1; min-width: 0; }
.kopf .titel b { display: block; font-size: 16px; font-weight: 800; }
.kopf .titel span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rund { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.rund svg { width: 20px; height: 20px; }

main.inhalt { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.abschnitt { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.leiste button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 700; border-radius: 12px;
}
.leiste button svg { width: 22px; height: 22px; }
.leiste button.aktiv { color: var(--text); }
.leiste button.aktiv .ico { background: var(--lime); color: var(--lime-ink); }
.leiste .ico { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 15px; }
.zahl {
  position: absolute; top: 4px; left: calc(50% + 10px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}

/* ── Karten ── */
.karte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.leer { text-align: center; color: var(--muted); padding: 40px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.leer b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

.termin { display: grid; grid-template-columns: 60px 1fr; gap: 14px; align-items: start; }
.datum { text-align: center; border-radius: 12px; background: var(--surface-2); padding: 8px 0; }
.datum small { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; }
.datum b { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; }
.termin.naechster .datum { background: var(--lime); color: var(--lime-ink); }
.termin.naechster .datum small { color: var(--lime-ink); opacity: 0.75; }
.termin .zeit { font-size: 17px; font-weight: 800; }
.termin .info { font-size: 14px; color: var(--text-2); }
.termin .info span + span::before { content: ' · '; color: var(--faint); }
.termin.vorbei { opacity: 0.6; }
.termin.abgesagt .zeit { text-decoration: line-through; color: var(--muted); }

.marker { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.marker.amber { background: var(--amber-soft); color: var(--amber); }
.marker.red { background: var(--red-soft); color: var(--red); }
.marker.green { background: var(--green-soft); color: var(--green); }
.marker.blue { background: var(--blue-soft); color: var(--blue); }
.marker.grau { background: var(--surface-2); color: var(--muted); }

.hinweis { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.hinweis .punkt { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.hinweis .punkt svg { width: 18px; height: 18px; }
.hinweis.verschoben .punkt { background: var(--amber-soft); color: var(--amber); }
.hinweis.abgesagt .punkt { background: var(--red-soft); color: var(--red); }
.hinweis.neu .punkt { background: var(--green-soft); color: var(--green); }
.hinweis b { display: block; font-size: 14px; }
.hinweis p { font-size: 14px; color: var(--text-2); }
.hinweis small { color: var(--faint); font-size: 12px; }
.hinweis.ungelesen { border-color: var(--amber); }

.banner { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--amber-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); font-size: 14px; }

/* Vorschläge */
.vorschlag { display: flex; flex-direction: column; gap: 12px; }
.vorschlag.offen { border-color: var(--lime-strong); box-shadow: 0 0 0 3px var(--lime-soft); }
.vorschlag .oben { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; align-items: center; }
.vorschlag .tag { font-size: 13px; font-weight: 700; color: var(--muted); }
.vorschlag .wann { font-size: 22px; font-weight: 800; line-height: 1.2; }
.vorschlag .notiz { font-size: 14px; color: var(--text-2); background: var(--surface-2); padding: 10px 12px; border-radius: 10px; }
.vorschlag .knoepfe { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.frist { font-size: 13px; font-weight: 700; color: var(--amber); }

/* Nachrichten */
.chat { display: flex; flex-direction: column; gap: 8px; }
.blase { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.blase small { display: block; margin-top: 4px; font-size: 11px; opacity: 0.7; }
.blase.praxis { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.blase.patient { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 6px; }
.blase .von { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.tagtrenner { align-self: center; font-size: 12px; font-weight: 700; color: var(--faint); margin: 8px 0 2px; }
.eingabe {
  position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 6;
  display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 12px; background: var(--bg); border-top: 1px solid var(--line);
}
.eingabe textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); }
.eingabe .btn { flex: none; width: 44px; padding: 0; }
main.inhalt.mit-eingabe { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }

/* Einstellungen */
.blatt { position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / 0.4); display: flex; align-items: flex-end; justify-content: center; }
.blatt > div { width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; background: var(--bg); border-radius: 20px 20px 0 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.blatt h2 { font-size: 20px; font-weight: 800; }
.zeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; }
.zeile b { display: block; }
.zeile span { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgb(0 0 0 / 0.2);
}

/* Hilfsklassen (keine Inline-Stile wegen der Content-Security-Policy) */
.hinweis-vorschlag { text-align: left; border-color: var(--lime-strong); background: var(--lime-soft); }
.leise { color: var(--text-2); font-size: 14px; }
.klein { font-size: 13px; color: var(--muted); }
.ohne-abstand { margin: 0; }
.blatt-kopf { display: flex; justify-content: space-between; align-items: center; }

/* Testbetrieb (Server mit TESTBETRIEB=1) */
.testbetrieb { padding: 10px 14px; border-radius: 12px; background: var(--red-soft); color: var(--red); font-size: 13px; font-weight: 600; border: 1px dashed currentColor; }
