/* ============================================================
   Wettenberg hilft – Design System (mobile-first)
   System-Fonts, keine externen Ressourcen, hoher Kontrast.
   Tap-Targets ≥ 44px, robustes Stack-Verhalten auf engen Screens.
   ============================================================ */

:root {
  /* Basis-Farben — modern, weißer Hintergrund, cleane Slate-Skala
     für Border/Surface. Logo-Bezug bleibt über die Primary/Rainbow. */
  --c-bg:            #ffffff;
  --c-bg-subtle:     #fafafa;          /* leichter Abschnitts-Hintergrund */
  --c-surface:       #ffffff;
  --c-surface-2:     #f8fafc;          /* kühles Off-White für Sektionen */
  --c-border:        #e5e7eb;          /* slate-200 */
  --c-border-strong: #cbd5e1;          /* slate-300 */
  --c-text:          #0f172a;          /* slate-900 — fast schwarz, klarer Kontrast */
  --c-text-muted:    #475569;          /* slate-600 */
  --c-text-soft:     #94a3b8;          /* slate-400 */

  /* Primär: warmes Rot-Orange aus dem Wettenberg-bleibt-bunt-Logo,
     leicht angepasst für besseren AA-Kontrast auf weißem BG */
  --c-primary:       #c2410c;          /* tiefer als das Logo, AA-konform auf #fff */
  --c-primary-700:   #9a3412;
  --c-primary-50:    #fff7ed;
  --c-primary-100:   #ffedd5;
  --c-primary-200:   #fed7aa;

  /* Sekundärer Akzent (kühl, modern) */
  --c-accent:        #2563eb;          /* blue-600 */
  --c-accent-700:    #1d4ed8;
  --c-accent-50:     #eff6ff;

  /* Regenbogenpalette aus dem Logo */
  --c-rb-red:    #d8431c;
  --c-rb-orange: #f08820;
  --c-rb-yellow: #f5c518;
  --c-rb-green:  #3fa34d;
  --c-rb-blue:   #2563aa;
  --c-rb-purple: #6a3093;

  --rainbow: linear-gradient(
    90deg,
    var(--c-rb-red)    0%,
    var(--c-rb-orange) 20%,
    var(--c-rb-yellow) 40%,
    var(--c-rb-green)  60%,
    var(--c-rb-blue)   80%,
    var(--c-rb-purple) 100%
  );
  --rainbow-soft: linear-gradient(
    135deg,
    rgba(216,67,28,.08)   0%,
    rgba(240,136,32,.08)  20%,
    rgba(245,197,24,.08)  40%,
    rgba(63,163,77,.08)   60%,
    rgba(37,99,170,.08)   80%,
    rgba(106,48,147,.08) 100%
  );

  --c-success:      #15803d;
  --c-success-50:   #f0fdf4;
  --c-warn:         #b45309;
  --c-warn-50:      #fffbeb;
  --c-danger:       #b91c1c;
  --c-danger-50:    #fef2f2;
  --c-info:         #1e40af;
  --c-info-50:      #eff6ff;

  /* Typografie */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
          Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r:    10px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Schatten — modern, subtil, mehrlagig */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow:    0 4px 6px -1px rgba(15, 23, 42, .06), 0 2px 4px -2px rgba(15, 23, 42, .04);
  --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, .08), 0 4px 6px -4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, .10), 0 8px 10px -6px rgba(15, 23, 42, .04);

  /* Ring (Focus / Hover-Outline) */
  --ring-primary: 0 0 0 3px rgba(194, 65, 12, .15);
  --ring-accent:  0 0 0 3px rgba(37, 99, 235, .15);

  /* Spacing-Skala (4er-Schritte) — durchgängig statt magischer rem-Werte */
  --space-0: 0;
  --space-1: .25rem;   /*  4px */
  --space-2: .5rem;    /*  8px */
  --space-3: .75rem;   /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-7: 2rem;     /* 32px */
  --space-8: 2.5rem;   /* 40px */
  --space-9: 3rem;     /* 48px */
  --space-10: 4rem;    /* 64px */

  /* Typografische Skala */
  --text-xs:   .75rem;   /* 12px */
  --text-sm:   .875rem;  /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg:   1.125rem; /* 18px */
  --text-xl:   1.25rem;  /* 20px */
  --text-2xl:  1.5rem;   /* 24px */
  --text-3xl:  1.875rem; /* 30px */
  --text-4xl:  2.25rem;  /* 36px */

  /* Z-Index-Skala (verhindert Wettrennen mit hartkodierten Werten) */
  --z-base:     1;
  --z-sticky:   30;
  --z-dropdown: 40;
  --z-fab:      40;
  --z-modal:    50;
  --z-toast:    60;

  /* Touch-Ziel-Mindestmaße */
  --touch-target:        44px;
  --touch-target-primary: 56px;

  --container: 1180px;
  --header-h: 60px;
}

/* ---------- Reset / Basis ---------- */

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--c-primary-700); text-underline-offset: 3px; }
a:hover { color: var(--c-primary); }
hr { border: 0; border-top: 1px solid var(--c-border); margin: 1.5rem 0; }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.01em; margin: 0 0 .6rem; word-wrap: break-word; }
h1 { font-size: clamp(1.45rem, 5vw, 2.2rem); font-weight: 700; }
h2 { font-size: clamp(1.15rem, 3.5vw, 1.6rem); font-weight: 650; }
h3 { font-size: clamp(1rem, 3vw, 1.15rem); font-weight: 650; }
p  { margin: .25rem 0 1rem; word-wrap: break-word; }

code, kbd, samp { font-family: var(--font-mono); font-size: .92em; word-break: break-word; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 1rem; top: 1rem; z-index: 100;
  background: #000; color: #fff; padding: .55rem 1rem; border-radius: var(--r-sm);
}

.container       { max-width: var(--container); margin-inline: auto; padding-inline: 1rem; }
.container-wide  { max-width: 1600px;          margin-inline: auto; padding-inline: 1rem; }
@supports (padding: max(0px)) {
  .container, .container-wide {
    padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
  }
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 3px 0 0 transparent; /* placeholder, replaced by ::after */
  padding-top: env(safe-area-inset-top);
}
.site-header::after {
  content: ""; display: block; height: 3px;
  background: var(--rainbow);
  background-size: 100% 100%;
  position: absolute; left: 0; right: 0; bottom: -3px;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; min-height: var(--header-h); padding-block: .5rem;
  position: relative;
}

