/* ============================================================
   IFPAA — Landingpage
   Helles, professionelles Institut-Design (Corporate Identity)
   ============================================================ */

:root {
  /* Farben — Corporate-Identity-Palette */
  --bg: #f8f9fb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d0d5dd;

  --text: #23272f;
  --text-muted: #667085;

  --primary: #0f2238;
  --primary-hover: #16304d;

  --accent: #3f6d92;
  --accent-dim: rgba(63, 109, 146, 0.08);
  --accent-glow: rgba(63, 109, 146, 0.18);

  --error: #d92d20;
  --error-dim: rgba(217, 45, 32, 0.08);

  /* Schatten (neutral, an --primary angelehnt) */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 8px 20px -6px rgba(16, 24, 40, 0.12), 0 2px 6px -2px rgba(16, 24, 40, 0.06);

  /* Typografie */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;

  /* Rhythmus */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  --radius: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Reset & Basis ===== */
*, *::before, *::after { box-sizing: border-box; }

/* iOS/Android legen beim Antippen ein graues Rechteck über das Element. Das
   folgt der Box des angetippten Elements, nicht seiner sichtbaren Form: bei
   den Chips liegt der Klickbereich am <label>, die Pillenform aber am <span>
   darin, weshalb kurz ein eckiger Kasten um eine runde Pille aufblitzte.
   Die Rückmeldung übernehmen die eigenen :active- und :checked-Zustände. */
a, button, label, summary, input, select, textarea,
[role="button"], .aims-doc, .aims-file, .aims-tab {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: inline-block; vertical-align: middle; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--primary);
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

p { margin: 0 0 var(--space-4); }

a { color: var(--accent); }
a:hover { color: var(--primary-hover); }

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

::selection { background: var(--accent-glow); color: var(--primary); }
/* In dunklen Bereichen (Terminal, AIMS-Fenster) braucht die Markierung
   helle Schrift auf kräftigerem Grund */
.terminal ::selection,
.aims-window ::selection {
  background: rgba(138, 177, 214, 0.45);
  color: #ffffff;
}
/* Dunkel gefüllte Flächen (Buttons, aktive Sprachwahl): die globale Markierung
   setzt dunkle Schrift, die auf Navy unlesbar wäre. Hier hell markieren. */
.btn-primary::selection,
.btn-primary *::selection,
.lang-link.is-active::selection,
.lang-link.is-active *::selection {
  background: rgba(255, 255, 255, 0.32);
  color: #ffffff;
}
/* Das helle Dokument-Blatt im dunklen Viewer markiert wieder dunkel */
.aims-sheet ::selection {
  background: rgba(63, 109, 146, 0.3);
  color: var(--primary);
}

/* Honeypot: für Menschen unsichtbar, für Bots ein verlockendes Feld */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.container {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container-narrow { max-width: 46rem; margin: 0 auto; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.8rem 1.6rem;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease),
              color 200ms var(--ease), box-shadow 200ms var(--ease), transform 150ms var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 0.5rem 1rem; min-height: 40px; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.2rem; font-size: 1.05rem; }

/* ===== Topbar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 249, 251, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0.7rem var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  padding: 0.2rem;
  font-family: var(--font-mono);
}
.lang-link {
  padding: 0.3rem 0.6rem;
  border-radius: 100px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}
.lang-link:hover { color: var(--primary); }
.lang-link.is-active {
  background: var(--primary);
  color: #ffffff;
}
.lang-link.is-active:hover { color: #ffffff; }

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--primary);
  text-decoration: none;
}
.wordmark-sigil { width: 32px; height: 32px; flex-shrink: 0; object-fit: contain; }
.wordmark-text { display: flex; flex-direction: column; line-height: 1.2; }
.wordmark-text strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.wordmark-sub {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 82svh;
  display: flex;
  align-items: center;
  padding: var(--space-24) 0 var(--space-16);
  background: var(--bg);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, var(--accent-dim), transparent 70%);
}
/* feines Raster als dezentes Institutsmotiv */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 34, 56, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 34, 56, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 30%, black 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 30%, black 25%, transparent 75%);
}
.hero-scanline {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}
.hero-inner { position: relative; text-align: center; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-8);
}
.eyebrow::before { content: "// "; color: var(--text-muted); }

