/* Layout: Schreibprogramm wie Word/Docs – Kopfzeile, Werkzeugleiste, Blatt auf grauem Tisch, rechts die Diktat-Spalte. Nur hell (Veto-Kundenseiten). */
@font-face { font-family: Switzer; font-weight: 400; font-display: swap; src: url('/start/fonts/switzer-400.woff2') format('woff2'); }
@font-face { font-family: Switzer; font-weight: 500; font-display: swap; src: url('/start/fonts/switzer-500.woff2') format('woff2'); }
@font-face { font-family: Switzer; font-weight: 600; font-display: swap; src: url('/start/fonts/switzer-600.woff2') format('woff2'); }
@font-face { font-family: Switzer; font-weight: 700; font-display: swap; src: url('/start/fonts/switzer-700.woff2') format('woff2'); }
@font-face { font-family: Caveat; font-weight: 600; font-display: swap; src: url('/start/fonts/caveat-600.woff2') format('woff2'); }
:root {
  color-scheme: light;
  --bg: #ffffff; --fg: #1b1c21; --text: #3b3d45; --muted: #676a75; --line: #e4e6ea;
  --accent: #4c6876; --floor: #edf1f3; --rec: #c2394b; --ok: #1f7f60;
  --soft: color-mix(in srgb, var(--accent) 8%, var(--bg));
  --soft2: color-mix(in srgb, var(--accent) 14%, var(--bg));
  --sans: Switzer, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: Caveat, "Segoe Script", cursive;
  --brief: Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none; }
