/* heplano.com — Marketing-Website (Master-Prompt §8/§16/§30/§31) */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Lange, unteilbare deutsche Komposita (z.B. "Baustellendokumentation")
     sprengten auf schmalen Viewports sonst ihre Grid-/Flex-Container, weil
     ein einzelnes Wort nicht umbrechen kann - overflow-x:hidden oben
     versteckte das dann als abgeschnittenen Text statt als Scrollbalken.
     overflow-wrap wird vererbt, deckt also auch Ueberschriften/Absaetze
     in allen Karten-Komponenten ab. */
  overflow-wrap: break-word;
}

/* Sperrt das Scrollen des Hintergrunds, solange die mobile Navigation
   geoeffnet ist. Ersetzt das frueher direkt gesetzte
   document.body.style.overflow (CSP: style-src ohne 'unsafe-inline').
   Bewusst als body.no-scroll notiert, damit die Regel die
   overflow-x: hidden-Kurzschreibweise oben zuverlaessig ueberstimmt. */
body.no-scroll { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 {
  line-height: var(--lh-tight);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: var(--font-display);
  text-wrap: balance;
}
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

/* Focus visibility (§31) */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--fs-base);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
/* Inline-Icon links vom Button-Label. Ersetzt das frühere
   style="margin-right:6px" am <svg> (CSP: style-src ohne 'unsafe-inline'). */
.btn__icon { margin-right: 6px; }
.btn-primary {
  /* Nochmals dunkler (Nutzer-Feedback 2026-09-18): --color-primary allein
     wirkte als flache Flaeche zu grell, --color-primary-dark noch immer
     zu hell. Ruhezustand jetzt --color-primary-darker, Hover hellt
     stufenweise auf statt zu verdunkeln. */
  background: var(--color-primary-darker);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  border-color: var(--color-text);
  transform: translateY(-1px);
}
.btn-store {
  background: var(--color-text);
  color: var(--color-bg);
}
.btn-store[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-block { width: 100%; }
.btn-lg { padding: 1rem 1.75rem; font-size: var(--fs-lg); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  font-weight: 800;
  font-size: var(--fs-lg);
  color: var(--color-text);
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }

.nav-desktop {
  display: none;
}
.nav-desktop ul {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav-desktop a {
  text-decoration: none;
  font-weight: 500;
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  transition: color var(--transition-fast);
}
.nav-desktop a:hover { color: var(--color-text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
/* Unter ~430px sprengte der Header (Logo + Sprachauswahl + CTA + Menü)
   knapp die Viewportbreite (horizontales Scrollen, §16 verbietet das
   ausdrücklich). Die CTA steht auf schmalen Bildschirmen bereits groß im
   aufklappenden Mobile-Menü zur Verfügung, daher hier ausgeblendet statt
   verkleinert. */
@media (max-width: 430px) {
  .header-actions__cta { display: none; }
  .header-actions { gap: var(--space-2); }
}

.lang-switch {
  position: relative;
}
.lang-switch__button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.9rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.lang-switch__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: var(--space-2);
  display: none;
  max-height: 70vh;
  overflow-y: auto;
}
.lang-switch[data-open="true"] .lang-switch__menu { display: block; }
.lang-switch__menu a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--fs-sm);
}
.lang-switch__menu a:hover,
.lang-switch__menu a[aria-current="true"] {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.menu-toggle {
  display: inline-flex;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  color: var(--color-text);
}

.nav-mobile {
  display: none;
  position: fixed;
  inset: var(--header-height) 0 0 0;
  background: var(--color-bg);
  z-index: 90;
  overflow-y: auto;
  padding: var(--space-6) var(--space-5);
}
.nav-mobile[data-open="true"] { display: block; }
.nav-mobile ul { display: flex; flex-direction: column; gap: var(--space-2); }
.nav-mobile a {
  display: block;
  padding: var(--space-4);
  font-size: var(--fs-xl);
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}
.nav-mobile .btn { margin-top: var(--space-6); }

/* ---------- Hero ----------
   Foto-Hintergrund (Platzhalter-Illustration statt Stockfoto, siehe
   Abschlussreport) mit dunklem Verlauf links für Textlesbarkeit (§9). */
.hero {
  position: relative;
  padding: var(--space-9) 0 0;
  overflow: hidden;
  background: var(--color-navy);
  color: #fff;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background: var(--hero-illustration);
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-8);
  padding-bottom: var(--space-8);
}
.hero__breadcrumb {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  text-decoration: none;
}
.hero__breadcrumb:hover {
  text-decoration: underline;
}
.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.eyebrow a {
  color: inherit;
  text-decoration: none;
}
.eyebrow a:hover {
  text-decoration: underline;
}
.eyebrow-suffix {
  display: inline-block;
  font-size: 0.65em;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-danger);
  margin-left: 0.4em;
  vertical-align: middle;
}
.status-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--radius-pill);
  padding: 3px var(--space-3);
}
/* Bewusst eine deckende (nicht transluzente) Farbe: dieses Badge erscheint
   sowohl auf dem dunklen Hero-Hintergrund als auch auf der hellen
   Pricing-Card - eine deckende Farbe haelt den Kontrast in beiden Faellen
   hoch, ohne zwei Varianten pflegen zu muessen. Bewusst warm/auffaellig
   (nicht neutral-grau), damit es neben dem orangenen "Jetzt kaufen"-Button
   nicht uebersehen wird (siehe usability-Review vor Launch). */
