/* =========================================================
   Die Behandler – Übungsplattform (Clickdemo)
   Design-System / Basis-Styles
   Spätere Wiederverwendung als Blade-Frontend.
   ========================================================= */

:root {
  /* Farben – CI „Die Behandler" (Pastell + Petrol + Grün) */
  --bg:           #FBFAF7;   /* warmes Off-White */
  --surface:      #FFFFFF;
  --surface-2:    #F1F0EB;
  --primary:      #1E4B47;   /* dunkles Petrol/Teal – Buttons, Footer */
  --primary-dark: #143430;
  --primary-soft: #E3ECEA;
  --accent:       #5AA46A;   /* Grün – Akzent/Pin */
  --text:         #1F2A2E;
  --text-muted:   #5E6B6E;
  --border:       #E6E6DF;
  --success:      #5AA46A;
  --success-soft: #E6F1E7;
  /* Pastell-Sektionen aus der CI */
  --blush:        #F6E2DC;
  --sky:          #DCE7F0;
  --mint:         #E3EDDD;

  /* Form */
  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(16,40,34,.06), 0 1px 3px rgba(16,40,34,.07);
  --shadow-md: 0 6px 18px rgba(16,40,34,.10);
  --shadow-lg: 0 16px 40px rgba(16,40,34,.16);

  --maxw: 1080px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---------------------------------------------------------
   Dunkles Design – global umschaltbar (Button in der Kopfzeile).
   Nutzt denselben localStorage-Key 'theme' wie das Filament-Admin,
   damit App und Verwaltung derselben Einstellung folgen.
   Nur Variablen-Overrides: alle Komponenten ziehen automatisch mit.
   --------------------------------------------------------- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg:           #0F1917;
  --surface:      #17231F;
  --surface-2:    #1D2B26;
  --primary:      #2C665F;
  --primary-dark: #1E4B47;
  --primary-soft: #1E332E;
  --accent:       #6FBF7F;
  --text:         #E9EFEC;
  --text-muted:   #A9B6B1;
  --border:       #2B3A35;
  --success-soft: #1C3226;
  --blush:        #392E2A;
  --sky:          #24313B;
  --mint:         #233227;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.40), 0 1px 3px rgba(0,0,0,.45);
  --shadow-md: 0 6px 18px rgba(0,0,0,.50);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.60);
}

/* Wort-Bild-Marke im Dark-Mode: PNG bleibt TRANSPARENT (kein Chip) und wird
   per Filter lesbar gemacht -- Helligkeit invertiert, Farbtoene bleiben durch
   die 180-Grad-Drehung erhalten (Pastell bleibt Pastell). Abnahme 24.07. */
[data-theme="dark"] .appbar__logo,
[data-theme="dark"] .bh-logo,
[data-theme="dark"] .auth-logo { filter: invert(1) hue-rotate(180deg); }

/* Dark: Links/Nav in Akzent-Gruen -- var(--primary-dark) waere Petrol auf
   Petrol und kaum lesbar (Kontrast-Feedback Abnahme 22.07.). */
[data-theme="dark"] .link { color: var(--accent); }
[data-theme="dark"] .link:hover { color: #8FD6A0; }

/* "Diesem Gerät vertrauen"-Checkbox auf der Mail-Code-Seite */
.remember-device { display: flex; align-items: flex-start; gap: 10px; margin-top: -4px; cursor: pointer; font-size: .88rem; color: var(--text-muted); }
.remember-device input { margin-top: 3px; flex: none; width: 18px; height: 18px; accent-color: var(--primary); }

/* Code-Eingabe: Auge-Button (anzeigen/verbergen) im Feld */
.code-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; color: var(--text-muted);
}
.code-eye:hover { color: var(--text); background: var(--surface-2); }
.code-eye svg { width: 20px; height: 20px; }
.code-eye[aria-pressed="true"] { color: var(--primary); }

/* FAQ (Portal-Hilfeseite) */
.faq__item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 0 14px; }
.faq__item summary { cursor: pointer; font-weight: 600; padding: 13px 0; list-style: none; position: relative; padding-right: 26px; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: '+'; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--accent); font-size: 1.1rem; }
.faq__item[open] summary::after { content: '–'; }
.faq__item p { padding: 0 0 14px; color: var(--text-muted); font-size: .93rem; }