.hero-title {
  font-size: clamp(2.5rem, 6.8vw, 4.8rem);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: var(--space-6);
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}
.hero-lead {
  max-width: 42rem;
  margin: 0 auto var(--space-6);
  font-size: 1.1rem;
  color: var(--text-muted);
}
/* Knappe, scannbare Produkt-Verankerung: sagt in einem Blick, was das ist */
.hero-spec {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1rem;
  margin: 0 auto var(--space-8);
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hero-spec span { white-space: nowrap; }
.hero-spec span::before { content: "// "; color: var(--accent); }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.hero-note {
  max-width: 34rem;
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ===== AIMS-Terminal ===== */
.section-terminal {
  padding-top: 0;
  margin-top: calc(-1 * var(--space-8));
  position: relative;
  z-index: 2;
}
.terminal {
  background: var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -24px rgba(15, 34, 56, 0.45), var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--primary-hover);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.1rem;
  background: var(--primary-hover);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}
.terminal-dot:first-child { background: var(--accent); }
.terminal-title {
  margin-left: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.terminal-status {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  transition: color 500ms var(--ease);
}
/* Sichtbarer Sprung, wenn die Konsole dem Gast Stufe 2 gewährt */
.terminal-status.is-granted { color: #9cc3e6; }
.terminal-body {
  padding: var(--space-6) var(--space-8);
  min-height: 23rem;
}
.term-line {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: #cfd9e4;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-warn { color: #f97066; }                      /* Warnung */
.term-final { color: #ffffff; font-weight: 500; }
.term-grant { color: #9cc3e6; font-weight: 500; }   /* Freigabe gewährt */
.term-prompt {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
  color: #cfd9e4;
  margin: 0;
}
.term-prompt.is-active { display: block; }
.term-prompt.is-active::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: currentColor;
  vertical-align: text-bottom;
  animation: blink 0.9s steps(1) infinite;
}
.term-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.25em;
  background: currentColor;
  vertical-align: text-bottom;
  animation: blink 1.05s steps(1) infinite;
}
/* Interaktive Eingabezeile: erscheint erst, wenn die Boot-Animation durch ist
   (während .term-animating versteckt). Ersetzt optisch den blinkenden Prompt. */
/* align-items: center statt baseline, und Prompt und Spiegeltext teilen sich
   dieselbe Zeilenhöhe. Sonst sitzt der Block-Cursor rund 4px unter der Mitte
   des ">"-Zeichens, weil Baseline-Ausrichtung die unterschiedlichen
   Zeilenboxen (21,9px vs. 24,9px) gegeneinander verschiebt. */
.term-inputline {
  display: flex;
  align-items: center;
  gap: 0.45em;
  margin: 0;
}
.term-animating .term-inputline { display: none; }
.term-inputline-prompt {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
  color: #8ab1d6;
  flex-shrink: 0;
}
/* Konsolen-Optik: das echte <input> ist unsichtbar und liegt über der Zeile.
   Der getippte Text wird in .term-input-mirror gespiegelt, dahinter blinkt ein
   Block-Cursor wie in einer echten Konsole (kein sichtbares Eingabefeld). */
/* Schriftgröße hier setzen, damit Spiegeltext und Block-Cursor (Höhe 1em) sie
   erben und exakt so groß sind wie der ">"-Prompt daneben. */
.term-input-field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.term-input-mirror {
  font-family: var(--font-mono);
  font-size: inherit;
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: #ffffff;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: none;
}
.term-caret {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 0.03em;
  background: #cfd9e4;
  animation: blink 0.9s steps(1) infinite;
  flex-shrink: 0;
  user-select: none;
}
/* .terminal-body-Präfix hebt die Spezifität über die globale input[type=text]-
   Regel (sonst bekäme das Feld heller Hintergrund/Rahmen = "weißes Eingabefeld"). */
.terminal-body .term-input,
.terminal-body .term-input:focus {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: transparent;
  caret-color: transparent;
  outline: none;
  box-shadow: none;
  font: inherit;
  cursor: text;
}
/* Der unsichtbare Input soll bei Strg+A keine zweite Markierung über den
   sichtbaren Spiegeltext legen (sonst doppelte Hervorhebung). */
.terminal-body .term-input::selection { background: transparent; color: transparent; }
.term-echo { white-space: pre-wrap; word-break: break-word; }
.term-echo-cmd { color: #ffffff; }
/* Kurzer Glitch, wenn das System auf einen "Treffer" reagiert */
.term-glitch { animation: term-glitch 0.42s steps(2) 2; }
@keyframes term-glitch {
  0%, 100% { transform: none; opacity: 1; }
  25% { transform: translateX(-2px); opacity: 0.82; }
  50% { transform: translateX(2px); opacity: 0.96; }
  75% { transform: translateX(-1px); opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
  .term-caret { animation: none; }
  .term-glitch { animation: none; }
}
.term-line.is-typing::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.15em;
  background: currentColor;
  vertical-align: text-bottom;
  animation: blink 0.9s steps(1) infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
/* ===== Sektionen ===== */
.section { padding: var(--space-24) 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  color: var(--accent);
  margin-bottom: var(--space-3);
}
.kicker::before { content: "// "; color: var(--text-muted); }

.section-title {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  text-align: center;
  margin-bottom: var(--space-8);
}
.section-title em { font-style: italic; color: var(--accent); }

.section-lead {
  color: var(--text-muted);
  max-width: 40rem;
  text-align: center;
  margin: 0 auto var(--space-12);
}
.section-lead strong { color: var(--text); }

/* Lesbarer Fließtext-Block (z. B. Worldbuilding-Abschnitt "Das Institut") */
.prose-narrow p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: var(--space-6);
}
.prose-narrow p:last-child { margin-bottom: 0; }
.prose-narrow strong, .prose-narrow em { color: var(--text); font-style: normal; }

/* ===== Karten / Säulen ===== */
.pillars {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: var(--space-4);
  align-items: stretch;
}
.pillar-join {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-8);
  box-shadow: var(--shadow-xs);
  transition: border-color 250ms var(--ease), transform 250ms var(--ease), box-shadow 250ms var(--ease);
}
.card:hover {
  border-color: rgba(63, 109, 146, 0.4);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.card-tag {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.2rem 0.5rem;
}
.pillar-icon {
  width: 44px; height: 44px;
  margin-bottom: var(--space-4);
  object-fit: contain;
}
.pillar-icon-primary { color: var(--primary); }
.pillar h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-1);
}
.pillar-sub {
  font-size: 0.85rem;
  color: var(--accent);
  font-style: italic;
  font-family: var(--font-body);
  margin-bottom: var(--space-3);
}
.pillar { display: flex; flex-direction: column; cursor: pointer; }
.pillar > p:not(.pillar-sub) { color: var(--text-muted); font-size: 0.95rem; margin-bottom: var(--space-6); }
/* "Vollständiger Vermerk" als eleganter Karten-Footer mit Trennlinie,
   unten bündig über alle Karten (Label links, Pfeil rechts) */
.pillar-open {
  margin-top: auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4em;
  padding: var(--space-4) 0 0;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.pillar-open::after { content: "→"; transition: transform 200ms var(--ease); }
.pillar-open:hover { color: var(--primary); }
.card:hover .pillar-open { color: var(--primary); border-top-color: rgba(63, 109, 146, 0.4); }
.card:hover .pillar-open::after { transform: translateX(3px); }

/* Dossier-Fenster (natives <dialog>) im Stil des internen Systems */
.dossier-src { display: none; }
.dossier {
  width: min(40rem, calc(100vw - 2rem));
  max-height: min(86vh, 50rem);
  padding: 0;
  border: 1px solid var(--primary-hover);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px -20px rgba(15, 34, 56, 0.6);
  overflow: hidden;
  color: var(--text);
}
/* Flex-Spalte, damit der Körper den Restplatz füllt und für sich scrollt.
   Ohne das clippt .dossier (overflow:hidden) längere Vermerke am unteren Rand,
   wodurch die Meta-Zeile unerreichbar wird und ihr gestrichelter Oberrand als
   scheinbar zufällige Linie an der Fensterkante stehen bleibt. */
.dossier[open] {
  animation: dossier-in 260ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
/* flex-basis MUSS auto bleiben (nicht das übliche `flex: 1` = Basis 0).
   Der Dialog hat height:auto und nur eine max-height, seine Höhe kommt also
   aus dem Inhalt. Mit Basis 0 steuert der Körper zur Höhenberechnung nichts
   bei: Safari auf iOS schrumpft das Fenster dann auf die Kopfleiste zusammen
   und zeigt vom Vermerk nur einen Streifen. Mit auto zählt die Inhaltshöhe
   mit, die max-height deckelt sie, und flex-shrink lässt den Körper scrollen. */
.dossier-body { flex: 1 1 auto; min-height: 0; }
.dossier-bar { flex-shrink: 0; }
@keyframes dossier-in {
  from { opacity: 0; transform: translateY(18px) scale(0.955); }
  to { opacity: 1; transform: none; }
}
.dossier::backdrop { background: rgba(15, 34, 56, 0.55); }
.dossier[open]::backdrop { animation: dossier-backdrop-in 260ms ease; }
@keyframes dossier-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .dossier[open], .dossier[open]::backdrop { animation-duration: 1ms; }
}
.dossier-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.1rem;
  background: var(--primary);
}
.dossier-bar .terminal-dot { background: rgba(255, 255, 255, 0.22); }
.dossier-bar .terminal-dot:first-child { background: var(--accent); }
.dossier-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-left: 0.4rem;
}
.dossier-close {
  margin-left: auto;
  width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 5px;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 180ms var(--ease);
}
.dossier-close:hover { background: rgba(255, 255, 255, 0.18); }
.dossier-body { padding: var(--space-8); overflow-y: auto; }
.dossier-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}
.dossier-body h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin-bottom: var(--space-6);
}
/* Überschriften mit ausgeschriebener Unterzeile (z. B. Akronym + Langform):
   Akronym bleibt einzeilig, die Langform steht kleiner direkt darunter. */