.status-badge--soon {
  margin: var(--space-3) 0;
  color: #2a1a08;
  background: #d9a46a;
  border: 1px solid #c08a4e;
}
.pricing-card__status-badge { margin-bottom: var(--space-3); }
.hero__headline {
  font-size: clamp(2.2rem, 6vw, var(--fs-5xl));
  line-height: 1.03;
  margin-bottom: var(--space-5);
  max-width: 16ch;
}
.hero__headline .accent { color: var(--color-primary); }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero__headline .accent {
    background: linear-gradient(135deg, #ffb27a, var(--color-primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.hero__sub {
  font-size: var(--fs-lg);
  color: rgba(255, 255, 255, 0.82);
  max-width: 46ch;
  margin-bottom: var(--space-6);
}
/* Sichtbares Aktualitaets-Signal (SEO/GEO-Ausbau 2026-09-20): zeigt das
   Datum der letzten inhaltlichen Aenderung direkt im Hero, analog zum
   "Stand: ..." auf den Rechtstexten. :empty blendet die Zeile aus, falls
   {{LAST_UPDATED}} fuer eine Seite mal leer bliebe. */
.hero__updated {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--space-6);
}
.hero__updated:empty { display: none; }
/* Deutlich sichtbarer Hinweis (nicht als kleine Fussnote), damit
   interessierte Nutzer sofort sehen, dass HEPLANO Rechnung nur fuer
   deutsche Unternehmen gedacht ist - bewusst direkt im Hero statt erst
   im Preisbereich weiter unten (Nutzer-Feedback 2026-09-18). Bei Apps
   ohne diese Einschraenkung (z.B. HEPLANO Build) ist der Locale-Wert
   leer, ":empty" blendet den Absatz dann komplett aus. */
.hero__availability-note {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 46ch;
  margin-bottom: var(--space-6);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.4;
}
.hero__availability-note::before {
  content: "🇩🇪";
  font-size: 1.1em;
  flex: none;
}
.hero__availability-note:empty {
  display: none;
}

.hero__chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-7);
  max-width: 620px;
}
.hero__chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.hero__chip .icon-badge {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: #fff;
  color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
}
.hero__chip .icon-badge svg { width: 16px; height: 16px; }

.hero__price-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.hero__price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-4xl);
  font-weight: 500;
  color: var(--color-primary);
}
.hero__price-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
}
.hero__price-subtext {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: var(--space-6);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-7);
}
.hero__actions .btn {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 0.7rem 1.4rem;
  line-height: 1.3;
}
.hero__actions .btn-sub {
  font-size: var(--fs-xs);
  font-weight: 400;
  opacity: 0.85;
}
.hero__actions .btn-secondary {
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-text);
  border-color: transparent;
}

.hero__mockup {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: var(--space-8);
}
.phone-frame {
  width: min(300px, 78vw);
  aspect-ratio: 375 / 780;
  border-radius: 44px;
  background: #0b0b0c;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  flex: none;
}
.phone-frame__screen {
  width: 100%;
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: var(--color-bg-elevated);
}
.phone-frame__screen iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
/* Nutzer-Feedback: statt eines "Demo-Modus"-Banners im (kleinen) Mockup
   selbst steht der Hinweis jetzt gut lesbar direkt daneben. */
.mockup-disclaimer {
  margin-top: var(--space-3);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--color-text-faint);
  max-width: 260px;
}
.mockup-disclaimer--dark {
  color: rgba(255, 255, 255, 0.6);
}

/* Foto-Hintergrund-Platzhalter: abstraktes Baustellen-Muster statt echtem
   Stockfoto (Master-Prompt §29: keine erfundenen Screenshots/Assets ohne
   Kennzeichnung – ein echtes, lizenziertes Foto ersetzt dies vor dem
   Launch, siehe Abschlussreport). */
:root {
  /* Basis-Verlauf 2026-09-18 abgedunkelt (Nutzer-Feedback: Hero wirkte zu
     hell/blau) - deutlich dunkler als vorher, konsistent mit den
     vertieften --color-navy/--color-navy-deep-Tokens. */
  --hero-illustration: repeating-linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.03) 0px,
      rgba(255, 255, 255, 0.03) 2px,
      transparent 2px,
      transparent 42px
    ),
    radial-gradient(circle at 82% 18%, rgba(232, 106, 44, 0.22), transparent 42%),
    radial-gradient(circle at 6% 92%, rgba(78, 140, 255, 0.1), transparent 48%),
    linear-gradient(160deg, #16283f, #0a1420 60%);
}

/* Reveal-on-scroll (§30). Progressive enhancement: content is fully
   visible by default; JS opts elements into the reveal animation via
   .reveal-pending so a failed/blocked script never hides content. */
[data-reveal].reveal-pending {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}
[data-reveal].reveal-pending.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal].reveal-pending { opacity: 1; transform: none; transition: none; }
}

