/* Fonts loaded via <link> in HTML for faster rendering (§2.4) */

/* =====================================================================
   DESIGN TOKENS (§11 – Token-Architektur)
   ===================================================================== */
:root {
  /* === PRIMITIVE TOKENS === */

  /* HSL Color Foundation (§3.4) */
  --hue-primary: 148;
  --hue-accent: 120;
  --hue-blue: 200;
  --hue-danger: 6;

  /* Colors – Knalliges Ginkgo-Grün für UI-Elemente (Buttons, Footer, Icons).
     Die Helligkeit dieser Grüntöne ist eine bewusste Designentscheidung und
     bleibt so. Folge: weisser Text darauf liegt unter dem WCAG-Kontrastwert
     4.5:1 (green-mid 1.9:1, green-dark 2.9:1). Wer das spaeter beheben will,
     kann NICHT einfach die Flaeche abdunkeln – stattdessen die Schriftfarbe auf
     ein dunkles Gruen umstellen (erreicht 8.2:1 bei unveraenderter Flaeche). */
  --green-dark:   hsl(110, 60%, 42%);
  --green-mid:    hsl(105, 65%, 52%);
  --green-light:  hsl(100, 70%, 62%);
  --green-heading: hsl(120, 15%, 18%);  /* Fast Schwarz mit zartem Grünstich – für Überschriften */
  --blue:         hsl(200, 29%, 51%);
  --bg:           hsl(85, 25%, 97%);
  --bg-section:   hsl(85, 20%, 94%);
  --white:        hsl(85, 15%, 99%);
  /* Textfarben – neutral-dunkel, kein Grün-Overload (§3.1 Premium Guide) */
  --text:         hsl(120, 8%, 22%);
  --text-light:   hsl(110, 6%, 42%);
  --border:       hsl(85, 15%, 84%);
  --accent:       hsl(85, 20%, 91%);
  --notdienst:    hsl(6, 63%, 46%);

  /* Typographic Scale – Major Third 1.25 (§2.3) */
  --text-xs:    0.64rem;   /* 10.24px */
  --text-sm:    0.8rem;    /* 12.8px  */
  --text-base:  1rem;      /* 16px    */
  --text-lg:    1.25rem;   /* 20px    */
  --text-xl:    1.563rem;  /* 25px    */
  --text-2xl:   1.953rem;  /* 31.25px */
  --text-3xl:   2.441rem;  /* 39px    */
  --text-4xl:   3.052rem;  /* 48.8px  */

  /* 8px Spacing System (§4.2) */
  --space-1:   0.25rem;  /*  4px  */
  --space-2:   0.5rem;   /*  8px  */
  --space-3:   0.75rem;  /* 12px  */
  --space-4:   1rem;     /* 16px  */
  --space-5:   1.5rem;   /* 24px  */
  --space-6:   2rem;     /* 32px  */
  --space-8:   3rem;     /* 48px  */
  --space-10:  4rem;     /* 64px  */
  --space-12:  5rem;     /* 80px  */
  --space-16:  8rem;     /* 128px */

  /* Shadow System (§9.2) */
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:   0 4px 12px rgba(45, 90, 61, 0.08);
  --shadow-lg:   0 8px 32px rgba(45, 90, 61, 0.12);
  --shadow-xl:   0 16px 48px rgba(45, 90, 61, 0.16);
  --shadow-glow: 0 0 40px rgba(61, 122, 82, 0.15);
  --shadow:      var(--shadow-md);  /* legacy alias */

  /* Border Radius System (§16) */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius:      12px;    /* legacy alias */
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Transition System (§8, §11.2) – nie lineares Easing */
  --ease-premium: cubic-bezier(.2, .8, .2, 1);
  --transition-fast: 150ms var(--ease-premium);
  --transition-base: 250ms var(--ease-premium);
  --transition-slow: 400ms var(--ease-premium);
  --transition:      var(--transition-base);  /* legacy alias */

  /* === SEMANTIC TOKENS === */
  --section-gap:   6.25rem;  /* 100px – generous whitespace (§4.1) */
  --content-gap:   var(--space-8);
  --card-padding:  var(--space-6);
  --card-gap:      var(--space-5);
  --inline-gap:    var(--space-2);

  /* Hoehe des fixierten Headers. js/layout.js misst den echten Wert und
     ueberschreibt die Variable am <html>-Element – die Werte hier sind der
     Fallback ohne JS (siehe Media-Queries im RESPONSIVE-Block). */
  --header-h: 108px;
}


/* =====================================================================
   RESET
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* font-size: 100% statt 16px – respektiert die Schriftgroesse aus den Browsereinstellungen */
html {
  scroll-behavior: smooth; font-size: 100%;
  /* Ankersprunge landen sonst unter dem fixierten Header */
  scroll-padding-top: calc(var(--header-h) + var(--space-3));
  /* iOS blaeht Text im Querformat sonst eigenmaechtig auf */
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.7;
  /* Sicherheitsnetz gegen horizontales Scrollen auf schmalen Screens */
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(105, 190, 60, .18);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* Lange Woerter (E-Mail-Adressen, Komposita wie "Verwaltungsangestellte")
   sprengen sonst die schmalen Karten auf dem Handy. overflow-wrap wird
   vererbt – einmal am body genuegt fuer das gesamte Dokument. */
body { overflow-wrap: break-word; }


/* =====================================================================
   ACCESSIBILITY (§14)
   ===================================================================== */

/* [hidden] muss display-Regeln (z.B. display:grid) schlagen, sonst bleibt Verstecktes sichtbar */
[hidden] { display: none !important; }

/* Nur fuer Screenreader – z.B. Live-Regionen (§14.2) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip Link (§14.2) */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 1000;
  padding: var(--space-2) var(--space-4);
  background: var(--green-mid);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: var(--space-4);
}

/* Focus States (§14.2) */
:focus-visible {
  outline: 2px solid var(--green-mid);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Reduced Motion (§14.4) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* =====================================================================
   TYPOGRAPHY (§2)
   ===================================================================== */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--green-heading);
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 600; }
h3 { font-size: var(--text-lg); font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }
p  {
  color: var(--text-light);
  font-size: clamp(var(--text-base), 0.5vw + 0.9rem, var(--text-lg));
}


/* =====================================================================
   LAYOUT
   ===================================================================== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 var(--space-5); }
.section { padding: var(--section-gap) 0; }
.section-sm { padding: var(--content-gap) 0; background: var(--bg-section); }
.section-bg { background: var(--bg-section); }

/* Section separator – subtle gradient line between sections (§6.1 Contrast) */
.section + .section-bg,
.section-bg + .section {
  border-top: 1px solid var(--border);
}

/* Grid-Kinder haben per Default min-width:auto und koennen deshalb nicht
   unter ihre min-content-Breite schrumpfen – ein einzelnes langes Wort
   (oder eine eingerueckte Unterliste) macht die Spalte dann breiter als
   den Container. min-width:0 gibt die Spalte wieder frei. */
.grid-2 > *, .grid-3 > *, .two-col > *,
.aktuelles-grid > *, .kontakt-grid > *, .anfahrt-grid > *,
.mfa-grid > *, .team-grid > *, .leistung-detail > *,
.leistungen-grid > *, .footer-grid > *, .map-info-grid > *,
.contact-row > *, .praxis-gallery > *, .image-row > * {
  min-width: 0;
}

/* Dasselbe fuer die Zeilen-Layouts aus Icon/Label + Text: das Textkind muss
   schrumpfen duerfen. Bewusst frueh in der Datei – die festen Breiten der
   Icons (.ki, .ci-icon, .step-num) stehen weiter unten und gewinnen. */
.bio-row > *, .bio-werdegang li > *, .rezept-step > *,
.kontakt-row > *, .contact-item > *, .mfa-card > *,
.map-info-item > *, .anfahrt-card > * {
  min-width: 0;
}

/* Unteilbare Zeichenketten (E-Mail-Adressen, URLs, lange Fachbegriffe):
   "anywhere" senkt – anders als "break-word" – auch die min-content-Breite
   und laesst damit die umgebende Flex-/Grid-Spalte mitschrumpfen. Ohne das
   sprengt z.B. "praxis.eresing@witta.de" bei grosser Schrift die Karte. */
a[href^="mailto:"], .kontakt-row a, .legal a,
.legal-table td, .legal-table th,
.footer-brand a, .section-label, .mfa-card h4 {
  overflow-wrap: anywhere;
}
/* inline-flex schrumpft nicht unter min-content – deckelt sonst die Spalte */
.section-label { max-width: 100%; }