.dossier-body h3:has(+ .dossier-subtitle) { margin-bottom: 0.3rem; }
.dossier-subtitle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  line-height: 1.4;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}
.dossier-body p { color: var(--text-muted); line-height: 1.75; margin-bottom: var(--space-4); }
.dossier-body p:last-child { margin-bottom: 0; }
.dossier-body strong { color: var(--text); font-weight: 600; }
.dossier-meta {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ===== Phänomene / Aus dem Archiv ===== */
.pheno-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.pheno-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
  transition: border-color 250ms var(--ease), transform 250ms var(--ease), box-shadow 250ms var(--ease);
}
.pheno-card:hover {
  border-color: rgba(63, 109, 146, 0.4);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.pheno-id {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0;
}
.pheno-card > p:not(.pheno-id):not(.pheno-status) {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}
.pheno-status {
  margin: auto 0 0;
  padding-top: var(--space-3);
  min-height: 2.2em; /* reserviert Platz, damit die Deny-Meldung nicht umbricht und die Karte springt */
  display: flex;
  align-items: flex-end;
  border-top: 1px dashed var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pheno-open { color: var(--error); font-weight: 600; }
/* Gesperrte Fallakten reagieren wie das AIMS-System: Wackeln + Deny-Meldung */
.pheno-card[data-locked] { position: relative; cursor: pointer; }
.pheno-locktag {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  color: var(--text-muted);
  opacity: 0.55;
  transition: color 200ms var(--ease), opacity 200ms var(--ease);
}
.pheno-locktag svg { width: 14px; height: 14px; display: block; }
.pheno-card[data-locked]:hover .pheno-locktag { opacity: 1; color: var(--accent); }
.pheno-status.is-denied { color: var(--error); font-weight: 600; }

/* ===== Ablauf / Steps ===== */
.steps {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  gap: var(--space-6);
  max-width: 46rem;
}
.step {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.step-num {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  padding-top: 0.2rem;
  flex-shrink: 0;
}
.step h3 { font-size: 1.2rem; margin-bottom: var(--space-2); }
.step p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }

.case-ref {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
  letter-spacing: 0.03em;
}
/* Fallbezeichnung im Ablauf — gleiche Schrift wie der Fließtext,
   nur abgesetzt durch Gewicht und Farbe */
.step-case {
  display: block;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

/* ===== AIMS-Aktenansicht (interaktives Fenster) ===== */
.aims-window {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
/* Feste Höhe, damit das Fenster beim Tab-Wechsel nicht springt.
   Längere Inhalte (Bericht) scrollen innerhalb der Ansicht. */
.aims-main {
  display: flex;
  height: 27rem;
}
.aims-sidebar {
  width: 10.5rem;
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: var(--space-4) 0;
}
.aims-side-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 var(--space-4);
  margin: 0 0 var(--space-2);
}
.aims-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem var(--space-4);
  background: none;
  border: none;
  border-left: 2px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text);
  cursor: pointer;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}
.aims-file svg { width: 12px; height: 12px; margin-left: auto; color: var(--text-muted); flex-shrink: 0; }
.aims-file.is-active {
  border-left-color: var(--accent);
  background: var(--accent-dim);
  color: var(--primary);
  font-weight: 600;
}
.aims-file.is-locked { color: var(--text-muted); }
.aims-file.is-locked:hover { color: var(--text); background: var(--surface-hover, rgba(0,0,0,0.03)); }
.aims-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.aims-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.aims-tab {
  padding: 0.65rem var(--space-4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}
.aims-tab:hover { color: var(--primary); }
.aims-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.aims-pane {
  padding: var(--space-6);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.aims-pane[hidden] { display: none; }
/* Dezente Scrollleiste im dunklen Viewer */
.aims-pane::-webkit-scrollbar { width: 8px; }
.aims-pane::-webkit-scrollbar-track { background: transparent; }
.aims-pane::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 100px;
}
.aims-pane::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }
.aims-doclist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.aims-doc {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 150ms var(--ease);
}
/* Ohne min-width:0 kann der Dateiname als Flex-Kind nicht unter seine
   min-content-Breite. Ein Mono-Dateiname ohne Leerzeichen bricht nirgends,
   also stand die Zeile fest auf ihrer vollen Breite und schob den
   Freigabe-Status auf schmalen Displays aus dem Fenster heraus. */
.aims-doc-name { min-width: 0; overflow-wrap: anywhere; }
.aims-doc:hover { border-color: var(--accent); }
.aims-doc:active { border-color: var(--accent); }
.aims-doc.is-locked { color: var(--text-muted); }
.aims-doc-state {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.aims-doc.is-locked .aims-doc-state { color: var(--text-muted); }
.aims-doc-state svg { width: 11px; height: 11px; }
/* Gesperrte Tabs (Zeitlinie, Personen): sichtbar, aber unzugänglich */
.aims-tab.is-locked { opacity: 0.55; cursor: not-allowed; display: inline-flex; align-items: center; gap: 0.35em; }
.aims-tab.is-locked svg { width: 11px; height: 11px; }
/* Gesperrter Querverweis im Bericht (liegt im hellen Dokument) */
.aims-xref {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.02em 0.35em;
  margin: 0 0.15em;
  cursor: not-allowed;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}
.aims-xref svg { width: 0.72em; height: 0.72em; opacity: 0.8; }
/* Referenzarchiv-Hinweis in der Statusleiste (dezenter Warnton) */
.aims-sync { color: rgba(255, 205, 130, 0.72); }
.aims-locked {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}
.aims-lock {
  width: 34px;
  height: 34px;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.aims-locked-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--space-2);
}
.aims-locked p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: var(--space-3); }
.aims-locked a { font-size: 0.85rem; font-weight: 600; }
/* Einzeilig und höhenstabil: die Deny-Meldung ist länger als "Bereit" und
   würde bei Umbruch das ganze Fenster wachsen lassen. */