/* ---------- Trust bar (im Hero, 4 reichhaltige Kacheln) ---------- */
.trust-bar {
  position: relative;
  z-index: 1;
  background: var(--color-navy-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.trust-bar ul {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  padding: var(--space-6) 0;
}
.trust-bar li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: #fff;
}
.trust-bar .icon-badge {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
}
.trust-bar .icon-badge svg { width: 18px; height: 18px; }
.trust-bar strong { display: block; font-size: var(--fs-sm); margin-bottom: 2px; }
.trust-bar span { font-size: var(--fs-xs); color: rgba(255, 255, 255, 0.65); }

@media (min-width: 640px) {
  .trust-bar ul { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .trust-bar ul { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Section shell ---------- */
.section { padding: var(--space-9) 0; }
.section-subtle { background: var(--color-bg-subtle); }
.section__head {
  max-width: 60ch;
  margin: 0 auto var(--space-7);
  text-align: center;
}
.section__title { font-size: var(--fs-2xl); margin-bottom: var(--space-3); }
.section__intro { color: var(--color-text-muted); font-size: var(--fs-lg); }

/* ---------- Features grid ---------- */
.feature-grid {
  display: grid;
  gap: 0 var(--space-8);
  grid-template-columns: 1fr;
}
.feature-card {
  background: transparent;
  border: none;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
  padding: var(--space-7) 0;
  box-shadow: none;
  transition: opacity var(--transition-base);
}
.feature-card:hover { opacity: 0.86; }
.feature-card__icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-5);
}
.feature-card__icon svg { width: 26px; height: 26px; }
.feature-card h3 { font-size: var(--fs-xl); margin-bottom: var(--space-3); }
.feature-card p { color: var(--color-text-muted); font-size: var(--fs-base); max-width: 34ch; }
/* Gestaffelte Reveal-Animation der Karten (zuvor als dynamisches
   style="transition-delay:…" aus build_pages.py/js/main.js erzeugt).
   Die Modifier werden serverseitig bzw. beim Client-Rendering nach
   Listenindex % 3 vergeben — identische Werte wie vorher.
   Selektor bewusst mit [data-reveal] kombiniert: [data-reveal].reveal-pending
   (weiter oben) setzt die transition-Kurzschreibweise und wuerde einen
   einfachen .feature-card--stagger-*-Selektor sonst ueberstimmen und die
   Verzoegerung auf 0 zuruecksetzen. */
[data-reveal].feature-card--stagger-0 { transition-delay: 0ms; }
[data-reveal].feature-card--stagger-1 { transition-delay: 60ms; }
[data-reveal].feature-card--stagger-2 { transition-delay: 120ms; }

/* ---------- App portfolio grid ---------- */
/* Die Portfolio-Karten nutzen bewusst das dunkle HEPLANO-App-Designsystem
   (identische Werte zu AppColors/AppTheme.dark() in
   heplano_theme/lib/src/theme.dart) statt der hellen Website-Tokens aus
   tokens.css — sie sollen wie ein Ausschnitt aus den tatsächlichen Apps
   wirken, unabhängig vom hellen/dunklen Farbschema der übrigen Seite.
   Korrektur 2026-09-14: kein Template bindet Fraunces/Inter per
   <link rel="stylesheet" ... fonts.googleapis.com> ein — die CSP blockt
   fonts.googleapis.com sogar aktiv (siehe .htaccess). Auch die Portfolio-
   Karten nutzen wie der Rest der Website ausschließlich den
   System-Schriftstapel, nur die Farb-/Designtokens weichen ab. */
.app-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}
.app-card {
  --hp-bg: #1b1f29;
  --hp-border: rgba(255, 255, 255, 0.08);
  --hp-accent: #c08a4e;
  --hp-accent-strong: #d9a46a;
  --hp-text: #f2efe9;
  --hp-text-muted: #9195a3;
  --hp-text-faint: #5c6070;
  --hp-success: #7fae93;
  --hp-success-soft: rgba(127, 174, 147, 0.15);
  --hp-soon: #d9a46a;
  --hp-soon-soft: rgba(217, 164, 106, 0.15);

  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
  background: var(--hp-bg);
  border: 1px solid var(--hp-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  font-family: 'Inter', var(--font-sans);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  /* Grid-Item von .app-grid (grid-template-columns: 1fr) - ohne min-width:0
     bleibt die Karte auf schmalen Viewports so breit wie ihr Inhalt
     (Icon + Textblock), siehe .area-tile weiter unten fuer denselben Fix. */
  min-width: 0;
}
/* Der unbenannte Textblock neben .app-card__icon (Markup: <img
   class="app-card__icon"><div>...</div>) ist ein Flex-Kind ohne eigene
   Klasse - braucht ebenfalls min-width:0, sonst verhindert sein
   Inhalts-Mindestbreite (z.B. das unteilbare Wort "Baustellendokumentation"
   in .app-card__tagline) das Schrumpfen der ganzen Karte. */
.app-card > div { min-width: 0; }
.app-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -12px rgba(192, 138, 78, 0.28);
  border-color: var(--hp-accent);
}
.app-card__icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.app-card__name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: var(--space-2);
  gap: var(--space-3);
  margin-bottom: var(--space-1);
}
.app-card__name {
  font-family: 'Fraunces', var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-xl);
  color: var(--hp-text);
}
.app-card__name-suffix {
  font-size: 0.55em;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hp-accent-strong);
  margin-left: 0.4em;
  vertical-align: middle;
}
.app-card__status {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--hp-success);
  background: var(--hp-success-soft);
  border-radius: var(--radius-pill);
  padding: 2px var(--space-3);
}
.app-card__status--soon {
  color: var(--hp-soon);
  background: var(--hp-soon-soft);
}
.app-card__tagline {
  font-size: var(--fs-sm);
  color: var(--hp-text-faint);
  margin-bottom: var(--space-3);
}
.app-card__desc {
  font-size: var(--fs-sm);
  color: var(--hp-text-muted);
  margin-bottom: var(--space-4);
}
.app-card__highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}
.app-card__highlights li {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--hp-text);
}
.app-card__highlights li::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hp-accent);
  transform: translateY(-2px);
}
.app-card__cta {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--hp-accent-strong);
}