/* =====================================================================
   BUTTONS (§8.3)
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) 28px; border-radius: var(--radius-full); font-size: .9rem;
  font-family: 'Inter', sans-serif; font-weight: 500; cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  /* inline-flex waechst sonst ueber die Spalte hinaus, wenn die Beschriftung
     lang oder die Schrift hochgezoomt ist */
  max-width: 100%;
  flex-wrap: wrap; justify-content: center;
}
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-primary { background: var(--green-mid); color: #fff; }
.btn-primary:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
  transition-duration: 100ms;
}
.btn-outline {
  border-color: var(--green-mid); color: var(--green-mid);
  background: transparent; box-shadow: none;
}
.btn-outline:hover { background: var(--green-mid); color: #fff; }
.btn-outline:active { background: var(--green-dark); }
.btn-white { background: #fff; color: var(--green-dark); }
.btn-white:hover { background: var(--accent); transform: translateY(-2px); }
.btn-white:active { transform: translateY(0); transition-duration: 100ms; }
.btn-disabled { cursor: default; opacity: .85; pointer-events: none; }
.btn-group { display: flex; gap: var(--space-3); flex-wrap: wrap; }


/* =====================================================================
   HEADER / NAV (§7)
   ===================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
  background: rgba(247,249,246,.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base),
              transform var(--transition-base);
}
.site-header.header-hidden { transform: translateY(-100%); }
/* Die Unterseiten blenden den Header beim Runterscrollen aus. Bei offenem
   Mobilmenue wuerde damit die gesamte Navigation aus dem Bild fahren. */
.site-header.menu-open.header-hidden { transform: none; }
.site-header.scrolled { box-shadow: var(--shadow-md); }

/* Transparent hero-overlay state */
.site-header.hero-transparent {
  background: rgba(20,20,20,.18);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom-color: transparent;
  box-shadow: none;
  /* Der Verlauf laeuft tiefer ins Hero-Bild aus: Der Header bekommt hier
     unten zusaetzlichen (leeren) Raum, ueber den die Maske ausblendet.
     Bewusst EIN Element – zwei gestapelte backdrop-filter erzeugen an der
     Naht eine sichtbare Kante. Die Kopfzeilenhoehe fuer das Layout misst
     js/layout.js an .nav-inner, dieser Zusatzraum zaehlt also nicht mit. */
  padding-bottom: 26px;
  -webkit-mask-image: linear-gradient(to bottom, black 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 62%, transparent 100%);
}
/* Bei offenem Menue deckt der Header voll – sonst verblasst das Menue unten */
.site-header.hero-transparent.menu-open { padding-bottom: 0; }
/* Offenes Mobilmenue ueber dem Hero-Foto: deutlich deckender, sonst ist die
   weisse Schrift auf dem Bild nicht lesbar (WCAG 1.4.3) */
.site-header.hero-transparent.menu-open {
  -webkit-mask-image: none;
  mask-image: none;
  background: rgba(22, 42, 31, .88);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.site-header.hero-transparent .nav-link { color: rgba(255,255,255,.92); }
.site-header.hero-transparent .nav-link:hover,
.site-header.hero-transparent .nav-link.active {
  color: #fff; background: rgba(255,255,255,.15);
}
.site-header.hero-transparent .nav-logo-text { color: #fff; }
.site-header.hero-transparent .nav-logo-text span { color: rgba(255,255,255,.65); }
.site-header.hero-transparent .hamburger span { background: #fff; }

.nav-inner {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: var(--space-6) var(--space-5) 20px;
  max-width: 1280px; margin: 0 auto;
}
.nav-left, .nav-right { display: flex; align-items: center; gap: var(--space-2); }
.nav-right { justify-content: flex-end; }
.nav-logo { text-align: center; }
.nav-logo img { height: 56px; width: auto; }
.nav-logo-text {
  font-family: 'Playfair Display', serif; font-size: 1.1rem;
  font-weight: 700; color: var(--green-heading); line-height: 1.2;
  text-align: center;
}
.nav-logo-text span {
  display: block; font-size: .7rem; font-family: 'Inter', sans-serif;
  font-weight: 400; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-light);
}

.nav-link {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  font-size: .85rem; font-weight: 500; color: var(--text);
  transition: color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
  position: relative;
}
.nav-link::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; right: 50%;
  height: 2px; background: var(--green-mid); border-radius: 1px;
  transition: left 200ms var(--ease-premium), right 200ms var(--ease-premium);
}
.nav-link:hover::after, .nav-link.active::after { left: var(--space-3); right: var(--space-3); }
.nav-link:hover, .nav-link.active { color: var(--green-mid); background: var(--accent); }

.nav-notdienst {
  display: flex; align-items: center; gap: 6px; padding: var(--space-2) 14px;
  background: var(--notdienst); color: #fff; border-radius: var(--radius-full);
  font-size: var(--text-sm); font-weight: 600;
  transition: all var(--transition-base);
  animation: pulse-red 2.5s infinite;
  /* Eine zweizeilig umbrechende Pille sieht immer defekt aus */
  white-space: nowrap;
}
.nav-notdienst:hover { background: #a93226; transform: scale(1.04); }
@keyframes pulse-red {
  0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,.3); }
  50%      { box-shadow: 0 0 0 8px rgba(192,57,43,0); }
}

/* Mobile hamburger – <button>, damit per Tastatur bedienbar (WCAG 2.1.1).
   44x44px Mindestflaeche fuer Touch-Bedienung (WCAG 2.5.5) */
.hamburger {
  display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px;
  background: none; border: none; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  justify-self: end;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px; background: var(--text);
  border-radius: 2px; transition: all var(--transition-base);
}

/* Hamburger X-animation */
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav – inside header, inherits blur + background */
.mobile-nav {
  display: none; flex-direction: column;
  grid-column: 1 / -1;
  padding: 20px var(--space-2) var(--space-5);
  gap: var(--space-1);
  /* Im Querformat passt die Liste sonst nicht auf den Schirm */
  max-height: calc(100svh - 96px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mobile-nav.open { display: flex; }
.mobile-nav .nav-link {
  width: 100%; padding: var(--space-3) 14px;
  font-size: .95rem; border-radius: var(--radius-md);
  min-height: 44px; display: flex; align-items: center;
}
.mobile-nav .nav-notdienst {
  align-self: stretch;
  justify-content: center;
  margin-top: var(--space-3);
  min-height: 44px;
}
.nd-svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Hero-transparent mobile-nav text override */
.site-header.hero-transparent .mobile-nav .nav-link {
  color: rgba(255,255,255,.92);
}
.site-header.hero-transparent .mobile-nav .nav-link:hover,
.site-header.hero-transparent .mobile-nav .nav-link.active {
  background: rgba(255,255,255,.15);
  color: #fff;
}


/* =====================================================================
   HERO
   ===================================================================== */
.hero {
  position: relative; display: flex; align-items: center;
  margin-top: 0; overflow: hidden; padding-bottom: 160px;
  /* svh statt vh: die ein-/ausfahrende Browserleiste auf iOS/Android
     wuerde den Hero sonst bei jedem Scroll neu umbrechen */
  min-height: 100vh;
  min-height: 100svh;
}
/* Der Hero ist ein Flex-Container, sein Inhalt also ein Flex-Kind – und das
   kann per Vorgabe nicht schmaler werden als sein laengster unteilbarer
   Inhalt. Bei stark vergroesserter Schrift schob das die Ueberschrift, den
   Text und beide Schaltflaechen ueber den rechten Rand, wo sie wegen
   overflow:hidden abgeschnitten und unerreichbar waren (WCAG 1.4.4).
   min-width:0 gibt die Spalte frei, der Text bricht dann normal um. */
.hero > .container { min-width: 0; }
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  background-image: url('../img/hero-ginkgo.jpg');
  transition: transform 0.1s linear;
  will-change: transform;
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(25,55,40,.45) 0%,
      rgba(35,70,50,.30) 30%,
      rgba(50,90,70,.12) 65%,
      rgba(50,90,70,.0) 100%
    ),
    linear-gradient(160deg, rgba(35,70,50,.35) 0%, rgba(70,110,85,.10) 100%);
}
.hero::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 220px; z-index: 1;
  background: linear-gradient(to bottom, transparent 0%, var(--bg) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative; z-index: 2; color: #fff;
  max-width: 680px; padding-top: var(--section-gap);
}
.hero-badge {
  display: inline-block; margin-bottom: var(--space-5);
  background: rgba(255,255,255,.15); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.3); border-radius: var(--radius-full);
  padding: 6px var(--space-4); font-size: var(--text-sm); font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; line-height: 1.45;
  max-width: 100%;
}
/* Ort bleibt als Ganzes zusammen – bricht auf schmalen Displays komplett in Zeile 2.
   Die Pille schrumpft danach per js/layout.js auf die Breite der laengsten
   gesetzten Zeile; ohne JS bliebe sie in diesem Fall zu breit. */
/* "Eresing bei Landsberg" darf umbrechen. Nachgemessen: Bei normaler
   Schriftgroesse rendert der Badge mit und ohne Umbruchsperre exakt gleich
   (320px: 2 Zeilen bis x=188, 390/430px: 1 Zeile) – die Sperre aendert dort
   also nichts. Bei 200% Schrift dagegen schob sie den Text auf x=415 hinaus,
   waehrend die Pille bei 358 endet: "ERESING BEI LANDSBER" war abgeschnitten
   und wegen overflow:hidden nicht erreichbar. */
.hero-badge .badge-nowrap { white-space: normal; }
.hero h1 { color: #fff; margin-bottom: 20px; text-shadow: 0 2px 20px rgba(0,0,0,.2); }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,.88); margin-bottom: var(--space-8); max-width: 540px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-scroll {
  position: absolute; bottom: 56px; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: rgba(255,255,255,.6); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  animation: bounce 2s infinite;
}
.hero-scroll::after { content: '↓'; font-size: 1.2rem; }
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%     { transform: translateX(-50%) translateY(6px); }
}


/* =====================================================================
   PAGE HERO (Subpages)
   ===================================================================== */
.page-hero {
  /* exakt die gemessene Header-Hoehe – vorher fix 84px, wodurch der
     Seitenkopf auf schmalen Screens unter dem Header verschwand */
  margin-top: var(--header-h);
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  padding: 60px 0 50px; color: #fff;
  position: relative; overflow: hidden;
}
.page-hero h1 { color: #fff; font-size: clamp(1.8rem,4vw,2.6rem); }
.page-hero p  { color: rgba(255,255,255,.82); margin-top: 10px; }
.page-hero .section-label { color: rgba(255,255,255,.7); }


/* =====================================================================
   PHILOSOPHY STRIP
   ===================================================================== */
.philosophy {
  background: var(--green-dark); color: #fff; text-align: center;
  padding: var(--space-8) var(--space-5);
}
.philosophy p {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.05rem,2.5vw,1.35rem);
  font-style: italic; color: rgba(255,255,255,.92);
  max-width: 700px; margin: 0 auto;
}


