/* =========================================================
   Biber-Portal — Designsystem „Keynote“, Max-Planck-Gymnasium Delmenhorst
   Große Typografie, kurze Sätze, ruhige Flächen, präzise Bewegung.
   Farben: Maxe-Grün (Schullogo) und MINT-EC-Gelb.
   ========================================================= */

:root {
  --bg: #fbfbfd;
  --bg-2: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.14);
  --panel: rgba(255, 255, 255, 0.72);
  --panel-solid: #ffffff;
  --field: rgba(0, 0, 0, 0.035);
  --nav: rgba(251, 251, 253, 0.72);
  --link: #3d7a14;

  --a1: #8ab53a;   /* Maxe-Grün (Logo #a4c64d, kontrastreicher) */
  --a2: #4e8a1e;   /* Tiefgrün */
  --a3: #f2b600;   /* MINT-EC-Gelb (Logo #ffcc01, kontrastreicher) */
  --a1-rgb: 138, 181, 58;
  --grad: linear-gradient(100deg, var(--a2) 0%, var(--a1) 50%, var(--a3) 100%);

  --btn: #1d1d1f;
  --btn-ink: #ffffff;

  --ok: #1a7f37; --ok-bg: rgba(26, 127, 55, 0.10);
  --warn: #b25000; --warn-bg: rgba(245, 158, 11, 0.14);
  --err: #d70015; --err-bg: rgba(215, 0, 21, 0.08);

  --shadow: 0 1px 1px rgba(0,0,0,.02), 0 8px 24px -8px rgba(0,0,0,.10), 0 30px 60px -30px rgba(0,0,0,.16);
  --spot: rgba(var(--a1-rgb), 0.10);
  --mesh-1: rgba(164, 198, 77, 0.42);
  --mesh-2: rgba(78, 138, 30, 0.22);
  --mesh-3: rgba(255, 204, 1, 0.30);

  --r-xl: 32px; --r-lg: 24px; --r-md: 16px; --r-sm: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --display: -apple-system, "SF Pro Display", "Inter Tight", "Inter", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --text: -apple-system, "SF Pro Text", "Inter", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg-2: #0b0b0e; --ink: #f5f5f7; --ink-2: #d2d2d7; --muted: #86868b;
    --line: rgba(255,255,255,.10); --line-2: rgba(255,255,255,.18);
    --panel: rgba(22, 22, 26, 0.62); --panel-solid: #111114; --field: rgba(255,255,255,.05);
    --nav: rgba(0, 0, 0, 0.66); --link: #b5d66a;
    --a1: #a4c64d; --a2: #6fae3a; --a3: #ffcc01; --a1-rgb: 164, 198, 77;
    --btn: #f5f5f7; --btn-ink: #000000;
    --ok: #30d158; --ok-bg: rgba(48,209,88,.14); --warn: #ffb340; --warn-bg: rgba(255,179,64,.14); --err: #ff453a; --err-bg: rgba(255,69,58,.14);
    --shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 30px 80px -30px rgba(0,0,0,.9);
    --spot: rgba(var(--a1-rgb), 0.14);
    --mesh-1: rgba(164, 198, 77, 0.30); --mesh-2: rgba(78, 138, 30, 0.30); --mesh-3: rgba(255, 204, 1, 0.18);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --bg-2: #0b0b0e; --ink: #f5f5f7; --ink-2: #d2d2d7; --muted: #86868b;
  --line: rgba(255,255,255,.10); --line-2: rgba(255,255,255,.18);
  --panel: rgba(22, 22, 26, 0.62); --panel-solid: #111114; --field: rgba(255,255,255,.05);
  --nav: rgba(0, 0, 0, 0.66); --link: #b5d66a;
  --a1: #a4c64d; --a2: #6fae3a; --a3: #ffcc01; --a1-rgb: 164, 198, 77;
  --btn: #f5f5f7; --btn-ink: #000000;
  --ok: #30d158; --ok-bg: rgba(48,209,88,.14); --warn: #ffb340; --warn-bg: rgba(255,179,64,.14); --err: #ff453a; --err-bg: rgba(255,69,58,.14);
  --shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 30px 80px -30px rgba(0,0,0,.9);
  --spot: rgba(var(--a1-rgb), 0.14);
  --mesh-1: rgba(164, 198, 77, 0.30); --mesh-2: rgba(78, 138, 30, 0.30); --mesh-3: rgba(255, 204, 1, 0.18);
  color-scheme: dark;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 17px/1.47 var(--text); letter-spacing: -.012em; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .88em; padding: .08em .4em; border-radius: 6px; background: var(--field); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: rgba(var(--a1-rgb), .28); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline { display: inline; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.mono { font-family: var(--mono); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 8px; }

/* ---------- Hintergrund ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.bg-mesh { position: absolute; inset: -20%; filter: blur(90px) saturate(140%); opacity: .9; }
.bg-mesh i { position: absolute; border-radius: 50%; will-change: transform; }
.bg-mesh i:nth-child(1) { width: 52vmax; height: 52vmax; left: 8%; top: -8%; background: radial-gradient(circle, var(--mesh-1), transparent 65%); animation: orbit-a 36s var(--ease-in-out) infinite alternate; }
.bg-mesh i:nth-child(2) { width: 46vmax; height: 46vmax; right: 2%; top: 6%; background: radial-gradient(circle, var(--mesh-2), transparent 65%); animation: orbit-b 42s var(--ease-in-out) infinite alternate; }
.bg-mesh i:nth-child(3) { width: 40vmax; height: 40vmax; left: 34%; top: 38%; background: radial-gradient(circle, var(--mesh-3), transparent 65%); animation: orbit-c 30s var(--ease-in-out) infinite alternate; }
@keyframes orbit-a { to { transform: translate(14vw, 8vh) scale(1.15); } }
@keyframes orbit-b { to { transform: translate(-12vw, 16vh) scale(.9); } }
@keyframes orbit-c { to { transform: translate(-10vw, -14vh) scale(1.2); } }
.bg-grid {
  position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%);
}
.bg-grain {
  position: absolute; inset: 0; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 30; height: 52px;
  background: var(--nav); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { height: 100%; width: min(1080px, calc(100% - 44px)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: .95rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 2px; font-size: .82rem; }
.nav-links a, .nav-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  color: var(--ink-2); background: none; border: 0; font: inherit; cursor: pointer; transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-btn:hover { color: var(--ink); text-decoration: none; background: var(--field); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--grad); }
.nav-user { padding: 8px 12px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-links svg { width: 15px; height: 15px; }
.theme { width: 34px; height: 34px; justify-content: center; padding: 0; }

/* ---------- Layout ---------- */
main { width: min(1080px, calc(100% - 44px)); margin: 0 auto; padding: 8px 0 80px; flex: 1; }
.foot { width: min(1080px, calc(100% - 44px)); margin: 0 auto; padding: 22px 0 40px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .76rem; }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

/* ---------- Typografie ---------- */
.hero { text-align: center; padding: clamp(56px, 11vh, 120px) 0 clamp(36px, 6vh, 64px); }
.hero.tight { padding: clamp(40px, 7vh, 72px) 0 36px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: .95rem; font-weight: 600; color: var(--muted); letter-spacing: -.005em; }
.display {
  margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -.045em; line-height: 1.02;
  font-size: clamp(3rem, 9vw, 6.4rem);
}
.hero.tight .display { font-size: clamp(2.6rem, 7vw, 5rem); }
.sub { margin: 20px auto 0; max-width: 640px; font-family: var(--display); font-size: clamp(1.25rem, 2.6vw, 1.75rem); line-height: 1.25; font-weight: 600; letter-spacing: -.022em; color: var(--muted); }
.fine { margin: 18px 0 0; font-size: .82rem; color: var(--muted); }
.kicker { font-size: .78rem; font-weight: 600; letter-spacing: .01em; color: var(--muted); }
.h2 { margin: 0; font-family: var(--display); font-size: clamp(1.8rem, 3.6vw, 2.5rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.08; }
.h3 { margin: 0 0 8px; font-family: var(--display); font-size: 1.45rem; font-weight: 700; letter-spacing: -.028em; line-height: 1.15; }

.live { width: 8px; height: 8px; border-radius: 50%; background: var(--a1); box-shadow: 0 0 0 0 rgba(var(--a1-rgb), .55); animation: live 2.2s var(--ease) infinite; }
.live.phase-wettbewerb { background: var(--a3); }
.live.phase-pause, .live.phase-beendet { background: var(--muted); animation: none; }
@keyframes live { 70% { box-shadow: 0 0 0 9px rgba(var(--a1-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--a1-rgb), 0); } }

/* Wort-für-Wort-Reveal (per JS aufgeteilt) */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.wi { display: inline-block; }
.js [data-split] .wi { transform: translateY(105%); opacity: 0; filter: blur(8px); }
.js.is-ready [data-split] .wi { animation: word-in .95s var(--ease) forwards; animation-delay: calc(80ms + var(--d, 0) * 70ms); }
@keyframes word-in { to { transform: none; opacity: 1; filter: blur(0); } }
.js [data-split] .grad-word { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Scroll-Reveal */
.js .reveal { opacity: 0; transform: translateY(24px) scale(.985); filter: blur(6px); transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .reveal.in { opacity: 1; transform: none; filter: none; }

.hero-cta { margin-top: 38px; }
.dev-login { display: flex; gap: 8px; justify-content: center; margin: 28px auto 0; max-width: 420px; }
.dev-login input { flex: 1; }

/* ---------- Formularfelder ---------- */
input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--field); border: 1px solid transparent;
  border-radius: var(--r-sm); padding: 11px 14px; min-width: 0; transition: border-color .2s, box-shadow .2s, background .2s;
}
input:hover, select:hover { background: var(--line); }
input:focus, select:focus, textarea:focus { outline: none; background: var(--panel-solid); border-color: var(--link); box-shadow: 0 0 0 4px rgba(var(--a1-rgb), .22); }

/* ---------- Buttons ---------- */
.btn {
  --mx: 0px; --my: 0px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 0; cursor: pointer;
  font: 500 .98rem/1.2 var(--text); letter-spacing: -.01em; text-decoration: none !important; white-space: nowrap;
  transform: translate(var(--mx), var(--my));
  transition: transform .35s var(--ease), background .2s, color .2s, box-shadow .3s var(--ease), opacity .2s;
}
.btn:active { transform: translate(var(--mx), var(--my)) scale(.96); }
.btn-primary { font-weight: 600; color: var(--btn-ink); background: var(--btn); overflow: hidden; isolation: isolate; box-shadow: 0 10px 30px -12px rgba(0,0,0,.45); }
.btn-primary::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grad); opacity: 0; transition: opacity .5s var(--ease); }
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover { color: #fff; box-shadow: 0 16px 40px -12px rgba(var(--a1-rgb), .6); }
.btn-primary::after { content: ""; position: absolute; inset: 0; transform: translateX(-130%) skewX(-18deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); }
.btn-primary:hover::after { animation: sheen 1s var(--ease); }
@keyframes sheen { to { transform: translateX(130%) skewX(-18deg); } }
.btn-xl { padding: 17px 30px; font-size: 1.06rem; font-weight: 600; }
.btn-lg { padding: 14px 24px; }
.btn-quiet { color: var(--ink); background: var(--field); }
.btn-quiet:hover { background: var(--line-2); }
.btn-ghost { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn-danger { color: #fff; background: var(--err); }
.btn[disabled] { opacity: .35; cursor: not-allowed; }
.btn svg { transition: transform .35s var(--ease); }
.btn:hover svg.arrow, .btn:hover .ext { transform: translateX(3px); }
.link { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; font: inherit; color: var(--link); cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--field); color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s, transform .3s var(--ease); }
.icon:hover { background: var(--line-2); color: var(--ink); }
.icon:active { transform: scale(.92); }
.icon.danger:hover { color: var(--err); background: var(--err-bg); }
.icon svg { width: 15px; height: 15px; }

/* ---------- Panels ---------- */
.panel {
  position: relative; overflow: hidden; border-radius: var(--r-xl); background: var(--panel);
  backdrop-filter: saturate(170%) blur(24px); -webkit-backdrop-filter: saturate(170%) blur(24px);
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
/* Spotlight folgt dem Mauszeiger */
.spot::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease);
  background: radial-gradient(480px circle at var(--sx, 50%) var(--sy, 0%), var(--spot), transparent 60%);
}
.spot:hover::before { opacity: 1; }
.spot > * { position: relative; }

/* ---------- Zugangsdaten ---------- */
.cred { max-width: 820px; margin: 0 auto; padding: clamp(24px, 4vw, 44px); }
.cred::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--grad); opacity: .8; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.tag { padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--ink-2); background: var(--field); }
.field { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.idx { font-family: var(--mono); font-size: .8rem; color: var(--muted); transition: color .4s; }
.field.is-done .idx, .go.is-done .idx { color: var(--ok); }
.k { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.v { display: block; font-family: var(--mono); font-size: clamp(1.45rem, 3.6vw, 2.1rem); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.secret.is-hidden { letter-spacing: .12em; color: var(--muted); }
.field-act { display: flex; gap: 8px; }
.copy .ico { position: relative; width: 16px; height: 16px; display: inline-grid; }
.copy .ico svg { position: absolute; inset: 0; width: 16px; height: 16px; transition: transform .45s var(--spring), opacity .25s; }
.copy .ico svg + svg { transform: scale(.3) rotate(-30deg); opacity: 0; }
.copy.done { background: var(--ok-bg); color: var(--ok); }
.copy.done .ico svg:first-child { transform: scale(.3); opacity: 0; }
.copy.done .ico svg + svg { transform: none; opacity: 1; }
.meter { height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; margin: 2px 0 0; }
.meter i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .9s var(--ease); }
.go { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; align-items: center; padding-top: 26px; }
.go-main { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.go-links { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: .95rem; }
.hint { margin: 14px 0 0 60px; font-size: .84rem; color: var(--muted); }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1080px; margin: 28px auto 0; }
.tile { position: relative; overflow: hidden; padding: 28px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: saturate(170%) blur(24px); -webkit-backdrop-filter: saturate(170%) blur(24px); }
.tile p { margin: 0; color: var(--ink-2); }
.tile .k { margin-bottom: 14px; }
.mega { font-family: var(--display); font-weight: 700; letter-spacing: -.06em; line-height: .9; font-size: clamp(4.5rem, 10vw, 7rem); margin: 0 0 8px !important; }
.mega span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.tile-foot { font-weight: 600; color: var(--ink) !important; }
.timeline { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 14px 1fr auto; align-items: baseline; column-gap: 12px; padding: 9px 0; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); }
.timeline li strong { color: var(--ink); font-size: .9rem; font-weight: 600; }
.tl-dot { align-self: center; width: 10px; height: 10px; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 2px var(--line-2); }
.timeline li.done .tl-dot { background: var(--muted); box-shadow: none; }
.timeline li.done strong { color: var(--muted); }
.timeline li.now .tl-dot { background: var(--a1); box-shadow: 0 0 0 4px rgba(var(--a1-rgb), .2), 0 0 14px rgba(var(--a1-rgb), .7); animation: live 2.2s var(--ease) infinite; }
.bold-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.bold-list li { font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -.025em; line-height: 1.2; }
.bold-list li span { display: block; font-family: var(--text); font-weight: 400; font-size: .92rem; letter-spacing: -.01em; color: var(--muted); }

/* Startseite: drei Schritte */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: clamp(40px, 8vh, 90px); }
.steps .tile { padding: 30px 28px 34px; }
.steps .num { display: block; font-family: var(--mono); font-size: .8rem; color: var(--muted); margin-bottom: 42px; }
.steps h3 { margin: 0 0 6px; font-family: var(--display); font-size: 1.9rem; font-weight: 700; letter-spacing: -.04em; }