/* Hamburger-Button: nur Mobile sichtbar */
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: transparent; border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  cursor: pointer; flex-shrink: 0;
  color: var(--c-text);
  padding: 0;
}
.nav-toggle:hover { background: var(--c-surface-2); border-color: var(--c-border-strong); }
.nav-toggle .nav-toggle-icon {
  display: block; width: 22px; height: 2px;
  background: currentColor; border-radius: 2px;
  position: relative;
}
.nav-toggle .nav-toggle-icon::before,
.nav-toggle .nav-toggle-icon::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .18s ease, top .18s ease;
}
.nav-toggle .nav-toggle-icon::before { top: -7px; }
.nav-toggle .nav-toggle-icon::after  { top:  7px; }
body[data-nav-open] .nav-toggle .nav-toggle-icon { background: transparent; }
body[data-nav-open] .nav-toggle .nav-toggle-icon::before { top: 0; transform: rotate(45deg); }
body[data-nav-open] .nav-toggle .nav-toggle-icon::after  { top: 0; transform: rotate(-45deg); }
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  text-decoration: none; color: var(--c-text); font-weight: 600;
  flex-shrink: 1; min-width: 0;
}
.brand-mark {
  height: 2.25rem; flex-shrink: 0;
  display: inline-flex; align-items: center;
}
.brand-mark img { height: 100%; width: auto; display: block; }
.brand-mark.fallback {
  width: 2.5rem; height: 2.5rem; border-radius: 8px;
  background: var(--rainbow);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem;
  letter-spacing: -.02em;
  box-shadow: var(--shadow-sm);
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.brand-text {
  font-size: 1rem; letter-spacing: -.01em; line-height: 1.15;
  display: inline-block; max-width: 100%;
}
@media (max-width: 599px) {
  .brand-text { font-size: .92rem; }
}
.brand-text strong { color: var(--c-primary-700); }

/* Hauptnavigation: immer sichtbar, wraps automatisch auf engen Screens */
.primary-nav {
  display: flex !important; flex-flow: row wrap;
  gap: .15rem; align-items: center;
  flex: 1 1 auto; justify-content: flex-end;
}
.primary-nav a, .primary-nav .link-button {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem .8rem; border-radius: var(--r-pill);
  text-decoration: none; color: var(--c-text-muted); font-weight: 500;
  font-size: .92rem; line-height: 1.2; border: 1px solid transparent;
  background: none; cursor: pointer; font-family: inherit;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.primary-nav a:hover, .primary-nav .link-button:hover {
  background: var(--c-surface-2); color: var(--c-primary-700);
}
.primary-nav a[aria-current="page"] {
  background: var(--c-primary-50);
  color: var(--c-primary-700);
  font-weight: 600;
}
.primary-nav .nav-cta {
  background: var(--c-primary); color: #fff;
  box-shadow: var(--shadow-sm);
}
.primary-nav .nav-cta:hover { background: var(--c-primary-700); color: #fff; }
/* Nav-Icons konsequent monochrom (Schwarz/Weiß-Look).
   Icon-Farbe ist hart auf ein neutrales Grau gefixt und ändert sich
   NICHT auf Hover oder bei aria-current — kein farbiger Akzent.
   Auf dem CTA-Button (farbiger Hintergrund) ist das Icon weiß. */
.primary-nav .nav-icon {
  width: 1.05em; height: 1.05em; flex-shrink: 0;
  color: var(--c-text-muted);
}
.primary-nav a:hover .nav-icon,
.primary-nav a[aria-current="page"] .nav-icon,
.primary-nav .link-button:hover .nav-icon {
  color: var(--c-text); /* etwas kräftiger, aber weiterhin neutral */
}
.primary-nav .nav-icon path,
.primary-nav .nav-icon circle,
.primary-nav .nav-icon rect,
.primary-nav .nav-icon line,
.primary-nav .nav-icon polyline,
.primary-nav .nav-icon polygon {
  stroke: currentColor;
  fill: none;
}
.primary-nav .nav-cta .nav-icon { color: #fff; }
.primary-nav .nav-cta:hover .nav-icon { color: #fff; }
.nav-form { margin: 0; display: contents; }

/* Mobile- UND Tablet/Small-Laptop-Drawer: unter 1024px klappt die Nav
   unter den Header. Grund: bei eingeloggten Admins gibt es bis zu 13
   Top-Level-Nav-Items — auf 13"/14"-Laptops würden die in 2 Zeilen
   umbrechen und der sticky Header würde den Above-the-Fold-Bereich
   überlagern. Hamburger ist auf Tablets und schmalen Laptops besser. */
@media (max-width: 1023px) {
  .nav-toggle { display: inline-grid; }
  .primary-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-lg);
    padding: .5rem .75rem 1rem;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: .25rem;
    max-height: calc(100dvh - var(--header-h) - 4px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility 0s .18s;
  }
  body[data-nav-open] .primary-nav {
    opacity: 1; visibility: visible; transform: translateY(0);
    transition: opacity .18s ease, transform .18s ease;
  }
  .primary-nav a, .primary-nav .link-button {
    width: 100%; justify-content: flex-start;
    padding: .8rem .9rem; font-size: 1rem; min-height: 44px;
    border-radius: var(--r-sm);
  }
  .primary-nav .nav-cta { margin-top: .25rem; justify-content: center; }
  .brand-text { font-size: .92rem; }
}

/* Übergangsbereich 1024–1279 px: Desktop-Nav, aber kompakt damit
   13 Items auf einem 13"-Laptop in eine Zeile passen */
@media (min-width: 1024px) and (max-width: 1279px) {
  .primary-nav a, .primary-nav .link-button {
    padding: .45rem .55rem;
    font-size: .85rem;
    gap: .3rem;
  }
  .primary-nav .nav-icon { width: .95em; height: .95em; }
  .header-inner { gap: .5rem; }
  .brand-text { font-size: .9rem; }
}

/* Über 1280px: Header höhe begrenzen + Wrap als Safety-Net */
@media (min-width: 1280px) {
  .primary-nav { flex-wrap: wrap; }
}

/* Backdrop, wenn Drawer offen */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(15, 23, 16, .35);
  z-index: 40;
}
@media (max-width: 1023px) {
  body[data-nav-open] .nav-backdrop { display: block; }
}
@media (min-width: 1024px) {
  body { overflow: auto !important; }
  body[data-nav-open] { /* on desktop: noop */ }
}
@media (max-width: 1023px) {
  body[data-nav-open] { overflow: hidden; }
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 3rem; padding: 1.75rem 0;
  padding-bottom: max(1.75rem, env(safe-area-inset-bottom));
  background: #161616; color: #d1d5db;
  position: relative;
}
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: var(--rainbow);
}
.site-footer a {
  color: #fbbf24; text-decoration: none;
  margin-right: 1rem; display: inline-block;
  padding: .55rem .15rem; min-height: 36px; line-height: 1.4;
}
.site-footer a:hover { text-decoration: underline; }
.footer-inner { display: flex; flex-direction: column; gap: 1rem; }
.footer-inner > div { font-size: .92rem; }
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; justify-content: space-between; }
}

