/* ==========================================================================
   Lange Nacht der Mathematik 2026 – Anmeldung (Angelaschule Osnabrück)
   Eine Datei, kein Framework. Mobile-first; CSP-konform (kein JS, keine
   Inline-Styles). Icons sind Inline-SVGs aus templates/_icons.html
   (Farbe = currentColor, Größe hier per .icon).
   Aufbau:
     1. Design-Tokens (hell / dunkel)
     2. Basis & Typografie
     3. Layout: Kopf, Inhalt, Fuß
     4. Bausteine: Icon, Karte, Button, Formular, Hinweis, Badge, Aufklapper
     5. Seiten-Module: Hero, Schritte, Fortschritt, Team, Code, Regeln, Admin
     6. Hilfsklassen, Breakpoints, Bewegung, Druck
   Kontraste: Text ≥ 4.5:1, Bedienelement-Ränder/Icons ≥ 3:1 (WCAG AA).
   ========================================================================== */

/* 1. Design-Tokens ------------------------------------------------------- */
:root {
  color-scheme: light dark;

  /* Markenfarben der Veranstaltung 2025 */
  --indigo-500: #6664e8;
  --indigo-600: #4543b8;          /* Text/Buttons auf Weiß (≈ 7:1) */
  --indigo-700: #36349a;
  --orange-500: #ff5500;          /* Akzentflächen; darauf nur dunkle Schrift */

  /* Flächen & Text */
  --bg: #f4f4fb;
  --bg-accent: #e9e8fb;
  --surface: #ffffff;
  --surface-2: #f5f5fb;
  --text: #191a2e;
  --text-muted: #53566f;          /* 6.9:1 auf Weiß */
  --line: #dcdce8;                /* nur dekorative Trennlinien */
  --border: #74768f;              /* Ränder von Eingaben/Bedienelementen: 4.5:1 */

  /* Rollen */
  --primary: var(--indigo-600);
  --primary-hover: var(--indigo-700);
  --on-primary: #ffffff;
  --primary-soft: #ececfd;
  --accent: var(--orange-500);
  --on-accent: #1d1206;           /* dunkle Schrift auf Orange: ≈ 6:1 */
  --accent-text: #b33a00;         /* Orange als Text: 5.3:1 auf Weiß */
  --accent-soft: #fff0e8;

  --ok: #17703d;   --ok-soft: #e7f5ec;
  --warn: #8a4b00; --warn-soft: #fff4e0;
  --err: #b3261e;  --err-soft: #fdecea;
  --info: var(--indigo-600); --info-soft: var(--primary-soft);

  --focus: #c43e00;               /* Fokusring: ≥ 4.5:1 auf allen hellen Flächen */

  /* Form */
  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 20px;
  --shadow: 0 1px 2px rgb(25 26 46 / .06), 0 4px 16px rgb(25 26 46 / .07);
  --shadow-lift: 0 2px 4px rgb(25 26 46 / .08), 0 10px 28px rgb(69 67 184 / .16);

  /* Abstände (4er-Raster) */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem;

  /* Typografie-Skala (nichts unter 13 px) */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-xs: .8125rem;   /* 13 px */
  --fs-sm: .875rem;    /* 14 px */
  --fs-base: 1rem;     /* 16 px */
  --fs-md: 1.125rem;   /* 18 px */
  --fs-lg: 1.3rem;     /* 21 px */
  --fs-xl: clamp(1.6rem, 1.2rem + 2vw, 2.1rem);

  --content: 48rem;
  --touch: 2.75rem;    /* 44 px Mindesthöhe für Bedienelemente */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101120;
    --bg-accent: #1a1a3a;
    --surface: #1b1c30;
    --surface-2: #24263f;
    --text: #ececf6;
    --text-muted: #b0b2cb;
    --line: #3d4068;
    --border: #8487b0;            /* 4.6:1 auf --surface */

    --primary: #a3a1ff;
    --primary-hover: #bdbcff;
    --on-primary: #14143a;
    --primary-soft: #292a52;
    --accent: #ff7a3d;
    --on-accent: #1d1206;
    --accent-text: #ff9e6e;
    --accent-soft: #35231c;

    --ok: #74d9a0;   --ok-soft: #16301f;
    --warn: #ffc56e; --warn-soft: #35290f;
    --err: #ff948b;  --err-soft: #3b1b1b;
    --info: #b8b7ff; --info-soft: var(--primary-soft);

    --focus: #ff9a66;
    --shadow: 0 1px 2px rgb(0 0 0 / .5), 0 6px 22px rgb(0 0 0 / .35);
    --shadow-lift: 0 2px 6px rgb(0 0 0 / .5), 0 12px 30px rgb(0 0 0 / .4);
  }
}