/* Celebration-Overlay: Programm-/Tagesabschluss */
.celebrate {
  position: fixed; inset: 0; z-index: 95;
  display: flex; align-items: center; justify-content: center;
  background: rgba(16, 32, 28, .45); padding: 24px; cursor: pointer;
}
.celebrate[hidden] { display: none; }
.celebrate__card {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 34px 40px; text-align: center; max-width: 340px;
}
.celebrate--in .celebrate__card { animation: bh-pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.celebrate__stars { display: flex; justify-content: center; gap: 6px; font-size: 1.25rem; color: #E1A100; }
.celebrate--in .celebrate__stars span { animation: bh-star .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.celebrate--in .celebrate__stars span:nth-child(1) { animation-delay: .25s; }
.celebrate--in .celebrate__stars span:nth-child(2) { animation-delay: .35s; }
.celebrate--in .celebrate__stars span:nth-child(3) { animation-delay: .45s; }
.celebrate--in .celebrate__stars span:nth-child(4) { animation-delay: .55s; }
.celebrate--in .celebrate__stars span:nth-child(5) { animation-delay: .65s; }
.celebrate__emoji { font-size: 3rem; margin-top: 8px; }
.celebrate--in .celebrate__emoji { animation: bh-pop .55s cubic-bezier(.2, 1.5, .4, 1) .1s both; }
.celebrate__title { font-size: 1.15rem; font-weight: 700; margin-top: 8px; }
.celebrate__sub { color: var(--text-muted); font-size: .9rem; margin-top: 4px; }

@keyframes bh-pop {
  0% { transform: scale(.55); opacity: 0; }
  70% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes bh-star {
  0% { transform: scale(0) rotate(-40deg); opacity: 0; }
  70% { transform: scale(1.35) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .celebrate--in .celebrate__card,
  .celebrate--in .celebrate__emoji,
  .celebrate--in .celebrate__stars span { animation: none; }
}

/* ===== Oeffentliche Startseite (Landing) ===== */
.lp-hero { background: linear-gradient(180deg, var(--primary-soft), var(--bg)); padding-block: 8px 8px; }
.lp-hero__inner { max-width: 760px; margin-inline: auto; text-align: center; padding-block: 40px 48px; }
.lp-brand { display: inline-flex; align-items: center; gap: 12px; }
.lp-logo { height: 44px; width: auto; }
[data-theme="dark"] .lp-logo { filter: invert(1) hue-rotate(180deg); }
.lp-title { font-size: clamp(2rem, 6vw, 3.1rem); line-height: 1.08; letter-spacing: -.02em; margin-top: 6px; }
.lp-lead { margin-top: 14px; font-size: 1.1rem; color: var(--text-muted); max-width: 56ch; margin-inline: auto; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.lp-cta__main { font-size: 1.05rem; padding: 14px 26px; }

.lp-steps { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .lp-steps { grid-template-columns: repeat(3, 1fr); } }
.lp-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.lp-step__no { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 700; }
.lp-step h3 { margin-top: 12px; font-size: 1.1rem; }
.lp-step p { margin-top: 6px; color: var(--text-muted); font-size: .95rem; }

.lp-team { display: grid; gap: 20px; grid-template-columns: repeat(2, 1fr); margin-top: 24px; }
@media (min-width: 720px) { .lp-team { grid-template-columns: repeat(4, 1fr); } }
.lp-team__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.lp-team__photo { width: 84px; height: 84px; border-radius: 999px; object-fit: cover; margin: 0 auto; display: block; }
.lp-team__initials { display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; font-size: 1.5rem; }
[data-theme="dark"] .lp-team__initials { color: var(--accent); }
.lp-team__name { margin-top: 12px; font-weight: 700; }
.lp-team__role { color: var(--accent); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.lp-team__bio { margin-top: 8px; font-size: .88rem; color: var(--text-muted); }

.lp-privacy { max-width: 720px; margin-inline: auto; background: var(--mint); border-color: transparent; text-align: center; }
[data-theme="dark"] .lp-privacy { background: var(--surface-2); }
.lp-privacy p { margin-top: 8px; color: var(--text-muted); }

/* Datei-/Kamera-Auswahl im Schnell-Upload (capture-Buttons) */
.upl-choose { display: flex; gap: 8px; flex-wrap: wrap; }
.upl-choose__btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }

/* Gewaehlte Bilder als Chips (AA2 Mehrfach-Upload) */
.upl-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.upl-imgs__chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: .8rem; font-weight: 600; }
.upl-imgs__chip button { border: 0; background: none; cursor: pointer; color: var(--text-muted); font-size: .85rem; padding: 0; line-height: 1; }
.upl-imgs__chip button:hover { color: #c0392b; }

/* ===== AA2: Bilder-Galerie (Karussell) — Detailseite + Feed =====
   Reines CSS-Scroll-Snap: horizontales Wischen ist natives Scrollen,
   ein Tap bleibt ein Klick (Browser trennen Geste und Klick) -> der
   Erledigt-Button im Feed wird durch Wischen NIE ausgeloest. */
.bh-gal { position: relative; overflow: hidden; }
.bh-gal__track {
  display: flex; height: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bh-gal__track::-webkit-scrollbar { display: none; }
.bh-gal__slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.bh-gal__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Pfeile: nur auf Geraeten mit Maus/Trackpad (Touch wischt) */
.bh-gal__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(16, 32, 28, .55); color: #fff; font-size: 1.1rem; line-height: 1;
}
.bh-gal__nav:hover { background: rgba(16, 32, 28, .8); }
.bh-gal__nav--prev { left: 10px; }
.bh-gal__nav--next { right: 10px; }
@media (hover: hover) and (pointer: fine) { .bh-gal:not([data-count="1"]) .bh-gal__nav { display: inline-flex; } }

/* Punkte-Indikator */
.bh-gal__dots {
  position: absolute; left: 0; right: 0; bottom: 8px; z-index: 2;
  display: flex; gap: 6px; justify-content: center; pointer-events: none;
}
.bh-gal__dot { width: 7px; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .45); box-shadow: 0 0 0 1px rgba(16, 32, 28, .25); transition: background .2s, transform .2s; }
.bh-gal__dot--active { background: #fff; transform: scale(1.25); }

/* Detailseite: stehendes Karussell unter/statt Video */
.bh-gal--detail { margin-top: 16px; border-radius: var(--radius); aspect-ratio: 16/10; background: var(--surface-2); }

/* Feed: Galerie fuellt den Medienbereich */
.bh-gal--feed, .bh-gal--feed .bh-gal__track { height: 100%; }
.bh-gal--feed .bh-gal__slide { height: 100%; }
/* Im Vollbild-Feed sitzen die Punkte OBEN mittig (unten verdeckt sie die
   Caption; oben ist zwischen Zurueck-Pfeil und Details-Button Platz) --
   unterhalb des Tagesziel-Chips (HH3). */
.bh-gal--feed .bh-gal__dots { bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 52px); }

/* HH3: Tagesziel-Chip oben mittig im Vollbild-Feed. */
.feed__goal { display: none; position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 50%; transform: translateX(-50%); z-index: 40; padding: 8px 14px; border-radius: 999px; background: rgba(17,32,28,.72); color: #fff; font-size: .85rem; font-weight: 600; white-space: nowrap; }
body.feed-full .feed__goal:not([hidden]) { display: inline-flex; align-items: center; gap: 2px; }

/* II4: Tagesziel als sich fuellender Kuchen (animiert via @property). */
@property --p { syntax: '<number>'; inherits: false; initial-value: 0; }
.feed__goal-pie {
  width: 16px; height: 16px; border-radius: 50%; flex: none; margin-right: 7px;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), rgba(255, 255, 255, .28) 0);
  transition: --p .5s ease;
}
.feed__goal--pop { animation: bhGoalPop .35s ease; }
@keyframes bhGoalPop { 40% { transform: translateX(-50%) scale(1.18); } }
.feed__goal--full { background: rgba(31, 84, 66, .9); }
.feed__goal--full .feed__goal-pie { box-shadow: 0 0 0 3px rgba(122, 192, 103, .4); }

/* HH2: Video-Fortschrittslinie oben an der Kachel (Story-Stil). */
.feed__progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,.22); z-index: 2; }
.feed__progress i { display: block; height: 100%; width: 0; background: var(--accent); }

/* II5: Haken-Pop beim Doppel-Tap (Feedback in der Kachelmitte). */
.feed__checkpop {
  position: absolute; inset: 0; margin: auto; width: 120px; height: 120px; z-index: 6;
  border-radius: 999px; background: rgba(122, 192, 103, .95); color: #fff;
  display: grid; place-items: center; font-size: 3.2rem; font-weight: 700;
  pointer-events: none; animation: bhCheckPop .7s ease forwards;
}
@keyframes bhCheckPop {
  0% { transform: scale(.4); opacity: 0; }
  25% { transform: scale(1.08); opacity: 1; }
  60% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* II2: Slide-Uebergaenge beim Uebungswechsel (Detailseite). */
body.slide-out-left main { animation: bhSlideOutL .15s ease forwards; }
body.slide-out-right main { animation: bhSlideOutR .15s ease forwards; }
body.slide-in-from-right main { animation: bhSlideInR .22s ease; }
body.slide-in-from-left main { animation: bhSlideInL .22s ease; }
@keyframes bhSlideOutL { to { opacity: 0; transform: translateX(-28px); } }
@keyframes bhSlideOutR { to { opacity: 0; transform: translateX(28px); } }
@keyframes bhSlideInR { from { opacity: 0; transform: translateX(28px); } }
@keyframes bhSlideInL { from { opacity: 0; transform: translateX(-28px); } }

/* JJ1: QR-Scanner-Overlay auf dem Patienten-Login. */
.qrscan { position: fixed; inset: 0; z-index: 100; background: #0c1613; display: grid; place-items: center; }
.qrscan[hidden] { display: none; }
.qrscan__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qrscan__frame { position: relative; width: min(64vw, 260px); aspect-ratio: 1; border: 3px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(12,22,19,.45); }
.qrscan__hint { position: absolute; left: 20px; right: 20px; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.qrscan__close { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 14px; background: rgba(17,32,28,.72); color: #fff; border: 0; }

/* Ruhige Bewegung fuer empfindliche Nutzer (Zielgruppe teils aelter). */
@media (prefers-reduced-motion: reduce) {
  body.slide-out-left main, body.slide-out-right main,
  body.slide-in-from-right main, body.slide-in-from-left main,
  .feed__goal--pop, .feed__checkpop { animation: none !important; }
  .feed__goal-pie { transition: none; }
}

/* Schnell-Upload-Overlay im Behandler-Workspace */
.upl-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(16, 32, 28, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.upl-card { max-width: 540px; width: 100%; max-height: 92vh; overflow: auto; }
.upl-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.upl-chip input { position: absolute; opacity: 0; pointer-events: none; }
.upl-chip:has(input:checked) { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Theme-Umschalter (Hell/Dunkel) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: none; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--text); border-color: var(--primary); }
.theme-toggle__icon::before { content: '☾'; font-size: 1.05rem; line-height: 1; }
[data-theme="dark"] .theme-toggle__icon::before,
.dark .theme-toggle__icon::before { content: '☀'; }
.theme-toggle--float { position: fixed; top: 14px; right: 14px; z-index: 50; box-shadow: var(--shadow-sm); }

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* Layout */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: 48px; }
.stack > * + * { margin-top: 16px; }

/* Typografie */
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight: 600;
  color: var(--accent);
}
.muted { color: var(--text-muted); }
.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 52ch; }

/* Pills / Tags */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: .75rem; font-weight: 600;
  background: var(--primary-soft); color: var(--primary-dark);
}
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: .8rem; font-weight: 500;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.tag--active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 1rem;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
  min-height: 50px;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--primary-dark); }