/* ---------- Main ---------- */

.main-content { padding: 1.25rem 1rem 3rem; }
@media (min-width: 768px) { .main-content { padding: 1.75rem 1.25rem 4rem; } }

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden;
  background: #fff;
  background-image: var(--rainbow-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.1rem;
  margin-bottom: 1.5rem;
}
.hero::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: var(--rainbow);
}
@media (min-width: 768px) { .hero { padding: 2.5rem 2rem; margin-bottom: 2rem; } }
.hero h1 { max-width: 22ch; }
.hero p { max-width: 60ch; color: var(--c-text-muted); font-size: 1rem; }
.hero .hero-subline {
  font-style: italic; font-size: 1.1rem; color: var(--c-text);
  margin: -.25rem 0 1rem; max-width: 60ch; opacity: .85;
}
.hero-actions { display: flex; flex-direction: column; gap: .55rem; margin-top: 1rem; }
@media (min-width: 540px) { .hero-actions { flex-direction: row; flex-wrap: wrap; } }
.hero-actions .btn { width: 100%; }
@media (min-width: 540px) { .hero-actions .btn { width: auto; } }

/* ---------- Buttons (modernisiert) ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .65rem 1.1rem;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  text-decoration: none; cursor: pointer; line-height: 1.15;
  min-height: 44px;
  font: 500 .95rem var(--font);
  letter-spacing: -.005em;
  transition: background-color .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .05s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring-primary);
}
.btn-primary {
  background: var(--c-primary); color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover { background: var(--c-primary-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-secondary {
  background: var(--c-surface);
  border-color: var(--c-border-strong);
  color: var(--c-text);
}
.btn-secondary:hover {
  border-color: var(--c-primary);
  color: var(--c-primary-700);
  background: var(--c-primary-50);
}
.btn-ghost {
  background: transparent;
  color: var(--c-text-muted);
}
.btn-ghost:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
}
.btn-danger { background: var(--c-danger); color: #fff; box-shadow: var(--shadow-xs); }
.btn-danger:hover { background: #991b1b; color: #fff; }
.btn-success { background: var(--c-success); color: #fff; box-shadow: var(--shadow-xs); }
.btn-success:hover { background: #14532d; color: #fff; }
.btn-sm { padding: .45rem .85rem; font-size: .86rem; min-height: 36px; }
.btn-lg { padding: .85rem 1.4rem; font-size: 1.05rem; min-height: 52px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: .55rem; min-height: 40px; min-width: 40px; aspect-ratio: 1; }

/* ---------- Cards (subtiler Look, weicher Schatten) ---------- */

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  margin-bottom: 1rem;
  transition: box-shadow .15s ease, border-color .15s ease;
}
@media (min-width: 768px) { .card { padding: 1.5rem; } }
.card-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 540px) { .card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } }
@media (min-width: 768px) { .card-grid { gap: 1.25rem; } }