/* =====================================================================
   GINKGO DECORATION
   ===================================================================== */
.ginkgo-deco { position: absolute; opacity: .06; pointer-events: none; z-index: 0; }


/* =====================================================================
   QUICK LINKS
   ===================================================================== */
.quick-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
}
.quick-link-card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: var(--card-padding) 20px;
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  display: flex; flex-direction: column; align-items: center;
  width: 100%; min-width: 0;
}
.quick-link-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.quick-link-card:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  transition-duration: 100ms;
}
.quick-link-card h4 { margin-bottom: var(--space-1); font-size: .95rem; }
.quick-link-card p  { font-size: var(--text-sm); color: var(--text-light); }
.ql-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--green-mid), var(--green-dark));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; margin: 0 auto var(--space-3);
  box-shadow: 0 4px 14px rgba(45,90,61,.22);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.quick-link-card:hover .ql-icon {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(45,90,61,.32);
}
.ql-icon svg { width: 26px; height: 26px; }
@media (max-width: 768px) {
  .quick-links { grid-template-columns: repeat(2, 1fr); }
}


/* =====================================================================
   LEISTUNGEN CARDS (Index Overview)
   ===================================================================== */
.leistungen-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--card-gap); }
@media (max-width: 900px) { .leistungen-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .leistungen-grid { grid-template-columns: 1fr; } }
.leistung-card {
  background: var(--white); border-radius: var(--radius-lg); padding: var(--card-padding) 28px;
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease-premium),
              box-shadow 0.3s var(--ease-premium),
              border-color 0.3s var(--ease-premium);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.leistung-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--green-mid), var(--blue));
}
.leistung-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-lg);
}
.leistung-card:active {
  transform: translateY(-2px) scale(1.005);
  transition-duration: 100ms;
}
.leistung-icon {
  width: 52px; height: 52px; background: var(--accent); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--green-mid); margin-bottom: var(--space-4);
}
.leistung-icon svg { width: 26px; height: 26px; }
.leistung-card h3 { margin-bottom: var(--space-2); }
.leistung-card p  { font-size: .9rem; flex: 1; }
.leistung-tag {
  display: inline-block; margin-top: 14px; font-size: .7rem; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-full);
  background: var(--accent); color: var(--green-mid);
  align-self: flex-start;
}
.leistung-tag.privat { background: #e8eef5; color: var(--blue); }

/* Bento Layout – first card spans 2 columns for visual hierarchy (§6.3) */
.leistungen-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--card-gap);
}
.leistungen-bento .bento-featured {
  grid-column: span 2;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-8) var(--space-6);
}
.leistungen-bento .bento-featured .leistung-icon {
  width: 64px; height: 64px; border-radius: 18px;
  margin-bottom: var(--space-5);
}
.leistungen-bento .bento-featured .leistung-icon svg { width: 32px; height: 32px; }
.leistungen-bento .bento-featured h3 { font-size: var(--text-xl); margin-bottom: var(--space-3); }
.leistungen-bento .bento-featured p { font-size: var(--text-base); max-width: 440px; }
@media (max-width: 900px) {
  .leistungen-bento { grid-template-columns: repeat(2, 1fr); }
  .leistungen-bento .bento-featured { grid-column: span 2; grid-row: span 1; padding: var(--card-padding) 28px; }
  .leistungen-bento .bento-featured h3 { font-size: var(--text-lg); }
}
@media (max-width: 540px) {
  .leistungen-bento { grid-template-columns: 1fr; }
  .leistungen-bento .bento-featured { grid-column: span 1; }
}


/* =====================================================================
   LEISTUNG DETAIL (leistungen.html)
   ===================================================================== */
.leistung-detail {
  background: var(--white); border-radius: var(--radius-lg); padding: 40px 36px;
  border: 1px solid var(--border); margin-bottom: var(--card-padding); display: grid;
  grid-template-columns: 1fr 1fr; gap: 36px; align-items: center;
}
.leistung-detail:nth-child(even) { direction: rtl; }
.leistung-detail:nth-child(even) > * { direction: ltr; }
@media (max-width: 900px) {
  .leistung-detail { grid-template-columns: 1fr; direction: ltr !important; }
  .leistung-detail:nth-child(even) { direction: ltr; }
}
.leistung-detail-img {
  aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-section); display: flex; align-items: center;
  justify-content: center; font-size: 5rem;
}
.leistung-detail-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--transition-slow);
}
.leistung-detail:hover .leistung-detail-img img { transform: scale(1.03); }

.leistung-detail h2 { margin-bottom: var(--space-3); }
.leistung-detail ul {
  margin-top: 14px; display: flex; flex-direction: column; gap: 6px;
  padding-left: var(--space-4); list-style: disc;
  color: var(--text-light); font-size: .9rem;
}

/* Kassenart filter tabs – <button>, damit per Tastatur bedienbar (WCAG 2.1.1) */
.kassenart-tabs { display: flex; gap: var(--space-3); margin-bottom: 40px; flex-wrap: wrap; }
.kassenart-tab {
  padding: var(--space-2) var(--space-5); border-radius: var(--radius-full);
  border: 2px solid var(--border);
  font-family: inherit;
  font-weight: 600; font-size: .88rem; cursor: pointer;
  transition: all var(--transition-base);
  background: var(--white); color: var(--text-light);
}
.kassenart-tab:hover { border-color: var(--green-mid); color: var(--green-mid); }
.kassenart-tab.active { border-color: var(--green-mid); background: var(--green-mid); color: #fff; }
.badge-gkv {
  background: var(--accent); color: var(--green-mid);
  font-size: .75rem; font-weight: 700; padding: 3px 10px;
  border-radius: var(--radius-full); margin-left: 10px;
}
.badge-pkv {
  background: #e8eef5; color: var(--blue);
  font-size: .75rem; font-weight: 700; padding: 3px 10px;
  border-radius: var(--radius-full); margin-left: 10px;
}
.leistung-meta {
  display: flex; gap: var(--space-2); margin-top: 14px; flex-wrap: wrap;
}
.leistung-meta span {
  font-size: .72rem; font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-full); background: var(--accent); color: var(--green-mid);
}
.leistung-meta span.privat { background: #e8eef5; color: var(--blue); }


/* =====================================================================
   SPRECHZEITEN
   ===================================================================== */
.sprechzeiten-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 36px;
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
  height: 100%; box-sizing: border-box;
  display: flex; flex-direction: column;
}
.sprechzeiten-card h2 { margin-bottom: var(--space-5); }
.sz-table { width: 100%; border-collapse: collapse; }
.sz-table tr { border-bottom: 1px solid var(--border); }
.sz-table tr:last-child { border-bottom: none; }
.sz-table th, .sz-table td { padding: 10px 0; font-size: .92rem; }
/* Wochentag steht als <th scope="row"> in der Zeile (WCAG 1.3.1) */
.sz-table th {
  font-family: 'Inter', sans-serif;
  font-weight: 600; color: var(--green-heading); width: 80px;
  text-align: left;
}
.sz-table td { color: var(--text-light); }
.sz-note {
  margin-top: var(--space-4); padding: var(--space-3) var(--space-4);
  background: var(--accent); border-radius: 10px;
  font-size: .85rem; color: var(--green-heading);
}


/* =====================================================================
   AKTUELLES
   ===================================================================== */
.aktuelles-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 40px; align-items: stretch; }
.aktuelles-grid > div:last-child { display: flex; flex-direction: column; }
.aktuelles-grid > div:last-child .aktuelles-box:last-child { flex: 1; }
@media (max-width: 900px) { .aktuelles-grid { grid-template-columns: 1fr; } }
.aktuelles-box {
  background: linear-gradient(135deg, var(--accent), var(--white));
  border: 1px solid var(--border); border-left: 4px solid var(--green-mid);
  border-radius: var(--radius); padding: 28px var(--card-padding);
}
.aktuelles-box .label {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--green-mid); margin-bottom: var(--space-2);
}
.aktuelles-box h3 { margin-bottom: var(--space-2); }
/* Zeilenumbrueche aus dem Admin auch in der Kachel uebernehmen –
   gleiche Begruendung wie bei .modal-box p weiter unten. */
.aktuelles-box p { font-size: .9rem; white-space: pre-line; }
.aktuelles-date { font-size: .78rem; color: var(--text-light); margin-top: 10px; }


/* =====================================================================
   INLINE IMAGE & IMAGE GRID (index.html)
   ===================================================================== */
.inline-image { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.inline-image img {
  width: 100%; height: 340px; object-fit: cover;
  transition: transform var(--transition-slow);
}
.inline-image:hover img { transform: scale(1.03); }
.inline-image-placeholder {
  width: 100%; height: 340px;
  background: linear-gradient(135deg, var(--accent), var(--bg-section));
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; border-radius: var(--radius-lg);
}
.image-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-top: 40px; }
@media (max-width: 900px) { .image-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .image-row { grid-template-columns: 1fr; } }
.image-tile {
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4/3; background: var(--bg-section);
}
.image-tile img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--transition-slow);
}
.image-tile:hover img { transform: scale(1.03); }
.image-tile-ph {
  width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center; font-size: 2.5rem;
}