/* 2. Basis & Typografie --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background: radial-gradient(60rem 22rem at 50% -8rem, var(--bg-accent), transparent 70%), var(--bg);
  color: var(--text);
  font: var(--fs-base)/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--s3); letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: var(--fs-xl); font-weight: 800; }
h2 { font-size: var(--fs-lg); font-weight: 750; }
h3 { font-size: var(--fs-md); font-weight: 700; }
p { margin: 0 0 var(--s3); }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }
strong { font-weight: 700; }

a { color: var(--primary); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--primary-hover); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: .05em .35em; border-radius: 4px; }

/* 3. Layout --------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--content); margin: 0 auto; padding-inline: var(--s4); }

.skip-link {
  position: absolute; left: var(--s4); top: -5rem; z-index: 10;
  display: inline-flex; align-items: center; min-height: var(--touch);
  background: var(--primary); color: var(--on-primary); padding: var(--s2) var(--s4);
  border-radius: var(--radius-s); font-weight: 700;
}
.skip-link:focus { top: var(--s2); color: var(--on-primary); }

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3);
  padding-block: var(--s2);
}

.brand {
  display: inline-flex; align-items: center; gap: var(--s3);
  flex: 1 1 auto; min-width: 0; min-height: var(--touch);
  color: var(--text); text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid; place-items: center;
  width: 2.6rem; height: 2.6rem; flex: none;
  border-radius: 12px;
  background: var(--indigo-600);
  background: linear-gradient(135deg, var(--indigo-500), var(--indigo-700));
  box-shadow: inset 0 -3px 0 var(--orange-500);
  color: #fff;
}
.brand-mark .icon { width: 1.45rem; height: 1.45rem; fill: currentColor; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-title { font-weight: 800; font-size: var(--fs-base); }
.brand-short { display: none; }
.brand-sub { font-size: var(--fs-xs); color: var(--text-muted); }

.site-nav { display: flex; align-items: center; gap: var(--s2); flex: none; }
.site-nav form { margin: 0; }
.nav-user {
  display: inline-flex; align-items: center; gap: var(--s1);
  max-width: 14rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: var(--fs-sm); color: var(--text-muted);
}
.nav-link {
  display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 var(--s4);
  border-radius: 999px; font-weight: 650; text-decoration: none; font-size: var(--fs-sm);
  background: var(--primary-soft); color: var(--primary);
}
.nav-link:hover { color: var(--primary-hover); }

main { flex: 1; padding-block: var(--s4) var(--s6); }
main > * + * { margin-top: var(--s4); }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--text-muted); font-size: var(--fs-sm);
  padding-block: var(--s5);
}
.site-footer p { display: flex; gap: var(--s2); max-width: 40rem; margin: 0; }
.site-footer .icon { margin-top: .15em; }

/* 4. Bausteine ------------------------------------------------------------ */

/* Icon (Inline-SVG) */
.icon {
  width: 1.2em; height: 1.2em; flex: none;
  vertical-align: -.22em;
}
.with-icon { display: flex; align-items: center; gap: var(--s2); }

/* Karte: Kinder per gap getrennt, damit Listen/Raster keine Abstände verlieren */
.card {
  display: flex; flex-direction: column; gap: var(--s4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
  padding: var(--s5) var(--s4);
}
.card > * { margin-block: 0; }
.card > .btn { align-self: flex-start; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.card-head > * { margin: 0; }
.card-head h1, .card-head h2 { flex: 1 1 auto; }
.eyebrow {
  display: block; margin-bottom: calc(-1 * var(--s2));
  font-size: var(--fs-xs); font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-text);
}
.card--next {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface) 75%);
  box-shadow: var(--shadow-lift);
}
.card--alert { border: 2px solid var(--accent); }
.card--quiet { background: var(--surface-2); box-shadow: none; }