.project-card {
  display: flex; flex-direction: column; height: 100%;
}
.project-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--c-border-strong);
}
.project-card h3 { margin-bottom: .35rem; }
.project-card h3 a { color: var(--c-text); text-decoration: none; }
.project-card h3 a:hover { color: var(--c-primary-700); }
.project-card p { color: var(--c-text-muted); flex: 1; }
.project-meta { color: var(--c-text-soft); font-size: .87rem; margin-bottom: .5rem; }
.project-actions { margin-top: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.project-actions .btn { flex: 1 1 auto; min-width: 0; }
@media (min-width: 540px) { .project-actions .btn { flex: 0 0 auto; } }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .78rem; font-weight: 500; line-height: 1.4;
  background: var(--c-surface-2); color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  white-space: nowrap;
}
.badge-success { background: var(--c-success-50); color: var(--c-success); border-color: #bbf7d0; }
.badge-warn    { background: var(--c-warn-50);    color: var(--c-warn);    border-color: #fde68a; }
.badge-danger  { background: var(--c-danger-50);  color: var(--c-danger);  border-color: #fecaca; }
.badge-info    { background: var(--c-info-50);    color: var(--c-info);    border-color: #bfdbfe; }
.badge-accent  { background: var(--c-accent-50);  color: var(--c-accent);  border-color: #c1d6ee; }

/* Kategoriebadges in den Regenbogen-Tönen (mappen sich über data-cat) */
.badge[data-cat="zeit"]         { background: rgba(216,67,28,.10);  color: var(--c-rb-red);    border-color: rgba(216,67,28,.30); }
.badge[data-cat="leihen"]       { background: rgba(240,136,32,.12); color: #b56409;            border-color: rgba(240,136,32,.32); }
.badge[data-cat="spenden"]      { background: rgba(245,197,24,.18); color: #876c00;            border-color: rgba(245,197,24,.40); }
.badge[data-cat="transport"]    { background: rgba(63,163,77,.12);  color: var(--c-rb-green);  border-color: rgba(63,163,77,.32); }
.badge[data-cat="lagerflaeche"] { background: rgba(37,99,170,.10);  color: var(--c-rb-blue);   border-color: rgba(37,99,170,.30); }
.badge[data-cat="werkzeug"]     { background: rgba(106,48,147,.10); color: var(--c-rb-purple); border-color: rgba(106,48,147,.30); }
.badge[data-cat="fachlich"]     { background: rgba(15,118,110,.10); color: var(--c-accent);    border-color: rgba(15,118,110,.30); }
.badge[data-cat="sonstiges"]    { background: var(--c-surface-2);   color: var(--c-text-muted);border-color: var(--c-border); }
.badge-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Forms ---------- */

.form {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r); padding: 1.1rem; max-width: 720px;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 768px) { .form { padding: 1.5rem; } }
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .92rem; }
.form-row .hint { color: var(--c-text-soft); font-size: .85rem; margin-top: .35rem; display: block; }
.form input[type=text], .form input[type=email], .form input[type=password],
.form input[type=tel], .form input[type=date], .form input[type=number],
.form select, .form textarea {
  width: 100%; padding: .7rem .85rem;
  border: 1px solid var(--c-border-strong); border-radius: var(--r-sm);
  font: 16px/1.4 var(--font); /* 16px verhindert iOS-Zoom */
  background: #fff; color: var(--c-text); min-height: 44px;
  transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 0; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(184, 65, 14, .15);
}
.form textarea { min-height: 7rem; resize: vertical; }
.form-check { display: flex; align-items: flex-start; gap: .55rem; margin-bottom: .75rem; }
.form-check input { margin-top: .2rem; transform: scale(1.15); flex-shrink: 0; }
.form-check label { line-height: 1.45; font-weight: 500; }
.form-grid { display: grid; gap: .85rem; grid-template-columns: 1fr; }
@media (min-width: 540px) { .form-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; } }
.form-grid .form-row { margin: 0; }

/* ---------- Flash ---------- */

.flash {
  margin: 1rem 0; padding: .85rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}
.flash-success { background: var(--c-success-50); color: var(--c-success); border-color: #bbf7d0; }
.flash-error   { background: var(--c-danger-50);  color: var(--c-danger);  border-color: #fecaca; }
.flash-warning { background: var(--c-warn-50);    color: var(--c-warn);    border-color: #fde68a; }
.flash-info    { background: var(--c-info-50);    color: var(--c-info);    border-color: #bfdbfe; }

/* ---------- Tables ---------- */

.data-wrap {
  overflow-x: auto; border: 1px solid var(--c-border); border-radius: var(--r);
  -webkit-overflow-scrolling: touch;
  background: var(--c-surface);
  position: relative;
  /* Sanfter Schatten am rechten Rand, der mit-scrollt: zeigt, dass es weitergeht */
  background-image:
    linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0)),
    linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0)),
    linear-gradient(to right, rgba(0,0,0,0), rgba(15,23,16,.10)),
    linear-gradient(to left,  rgba(0,0,0,0), rgba(15,23,16,.10));
  background-position: 0 0, 100% 0, 0 0, 100% 0;
  background-repeat: no-repeat;
  background-size: 16px 100%, 16px 100%, 16px 100%, 16px 100%;
  background-attachment: local, local, scroll, scroll;
}
table.data {
  width: 100%; border-collapse: collapse; background: var(--c-surface);
  font-size: .94rem; min-width: 560px;
}
table.data th, table.data td {
  padding: .7rem .85rem; text-align: left; border-bottom: 1px solid var(--c-border); vertical-align: top;
}
table.data thead th {
  background: var(--c-surface-2); font-weight: 600; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .04em; color: var(--c-text-muted);
  position: sticky; top: 0;
}
table.data tbody tr:hover { background: var(--c-surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }

/* Erste Spalte beim Querscrollen fixieren (opt-in via .sticky-first) */
.data-wrap.sticky-first { position: relative; }
.data-wrap.sticky-first table.data thead th:first-child,
.data-wrap.sticky-first table.data tbody td:first-child {
  position: sticky; left: 0; z-index: 1;
  background: var(--c-surface);
  box-shadow: 1px 0 0 0 var(--c-border);
}
.data-wrap.sticky-first table.data tbody tr:hover td:first-child { background: var(--c-surface-2); }
.data-wrap.sticky-first table.data thead th:first-child {
  background: var(--c-surface-2); z-index: 2;
}

/* Karten-Layout für Daten-Tabellen unter 600px */
@media (max-width: 599px) {
  .data-wrap.cards-on-mobile { border: 0; background: transparent; overflow: visible; }
  .data-wrap.cards-on-mobile table.data { min-width: 0; background: transparent; font-size: .95rem; }
  .data-wrap.cards-on-mobile table.data thead { display: none; }
  .data-wrap.cards-on-mobile table.data tr {
    display: block; background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--r); margin-bottom: .75rem; padding: .25rem .25rem;
    box-shadow: var(--shadow-sm);
  }
  .data-wrap.cards-on-mobile table.data td {
    display: block; border: 0; padding: .55rem .75rem; border-bottom: 1px solid var(--c-border);
  }
  .data-wrap.cards-on-mobile table.data td:last-child { border-bottom: 0; }
  .data-wrap.cards-on-mobile table.data td::before {
    content: attr(data-label);
    display: block; font-weight: 600; font-size: .72rem; text-transform: uppercase;
    color: var(--c-text-soft); letter-spacing: .04em; margin-bottom: .2rem;
  }
}

/* ---------- Bedarfsliste ---------- */

.needs-list { list-style: none; padding: 0; margin: 0; }
.needs-list > li {
  padding: 1rem 0; border-bottom: 1px dashed var(--c-border);
}
.needs-list > li:last-child { border-bottom: 0; }
.need-head { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.need-meta { color: var(--c-text-soft); font-size: .87rem; margin-top: .35rem; }

/* ---------- Stats ---------- */

.stat {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r); padding: 1rem 1.1rem; box-shadow: var(--shadow-sm);
}
.stat-label { font-size: .78rem; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
.stat-foot  { font-size: .82rem; color: var(--c-text-muted); margin-top: .3rem; }
.stat-foot a { color: var(--c-primary-700); }
.stats-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1.25rem; }
@media (min-width: 768px) { .stats-grid { gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 1.5rem; } }

/* ---------- Admin Shell ---------- */

.admin-shell { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 900px) { .admin-shell { grid-template-columns: 240px 1fr; gap: 1.5rem; } }

.admin-sidebar {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r); padding: .5rem; align-self: start;
}
@media (min-width: 900px) { .admin-sidebar { padding: .75rem; position: sticky; top: calc(var(--header-h) + 1rem); } }
.admin-sidebar h4 {
  font-size: .72rem; text-transform: uppercase; color: var(--c-text-soft);
  letter-spacing: .08em; margin: .65rem .65rem .3rem;
}
.admin-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar a {
  padding: .65rem .75rem; border-radius: var(--r-sm); text-decoration: none;
  color: var(--c-text); font-size: .94rem; display: flex; gap: .5rem; align-items: center;
  min-height: 44px;
}
.admin-sidebar a:hover { background: var(--c-surface-2); }
.admin-sidebar a.is-active {
  background: var(--c-primary-50); color: var(--c-primary-700); font-weight: 600;
}
/* Auf Mobile: Sidebar in <details> kollabierbar */
.admin-sidebar-toggle {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; padding: .65rem .85rem;
  font-weight: 600; color: var(--c-text); border-radius: var(--r-sm);
  background: var(--c-surface-2); margin-bottom: .25rem;
}
.admin-sidebar-toggle::-webkit-details-marker, .admin-sidebar-toggle::marker { display: none; content: ""; }
.admin-sidebar-toggle::after { content: "▾"; }
.admin-sidebar details[open] .admin-sidebar-toggle::after { content: "▴"; }
.admin-sidebar details > h4,
.admin-sidebar details > nav { display: none; }
.admin-sidebar details[open] > h4,
.admin-sidebar details[open] > nav { display: block; }
.admin-sidebar details[open] > nav { display: flex; flex-direction: column; gap: 2px; }
@media (min-width: 900px) {
  .admin-sidebar-toggle { display: none; }
  .admin-sidebar details > h4,
  .admin-sidebar details > nav { display: block; }
  .admin-sidebar details > nav { display: flex; flex-direction: column; gap: 2px; }
}

.admin-main { min-width: 0; }

.page-head {
  display: flex; flex-direction: column;
  gap: .75rem; margin-bottom: 1.25rem;
}
.page-head h1 { margin: 0; }
.page-head > div:first-child { min-width: 0; flex: 1 1 auto; }
.page-head .flex {
  gap: .5rem; flex-shrink: 0; flex-wrap: wrap;
  width: 100%;
}
@media (max-width: 599px) {
  /* Auf engen Screens: Buttons im page-head full-width stacken */
  .page-head .flex .btn { flex: 1 1 100%; }
  .page-head .flex .btn-sm { flex: 1 1 auto; min-width: 140px; }
}
.page-head .btn { white-space: normal; max-width: 100%; }
@media (min-width: 600px) {
  .page-head { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; }
  .page-head .flex { width: auto; }
}

/* ---------- Auth Layout ---------- */

.auth-wrap {
  max-width: 460px; margin: 1.5rem auto;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 1.25rem; box-shadow: var(--shadow);
}
@media (min-width: 540px) { .auth-wrap { margin: 2.5rem auto; padding: 2rem; } }
.auth-wrap h1 { font-size: 1.5rem; margin-bottom: .35rem; }
.auth-wrap > p:first-of-type { color: var(--c-text-muted); margin-bottom: 1.25rem; }
.auth-wrap .form { padding: 0; border: 0; box-shadow: none; max-width: none; }

/* ---------- Toolbar ---------- */

.toolbar {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r); padding: .65rem .85rem;
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.toolbar select, .toolbar input[type=text] {
  border: 1px solid var(--c-border-strong); border-radius: var(--r-sm);
  padding: .55rem .7rem; font: inherit; min-height: 40px;
}

/* ---------- Section ---------- */

.section { margin-block: 1.75rem; }
.section-head {
  display: flex; flex-direction: column; gap: .25rem;
  margin-bottom: .75rem;
}
.section-head h2 { margin: 0; }
.section-head p { color: var(--c-text-muted); margin: 0; font-size: .92rem; }
@media (min-width: 600px) {
  .section-head { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
}

/* ---------- Print / Aushang ---------- */

@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .main-content { padding: 0; }
}
.aushang { padding: 1rem; max-width: 800px; margin: 0 auto; }
@media (min-width: 768px) { .aushang { padding: 2rem; } }
.aushang h1 { font-size: clamp(1.5rem, 5vw, 2.2rem); margin-bottom: .25rem; }
.aushang .qr-wrapper { display: flex; justify-content: center; margin: 1.5rem 0; }
.aushang .qr-wrapper svg, .aushang .qr-wrapper img { width: min(280px, 80vw); height: auto; }

/* ---------- Icons ---------- */

.icon {
  display: inline-block; flex-shrink: 0;
  width: 1.1em; height: 1.1em;
  vertical-align: -.18em;
  stroke-width: 2;
}
.icon-sm { width: .95em; height: .95em; }
.icon-lg { width: 1.4em; height: 1.4em; vertical-align: -.25em; }
.icon-xl { width: 1.75rem; height: 1.75rem; }
.icon-xxl { width: 2.25rem; height: 2.25rem; }

/* Stat-Card-Icon im farbigen Kreis */
.stat-icon-bubble {
  display: inline-grid; place-items: center;
  width: 2.4rem; height: 2.4rem;
  border-radius: 12px;
  background: var(--c-primary-50); color: var(--c-primary-700);
  margin-bottom: .55rem;
}
.stat-icon-bubble.accent  { background: var(--c-accent-50); color: var(--c-accent); }
.stat-icon-bubble.success { background: var(--c-success-50); color: var(--c-success); }
.stat-icon-bubble.warn    { background: var(--c-warn-50); color: var(--c-warn); }
.stat-icon-bubble.info    { background: var(--c-info-50); color: var(--c-info); }
.stat-icon-bubble .icon   { width: 1.4rem; height: 1.4rem; stroke-width: 2; }

/* Section-Icon: Kreis mit Icon, neben Überschrift */
.section-head h2 .icon, .section-head h1 .icon { margin-right: .35rem; vertical-align: -.2em; }

/* Step-Icon: Nummer im einfarbigen Kreis (Regenbogen über alle Steps verteilt) */
.step-marker {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--c-text-soft); color: #fff; font-weight: 700;
  margin-right: .55rem; vertical-align: -.55rem;
  box-shadow: var(--shadow-sm);
}
/* Pro Step in einer Liste eine eigene Regenbogenfarbe */
ol > li:nth-child(1) .step-marker { background: var(--c-rb-red);    }
ol > li:nth-child(2) .step-marker { background: var(--c-rb-orange); }
ol > li:nth-child(3) .step-marker { background: #d4ad0a;            } /* Yellow etwas dunkler für Lesbarkeit */
ol > li:nth-child(4) .step-marker { background: var(--c-rb-green);  }
ol > li:nth-child(5) .step-marker { background: var(--c-rb-blue);   }
ol > li:nth-child(6) .step-marker { background: var(--c-rb-purple); }
ol > li:nth-child(7) .step-marker { background: var(--c-rb-red);    }
ol > li:nth-child(8) .step-marker { background: var(--c-rb-orange); }
ol > li:nth-child(9) .step-marker { background: #d4ad0a;            }

/* Rainbow-CTA-Button: bewusst auffällig */
.btn-rainbow {
  background: var(--rainbow); color: #fff;
  border: 0;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
  box-shadow: 0 2px 6px rgba(216,67,28,.25), 0 4px 16px -4px rgba(106,48,147,.30);
  position: relative;
}
.btn-rainbow:hover {
  color: #fff;
  filter: brightness(1.07);
  transform: translateY(-1px);
}
.btn-rainbow:active { transform: translateY(0); }
.btn-lg {
  padding: .85rem 1.4rem;
  font-size: 1rem;
  min-height: 48px;
}

/* Screenshot-Figur in der ausführlichen Anleitung */
.screenshot {
  margin: 1rem 0; padding: 0;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.screenshot img {
  width: 100%; height: auto; display: block;
  background: var(--c-surface-2);
}
.screenshot figcaption {
  padding: .55rem .85rem; font-size: .85rem;
  color: var(--c-text-muted); border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
}
.screenshot-placeholder .ph-frame {
  display: grid; place-items: center; gap: .5rem;
  min-height: 220px; padding: 2rem 1rem;
  color: var(--c-text-soft);
  background: repeating-linear-gradient(45deg, var(--c-surface-2), var(--c-surface-2) 12px, var(--c-surface) 12px, var(--c-surface) 24px);
}
.screenshot-placeholder .ph-frame code {
  background: rgba(0,0,0,.04); padding: .15rem .5rem; border-radius: var(--r-sm);
  font-size: .8rem;
}

/* Empty-State Container */
.empty-state {
  text-align: center; padding: 2rem 1rem;
  color: var(--c-text-muted);
}
.empty-state .icon-xxl { color: var(--c-text-soft); margin-bottom: .75rem; }
.empty-state h3 { margin-bottom: .5rem; color: var(--c-text); }

/* ---------- Filter-Form (für lange Filterleisten in Adminansichten) ----------
   Statt vieler Inline-styled Grids — überall, wo eine `.filters`-Form mit vielen
   Selects ist, sorgt diese Klasse für sauberes Stacking auf Mobile. */
.filters {
  display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  align-items: end;
}
.filters > div { min-width: 0; }
.filters .filter-actions { display: flex; gap: .4rem; align-items: flex-end; flex-wrap: wrap; }
.filters .filter-actions .btn { flex: 0 0 auto; }
@media (max-width: 539px) {
  .filters { grid-template-columns: 1fr; }
  .filters .filter-actions .btn { flex: 1 1 auto; }
}

/* Optional: Filter unter 600px in <details>-Drawer kollabieren */
.filters-collapsible > summary {
  list-style: none; cursor: pointer; padding: .85rem 1rem;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; min-height: 44px;
}
.filters-collapsible > summary::-webkit-details-marker,
.filters-collapsible > summary::marker { display: none; content: ""; }
.filters-collapsible > summary::after { content: "▾"; transition: transform .15s; }
.filters-collapsible[open] > summary { border-radius: var(--r) var(--r) 0 0; border-bottom: 0; }
.filters-collapsible[open] > summary::after { transform: rotate(180deg); }
.filters-collapsible > .filters {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-top: 0; border-radius: 0 0 var(--r) var(--r);
  padding: .85rem 1rem; margin: 0;
}
@media (min-width: 768px) {
  /* Auf Desktop: Drawer immer offen, Toggle ausblenden */
  .filters-collapsible > summary { display: none; }
  .filters-collapsible > .filters { border-radius: var(--r); padding: .85rem 1rem; }
}

/* ---------- Bessere Wrap-Behavior für .flex-Container ---------- */
@media (max-width: 539px) {
  /* Generische Flex-Reihen mit Buttons bleiben in der Reihe, aber Buttons werden klickbarer */
  .flex .btn-sm, .flex-between .btn-sm { min-height: 40px; }
}

/* ---------- Utility ---------- */

.muted { color: var(--c-text-muted); }
.soft  { color: var(--c-text-soft); }
.tight { margin: 0; }
.center { text-align: center; }
.flex { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; gap: .5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.flex-between > * { min-width: 0; }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.hidden { display: none; }
.no-wrap { white-space: nowrap; }
.full { width: 100%; }
@media (max-width: 599px) {
  .hide-mobile { display: none !important; }
  .full-on-mobile { width: 100% !important; }
}

/* ============================================================
   Phase-0-Erweiterungen — UX-Polish ohne Build-Step
   ============================================================ */

/* Form-Fehler am Feld (statt nur Sammel-Flash oben) */
.form-row.has-error input,
.form-row.has-error textarea,
.form-row.has-error select {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, .12);
}
.form-row .form-error {
  display: block;
  margin-top: .35rem;
  color: var(--c-danger);
  font-size: var(--text-sm);
  font-weight: 500;
}

/* Mobile-Primär-Button: 56px Touch-Ziel für Haupt-CTAs auf der Startseite */
.btn-mobile-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target-primary, 56px);
  padding: .9rem 1.4rem;
  font-size: var(--text-lg, 1.125rem);
  font-weight: 600;
  border-radius: var(--r-lg, 14px);
  background: var(--c-primary);
  color: #fff;
  text-decoration: none;
  border: 0;
  transition: background-color .15s ease;
  box-shadow: var(--shadow-md);
}
.btn-mobile-primary:hover,
.btn-mobile-primary:focus-visible {
  background: var(--c-primary-700);
  color: #fff;
}
.btn-mobile-primary.is-secondary {
  background: var(--c-surface);
  color: var(--c-text);
  border: 2px solid var(--c-border-strong);
}
.btn-mobile-primary.is-secondary:hover,
.btn-mobile-primary.is-secondary:focus-visible {
  background: var(--c-surface-2);
  border-color: var(--c-primary);
  color: var(--c-text);
}

/* Trust-Strip auf der Startseite */
.trust-strip {
  display: grid;
  gap: var(--space-3, .75rem);
  grid-template-columns: 1fr;
  margin: var(--space-6, 1.5rem) 0;
}
@media (min-width: 640px) {
  .trust-strip { grid-template-columns: repeat(3, 1fr); }
}
.trust-strip .trust-item {
  display: flex;
  gap: var(--space-3, .75rem);
  align-items: flex-start;
  padding: var(--space-4, 1rem);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md, 10px);
}
.trust-strip .trust-item .trust-icon {
  color: var(--c-primary);
  flex-shrink: 0;
}
.trust-strip .trust-item .trust-text {
  font-size: var(--text-sm, .875rem);
  line-height: 1.45;
}
.trust-strip .trust-item strong { display: block; margin-bottom: .15rem; }

/* Hero-Sektion mobile-first mit großen Touch-Targets */
.home-hero {
  padding: var(--space-7, 2rem) 0 var(--space-6, 1.5rem);
  text-align: left;
}
.home-hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 var(--space-3, .75rem);
}
.home-hero .hero-lead {
  font-size: var(--text-lg, 1.125rem);
  color: var(--c-text-muted);
  margin: 0 0 var(--space-5, 1.25rem);
  max-width: 60ch;
}
.home-hero .hero-cta {
  display: grid;
  gap: var(--space-3, .75rem);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .home-hero .hero-cta { grid-template-columns: 1fr 1fr; max-width: 36rem; }
}

/* Reduced motion: alle CSS-Transitions stilllegen */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus-Polish für Inline-Links in Fließtext (heute lückenhaft) */
a:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: var(--r-xs, 4px);
}

