/* a140: Rechtstexte (Impressum, Datenschutz). Gemeinsam für das Modal im Funnel und die Seiten
   /v2/impressum/ und /v2/datenschutz/. Setzt app.css voraus (Tokens, Schriften).
   Überschriften: Urbanist, Versalien. Fließtext: Sora Light (300). Farben nur aus den Tokens
   (Anthrazit, Sand bzw. Pfadfarbe, --fg, --muted). */

/* ---------- Typografie des Rechtstexts ---------- */
.legal-doc {
  max-width: 68ch;
  font-family: var(--f-sub);
  font-weight: 300;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: rgba(243, 242, 240, 0.9);
  letter-spacing: 0.003em;
  overflow-wrap: break-word;
  hyphens: manual;
  user-select: text;
  -webkit-user-select: text;
}
.legal-doc p, .legal-doc ul, .legal-doc blockquote, .legal-doc .legal-table { margin: 0 0 1em; }
.legal-doc strong { font-weight: 600; color: var(--fg); }
.legal-doc em { font-style: italic; }
.legal-doc a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--sand) 70%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.legal-doc a:hover, .legal-doc a:focus-visible { color: #fff; text-decoration-color: var(--sand); }
.legal-doc ul { padding-left: 1.15em; }
.legal-doc li { margin: 0 0 0.45em; padding-left: 0.2em; }
.legal-doc li::marker { color: var(--sand); }

/* a142: Titel-Schatten auch außerhalb der Bühne. Exakt der Wert aus css/act2.css (.stage), hier für Modal, Overlay
   „Statistik“ und die Standalone-Seiten, die keine Bühne haben. Bei einer Änderung beide Stellen anpassen. */
:root { --title-shadow: drop-shadow(0 1px 2px rgba(8, 8, 9, 0.55)) drop-shadow(0 2px 10px rgba(8, 8, 9, 0.35)); }
.legal-title { filter: none; } /* a149 (Andi t2168u): Rechtsseiten ohne Titelschatten */
.legal-title {
  margin: 0;
  font-family: var(--f);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.15;
  color: var(--fg);
  overflow-wrap: break-word;
}
.legal-h {
  margin: 2.1em 0 0.7em;
  font-family: var(--f);
  font-weight: 750;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.35;
  color: var(--fg);
  scroll-margin-top: 16px;
}
.legal-h::before {
  content: '';
  display: block;
  width: 22px;
  height: 1px;
  margin-bottom: 0.7em;
  background: var(--sand);
  box-shadow: 0 0 10px var(--glow-soft);
}
.legal-doc > .legal-h:first-child { margin-top: 0.4em; }

/* [OFFEN: …] im Mock sofort sichtbar */
.legal-open {
  padding: 0.08em 0.4em;
  border-radius: 5px;
  background: #dcc39e;
  color: #111214;
  font-weight: 500;
  outline: 1px dashed rgba(17, 18, 20, 0.55);
  outline-offset: -3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.legal-doc blockquote {
  padding: 14px 16px;
  border-left: 2px solid var(--sand);
  border-radius: 0 12px 12px 0;
  background: rgba(243, 242, 240, 0.035);
}
.legal-doc blockquote p:last-child { margin-bottom: 0; }

/* Tabellen */
.legal-table { overflow-x: auto; overscroll-behavior-x: contain; }
.legal-doc table { width: 100%; border-collapse: collapse; font-size: 0.875em; line-height: 1.55; }
.legal-doc th {
  padding: 0 14px 8px 0;
  text-align: left;
  vertical-align: bottom;
  font-family: var(--f);
  font-weight: 750;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.legal-doc td { padding: 10px 14px 10px 0; vertical-align: top; border-top: 1px solid var(--hair); }
.legal-doc th:last-child, .legal-doc td:last-child { padding-right: 0; }
@media (max-width: 640px) {
  .legal-doc table, .legal-doc tbody, .legal-doc tr, .legal-doc td { display: block; width: 100%; }
  .legal-doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .legal-doc tr {
    margin: 0 0 10px;
    padding: 4px 14px;
    border-radius: 12px;
    background: rgba(243, 242, 240, 0.035);
    box-shadow: inset 0 0 0 1px var(--hair);
  }
  .legal-doc td { padding: 9px 0; }
  .legal-doc td:first-child { border-top: 0; }
  .legal-doc td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-family: var(--f);
    font-weight: 750;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
  }
}

/* ---------- Modal im Funnel ---------- */
html.legal-locked, html.legal-locked body { overflow: hidden; overscroll-behavior: none; }
.legal-modal {
  /* Lichtkante neu aus dem übernommenen Pfad-Akzent ableiten (Tokens in :root rechnen mit dem Root-Sand) */
  --edge: color-mix(in srgb, var(--sand) 24%, rgba(243, 242, 240, 0.1));
  --edge-hi: color-mix(in srgb, var(--sand) 62%, rgba(243, 242, 240, 0.16));
  --glow: color-mix(in srgb, var(--sand) 60%, transparent);
  --glow-soft: color-mix(in srgb, var(--sand) 28%, transparent);
  position: fixed;
  left: 0; right: 0;
  top: var(--vvt, 0px);
  height: 100vh; height: 100dvh; height: var(--vvh, 100dvh);
  z-index: 60;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-t) + var(--banner) + 12px) 12px calc(var(--safe-b) + 12px);
  overscroll-behavior: contain;
  color: var(--fg);
}
.legal-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 10, 11, 0.72);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  backdrop-filter: blur(8px) saturate(1.1);
  opacity: 0;
  transition: opacity 0.28s var(--ease-out);
}
.legal-modal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(46rem, 100%);
  max-height: 100%;
  min-height: 0;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(34, 35, 40, 0.9), rgba(15, 16, 18, 0.95));
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: inset 0 0 0 1px var(--edge), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 30px 60px -30px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.28s var(--ease-out), transform 0.36s var(--ease-out);
}
.legal-modal.is-open .legal-modal-backdrop { opacity: 1; }
.legal-modal.is-open .legal-modal-dialog { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .legal-modal-backdrop, .legal-modal-dialog { transition: none; transform: none; }
}