/* Buttons */
button, .btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--touch); padding: .6rem 1.25rem;
  border: 2px solid transparent; border-radius: 12px;
  background: var(--primary); color: var(--on-primary);
  font: inherit; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s, box-shadow .15s;
}
button:hover, .btn:hover { background: var(--primary-hover); color: var(--on-primary); }
button:active, .btn:active { transform: translateY(1px); }
.btn-lg { min-height: 3.25rem; font-size: var(--fs-md); padding-inline: 1.6rem; box-shadow: var(--shadow-lift); }
.btn-block { display: flex; width: 100%; }
.btn-secondary, button.secondary { background: transparent; color: var(--primary); border-color: currentColor; }
.btn-secondary:hover, button.secondary:hover { background: var(--primary-soft); color: var(--primary-hover); }
.btn-small { padding: .35rem .9rem; font-size: var(--fs-sm); border-radius: 10px; }   /* bleibt ≥ 44 px hoch */
button.danger, .btn-danger { background: var(--err); color: #fff; }
button.danger:hover, .btn-danger:hover { background: #8f1d17; color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #105a30; color: #fff; }
@media (prefers-color-scheme: dark) {
  button.danger, .btn-danger { color: #2a0d0b; }
  button.danger:hover, .btn-danger:hover { background: #ffb8b2; color: #2a0d0b; }
  .btn-ok { color: #0b2716; }
  .btn-ok:hover { background: #a3ebc1; color: #0b2716; }
}
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.actions > form { margin: 0; }
.actions--split { display: grid; grid-template-columns: 1fr 1fr; }
.actions--split button { width: 100%; padding-inline: .5rem; white-space: nowrap; }

/* Formulare */
form > :not(input[type=hidden]) ~ :not(input[type=hidden]) { margin-top: var(--s3); }
.field { display: flex; flex-direction: column; gap: var(--s2); }
label { font-weight: 650; }
.hint { font-size: var(--fs-sm); color: var(--text-muted); margin: 0; }
input[type=text], select {
  width: 100%; min-height: 3rem; padding: .7rem .85rem;
  border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: var(--fs-base);
}
input[type=text]::placeholder { color: var(--text-muted); }
input[type=text]:hover, select:hover { border-color: var(--primary); }
input[type=text]:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--primary); }
select {
  -webkit-appearance: none; appearance: none; padding-right: 2.6rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 1.25rem) 55%, calc(100% - .9rem) 55%;
  background-size: .38rem .38rem; background-repeat: no-repeat;
}
.input-code {
  font-family: var(--mono); font-size: 1.25rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; text-align: center;
}
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); }
.inline-form > * { margin: 0; }
.inline-form > :not(input[type=hidden]) ~ :not(input[type=hidden]) { margin-top: 0; }
.inline-form .field { flex: 1 1 10rem; }

/* Checkbox mit großer Klickfläche */
.check {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s4); border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); font-weight: 450; cursor: pointer;
}
.check:hover { border-color: var(--primary); }
.check:has(input:checked) { border-color: var(--ok); background: var(--ok-soft); }  /* Zusatz; ohne :has() unverändert nutzbar */
.check input { flex: none; width: 1.4rem; height: 1.4rem; margin: .1rem 0 0; accent-color: var(--primary); cursor: pointer; }

/* Hinweise und Flash-Meldungen: Icon + Farbe + Text, nie nur Farbe */
.notice, .flash {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--line); border-left-width: 5px; border-radius: var(--radius);
  background: var(--surface);
  margin: 0;
}
.notice-icon, .flash-icon { width: 1.5rem; height: 1.5rem; margin-top: .02rem; color: var(--info); }
.notice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s2); }
.notice-body p, .flash p { margin: 0; }

