:root {
  --bg: #f4f6f8; --card: #fff; --text: #1b2430; --muted: #5b6775; --line: #d9dee4;
  --primary: #0b5cad; --primary-text: #fff; --danger: #b3261e; --ok: #1e7a3c; --warn: #9a6700;
  --radius: 10px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1rem; }
header.top { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--primary); text-decoration: none; font-size: 1.1rem; display: inline-flex; align-items: center; gap: .5rem; }
.brand-logo { height: 1.6rem; width: auto; display: block; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem; }
footer a { color: var(--muted); }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; } h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin: 0 auto 1rem; max-width: 1100px; }
form.card, .card.narrow { max-width: 520px; }
.stack { display: flex; flex-direction: column; gap: .5rem; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row[hidden] { display: none; }
.center { text-align: center; }
label { font-weight: 600; font-size: .95rem; }
label.check { display: flex; gap: .75rem; align-items: flex-start; font-weight: 400; cursor: pointer; padding: .4rem 0; }
input { font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
/* Checkboxen: feste Größe (≥ 24 px, WCAG 2.5.8), schrumpfen im Flex-Layout neben langem Text nicht */
input[type="checkbox"] { flex: 0 0 auto; width: 1.5rem; height: 1.5rem; min-width: 1.5rem; margin: .1rem 0 0; padding: 0; accent-color: var(--primary); cursor: pointer; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #7fb2ec; outline-offset: 2px; }
button, a.button { font: inherit; background: var(--primary); color: var(--primary-text); border: 0; border-radius: 8px; padding: .6rem 1rem; cursor: pointer; text-decoration: none; display: inline-block; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary { background: #e7ebf0; color: var(--text); }
button.danger { background: var(--danger); }
.small { padding: .35rem .7rem; font-size: .9rem; }
.muted { color: var(--muted); }
.error { background: #fdecea; color: var(--danger); border: 1px solid #f5c2bd; padding: .75rem 1rem; border-radius: 8px; margin: 0 auto 1rem; max-width: 1100px; }
.ok { color: var(--ok); } p.error, p.ok { background: none; border: 0; padding: 0; }
.list { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem; border: 1px solid var(--line); border-radius: 8px; flex-wrap: wrap; }
.linkbox { background: #eef5fc; border-radius: 8px; padding: .75rem; margin-top: 1rem; }
.linkbox input { flex: 1; }
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.badge.ok { background: #e3f4e8; color: var(--ok); }
.badge.pending { background: #fff4d6; color: var(--warn); }
code.secret { font-size: 1.2rem; letter-spacing: .05em; background: #f0f2f5; padding: .5rem; border-radius: 6px; }
code.uri { word-break: break-all; font-size: .8rem; }
.qr-box { display: flex; justify-content: center; }
canvas.qr { width: min(100%, 264px); height: auto; image-rendering: pixelated; border: 1px solid #d0d5dc; border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--line); }
.scroll { max-height: 400px; overflow: auto; }
.device video.preview { width: 100%; max-width: 420px; border-radius: 8px; background: #000; transform: scaleX(-1); }
.meter { display: flex; gap: .5rem; align-items: center; } meter { flex: 1; max-width: 300px; }

/* Videosprechstunde */
.call { display: flex; flex-direction: column; gap: .75rem; }
.call-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.security { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.sas { font-size: .9rem; } .sas code { font-size: 1rem; font-weight: 700; background: #eef5fc; padding: .1rem .4rem; border-radius: 4px; }
.call-main { display: flex; gap: 1rem; }
.grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .75rem; }
.tile { margin: 0; position: relative; background: #111; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile.local video { transform: scaleX(-1); }
.tile figcaption { position: absolute; left: .5rem; bottom: .5rem; background: rgba(0,0,0,.6); color: #fff; padding: .2rem .5rem; border-radius: 6px; font-size: .85rem; }
.quality[data-level="schlecht"] { color: #ffb4ab; } .quality[data-level="mittel"] { color: #ffe08a; }
/* Medienweg (Dok. 11 T22): Hinweis in der Kachel, Weiterleitung farblich wie „mittel“ */
.route-tile[data-route="relay"] { color: #ffe08a; }
.lobby { width: 280px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; }
.lobby-entry { border-top: 1px solid var(--line); padding: .5rem 0; display: flex; flex-direction: column; gap: .4rem; }
.waiting { text-align: center; background: var(--card); border-radius: var(--radius); padding: 2rem; }
.practice-logo { display: block; max-width: min(280px, 70%); max-height: 160px; width: auto; height: auto; object-fit: contain; margin: 0 auto 1rem; }
.practice-logo[hidden] { display: none; }
.logo-admin .practice-logo { margin: 0 0 .75rem; max-height: 120px; }
.spinner { width: 36px; height: 36px; margin: 1rem auto; border: 4px solid #d0dbe8; border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.controls { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.call-status { color: var(--muted); }
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: #1b2430; color: #fff; padding: .6rem 1rem; border-radius: 8px; }
.legal { max-width: 800px; }
.legal h2 { margin-top: 1.5rem; }
@media (max-width: 760px) { .call-main { flex-direction: column; } .lobby { width: auto; } }

/* Admin-Konsole: Navigation und Kontenverwaltung (gruppiert nach Praxis) */
nav.admin-nav { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
nav.admin-nav a.button { display: inline-flex; align-items: center; gap: .45rem; background: #e7ebf0; color: var(--text); }
nav.admin-nav a.button[aria-current="page"] { background: var(--primary); color: var(--primary-text); }
select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
select:focus-visible { outline: 3px solid #7fb2ec; outline-offset: 2px; }
.acc-filter { align-items: flex-end; }
.acc-filter .field { display: flex; flex-direction: column; gap: .2rem; }
/* Ärztinnen/Ärzte in Weiterbildung: Beschriftung über dem Feld */
.trainee-form .field, #trainees details .field { display: flex; flex-direction: column; gap: .2rem; }
.trainee-form { display: grid; gap: .6rem; justify-items: start; }
#trainees details { margin-top: .4rem; }
#trainees details[open] { display: grid; gap: .5rem; justify-items: start; }
.acc-group { border: 1px solid var(--line); border-radius: 8px; padding: 0; margin-top: .75rem; overflow: hidden; }
.acc-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; padding: .7rem .9rem; background: #f4f7fa; border-bottom: 1px solid var(--line); }
.acc-title { min-width: 0; }
.acc-title h3 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.acc-title h3 .badge { margin-left: 0; }
.acc-title small { color: var(--muted); }
.acc-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.acc-group > .practice-edit:empty { display: none; }
.acc-group > .practice-edit { padding: .75rem .9rem 0; }
.acc-group > .practice-edit > form { margin: 0 0 .25rem; }
.acc-group > .list { margin: 0; padding: .75rem .9rem; }
.acc-group .item > .row { margin-left: auto; }
button > .icon { width: 1rem; height: 1rem; margin-right: .35rem; vertical-align: -.18em; }
.acc-intro { margin: 0 0 1rem; }
.acc-intro summary { cursor: pointer; color: var(--primary); }
.acc-intro p { margin: .5rem 0 0; }
.badge.locked { background: #fde4e4; color: #a32020; }
.badge.inactive { background: #eceff3; color: var(--muted); }
.password-change form { max-width: 520px; }
.profile-form, .practice-edit form { max-width: 520px; }
.practice-edit { margin-top: .5rem; }

/* Barrierefreiheit der Patientenseiten (WCAG 2.1 AA / EN 301 549) – Ergänzungen, überschreiben
   bewusst einzelne Werte oben. Kontraste: Text ≥ 4,5:1, Fokus/Feldränder ≥ 3:1 (1.4.3, 1.4.11). */
:root { --warn: #7a5200; --focus: #0b5cad; --field: #6b7684; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: .5rem; top: -100px; z-index: 100; background: var(--card); color: var(--primary); padding: .5rem 1rem; border-radius: 8px; border: 2px solid var(--focus); font-weight: 600; }
.skip-link:focus { top: .5rem; }
/* Sichtbarer Fokus mit ausreichendem Kontrast auf hellem und dunklem Grund (2.4.7) */
input:focus-visible, button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px #fff;
}
/* Programmatisch fokussierte Überschriften/Hauptbereich (Fokusführung) ohne Rahmen */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, main[tabindex="-1"]:focus { outline: none; box-shadow: none; }
input, select { border-color: var(--field); }
input[aria-invalid="true"] { border: 2px solid var(--danger); }
input[type="checkbox"][aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.hint { margin: 0; color: var(--muted); font-size: .9rem; }
.field-error { margin: 0; color: var(--danger); font-weight: 600; }
.field-error::before { content: "⚠ "; }
.legal-note { margin: 0; padding: .5rem .75rem; background: #eef5fc; border-radius: 8px; font-size: .9rem; }
.notice { background: #fff4d6; color: #4a3200; border: 1px solid #e5c76b; padding: .6rem 1rem; border-radius: 8px; text-align: center; }
.device { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .5rem; }
.device .meter { margin: .5rem 0; }
.ctl.off { background: #3d4652; color: #fff; }
/* Mikrofon/Kamera als Symbol: an = blau, aus = rot durchgestrichen (Kontrast ≥ 3:1, WCAG 1.4.11) */
.ctl.ctl-icon { display: inline-flex; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; padding: 0; border-radius: 50%; background: #fff; color: var(--primary); border: 2px solid currentColor; }
.ctl.ctl-icon.off { background: #fff; color: var(--danger); }
.ctl.ctl-icon:hover { background: #eef5fc; }
.ctl.ctl-icon.off:hover { background: #fdecea; }
.ctl-svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctl-svg .strike { display: none; stroke-width: 2.5; }
.ctl.off .ctl-svg .strike { display: inline; }
.controls { align-items: center; }
.sas code { direction: ltr; unicode-bidi: isolate; }
.sas-hint { flex-basis: 100%; margin: 0; font-size: .85rem; }
.tile figcaption { left: auto; inset-inline-start: .5rem; }
.tile figcaption strong { unicode-bidi: isolate; }
#lang { margin-inline-start: auto; }
.langbox { display: inline-flex; align-items: center; gap: .4rem; }
.langsel-label { font-weight: 400; }
footer nav { display: inline; }
footer p { margin: .25rem 0 0; }
/* Umbruch statt waagerechtem Scrollen bis 320 CSS-Pixel bzw. 400 % Zoom (1.4.10) */
main, .card, footer { overflow-wrap: break-word; }
.grid { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.device video.preview { max-width: min(420px, 100%); }
/* Kalenderübersicht im Bereich „Planen und einladen“: sieben Spalten, je Tag eine Schaltfläche mit der Zahl der Termine */
.calendar { margin-top: 1.25rem; max-width: 34rem; }
.cal-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cal-head h3 { margin: 0; flex: 1 1 auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .25rem; margin-top: .5rem; }
.cal-wd { text-align: center; font-size: .8rem; color: var(--muted); }
button.cal-day { background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .25rem 0; min-height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; }
button.cal-day.past { color: var(--muted); }
button.cal-day.has { font-weight: 700; border-color: var(--primary); color: var(--text); }
button.cal-day[aria-current="date"] { box-shadow: inset 0 0 0 2px var(--primary); }
button.cal-day[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); }
.cal-count { font-size: .75rem; font-weight: 700; line-height: 1.25rem; min-width: 1.25rem; padding: 0 .3rem; border-radius: 999px; background: var(--primary); color: var(--primary-text); }
.cal-count[hidden] { display: none; }
button.cal-day[aria-pressed="true"] .cal-count { background: #fff; color: var(--primary); }
#day-title { margin: 1.25rem 0 0; }
/* Schaltflächen eines Listeneintrags: umbrechen statt aus dem Eintrag zu laufen, Beschriftung nie im Wort trennen */
.item > .row { flex-wrap: wrap; }
.item > .row > button, .item > .row > a { white-space: nowrap; }
/* Schmale Bildschirme (Mobiltelefon): Text über die volle Breite, darunter die Schaltflächen in gleich breiten,
   gut treffbaren Feldern (mindestens 44 px hoch, WCAG 2.5.5); Zeilen brechen grundsätzlich um */
@media (max-width: 600px) {
  .row { flex-wrap: wrap; }
  .item > div:first-child { flex: 1 1 100%; min-width: 0; }
  .item > .row { flex: 1 1 100%; margin-left: 0; }
  .item > .row > button, .item > .row > a, .item > button {
    flex: 1 1 calc(50% - .25rem); min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-align: center;
  }
  .item > .row > a:not(.button) { border: 1px solid var(--line); border-radius: 8px; padding: .35rem .7rem; }
  .item > details { flex: 1 1 100%; }
  .row > input, .row > select { flex: 1 1 12rem; min-width: 0; }
  /* Treffflächen: Schaltflächen, Auswahl- und Eingabefelder mindestens 44 px hoch – auf allen Seiten, auch für Patienten */
  button, a.button, select, summary, input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) { min-height: 44px; }
  button.link { display: inline-flex; align-items: center; }
  label.check { min-height: 44px; align-items: center; }
  /* Gespräch: eigenes Kontrollbild oben, damit es den Namen des Gegenübers (unten) nicht verdeckt; Name bricht um */
  .grid.pip > .tile.local { top: .5rem; bottom: auto; inset-inline-end: .5rem; min-width: 96px; width: 30%; }
  .tile figcaption { max-width: calc(100% - 1rem); }
}
@media (max-width: 480px) {
  header.top { padding: .5rem; }
  .card { padding: .9rem; }
  .controls button { flex: 1 1 100%; }
  .controls button.ctl-icon { flex: 0 0 auto; }
}
/* Bewegung reduzieren (2.3.3) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Windows-Kontrastdesigns: Rahmen für Flächen, die sonst nur über Farbe erkennbar sind */
@media (forced-colors: active) {
  .badge, .notice, .legal-note, button, a.button { border: 1px solid CanvasText; }
  input:focus-visible, button:focus-visible, a:focus-visible, select:focus-visible { outline-color: Highlight; }
}

/* Anwenderdokumentation (public/hilfe): Schritt-für-Schritt-Anleitungen mit Screenshots */
.help { max-width: 900px; }
.help h2 { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.help h3 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; }
.help ol.steps > li { margin-bottom: .6rem; }
.help figure.shot { margin: 1rem 0 1.5rem; }
.help figure.shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.help figure.shot figcaption { color: var(--muted); font-size: .9rem; margin-top: .4rem; }
.help .tip, .help .important { border-radius: 8px; padding: .75rem 1rem; margin: 1rem 0; }
.help .tip { background: #eef5fc; border-inline-start: 4px solid var(--primary); }
.help .important { background: #fff4d6; border-inline-start: 4px solid var(--warn); color: #3d2a00; }
.help .tip > :first-child, .help .important > :first-child { margin-top: 0; }
.help .tip > :last-child, .help .important > :last-child { margin-bottom: 0; }
.help table { font-size: .95rem; margin: .5rem 0 1rem; }
.help th { background: #f0f2f5; }
.help-toc { columns: 2 260px; }
.device-help { margin: .75rem 0 0; }
.help-pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 1rem; margin: 1rem 0; }
.store { border: 1px solid var(--line); border-radius: 8px; padding: .75rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; margin: 0; }
.store canvas.qr { width: 160px; max-width: 100%; }
.store small { color: var(--muted); }
header.top nav.help-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
header.top .help-link { margin-inline-start: auto; }
@media print {
  header.top, footer, .skip-link, .help-pager { display: none; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
  .help figure.shot { break-inside: avoid; }
}

/* Passwort vergessen, Wiederherstellungscodes (Zwei-Faktor) */
button.link { background: none; color: var(--primary); padding: .25rem 0; text-decoration: underline; text-align: left; }
p.warn { color: var(--warn); font-weight: 600; }
ol.codes { columns: 2; column-gap: 2rem; font-size: 1.1rem; padding-left: 1.5rem; }
ol.codes li { margin: .2rem 0; break-inside: avoid; }
@media print { header.top, footer, .recovery-codes button { display: none; } }

/* Medienweg in Klammern direkt hinter dem Verschlüsselungshinweis (erste Zeile im Raum) */
.security .route { margin-left: -.45rem; font-size: .85rem; font-weight: 600; color: var(--ok); }
.security .route[data-route="relay"], .security .route[data-route="mixed"] { color: var(--warn); }
.security .route[data-route="checking"] { color: var(--muted); font-weight: 400; }

/* Testkonten (BSNR 123456789): rote Kennzeichnung „Testverbindung ohne echte Ärztin/echten Arzt“ */
.test-banner { background: #b3261e; color: #fff; font-weight: 700; padding: .6rem 1rem; border-radius: 8px; margin: 0 0 .75rem; }
.test-connection .tile, .test-connection .lobby, .test-connection .waiting { outline: 3px solid #b3261e; outline-offset: 2px; }
.badge.test { background: #b3261e; color: #fff; margin-left: .5rem; }

/* Einladung per E-Mail: Vorschau des Anschreibens */
pre.mail-preview { white-space: pre-wrap; word-break: break-word; max-height: 22rem; overflow: auto; padding: .75rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-size: .9rem; }
.row > input#emails { flex: 1 1 24rem; min-width: 0; max-width: 40rem; }
input.mail-recipients { width: 100%; max-width: 40rem; }

/* Symbole (ui.js icon): Linien in Textfarbe */
.icon { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
nav.portal-nav a.button { display: inline-flex; align-items: center; gap: .45rem; }
nav.portal-nav .nav-count { min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .8rem; font-weight: 700; line-height: 1.4rem; text-align: center; }
nav.portal-nav .nav-count[hidden] { display: none; }

/* Bereich „Durchführen“: Benachrichtigung, Gruppen nach Uhrzeit */
.notify-box { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .75rem 0 0; }
.notify-box button { display: inline-flex; align-items: center; gap: .4rem; }
.notify-box > .icon { color: var(--primary); }
h3.run-group { margin: .75rem 0 0; font-size: .95rem; color: var(--muted); text-transform: none; }
.run-list .item.now { border-color: var(--primary); border-inline-start-width: 4px; }
.run-list .item.has-waiting { background: #fffbea; }
/* Wartende mit Termin (blau) bzw. ohne Termin (orange); zusätzlich als Text im Badge (nicht nur über die Farbe) */
.run-list .item.wait-appt { background: #eaf2fb; border-color: #0b5cad; border-inline-start-width: 6px; }
.run-list .item.wait-open { background: #fff3e2; border-color: #b45309; border-inline-start-width: 6px; }
.badge.appt { background: #dbe8f7; color: #0b4a8a; }
.badge.walkin { background: #ffe3c2; color: #7c3a00; }
.badge.queue-no { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.wait-legend .badge { margin: 0 .15rem; }
.queue-hint { font-weight: 600; color: #7c3a00; }
.queue-pos { font-size: 1.1rem; font-weight: 700; }

/* Patient im Wartezimmer: Raster mit großem Eigenbild ausblenden, kleine Kontrollansicht im Wartebereich */
.grid[hidden] { display: none; }
.waiting-self { margin: 1rem auto 0; max-width: 220px; }
.waiting-self video { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: #000; transform: scaleX(-1); }
.waiting-self figcaption { font-size: .85rem; color: var(--muted); margin-top: .3rem; }

/* Geräteauswahl (Technik-Check und Raum) */
.device-select { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: .5rem 0; }
.device-select label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; flex: 1 1 14rem; max-width: 22rem; }
.device-select select { width: 100%; }
.device-panel { margin: .75rem auto 0; max-width: 46rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem 1rem; }
.device-panel[hidden] { display: none; }
.ctl.ctl-icon[aria-expanded="true"] { background: #eef5fc; }
.ctl-icon .icon { width: 1.6rem; height: 1.6rem; }

/* Formular „Planen und einladen“: Beschriftung über dem Feld, Hinweise am Feld */
.create-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: .75rem 1rem; margin: .5rem 0 1rem; }
.create-form .field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.create-form .field.wide, .create-form .form-actions { grid-column: 1 / -1; }
.create-form .field input { width: 100%; max-width: none; }
.create-form small { line-height: 1.35; }

/* Kopieren: Rückmeldung ohne Layoutsprung */
.copy-wrap { display: inline-flex; }
button.copy { min-width: 6.5rem; }

/* Raum: eine Statuszeile (Verbindung, Verschlüsselung, Medienweg) */
.security .call-status:empty { display: none; }
.security .call-status { font-size: .9rem; }

/* Steuerleiste: Beschriftung unter den Symbolen, „Beenden“ mit Abstand */
.controls { align-items: flex-start; gap: .75rem; }
.ctl-item { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.ctl-caption { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.ctl-item.off .ctl-caption { color: var(--danger); font-weight: 600; }
.ctl-item.ctl-end { margin-inline-start: 2rem; align-self: flex-start; padding-top: .3rem; }
@media (max-width: 480px) { .ctl-item.ctl-end { margin-inline-start: 0; flex-basis: 100%; } .ctl-item.ctl-end button { width: 100%; } }

/* Genau ein Gegenüber: großes Bild, eigenes Bild klein in der Ecke (Bild im Bild) */
.grid.pip { display: block; position: relative; }
.grid.pip[hidden] { display: none; }
.grid.pip > .tile:not(.local) { width: 100%; }
.grid.pip > .tile.local { position: absolute; inset-inline-end: .75rem; bottom: .75rem; width: min(26%, 260px); min-width: 140px; z-index: 2; border: 2px solid #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.grid.pip > .tile.local figcaption { font-size: .75rem; padding: .1rem .35rem; }

/* Einladungsseite: Schrittanzeige, kleineres Logo */
.join .practice-logo { max-height: 96px; max-width: min(200px, 60%); }
ol.steps { display: flex; flex-wrap: wrap; gap: .35rem .5rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: step; font-size: .9rem; }
ol.steps li { counter-increment: step; display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); }
ol.steps li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid currentColor; font-weight: 700; font-size: .8rem; }
ol.steps li:not(:last-child)::after { content: "›"; margin-inline-start: .35rem; color: var(--muted); }
ol.steps li.done { color: var(--ok); }
ol.steps li[aria-current="step"] { color: var(--primary); font-weight: 700; }
ol.steps li[aria-current="step"]::before { background: var(--primary); color: #fff; border-color: var(--primary); }
[dir="rtl"] ol.steps li:not(:last-child)::after { content: "‹"; }

/* Bereiche des Portals als Registerkarten */
nav.portal-nav { margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
nav.portal-nav [role="tablist"] { display: flex; gap: .25rem; flex-wrap: wrap; }
nav.portal-nav a[role="tab"] { display: inline-flex; align-items: center; gap: .45rem; padding: .65rem 1rem; margin-bottom: -1px; color: var(--text); text-decoration: none; border: 1px solid transparent; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; }
nav.portal-nav a[role="tab"]:hover { background: #e9eef4; }
nav.portal-nav a[role="tab"][aria-selected="true"] { color: var(--primary); font-weight: 700; background: var(--card); border-color: var(--line); border-bottom: 3px solid var(--primary); }

/* Technik-Check: Lautsprechertest */
.device .speaker { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .25rem 0 .5rem; }

/* Einladungstext der Praxis */
.invite-text textarea { width: 100%; max-width: 46rem; font: inherit; line-height: 1.45; padding: .6rem; border: 1px solid var(--field, #6b7684); border-radius: 6px; resize: vertical; }
.invite-text code { background: #eef2f6; padding: 0 .25rem; border-radius: 4px; }

/* Ad-hoc-Anmeldung: Sprechzeiten (Portal und Patientenseite), Grund im Wartezimmer */
.adhoc-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: .5rem 1rem; }
.adhoc-week .field { display: flex; flex-direction: column; gap: .2rem; }
.adhoc details { margin: .5rem 0; }
.adhoc details summary { cursor: pointer; color: var(--primary); }
.adhoc-hours ul { margin: .25rem 0 .75rem; padding-inline-start: 1.25rem; }
#reason { width: 100%; font: inherit; padding: .6rem; border: 1px solid var(--field, #6b7684); border-radius: 6px; resize: vertical; }
.lobby .reason { margin: .2rem 0; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.lobby .reason em { color: var(--muted); }
.lobby .browser-lang { margin: .15rem 0 0; font-size: .9rem; color: var(--muted); }
.reason-unlock { border-top: 1px solid var(--line); padding-top: .5rem; margin-bottom: .5rem; }
.reason-unlock input { width: 100%; }
.adhoc-capacity .field { display: flex; flex-direction: column; gap: .2rem; min-width: 14rem; }
.adhoc-capacity input[type="number"] { max-width: 8rem; }
.adhoc-duration { margin: 0; }
/* Hinweis vor der Abmeldung bei Leerlauf (Portal) */
.idle-warning { position: sticky; top: .5rem; z-index: 20; background: #fff4d6; color: #5c4400; border: 1px solid #e0c36a; padding: .75rem 1rem; border-radius: 8px; margin: 0 auto 1rem; max-width: 1100px; }