.legal-modal-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 12px 22px;
  border-bottom: 1px solid var(--hair);
}
.legal-modal-head .legal-title { flex: 1; min-width: 0; font-size: clamp(0.875rem, 2.6vw, 1.125rem); }
.legal-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin: 0; padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(34, 35, 40, 0.6), rgba(15, 16, 18, 0.66));
  box-shadow: inset 0 0 0 1px var(--edge);
  color: var(--fg);
}
.legal-close:hover, .legal-close:focus-visible { box-shadow: inset 0 0 0 1px var(--edge-hi), 0 0 22px -8px var(--glow); }
.legal-close:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; border-radius: 50%; }
.legal-close-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

.legal-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 18px 22px calc(18px + var(--safe-b));
  scrollbar-width: thin;
  scrollbar-color: rgba(243, 242, 240, 0.22) transparent;
}
.legal-modal-body:focus { outline: none; }
.legal-modal-body:focus-visible { outline: 2px solid var(--sand); outline-offset: -4px; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.legal-modal-body .legal-table { touch-action: pan-x pan-y; }

.legal-modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  max-width: 68ch;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
}
.legal-switch {
  font-family: var(--f);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--sand) 70%, transparent);
  text-underline-offset: 4px;
}
.legal-switch:hover, .legal-switch:focus-visible { color: #fff; text-decoration-color: var(--sand); }
.legal-btn {
  min-height: 44px;
  margin: 0;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(34, 35, 40, 0.6), rgba(15, 16, 18, 0.66));
  box-shadow: inset 0 0 0 1px var(--edge), 0 10px 24px -16px rgba(0, 0, 0, 0.9);
  color: var(--fg);
  font-family: var(--f);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legal-btn:hover, .legal-btn:focus-visible { box-shadow: inset 0 0 0 1px var(--edge-hi), 0 0 22px -8px var(--glow), 0 10px 24px -16px rgba(0, 0, 0, 0.9); }
.legal-btn:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; }

@media (max-width: 560px) {
  .legal-modal { padding: calc(var(--safe-t) + var(--banner) + 6px) 6px 6px; }
  .legal-modal-dialog { width: 100%; height: 100%; border-radius: 18px; }
  .legal-modal-head { padding: 10px 8px 10px 16px; }
  .legal-modal-body { padding: 14px 16px calc(16px + var(--safe-b)); }
  .legal-doc { font-size: 0.9375rem; line-height: 1.65; }
}

/* ---------- a142: Overlay „Statistik“ (Wahl später ändern). Gleiches Glas wie das Legal-Modal, aber kompakt ---------- */
.stats-modal .legal-modal-dialog { width: min(26rem, 100%); height: auto; }
.stats-modal-body { padding: 16px 22px calc(20px + var(--safe-b)); }
/* Popup-Job: Statuszeile wie im Wortlaut direkt hinter dem Titel („Statistik – Status: …“). Passt sie nicht in die
   Zeile, rutscht sie als Ganzes darunter. */