.btn--ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn--block { width: 100%; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card--pad { padding: 24px; }

/* Auswahl-Karten (Startseite) */
.choice-grid { display: grid; gap: 24px; grid-template-columns: 1fr; margin-top: 36px; }
@media (min-width: 760px) { .choice-grid { grid-template-columns: 1fr 1fr; } }
.choice {
  display: flex; flex-direction: column; gap: 14px;
  padding: 32px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease;
}
.choice:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.choice__icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-dark);
}
.choice__meta { font-size: .85rem; color: var(--text-muted); margin-top: auto; }
.choice__cta { color: var(--primary-dark); font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }

/* Telefon-Rahmen (Patienten-Ansicht) */
.phone {
  width: 390px; max-width: 100%;
  margin-inline: auto;
  background: var(--surface);
  border-radius: 38px;
  box-shadow: var(--shadow-lg);
  border: 10px solid #11201C;
  overflow: hidden;
  min-height: 780px;
}

/* Play-Overlay für Übungsbilder (suggeriert Video) */
.thumb { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__play {
  position: absolute; inset: 0; margin: auto;
  width: 54px; height: 54px; border-radius: 999px;
  background: rgba(255,255,255,.92); color: var(--primary-dark);
  display: grid; place-items: center;
  box-shadow: var(--shadow-md);
}
.thumb__dur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(17,32,28,.78); color: #fff;
  font-size: .72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 6px;
}