/* ---------- Why section ---------- */
.why {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
/* Fliesstext unter der Why-Ueberschrift (ersetzt inline
   style="margin-top:12px;color:…;font-size:…"). */
.why__text {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--fs-lg);
}
.why blockquote {
  margin: var(--space-7) 0 0;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 600;
  padding: 0;
  border: none;
  text-align: center;
  background: none;
}

/* ---------- Trust section ---------- */
.trust-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
.trust-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
}
.trust-item__mark {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-success);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.trust-item h3 { font-size: var(--fs-base); margin-bottom: var(--space-1); }
.trust-item p { font-size: var(--fs-sm); color: var(--color-text-muted); }

/* ---------- Pricing ---------- */
.pricing-card {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  background: var(--color-navy);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  color: #fff;
}
.pricing-card__price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 500;
  color: #fff;
  margin: var(--space-4) 0 0;
}
.pricing-card__note {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
}
.pricing-card__subtext {
  margin: var(--space-3) 0 var(--space-7);
  color: rgba(255, 255, 255, 0.65);
}
.pricing-card__features {
  text-align: left;
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-7);
  max-width: 360px;
  margin-inline: auto;
}
.pricing-card__features li {
  display: flex;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.88);
}
.pricing-card__features li::before {
  content: "✓";
  color: var(--color-primary);
  font-weight: 700;
}
.pricing-card__ctas {
  display: grid;
  gap: var(--space-3);
}
.pricing-card__ctas .btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}
.pricing-card__ctas .btn-secondary:hover {
  border-color: #fff;
  color: #fff;
}
.pricing-card__ctas .btn-store {
  background: #fff;
  color: var(--color-navy-deep);
}
.pricing-card__license-note {
  margin-top: var(--space-5);
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.5);
}
.pricing-card__soon {
  margin-top: var(--space-2);
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}
.pricing-card__availability-note {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.pricing-card__availability-note:empty {
  display: none;
}

/* ---------- Sample report ---------- */
.sample-report { text-align: center; }
.sample-report__frame {
  position: relative;
  display: block;
  max-width: 640px;
  margin: 0 auto var(--space-5);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sample-report__frame:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 12px 28px rgba(232, 106, 44, 0.18);
}
.sample-report__frame img {
  display: block;
  width: 100%;
  height: auto;
}
.sample-report__zoom {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  padding: 6px 12px;
  border-radius: var(--radius-full, 999px);
  background: rgba(20, 20, 20, 0.72);
  color: #fff;
  font-size: var(--fs-sm);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.sample-report__frame:hover .sample-report__zoom,
.sample-report__frame:focus-visible .sample-report__zoom {
  opacity: 1;
  transform: translateY(0);
}
/* ---------- Apps ohne Demo (apps.json: "hasDemo": false) ----------
   Blendet Demo-Sektion, Hero-Mockup, den Demo-Link im Hero (der auch die
   primäre CTA ist – ohne Demo bleibt nur "Jetzt kaufen") sowie sämtliche
   Nav-/Footer-Verweise auf #demo aus, ohne das gemeinsame Template pro App
   verzweigen zu müssen. */
body[data-has-demo="false"] #demo,
body[data-has-demo="false"] .hero__mockup,
body[data-has-demo="false"] [data-demo-link],
body[data-has-demo="false"] .nav-desktop li:has(a[href="#demo"]),
body[data-has-demo="false"] .nav-mobile li:has(a[href="#demo"]),
body[data-has-demo="false"] .footer-col li:has(a[href="#demo"]) {
  display: none !important;
}

/* ---------- Apps ohne Beispiel-Bericht (apps.json: "hasSampleReport": false) ----------
   Die Bilder unter #sample-report sind fest auf die Baustellenbericht-
   Assets von heplano_build verdrahtet (Master-Prompt §29) — für andere
   Apps ohne eigenen echten Beispielbeleg falscher Inhalt, deshalb ausblenden
   statt eines irreführenden Platzhalters. */
body[data-has-sample-report="false"] #sample-report {
  display: none !important;
}

/* ---------- Demo section ----------
   Nutzer-Feedback: reines Weiß wirkte flach neben dem Phone-Mockup – ein
   dezenter, markenfarbener Glow im Hintergrund gibt der Demo mehr Tiefe. */
#demo.section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(232, 106, 44, 0.1), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(78, 140, 255, 0.08), transparent 45%),
    var(--color-bg);
}
.demo-section {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-6);
  align-items: center;
}
.demo-copy { text-align: center; }
/* Ueberschrift + Fliesstext der Demo-Sektion (ersetzen die frueheren
   inline styles margin-bottom:16px bzw. color/font-size/margin-bottom:20px). */