.stats-status {
  display: inline-block;
  font-weight: 750;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  line-height: 1.3;
  color: var(--sand);
}
/* Aktuelle Wahl an den Overlay-Buttons: Haken und helle Kante (neutral, keine Signalfarbe) */
.stats-modal .stats-btn { display: flex; align-items: center; justify-content: center; gap: 7px; }
.stats-mark { display: none; flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.stats-modal .stats-btn.is-current { box-shadow: inset 0 0 0 1.5px rgba(243, 242, 240, 0.86), 0 10px 24px -16px rgba(0, 0, 0, 0.9); }
.stats-modal .stats-btn.is-current .stats-mark { display: block; }
.stats-text {
  margin: 0 0 18px;
  font-family: var(--f-sub);
  font-weight: 300;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgba(243, 242, 240, 0.9);
}
/* ---------- SKIP-Job: Rückfrage vor „Fragen überspringen“ (js/main.js skipAsk). Gleiches Glas und gleiche Buttons
   wie das Overlay „Statistik“, nur Titel plus zwei Antworten untereinander (der lange Ja-Text bleibt einzeilig). ---------- */
.skip-modal .legal-modal-dialog { width: min(22rem, 100%); }
.skip-modal .legal-modal-head { padding: 18px 22px 14px; }
.skip-modal .legal-modal-head .legal-title { font-size: 1rem; line-height: 1.25; text-wrap: balance; }
.skip-modal .stats-actions { grid-template-columns: 1fr; }
.skip-modal .stats-btn { padding: 6px 12px; line-height: 1.25; }
@media (max-width: 560px) {
  .skip-modal .legal-modal-head { padding: 16px 16px 12px; }
}
@media (max-width: 560px) {
  .legal-modal.stats-modal { padding: calc(var(--safe-t) + var(--banner) + 12px) 12px calc(var(--safe-b) + 12px); }
  .stats-modal .legal-modal-dialog { height: auto; }
  .stats-modal-body { padding: 14px 16px 18px; }
}

/* ---------- Standalone-Seiten ---------- */
/* app.css sperrt Dokument-Scroll für die Funnel-Bühne; hier normal scrollen */
html.legal-standalone { height: auto; overflow: visible; overflow-y: auto; overscroll-behavior: auto; }
html.legal-standalone body {
  height: auto;
  min-height: 100%;
  overflow: visible;
  overscroll-behavior: auto;
  background:
    radial-gradient(90vmax 60vmax at 50% -10%, color-mix(in srgb, var(--sand) 7%, transparent) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.legal-top {
  position: sticky;
  top: calc(var(--safe-t) + var(--banner));
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: calc(var(--safe-t) + var(--banner));
  padding: 10px max(14px, env(safe-area-inset-right, 0px)) 10px max(10px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, rgba(17, 18, 20, 0.94), rgba(17, 18, 20, 0.82));
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--hair);
}
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(34, 35, 40, 0.6), rgba(15, 16, 18, 0.66));
  box-shadow: inset 0 0 0 1px var(--edge);
  color: var(--fg);
  text-decoration: none;
  font-family: var(--f);
  font-weight: 750;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legal-back:hover, .legal-back:focus-visible { box-shadow: inset 0 0 0 1px var(--edge-hi), 0 0 22px -8px var(--glow); }
.legal-back .ln-ico { width: 18px; height: 18px; }
.legal-nav {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--f);
  font-weight: 650;
  font-size: max(12px, 0.75rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legal-nav a { color: rgba(243, 242, 240, 0.78); text-decoration: none; padding: 12px 2px; }
.legal-nav a:hover, .legal-nav a:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.legal-nav a[aria-current='page'] { color: var(--fg); text-decoration: underline; text-decoration-color: var(--sand); text-underline-offset: 4px; }
.legal-main {
  padding: clamp(28px, 6vh, 64px) max(20px, env(safe-area-inset-right, 0px)) calc(48px + var(--safe-b)) max(20px, env(safe-area-inset-left, 0px));
}
.legal-main .legal-doc { margin: 0 auto; font-size: 1rem; }
.legal-main .legal-title { margin-bottom: 1.1em; font-size: clamp(1.5rem, 5vw, 2.5rem); }
.legal-main .legal-h { font-size: 0.875rem; }
.legal-noscript { max-width: 68ch; margin: 0 auto; font-family: var(--f-sub); font-weight: 300; color: var(--muted); }