.notice--info  { border-color: var(--info);  background: var(--info-soft); }
.notice--ok    { border-color: var(--ok);    background: var(--ok-soft); }
.notice--warn  { border-color: var(--warn);  background: var(--warn-soft); }
.notice--error { border-color: var(--err);   background: var(--err-soft); }
.notice--ok .notice-icon { color: var(--ok); }
.notice--warn .notice-icon { color: var(--warn); }
.notice--error .notice-icon { color: var(--err); }

/* Flash: Kategorien aus web.py: ok, error, sonst Info */
.flashes { display: grid; gap: var(--s2); scroll-margin-top: var(--s4); }
.flash { border-color: var(--info); background: var(--info-soft); font-weight: 600; box-shadow: var(--shadow); padding-block: var(--s4); }
.flash.ok { border-color: var(--ok); background: var(--ok-soft); }
.flash.ok .flash-icon { color: var(--ok); }
.flash.error { border-color: var(--err); background: var(--err-soft); border-width: 2px 2px 2px 6px; }
.flash.error .flash-icon { color: var(--err); }

/* Badges / Statuschips */
.badges { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); margin: 0; }
.badge {
  display: inline-flex; align-items: center; gap: .3em;
  padding: .15rem .65rem; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 650; line-height: 1.5; white-space: nowrap;
  border: 1px solid var(--border); color: var(--text-muted); background: var(--surface);
}
.badge .icon { width: 1.05em; height: 1.05em; }
.badge--lead { border-color: transparent; background: var(--primary-soft); color: var(--primary); }
.badge--ok   { border-color: transparent; background: var(--ok-soft);   color: var(--ok); }
.badge--warn { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
.badge--err  { border-color: transparent; background: var(--err-soft);  color: var(--err); }

/* Aufklappbereich (Team verlassen, Admin-Details, Fehlersuche) */
details.disclosure { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
details.disclosure summary {
  display: flex; align-items: center; gap: var(--s2); min-height: var(--touch);
  padding: var(--s2) var(--s4); cursor: pointer; font-weight: 650; color: var(--text-muted); list-style: none;
}
details.disclosure summary::-webkit-details-marker { display: none; }
.disclosure-icon { transition: transform .15s; }
details.disclosure[open] .disclosure-icon { transform: rotate(90deg); }
details.disclosure summary:hover { color: var(--text); }
.danger-zone summary:hover { color: var(--err); }
details.disclosure > :not(summary) { margin: 0; padding: 0 var(--s4) var(--s4); }
details.disclosure p { color: var(--text-muted); font-size: var(--fs-sm); }

/* 5. Seiten-Module -------------------------------------------------------- */

/* Hero (Startseite, nicht angemeldet) */
.hero { padding-block: var(--s6) var(--s5); position: relative; overflow: hidden; }
.hero h1 { max-width: 22ch; }
.hero .lead { font-size: var(--fs-md); color: var(--text-muted); }
.facts { display: grid; gap: var(--s3); padding: 0; }
.facts > div {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3); border-radius: var(--radius); background: var(--surface-2);
}
.fact-icon { width: 1.5rem; height: 1.5rem; color: var(--primary); margin-top: .1rem; }
.facts dt { font-size: var(--fs-xs); font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.facts dd { margin: 0; font-weight: 600; }

/* Schrittliste „So läuft die Anmeldung“ */
.steps { list-style: none; padding: 0; display: grid; gap: var(--s4); counter-reset: step; }
.steps > li {
  counter-increment: step;
  display: grid; grid-template-columns: 2.5rem 1fr; gap: var(--s1) var(--s3);
  align-content: start; position: relative;
}
.steps > li > * { grid-column: 2; margin: 0; }
.steps > li::before {
  content: counter(step);
  grid-column: 1; grid-row: 1 / span 3;
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--primary); color: var(--on-primary); font-weight: 800;
}
.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 1.2rem; top: 2.75rem; bottom: calc(-1 * var(--s4) + .25rem);
  width: 2px; background: var(--line);
}
.steps > li:last-child::before { background: var(--accent); color: var(--on-accent); }
.steps h3 { margin-top: .45rem; font-size: var(--fs-base); }
.steps p { color: var(--text-muted); font-size: var(--fs-sm); }