.demo-copy__title { margin-bottom: var(--space-4); }
.demo-copy__text {
  color: var(--color-text-muted);
  font-size: var(--fs-lg);
  margin-bottom: 20px;
}
.demo-banner {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: 700;
  margin-bottom: var(--space-4);
}
.demo-frame-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.demo-frame-wrap .phone-frame { width: min(340px, 84vw); box-shadow: var(--shadow-lg); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; display: grid; gap: var(--space-3); }
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  overflow: hidden;
}
.faq-item__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  background: none;
  border: 0;
  text-align: left;
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--color-text);
  cursor: pointer;
}
.faq-item__icon {
  flex: none;
  transition: transform var(--transition-base);
}
.faq-item[data-open="true"] .faq-item__icon { transform: rotate(45deg); }
.faq-item__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
}
.faq-item__a-inner { padding: 0 var(--space-5) var(--space-5); }
.faq-item[data-open="true"] .faq-item__a { max-height: 400px; }

/* ---------- Social proof placeholder ---------- */
.social-proof {
  text-align: center;
  color: var(--color-text-faint);
  font-style: italic;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

/* ---------- Final CTA ---------- */
.final-cta {
  text-align: center;
  background: linear-gradient(135deg, var(--color-navy), var(--color-navy-deep));
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-5);
  color: #fff;
}
.final-cta h2 { font-size: var(--fs-2xl); margin-bottom: var(--space-3); }
.final-cta p { opacity: 0.92; margin-bottom: var(--space-6); }
.final-cta .btn-primary { background: #fff; color: var(--color-primary-dark); box-shadow: none; }
.final-cta .btn-primary:hover { background: #fff0e8; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) 0 var(--space-6);
  background: var(--color-bg-subtle);
}
.footer-grid {
  display: grid;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.footer-brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 800; margin-bottom: var(--space-2); }
.footer-brand img { width: 28px; height: 28px; border-radius: 7px; }
.footer-tagline { color: var(--color-text-muted); font-size: var(--fs-sm); max-width: 32ch; }
.footer-col h3 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-faint); margin-bottom: var(--space-3); }
.footer-col ul { display: grid; gap: var(--space-2); }
.footer-col a { text-decoration: none; color: var(--color-text-muted); font-size: var(--fs-sm); }
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-xs);
  color: var(--color-text-faint);
}
.footer-bottom a { color: inherit; text-decoration: none; }
.footer-bottom a:hover { color: var(--color-primary); }

/* ---------- Legal placeholder pages ---------- */
.legal-page { padding: var(--space-9) 0; max-width: 760px; margin: 0 auto; }
.legal-page h1 { font-size: var(--fs-2xl); margin-bottom: var(--space-5); }
.legal-page .placeholder-box {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  color: var(--color-text-muted);
}
/* Abschliessender "Zurueck"-Absatz am Fuss jeder Legal-Seite
   (ersetzt inline style="margin-top:24px"). */
.legal-page__back-link { margin-top: var(--space-5); }

/* ---------- Responsive ---------- */
@media (min-width: 720px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); }
}

@media (min-width: 960px) {
  .nav-desktop { display: block; }
  .menu-toggle { display: none; }
  .hero__inner {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: end;
    padding-top: var(--space-6);
  }
  .hero__headline { max-width: 12ch; }
  .hero__chips { grid-template-columns: repeat(3, 1fr); }
  .demo-section { grid-template-columns: 1fr 1fr; text-align: left; }
  .demo-copy { text-align: left; }
}

@media (min-width: 720px) {
  .demo-frame-wrap .phone-frame { width: 300px; }
}

/* ---------- Content-/Rechner-Seiten (SEO-Werkzeugkasten-Umbau) ---------- */
.content-hero { padding: var(--space-7) 0; }
.content-hero .hero__bg { display: none; }
.content-hero .hero__inner { display: block; padding-bottom: 0; }
.content-hero .hero__headline { max-width: 30ch; }
.content-hero .hero__sub { max-width: 62ch; margin-bottom: 0; }

.content-body { max-width: 760px; }
.content-body h2 { font-size: var(--fs-xl); margin: var(--space-7) 0 var(--space-3); }
.content-body h3 { font-size: var(--fs-lg); margin: var(--space-6) 0 var(--space-2); }
.content-body p { margin-bottom: var(--space-4); }
.content-body ul, .content-body ol { list-style: disc; padding-left: 1.4em; margin-bottom: var(--space-4); }
.content-body ol { list-style: decimal; }

/* Links, die zu einer kostenpflichtigen HEPLANO-App fuehren (statt zu einem
   weiteren kostenlosen Rechner/Wissensartikel) - farblich hervorgehoben,
   damit sie im Fliesstext schneller auffallen als normale Links. */
.content-body a.link-app {
  color: var(--color-primary);
  font-weight: 700;
}
.content-body a.link-app::after {
  content: " \2192";
}

.example-table { width: 100%; border-collapse: collapse; margin: var(--space-5) 0; font-size: var(--fs-sm); }
.example-table th, .example-table td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border); }
.example-table tfoot td { font-weight: 700; border-top: 2px solid var(--color-text); border-bottom: none; }