html, body { height: 100%; }
body { margin: 0; background: var(--floor); color: var(--fg); font: 15px/1.5 var(--sans); display: flex; flex-direction: column; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Kopfzeile */
.kopf { display: flex; align-items: center; gap: 14px; height: 60px; background: var(--bg); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.marke { font-weight: 700; font-size: 22px; letter-spacing: -.03em; }
.strich { width: 1px; height: 26px; background: var(--line); }
.doc { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.doc-titel { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-zeile { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-zeile .gesp::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; }
.kopf .rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pille { font-size: 12.5px; font-weight: 600; color: var(--accent); background: var(--soft); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.haupt { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--fg); color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap; }
.haupt:disabled { background: #d4d7dc; color: #7c7f88; cursor: not-allowed; }
.haupt svg { width: 16px; height: 16px; }

/* Werkzeugleiste */
.leiste { display: flex; align-items: center; gap: 4px; height: 48px; background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); overflow-x: auto; scrollbar-width: none; }
.leiste::-webkit-scrollbar { display: none; }
.w { flex: none; display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border: 0; border-radius: 7px; background: transparent; color: var(--text); cursor: pointer; font-size: 14px; }
.w:hover { background: var(--floor); }
.w svg { width: 18px; height: 18px; }
.w.b { font-weight: 700; } .w.i { font-style: italic; font-family: Georgia, serif; } .w.u { text-decoration: underline; }
.trenn { flex: none; width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.diktier { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border: 1px solid color-mix(in srgb, var(--rec) 30%, var(--bg)); border-radius: 999px; background: color-mix(in srgb, var(--rec) 6%, var(--bg)); color: var(--rec); font-weight: 600; font-size: 14px; cursor: pointer; margin-right: 6px; }
.diktier .pkt { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); }
.diktier:hover { background: color-mix(in srgb, var(--rec) 11%, var(--bg)); }
body[data-z="aufnahme"] .diktier .pkt { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
/* Pause: der rote Punkt steht still (rot, sichtbar), bei „Weiter“ blinkt er wieder */
body[data-pausiert] .diktier .pkt, body[data-pausiert] .rec-top .pkt { animation: none; }

/* Arbeitsfläche */
.flaeche { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 348px; }
.tisch { min-width: 0; overflow: auto; padding: 28px 24px 40px; }
.spalte { background: var(--bg); border-left: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; }

/* Blatt (DIN 5008, verkleinert) */
.blatt { position: relative; width: 100%; max-width: 720px; margin: 0 auto; min-height: 980px; background: #fff; border-radius: 2px; box-shadow: 0 1px 2px rgba(27,28,33,.08), 0 6px 24px rgba(27,28,33,.06); padding: 56px 64px 64px 72px; font: 14.5px/1.6 var(--brief); color: #222; }
.absender { font-size: 9.5px; color: #888; border-bottom: 1px solid #ddd; padding-bottom: 3px; width: 62%; }
.kopfblock { display: flex; justify-content: space-between; gap: 24px; margin-top: 10px; }
.anschrift { font-size: 13.5px; line-height: 1.5; color: #333; }
.info { display: grid; grid-template-columns: 78px minmax(120px, auto); column-gap: 10px; row-gap: 1px; align-items: center; font-size: 12px; line-height: 1.7; color: #222; min-width: 210px; }
.info .l { color: #888; }
.info .leer-wert { color: #b3b6bd; }
/* Blaue Kästen im Briefkopf (Slava 19.11.): Krankenkasse links, Patientendaten rechts über alle drei Zeilen.
   .pat ist auch die Patienten-Karte der Spalte (margin/padding/border) – hier ausdrücklich zurückgesetzt. */
.ph.block { margin: 0; border: 0; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 6px; white-space: normal; line-height: 1.35; font-size: 12px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, #fff); }
.info .ph.block { grid-column: 2; grid-row: 2 / span 3; align-self: stretch; }
.anschrift .ph.block.kasse { display: inline-flex; font-size: 13.5px; line-height: 1.5; padding: 8px 12px; }
.ph.block.kasse small { font-size: 11px; }
.ph.block::before { margin-right: 0; flex: none; }
.ph.block small { display: block; font-size: 10.5px; opacity: .8; }
.ph { background: color-mix(in srgb, var(--accent) 10%, #fff); color: var(--accent); border-radius: 3px; padding: 0 3px; font-size: .95em; white-space: nowrap; }
.betreff { font-weight: 700; margin: 40px 0 18px; font-size: 14.5px; min-height: 1.6em; }
.text { outline: none; min-height: 380px; position: relative; }
.text p { margin: 0 0 .9em; }
.text:empty::before, .text.leer::before { content: attr(data-hinweis); color: #9a9da6; pointer-events: none; position: absolute; inset: 0 auto auto 0; font-family: var(--sans); font-size: 15px; line-height: 1.6; max-width: 32em; }
.text .neu { background: linear-gradient(transparent 0, color-mix(in srgb, var(--accent) 9%, #fff) 0); border-radius: 2px; transition: background 1.6s ease; }
.text .neu.ruhig { background: transparent; }
.text .ergaenzt { box-shadow: -10px 0 0 -7px var(--accent); }
.denkt { display: grid; gap: 10px; margin-top: 4px; }
.denkt i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef1f3 0%, #e1e7ea 40%, #eef1f3 80%); background-size: 200% 100%; animation: schimmer 1.3s linear infinite; }
@keyframes schimmer { to { background-position: -200% 0; } }
.schluss { margin-top: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.unter { position: relative; width: 260px; }
.unter canvas { display: block; width: 260px; height: 72px; touch-action: none; }
.unter .linie { border-top: 1px solid #999; font-size: 11px; color: #777; padding-top: 3px; }
.unter.aktiv canvas { background: color-mix(in srgb, var(--accent) 6%, #fff); border-radius: 6px 6px 0 0; cursor: crosshair; }
.unter .zeig { position: absolute; left: 0; right: 0; top: 24px; text-align: center; font: 600 13px var(--sans); color: var(--accent); pointer-events: none; }
.stempel { width: 190px; min-height: 84px; border: 1.5px dashed #c9ced3; border-radius: 6px; display: grid; place-items: center; font: 11.5px var(--sans); color: #9a9da6; text-align: center; padding: 6px; }
.stempel.hat { border-color: transparent; padding: 0; }
.stempel button { border: 0; background: transparent; color: var(--accent); font: 600 12.5px var(--sans); cursor: pointer; padding: 8px; line-height: 1.35; }
.unter-hinweis { margin: 14px 0 0; font: 12px/1.5 var(--sans); color: var(--muted); max-width: 46em; }
.ph.pat::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 4px; vertical-align: -1px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.5'/%3E%3Cpath d='M3 22a9 9 0 0 1 18 0z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.5'/%3E%3Cpath d='M3 22a9 9 0 0 1 18 0z'/%3E%3C/svg%3E") center/contain no-repeat; }
.seitenfuss { position: absolute; left: 72px; right: 64px; bottom: 22px; display: flex; justify-content: space-between; font-size: 10px; color: #aaa; }

/* Diktat-Spalte */
.sp-kopf { padding: 20px 22px 6px; }
.eye { margin: 0 0 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.sp-kopf h2 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.sp-kopf p { margin: 8px 0 0; color: var(--text); font-size: 14.5px; text-wrap: pretty; }
.schritte { list-style: none; margin: 14px 22px 4px; padding: 0; display: grid; gap: 0; }
.schritte li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 9px 0; font-size: 14px; color: var(--text); border-top: 1px solid var(--line); }
.schritte li:first-child { border-top: 0; }
.schritte .nr { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: var(--accent); background: var(--soft); font-variant-numeric: tabular-nums; }
.schritte li b { color: var(--fg); font-weight: 600; display: block; }
.schritte li.an .nr { background: var(--accent); color: #fff; }
.schritte li.ok .nr { background: var(--ok); color: #fff; }
.schritte .kurz { display: none; font-style: normal; }
.schritte li[hidden] { display: none; }
.schritte.kompakt { grid-template-columns: repeat(4, 1fr); margin-top: 12px; position: relative; }
.schritte.kompakt::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 12px; height: 2px; background: var(--line); }
.schritte.kompakt li { grid-template-columns: 1fr; justify-items: center; gap: 4px; border: 0; padding: 0; text-align: center; position: relative; }
.schritte.kompakt li > span:last-child { display: none; }
.schritte.kompakt .kurz { display: block; font-size: 12.5px; color: var(--muted); }
.schritte.kompakt li.an .kurz { color: var(--fg); font-weight: 600; }
.schritte.kompakt .nr { box-shadow: 0 0 0 4px var(--bg); }

/* Der nächste Schritt – eine klare Karte, eine Taste */
.naechst { border-radius: 16px; background: var(--fg); color: #fff; padding: 16px; }
.naechst .eye { color: #a9c3cf; margin-bottom: 4px; }
.naechst h3 { margin: 0; font-size: 18px; line-height: 1.25; letter-spacing: -.01em; }
.naechst p { margin: 6px 0 14px; font-size: 13.5px; color: #c9ccd3; text-wrap: pretty; }
.naechst .los2 { width: 100%; height: 48px; border: 0; border-radius: 11px; background: #fff; color: var(--fg); font-weight: 600; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.naechst .los2 svg { width: 18px; height: 18px; }
.naechst .los2.zweit { margin-top: 8px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); }
.naechst .los2.zweit:hover { background: rgba(255,255,255,.1); }
.naechst .los2.zweit:disabled { background: transparent; color: #9a9da6; border-color: #4a4d55; }
.naechst.hell .los2.zweit { background: var(--bg); color: var(--fg); border-color: var(--line); }
.nebenbei { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 2px 0; }
.nebenbei button { border: 0; background: transparent; padding: 8px 0; min-height: 40px; color: var(--accent); font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.nebenbei svg { width: 16px; height: 16px; }

/* Weg des Briefs als kleine Strecke */
.strecke { margin: 16px 22px 0; }
.strecke h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.strecke ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.strecke ol::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 17px; border-top: 2px dotted #c7d0d5; }
.strecke li { display: grid; justify-items: center; text-align: center; gap: 6px; font-size: 12px; line-height: 1.3; color: var(--text); position: relative; padding: 0 2px; }
.strecke .knoten { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); box-shadow: 0 0 0 4px var(--bg); }
.strecke li.du .knoten { background: var(--accent); color: #fff; }
.strecke .knoten svg { width: 17px; height: 17px; }
.strecke.f5 ol { grid-template-columns: repeat(5, 1fr); }
.strecke.f5 ol::before { left: 10%; right: 10%; }
.strecke.f5 li { font-size: 11.5px; }
.strecke p { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); text-wrap: pretty; }

/* Stempel zuschneiden */
.stempel img { display: block; max-width: 205px; max-height: 92px; mix-blend-mode: multiply; }
.stempel .aendern { position: absolute; right: 0; bottom: -22px; font: 600 11.5px var(--sans); color: var(--accent); background: transparent; border: 0; padding: 4px 0; cursor: pointer; }
.stempel { position: relative; }
.dlg { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(27,28,33,.45); padding: 16px; }
.dlg[hidden] { display: none; }
.dlg-in { width: min(760px, 100%); max-height: 100%; overflow: auto; background: var(--bg); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25); padding: 20px; display: grid; gap: 14px; }
.dlg-in h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.dlg-in > p { margin: -6px 0 0; color: var(--text); font-size: 14px; }
.dlg-haupt { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 16px; }
.buehne { position: relative; background: var(--floor) repeating-conic-gradient(#e6eaed 0 25%, transparent 0 50%) 0 0 / 16px 16px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; min-height: 260px; touch-action: none; user-select: none; }
.buehne canvas { display: block; max-width: 100%; }
.rahmen { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(27,28,33,.5), 0 0 0 1px rgba(27,28,33,.4); cursor: move; }
.rahmen i { position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.rahmen i[data-e="nw"] { left: -10px; top: -10px; cursor: nwse-resize; } .rahmen i[data-e="ne"] { right: -10px; top: -10px; cursor: nesw-resize; }
.rahmen i[data-e="sw"] { left: -10px; bottom: -10px; cursor: nesw-resize; } .rahmen i[data-e="se"] { right: -10px; bottom: -10px; cursor: nwse-resize; }
.vorschau { display: grid; gap: 10px; align-content: start; font-size: 13px; color: var(--text); }
.vorschau h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.mini-blatt { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 14px 12px; height: 128px; display: flex; align-items: flex-end; justify-content: flex-end; position: relative; }
.mini-blatt::before { content: ""; position: absolute; left: 12px; right: 40%; top: 18px; height: 40px; background: repeating-linear-gradient(#e7e9ec 0 3px, transparent 3px 9px); }
.mini-blatt canvas { max-width: 120px; max-height: 54px; mix-blend-mode: multiply; }
.schalter { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.schalter input { width: 18px; height: 18px; accent-color: var(--accent); }
.dlg-fuss { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dlg-fuss .hell { height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; font-weight: 500; }
.dlg-fuss .haupt { height: 44px; }
.dlg-fuss .links { margin-right: auto; }
@media (max-width: 640px) { .dlg-haupt { grid-template-columns: 1fr; } }
.modul { margin: 10px 22px 0; }
.aufnehmen { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 0; border-radius: 14px; background: var(--fg); color: #fff; cursor: pointer; text-align: left; }
.aufnehmen .rund { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--rec); display: grid; place-items: center; box-shadow: 0 0 0 5px rgba(194,57,75,.22); }
.aufnehmen .rund svg { width: 20px; height: 20px; color: #fff; }
.aufnehmen b { display: block; font-size: 16px; font-weight: 600; }
.aufnehmen span { font-size: 13px; color: #b9bcc4; }
.aufnehmen:disabled { opacity: .45; cursor: not-allowed; }
.leise { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-wrap: pretty; }
.zust { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--soft); font-size: 13.5px; color: var(--text); cursor: pointer; }
.zust input { color-scheme: light; background: #fff; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }

.rec { border-radius: 14px; background: var(--fg); color: #fff; padding: 16px; }
.rec-top { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #c9ccd3; }
.rec-top .pkt { width: 10px; height: 10px; border-radius: 50%; background: #ff5a6e; animation: blink 1s steps(2, start) infinite; }
.rec-top .uhr { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; color: #fff; letter-spacing: -.01em; }
.welle { display: flex; align-items: center; gap: 3px; height: 40px; margin: 12px 0; }
.welle b { flex: 1; background: #a9c3cf; border-radius: 2px; height: 10%; transition: height .12s ease; }
.rec-knoepfe { display: flex; gap: 8px; }
.rec-knoepfe button { flex: 1; height: 44px; border-radius: 10px; border: 0; cursor: pointer; font-weight: 600; }
.rec-knoepfe .pause { background: #2f3139; color: #e5e7eb; }
.rec-knoepfe .fertig { background: #fff; color: var(--fg); flex: 1.6; }
.worte { margin-top: 14px; font-size: 13.5px; color: var(--text); }
.worte h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.worte p { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--floor); line-height: 1.55; max-height: 190px; overflow: auto; }
.worte p:empty::before { content: "Ihre Worte erscheinen hier."; color: var(--muted); }

.anstoss { margin: 14px 22px 0; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); box-shadow: 0 4px 18px rgba(27,28,33,.06); animation: rein .35s ease both; }
@keyframes rein { from { opacity: 0; transform: translateY(6px); } }
.anstoss p { margin: 0 0 10px; font-size: 14px; color: var(--text); text-wrap: pretty; }
.anstoss p b { color: var(--fg); }
.zeile2 { display: flex; gap: 8px; flex-wrap: wrap; }
.klein { height: 38px; padding: 0 12px; border-radius: 9px; border: 0; background: var(--fg); color: #fff; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.klein.hell { background: var(--floor); color: var(--fg); }
.fertigbox { padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--ok) 9%, var(--bg)); color: var(--fg); font-size: 14px; }
.fertigbox b { display: block; margin-bottom: 2px; }
.fertigbox span { color: var(--text); }
.pat { margin: 14px 22px 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.pat h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.wahl { display: grid; grid-template-columns: 1fr 1fr; background: var(--floor); border-radius: 10px; padding: 3px; gap: 3px; }
.wahl button { border: 0; background: transparent; border-radius: 8px; min-height: 40px; padding: 4px 8px; font-size: 13.5px; font-weight: 500; color: var(--text); cursor: pointer; line-height: 1.25; }
.wahl button[aria-pressed="true"] { background: var(--bg); color: var(--fg); font-weight: 600; box-shadow: 0 1px 2px rgba(27,28,33,.1); }
.wahl button:disabled { cursor: not-allowed; opacity: .55; }
.optionen { display: grid; gap: 8px; margin-bottom: 12px; }
.option { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; width: 100%; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; }
.option:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.option .kreis { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #b4b8c0; margin-top: 1px; display: grid; place-items: center; background: var(--bg); }
.option[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.option[aria-pressed="true"] .kreis { border-color: var(--accent); }
.option[aria-pressed="true"] .kreis::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.option b { display: block; font-size: 15px; font-weight: 600; }
.option small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.formular { margin-bottom: 12px; }
.formular .felder { margin-top: 0; }
.formular .zust { margin-top: 10px; padding: 10px 12px; font-size: 13px; }
.formular .leise { margin-top: 8px; font-size: 12.5px; }
.los2:disabled { background: #4a4d55; color: #9a9da6; cursor: not-allowed; }
.naechst.hell { background: var(--bg); color: var(--fg); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(27,28,33,.04); }
.naechst.hell .eye { color: var(--accent); }
.naechst.hell p { color: var(--muted); }
.naechst.hell .formular .leise { color: var(--muted); }
.naechst.hell .los2 { background: var(--fg); color: #fff; }
.naechst.hell .los2:disabled { background: #d4d7dc; color: #7c7f88; }
.patzeile { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--floor); font-size: 13px; color: var(--text); }
.patzeile svg { width: 16px; height: 16px; flex: none; color: var(--accent); }
.patzeile span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patzeile button { border: 0; background: transparent; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px 0; }
.felder { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.felder label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.felder label.breit { grid-column: 1 / -1; }
.felder input { height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: #fff; color-scheme: light; -webkit-appearance: none; appearance: none; font: 14px var(--sans); color: var(--fg); min-width: 0; width: 100%; }
.felder input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
/* Fehler-UX (A1-F6, 23.11.): falsches Feld rot umrandet, auch mit Fokus */
.felder input[aria-invalid="true"] { border-color: var(--rec); }
.felder input[aria-invalid="true"]:focus { outline-color: var(--rec); }
.pat .leise { margin-top: 10px; }
.info .wert { color: #222; }
.ph.pat { cursor: pointer; }
.werkzeuge { display: grid; gap: 8px; margin-top: 12px; }
.werkzeuge button { display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); cursor: pointer; font-weight: 500; text-align: left; }
.werkzeuge button:hover { background: var(--floor); }
.werkzeuge svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.sp-fuss { margin-top: auto; padding: 16px 22px 18px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-start; }
.sp-fuss svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

/* Statuszeile wie in Word */
.status { display: flex; gap: 18px; align-items: center; height: 28px; background: var(--bg); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); font-variant-numeric: tabular-nums; }
.status .r { margin-left: auto; }

@media (max-width: 900px) {
  body { height: auto; min-height: 100%; }
  .flaeche { grid-template-columns: 1fr; }
  .spalte { border-left: 0; border-top: 1px solid var(--line); order: -1; }
  .sp-fuss { display: none; }
  .tisch { padding: 16px 12px 28px; }
  .blatt { padding: 32px 24px 56px; min-height: 0; font-size: 13.5px; }
  .seitenfuss { left: 24px; right: 24px; }
  .kopfblock { flex-direction: column; gap: 12px; }
  .doc-zeile, .strich, .pille { display: none; }
  .schluss { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) { .haupt .lang { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ─── Ergänzungen der echten Seite (17.11.2026) ─── */
/* Eingabefelder und Häkchen immer hell – auch im Dunkelmodus des Geräts */
input, textarea, select { color-scheme: light; }
input[type="checkbox"] { background: #fff; color-scheme: light; }
.haupt[hidden], .los2[hidden], .klein[hidden] { display: none; }
a.marke { color: inherit; text-decoration: none; }
a.haupt { text-decoration: none; }
.doc-zeile .gesp.fehl::before { background: var(--rec); }
.noscript { margin: 16px 22px; padding: 12px 14px; border-radius: 12px; background: var(--soft); color: var(--text); font-size: 14px; }

/* Briefkopf-Zeilen (statt Inline-Stil) */
.info .r1 { grid-row: 1; } .info .r2 { grid-row: 2; } .info .r3 { grid-row: 3; } .info .r4 { grid-row: 4; }

/* Platzhalter-Marken im Brief: ein Stück, nicht editierbar */
.text .ph { display: inline-block; cursor: default; user-select: all; -webkit-user-select: all; }
/* Die Marken im Brief sind kleine Wort-Marken – nicht die Patienten-Karte (.pat in der Spalte). */
.text .ph, .info .ph:not(.block) { margin: 0; padding: 0 3px; border: 0; border-radius: 3px; line-height: inherit; }
/* Offene Stelle „[bitte ergänzen: …]“: fällt auf, bleibt aber normaler, änderbarer Text. */
.text mark.offen { background: #fff1d6; color: #7a4b00; border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -1px 0 #e8b864; }
/* Gelbe Stelle (Slava 19.11.): ein Klick leert sie, der Hinweis steht beim Tippen klein darüber */
.text mark.offen { cursor: text; position: relative; }
.text mark.offen:hover { background: #ffe6b5; }
.text mark.offen.tippt { background: #fff7e8; padding: 0 4px; box-shadow: inset 0 -2px 0 #e8b864; }
.text mark.offen.tippt::before { content: attr(data-hinweis); position: absolute; left: -2px; bottom: calc(100% + 4px); width: max-content; max-width: min(30em, 70vw); white-space: normal; font: 600 11px/1.35 var(--sans); color: #6b4100; background: #ffe7b8; border: 1px solid #e8b864; border-radius: 6px; padding: 3px 8px; pointer-events: none; user-select: none; -webkit-user-select: none; z-index: 3; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
/* Gelbe Stelle einsprechen (Kevin 19.11.): kleiner Knopf neben der geöffneten Stelle; während der Aufnahme pulsiert die Stelle */
.stelle-hilfe { position: fixed; z-index: 40; display: flex; align-items: center; gap: 8px; max-width: min(34em, calc(100vw - 16px)); padding: 3px 3px 3px 8px; font: 600 11px/1.35 var(--sans); color: #6b4100; background: #ffe7b8; border: 1px solid #e8b864; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.stelle-hilfe[hidden] { display: none; }
.stelle-hilfe .sh-text { min-width: 0; }
.sh-mikro { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px 0 7px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: 600 11.5px/1 var(--sans); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sh-mikro svg { width: 13px; height: 13px; }
.sh-mikro:hover { filter: brightness(1.1); }
.sh-mikro:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse) { .sh-mikro { height: 36px; padding: 0 12px 0 10px; font-size: 14px; } .stelle-hilfe { font-size: 13px; } }
.text mark.offen.tippt.mit-hilfe::before { display: none; }
/* Vorschläge zu einer gelben Stelle („Übernehmen: …“): eigene Zeile im Kästchen, Touch-Ziel ≥ 48 px */
.stelle-hilfe { flex-wrap: wrap; }
.sh-vorschlaege { flex: 0 0 100%; display: grid; gap: 4px; }
.sh-vorschlaege:empty { display: none; }
.sh-vorschlag { min-height: 48px; padding: 6px 12px; border: 1px solid #e8b864; border-radius: 8px; background: #fff; color: #5c3700; font: 600 13px/1.35 var(--sans); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sh-vorschlag:hover { background: #fff7e8; }
.sh-vorschlag:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sh-mikro[hidden] { display: none; }
.text mark.offen.hoert { background: #ffe1a3; animation: hoert 1.2s ease-in-out infinite alternate; }
@keyframes hoert { from { box-shadow: inset 0 -2px 0 #e8b864, 0 0 0 0 rgba(232, 184, 100, .55); } to { box-shadow: inset 0 -2px 0 #e8b864, 0 0 0 5px rgba(232, 184, 100, 0); } }
@media (prefers-reduced-motion: reduce) { .text mark.offen.hoert { animation: none; } }
/* Legende über dem Blatt (Slava 19.11.): kleiner weißer Kasten, erscheint mit dem Brief – die Muster sehen aus wie die Marken im Brief */
.legende { width: fit-content; max-width: 720px; margin: 0 auto 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 20px; padding: 9px 16px; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(27,28,33,.08), 0 4px 14px rgba(27,28,33,.06); font: 13px/1.3 var(--sans); color: var(--text); animation: rein .35s ease both; }
.legende[hidden], .lg-eintrag[hidden] { display: none; }
.lg-eintrag { display: inline-flex; align-items: center; gap: 7px; cursor: help; }
.lg { flex: none; display: inline-block; padding: 3px 7px; border-radius: 4px; font: 600 11.5px/1.2 var(--brief); }
.lg.blau { background: color-mix(in srgb, var(--accent) 10%, #fff); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, #fff); }
.lg.gelb { background: #fff1d6; color: #7a4b00; box-shadow: inset 0 -2px 0 #e8b864; }
/* Leiste: Auswahlfeld (Zoom) und gedrückte Knöpfe wie in Docs/Word */
.w.feld { position: relative; gap: 2px; grid-auto-flow: column; padding: 0 6px 0 8px; }
.w.feld select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; padding: 0 16px 0 0; height: 100%; outline: none; }
.w.feld svg { position: absolute; right: 6px; width: 12px; height: 12px; pointer-events: none; }
.w.feld:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.w[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.blatt { zoom: var(--zoom, 1); }
.text .ph.pat { cursor: default; }
.info .ph.pat { cursor: pointer; }

/* Lade-Balken beim Schreiben (statt Inline-Breiten) */
.denkt i:nth-of-type(1) { width: 30%; } .denkt i:nth-of-type(2) { width: 96%; } .denkt i:nth-of-type(3) { width: 88%; }
.denkt i:nth-of-type(4) { width: 92%; } .denkt i:nth-of-type(5) { width: 60%; } .denkt i:nth-of-type(6) { width: 94%; } .denkt i:nth-of-type(7) { width: 80%; }
/* Warten sichtbar (Slava 19.11.): Satz mit hüpfenden Punkten auf dem Blatt, kräftigere Schimmer-Zeilen */
.denkt-ton { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font: 600 14px var(--sans); color: var(--accent); }
.punkte { display: inline-flex; gap: 4px; }
.punkte b { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: hupf 1s ease-in-out infinite; }
.punkte b:nth-child(2) { animation-delay: .15s; } .punkte b:nth-child(3) { animation-delay: .3s; }
@keyframes hupf { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-5px); opacity: 1; } }
.denkt i { background: linear-gradient(90deg, #e6ebee 0%, #d3dce1 40%, #e6ebee 80%); background-size: 200% 100%; }
/* Seitenspalte: zwei Arbeitsschritte mit Haken und ein Balken */
.arbeit { border-radius: 14px; background: var(--fg); color: #fff; padding: 16px; }
.arbeit ol { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.arbeit li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(255,255,255,.5); }
.arbeit li.an { color: #fff; font-weight: 600; } .arbeit li.ok { color: rgba(255,255,255,.8); }
.ap-pkt { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); display: grid; place-items: center; }
.arbeit li.an .ap-pkt { border-color: rgba(255,255,255,.25); border-top-color: #fff; animation: dreh .8s linear infinite; }
.arbeit li.ok .ap-pkt { border-color: var(--ok); background: var(--ok); }
.arbeit li.ok .ap-pkt::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
@keyframes dreh { to { transform: rotate(360deg); } }
.balken { height: 6px; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; }
.balken i { display: block; height: 100%; width: 0; border-radius: 3px; background: #fff; transition: width .25s linear; }

/* Stempel-Feld auf dem Blatt */
.stempel.leer-fest { cursor: default; }
.stempel .stempel-neu { color: var(--accent); font: 600 12.5px var(--sans); }
.stempel .stempel-neu small { display: block; font-weight: 400; color: var(--muted); }
.stempel .entfernen { position: absolute; left: 0; bottom: -22px; font: 600 11.5px var(--sans); color: var(--muted); background: transparent; border: 0; padding: 4px 0; cursor: pointer; }
.dlg-in.schmal { width: min(460px, 100%); }
.dlg-in .klein-hinweis { color: var(--muted); font-size: 12.5px; }
.dlg-in .dlg-fehler { margin: 0; color: var(--rec); font-size: 13.5px; font-weight: 600; }

/* Unterschrift löschen */
.textknopf { border: 0; background: transparent; padding: 8px 0; min-height: 40px; color: var(--accent); font: 600 13px var(--sans); cursor: pointer; }
.textknopf[hidden] { display: none; }

/* Fehler und Hinweise in der Spalte – freundlich, mit Weg weiter */
.melde { margin: 14px 22px 0; padding: 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--rec) 35%, var(--line)); background: color-mix(in srgb, var(--rec) 5%, var(--bg)); }
.melde.info { display: block; font-size: inherit; line-height: inherit; border-color: var(--line); background: var(--soft); } /* .info ist auch der Briefkopf (Raster) – hier nicht */
.melde p { margin: 0 0 10px; font-size: 14px; color: var(--text); text-wrap: pretty; }
.melde p b { display: block; color: var(--fg); font-size: 14.5px; margin-bottom: 2px; }
.melde .zeile2 { margin-top: 2px; }
/* Kein Brief (Regel 8): Grund der KI und das Gehörte als eigene, ruhige Zeilen */
.melde p.grund, .melde p.gehoert { margin: 0 0 10px; padding: 9px 11px; border-radius: 10px; background: var(--bg); font-size: 13.5px; line-height: 1.45; }
.melde p.grund { box-shadow: inset 3px 0 0 #e8b864; }
.melde p.gehoert { color: var(--muted); }
.melde p.grund span, .melde p.gehoert span { display: block; font: 600 11px/1.3 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.melde a.klein { display: inline-flex; align-items: center; text-decoration: none; }
.zust.rot { box-shadow: inset 0 0 0 2px var(--rec); }
.feh { margin: 8px 0 0; color: var(--rec); font-size: 13px; font-weight: 600; }
.hinweis-feh { margin: 0 0 8px; color: var(--rec); font-size: 13px; font-weight: 600; }

/* Ergänzen ohne Mikrofon: kleines Tipp-Feld */
.tippkarte { margin: 10px 22px 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 10px; }
.tippkarte label { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.tippkarte textarea { width: 100%; min-height: 96px; resize: vertical; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--fg); font: 14px/1.5 var(--sans); }
.tippkarte textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

/* Wartezeit: Hinweis, dass es weitergeht */
.worte .warte { background: var(--soft); color: var(--text); }
.rec-top .rest { margin-left: 8px; font-size: 12.5px; color: #c9ccd3; }

/* Freigegeben */
.fertigbox { margin: 10px 22px 0; }
/* Code-Weg (22.11.2026): der Code für den Patienten, groß und gut lesbar */
.codebox { margin: 10px 22px 0; padding: 16px; border-radius: 16px; background: var(--soft); border: 1px solid var(--soft2); }
.codebox .cb-eye { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--accent); }
.codebox .cb-code { margin: 0; font: 600 34px/1.15 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; color: var(--fg); word-break: break-all; user-select: all; }
.codebox .cb-daten { margin: 6px 0 14px; font-size: 14px; color: var(--text); }
.codebox .cb-daten b { color: var(--fg); font-weight: 600; }
.codebox .cb-kopie { width: 100%; min-height: 48px; border: 0; border-radius: 11px; background: var(--fg); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; }
.codebox .cb-kopie.ok { background: var(--ok); }
.codebox .cb-satz { margin: 10px 0 0; font-size: 13.5px; color: var(--text); text-wrap: pretty; }
.codebox .cb-text { margin-top: 8px; }
.codebox .cb-text summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.codebox .cb-text textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: #fff; color-scheme: light; font: 13px/1.5 var(--sans); color: var(--fg); resize: vertical; }
.codebox .cb-klein { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); text-wrap: pretty; }
.fertigbox + .naechst { margin-top: 12px; }
body[data-frei="1"] .leiste .w:not(.feld), body[data-frei="1"] .diktier { opacity: .45; pointer-events: none; }
body[data-frei="1"] .text, body[data-frei="1"] .betreff { cursor: default; }

/* Touch-Ziele ab 48 px auf Handy und Tablet (Mobile-first); am Desktop bleibt der abgenommene Entwurf */
@media (pointer: coarse), (max-width: 900px) {
  .haupt, .dlg-fuss .hell, .dlg-fuss .haupt, .klein, .rec-knoepfe button { min-height: 48px; height: auto; }
  .diktier { height: 48px; }
  .w { min-width: 48px; height: 48px; }
  .leiste { height: 56px; }
  .nebenbei button, .textknopf, .patzeile button { min-height: 48px; }
  .wahl button, .option { min-height: 48px; }
  .felder input { height: 48px; }
  .stempel button { min-height: 48px; }
  /* 48 px hoch, deshalb ganz unter den Stempel statt 22 px darüber (E2E 26.11.2026: die Knöpfe lagen am Handy auf dem Stempelbild) */
  .stempel .aendern, .stempel .entfernen { min-height: 48px; display: inline-flex; align-items: center; bottom: -50px; }
  .stempel.hat { margin-bottom: 44px; }
  .schalter input, .zust input { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) { .anstoss, .melde { animation: none; } }
.stempel button small { display: block; font-weight: 400; color: var(--muted); }
.doc-zeile .gesp.still::before { display: none; }
a.klein { display: inline-flex; align-items: center; text-decoration: none; }
.tippkarte .leise { margin: 0; }

/* Ankunft von der Seite für Einrichtungen (Klick auf den roten Knopf): Das kleine Programmbild wächst zu diesem
   Arbeitsplatz. Seitenübergang des Browsers; die Namen stehen gleich in public/praxis/landing.html. Das Beispiel
   blendet unterwegs aus, das echte, bedienbare Blatt ein. Browser ohne diese Funktion laden einfach die Seite. */
/* Am Handy (Spalte oben, anderer Aufbau) gibt es nur ein weiches Überblenden; das Wachsen erst ab 901 px wie dort. */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
@media (prefers-reduced-motion: no-preference) and (min-width: 901px) {
  html { background: var(--floor); } /* sonst wandert der Body-Hintergrund auf die Leinwand und der wachsende Rahmen wäre durchsichtig */
  body { view-transition-name: vt-rahmen; }
  .kopf { view-transition-name: vt-kopf; } .leiste { view-transition-name: vt-leiste; }
  .tisch { view-transition-name: vt-tisch; } .blatt { view-transition-name: vt-blatt; } .spalte { view-transition-name: vt-spalte; }
  ::view-transition-group(*) { animation-duration: .82s; animation-timing-function: cubic-bezier(.6, 0, .3, 1); } /* weich anfahren, weich abbremsen */
  /* Die alte Seite bleibt stehen, bis das wachsende Fenster sie bedeckt; der Rahmen blendet weich vom weißen Fenster zum Boden */
  ::view-transition-old(root) { animation: vt-weg .25s ease .58s both; }
  ::view-transition-new(root) { animation: vt-da .25s ease .58s both; }
  ::view-transition-old(vt-kopf), ::view-transition-old(vt-leiste), ::view-transition-old(vt-blatt), ::view-transition-old(vt-spalte), ::view-transition-old(vt-tisch) { animation: vt-weg .42s ease-in-out .24s both; }
  ::view-transition-new(vt-kopf), ::view-transition-new(vt-leiste), ::view-transition-new(vt-blatt), ::view-transition-new(vt-spalte), ::view-transition-new(vt-tisch) { animation: vt-da .42s ease-in-out .24s both; } /* gleicher Takt: leeres Beispiel und echtes Blatt blenden ineinander, ohne blasse Mitte */
}
@keyframes vt-weg { to { opacity: 0; } }
@keyframes vt-da { from { opacity: 0; } }