.aims-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: var(--space-4);
  min-height: 2.1rem;
  padding: 0.45rem var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.aims-statusbar > span:first-child { flex-shrink: 0; }
.aims-sync { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.aims-status-msg { flex-shrink: 0; margin-left: auto; text-align: right; }
.aims-status-msg.is-denied { color: var(--error); font-weight: 600; }
@keyframes aims-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.shake { animation: aims-shake 180ms ease-in-out 2; }

/* Boot-Sequenz beim ersten Sichtbarwerden */
.aims-loading { display: none; }
.aims-booting .aims-main,
.aims-booting .aims-statusbar { visibility: hidden; }
.aims-booting .aims-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  position: absolute;
  inset: 0;
}
.aims-loading p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}
.aims-progress {
  width: 12rem;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.aims-booting .aims-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  animation: aims-load 1.9s ease-in-out forwards;
}
@keyframes aims-load { to { width: 100%; } }

.aims-fineprint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 34rem;
  margin: var(--space-6) auto 0;
}

/* --- AIMS-Fenster: dunkles Software-Theme (interne Software, kein Website-Look) --- */
.aims-window {
  background: var(--primary);
  border-color: var(--primary-hover);
}
.aims-sidebar {
  background: rgba(255, 255, 255, 0.04);
  border-right-color: rgba(255, 255, 255, 0.08);
}
.aims-side-label { color: rgba(255, 255, 255, 0.4); }
.aims-file { color: rgba(255, 255, 255, 0.78); }
.aims-file svg { color: rgba(255, 255, 255, 0.35); }
.aims-file.is-active {
  border-left-color: #8ab1d6;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.aims-file.is-locked { color: rgba(255, 255, 255, 0.45); }
.aims-file.is-locked:hover { color: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.05); }
.aims-tabs { border-bottom-color: rgba(255, 255, 255, 0.08); }
.aims-tab { color: rgba(255, 255, 255, 0.55); }
.aims-tab:hover { color: #ffffff; }
.aims-tab.is-active { color: #ffffff; border-bottom-color: #8ab1d6; }
/* Der freigegebene Bericht liegt als helles Dokument im dunklen Viewer */
.aims-sheet {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: var(--space-6);
  box-shadow: 0 12px 32px -14px rgba(0, 0, 0, 0.65);
}
.aims-doc {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #dbe4ee;
}
.aims-doc:hover { border-color: #8ab1d6; }
.aims-doc.is-locked { color: rgba(255, 255, 255, 0.5); }
.aims-doc-state { color: #8ab1d6; }
.aims-doc.is-locked .aims-doc-state { color: rgba(255, 255, 255, 0.4); }
.aims-lock { color: rgba(255, 255, 255, 0.4); }
.aims-locked-title { color: #ffffff; }
.aims-locked p { color: rgba(255, 255, 255, 0.6); }
.aims-locked a { color: #9cc3e6; }
.aims-locked a:hover { color: #ffffff; }
.aims-statusbar {
  background: rgba(0, 0, 0, 0.25);
  border-top-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
}
.aims-loading p { color: rgba(255, 255, 255, 0.6); }
.aims-progress { background: rgba(255, 255, 255, 0.15); }
.aims-booting .aims-progress span { background: #8ab1d6; }
.aims-window :focus-visible { outline-color: #9cc3e6; }

/* --- Eingebetteter Bergungsbericht: Dokument-Viewer im AIMS-Fenster ---
   Die freigegebene Akte wird als Folge weißer A4-Seiten (Bilder) dargestellt,
   gerahmt von einer dunklen Dokument-Leiste. Kein iframe/PDF-Plugin, damit es
   sich wie ein internes Dokument der Software anfühlt, nicht wie ein Download.
   Zum Austausch der Akte siehe den Kommentar im HTML (data-pane="bericht"). */
.aims-report {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
/* Kollabierte Vorschau: der Bericht wird nicht inline gezeigt, sondern als
   geschlossenes Dokument mit "Öffnen"-Aktion. Die eigentlichen Seiten liegen
   versteckt darunter (.aims-report-pages[hidden]) und dienen nur als Quelle
   für die Großansicht. */
.aims-report-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
}
.aims-report-doc {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.aims-report-doc-icon { width: 32px; height: 40px; flex-shrink: 0; color: #8ab1d6; }
.aims-report-doc-info { min-width: 0; flex: 1; }
.aims-report-doc-id {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #ffffff;
  margin-bottom: 0.25rem;
}
/* Klassifizierung als kompakter Stempel statt großflächigem gelben Text */
.aims-report-badge {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 205, 130, 0.9);
  border: 1px solid rgba(255, 205, 130, 0.34);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}
.aims-report-doc-meta {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
}
.aims-report-open {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  align-self: flex-start;
  padding: 0.55rem 1.1rem;
  background: #8ab1d6;
  color: var(--primary);
  border: none;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms var(--ease);
}
.aims-report-open:hover { background: #9cc3e6; }
.aims-report-open svg { width: 13px; height: 13px; }
.aims-report-pages[hidden] { display: none; }
.aims-report-bar,
.aims-report-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: 0.5rem var(--space-4);
  background: rgba(0, 0, 0, 0.32);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.aims-report-bar { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.aims-report-foot { border-top: 1px solid rgba(255, 255, 255, 0.1); text-transform: none; letter-spacing: 0.04em; }
.aims-report-id { color: rgba(255, 255, 255, 0.6); }
.aims-report-clr { color: rgba(255, 205, 130, 0.82); white-space: nowrap; }
.aims-report-foot span { color: rgba(255, 255, 255, 0.42); }
.aims-report-pages {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4);
}
.aims-report-pages {
  cursor: zoom-in;
}
.aims-report-pages img {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 10px 28px -12px rgba(0, 0, 0, 0.75);
  transition: box-shadow 160ms var(--ease);
}
.aims-report-pages:hover img { box-shadow: 0 12px 34px -12px rgba(0, 0, 0, 0.85); }
.aims-report-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.aims-report-zoom {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.24rem 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}
.aims-report-zoom:hover { background: rgba(255, 255, 255, 0.16); border-color: #8ab1d6; color: #fff; }
.aims-report-zoom svg { width: 12px; height: 12px; }

/* Großansicht des Berichts: nutzt die Dialog-Basis (.dossier), nur breiter
   und mit dunklem, scrollbarem Dokumentkörper. Die Seiten werden per JS aus
   .aims-report-pages geklont, damit der Austauschpunkt eine einzige Quelle bleibt. */
.report-modal {
  width: min(56rem, calc(100vw - 2rem));
  max-height: 94vh;
  background: var(--primary);
}
/* Flex-Spalte, damit der Körper den Restplatz füllt und für sich scrollt
   (die Dialog-Basis .dossier hat overflow:hidden). */
.report-modal[open] {
  display: flex;
  flex-direction: column;
}
.report-modal-body {
  /* Basis auto aus demselben Grund wie bei .dossier-body */
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--space-4);
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.35);
}
.report-modal-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.report-modal-pages img {
  display: block;
  width: 100%;
  max-width: 48rem;
  height: auto;
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 14px 44px -16px rgba(0, 0, 0, 0.85);
}

.casefile-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: var(--space-4);
  margin: 0 0 var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px dashed var(--border-strong);
}
/* Subgrid: alle Labels teilen sich eine Zeilenhöhe, alle Werte beginnen
   dadurch auf gleicher Höhe, egal wie lang die Beschriftung in der jeweiligen
   Sprache ist. Ohne Subgrid-Unterstützung greift die min-height unten. */
.casefile-facts > div {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
  border-left: 2px solid var(--accent);
  padding-left: var(--space-3);
}
/* Feste Label-Höhe (Platz für zwei Zeilen), damit alle Werte auf gleicher
   Höhe beginnen. Vorher waren die Werte nach unten ausgerichtet, wodurch
   unter kurzen Labels große Lücken entstanden. */
.casefile-facts dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.3;
  min-height: 2.6em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.casefile-facts dd {
  margin: 0;
  padding-top: 0.2rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--primary);
}
.casefile-facts dd.status-open { color: var(--error); }
.casefile-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.casefile-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.9;
  color: var(--text);
}
.casefile-text em { color: var(--primary); }
.redact {
  background: var(--primary);
  color: transparent;
  border-radius: 2px;
  padding: 0 0.2em;
  user-select: none;
}
.casefile-note {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
  margin: var(--space-6) 0 0;
}

/* ===== Formular ===== */
#recruit-form { display: grid; gap: var(--space-8); }

.form-block {
  margin: 0;
  padding: var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.form-legend {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  padding: 0;
}
/* Legende in die Box holen (statt auf der Rahmenlinie) */
fieldset.form-block > legend.form-legend {
  float: left;
  width: 100%;
  margin-bottom: var(--space-2);
}
fieldset.form-block > legend.form-legend + .field { clear: both; margin-top: var(--space-4); }
.form-legend-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}
.form-legend-hint {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}
/* Trennzeichen nur, solange der Hinweis in derselben Zeile steht. Auf schmalen
   Displays rutscht er in eine eigene Zeile, dort wäre ein führendes "·" falsch
   (siehe Mobil-Regeln weiter unten). */
.form-legend-hint::before { content: "· "; }

fieldset.form-block > .field { margin-top: var(--space-6); }

.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  margin-bottom: var(--space-3);
}
.field-label em { color: var(--accent); font-style: italic; }
.field-optional {
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.9em;
}
.field-label-sub { margin-top: var(--space-4); font-weight: 500; font-size: 0.9rem; }
.field-help {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: -0.4rem 0 var(--space-3);
}
/* Anders als .field-help (sitzt über der Frage, negativer Top-Abstand zum
   Label) steht .field-note unter der Auswahl, deshalb positiver Abstand. */
.field-note {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
  margin: var(--space-2) 0 0;
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
textarea { resize: vertical; min-height: 5rem; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  color: var(--error);
  font-size: 0.85rem;
  margin: var(--space-2) 0 0;
}

/* Radio-Karten */
.radio-cards {
  display: grid;
  gap: var(--space-3);
}
.radio-cards-row {
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
}
.radio-card {
  position: relative;
  /* flex statt block, damit der sichtbare <span> die volle Höhe der
     Rasterzeile bekommt. Als block blieb er auf Inhaltshöhe stehen: sobald
     eine Beschriftung umbrach ("Ja, sicher" / "Eher nicht"), war die Karte
     daneben spürbar niedriger, obwohl das Raster beide gleich hoch auslegt. */
  display: flex;
  cursor: pointer;
}
.radio-card > span { flex: 1; }
.radio-card input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.radio-card span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.8rem 1rem;
  min-height: 44px;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease);
}
.radio-card strong { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.radio-card small { color: var(--text-muted); font-size: 0.8rem; }
.radio-card:hover span { border-color: var(--accent); }
.radio-card:active span { border-color: var(--accent); background: var(--accent-dim); }
.radio-card input:checked + span {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.radio-card input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Checkbox-Chips */
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.check-chip {
  position: relative;
  cursor: pointer;
}
.check-chip input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.check-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease), color 180ms var(--ease);
}
.check-chip:hover span { border-color: var(--accent); }
/* Ersetzt die abgeschaltete Tap-Hervorhebung: die Rückmeldung sitzt jetzt auf
   der Pille selbst und hat damit auch deren Form. */
.check-chip:active span { border-color: var(--accent); background: var(--accent-dim); }
.check-chip input:checked + span {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.check-chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Einwilligung */
.check-line {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.check-line input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

/* Kurze technische Schnipsel im Fließtext der Legal-Seiten (z. B. ?ref=) */
.mono-inline {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--accent-dim);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  white-space: nowrap;
}

/* Range */
.range-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.range-end {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}
input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  min-height: 44px;
  cursor: pointer;
}
.range-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 2ch;
  text-align: center;
}

/* Preis-Grid */
.price-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
.price-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: 100%;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.price-item span { flex: 1 0 auto; }
.price-item input { margin-top: auto; }
.price-item input { font-family: var(--font-mono); }

/* Optionaler Teil (details) */
.form-optional { padding: 0; overflow: hidden; }
.form-optional summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-8);
  cursor: pointer;
  user-select: none;
  transition: background-color 180ms var(--ease);
}
.form-optional summary::-webkit-details-marker { display: none; }
.form-optional summary:hover { background: var(--bg); }
.summary-chevron {
  width: 20px; height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 250ms var(--ease);
}
.form-optional[open] .summary-chevron { transform: rotate(180deg); }
.form-optional-body {
  padding: 0 var(--space-8) var(--space-8);
  display: grid;
  gap: var(--space-6);
  border-top: 1px solid var(--border);
  padding-top: var(--space-6);
}

/* Submit */
.form-submit-row { text-align: center; }
.form-fineprint {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 30rem;
  margin: var(--space-4) auto 0;
}
.btn-spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn[data-loading="true"] .btn-spinner { display: inline-block; }
.btn[data-loading="true"] { pointer-events: none; opacity: 0.85; }

/* Erfolg */
.form-success {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  border: 1px solid rgba(63, 109, 146, 0.3);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, var(--accent-dim), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.success-sigil {
  width: 56px;
  height: 56px;
  color: var(--accent);
  margin-bottom: var(--space-4);
}
.form-success h3 { font-size: 1.6rem; }
.form-success p { color: var(--text-muted); max-width: 30rem; margin-left: auto; margin-right: auto; }
/* Spam-Ordner-Hinweis: leiser als der Rest, aber vorhanden. Ohne ihn landet
   ein Teil der Bestätigungsmails ungesehen im Spam und der Vorgang bleibt
   für immer unbestätigt. */
.form-success-hint {
  font-size: 0.85rem;
  margin-top: var(--space-3);
  margin-bottom: 0;
  opacity: 0.75;
}

/* ===== FAQ ===== */
.faq-list { display: grid; gap: var(--space-3); }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 var(--space-6);
  box-shadow: var(--shadow-xs);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4) 0;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 44px;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: transform 200ms var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  color: var(--text-muted);
  font-size: 0.93rem;
  padding-bottom: var(--space-4);
  margin: 0;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: var(--space-12) 0;
}
.footer-inner { text-align: center; }
.footer-sigil {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.footer-sigil img { width: 20px; height: 20px; }
.footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 34rem;
  margin: var(--space-3) auto;
}
.footer-doc {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
}
.footer-legal { font-size: 0.8rem; margin: 0; }
.footer-legal a { color: var(--text-muted); }
.footer-legal a:hover { color: var(--accent); }

/* ===== Scroll-Reveal =====
   Nur aktiv, wenn JS läuft (html.js) — ohne JS bleibt alles sichtbar. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ===== Rechtsseiten (Impressum / Datenschutz) ===== */
.placeholder-notice {
  background: var(--accent-dim);
  border: 1px solid rgba(63, 109, 146, 0.3);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-8);
  font-size: 0.92rem;
  color: var(--text);
}
.placeholder-notice strong { color: var(--primary); }
.legal-body {
  text-align: left;
  color: var(--text-muted);
}
.legal-body h2 {
  font-size: 1.1rem;
  text-align: left;
  color: var(--primary);
  margin-top: var(--space-8);
}
.legal-body h3 {
  font-size: 0.95rem;
  text-align: left;
  color: var(--primary);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}