.disclaimer-box { display: flex; gap: var(--space-3); background: var(--color-bg-subtle); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4); margin: var(--space-5) 0; font-size: var(--fs-sm); color: var(--color-text-muted); }
.disclaimer-box .icon-badge { flex: none; width: 22px; height: 22px; color: var(--color-primary-dark); }

.calc-form { background: var(--color-bg-elevated); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-md); margin: var(--space-5) 0; }
.calc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4) var(--space-5); }
.calc-field label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--space-1); }
.calc-field__input { position: relative; }
.calc-field__input input {
  width: 100%;
  padding: 0.7rem 2.6rem 0.7rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  background: var(--color-bg);
  color: var(--color-text);
}
.calc-field__input input:focus { border-color: var(--color-focus); }
.calc-field__input__unit { position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--color-text-faint); font-size: var(--fs-sm); pointer-events: none; }
.calc-field__hint { font-size: var(--fs-xs); color: var(--color-text-faint); margin-top: var(--space-1); }
.calc-field__error { font-size: var(--fs-xs); color: var(--color-danger); margin-top: var(--space-1); min-height: 1em; }
.calc-field[data-invalid="true"] .calc-field__input input { border-color: var(--color-danger); }
.calc-actions { margin-top: var(--space-5); display: flex; gap: var(--space-3); flex-wrap: wrap; }

.calc-result { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--color-border); }
.calc-result[hidden] { display: none; }
.calc-result__label { font-size: var(--fs-sm); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.calc-result__value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-4xl); font-weight: 500; color: var(--color-primary-dark); margin: var(--space-2) 0 var(--space-4); }
.calc-breakdown { display: flex; flex-direction: column; gap: var(--space-2); font-variant-numeric: tabular-nums; }
.calc-breakdown li { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--fs-sm); padding: var(--space-2) 0; border-bottom: 1px dashed var(--color-border); }
.calc-breakdown li:last-child { border-bottom: none; font-weight: 700; border-top: 2px solid var(--color-text); padding-top: var(--space-3); }
.calc-result__value.is-negative { color: var(--color-danger); }
.calc-next-step { margin-top: var(--space-5); }

.quote-table { width: 100%; border-collapse: collapse; margin-top: var(--space-2); font-variant-numeric: tabular-nums; }
.quote-table th, .quote-table td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border); font-size: var(--fs-sm); }
.quote-table th:last-child, .quote-table td:last-child { text-align: right; }
.quote-table tr:last-child td { font-weight: 700; border-top: 2px solid var(--color-text); border-bottom: none; font-size: var(--fs-base); }
.quote-meta { font-size: var(--fs-xs); color: var(--color-text-faint); margin-top: var(--space-3); }
.calc-print-actions { margin-top: var(--space-5); }

@media print {
  body * { visibility: hidden; }
  #quote-print-area, #quote-print-area *, .print-area, .print-area * { visibility: visible; }
  #quote-print-area, .print-area { position: absolute; top: 0; left: 0; width: 100%; padding: var(--space-6); }
  #quote-print-area [data-calc-print], .print-area button { display: none; }
}

.app-recommendation__inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-7); align-items: center; }
.app-recommendation__copy h2 { font-size: var(--fs-2xl); margin: var(--space-2) 0 var(--space-3); }
.app-recommendation__trust { margin: var(--space-4) 0; display: flex; flex-direction: column; gap: var(--space-2); }
.app-recommendation__trust li { font-size: var(--fs-sm); color: var(--color-text-muted); padding-left: 1.4em; position: relative; }
.app-recommendation__trust li::before { content: "\2713"; position: absolute; left: 0; color: var(--color-success); font-weight: 700; }
.app-recommendation__media { display: flex; justify-content: center; }
.app-recommendation__media img { border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }

.content-faq { display: flex; flex-direction: column; gap: var(--space-3); max-width: 760px; }
.content-faq details { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); background: var(--color-bg-elevated); }
.content-faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: var(--space-3); }
.content-faq summary::-webkit-details-marker { display: none; }
.content-faq summary::after { content: "+"; font-size: 1.3em; color: var(--color-primary); flex: none; }
.content-faq details[open] summary::after { content: "\2212"; }
.content-faq p { margin-top: var(--space-3); color: var(--color-text-muted); font-size: var(--fs-sm); }

@media (max-width: 640px) {
  .calc-grid { grid-template-columns: 1fr; }
  .app-recommendation__inner { grid-template-columns: 1fr; }
}

/* ---------- Startseite: Bereichs-Kacheln (Umbau-Plan Phase 2) ---------- */
.area-tiles { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
.area-tile {
  display: block;
  /* Grid-Items sind ohne das per Default "auto" (= Inhalts-Mindestbreite),
     das koennte auf schmalen Viewports trotz overflow-wrap oben breiter
     als die Spalte bleiben - min-width:0 erlaubt der Karte, tatsaechlich
     auf Container-Breite zu schrumpfen. */
  min-width: 0;
  text-decoration: none;
  padding: var(--space-8) var(--space-7);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  box-shadow: none;
  transition: border-color var(--transition-base), transform var(--transition-base);
}
.area-tile:hover { transform: translateY(-3px); border-color: var(--color-primary); }
.area-tile__eyebrow { display: block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-primary); margin-bottom: var(--space-3); }
.area-tile h2 { font-size: var(--fs-2xl); margin-bottom: var(--space-3); }
.area-tile p { color: var(--color-text-muted); margin-bottom: var(--space-5); }
.area-tile__cta { font-weight: 700; color: var(--color-primary-dark); }
.area-tile__cta::after { content: " \2192"; }
.area-tile--soon { cursor: default; opacity: 0.75; }
.area-tile--soon:hover { transform: none; box-shadow: var(--shadow-md); }
.area-tile__cta--soon { font-weight: 600; color: var(--color-text-faint); font-size: var(--fs-sm); }
.area-tile__cta--soon::after { content: none; }