/* Fortschritt (angemeldet) */
.progress { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); }
.progress li {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s1);
  font-size: var(--fs-xs); font-weight: 650; color: var(--text-muted); text-align: center;
}
.progress .dot {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface); font-weight: 800; font-size: var(--fs-sm);
}
.progress .dot .icon { width: 1rem; height: 1rem; stroke-width: 3; }
.progress li:not(:first-child)::before {
  content: ""; position: absolute; top: 1rem; right: 50%; width: 100%; height: 2px;
  background: var(--border);
}
.progress .done .dot { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.progress .done:not(:first-child)::before, .progress .current:not(:first-child)::before { background: var(--ok); }
.progress .current { color: var(--text); }
.progress .current .dot { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }

/* Platz-Anzeige: ein Punkt pro Platz */
.seats { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.seat-dots { display: inline-flex; gap: .4rem; }
.seat { width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 2px dashed var(--border); }
.seat--taken { border: 2px solid var(--primary); background: var(--primary); }
.seat--pending { border: 2px solid var(--warn); background: repeating-linear-gradient(45deg, var(--warn) 0 3px, transparent 3px 6px); }
.seats-text { margin: 0; font-weight: 600; }

/* Mitgliederliste */
.members { list-style: none; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.members li { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s3); background: var(--surface); }
.members li + li { border-top: 1px solid var(--line); }
.avatar {
  flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); font-weight: 800;
}
.member-main { flex: 1 1 8rem; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.member-name { font-weight: 650; overflow-wrap: anywhere; }
.member-meta { font-size: var(--fs-sm); color: var(--text-muted); overflow-wrap: anywhere; }

/* Teamcode: groß, gut diktier- und kopierbar */
.codebox {
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  border: 2px dashed var(--primary); border-radius: var(--radius);
  background: var(--primary-soft); padding: var(--s4); text-align: center;
}
.codebox p { margin: 0; }
.codebox-title { font-weight: 750; font-size: var(--fs-md); }
.codebox .label { font-weight: 600; font-size: var(--fs-sm); color: var(--text-muted); }
.code {
  display: inline-block; font: 800 clamp(1.8rem, 1.3rem + 3vw, 2.4rem)/1.2 var(--mono);
  letter-spacing: .16em; color: var(--text);
  background: var(--surface); padding: .35rem .8rem; border-radius: var(--radius-s);
  -webkit-user-select: all; user-select: all;
}

/* Zwei Wege (gründen / beitreten) */
.choices { display: grid; gap: var(--s4); }
.choice-or {
  display: flex; align-items: center; gap: var(--s3); margin: 0;
  color: var(--text-muted); font-weight: 700; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .08em;
}
.choice-or::before, .choice-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.choice h2 { display: flex; align-items: center; gap: var(--s2); }
.ico-round {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; flex: none;
  background: var(--primary-soft); color: var(--primary);
}
.ico-round .icon { width: 1.3rem; height: 1.3rem; }

.stat-line {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.stat-line > .icon { width: 1.5rem; height: 1.5rem; color: var(--primary); }
.stat-line p { margin: 0; }
.stat-line strong { font-size: 1.15em; color: var(--primary); }

/* Regeln */
.rules { list-style: none; padding: 0; display: grid; gap: var(--s3); counter-reset: rule; }
.rules li {
  counter-increment: rule;
  display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s3);
  padding: var(--s4); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line);
}
.rule-icon { grid-row: span 2; width: 1.75rem; height: 1.75rem; color: var(--primary); }
.rules strong { display: block; font-size: var(--fs-md); }
.rules strong::before { content: counter(rule) ". "; color: var(--accent-text); }

/* Admin */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.stat {
  padding: var(--s3); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.stat b { font-size: 1.6rem; line-height: 1.1; }
.stat span { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; }
.stat--alert { border-color: var(--accent); background: var(--accent-soft); }
.stat--alert b { color: var(--accent-text); }

.caps { list-style: none; padding: 0; display: grid; gap: var(--s3); }
.cap-row { display: grid; grid-template-columns: 1fr; gap: var(--s1); }
.cap-name { font-weight: 650; }
.cap-nums { font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }

progress {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: .75rem; border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
  background: var(--surface-2); color: var(--primary);
}
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
progress.is-full::-webkit-progress-value { background: var(--accent); }
progress.is-full::-moz-progress-bar { background: var(--accent); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 700; padding: var(--s3) var(--s3) var(--s2); }
th, td { text-align: left; padding: .6rem var(--s3); border-top: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }
td.num, th.num { text-align: right; }

.requests { list-style: none; padding: 0; display: grid; gap: var(--s3); }
.request { padding: var(--s4); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.request > * + * { margin-top: var(--s3); }
.request p { margin: 0; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin: var(--s6) 0 var(--s3); }
.section-title h2 { margin: 0; }
.team-grid { display: grid; gap: var(--s3); }
.team-card { padding: var(--s4); gap: var(--s2); }
.team-card.is-incomplete { border-left: 5px solid var(--warn); }
.team-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.team-card-head h3 { margin: 0; overflow-wrap: anywhere; }
.team-meta { font-size: var(--fs-sm); color: var(--text-muted); }
.team-card details.disclosure summary { min-height: var(--touch); font-size: var(--fs-sm); }
.member-lines { list-style: none; display: grid; gap: var(--s2); }
.member-lines li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s1) var(--s2); font-size: var(--fs-sm); }
.tags { display: inline-flex; gap: var(--s1); }
.tag { font-size: var(--fs-xs); font-weight: 650; padding: 0 .5rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); }
.tag--lead { color: var(--primary); }
.tag--warn { color: var(--warn); }
.delete-form { padding-top: var(--s2); }