.legal-body ul { padding-left: 1.2rem; }
.legal-body li { margin-bottom: var(--space-2); }
.legal-body a { color: var(--accent); }
.legal-body strong { color: var(--text); }
/* Inhaltsübersicht: zweispaltig, ohne Aufzählungspunkte */
.legal-body .index {
  list-style: none;
  padding-left: 0;
  columns: 2;
  column-gap: var(--space-8);
  margin-bottom: var(--space-8);
}
.legal-body .index li { margin-bottom: var(--space-1); }
.legal-body .seal { margin-top: var(--space-8); font-size: 0.8rem; }
@media (max-width: 640px) {
  .legal-body .index { columns: 1; }
}
.legal-back {
  display: inline-block;
  margin-top: var(--space-8);
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}
.legal-back:hover { color: var(--primary-hover); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .pillars { grid-template-columns: 1fr; justify-items: stretch; }
  .pillar-join { justify-self: center; }
  .pheno-grid { grid-template-columns: 1fr; }
  .terminal-body { padding: var(--space-4) var(--space-6); min-height: 22rem; }
  .term-line, .term-prompt, .term-input, .term-inputline-prompt, .term-input-field { font-size: 0.72rem; }
  .terminal-bar { flex-wrap: wrap; row-gap: 0.2rem; }
  .terminal-status { margin-left: 0; width: 100%; padding-left: 1.35rem; }
}