/* Empty-State-Komponente — etwas mehr Luft als heute */
.empty-state {
  text-align: center;
  padding: var(--space-7, 2rem) var(--space-4, 1rem);
}
.empty-state .icon-xxl { display: inline-block; margin-bottom: var(--space-3, .75rem); opacity: .65; }
.empty-state h3 { margin: 0 0 var(--space-2, .5rem); font-size: var(--text-xl, 1.25rem); }
.empty-state p  { margin: 0 0 var(--space-4, 1rem); color: var(--c-text-muted); }

/* ============================================================
   Mobile-First-Polish für Admin-Bereich (Phase-0-Erweiterung 2)
   ============================================================ */

/* Filter-Form: auf engen Screens jedes Feld 100% breit */
@media (max-width: 599px) {
  form.filters {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: var(--space-3, .75rem);
  }
  form.filters > div { min-width: 0; }
  form.filters input[type=text],
  form.filters input[type=search],
  form.filters input[type=email],
  form.filters input[type=tel],
  form.filters input[type=date],
  form.filters input[type=number],
  form.filters select,
  form.filters textarea {
    width: 100%;
    min-height: var(--touch-target, 44px);
    font-size: var(--text-base, 1rem); /* verhindert iOS-Zoom auf Focus */
  }
  form.filters .filter-actions {
    display: flex; gap: var(--space-2, .5rem);
    margin-top: var(--space-2, .5rem);
  }
  form.filters .filter-actions .btn { flex: 1 1 0; min-height: var(--touch-target, 44px); }
}