/* Leere Zustände */
.empty { max-width: 680px; margin: 0 auto; padding: clamp(32px, 6vw, 56px); text-align: center; }
.empty .h3 { font-size: 1.8rem; }
.empty p { color: var(--ink-2); margin: 8px 0 0; }

/* ---------- Hinweise ---------- */
.notice, .alert, .banner { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 820px; margin: 0 auto 22px; padding: 13px 20px; border-radius: 999px; font-size: .92rem; text-align: center; }
.notice { background: var(--panel-solid); box-shadow: var(--shadow); color: var(--ink); font-weight: 500; }
.notice::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--a3); flex: none; }
.banner { background: var(--field); color: var(--ink-2); }
.alert { border-radius: var(--r-md); justify-content: flex-start; text-align: left; }
.alert.error { background: var(--err-bg); color: var(--err); }
.alert.success { background: var(--ok-bg); color: var(--ok); }
.hero .alert { max-width: 520px; margin: 26px auto 0; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 60; transform: translate(-50%, 16px) scale(.96); opacity: 0; padding: 12px 20px; border-radius: 999px; white-space: nowrap; font-size: .9rem; font-weight: 600; color: var(--btn-ink); background: var(--btn); box-shadow: 0 20px 40px -12px rgba(0,0,0,.5); transition: opacity .25s, transform .5s var(--spring); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- Druck ---------- */
.print-card { display: none; }
@media print {
  .bg, .nav, .foot, main > *:not(.print-card), .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .print-card { display: block !important; border: 1.5px dashed #000; border-radius: 14px; padding: 24px; max-width: 480px; font: 13pt/1.5 var(--text); }
  .print-card h2 { margin: 0 0 10px; font-size: 15pt; }
}

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
  .bento, .steps { grid-template-columns: 1fr; }
  .steps .num { margin-bottom: 18px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  main, .nav-inner, .foot { width: calc(100% - 32px); }
  .nav-user, .nav-links .lbl { display: none; }
  .nav-links a, .nav-btn { padding: 8px 9px; }
  .field { grid-template-columns: 28px minmax(0, 1fr); gap: 10px 12px; padding: 18px 0; }
  .field-act { grid-column: 1 / -1; }
  .field-act .btn { flex: 1; }
  .go { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
  .go .idx { padding-top: 18px; }
  .go-main .btn-xl { width: 100%; }
  .hint { margin-left: 40px; }
  .notice, .banner { border-radius: var(--r-md); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js [data-split] .wi { opacity: 1; transform: none; filter: none; }
}

/* =========================================================
   Verwaltung
   ========================================================= */
.segmented { display: flex; width: max-content; max-width: 100%; margin: 0 auto 28px; padding: 4px; gap: 2px; border-radius: 999px; background: var(--field); overflow-x: auto; }
.segmented a { padding: 8px 18px; border-radius: 999px; font-size: .86rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: background .25s var(--ease), color .2s, box-shadow .25s; }
.segmented a:hover { text-decoration: none; background: var(--panel-solid); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 24px 24px 22px; }
.stat .k { margin: 0; }
.stat-num { margin: 0 0 6px; font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 5vw, 3.6rem); letter-spacing: -.055em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat.is-warn .stat-num span { background: linear-gradient(100deg, var(--a3), #f97316); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bar { display: block; height: 3px; margin-top: 14px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width 1.2s var(--ease); }

.block { padding: clamp(24px, 3.4vw, 40px); margin-bottom: 20px; }
.block-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-bottom: 26px; }
.block-head > div:first-of-type { flex: 1 1 260px; }
.block-head .num { align-self: flex-start; padding-top: 10px; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.block-head p { margin: 6px 0 0; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 260px; padding: 28px; text-align: center;
  border-radius: var(--r-lg); border: 1.5px dashed var(--line-2); background: var(--field);
  transition: border-color .3s, background .3s, transform .4s var(--ease);
}
.dropzone.drag { border-color: var(--a1); background: rgba(var(--a1-rgb), .08); transform: scale(1.012); }
.drop-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--panel-solid); box-shadow: var(--shadow); margin-bottom: 4px; }
.dropzone.drag .drop-icon { animation: bob 1s var(--ease-in-out) infinite alternate; }
@keyframes bob { to { transform: translateY(-6px); } }
.file-name { color: var(--ink-2); min-height: 1.2em; }
.howto { list-style: none; counter-reset: h; padding: 0; margin: 0; display: grid; gap: 22px; align-content: center; }
.howto li { display: grid; gap: 2px; padding-left: 0; }
.howto strong { font-family: var(--display); font-size: 1.25rem; letter-spacing: -.025em; }
.howto span { color: var(--muted); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input { width: 180px; }
.table-wrap { overflow-x: auto; margin: 0 -8px; }
.table-wrap.scroll { max-height: min(68vh, 720px); overflow: auto; overscroll-behavior: contain; border-radius: var(--r-md); box-shadow: inset 0 -1px 0 var(--line); }
.table-wrap.scroll thead th { position: sticky; top: 0; z-index: 2; background: var(--panel-solid); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: left; font-size: .74rem; font-weight: 600; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.data td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data td small { display: block; color: var(--muted); font-size: .8rem; }
table.data tbody tr { transition: background .2s; }
table.data tbody tr:hover { background: var(--field); }
table.data.compact td { padding: 9px 8px; }
.row-open td { background: var(--warn-bg); }
.empty-cell { text-align: center; color: var(--muted); padding: 36px !important; }
.table-foot { margin: 14px 0 0; }
.assign-form { display: flex; gap: 6px; align-items: center; }
.assign-form input { width: 100%; min-width: 150px; padding: 8px 12px; font-family: var(--mono); font-size: .86rem; }
.assign-form input.missing { background: var(--warn-bg); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--field); color: var(--muted); white-space: nowrap; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.warn { background: var(--warn-bg); color: var(--warn); }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px 16px; }
.settings-grid label { display: flex; flex-direction: column; gap: 7px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.settings-grid label small { font-weight: 400; }
.settings-grid .wide { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.switch { flex-direction: row !important; align-items: center; gap: 14px !important; cursor: pointer; color: var(--ink) !important; font-size: .95rem !important; font-weight: 500 !important; }
.switch input { position: absolute; opacity: 0; }
.track { position: relative; width: 51px; height: 31px; border-radius: 99px; background: var(--line-2); transition: background .3s var(--ease); flex: none; }
.thumb { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.2); transition: transform .45s var(--spring); }
.switch input:checked + .track { background: #34c759; }
.switch input:checked + .track .thumb { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--link); outline-offset: 3px; }

.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.audit { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; max-height: 300px; overflow: auto; font-size: .86rem; }
.audit li { display: grid; grid-template-columns: 112px 1fr; gap: 10px; color: var(--ink-2); }
.audit time { color: var(--muted); font-variant-numeric: tabular-nums; }
.danger-zone .k { color: var(--err); }
.clear-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 12px; }
.clear-form input { flex: 1 1 180px; }

.issues { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; color: var(--warn); font-size: .92rem; }
.issues .err { color: var(--err); }
.radio-cards { border: 0; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-cards legend { margin-bottom: 14px; }
.radio-cards label { display: flex; gap: 12px; padding: 18px; border-radius: var(--r-md); background: var(--field); cursor: pointer; box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .25s var(--ease), background .25s; }
.radio-cards label:has(input:checked) { background: var(--panel-solid); box-shadow: inset 0 0 0 2px var(--link); }
.radio-cards span { display: flex; flex-direction: column; gap: 2px; }
.radio-cards strong { font-family: var(--display); font-size: 1.1rem; letter-spacing: -.02em; }
.radio-cards small { color: var(--muted); }
.radio-cards input { accent-color: var(--link); margin-top: 5px; }

@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .duo { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .radio-cards { grid-template-columns: 1fr; }
  .audit li { grid-template-columns: 1fr; gap: 0; }
  .filters, .filters input, .filters select { width: 100%; }
}


/* ---------- Einzelne Zugänge ---------- */
.cred-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 16px; }
.cred-form label { display: flex; flex-direction: column; gap: 7px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.cred-form label small { font-weight: 400; }
.cred-form .span2 { grid-column: span 2; }
.cred-form .wide { grid-column: 1 / -1; }
.cred-form input.mono { font-family: var(--mono); font-size: 1rem; letter-spacing: .01em; }
.cred-form .opt { font-weight: 400; color: var(--muted); opacity: .8; }
.cred-form .actions { align-items: center; margin-top: 4px; }
.form-note { margin-right: auto; }
.form-panel { max-width: 860px; margin: 0 auto 20px; }
.form-panel .form-note { flex-basis: 100%; margin-bottom: 4px; }
::placeholder { color: var(--muted); font-weight: 400; opacity: .75; }
.meta-line { margin: 0 0 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); font-size: .84rem; color: var(--muted); }
.cred-form input:user-invalid { border-color: var(--err); box-shadow: 0 0 0 4px var(--err-bg); }
@media (max-width: 900px) {
  .cred-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cred-form { grid-template-columns: 1fr; }
  .cred-form .span2 { grid-column: auto; }
  .cred-form .actions .btn { flex: 1 1 auto; }
  .form-note { flex-basis: 100%; }
}

/* =========================================================
   Schul-Branding: Max-Planck-Gymnasium Delmenhorst · MINT-EC
   ========================================================= */

/* Logos in Hell- und Dunkelvariante */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: inline-block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline-block; }

/* Marke in der Navigation */
.brand img { height: 30px; width: auto; transition: transform .6s var(--spring); }
.brand:hover img { transform: rotate(-6deg) scale(1.06); }
.brand-text { display: grid; line-height: 1.1; }
.brand-text small { font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* Logoleiste auf der Startseite */
.school-logos { display: flex; align-items: center; justify-content: center; gap: clamp(18px, 4vw, 34px); margin: 0 auto 30px; }
.school-logos img { height: clamp(70px, 11vw, 104px); width: auto; }
.school-logos .mintec img { height: clamp(42px, 6.6vw, 62px); }
.school-logos .sep { width: 1px; align-self: stretch; background: var(--line-2); }
.school-logos a:hover { text-decoration: none; opacity: .85; }

/* Abschnitt „Am Maxe“ */
.school { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.school .tile p + p { margin-top: 10px; }
.school .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.school .badge { padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--ink-2); background: var(--field); box-shadow: inset 0 0 0 1px var(--line); }
.school .badge.mint { color: #5c4500; background: rgba(255, 204, 1, .28); box-shadow: none; }
.school .badge.green { color: #2f5a0e; background: rgba(164, 198, 77, .28); box-shadow: none; }
:root[data-theme="dark"] .school .badge.mint { color: #ffe27a; }
:root[data-theme="dark"] .school .badge.green { color: #cfe79a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .school .badge.mint { color: #ffe27a; }
  :root:not([data-theme="light"]) .school .badge.green { color: #cfe79a; }
}
.school .contact { font-style: normal; color: var(--ink-2); line-height: 1.6; }

/* Fußzeile mit Logos */
.foot { align-items: center; }
.foot-school { display: flex; align-items: center; gap: 14px; }
.foot-school img { height: 34px; width: auto; }
.foot-school .foot-mintec img { height: 22px; }
.foot-school span { display: grid; line-height: 1.35; }
.foot-school strong { color: var(--ink-2); font-weight: 600; }

/* Druck: Schulname auf der Zugangskarte */
.print-card .print-logos { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.print-card .print-logos img { height: 48px; width: auto; }
.print-card .print-logos img + img { height: 30px; }
.print-card .print-school { margin: 14px 0 0; font-size: 10pt; color: #444; }
@media print { .print-card .logo-dark { display: none !important; } .print-card .logo-light { display: inline-block !important; } }

@media (max-width: 900px) {
  .school { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .brand-text small { display: none; }
  .foot-school img { height: 28px; }
  .foot-school .foot-mintec { display: none; }
}

/* =========================================================
   Lehrkräfte: Gruppenauswahl und Kartendruck (DIN A4)
   ========================================================= */
.group-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 26px; }
.group-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--field); cursor: pointer; transition: background .2s, box-shadow .2s; }
.group-row:hover { background: var(--line); }
.group-row:has(input:checked) { background: var(--panel-solid); box-shadow: inset 0 0 0 2px var(--link); }
.group-row input { width: 18px; height: 18px; accent-color: var(--link); margin: 0; }
.group-name { flex: 1; font-weight: 600; }
.cards-options { margin-bottom: 22px; }
.page-teacher .duo { margin-top: 0; }

/* Druckbogen: auf dem Bildschirm als weißes Papier */
.page-cards main { width: min(1080px, calc(100% - 32px)); }
.sheet-bar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 18px auto 26px; padding: 14px 20px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: saturate(170%) blur(24px); -webkit-backdrop-filter: saturate(170%) blur(24px); }
.sheet-bar > div:first-child { display: grid; gap: 2px; }
.sheet-bar .muted { font-size: .84rem; }
.sheets { display: grid; justify-content: center; gap: 28px; overflow-x: auto; padding-bottom: 20px; }

.sheet {
  --cols: 2; --rows: 4;
  position: relative; width: 210mm; height: 297mm; padding: 10mm; box-sizing: border-box;
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr);
  background: #fff; color: #111; box-shadow: 0 20px 50px -20px rgba(0,0,0,.35); border-radius: 2px;
  font-family: var(--text); letter-spacing: 0;
}
.sheet.n10 { --rows: 5; }
.sheet.n12 { --cols: 3; }
.sheet-no { position: absolute; right: 10mm; bottom: 3.5mm; font-size: 7pt; color: #888; }

.card { display: flex; flex-direction: column; gap: 2.2mm; padding: 5mm 6mm; border: .3mm dashed #9a9a9a; margin: -.15mm; overflow: hidden; }
.card.blank { background: repeating-linear-gradient(135deg, transparent 0 3mm, #f3f3f3 3mm 3.4mm); }
.card-head { display: flex; align-items: center; gap: 2.5mm; padding-bottom: 2mm; border-bottom: .6mm solid #a4c64d; }
.card-head img { height: 9mm; width: auto; }
.card-head span { display: grid; flex: 1; line-height: 1.2; }
.card-head strong { font-size: 10pt; }
.card-head small { font-size: 7pt; color: #555; }
.card-name em { flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; font-weight: 700; font-size: 8.5pt; padding: .5mm 2.2mm; border-radius: 99px; background: #ffcc01; color: #3d2f00; }
.card-name { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 2mm; font-size: 11pt; font-weight: 700; }
.card-name span { min-width: 0; overflow-wrap: anywhere; }
.card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 1.2mm 3mm; align-items: baseline; }
.card dt { font-size: 7.5pt; color: #555; }
.card dd { margin: 0; font-family: var(--mono); font-size: 12.5pt; font-weight: 700; overflow-wrap: anywhere; }
.card-foot { margin-top: auto; font-size: 7pt; line-height: 1.35; color: #444; }
.card-foot b { color: #111; }

.sheet.n10 .card { padding: 3.5mm 5mm; gap: 1.5mm; }
.sheet.n10 .card-head img { height: 7mm; }
.sheet.n12 .card { padding: 4mm; }
.sheet.n12 .card-head img { height: 7mm; }
.sheet.n12 .card dd { font-size: 10.5pt; }
.sheet.n12 .card dl { grid-template-columns: 1fr; gap: .3mm; }
.sheet.n12 .card-name { font-size: 10pt; }

@media print {
  @page { size: A4 portrait; margin: 0; }
  body.page-cards { background: #fff !important; }
  body.page-cards main { width: auto; padding: 0; margin: 0; }
  body.page-cards main > .sheets { display: block !important; padding: 0; gap: 0; overflow: visible; }
  body.page-cards .sheet-bar { display: none !important; }
  body.page-cards .sheet { box-shadow: none; border-radius: 0; break-after: page; page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.page-cards .sheet:last-child { break-after: auto; page-break-after: auto; }
}
.card-howto { display: none; margin: 1mm 0 0; font-size: 7.5pt; line-height: 1.35; color: #333; }
.sheet.n8 .card-howto { display: block; }
.sheet.n8 .card-name { font-size: 13pt; }
.sheet.n8 .card dd { font-size: 15pt; }
.sheet.n12 .card-head strong { font-size: 9pt; }
.groups-import { display: grid; gap: 14px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.groups-import p { margin: 0; }
.groups-import-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.groups-import-row input[type="file"] { flex: 1 1 260px; }
.group-row input { flex: none; }
.chips { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.confirm-form .switch { display: flex; margin-bottom: 18px; }