.home-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-5) var(--space-7); text-align: center; }
.home-trust li { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); font-weight: 600; color: var(--color-text-muted); }
.home-trust li::before { content: "\2713"; color: var(--color-success); font-weight: 700; }

@media (min-width: 720px) {
  /* auto-fit statt fixer 2 Spalten: traegt die dritte Kachel (Spiele-
     Bereich, Umbau-Plan HEPLANO Loser) ohne haessliches 2+1-Restfeld. */
  .area-tiles { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

/* ---------- HEPLANO Loser: Spiele-Bereich (/loser/) ---------- */
.loser-tool {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  margin: var(--space-5) 0;
  max-width: 480px;
}
.loser-textarea {
  width: 100%;
  min-height: 8.5rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
  resize: vertical;
  margin-bottom: var(--space-4);
}
.loser-textarea:focus { border-color: var(--color-focus); }
.loser-number-inputs { display: flex; gap: var(--space-4); margin-bottom: var(--space-4); flex-wrap: wrap; }
.loser-number-inputs label { font-weight: 600; font-size: var(--fs-sm); display: flex; flex-direction: column; gap: var(--space-1); }
.loser-number-inputs input {
  width: 8rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  background: var(--color-bg);
  color: var(--color-text);
}
.loser-number-inputs input:focus { border-color: var(--color-focus); }
.loser-result {
  margin-top: var(--space-5);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--color-primary-dark);
  min-height: 1.4em;
}
.loser-result--error { color: var(--color-danger); font-size: var(--fs-base); font-weight: 600; }
.loser-result--pulse { animation: loser-pulse 320ms ease; }
@keyframes loser-pulse {
  0% { transform: scale(0.9); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

/* Zufallszahl: Ziffern-Kacheln statt reinem Fliesstext (Slot-Automat-
   Reveal). Jede Kachel bekommt beim Wuerfeln per JS erst zufaellige
   Ziffern (Klasse wird retriggert), dann rastet sie zeitlich gestaffelt
   auf den finalen Wert ein (.is-locked + Pop-Animation) - reine
   Klassen-Toggles, keine Inline-Styles (CSP). */
.loser-digits { display: flex; justify-content: center; gap: var(--space-2); margin: var(--space-4) 0; flex-wrap: wrap; }
.loser-digit {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 3rem;
  padding: 0 0.3rem;
  background: var(--color-navy);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: var(--fs-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm);
}
.loser-digit--sign { background: transparent; color: var(--color-text); box-shadow: none; }
.loser-digit--pop { animation: loser-digit-pop 220ms ease; }
@keyframes loser-digit-pop {
  0% { transform: scale(0.75) translateY(-4px); background: var(--color-primary); }
  100% { transform: scale(1) translateY(0); }
}

/* Zufaellige Person: "Namens-Reel" - bewusst eine flache Karte statt
   eines rotierenden Rads (das Zufallsrad wurde explizit verworfen).
   Jeder Tick der Auslos-Schleife retriggert die Flip-Animation; die
   finale Auswahl bekommt eine staerkere Settle-Animation + Akzentrahmen. */
.loser-reel { display: flex; justify-content: center; margin: 0 auto var(--space-4); }
.loser-reel__card {
  min-width: 200px;
  padding: var(--space-4) var(--space-5);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-xl);
  font-weight: 700;
  text-align: center;
}
.loser-reel__card--flip { animation: loser-reel-flip 130ms ease; }
.loser-reel__card--settled { border-color: var(--color-primary); animation: loser-reel-settle 420ms ease; }
@keyframes loser-reel-flip {
  0% { transform: translateY(-6px) scale(0.96); opacity: 0.5; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes loser-reel-settle {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Muenzwurf */
.loser-coin {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--color-primary) 70%, var(--color-primary-dark) 100%);
  border: 4px double #fff3d6;
  box-shadow: var(--shadow-md), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  margin-bottom: var(--space-5);
}
.loser-coin--flip { animation: loser-coin-flip 900ms ease-in-out; }
@keyframes loser-coin-flip {
  0% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(900deg) scale(1.15); }
  100% { transform: rotateY(1800deg) scale(1); }
}

/* 3 Wuerfel */
.loser-dice { display: flex; gap: var(--space-3); justify-content: center; margin: 0 auto var(--space-5); flex-wrap: wrap; }
.loser-die {
  width: 64px;
  height: 64px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.loser-die--rolling { animation: loser-die-shake 700ms ease-in-out; }
@keyframes loser-die-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}
.loser-die__dot { border-radius: 50%; align-self: center; justify-self: center; width: 10px; height: 10px; }
.loser-die__dot.is-on { background: var(--color-text); }
.loser-die.is-rolled { border-color: var(--color-primary); }
/* Pasch-Bonus: mind. zwei gleiche Augenzahlen unter den 3 Wuerfeln. */
.loser-die--pasch { border-color: var(--color-primary); box-shadow: var(--shadow-md), 0 0 0 2px rgba(232, 106, 44, 0.35); animation: loser-die-pasch-pop 320ms ease; }
@keyframes loser-die-pasch-pop {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@media (max-width: 640px) {
  .loser-tool { padding: var(--space-5); }
}

/* App-CTA-Karte direkt unter dem Tool (statt nur ein Disclaimer-Absatz
   weiter unten im SEO-Text) - soll im Moment des Ergebnisses gesehen
   werden, nicht erst nach dem Scrollen durch Fliesstext. */
.loser-cta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  max-width: 480px;
  margin: 0 0 var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: var(--color-navy);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.loser-cta:hover, .loser-cta:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-lg, var(--shadow-md)); }
.loser-cta__icon { flex: none; font-size: var(--fs-2xl); line-height: 1; }
.loser-cta__text { color: #fff; font-size: var(--fs-sm); line-height: var(--lh-normal); }
.loser-cta__text strong { color: var(--color-primary-light); }
/* Sichtbare Klick-Affordance, da die ganze Karte jetzt ein Link zum
   Turniermodus ist (vorher nur Text ohne Ziel - Funnel-Bruch behoben). */
.loser-cta__text::after { content: " \2192"; color: var(--color-primary-light); font-weight: 700; }

/* Verlauf (Muenzwurf/Zufallszahl): letzte Ergebnisse als kleine Chips. */
.loser-history { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.loser-history__item {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* Mehrspieler-Ergebnisliste (Zufallszahl/3 Wuerfel im "Wer verliert?"-Modus):
   eine Zeile pro Person, niedrigster Wert verliert. Waehrend eines
   Stichentscheids sind nur die Gleichstand-Spieler markiert (--tied), am
   Ende nur die verlierende Person (--loser). Jede Zeile wird bei jedem
   Wurf neu erzeugt (innerHTML-Rebuild), daher spielt die Pop-Animation
   automatisch bei jedem Ergebnis. */
.loser-players { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-4) 0; }
.loser-players__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
  font-size: var(--fs-sm);
  animation: loser-players-pop 260ms ease;
}
.loser-players__name { font-weight: 600; }
.loser-players__value { font-weight: 700; color: var(--color-text-muted); }
.loser-players__item--tied { border-color: var(--color-focus); background: rgba(59, 130, 246, 0.08); }
.loser-players__item--loser { border-color: var(--color-danger); background: rgba(220, 38, 38, 0.08); }
.loser-players__item--loser .loser-players__value { color: var(--color-danger); }
@keyframes loser-players-pop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Ausgeschiedene (Zufaellige Person/Zufallsrad im Ausscheidungs-Modus). */
.loser-eliminated { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0; }
.loser-eliminated__item {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--color-bg-subtle);
  color: var(--color-text-faint);
  text-decoration: line-through;
  border: 1px solid var(--color-border);
}
.loser-again-btn { margin-top: var(--space-4); }
.loser-winner-banner {
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  font-weight: 700;
  color: var(--color-primary-darker);
}

/* Konfetti: feste Klassen-Varianten statt Inline-Styles (CSP: style-src
   'self' ohne 'unsafe-inline' - jede Flugbahn/Farbe ist eine vordefinierte
   Klasse, JS haengt nur Klassennamen an/entfernt Elemente). */
.loser-confetti { position: relative; height: 0; overflow: visible; }
.loser-confetti-piece {
  position: absolute;
  top: 0;
  left: 50%;
  width: 8px;
  height: 8px;
  opacity: 0;
  border-radius: 2px;
  pointer-events: none;
}
.loser-confetti-piece.is-active { animation-name: loser-confetti-fall; animation-duration: 900ms; animation-timing-function: ease-out; animation-fill-mode: forwards; }
.loser-confetti-piece--0 { background: var(--color-primary); --dx: -70px; animation-delay: 0ms; }
.loser-confetti-piece--1 { background: var(--color-navy); --dx: -55px; animation-delay: 30ms; }
.loser-confetti-piece--2 { background: var(--color-success); --dx: -38px; animation-delay: 60ms; }
.loser-confetti-piece--3 { background: var(--color-primary-dark); --dx: -22px; animation-delay: 10ms; }
.loser-confetti-piece--4 { background: var(--color-focus); --dx: -8px; animation-delay: 80ms; }
.loser-confetti-piece--5 { background: var(--color-primary); --dx: 8px; animation-delay: 20ms; }
.loser-confetti-piece--6 { background: var(--color-navy); --dx: 22px; animation-delay: 70ms; }
.loser-confetti-piece--7 { background: var(--color-success); --dx: 38px; animation-delay: 40ms; }
.loser-confetti-piece--8 { background: var(--color-primary-dark); --dx: 55px; animation-delay: 0ms; }
.loser-confetti-piece--9 { background: var(--color-focus); --dx: 70px; animation-delay: 50ms; }
@keyframes loser-confetti-fall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx), 110px) rotate(340deg); }
}