/* Praxis-Galerie – beschriftete Einblicke */
.praxis-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 40px; align-items: start; }
.praxis-gallery--portrait { grid-template-columns: 1fr 1fr 1fr; margin-top: 28px; }
.praxis-gallery--portrait .praxis-frame { aspect-ratio: 3 / 4; }
/* Drei Querformat-Kacheln nebeneinander (Startseite) */
.praxis-gallery--triple { grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
@media (max-width: 700px) {
  .praxis-gallery { grid-template-columns: 1fr; gap: 24px; }
  .praxis-gallery--portrait { grid-template-columns: 1fr 1fr; }
  .praxis-gallery--triple { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) { .praxis-gallery--portrait, .praxis-gallery--triple { grid-template-columns: 1fr; } }
.praxis-item { margin: 0; }
.praxis-frame {
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--bg-section);
  display: flex; gap: 4px;
}
.praxis-frame img {
  flex: 1 1 0; min-width: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform var(--transition-slow);
}
.praxis-item:hover .praxis-frame img { transform: scale(1.03); }
.praxis-item figcaption {
  margin-top: 12px; text-align: center;
  font-size: var(--text-base); font-weight: 500; color: var(--text-light);
}


/* =====================================================================
   MODAL (Aktuelles Popup)
   ===================================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(20,40,30,.55); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease-premium);
}
.modal-overlay.visible { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--white); border-radius: var(--radius-lg);
  max-width: 520px; width: 100%; padding: 40px 44px 36px;
  /* Langer Text darf auf kleinen Screens im Dialog scrollen, statt abzuschneiden */
  max-height: calc(100svh - 2 * var(--space-5));
  overflow-y: auto; overscroll-behavior: contain;
  position: relative; box-shadow: var(--shadow-xl);
  transform: translateY(24px) scale(.97);
  transition: transform .35s var(--ease-premium);
  border-top: 4px solid var(--green-mid);
}
.modal-overlay.visible .modal-box { transform: translateY(0) scale(1); }
/* Fokus wird beim Oeffnen programmatisch hierher gesetzt – kein sichtbarer Ring noetig */
.modal-box:focus { outline: none; }
.modal-close {
  position: absolute; top: var(--space-2); right: var(--space-2);
  background: none; border: none; cursor: pointer;
  color: var(--text-light); font-size: 1.4rem; line-height: 1;
  transition: color var(--transition-fast);
  /* 44x44px Touch-Flaeche (WCAG 2.5.5) */
  width: 44px; height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text); }
.modal-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--green-mid); margin-bottom: 10px;
}
.modal-box h3 { margin-bottom: var(--space-3); font-size: 1.4rem; }
/* pre-line uebernimmt die Zeilenumbrueche aus dem Admin-Textfeld: Der Text
   wird per textContent gesetzt, ein "\n" waere sonst nur ein Leerzeichen.
   Bewusst pre-line statt pre-wrap – mehrfache Leerzeichen und Einrueckungen
   werden zusammengefasst, lange Zeilen brechen weiter normal um. Leerzeilen
   im Admin ergeben so echte Absaetze. HTML wird dabei nicht ausgewertet,
   die Eingabe bleibt also ungefaehrlich. */
.modal-box p { font-size: .93rem; color: var(--text-light); line-height: 1.7; white-space: pre-line; }
.modal-date { font-size: .78rem; color: var(--text-light); margin-top: var(--space-4); opacity: .75; }
.modal-footer { margin-top: var(--space-5); }
.modal-footer button {
  background: var(--green-mid); color: #fff; border: none;
  border-radius: var(--radius-full);
  padding: 11px 28px; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: background var(--transition-fast);
}
.modal-footer button:hover { background: var(--green-dark); }


/* =====================================================================
   NOTDIENST FLOAT
   ===================================================================== */
/* Float group – kept for backwards compatibility */
.notdienst-float-group {
  position: fixed; bottom: 28px; right: 28px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.notdienst-float {
  position: fixed; bottom: 28px; right: 28px; z-index: 200;
  background: var(--notdienst); color: #fff; border-radius: var(--radius-full);
  padding: var(--space-3) 20px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 32px rgba(192,57,43,.35);
  font-weight: 600; font-size: .88rem;
  transition: all var(--transition-base);
  animation: ndPulse 2.4s ease-in-out infinite;
}
.notdienst-float:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 40px rgba(192,57,43,.5);
}
.notdienst-float .nd-icon { font-size: 1.2rem; }
@keyframes ndPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(180,30,30,.4); }
  50%       { box-shadow: 0 4px 32px rgba(180,30,30,.65); }
}


/* =====================================================================
   MAP SECTION
   ===================================================================== */
.map-wrapper { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); height: 420px; }
.map-wrapper iframe { width: 100%; height: 100%; border: 0; }


/* =====================================================================
   ZWEI-KLICK-CONSENT (externe Einbettungen)
   ===================================================================== */
.embed-consent { position: relative; }
.embed-placeholder {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--bg-section));
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: var(--space-3); padding: var(--space-5);
}
.embed-placeholder h3 { color: var(--green-heading); }
.embed-placeholder p {
  font-size: .88rem; color: var(--text-light);
  max-width: 440px; margin: 0;
}
.embed-placeholder .embed-note { font-size: var(--text-sm); }
.embed-placeholder .embed-note a { color: var(--green-mid); text-decoration: underline; }
.embed-placeholder .embed-note a:hover { color: var(--green-dark); }
/* Scroll-Schutz ueber Karten (js/consent.js).
   Ohne diese Schicht faengt das Karten-iframe die Wischgeste ab und die Seite
   laesst sich am Lageplan nicht weiterscrollen – man verschiebt stattdessen
   die Karte. Ein Tippen entfernt die Schicht und gibt die Karte frei. */
.embed-guard {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0;
  background: transparent;
  font: inherit; cursor: pointer;
  display: flex; align-items: flex-end; justify-content: center;
}
.embed-guard::after {
  content: 'Zum Verschieben der Karte tippen';
  margin-bottom: var(--space-4);
  padding: 7px 16px;
  background: rgba(20, 30, 20, .72);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: .78rem; font-weight: 500;
  backdrop-filter: blur(4px);
}
/* Mit Maus/Trackpad gibt es das Problem nicht – dort direkt bedienbar lassen */
@media (hover: hover) and (pointer: fine) {
  .embed-guard { display: none; }
}

/* Ohne JS bleibt der iframe leer – der noscript-Hinweis muss den Platz fuellen */
.embed-consent noscript {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-5); text-align: center;
  background: var(--bg-section);
}

/* Rahmen um die eingebettete Buchung. Sie steht ausschliesslich im Dialog
   (siehe .booking-overlay weiter unten) und fuellt dort die Hoehe unter der
   Kopfzeile – deshalb hier keine feste Hoehe und kein scroll-margin-top:
   In den Seitenfluss gescrollt wird zu ihr nicht mehr. */
.booking-wrapper {
  overflow: hidden; background: #fff;
  flex: 1; min-height: 0;
}
.booking-wrapper iframe { width: 100%; height: 100%; border: 0; }

/* termine.html steht in einer Spalte: Sprechzeiten -> Buchungsaufruf ->
   Folgerezepte. Die Buchung selbst steht seit dem Dialog nicht mehr im
   Seitenfluss, die beiden gruenen Kaesten stossen also direkt aneinander. */
.termine-cta-box + .termine-cta-box { margin-top: var(--space-10); }

/* Ladehinweis, solange die externe Buchung noch nicht geantwortet hat */
.booking-wrapper.embed-lade { position: relative; }
.booking-wrapper.embed-lade::after {
  /* Die externe Buchungs-App laedt ueber 1 MB nach und braucht spuerbar
     lange. Der Zusatz nimmt der Wartezeit den Anschein eines Fehlers. */
  content: 'Buchung wird geladen – das kann einen Moment dauern …';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-section); color: var(--text-light);
  font-size: var(--text-sm); letter-spacing: .04em;
}

/* Buchungsdialog.
   Die Buchung lief frueher im Seitenfluss. Die Buchungs-App zieht bei jedem
   Schritt den Blick auf ihr erstes Feld, wofuer der Browser das ganze
   Dokument scrollt – man landete nach jedem Klick wieder am Anfang der
   Buchung. Der Versuch, den Rahmen dafuer genau fensterhoch zu machen, hat
   nicht gereicht: Ruft die App scrollIntoView() auf, scrollt der Browser
   auch dann, wenn der Rahmen vollstaendig zu sehen ist. Deshalb liegt die
   Buchung jetzt in einem Dialog ueber der Seite – ohne Scrollweg kann nichts
   springen. Das Feststellen der Seite dahinter macht js/buchung.js. */
.booking-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(20,40,30,.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
  overscroll-behavior: contain;
  opacity: 0; transition: opacity .25s var(--ease-premium);
}
/* Muss das display:flex schlagen, sonst bliebe der Dialog sichtbar */
.booking-overlay[hidden] { display: none; }
.booking-overlay.visible { opacity: 1; }
.booking-dialog {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); overflow: hidden;
  width: 100%; max-width: 560px; height: 100%;
  display: flex; flex-direction: column;
}
/* Fokus wird beim Oeffnen programmatisch hierher gesetzt */
.booking-dialog:focus { outline: none; }
.booking-dialog-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.booking-dialog-bar h2 { font-size: 1.05rem; margin: 0; }
/* Logo neben dem Titel: Der Dialog liegt ueber der Seite und zeigt darunter
   eine fremde Anwendung – die Kopfzeile ist das Einzige, was die Buchung
   sichtbar an die Praxis bindet. min-width:0 laesst den Titel notfalls
   umbrechen, statt den Schliessen-Knopf aus dem Dialog zu draengen. */
.booking-dialog-brand {
  display: flex; align-items: center; gap: var(--space-2); min-width: 0;
}
.booking-dialog-brand img {
  width: 30px; height: 30px; object-fit: contain; flex-shrink: 0;
}
.booking-dialog-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-light); font-size: 1.6rem; line-height: 1;
  /* 44x44px Tippflaeche (WCAG 2.5.5) */
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.booking-dialog-close:hover { color: var(--text); background: var(--bg-section); }
/* Auf dem Handy zaehlt jeder Pixel Hoehe fuer die Buchung */
@media (max-width: 600px) {
  .booking-overlay { padding: var(--space-2); }
  .booking-dialog-bar h2 { font-size: .95rem; }
  .booking-dialog-brand img { width: 24px; height: 24px; }
}
/* Der Notdienst-Knopf klebte sonst ueber der abgedunkelten Flaeche */
body.booking-offen .notdienst-float,
body.booking-offen .notdienst-float-group { display: none; }
.map-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin-top: 20px; }
.map-info-item {
  background: var(--white); border-radius: var(--radius); padding: 18px 20px;
  border: 1px solid var(--border);
}
.map-info-item h4 { margin-bottom: 6px; font-size: .9rem; }
.map-info-item p { font-size: .85rem; }