/* Admin-Tabellen im Karten-Modus: Action-Spalte zur Reihe mit Touch-Targets */
@media (max-width: 599px) {
  .data-wrap.cards-on-mobile table.data td .btn,
  .data-wrap.cards-on-mobile table.data td button {
    min-height: var(--touch-target, 44px);
    padding-block: .55rem;
  }
  .data-wrap.cards-on-mobile table.data td form {
    display: inline-flex;
  }
  /* Wenn eine Zelle mehrere kleine Aktions-Forms enthält: locker stapeln */
  .data-wrap.cards-on-mobile table.data td > form + form,
  .data-wrap.cards-on-mobile table.data td > a + form,
  .data-wrap.cards-on-mobile table.data td > form + a {
    margin-left: var(--space-2, .5rem);
  }
  /* Action-Spalte (oft die letzte) bekommt mehr Atemraum */
  .data-wrap.cards-on-mobile table.data td:last-child {
    padding-block: var(--space-3, .75rem);
    background: var(--c-surface-2);
  }
  /* Inline-`<form style="display:inline">` darf auf Mobile umbrechen */
  .data-wrap.cards-on-mobile table.data td[style*="white-space:nowrap"] {
    white-space: normal !important;
  }
}

/* Admin-Sidebar mobile: voller Touch-Bereich auf jeder Zeile */
@media (max-width: 899px) {
  .admin-sidebar a { min-height: var(--touch-target, 44px); font-size: var(--text-base, 1rem); }
  .admin-sidebar-toggle { min-height: var(--touch-target, 44px); font-size: var(--text-base, 1rem); }
}