@media (max-width: 640px) {
  .section { padding: var(--space-16) 0; }
  .hero { min-height: auto; padding: var(--space-16) 0 var(--space-12); }
  .wordmark-sub { display: none; }
  /* Auf Mobil wirkt die Pill mit gestapelten Zeilen zu wuchtig: Rahmen und
     Fläche weg, dezente umbrechende Mono-Zeile statt eines breiten Kastens. */
  .hero-spec {
    border: none;
    background: none;
    box-shadow: none;
    padding: 0;
    gap: 0.2rem 0.9rem;
    font-size: 0.62rem;
    color: var(--text-muted);
  }
  .topbar-actions { gap: 0.5rem; }
  .lang-link { padding: 0.28rem 0.5rem; font-size: 0.64rem; }
  .topbar .btn-sm { padding: 0.5rem 0.75rem; font-size: 0.78rem; white-space: nowrap; }
  .step { flex-direction: column; gap: var(--space-3); }
  .casefile-facts { grid-template-columns: repeat(2, 1fr); }
  /* Gestapelt: feste Höhe aufheben, Panes wachsen wieder mit dem Inhalt */
  .aims-main { flex-direction: column; height: auto; min-height: 0; }
  .aims-pane { overflow-y: visible; }
  /* Platz sparen: der Referenzarchiv-Hinweis entfällt auf schmalen Displays */
  .aims-sync { display: none; }
  .aims-sidebar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: var(--space-2) var(--space-3);
  }
  .aims-side-label { width: 100%; padding: 0 var(--space-2); margin-bottom: 0.2rem; }
  .aims-file {
    width: auto;
    border-left: none;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.7rem;
  }
  .aims-pane { padding: var(--space-4); }

  /* Sechs Reiter passen nicht in eine Zeile. Vorher scrollten sie waagerecht,
     ohne das anzuzeigen: sichtbar war nur ein angeschnittenes Wort am Rand,
     und die gesperrten Reiter (Zeitlinie, Personen) sah niemand. Genau die
     sollen aber auffallen, weil das Gesperrte den Reiz ausmacht. */
  .aims-tabs { flex-wrap: wrap; overflow-x: visible; }
  .aims-tab { padding: 0.6rem var(--space-3); }

  /* Dateiname und Freigabe-Status untereinander statt nebeneinander: in einer
     Zeile bleibt für den Status sonst zu wenig Platz. */
  .aims-doc { flex-wrap: wrap; gap: 0.3rem var(--space-3); }
  .aims-doc-name { flex: 1 0 100%; }
  .aims-doc-state { margin-left: 0; }

  .price-grid { grid-template-columns: 1fr; }
  .form-block { padding: var(--space-6); }
  .form-optional summary { padding: var(--space-4) var(--space-6); }
  .form-optional-body { padding-left: var(--space-6); padding-right: var(--space-6); }

  /* Antwortoptionen stehen auf Mobil durchgehend untereinander. Umbrechende
     Chips ergaben sonst ein unruhiges Bild: lange Antworten belegten eine
     ganze Zeile, kurze standen zu zweit daneben. */
  .check-grid { flex-direction: column; align-items: stretch; }
  .check-chip span { width: 100%; }
  .radio-cards-row { grid-template-columns: 1fr; }

  /* Skala: Regler oben über die volle Breite, darunter die beiden Endpunkte
     links und rechts. Vorher brach die Zeile um, wodurch der Wert auf der
     Beschriftung "10 - sofort" lag. */
  .range-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "slider slider slider"
      "min    value  max";
    align-items: center;
    gap: var(--space-2);
  }
  .range-row input[type="range"] { grid-area: slider; width: 100%; min-width: 0; margin: 0; }
  .range-row .range-end:first-of-type { grid-area: min; }
  .range-row .range-value { grid-area: value; }
  .range-row .range-end:last-of-type { grid-area: max; text-align: right; }
  /* Auf sehr schmalen Geräten dürfen die Endpunkte umbrechen, sonst drückt
     ihre nowrap-Mindestbreite die Zeile wieder aus dem Rahmen. */
  .range-end { white-space: normal; }

  /* Legende: Hinweis bekommt eine eigene volle Zeile statt in eine schmale
     Spalte gequetscht zu werden, und verliert dabei sein Trennzeichen. */
  .form-legend { flex-wrap: wrap; }
  .form-legend-hint { flex-basis: 100%; }
  .form-legend-hint::before { content: none; }

  /* Dialoge nutzen auf kleinen Displays fast den ganzen Bildschirm. Vorher las
     man lange Vermerke durch einen 337px schmalen Ausschnitt mit 32px Rand.
     Wichtig: Der Browser gibt <dialog> von sich aus max-width:calc(100% - 38px)
     und einen Außenabstand mit. Beides muss überschrieben werden, sonst bleibt
     die eigene Breitenangabe wirkungslos. */
  .dossier {
    width: calc(100vw - 1rem);
    max-width: none;
    margin: 0.5rem auto;
    max-height: 92vh;
    max-height: 92dvh;
  }
  .dossier-body { padding: var(--space-6) var(--space-4); }

  .report-modal {
    width: calc(100vw - 0.5rem);
    max-width: none;
    margin: 0.25rem auto;
    max-height: 95vh;
    max-height: 95dvh;
  }
  .report-modal-body { padding: var(--space-2); }
  .report-modal-pages { gap: var(--space-2); }
}

/* Aktenseiten antippen, um sie zu vergrößern. Eine A4-Seite ist auf
   Handybreite sonst unlesbar; im gezoomten Zustand kann waagerecht
   gescrollt werden. */
.report-modal-pages img { cursor: zoom-in; }
.report-modal-hint {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  margin: 0 0 var(--space-2);
}
.report-modal-body.is-zoomed { overflow: auto; }
.report-modal-body.is-zoomed .report-modal-pages { align-items: flex-start; }
.report-modal-body.is-zoomed .report-modal-pages img {
  /* width:100% + min-width ergibt eine feste, vorhersagbare Zoomstufe. Ohne das
     springt die Seite auf ihre volle Eigenbreite (1504px) und man muss deutlich
     weiter horizontal schieben, als zum Lesen nötig wäre. */
  width: 100%;
  max-width: none;
  min-width: 900px;
  cursor: zoom-out;
}