/* =====================================================================
   ANFAHRT (praxis.html)
   ===================================================================== */
.anfahrt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: var(--card-padding); }
@media (max-width: 768px) { .anfahrt-grid { grid-template-columns: 1fr; } }
.anfahrt-card {
  background: var(--white); border-radius: var(--radius); padding: var(--space-5);
  border: 1px solid var(--border);
}
.anfahrt-card h3 { margin-bottom: 10px; }
.anfahrt-card p, .anfahrt-card li { font-size: .9rem; color: var(--text-light); }
.anfahrt-card ul {
  padding-left: 18px; list-style: disc; display: flex;
  flex-direction: column; gap: 6px; margin-top: var(--space-2);
}
.icon-row { font-size: 1.4rem; margin-bottom: 10px; }


/* =====================================================================
   TEAM CARDS
   ===================================================================== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.team-card {
  background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease-premium), box-shadow 0.3s var(--ease-premium);
  display: flex; flex-direction: column;
}
.team-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.team-photo { aspect-ratio: 3/2; background: var(--bg-section); overflow: hidden; }
.team-photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: center center;
  transition: transform var(--transition-slow);
}
.team-card:hover .team-photo img { transform: scale(1.03); }
.team-photo-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--bg-section));
  font-size: 3rem;
}
.team-info { padding: 28px var(--card-padding); flex: 1; display: flex; flex-direction: column; }
.team-info h3 { font-size: 1.15rem; margin-bottom: var(--space-1); }
.team-info .role {
  font-size: .82rem; color: var(--blue); font-weight: 500;
  margin-bottom: 0; min-height: 2.6em;
}
.team-info p { font-size: .85rem; }
.team-badge {
  display: inline-block; margin-top: 10px; background: hsl(148, 10%, 92%); color: var(--text);
  font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-full);
  align-self: flex-start;
}
@media (max-width: 900px) {
  .team-grid { grid-template-columns: 1fr; }
  .team-photo { aspect-ratio: 3/4; }
  .team-photo img { object-position: calc(50% + 30px) center !important; }
}

/* Team bio (team.html) */
.bio-meta { margin-top: var(--space-3); display: flex; flex-direction: column; gap: 5px; }
.bio-row { display: flex; gap: 10px; font-size: .83rem; line-height: 1.5; }
.bio-row .bio-label {
  color: var(--green-mid); font-weight: 600; white-space: nowrap;
  min-width: 90px; flex-shrink: 0;
}
.bio-row .bio-value { color: var(--text); }
.bio-divider { height: 1px; background: var(--border); margin: var(--space-3) 0; }
.bio-werdegang {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: var(--space-1);
}
.bio-werdegang li { font-size: .82rem; line-height: 1.5; display: flex; gap: 10px; }
.bio-werdegang li .wj {
  color: var(--green-mid); font-weight: 600; min-width: 90px; flex-shrink: 0;
}
.bio-werdegang li .wt { color: var(--text); }


/* =====================================================================
   MFA CARDS (team.html)
   ===================================================================== */
.azubi-section {
  background: var(--bg-section); border-radius: var(--radius-lg);
  padding: 40px; margin-top: 60px;
}
.mfa-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px; margin-top: var(--space-5);
}

/* Karten steigen beim Hereinscrollen leicht auf, nacheinander.
   Der Ausgangszustand haengt an .js-anim – diese Klasse setzt team.html im
   Kopfbereich, und nur dann, wenn der IntersectionObserver verfuegbar ist,
   der sie spaeter wieder einblendet. Ohne JavaScript (oder ohne Observer)
   greift die Regel nie und der Abschnitt bleibt normal lesbar.
   Ohne "forwards" endet die Animation im regulaeren Zustand – dadurch
   bleibt der Hover-Effekt der Karte danach wirksam. */
@keyframes mfaAufsteigen {
  from { opacity: 0; transform: translateY(18px); }
}
.js-anim .mfa-card:not(.visible) {
  opacity: 0;
  transform: translateY(18px);
}
.mfa-card.visible {
  animation: mfaAufsteigen .55s var(--ease-premium) backwards;
}
/* Kleine Staffelung fuer Karten, die gemeinsam ins Bild kommen (Desktop-
   Raster). Auf dem Handy kommt jede Karte einzeln und bringt ihre eigene
   Verzoegerung mit – deshalb bewusst kurz gehalten. */
.mfa-card.visible:nth-child(2) { animation-delay: .06s; }
.mfa-card.visible:nth-child(3) { animation-delay: .12s; }
.mfa-card.visible:nth-child(4) { animation-delay: .18s; }
.mfa-card.visible:nth-child(5) { animation-delay: .24s; }
.mfa-card.visible:nth-child(6) { animation-delay: .30s; }
.mfa-card {
  background: var(--white); border-radius: var(--radius); padding: var(--space-5) 20px;
  text-align: center; border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  transition: transform var(--transition-base),
              box-shadow var(--transition-base),
              border-color var(--transition-base);
}
.mfa-card:hover {
  transform: translateY(-4px);
  border-color: var(--green-mid);
  box-shadow: var(--shadow-md);
}
.mfa-card h4 { font-size: .95rem; margin-top: var(--space-1); }
.mfa-role {
  font-size: .78rem; color: var(--green-mid); font-weight: 600;
  margin: var(--space-1) 0 10px; min-height: 2.4em;
  display: flex; align-items: center; justify-content: center;
}
.mfa-since {
  font-size: .78rem; color: var(--text-light);
  margin-bottom: 14px;
}
/* Kalender-Icon statt Emoji – Emoji rendern je Plattform verschieden und
   brechen den Line-Icon-Stil der Site. Inline im Textfluss, damit es beim
   Umbruch in der schmalen Karte bei der ersten Zeile bleibt. */
.mfa-since svg {
  display: inline; vertical-align: -2px; margin-right: 2px;
  color: var(--green-mid);
}
.mfa-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: auto; }
.mfa-tag {
  font-size: .72rem; background: hsl(148, 10%, 92%); color: var(--text);
  border-radius: 20px; padding: 2px 9px; font-weight: 500;
}
.mfa-photo {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; margin: 0 auto 10px; display: block;
}

/* Bleibt in der letzten Zeile Platz, sollen die uebrigen Karten mittig unter
   den vollen Zeilen stehen statt links zu kleben. Grid kann eine
   unvollstaendige Schlusszeile nicht von sich aus zentrieren, also bekommt
   das Raster doppelt so viele Spalten wie Karten pro Zeile und jede Karte
   ueberspannt zwei davon. Die Schlusszeile laesst sich dann um halbe Spalten
   versetzen. An der Kartenbreite aendert das nichts, sie ist bei 2N halben
   Spalten dieselbe wie bei N ganzen:
     2 * (B - (2N-1)*20) / 2N + 20  ==  (B - (N-1)*20) / N
   Die Spaltenzahl muss dafuer festliegen – :nth-child kann nicht wissen, wo
   eine Zeile anfaengt. Die Umschaltpunkte sind genau die von
   repeat(auto-fill, minmax(210px, 1fr)) oben, das Raster selbst bleibt also
   unveraendert. Rasterbreite = min(Viewport, 1280) - 48 (.container)
   - 80 (.azubi-section), Spalten = floor((Breite + 20) / 230):
     bis 797px -> 2 Spalten, ab 798px -> 3, ab 1028px -> 4,
     ab 1258px -> 5, dort passen alle fuenf Karten in eine Zeile.
   Aufgefuehrt sind nur die unvollstaendigen Schlusszeilen; ist die letzte
   Zeile voll, greift keine Regel. Die jeweils erste Karte der Schlusszeile
   wird gesetzt, die folgenden reihen sich von selbst dahinter ein. */
@media (min-width: 601px) and (max-width: 1257px) {
  .mfa-card { grid-column: span 2; }
}
@media (min-width: 601px) and (max-width: 797px) {
  .mfa-grid { grid-template-columns: repeat(4, 1fr); }
  .mfa-card:nth-child(2n+1):last-child        { grid-column: 2 / span 2; }
}
@media (min-width: 798px) and (max-width: 1027px) {
  .mfa-grid { grid-template-columns: repeat(6, 1fr); }
  .mfa-card:nth-child(3n+1):last-child        { grid-column: 3 / span 2; }
  .mfa-card:nth-child(3n+1):nth-last-child(2) { grid-column: 2 / span 2; }
}
@media (min-width: 1028px) and (max-width: 1257px) {
  .mfa-grid { grid-template-columns: repeat(8, 1fr); }
  .mfa-card:nth-child(4n+1):last-child        { grid-column: 4 / span 2; }
  .mfa-card:nth-child(4n+1):nth-last-child(2) { grid-column: 3 / span 2; }
  .mfa-card:nth-child(4n+1):nth-last-child(3) { grid-column: 2 / span 2; }
}

.team-join {
  background: var(--white); border: 2px dashed var(--green-mid);
  border-radius: var(--radius-lg); padding: var(--content-gap) 40px;
  text-align: center; margin-top: 56px;
}
.team-join h2 { margin-bottom: var(--space-3); }
.team-join p { max-width: 520px; margin: 0 auto var(--space-5); }


/* =====================================================================
   TERMINE (termine.html)
   ===================================================================== */