/* Page-Head: Subtitle auf Mobile nicht zu groß */
@media (max-width: 599px) {
  .page-head h1 {
    font-size: clamp(1.4rem, 5.5vw, 1.8rem);
    line-height: 1.2;
  }
  .page-head p.muted { font-size: var(--text-sm, .875rem); }
}

/* Filter-Collapsible: deutliche Klick-Fläche auf Mobile */
.filters-collapsible summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-3, .75rem) var(--space-4, 1rem);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm, 6px);
  font-weight: 600;
  margin-bottom: var(--space-3, .75rem);
  min-height: var(--touch-target, 44px);
  display: flex;
  align-items: center;
  gap: var(--space-2, .5rem);
}
.filters-collapsible summary::-webkit-details-marker,
.filters-collapsible summary::marker { display: none; content: ""; }
.filters-collapsible summary::after { content: "▾"; margin-left: auto; color: var(--c-text-muted); }
.filters-collapsible[open] summary::after { content: "▴"; }

/* Lange Inhalte in Karten brechen sauber */
.data-wrap.cards-on-mobile table.data td { word-break: break-word; }

/* Forms im Admin: Submit-Buttons-Reihe auf Mobile sticky am unteren Rand */
@media (max-width: 599px) {
  .form-actions-sticky {
    position: sticky;
    bottom: 0;
    background: var(--c-surface);
    padding: var(--space-3, .75rem) var(--space-4, 1rem);
    margin-inline: calc(-1 * var(--space-4, 1rem));
    border-top: 1px solid var(--c-border);
    box-shadow: 0 -2px 8px rgba(15, 23, 16, .05);
    z-index: var(--z-sticky, 30);
    display: flex;
    gap: var(--space-2, .5rem);
  }
  .form-actions-sticky .btn { flex: 1 1 0; min-height: var(--touch-target, 44px); }
}

/* Größere Tap-Targets für Buttons in card-Listen auf Mobile */
@media (max-width: 599px) {
  .card .btn-sm { min-height: 40px; padding: .55rem .85rem; }
}

/* ============================================================
   Bevölkerungsschutz mobile-first: Sektionen kollabierbar
   ============================================================ */

