:root {
  --c-red: #C82A15;
  --c-red-hover: #AD2C1A;
  --c-bg: #F5F2ED;
  --c-card: #FFFDF9;
  --c-ink: #1A1A1A;
  --c-muted: #6B6B6B;
  --c-border: #E5E0D8;
  --c-border-soft: #EFEAE2;
  --c-input-border: #D5D0C8;
  --c-error-bg: #FBE9EA;
  --c-error-border: #E2B6BA;
  --c-error-ink: #C53030;
  --c-block-stripe-a: #D4A574;
  --c-block-stripe-b: #cd9863;

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;

  --container-max: 1200px;
  --container-pad: clamp(20px, 5vw, 96px);
  --section-pad-y: clamp(64px, 10vw, 120px);
  /* Sticky-Header-Hoehe fuer 100svh-Rechnungen (Hero D). Header ist 72px
   * fest in .site-header__bar. Aendert sich das, hier nachziehen. */
  --site-header-h: 72px;

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;

  --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.02);
  --shadow-toast: 0 8px 30px rgba(0, 0, 0, 0.2);

  /* R5-G1-5: Zentrale z-index-Skala. Cockpit-Toolbar liegt über Sticky-Header,
   * aber Dialoge (Modals + Toasts) liegen IMMER ganz oben — auch über der
   * Cockpit-Bar, sonst verdeckt die Bar das aktive Modal (Befund
   * 2026-08-18: "Bearbeiten beenden"-Toast war hinter der Bar unsichtbar). */
  --z-content: 1;
  --z-sticky-header: 50;
  --z-cockpit-toolbar: 500;
  --z-cockpit-controls: 520;        /* inline Save/Cancel — über Sticky-Header */
  --z-cockpit-image-backdrop: 540;
  --z-cockpit-image-panel: 550;
  --z-modal-overlay: 600;           /* IMMER über Cockpit-Toolbar */
  --z-toast: 620;                   /* IMMER über Modal */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--c-bg);
  font-family: var(--font-body);
  color: var(--c-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100svh;
}

#app { min-height: 100svh; display: flex; flex-direction: column; }
#site-main { flex: 1; }

a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: inherit; }

input, select, textarea {
  font-family: inherit;
  color: var(--c-ink);
}
::placeholder { color: #9a948c; }

img { max-width: 100%; display: block; }

/* A-R3-3: Textselektion in Vereinsfarben.
 * Default: Vereins-Rot BG + weißer Text (auf hellen Flächen).
 * Auf explizit dunklen/roten Flächen (Hero, Cockpit-Toolbar, Sheet-Modals):
 * invertiert (weißer BG + roter Text) für Kontrast-Erhalt. */
::selection { background: var(--c-red); color: #fff; }
::-moz-selection { background: var(--c-red); color: #fff; }

.hero ::selection,
.schnupper-band ::selection,
.edit-toolbar ::selection,
.modal--sheet ::selection { background: #fff; color: var(--c-red); }
.hero ::-moz-selection,
.schnupper-band ::-moz-selection,
.edit-toolbar ::-moz-selection,
.modal--sheet ::-moz-selection { background: #fff; color: var(--c-red); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes sheetIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@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;
  }
}

.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;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Fix #9 — Silbentrennung fuer Fliesstext (21.08. 21:06 + 22.08. 00:06).
   Lange Komposita wie "Auftragsverarbeitungsvertrag" (28 Zeichen) passen sonst
   nicht auf 320px und erzwingen horizontales Scrollen.
   Nur unter Fliesstext-Containern und Tabellenzellen — nicht unter Ueberschriften,
   Navigation, Buttons, wo ein Trennstrich ein Fehler waere.
   Voraussetzung: lang="de" auf <html> (00:06: auf allen 16 Seiten gesetzt). */
.lead,
.text-body,
.text-small,
.doc__p,
.doc__list,
.training-table td {
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Fuer URLs/Mail-Adressen im Fliesstext (keine Silben, kein hyphens moeglich):
   overflow-wrap: break-word als gezielter Notnagel. Nicht "anywhere" — das
   liest sich abgeschnitten, nicht umbrochen (00:06). */
.doc__p a,
.doc__p code {
  overflow-wrap: break-word;
}