.termine-cta-box {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  border-radius: var(--radius-lg); padding: var(--content-gap) 40px;
  color: #fff; text-align: center;
  scroll-margin-top: calc(var(--header-h) + var(--space-4));
}
.termine-cta-box h2 { color: #fff; margin-bottom: 14px; }
.termine-cta-box p {
  color: rgba(255,255,255,.85); margin-bottom: 28px;
  max-width: 480px; margin-left: auto; margin-right: auto;
}
.termine-cta-icon {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
}
.termine-cta-icon svg {
  color: rgba(255,255,255,.85);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--card-padding); }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.termin-option {
  background: var(--white); border-radius: var(--radius-lg); padding: 36px;
  border: 1px solid var(--border);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.termin-option:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.termin-option h3 { margin-bottom: var(--space-2); font-size: 1.2rem; }
.termin-option p { font-size: .9rem; margin-bottom: var(--space-4); }
.termin-option ul { margin-bottom: var(--space-4); padding-left: 20px; }
.termin-option li { font-size: .88rem; color: var(--text-light); margin-bottom: 6px; list-style: disc; }

.info-box {
  background: #fff8e1; border: 1px solid #ffe082; border-radius: var(--radius);
  padding: var(--space-4) 20px; font-size: .88rem; color: #5c4a00;
  margin-bottom: 28px;
}
.info-box strong { color: #3a2e00; }

.rezept-box {
  background: var(--white); border-radius: var(--radius-lg); padding: var(--card-padding);
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.rezept-box h3 { margin-bottom: var(--space-3); }
.rezept-steps { display: flex; flex-direction: column; gap: 14px; margin-top: var(--space-4); }
.rezept-step { display: flex; align-items: flex-start; gap: 14px; }
.step-num {
  width: 30px; height: 30px; min-width: 30px;
  background: rgba(255,255,255,.25); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 700;
}
.step-text { font-size: .9rem; color: rgba(255,255,255,.9); padding-top: var(--space-1); }

.app-store-badges { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: 20px; }
.app-badge {
  background: var(--text); color: #fff; border-radius: 10px;
  padding: 10px 18px; font-size: .82rem;
  display: flex; align-items: center; gap: 10px;
  transition: background var(--transition-base);
}
.app-badge:hover { background: var(--green-dark); }
.app-badge .ab-icon { font-size: 1.4rem; }
.app-badge small { display: block; font-size: .65rem; opacity: .7; }

.contact-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: var(--content-gap); }
@media (max-width: 768px) { .contact-row { grid-template-columns: 1fr; } }
.contact-item {
  display: flex; align-items: flex-start; gap: var(--space-4);
  background: var(--white); border-radius: var(--radius); padding: var(--space-5);
  border: 1px solid var(--border);
}
.ci-icon {
  width: 44px; height: 44px; min-width: 44px;
  background: var(--accent); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; color: var(--green-mid);
}
.ci-icon svg { width: 22px; height: 22px; }
.contact-item h4 { font-size: .9rem; margin-bottom: var(--space-1); }
.contact-item p { font-size: .85rem; }

.testimonial {
  background: var(--bg-section); border-radius: var(--radius-lg);
  padding: 40px; text-align: center; margin-top: 60px;
}
.testimonial blockquote {
  font-family: 'Playfair Display', serif; font-size: 1.1rem; font-style: italic;
  color: var(--text); max-width: 580px; margin: 0 auto; line-height: 1.8;
}
.testimonial cite {
  display: block; margin-top: var(--space-4); font-size: .85rem;
  color: var(--text-light); font-style: normal;
}
.stars { color: #f4b942; font-size: 1.2rem; margin-bottom: var(--space-4); }


/* =====================================================================
   KONTAKT (kontakt.html)
   ===================================================================== */
.kontakt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.kontakt-grid > div { display: flex; flex-direction: column; }
/* height:100% (Basisregel) wuerde hier zur Spaltenhoehe *plus* margin-top
   addieren und die rechte Spalte ueberlaufen lassen – deshalb auf auto. */
.kontakt-grid .sprechzeiten-mini { flex: 1; height: auto; display: flex; flex-direction: column; justify-content: space-between; }
/* Notfall-Kasten fuellt die Resthoehe der linken Spalte, damit er unten
   buendig mit den Sprechzeiten der rechten Spalte abschliesst. */
.kontakt-grid .notfall-card { flex: 1; }
@media (max-width: 900px) {
  .kontakt-grid { grid-template-columns: 1fr; }
  .kontakt-grid .notfall-card { flex: 0 0 auto; }
}
.kontakt-info-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 36px;
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.kontakt-info-card h2 { margin-bottom: var(--space-5); }
.kontakt-row {
  display: flex; align-items: flex-start; gap: var(--space-4);
  padding: var(--space-4) 0; border-bottom: 1px solid var(--border);
}
.kontakt-row:last-child { border-bottom: none; }
.kontakt-row h4 { font-size: .85rem; margin-bottom: var(--space-1); }
.kontakt-row p, .kontakt-row a { font-size: .9rem; color: var(--text-light); }
.kontakt-row a:hover { color: var(--green-mid); }

.notfall-card {
  background: var(--notdienst); border-radius: var(--radius-lg);
  padding: var(--card-padding); color: #fff; margin-top: var(--space-5);
  /* Inhalt verteilt sich ueber die Kastenhoehe, damit der gestreckte
     Kasten nicht unten leer wirkt. */
  display: flex; flex-direction: column; justify-content: space-between;
  gap: var(--space-5);
}
.notfall-card h3 { color: #fff; margin-bottom: 0; }
.notfall-card p  { color: rgba(255,255,255,.85); font-size: .9rem; }
.notfall-card a  { color: #fff; font-weight: 700; font-size: 1.2rem; display: inline-block; }
.notfall-block a { margin-top: var(--space-2); }

.sprechzeiten-mini {
  background: var(--white); border-radius: var(--radius-lg); padding: 36px;
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
  height: 100%; box-sizing: border-box;
}
.sprechzeiten-mini h3 { margin-bottom: 20px; }


/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer {
  background: var(--green-dark); color: rgba(255,255,255,.95);
  /* Unten Platz fuer den fixierten Notdienst-Button: er sitzt 28px ueber dem
     Fensterrand und ist rund 46px hoch. Ohne diese Reserve liegt er am
     Seitenende genau auf Impressum/Datenschutz – die Links waren dadurch
     zwischen 768px und 1440px gar nicht anklickbar. */
  padding: 60px 0 var(--space-12);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--content-gap); margin-bottom: 40px; }
.footer-brand h3 { color: #fff; font-size: 1.2rem; margin-bottom: 10px; }
.footer-brand p { font-size: .88rem; line-height: 1.8; color: rgba(255,255,255,.85); }
.footer-col h4 {
  color: #fff; font-size: .85rem; letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: var(--space-4);
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col ul li a {
  font-size: .88rem; color: rgba(255,255,255,.85);
  transition: color var(--transition-fast);
}
.footer-col ul li a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15); padding-top: var(--space-5);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--space-3);
}
.footer-bottom--minimal { border-top: none; padding-top: 0; }
.footer-bottom p { font-size: var(--text-sm); color: rgba(255,255,255,.65); }
.footer-bottom a { font-size: var(--text-sm); color: rgba(255,255,255,.72); text-decoration: underline; transition: color var(--transition-fast); }
.footer-bottom a:hover { color: #fff; }


/* =====================================================================
   RECHTSSEITEN (impressum.html, datenschutz.html)
   ===================================================================== */
.legal { max-width: 760px; }
.legal h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}
.legal h2:first-child { margin-top: 0; }
.legal h3 { margin-top: var(--space-5); margin-bottom: var(--space-2); }
.legal p { font-size: .95rem; margin-bottom: var(--space-3); }
.legal a { color: var(--green-mid); text-decoration: underline; }
.legal a:hover { color: var(--green-dark); }

.legal-list {
  list-style: disc; padding-left: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-2);
  margin-bottom: var(--space-4);
  color: var(--text-light); font-size: .95rem;
}
.legal-list ul { list-style: circle; padding-left: var(--space-4); margin-top: var(--space-2); }

.legal-table {
  width: 100%; border-collapse: collapse; margin-bottom: var(--space-4);
}
.legal-table th, .legal-table td {
  text-align: left; vertical-align: top;
  padding: var(--space-3) var(--space-3) var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}
.legal-table th {
  font-family: 'Inter', sans-serif; font-weight: 600;
  color: var(--green-heading); width: 34%;
}
.legal-table td { color: var(--text-light); }
@media (max-width: 600px) {
  .legal-table th, .legal-table td { display: block; width: 100%; border-bottom: none; }
  .legal-table th { padding-bottom: var(--space-1); }
  .legal-table td { padding-top: 0; border-bottom: 1px solid var(--border); }
}

/* Hervorgehobener Kasten, z.B. Widerspruchsrecht nach Art. 21 DSGVO */
.legal-callout {
  background: var(--accent); border-left: 4px solid var(--green-mid);
  border-radius: var(--radius-md);
  padding: var(--space-5); margin: var(--space-5) 0;
}
.legal-callout h3 { margin-top: 0; }
.legal-callout p:last-child { margin-bottom: 0; }

/* Interner Arbeitshinweis – vor Veroeffentlichung entfernen */
.legal-hint {
  background: #fff8e1; border: 1px solid #ffe082;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5); margin-bottom: var(--space-6);
}
.legal-hint p { color: #5c4a00; margin-bottom: 0; font-size: .88rem; }

.legal-hr { border: none; border-top: 1px solid var(--border); margin: var(--space-8) 0 var(--space-5); }
.legal-meta { font-size: var(--text-sm); color: var(--text-light); }


/* =====================================================================
   SECTION LABELS
   ===================================================================== */
.section-label {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--green-mid);
  margin-bottom: var(--space-3);
  position: relative;
}


/* =====================================================================
   UTILITY CLASSES
   ===================================================================== */
.text-center { text-align: center; }
.text-narrow { max-width: 540px; }
.mt-8  { margin-top: var(--space-2); }
.mt-16 { margin-top: var(--space-4); }
.mt-24 { margin-top: var(--space-5); }
.mt-40 { margin-top: 40px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--card-gap); }
.link-accent { color: var(--green-mid); font-weight: 600; }
.link-accent:hover { color: var(--green-dark); }


/* =====================================================================
   SVG ICONS
   ===================================================================== */
.icon {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon svg {
  stroke: currentColor; fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

/* Kontakt Icon (§ Bug-Fix: .ki = .kontakt-icon) */
.ki {
  width: 40px; height: 40px; min-width: 40px;
  background: var(--accent); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--green-mid);
}
.ki svg { width: 20px; height: 20px; }

/* Map info icon */
.mi-icon { font-size: 1.4rem; margin-bottom: 10px; display: flex; color: var(--green-mid); }
.mi-icon svg { width: 28px; height: 28px; }


/* =====================================================================
   RESPONSIVE
   ===================================================================== */
/* --- Tablet quer: Navigation wird eng, Abstaende schrumpfen ---------------- */
@media (max-width: 1024px) {
  :root { --section-gap: 5rem; }
  .nav-inner { padding: var(--space-5) var(--space-4) 18px; }
  .nav-link { padding: var(--space-2) 10px; font-size: .8rem; }
  .nav-notdienst { padding: var(--space-2) 12px; font-size: .72rem; }
  .nav-logo img { height: 44px; }
}

/* --- Tablet hoch: zweispaltige Layouts brechen um ------------------------- */
@media (max-width: 900px) {
  .grid-2, .footer-grid, .grid-3 { grid-template-columns: 1fr; }
  .map-info-grid { grid-template-columns: 1fr; }
  .termine-grid { grid-template-columns: 1fr; }
  .grid-2 { gap: var(--space-6); }
  .footer-grid { gap: var(--space-6); }
}

/* --- Hamburger uebernimmt -------------------------------------------------
   Gemessen: die Desktop-Leiste (6 Links + einzeilige Notdienst-Pille +
   zweizeiliges Logo) braucht 940px. Darunter bricht erst der Praxisname,
   dann die Pille um – das betraf vor allem Handys im Querformat
   (z.B. Pixel 5 quer = 802px). */
@media (max-width: 939px) {
  .nav-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .nav-left, .nav-right { display: none; }
  .hamburger { display: flex; }

  /* Logo linksbuendig statt zentriert, sonst kollidiert es mit dem Burger.
     min-width:0 in der ganzen Kette, damit der Praxisname bei grosser
     Schrift umbrechen darf statt den Header aufzublaehen. */
  .nav-logo { text-align: left; justify-self: start; min-width: 0; }
  .nav-logo > a { min-width: 0; }
  .nav-logo-text { text-align: left; min-width: 0; }
}

@media (min-width: 940px) {
  .mobile-nav { display: none !important; }
}

/* --- Mobile: Abstaende und Typo schrumpfen ------------------------------- */
@media (max-width: 768px) {
  /* Fallback ohne JS – js/layout.js misst den echten Wert */
  :root { --header-h: 76px; --section-gap: 3.5rem; }

  .nav-inner { padding: var(--space-3) var(--space-4); }
  .nav-logo img { height: 34px; }
  .nav-logo-text { font-size: .82rem; line-height: 1.25; }
  .nav-logo-text span { font-size: .58rem; letter-spacing: .06em; }

  /* Der Abstand zum fixierten Header gehoert an den Flex-Container, nicht an
     das zentrierte Kind: wegen align-items:center wuerde ein padding-top am
     .hero-content den Inhalt nur um die Haelfte nach unten schieben. Auf
     niedrigen Viewports (Android mit URL-Leiste) rutschte der Badge dadurch
     bis auf ~10px an den halbtransparenten Header heran. */
  .hero {
    min-height: 92vh; min-height: 92svh;
    padding-top: calc(var(--header-h) + var(--space-5));
    padding-bottom: 110px;
  }
  .hero-content { padding-top: 0; }
  .hero p { margin-bottom: var(--space-6); }
  .hero-scroll { bottom: var(--space-6); }

  .page-hero { padding: 40px 0 36px; }
  .termine-cta-box { padding: var(--card-padding) var(--space-5); }
  .section { padding: 56px 0; }
  .section-sm { padding: var(--space-6) 0; }

}


/* =====================================================================
   FILTER-TABS (leistungen.html) – schmale Viewports
   Ab 800px passen die drei Pillen in eine Zeile; darunter brechen sie
   ungleich um. Deshalb hier: "Alle Leistungen" ueber die volle Breite,
   darunter die beiden Kassenart-Filter exakt gleich gross (flex-basis 0
   + grow 1, damit die unterschiedlich langen Beschriftungen die Breite
   nicht auseinanderziehen).
   ===================================================================== */
@media (max-width: 799px) {
  .kassenart-tabs {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
  }
  .kassenart-tab {
    width: 100%;
    text-align: center;
    min-height: 44px;
    padding: var(--space-2) var(--space-3);
    font-size: .8rem;
    line-height: 1.3;
  }
  /* Die beiden Kassenart-Filter stehen untereinander, linksbuendig und
     gleich gross. Flacher und leichter gesetzt als "Alle Leistungen" –
     sie sind die Unterauswahl, nicht die Hauptaktion. 46px bleiben ueber
     der Mindestgroesse einer Tippflaeche (44px). */
  .kassenart-tab[data-filter="gkv"],
  .kassenart-tab[data-filter="pkv"] {
    width: 84%;
    min-height: 46px;
    font-weight: 500;
  }
}

/* Auf schmalen Telefonen braucht "Gesetzliche Leistungen / Grundleistungen"
   mehr Platz, als die Pille bietet. Ohne diese Anpassung bricht nur dieser
   eine Filter zweizeilig um und waere dann hoeher als der andere – die
   beiden sollen aber gleich gross bleiben. */
@media (max-width: 374px) {
  .kassenart-tab { font-size: .69rem; }
}


/* =====================================================================
   ANIMATIONS (§8)
   ===================================================================== */

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s var(--ease-premium),
              transform 0.65s var(--ease-premium);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children (cards in a grid) */
.reveal-grid > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s var(--ease-premium),
              transform 0.55s var(--ease-premium);
}
.reveal-grid.visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(3) { transition-delay: 0.13s; opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(5) { transition-delay: 0.33s; opacity: 1; transform: translateY(0); }
.reveal-grid.visible > *:nth-child(6) { transition-delay: 0.40s; opacity: 1; transform: translateY(0); }

/* Hero text fade-in on load */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-badge      { animation: heroFadeUp .7s var(--ease-premium) forwards; animation-delay: .1s; opacity: 0; }
.hero-content h1 { animation: heroFadeUp .7s var(--ease-premium) forwards; animation-delay: .25s; opacity: 0; }
.hero-content p  { animation: heroFadeUp .7s var(--ease-premium) forwards; animation-delay: .4s; opacity: 0; }
.hero-cta        { animation: heroFadeUp .7s var(--ease-premium) forwards; animation-delay: .55s; opacity: 0; }

/* Page-hero text animation */
.page-hero .section-label { animation: heroFadeUp .6s var(--ease-premium) forwards; opacity: 0; animation-delay: .1s; }
.page-hero h1             { animation: heroFadeUp .6s var(--ease-premium) forwards; opacity: 0; animation-delay: .22s; }
.page-hero p              { animation: heroFadeUp .6s var(--ease-premium) forwards; opacity: 0; animation-delay: .36s; }

/* Smooth scroll */
html { scroll-behavior: smooth; }


/* =====================================================================
   MOBILE TWEAKS (≤ 600px)
   ===================================================================== */
@media (max-width: 600px) {
  /* Container-Padding */
  .container { padding: 0 var(--space-4); }

  /* Silbentrennung in schmalen Spalten: harte Umbrueche mitten im Wort
     werden so zu sauberen Trennstrichen (lang="de" liefert das Woerterbuch) */
  p, li, .mfa-role, .mfa-tag, .role, .bio-value, .wt,
  .anfahrt-card h3, .quick-link-card h4, .leistung-tag {
    hyphens: auto;
    -webkit-hyphens: auto;
  }

  /* --- Notdienst-Float kleiner, nie breiter als der Viewport --- */
  .notdienst-float {
    padding: var(--space-2) 14px;
    font-size: .78rem;
    gap: 7px;
    bottom: var(--space-4);
    right: var(--space-4);
    max-width: calc(100vw - 2 * var(--space-4));
  }
  .notdienst-float .nd-svg { width: 14px; height: 14px; }
  /* Float sitzt hier tiefer (bottom 16px) – oben darf der Footer knapper sein */
  .site-footer { padding: 44px 0 var(--space-10); }

  /* --- Buttons: volle Trefferflaeche --- */
  .btn { min-height: 44px; padding: var(--space-3) var(--space-5); }

  /* --- Leistungs-Cards: 2 Spalten auf Mobile --- */
  .leistungen-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: var(--space-3);
  }
  .leistung-card {
    padding: 20px 14px 18px;
  }
  .leistung-icon {
    width: 40px; height: 40px; margin-bottom: var(--space-4);
  }
  .leistung-icon svg { width: 20px; height: 20px; }
  .leistung-card h3 { font-size: var(--text-base); margin-bottom: var(--space-2); }
  .leistung-card p  { font-size: var(--text-sm); }
  .leistung-tag { margin-top: 14px; display: inline-block; }

  /* --- Anfahrt-Grid: 2 Spalten, kompakt --- */
  .anfahrt-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
    margin-left: 0;
    margin-right: 0;
  }
  .anfahrt-card {
    padding: var(--space-4) 14px;
  }
  .anfahrt-card h3 { font-size: .88rem; margin-bottom: var(--space-2); }
  .anfahrt-card p, .anfahrt-card li { font-size: .84rem; line-height: 1.55; }
  .anfahrt-card ul { gap: 5px; margin-top: var(--space-2); }
  .mi-icon svg { width: 22px; height: 22px; }
  .mi-icon { margin-bottom: var(--space-2); }

  /* --- Buttons: einheitliche Anordnung – auf dem Handy stehen alle
         Button-Gruppen untereinander und gleich breit, statt zwei
         verschieden grosse Pillen nebeneinander --- */
  .hero-cta { flex-direction: column; align-items: stretch; width: 100%; }
  .hero-cta .btn { justify-content: center; width: 100%; }
  .btn-group { flex-direction: column; align-items: stretch; }
  .btn-group .btn { justify-content: center; }
  .app-store-badges { flex-direction: column; align-items: stretch; }
  .app-badge { justify-content: center; }

  /* --- Grosse Karten-Paddings zuruecknehmen: 36–44px fressen auf
         360px-Screens die Haelfte der Textbreite --- */
  .sprechzeiten-card,
  .sprechzeiten-mini,
  .kontakt-info-card { padding: var(--space-5) var(--space-4); }
  .rezept-box       { padding: var(--space-5) var(--space-4); }
  .termin-option    { padding: var(--space-5) var(--space-4); }
  .leistung-detail  { padding: var(--space-5) var(--space-4); gap: var(--space-5); }
  .aktuelles-box    { padding: var(--space-5) var(--space-4); }
  .termine-cta-box  { padding: var(--space-6) var(--space-4); }
  .testimonial      { padding: var(--space-6) var(--space-4); margin-top: 40px; }
  .azubi-section    { padding: var(--space-5) var(--space-4); margin-top: 40px; }
  .team-join        { padding: var(--space-6) var(--space-4); margin-top: 40px; }
  .notfall-card     { padding: var(--space-5) var(--space-4); }
  .modal-box        { padding: var(--space-6) var(--space-4) var(--space-5); }
  .philosophy       { padding: var(--space-6) var(--space-4); }

  /* --- Sprechzeiten-Tabelle: schmalere Tag-Spalte, damit die Uhrzeiten
         in eine Zeile passen --- */
  .sz-table th { width: 42px; font-size: .86rem; }
  .sz-table td { font-size: .86rem; }
  .sz-table th, .sz-table td { padding: var(--space-2) 0; }
  .sz-note { padding: var(--space-3); font-size: .82rem; }

  /* --- Medien: feste Pixelhoehen auf Mobile-Mass bringen --- */
  .map-wrapper { height: 280px; }
  /* Der Einwilligungs-Platzhalter liegt absolut im Kartenrahmen – bei
     Standard-Padding passt sein Text dort nicht mehr hinein */
  .embed-placeholder { padding: var(--space-4); gap: var(--space-2); }
  .embed-placeholder h3 { font-size: 1.05rem; }
  .embed-placeholder p { font-size: .82rem; }
  .embed-placeholder .embed-note { font-size: .74rem; }
  .inline-image img,
  .inline-image-placeholder { height: 220px; }
  .booking-wrapper { margin-top: var(--space-6); }

  /* --- Team & MFA --- */
  .team-info { padding: var(--space-5) var(--space-4); }
  .bio-row .bio-label,
  .bio-werdegang li .wj { min-width: 74px; }

  /* MFA-Karten: versetzter Stapel statt gleichfoermiger Spalte.
     Links beginnen, dann alternierend rechts/links, mit leichter
     Ueberschneidung – die spaetere Karte liegt oben (DOM-Reihenfolge,
     position:relative genuegt). Der Schatten macht die Ueberlappung
     als bewusste Staffelung lesbar. */
  .mfa-grid { grid-template-columns: 1fr; gap: 0; }
  .mfa-card {
    position: relative;
    width: 86%;
    padding: var(--space-5) var(--space-4);
    box-shadow: 0 12px 28px rgba(45, 90, 61, .10), 0 2px 8px rgba(45, 90, 61, .06);
  }
  .mfa-card:nth-child(odd)  { justify-self: start; }
  .mfa-card:nth-child(even) { justify-self: end; }
  /* Angedeutete Ueberschneidung: bei -22px klebten die Karten aufeinander,
     bei -8px stand der Stapel zu locker */
  .mfa-card + .mfa-card { margin-top: -14px; }
  .mfa-photo { width: 84px; height: 84px; }
  .mfa-card h4 { font-size: .92rem; }
  .mfa-role { font-size: .74rem; }
  .mfa-since { font-size: .74rem; margin-bottom: 10px; }

  /* --- Footer --- */
  .footer-bottom {
    flex-direction: column; align-items: flex-start; gap: var(--space-3);
  }
  .footer-col ul li a { display: inline-block; padding: var(--space-1) 0; }

  /* --- Rechtsseiten --- */
  .legal h2 { margin-top: var(--space-6); }
}