/* Fehlerseite */
.error-card { align-items: center; text-align: center; padding-block: var(--s7); }
.error-card > .btn { align-self: center; }
.big-icon { color: var(--primary); }
.big-icon .icon { width: 3rem; height: 3rem; stroke-width: 1.6; }
.error-card .eyebrow { margin-bottom: 0; }

/* 6. Hilfsklassen --------------------------------------------------------- */
.muted { color: var(--text-muted); }
.ok { color: var(--ok); }
.err { color: var(--err); }
.warn { color: var(--warn); font-weight: 600; }
.small { font-size: var(--fs-sm); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.list { margin: 0; padding-left: 1.2rem; }
.list li + li { margin-top: var(--s1); }

/* Größere Bildschirme ----------------------------------------------------- */
@media (min-width: 40rem) {
  .wrap { padding-inline: var(--s5); }
  .card { padding: var(--s5) var(--s6); }
  .team-card { padding: var(--s4) var(--s5); }
  .hero { padding-block: var(--s7) var(--s6); }
  .facts { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; gap: var(--s5) var(--s4); }
  .steps > li::after { display: none; }
  .progress li { font-size: var(--fs-sm); }
  .stats { gap: var(--s3); }
  .cap-row { grid-template-columns: 1fr auto; column-gap: var(--s3); align-items: baseline; }
  .cap-row progress { grid-column: 1 / -1; }
  .team-grid { grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
}
/* Handy: Hauptbuttons über die volle Breite, kurzer Titel im Kopf */
@media (max-width: 39.99rem) {
  .btn-block-mobile { display: flex; width: 100%; }
  .card > .btn-block-mobile { align-self: stretch; }
  .actions > .btn-block-mobile, .actions > .form-grow { flex: 1 1 100%; }
  .form-grow button { width: 100%; }
  .brand-sub { display: none; }
  th, td { padding-inline: var(--s2); }
  .nav-link { padding: 0 var(--s3); }
}
@media (max-width: 34rem) {
  .nav-user { display: none; }   /* Name steht ohnehin in der Begrüßung */
  .brand-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* bleibt für Screenreader */
  .brand-short { display: inline; font-weight: 800; font-size: var(--fs-base); }
}

/* Bewegung reduzieren ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Druck: Hintergründe und Bedienelemente weg ------------------------------ */
@media print {
  body { background: #fff; color: #000; }
  .site-header nav, .site-footer, form, details { display: none; }
  .card { box-shadow: none; border-color: #999; }
}