/* Fortschritt */
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
/* Fortschritt in hellem Gruen (statt dunklem Petrol): sticht hervor und wirkt
   als Belohnung (Abnahme-Feedback 23.07.). Dark-Mode erbt das hellere Accent. */
.progress__bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .35s ease; }

/* Done-Häkchen */
.check {
  width: 44px; height: 44px; border-radius: 999px;
  border: 2px solid var(--border);
  display: grid; place-items: center;
  /* Blasses ✓ schon im offenen Zustand + Hover/Fokus -> als Abhak-Button
     erkennbar (nicht wie eine reine Status-Anzeige). */
  color: var(--border);
  background: var(--surface);
  transition: all .15s ease; flex: none;
}
.check:hover, .check:focus-visible { border-color: var(--success); color: var(--success); }
.check--done { background: var(--success); border-color: var(--success); color: #fff; }
.check--done:hover, .check--done:focus-visible { color: #fff; border-color: var(--success); }

/* Gamification (Phase 4): Wochenstatistik, Streak, Rewards, Programm-Tabs */
.badge-done { font-size: 1rem; }
.streak { font-weight: 700; color: var(--primary-dark); font-size: .95rem; white-space: nowrap; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week__day { display: grid; justify-items: center; gap: 4px; }
.week__dot { width: 22px; height: 22px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.week__day--partial .week__dot { background: var(--primary); opacity: .45; border-color: transparent; }
.week__day--full .week__dot { background: var(--success); border-color: transparent; }
.week__label { font-size: .7rem; color: var(--text-muted); }
.reward { border-radius: var(--radius); background: var(--surface-2); padding: 12px 14px; }
.reward__main { font-size: 1rem; }
.reward__stars { color: #E1A100; letter-spacing: 2px; }
.reward__bonus { font-size: .85rem; color: var(--text-muted); margin-top: 6px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scrollbar-width: none; -ms-overflow-style: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__btn { flex: none; scroll-snap-align: start; padding: 8px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); }
.tabs__btn[aria-selected="true"] { background: var(--primary); color: #fff; border-color: transparent; }

/* Demo-Hinweisleiste */
.demo-banner {
  background: #11201C; color: #cfe6df;
  font-size: .8rem; text-align: center; padding: 8px 16px;
}
.demo-banner strong { color: #fff; }

/* Footer */
.foot { text-align: center; color: var(--text-muted); font-size: .85rem; padding-block: 32px; }
/* Rechtliche Footer-Links (Impressum/Datenschutz -> externe Praxis-Website) */
.legal-links { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 6px; font-size: .82rem; }
.legal-links a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; display: inline-block; padding: 8px 4px; }
.legal-links a:hover { color: var(--primary); }
.legal-links__sep { color: var(--border); }

/* =========================================================
   App-Erweiterungen (Laravel-Build) – Formulare & App-Shell
   ========================================================= */

/* Formulare */
.field + .field { margin-top: 16px; }
/* Nebeneinanderliegende Felder (z. B. Patient + Dauer): gleiche Starthöhe.
   Hebt die vertikale Stapel-Regel .field + .field gezielt auf. */
.field-row { display: flex; gap: 10px; margin-top: 14px; align-items: flex-start; }
.field-row .field,
.field-row .field + .field { margin-top: 0; }
.label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; background: var(--surface); color: var(--text);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input--code { letter-spacing: .35em; text-align: center; font-size: 1.3rem; font-weight: 600; }
.help { font-size: .8rem; color: var(--text-muted); margin-top: 6px; }
.link { color: var(--primary-dark); font-weight: 600; white-space: nowrap; }
.link:hover { text-decoration: underline; }

/* Hinweise */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; }
.alert--error { background: #fdece9; color: #8a2b22; border: 1px solid #f3c9c2; }
.alert--ok { background: var(--success-soft); color: var(--primary-dark); border: 1px solid #cfe6d3; }

/* Auth-Screens */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 430px; }
.auth-logo { height: 48px; width: auto; margin: 0 auto 22px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: .85rem; color: var(--text-muted); }

/* App-Shell (eingeloggt) */
.appbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.appbar__inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.appbar__logo { height: 32px; width: auto; }
.appbar__spacer { flex: 1; }
.appbar__user { font-size: .9rem; color: var(--text-muted); display: flex; align-items: center; gap: 10px; }
.role-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--primary-soft); color: var(--primary-dark); }
.grid-cards { display: grid; gap: 20px; grid-template-columns: 1fr; margin-top: 28px; }
@media (min-width: 720px) { .grid-cards { grid-template-columns: repeat(3, 1fr); } }

/* =========================================================
   Behandler-Workspace (bespoke, Clickdemo-Look)
   ========================================================= */
.bh-top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.bh-top__inner { display: flex; align-items: center; gap: 14px; height: 64px; }
.bh-logo { height: 30px; width: auto; }
/* Produkt-Zusatz neben der Wort-Bild-Marke (das PNG traegt den Namen selbst). */
.bh-plattform { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.bh-spacer { flex: 1; }
.bh-userchip { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.bh-avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.bh-who { font-size: .85rem; line-height: 1.2; white-space: nowrap; }
.bh-who small { display: block; color: var(--text-muted); }

.bh-work { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 920px) { .bh-work { grid-template-columns: 1fr 384px; } }
/* Mobil: "Programm zusammenstellen" VOR der Uebungsliste -- Vorlage, Patient
   und Freigabe ohne langes Scrollen erreichbar (Abnahme 23.07.). Desktop
   bleibt zweispaltig (Bibliothek links, Builder rechts). */
@media (max-width: 919.98px) { .bh-work .builder { order: -1; } }

.bh-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { padding: 7px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); cursor: pointer; transition: all .12s ease; }
.chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.lib-card { display: flex; flex-direction: column; overflow: hidden; }
.lib-card .thumb { aspect-ratio: 4/3; border-radius: 0; }
.lib-card__body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lib-card__body h4 { font-size: .98rem; line-height: 1.25; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-tags .tag { font-size: .7rem; padding: 3px 8px; }
.add-btn { margin-top: auto; }
.add-btn.added { background: var(--success-soft); color: var(--primary-dark); border: 1px solid var(--success); }

.builder { padding: 20px; }
@media (min-width: 920px) { .builder { position: sticky; top: 86px; } }
.builder__list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.b-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.b-item__thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.b-item__name { font-weight: 600; font-size: .9rem; }
.b-empty { text-align: center; color: var(--text-muted); padding: 22px 0; font-size: .9rem; }
.b-x { width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); display: grid; place-items: center; flex: none; }
.b-x:hover { border-color: #c0392b; color: #c0392b; }
.b-dosage { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.b-dosage .input { padding: 5px 8px; font-size: .8rem; }
.b-num { width: 52px; }

.success-wrap { max-width: 520px; margin-inline: auto; text-align: center; }
.card-mock { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 28px; }
.qr { width: max-content; margin: 18px auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.code-chip { display: inline-block; font-family: ui-monospace, monospace; letter-spacing: .14em; font-weight: 700; font-size: 1.05rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; }

@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { position: absolute; left: 0; top: 0; margin: 24px; border: none; }
}

/* =========================================================
   Patienten-Portal · Feed/Reel-Modus (Phase 3 – Demo-Paritaet)
   Additiv; Liste bleibt Default. KEIN Erledigt-Status (= Phase 4).
   ========================================================= */

/* Segmented Control: Liste <-> Feed */
.segmented { display: inline-flex; gap: 4px; margin-top: 16px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; }
.segmented__btn { padding: 8px 18px; border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--text-muted); transition: background .15s ease, color .15s ease; }
.segmented__btn[aria-selected="true"] { background: var(--surface); color: var(--primary-dark); box-shadow: var(--shadow-sm); }

/* Feed: vertikales Snap-Scrolling, ein Item pro Screen. Nur im Vollbild sichtbar. */
.feed { display: none; }
.feed__item { display: block; position: relative; scroll-snap-align: start; scroll-snap-stop: always; }
/* Detail-Link füllt das Item; das Erledigt-Häkchen liegt als Overlay daneben. */
.feed__link { display: block; height: 100%; color: inherit; }
/* Erledigt-Button im Reels/Shorts-Stil: rechte Seite (Daumen-Bereich), gross,
   mit Label darunter wie ein Like-Button. */
.feed__check-form {
  position: absolute; right: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 150px);
  z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.feed__check {
  width: 62px; height: 62px;
  background: rgba(17,32,28,.5);
  border: 2px solid rgba(255,255,255,.9);
  color: rgba(255,255,255,.95);
  font-size: 1.7rem;
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.feed__check:hover, .feed__check:focus-visible { border-color: var(--success); color: #fff; }
.feed__check.check--done { background: var(--success); border-color: var(--success); color: #fff; }
.feed__check-label { color: #fff; font-size: .78rem; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.feed__media { position: relative; height: 100%; background: #11201C; overflow: hidden; }
.feed__media img { width: 100%; height: 100%; object-fit: cover; }
.feed__play { position: absolute; inset: 0; margin: auto; width: 66px; height: 66px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--primary-dark); display: grid; place-items: center; font-size: 1.4rem; box-shadow: var(--shadow-md); }
.feed__caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 20px calc(env(safe-area-inset-bottom, 0px) + 28px); background: linear-gradient(to top, rgba(17,32,28,.88), rgba(17,32,28,0)); color: #fff; }
.feed__title { font-size: 1.2rem; font-weight: 700; color: #fff; }
.feed__dosage { font-size: .9rem; opacity: .88; margin-top: 4px; }
.feed__cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 600; color: #fff; }

/* "X Liste"-Ausstieg – nur im Vollbild sichtbar */
/* EE1: runder Zurueck-Pfeil oben LINKS (Feed verlassen -> Liste). */
.feed__exit { display: none; position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 14px; z-index: 40; width: 44px; height: 44px; padding: 0; align-items: center; justify-content: center; border-radius: 999px; background: rgba(17,32,28,.72); color: #fff; font-size: 1.25rem; font-weight: 600; line-height: 1; }

/* EE2: "Details"-Button oben RECHTS -> Detailseite der sichtbaren Uebung. */
.feed__details { display: none; position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 14px; z-index: 40; padding: 10px 16px; border-radius: 999px; background: rgba(17,32,28,.72); color: #fff; font-size: .9rem; font-weight: 600; text-decoration: none; }
body.feed-full .feed__details:not([hidden]) { display: inline-flex; align-items: center; }

/* Vollbild-Modus (mobil): per JS via body.feed-full aktiviert */
body.feed-full { overflow: hidden; }
body.feed-full .appbar { display: none; }
body.feed-full main.container { max-width: 100%; padding: 0; }
body.feed-full #programList { display: none; }
body.feed-full .feed { display: block; position: fixed; inset: 0; height: 100dvh; margin: 0; z-index: 30; overflow-y: auto; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; }
body.feed-full .feed__item { height: 100dvh; }
body.feed-full .feed__exit { display: inline-flex; }

/* ===== CC1: Inline-Video im Feed (Reels) ===== */
/* Wrapper des Einzel-Mediums (ohne Karussell) fuellt die Kachel wie bisher. */
.feed__solo { position: absolute; inset: 0; }
/* Der Inline-Player ersetzt Standbild + Play-Overlay in der Kachel/Slide. */
.feed__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: 1; }

/* DD1: "Ton an"-Badge (Autoplay startet stumm -- Browser-Regel).
   Sitzt UNTER dem festen Zurueck-Pfeil (top+64px), nicht auf ihm (EE1). */
.feed__unmute {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 64px); left: 14px; z-index: 3;
  border: 0; cursor: pointer; padding: 8px 14px; border-radius: 999px;
  background: rgba(17, 32, 28, .72); color: #fff; font-size: .85rem; font-weight: 600;
}

/* DD3: Anleitung in der Caption -- 2 Zeilen Vorschau, "mehr" klappt im Feed aus. */
.feed__desc { margin-top: 10px; }
.feed__desc-text {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: .9rem; color: rgba(255, 255, 255, .85); white-space: pre-line;
}
.feed__desc--open .feed__desc-text { display: block; -webkit-line-clamp: unset; max-height: 38dvh; overflow-y: auto; }
.feed__desc-more { border: 0; background: none; cursor: pointer; padding: 4px 0 0; color: #fff; font-weight: 700; font-size: .85rem; }

/* DD8: End-Slide des Feeds (Abschluss + Weiter-Optionen). */
.feed__end { height: 100%; display: grid; place-content: center; text-align: center; gap: 10px; padding: 24px; }
.feed__end-emoji { font-size: 3rem; }
.feed__end h2 { font-size: 1.4rem; }
.feed__end-actions { display: grid; gap: 10px; margin-top: 14px; min-width: min(260px, 70vw); }
body.feed-full .feed__item--end { background: var(--bg); }

/* DD5: klickbare Wort-Bild-Marke im Portal-Header. */
.appbar__brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }

/* ===== CC3: Touch-Feedback (App-Gefuehl statt "eckig") ===== */
a, button, .btn, .check, .segmented__btn, .tabs__btn { -webkit-tap-highlight-color: transparent; }
.segmented__btn { min-height: 44px; }
@media (hover: none) {
  .btn:active, .check:active, .segmented__btn:active, .tabs__btn:active,
  .feed__play:active, .bh-gal__nav:active, .feed__exit:active { transform: scale(.95); }
  .lib-card:active, .feed__cta:active, .link:active { opacity: .8; }
}

/* ===== Responsive Staff-Navigation (Burger, mobil) ===== */
.bh-nav { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.appbar__nav { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.navburger { display: none; }
.navcollapse { display: contents; }   /* Desktop: Wrapper "transparent" -> Layout unverändert */

@media (max-width: 1024px) {
  .navburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0; margin-left: auto;
    background: var(--surface); color: var(--primary-dark);
    border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  }
  .navburger:hover { border-color: var(--primary); }
  .navburger__bars { position: relative; display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; }
  .navburger__bars::before, .navburger__bars::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .18s ease, top .18s ease; }
  .navburger__bars::before { top: -6px; }
  .navburger__bars::after  { top: 6px; }
  /* offener Zustand -> X */
  .navburger[aria-expanded="true"] .navburger__bars { background: transparent; }
  .navburger[aria-expanded="true"] .navburger__bars::before { top: 0; transform: rotate(45deg); }
  .navburger[aria-expanded="true"] .navburger__bars::after  { top: 0; transform: rotate(-45deg); }

  .navcollapse {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px 24px calc(env(safe-area-inset-bottom, 0px) + 14px);
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(17,32,28,.12); z-index: 50;
  }
  .navcollapse.is-open { display: flex; }

  .navcollapse .bh-spacer, .navcollapse .appbar__spacer { display: none; }
  .navcollapse .bh-nav, .navcollapse .appbar__nav { flex-direction: column; align-items: stretch; gap: 2px; margin: 0; }
  .navcollapse .link { display: block; padding: 12px 10px; border-radius: 8px; }
  .navcollapse .link:hover { background: var(--surface-2); text-decoration: none; }
  .navcollapse .bh-userchip, .navcollapse .appbar__user { margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
  .navcollapse form { margin: 8px 0 0; }
  .navcollapse .btn--ghost { width: 100%; justify-content: center; }
}