/* =====================================================================
   MOBILE TWEAKS (≤ 480px) – Standard-Smartphone hoch
   ===================================================================== */
@media (max-width: 480px) {
  :root { --section-gap: 2.75rem; }
  .section { padding: 44px 0; }

  .hero p { font-size: 1rem; }

  /* Quick-Links kompakter, bleiben zweispaltig */
  .quick-links { gap: var(--space-3); }
  .quick-link-card { padding: var(--space-5) var(--space-3); }
  .ql-icon { width: 46px; height: 46px; border-radius: 12px; }
  .ql-icon svg { width: 22px; height: 22px; }
  .quick-link-card h4 { font-size: .86rem; }
  .quick-link-card p { font-size: .74rem; }

  .two-col { gap: var(--space-4) !important; }
  .aktuelles-grid { gap: var(--space-6); }
  .praxis-item figcaption { font-size: .88rem; margin-top: var(--space-2); }
  .testimonial blockquote { font-size: 1rem; line-height: 1.7; }
}


/* =====================================================================
   MOBILE TWEAKS (≤ 340px) – sehr kleine Geraete (iPhone SE 1. Gen.)
   Bewusst erst hier, damit die zweispaltigen Karten auf den ueblichen
   360/375px-Telefonen erhalten bleiben.
   ===================================================================== */