/* Quick-Info-Strip am Seitenanfang — auf einen Blick die wichtigsten Live-Werte */
.cp-quick-info {
  display: grid;
  gap: var(--space-2, .5rem);
  grid-template-columns: 1fr;
  margin: var(--space-3, .75rem) 0 var(--space-5, 1.25rem);
}
@media (min-width: 600px) {
  .cp-quick-info { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .cp-quick-info { grid-template-columns: repeat(4, 1fr); }
}
.cp-qi-tile {
  display: flex; gap: var(--space-3, .75rem); align-items: flex-start;
  padding: var(--space-3, .75rem) var(--space-4, 1rem);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md, 10px);
  text-decoration: none;
  color: var(--c-text);
  min-height: var(--touch-target, 44px);
}
.cp-qi-tile.is-alert {
  background: linear-gradient(135deg, #fef2f2, #fff);
  border-color: #fecaca;
}
.cp-qi-tile.is-warn {
  background: linear-gradient(135deg, #fffbeb, #fff);
  border-color: #fde68a;
}
.cp-qi-tile.is-ok {
  background: linear-gradient(135deg, #f0fdf4, #fff);
  border-color: #bbf7d0;
}
.cp-qi-tile .qi-icon { font-size: 1.4rem; line-height: 1; flex-shrink: 0; padding-top: .15rem; }
.cp-qi-tile .qi-label {
  font-size: var(--text-xs, .75rem);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--c-text-soft);
  margin: 0;
}
.cp-qi-tile .qi-value {
  font-size: var(--text-lg, 1.125rem);
  font-weight: 600;
  margin: .1rem 0 0;
  font-variant-numeric: tabular-nums;
}
.cp-qi-tile .qi-sub {
  font-size: var(--text-xs, .75rem);
  color: var(--c-text-muted);
  margin-top: .15rem;
}

/* Sektion auf Mobile als kollabierbare Karte ---------------------------- */
@media (max-width: 767px) {
  section.cp-section-collapsible {
    border: 1px solid var(--c-border);
    border-radius: var(--r-md, 10px);
    background: var(--c-surface);
    margin-bottom: var(--space-3, .75rem);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    scroll-margin-top: 110px;
  }
  section.cp-section-collapsible > .section-head {
    margin: 0;
    padding: var(--space-3, .75rem) var(--space-4, 1rem);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: var(--space-2, .5rem);
    min-height: var(--touch-target, 44px);
    position: relative;
  }
  section.cp-section-collapsible > .section-head h2 {
    margin: 0;
    font-size: var(--text-lg, 1.125rem);
    flex: 1;
  }
  section.cp-section-collapsible > .section-head::after {
    content: "▾";
    color: var(--c-text-muted);
    flex-shrink: 0;
    transition: transform .15s ease;
  }
  section.cp-section-collapsible.is-open > .section-head::after {
    transform: rotate(180deg);
  }
  section.cp-section-collapsible > .section-head p.muted {
    display: none; /* Subtitel auf Mobile ausgeblendet, im Detail zu sehen */
  }
  section.cp-section-collapsible > .cp-section-content {
    display: none;
    padding: 0 var(--space-4, 1rem) var(--space-4, 1rem);
    border-top: 1px solid var(--c-border);
  }
  section.cp-section-collapsible.is-open > .cp-section-content {
    display: block;
  }
  /* Always-open-Sektionen (Warnungen, Notruf) bleiben aufgeklappt */
  section.cp-section-collapsible.is-always-open > .cp-section-content {
    display: block;
    border-top: 1px solid var(--c-border);
    padding: 0 var(--space-4, 1rem) var(--space-4, 1rem);
  }
  section.cp-section-collapsible.is-always-open > .section-head {
    cursor: default;
  }
  section.cp-section-collapsible.is-always-open > .section-head::after {
    display: none;
  }
  /* Toc-Items kompakter auf Mobile */
  .cp-toc {
    overflow-x: auto;
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .cp-toc a {
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

/* Desktop: keine Collapse-Logik. .cp-section-content rendert als normales
   Div, Toggle-Indikatoren bleiben unsichtbar, kein Button-Look. */
@media (min-width: 768px) {
  section.cp-section-collapsible > .section-head::after { display: none; }
  section.cp-section-collapsible > .section-head[role="button"] {
    cursor: default;
    pointer-events: none;
  }
  section.cp-section-collapsible > .cp-section-content { display: block; }
}

/* ============================================================
   Sprachumschalter (i18n)
   ============================================================ */

.lang-switcher {
  position: relative;
  margin-left: var(--space-3, .75rem);
  flex-shrink: 0;
}
.lang-switcher > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .75rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface);
  color: var(--c-text-muted);
  font-size: .9rem;
  font-weight: 500;
  min-height: 36px;
}
.lang-switcher > summary::-webkit-details-marker,
.lang-switcher > summary::marker { display: none; content: ""; }
.lang-switcher > summary:hover { background: var(--c-surface-2); color: var(--c-text); }
.lang-switcher .lang-switcher-current { font-size: 1rem; }
.lang-switcher .lang-switcher-caret { font-size: .75rem; color: var(--c-text-soft); }
/* Short 2-letter code: nur auf Mobile sichtbar */
.lang-switcher .lang-switcher-short {
  display: none;
  font-weight: 600;
  letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
}

.lang-switcher-list {
  list-style: none;
  margin: .4rem 0 0;
  padding: .35rem;
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  min-width: 14rem;
  max-height: 22rem;
  overflow-y: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown, 40);
}
.lang-switcher-list li { padding: 0; }
.lang-switcher-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .65rem;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--c-text);
  min-height: var(--touch-target, 44px);
}
.lang-switcher-item:hover { background: var(--c-surface-2); }
.lang-switcher-item.is-active {
  background: var(--c-primary-50);
  color: var(--c-primary-700);
  font-weight: 600;
}
.lang-switcher-item .lang-name { flex: 0 0 auto; }
.lang-switcher-item .lang-german {
  font-size: .8rem;
  color: var(--c-text-soft);
}
.lang-switcher-item .lang-status {
  margin-left: auto;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--c-text-soft);
  padding: .1rem .4rem;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
}

/* Auf engen Bildschirmen: Switcher kompakter (Globus + 2-letter Code) */
@media (max-width: 599px) {
  .lang-switcher { margin-left: 0; }
  .lang-switcher > summary {
    gap: .25rem;
    padding: .35rem .55rem;
    font-size: .82rem;
    min-height: 32px;
  }
  .lang-switcher .lang-switcher-current { font-size: .9rem; }
  .lang-switcher .lang-switcher-label { display: none; }
  .lang-switcher .lang-switcher-short { display: inline; }
  /* Dropdown am rechten Switcher-Rand verankern, Breite an Viewport binden
     — verhindert, dass Liste links aus dem Bildschirm läuft */
  .lang-switcher-list {
    right: 0;
    left: auto;
    min-width: 14rem;
    width: max-content;
    max-width: calc(100vw - 1rem);
  }
}

/* RTL-Anpassungen: Switcher-Liste am linken Rand verankern, Status-Badge spiegeln */
[dir="rtl"] .lang-switcher-list {
  right: auto;
  left: 0;
}
@media (max-width: 599px) {
  [dir="rtl"] .lang-switcher-list {
    right: auto;
    left: 0;
    max-width: calc(100vw - 1rem);
  }
}
[dir="rtl"] .lang-switcher-item .lang-status { margin-left: 0; margin-right: auto; }

/* Schwacher Body-RTL-Polish: page-head, flex-Reihen umkehren */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .page-head .flex { justify-content: flex-start; }
[dir="rtl"] .stack { text-align: right; }
