/* docbot – warm, klar, ruhig. Angelehnt an das aktuelle Apple-Design (Glasflächen, große Radien),
   aber mit Papierwärme statt Klinikweiß. Gebaut fürs Handy (390×844), am Rechner mit Seitenleiste. */

@font-face {
  font-family: 'Nunito';
  src: url('fonts/nunito-var.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --grund: #f5efe7;
  --grund-a: #fbe2cf;
  --grund-b: #e3ebdc;
  --grund-c: #f7ead9;
  --glas: rgba(255, 252, 248, 0.68);
  --glas-stark: rgba(255, 252, 248, 0.86);
  --fest: #fffdfa;
  --mulde: rgba(92, 64, 40, 0.06);
  --mulde-stark: rgba(92, 64, 40, 0.1);
  --linie: rgba(72, 48, 28, 0.1);
  --kante: rgba(255, 255, 255, 0.75);
  --text: #2b2420;
  --text2: #6d6259;
  --text3: #94877c;
  --akzent: #b9502f;
  --akzent-text: #a64527;
  --akzent-weich: rgba(201, 96, 63, 0.13);
  --auf-akzent: #fffaf5;
  --salbei: #557254;
  --salbei-weich: rgba(94, 122, 90, 0.14);
  --warn: #b3261e;
  --warn-weich: rgba(179, 38, 30, 0.1);
  --schatten: 0 1px 2px rgba(70, 45, 20, 0.05), 0 8px 28px rgba(70, 45, 20, 0.08);
  --schatten-hoch: 0 2px 6px rgba(70, 45, 20, 0.08), 0 18px 50px rgba(70, 45, 20, 0.18);
  --r-s: 12px;
  --r-m: 18px;
  --r-l: 26px;
  --rund: 'ui-rounded', 'SF Pro Rounded', 'Nunito', system-ui, sans-serif;
  --schrift: -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', 'Nunito', sans-serif;
  --unten: env(safe-area-inset-bottom, 0px);
  --oben: env(safe-area-inset-top, 0px);
  --leiste: 76px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #191513;
    --grund-a: #3a2419;
    --grund-b: #1f2a20;
    --grund-c: #2a1f18;
    --glas: rgba(48, 40, 35, 0.66);
    --glas-stark: rgba(44, 37, 32, 0.9);
    --fest: #2a2320;
    --mulde: rgba(255, 235, 215, 0.07);
    --mulde-stark: rgba(255, 235, 215, 0.12);
    --linie: rgba(255, 235, 215, 0.11);
    --kante: rgba(255, 255, 255, 0.09);
    --text: #f4ece4;
    --text2: #bcafa3;
    --text3: #8f8378;
    --akzent: #e58a66;
    --akzent-text: #f0a080;
    --akzent-weich: rgba(229, 138, 102, 0.17);
    --auf-akzent: #24140d;
    --salbei: #9dbb98;
    --salbei-weich: rgba(157, 187, 152, 0.15);
    --warn: #ff8a80;
    --warn-weich: rgba(255, 138, 128, 0.13);
    --schatten: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.28);
    --schatten-hoch: 0 2px 6px rgba(0, 0, 0, 0.4), 0 18px 50px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.45 var(--schrift);
  color: var(--text);
  background: var(--grund);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
/* Warmes Licht hinter dem Glas: drei weiche Farbflecken, fest zum Bildschirm. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vmax 50vmax at 8% -5%, var(--grund-a), transparent 62%),
    radial-gradient(55vmax 55vmax at 105% 30%, var(--grund-b), transparent 60%),
    radial-gradient(60vmax 45vmax at 30% 110%, var(--grund-c), transparent 60%),
    var(--grund);
}
h1, h2, h3 { font-family: var(--rund); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 32px; line-height: 1.12; font-weight: 800; }
h2 { font-size: 21px; line-height: 1.2; font-weight: 750; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
a { color: var(--akzent-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.leise { color: var(--text2); }
.klein { font-size: 14px; }
.mini { font-size: 12.5px; letter-spacing: 0.01em; }
.mittig { text-align: center; }

/* ---- Gerüst ---- */
#app { min-height: 100dvh; }
.seite {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--oben) + 18px) 18px calc(var(--leiste) + var(--unten) + 40px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: herein 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes herein { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.kopf { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.kopf h1 { flex: 1; min-width: 0; }
.kopf .titel-klein { flex: 1; min-width: 0; font: 700 17px var(--rund); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.gruss { font: 600 15px var(--rund); color: var(--text2); margin-bottom: -12px; }

/* ---- Glas ---- */
.glas {
  background: var(--glas);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid var(--kante);
  box-shadow: var(--schatten);
}
.karte { border-radius: var(--r-l); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.karte > h2 { display: flex; align-items: center; gap: 8px; }
.karte > h2 .ikon { color: var(--akzent-text); }
.karte.flach { padding: 6px; gap: 0; }
.karte.hinweis { background: var(--akzent-weich); border-color: transparent; box-shadow: none; }
.karte.ruhig { background: var(--salbei-weich); border-color: transparent; box-shadow: none; }
.abschnitt-titel { font: 700 13px var(--rund); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text3); padding: 6px 6px 0; }

/* ---- Navigation: schwebende Leiste unten, am Rechner links ---- */
.leiste {
  position: fixed;
  left: 50%;
  bottom: calc(var(--unten) + 12px);
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-radius: 999px;
  width: min(calc(100vw - 24px), 430px);
  box-shadow: var(--schatten-hoch);
}
.leiste a, .leiste .plus {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 52px;
  border-radius: 999px;
  color: var(--text2);
  text-decoration: none;
  font: 650 10.5px var(--rund);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.leiste a[aria-current='page'] { background: var(--mulde-stark); color: var(--akzent-text); }
.leiste a:active { transform: scale(0.94); }
.leiste .plus {
  flex: 0 0 56px;
  height: 56px;
  margin: 0 4px;
  background: var(--akzent);
  color: var(--auf-akzent);
  box-shadow: 0 6px 18px rgba(185, 80, 47, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.leiste .plus:active { transform: scale(0.92); }
.leiste .marke { display: none; }

@media (min-width: 900px) {
  :root { --leiste: 0px; }
  .leiste {
    left: 18px; top: 18px; bottom: 18px; transform: none;
    width: 232px; flex-direction: column; align-items: stretch; gap: 4px;
    border-radius: var(--r-l); padding: 14px 10px;
  }
  .leiste .marke { display: flex; align-items: center; gap: 10px; font: 800 20px var(--rund); padding: 6px 10px 16px; color: var(--text); }
  .leiste a, .leiste .plus { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 14px; border-radius: 14px; font-size: 15.5px; }
  .leiste .plus { order: 9; margin: auto 0 0; height: 50px; justify-content: center; }
  .leiste .plus::after { content: 'Hinzufügen'; }
  #app { padding-left: 250px; }
  .seite { padding-top: 34px; max-width: 780px; }
}

/* ---- Knöpfe ---- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 999px;
  font: 700 17px var(--rund); text-decoration: none; white-space: nowrap;
  background: var(--mulde-stark); color: var(--text);
  transition: transform 0.12s, filter 0.2s, background 0.2s;
}
.knopf:active { transform: scale(0.97); }
.knopf.haupt { background: var(--akzent); color: var(--auf-akzent); box-shadow: 0 6px 18px rgba(185, 80, 47, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28); }
.knopf.zart { background: var(--akzent-weich); color: var(--akzent-text); }
.knopf.gefahr { background: var(--warn-weich); color: var(--warn); }
.knopf.klein { min-height: 38px; padding: 0 16px; font-size: 15px; }
.knopf.voll { width: 100%; }
.knopf[disabled] { opacity: 0.45; pointer-events: none; }
.rund-knopf {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); background: var(--glas); border: 1px solid var(--kante);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--schatten); transition: transform 0.12s;
}
.rund-knopf:active { transform: scale(0.92); }
.rund-knopf.akzent { background: var(--akzent); color: var(--auf-akzent); border-color: transparent; }
.rund-knopf[disabled] { opacity: 0.4; pointer-events: none; }
.reihe { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.reihe.eng { gap: 6px; }
.reihe > .dehnt { flex: 1; min-width: 0; }
.stapel { display: flex; flex-direction: column; gap: 12px; }

/* ---- Eingaben ---- */
.feld { display: flex; flex-direction: column; gap: 6px; }
.feld > span { font: 650 13.5px var(--rund); color: var(--text2); padding-left: 4px; }
input[type='text'], input[type='search'], input[type='email'], input[type='date'], textarea, select {
  width: 100%; min-height: 50px; padding: 12px 16px;
  border-radius: var(--r-m); border: 1px solid var(--linie);
  background: var(--fest); color: var(--text); font-size: 17px;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: none; line-height: 1.45; min-height: 120px; display: block; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 4px var(--akzent-weich); }
::placeholder { color: var(--text3); }
.suchfeld { position: relative; }
.suchfeld .ikon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text3); pointer-events: none; }
.suchfeld input { padding-left: 46px; border-radius: 999px; background: var(--glas-stark); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 18px; margin: 0 -18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-height: 38px; padding: 0 15px; border-radius: 999px;
  font: 650 14.5px var(--rund); color: var(--text2);
  background: var(--glas); border: 1px solid var(--kante);
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.chip[aria-pressed='true'] { background: var(--text); color: var(--grund); border-color: transparent; }

/* ---- Listen ---- */
.zeile {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 11px 12px; border-radius: 20px; text-align: left; text-decoration: none; color: inherit;
  transition: background 0.15s;
}
.zeile:active, .zeile:hover { background: var(--mulde); }
.zeile + .zeile { box-shadow: 0 -1px 0 var(--linie); }
.zeile + .zeile:active, .zeile + .zeile:hover { box-shadow: none; }
.zeile .mitte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.zeile .haupttext { font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.zeile .nebentext { font-size: 14px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile .nebentext.mehrzeilig { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.zeile .pfeil { color: var(--text3); flex: 0 0 auto; }
.zeile mark { background: var(--akzent-weich); color: inherit; border-radius: 4px; padding: 0 2px; }
.daumen {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--mulde-stark); color: var(--text2);
}
.daumen img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; background: #fff; }
.daumen.art-arztbrief { background: rgba(201, 96, 63, 0.14); color: var(--akzent-text); }
.daumen.art-labor { background: rgba(94, 122, 90, 0.16); color: var(--salbei); }
.daumen.art-bildgebung { background: rgba(86, 110, 150, 0.16); color: #56709a; }
.daumen.art-rezept { background: rgba(170, 120, 40, 0.16); color: #96702a; }
.daumen.art-notiz { background: rgba(140, 100, 150, 0.15); color: #86628f; }
.monat { font: 750 15px var(--rund); color: var(--text2); padding: 14px 8px 4px; }
.punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--akzent); flex: 0 0 8px; animation: puls 1.4s ease-in-out infinite; }
@keyframes puls { 50% { opacity: 0.3; transform: scale(0.8); } }
.dreher { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--mulde-stark); border-top-color: var(--akzent); animation: dreh 0.8s linear infinite; flex: 0 0 20px; }
@keyframes dreh { to { transform: rotate(360deg); } }

.leer { text-align: center; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text2); }
.leer .bild { width: 76px; height: 76px; border-radius: 24px; background: var(--akzent-weich); color: var(--akzent-text); display: flex; align-items: center; justify-content: center; }
.leer h2 { color: var(--text); }

/* ---- Text aus Akte und Gespräch ---- */
.md { display: flex; flex-direction: column; gap: 10px; overflow-wrap: anywhere; }
.md h2, .md h3, .md h4 { font-family: var(--rund); margin: 6px 0 0; }
.md h2 { font-size: 19px; } .md h3 { font-size: 17px; } .md h4 { font-size: 15px; color: var(--text2); }
.md ul, .md ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 5px; }
.md li::marker { color: var(--text3); }
.md code { font: 14px ui-monospace, Menlo, monospace; background: var(--mulde); padding: 1px 5px; border-radius: 6px; }
.md pre { margin: 0; padding: 12px; background: var(--mulde); border-radius: var(--r-s); overflow-x: auto; font: 14px/1.4 ui-monospace, Menlo, monospace; white-space: pre-wrap; }
.md blockquote { margin: 0; padding: 10px 14px; border-radius: var(--r-s); background: var(--mulde); color: var(--text2); }
.md blockquote.widerspruch { background: var(--warn-weich); color: var(--text); }
.md .tabelle { overflow-x: auto; margin: 0 -4px; border-radius: var(--r-s); border: 1px solid var(--linie); background: var(--fest); }
.md table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
.md th, .md td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--linie); vertical-align: top; }
.md th { font: 700 12.5px var(--rund); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text3); white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
.beleg {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: baseline;
  margin: 0 1px; padding: 1px 9px 1px 7px; border-radius: 999px;
  font: 650 12.5px var(--rund); line-height: 1.5; color: var(--akzent-text); background: var(--akzent-weich);
  white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.beleg.fehlt { color: var(--text3); background: var(--mulde); text-decoration: line-through; }

/* ---- Akte ---- */
.block { position: relative; padding: 8px 10px; margin: 0 -10px; border-radius: 14px; text-align: left; width: calc(100% + 20px); display: block; transition: background 0.15s; }
.block:hover, .block:active { background: var(--mulde); }
.block.eigen { box-shadow: inset 3px 0 0 var(--salbei); background: var(--salbei-weich); margin-top: 4px; margin-bottom: 4px; }
.block.eigen::after { content: 'von dir'; position: absolute; right: 10px; top: -8px; font: 700 10.5px var(--rund); letter-spacing: 0.04em; text-transform: uppercase; color: var(--salbei); background: var(--fest); padding: 1px 8px; border-radius: 999px; border: 1px solid var(--linie); }
.block.gestrichen { color: var(--text3); text-decoration: line-through; box-shadow: none; background: none; font-size: 15px; }
.block.gestrichen::after { content: 'gestrichen'; color: var(--text3); text-decoration: none; }
.seitenkarte { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r-l); text-decoration: none; color: inherit; transition: transform 0.15s; }
.seitenkarte:active { transform: scale(0.985); }
.seitenkarte .nebentext { font-size: 14.5px; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.raster { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 620px) { .raster { grid-template-columns: 1fr 1fr; } }

/* ---- Gespräch ---- */
.gespraech { display: flex; flex-direction: column; gap: 14px; padding-bottom: 96px; }
.blase { max-width: 88%; padding: 11px 15px; border-radius: 22px; overflow-wrap: anywhere; }
.blase.ich { align-self: flex-end; background: var(--akzent); color: var(--auf-akzent); border-bottom-right-radius: 8px; white-space: pre-wrap; }
.blase.ich .anhang { display: flex; align-items: center; gap: 6px; font-size: 14px; opacity: 0.9; margin-top: 6px; }
.blase.docbot { align-self: flex-start; max-width: 100%; border-bottom-left-radius: 8px; }
.blase.system { align-self: center; max-width: 100%; font-size: 14px; color: var(--text2); background: var(--mulde); border-radius: 14px; text-align: center; }
.blase.recherche { align-self: stretch; max-width: 100%; background: var(--salbei-weich); border: 0; box-shadow: none; }
.blase .rolle { font: 700 12px var(--rund); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text3); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.blase .fuss { display: flex; gap: 14px; margin-top: 10px; }
.blase .fuss button { font: 650 13px var(--rund); color: var(--text3); display: inline-flex; align-items: center; gap: 5px; min-height: 32px; }
.blase .fuss button:hover { color: var(--akzent-text); }
.tippt { display: inline-flex; gap: 5px; padding: 6px 2px; }
.tippt i { width: 8px; height: 8px; border-radius: 50%; background: var(--text3); animation: tipp 1.2s infinite ease-in-out; }
.tippt i:nth-child(2) { animation-delay: 0.15s; } .tippt i:nth-child(3) { animation-delay: 0.3s; }
@keyframes tipp { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }
.vorschlag { align-self: stretch; border-radius: var(--r-l); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.vorschlag .kopfzeile { display: flex; align-items: center; gap: 8px; font: 750 15px var(--rund); }
.vorschlag .kopfzeile .ikon { color: var(--akzent-text); }
.vorschlag dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 15px; }
.vorschlag dt { color: var(--text3); } .vorschlag dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.vorschlag textarea { min-height: 84px; font-size: 16px; }
.schreiben {
  position: fixed; z-index: 15;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--leiste) + var(--unten) + 18px);
  width: min(calc(100vw - 24px), 720px);
  display: flex; align-items: flex-end; gap: 8px; padding: 7px; border-radius: 28px;
  box-shadow: var(--schatten-hoch);
}
.schreiben textarea { flex: 1; min-height: 44px; max-height: 160px; padding: 10px 6px; border: 0; background: transparent; box-shadow: none !important; border-radius: 0; }
.schreiben .anhaenge { position: absolute; left: 14px; bottom: calc(100% + 6px); display: flex; gap: 6px; flex-wrap: wrap; }
@media (min-width: 900px) { .schreiben { left: calc(50% + 125px); bottom: 26px; width: min(calc(100vw - 300px), 744px); } }
.starter { display: grid; gap: 10px; }
.starter button { text-align: left; padding: 14px 16px; border-radius: 20px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.starter button .ikon { color: var(--akzent-text); flex: 0 0 auto; }

/* ---- Unterlage ansehen ---- */
.blaetter { display: flex; flex-direction: column; gap: 12px; }
.blaetter img { width: 100%; height: auto; display: block; border-radius: var(--r-m); background: #fff; box-shadow: var(--schatten); border: 1px solid var(--linie); }
.abschrift { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.5; }
.seitenmarke { font: 700 12px var(--rund); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text3); margin: 8px 0 -4px; }
.umschalter { display: flex; padding: 4px; border-radius: 999px; background: var(--mulde-stark); gap: 2px; }
.umschalter button { flex: 1; min-height: 40px; border-radius: 999px; font: 700 15px var(--rund); color: var(--text2); }
.umschalter button[aria-pressed='true'] { background: var(--fest); color: var(--text); box-shadow: 0 1px 4px rgba(60, 40, 20, 0.14); }
audio, video { width: 100%; border-radius: var(--r-m); }
.eigenschaften { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15.5px; margin: 0; }
.eigenschaften dt { color: var(--text3); } .eigenschaften dd { margin: 0; overflow-wrap: anywhere; }

/* ---- Blatt (von unten), am Rechner als Fenster ---- */
dialog.blatt {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh;
  border-radius: 32px 32px 0 0; color: var(--text);
  background: var(--glas-stark);
  -webkit-backdrop-filter: blur(34px) saturate(180%); backdrop-filter: blur(34px) saturate(180%);
  box-shadow: var(--schatten-hoch); overflow: hidden;
}
dialog.blatt[open] { display: flex; flex-direction: column; animation: hoch 0.32s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
@keyframes hoch { from { transform: translateY(40%); opacity: 0; } }
dialog.blatt::backdrop { background: rgba(40, 26, 14, 0.32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: blende 0.25s both; }
@keyframes blende { from { opacity: 0; } }
.blatt .griff { width: 38px; height: 5px; border-radius: 3px; background: var(--mulde-stark); margin: 9px auto 0; flex: 0 0 auto; }
.blatt .blatt-kopf { display: flex; align-items: center; gap: 10px; padding: 12px 18px 4px; flex: 0 0 auto; }
.blatt .blatt-kopf h2 { flex: 1; }
.blatt .blatt-inhalt:focus { outline: none; }
.blatt .blatt-inhalt { padding: 12px 18px calc(22px + var(--unten)); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 700px) {
  dialog.blatt { margin: auto; border-radius: 30px; }
  .blatt .griff { display: none; }
  .blatt .blatt-kopf { padding-top: 20px; }
  dialog.blatt[open] { animation-name: herein; }
}
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kachel {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px;
  min-height: 112px; padding: 16px; border-radius: 24px; text-align: left;
  background: var(--fest); border: 1px solid var(--linie); font: 700 16.5px var(--rund);
  transition: transform 0.12s;
}
.kachel:active { transform: scale(0.96); }
.kachel .ikon-feld { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--akzent-weich); color: var(--akzent-text); }
.kachel:nth-child(2) .ikon-feld { background: var(--salbei-weich); color: var(--salbei); }
.kachel:nth-child(3) .ikon-feld { background: rgba(170, 120, 40, 0.15); color: #96702a; }
.kachel:nth-child(4) .ikon-feld { background: rgba(140, 100, 150, 0.15); color: #86628f; }
.kachel small { display: block; font: 500 13.5px var(--schrift); color: var(--text2); margin-top: 2px; }
.fortschritt { height: 6px; border-radius: 3px; background: var(--mulde-stark); overflow: hidden; }
.fortschritt i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--akzent); transition: width 0.25s; }
.fortschritt.fertig i { background: var(--salbei); }
.aufnahme { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 12px 0; }
.aufnahme .zeit { font: 800 44px var(--rund); font-variant-numeric: tabular-nums; }
.aufnahme .ausloeser { width: 84px; height: 84px; border-radius: 50%; background: var(--warn); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 6px var(--warn-weich); }
.aufnahme .ausloeser.laeuft { animation: puls 1.4s ease-in-out infinite; }
.streifen { display: flex; gap: 8px; overflow-x: auto; padding: 2px; }
.streifen img { height: 96px; width: auto; border-radius: 12px; border: 1px solid var(--linie); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--leiste) + var(--unten) + 28px); transform: translateX(-50%);
  z-index: 60; max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 18px;
  background: var(--text); color: var(--grund); font: 650 15px var(--rund); box-shadow: var(--schatten-hoch);
  animation: herein 0.25s both; text-align: center;
}
.fallzone { position: fixed; inset: 12px; z-index: 70; border-radius: 30px; border: 3px dashed var(--akzent); background: var(--akzent-weich); display: flex; align-items: center; justify-content: center; font: 800 24px var(--rund); color: var(--akzent-text); pointer-events: none; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* ---- Anmelden ---- */
.tor { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 18px; }
.tor .karte { width: 100%; max-width: 420px; padding: 28px 24px; gap: 18px; text-align: center; align-items: stretch; }
.zeichen { width: 76px; height: 76px; border-radius: 24px; margin: 0 auto; background: linear-gradient(145deg, #d9744f, #b9502f); color: #fffaf5; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(185, 80, 47, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.zeichen.klein { width: 34px; height: 34px; border-radius: 11px; margin: 0; box-shadow: none; }
.code { font: 800 clamp(15px, 4.6vw, 20px)/1.5 ui-monospace, Menlo, monospace; letter-spacing: 0.02em; white-space: nowrap; padding: 16px 8px; border-radius: var(--r-m); background: var(--fest); border: 1px dashed var(--linie); user-select: all; overflow-wrap: anywhere; }
.haken-zeile { display: flex; gap: 12px; align-items: center; text-align: left; font-size: 15.5px; }
.haken-zeile input { width: 26px; height: 26px; flex: 0 0 26px; accent-color: var(--akzent); }

@media print {
  .leiste, .kopf .rund-knopf, .schreiben, .nicht-drucken { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  body::before { display: none; }
  #app { padding: 0; } .seite { padding: 0; max-width: none; animation: none; }
  .glas { background: none; box-shadow: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .karte { padding: 0; }
  .block { margin: 0; padding: 2px 0; width: 100%; }
  .block.eigen { background: none; box-shadow: none; } .block.eigen::after, .block.gestrichen { display: none; }
  .beleg { background: none; color: #555; padding: 0; font-weight: 400; }
  .beleg::before { content: '('; } .beleg::after { content: ')'; }
}