@media (max-width: 340px) {
  .container { padding: 0 var(--space-3); }
  .nav-logo img { height: 28px; }
  .nav-logo-text { font-size: .74rem; }
  .nav-logo > a { gap: 6px !important; }

  /* Ab hier reicht die Breite fuer zwei Spalten Fliesstext nicht mehr aus */
  .leistungen-grid { grid-template-columns: 1fr !important; }
  .anfahrt-grid { grid-template-columns: 1fr !important; }
  .quick-links { grid-template-columns: 1fr; }

  /* Die Filter-Pillen brauchen hier mehr Breite, sonst bricht die laengere
     Beschriftung um und die beiden waeren unterschiedlich hoch */
  .kassenart-tab[data-filter="gkv"],
  .kassenart-tab[data-filter="pkv"] { width: 94%; }

  /* Versetzter MFA-Stapel: weniger Versatz, sonst werden die Karten zu schmal */
  .mfa-card { width: 92%; }
  .mfa-card + .mfa-card { margin-top: -10px; }

  .hero-badge { font-size: .7rem; padding: 5px var(--space-3); }
  .notdienst-float { font-size: .72rem; padding: var(--space-2) 12px; }
  .sz-table th, .sz-table td { font-size: .8rem; }
}


/* =====================================================================
   SMARTPHONE QUER – wenig Hoehe, viel Breite
   ===================================================================== */
@media (orientation: landscape) and (max-height: 520px) {
  /* 100svh waeren hier nur ~350px – zu wenig fuer Badge, H1, Text und CTAs */
  .hero {
    min-height: 520px;
    padding-top: calc(var(--header-h) + var(--space-3));
    padding-bottom: 90px;
  }
  .hero-content { padding-top: 0; }
  .mobile-nav { max-height: calc(100svh - 70px); }
}


/* =====================================================================
   TOUCH-GERAETE – Trefferflaechen (WCAG 2.5.5: mindestens 44x44px)
   Breitenunabhaengig, damit auch Tablets mit Touch profitieren.
   ===================================================================== */
@media (hover: none) {
  .btn,
  .kassenart-tab,
  .modal-footer button { min-height: 44px; }

  .skip-link { min-height: 44px; display: inline-flex; align-items: center; }

  /* Notdienst-Float ist das wichtigste Element im Notfall – der darf
     nicht die kleinste Schaltflaeche der Seite sein */
  .notdienst-float { min-height: 44px; }

  /* Notfallnummern und Rechtslinks im Footer waren 22–32px hoch */
  .footer-col ul li a,
  .footer-bottom a,
  .notfall-card a {
    display: inline-flex; align-items: center;
    min-height: 44px;
  }
  .footer-col ul { gap: 0; }
}


/* =====================================================================
   TOUCH-GERAETE – Hover-Effekte bleiben sonst nach dem Tippen haengen
   ===================================================================== */
@media (hover: none) {
  .quick-link-card:hover,
  .leistung-card:hover,
  .team-card:hover,
  .termin-option:hover,
  .mfa-card:hover,
  .btn-primary:hover,
  .btn-white:hover,
  .nav-notdienst:hover,
  .notdienst-float:hover { transform: none; }

  .quick-link-card:hover .ql-icon { transform: none; }
  .leistung-detail:hover .leistung-detail-img img,
  .praxis-item:hover .praxis-frame img,
  .inline-image:hover img,
  .image-tile:hover img,
  .team-card:hover .team-photo img { transform: none; }
}
