/* Sophia – Gestaltung
   Drei Ebenen: 1 Werte, 2 Bedeutung, 3 Bausteine.
   Bausteine verwenden nur Bedeutungs-Variablen, nie rohe Werte. */

/* ---------------------------------------------------------------- Schriften */
@font-face { font-family: "Archivo"; font-weight: 600; font-display: swap;
  src: url("/static/fonts/archivo-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 800; font-display: swap;
  src: url("/static/fonts/archivo-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-display: swap;
  src: url("/static/fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 600; font-display: swap;
  src: url("/static/fonts/hanken-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }

/* ------------------------------------------------------------- 1 · Werte */
:root {
  --blau-950: #03070F;
  --blau-900: #050A16;
  --blau-850: #091224;
  --blau-800: #0E1930;
  --blau-750: #14223F;
  --hell-50: #F6F3F1;
  --hell-300: #B3BED3;
  --hell-400: #8D9AB3;
  --linie-schwach: rgba(214, 226, 255, 0.07);
  --linie: rgba(214, 226, 255, 0.12);
  --linie-stark: rgba(214, 226, 255, 0.22);
  --rot-500: #A30100;
  --rot-400: #BC312D;
  --gruen: #4FAE72;
  --orange: #E0A93A;
  --rot-status: #E5605B;

  --schrift-titel: "Archivo", system-ui, "Segoe UI", sans-serif;
  --schrift-text: "Hanken Grotesk", system-ui, "Segoe UI", sans-serif;
  --schrift-daten: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --abstand-1: 4px;
  --abstand-2: 8px;
  --abstand-3: 12px;
  --abstand-4: 16px;
  --abstand-5: 24px;
  --abstand-6: 32px;
  --rund-klein: 4px;
  --rund-mittel: 6px;
  --rund-gross: 10px;
}

/* --------------------------------------------------------- 2 · Bedeutung */
:root {
  color-scheme: dark;
  --grund: var(--blau-900);
  --flaeche: var(--blau-850);
  --flaeche-erhoeht: var(--blau-800);
  --flaeche-gewaehlt: var(--blau-750);
  --flaeche-vertieft: var(--blau-950);
  --text: var(--hell-50);
  --text-zweitrangig: var(--hell-300);
  --text-gedaempft: var(--hell-400);
  --rahmen: var(--linie);
  --rahmen-stark: var(--linie-stark);
  --rahmen-schwach: var(--linie-schwach);
  --akzent: var(--rot-500);
  --akzent-hell: var(--rot-400);
  --status-gut: var(--gruen);
  --status-achtung: var(--orange);
  --status-fehler: var(--rot-status);
  /* Statusflächen: 12 % Deckkraft, Rahmen 30 % */
  --status-gut-flaeche: rgba(79, 174, 114, 0.12);
  --status-gut-rahmen: rgba(79, 174, 114, 0.30);
  --status-achtung-flaeche: rgba(224, 169, 58, 0.12);
  --status-achtung-rahmen: rgba(224, 169, 58, 0.30);
  --status-fehler-flaeche: rgba(229, 96, 91, 0.12);
  --status-fehler-rahmen: rgba(229, 96, 91, 0.30);
  --fokus: 0 0 0 3px rgba(188, 49, 45, 0.55);
}

/* --------------------------------------------------------- 3 · Bausteine */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--schrift-titel); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 18px; font-weight: 600; }
p { margin: 0; }

a { color: var(--text-zweitrangig); }
a:hover { color: var(--text); }
:focus-visible { outline: none; box-shadow: var(--fokus); border-radius: var(--rund-klein); }

/* Seitengerüst: Navigation | Inhalt | Claude-Leiste */
.geruest { display: flex; flex-wrap: wrap; min-height: 100vh; }

.navigation {
  flex: 1 1 220px; max-width: 260px;
  display: flex; flex-direction: column; gap: var(--abstand-5);
  padding: var(--abstand-5) 0;
  background: var(--flaeche);
  border-right: 1px solid var(--rahmen);
}
.navigation__marke {
  padding: 0 var(--abstand-5);
  font-family: var(--schrift-titel); font-weight: 800; font-size: 20px;
  letter-spacing: -0.02em; color: var(--text); text-decoration: none;
}
.navigation__liste { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.navigation__eintrag {
  display: block; padding: var(--abstand-3) var(--abstand-5);
  border-left: 3px solid transparent;
  color: var(--text-zweitrangig); text-decoration: none;
}
.navigation__eintrag:hover { color: var(--text); background: var(--flaeche-erhoeht); }
.navigation__eintrag--aktiv {
  border-left-color: var(--akzent);
  background: var(--flaeche-gewaehlt);
  color: var(--text); font-weight: 600;
}
.navigation__fuss {
  margin-top: auto; padding: 0 var(--abstand-5);
  display: flex; flex-direction: column; gap: var(--abstand-2);
  font-size: 13px; color: var(--text-gedaempft);
}
.navigation__version { font-family: var(--schrift-daten); font-size: 12px; }

.inhalt {
  flex: 999 1 560px; min-width: 0;
  display: flex; flex-direction: column; gap: var(--abstand-5);
  padding: var(--abstand-6);
}
.inhalt__kopf { display: flex; flex-direction: column; gap: var(--abstand-2); }
.inhalt__einleitung { color: var(--text-zweitrangig); max-width: 70ch; }

/* Claude-Leiste */
.claude-rand {
  flex: 0 0 52px;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 72px;
  background: var(--flaeche);
  border-left: 1px solid var(--rahmen);
}
.claude-rand__drehung { transform: rotate(-90deg); white-space: nowrap; }
.claude-leiste {
  flex: 1 1 340px; max-width: 400px; min-width: 0;
  display: flex; flex-direction: column; gap: var(--abstand-4);
  padding: var(--abstand-5);
  background: var(--flaeche);
  border-left: 1px solid var(--rahmen);
}
.claude-leiste[hidden] { display: none; }
.claude-leiste__hinweis { color: var(--text-zweitrangig); }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 var(--abstand-4);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border-radius: var(--rund-klein);
  border: 1px solid var(--rahmen-stark);
  background: transparent; color: var(--text);
}
.knopf:hover { background: var(--flaeche-erhoeht); color: var(--text); }
.knopf--haupt { background: var(--akzent); border-color: var(--akzent); }
.knopf--haupt:hover { background: var(--akzent-hell); border-color: var(--akzent-hell); }

/* Fläche mit Rahmen */
.flaeche {
  display: flex; flex-direction: column; gap: var(--abstand-4);
  padding: var(--abstand-5);
  background: var(--flaeche);
  border: 1px solid var(--rahmen);
  border-radius: var(--rund-gross);
}

/* Statuszeilen */
.statusliste { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.statusliste__zeile {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--abstand-3);
  padding: var(--abstand-3) 0;
  border-bottom: 1px solid var(--rahmen);
}
.statusliste__zeile:last-child { border-bottom: none; }

.marke {
  display: inline-flex; align-items: center; gap: var(--abstand-2);
  padding: 2px var(--abstand-3);
  font-size: 13px; font-weight: 600;
  border-radius: var(--rund-klein);
  border: 1px solid var(--rahmen-stark);
}
.marke--gut { background: var(--status-gut-flaeche); border-color: var(--status-gut-rahmen); color: var(--status-gut); }
.marke--achtung { background: var(--status-achtung-flaeche); border-color: var(--status-achtung-rahmen); color: var(--status-achtung); }
.marke--fehler { background: var(--status-fehler-flaeche); border-color: var(--status-fehler-rahmen); color: var(--status-fehler); }

/* Beschreibungsliste der Bereiche */
.bereichsliste { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.bereichsliste__zeile {
  display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
  gap: var(--abstand-4);
  padding: var(--abstand-3) 0;
  border-bottom: 1px solid var(--rahmen);
}
.bereichsliste__zeile:last-child { border-bottom: none; }
.bereichsliste__name { font-weight: 600; }
.bereichsliste__text { color: var(--text-zweitrangig); }

/* Tabellen */
.tabelle-rahmen { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th {
  text-align: left; padding: var(--abstand-2) var(--abstand-3) var(--abstand-2) 0;
  font-weight: 600; font-size: 13px; color: var(--text-zweitrangig);
  border-bottom: 1px solid var(--rahmen-stark);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.tabelle th[aria-sort="ascending"]::after { content: " ↑"; }
.tabelle th[aria-sort="descending"]::after { content: " ↓"; }
.tabelle td {
  padding: var(--abstand-3) var(--abstand-3) var(--abstand-3) 0;
  border-bottom: 1px solid var(--rahmen); vertical-align: top;
}
.tabelle__daten { font-family: var(--schrift-daten); font-size: 13px; color: var(--text-zweitrangig); white-space: nowrap; }

/* Hinweis */
.hinweis {
  padding: var(--abstand-3) var(--abstand-4);
  border-radius: var(--rund-mittel);
  background: var(--status-achtung-flaeche);
  border: 1px solid var(--status-achtung-rahmen);
}

/* Anmeldeseite */
.anmeldung {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: var(--abstand-5);
}
.anmeldung__karte { width: 100%; max-width: 420px; align-items: flex-start; }
.anmeldung__marke { font-family: var(--schrift-titel); font-weight: 800; font-size: 32px; letter-spacing: -0.02em; }
.anmeldung__text { color: var(--text-zweitrangig); }
.anmeldung__version { font-family: var(--schrift-daten); font-size: 12px; color: var(--text-gedaempft); }

@media (max-width: 720px) {
  .navigation { max-width: none; border-right: none; border-bottom: 1px solid var(--rahmen); }
  .inhalt { padding: var(--abstand-5) var(--abstand-4); }
  .claude-rand { flex-basis: 100%; padding: var(--abstand-3); border-left: none; border-top: 1px solid var(--rahmen); }
  .claude-rand__drehung { transform: none; }
  .claude-leiste { max-width: none; border-left: none; border-top: 1px solid var(--rahmen); }
  .bereichsliste__zeile { grid-template-columns: minmax(0, 1fr); gap: var(--abstand-1); }
}

/* Auf breiten Bildschirmen bleiben Navigation und Claude-Rand beim Scrollen stehen. */
@media (min-width: 721px) {
  .navigation, .claude-rand, .claude-leiste {
    position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto;
  }
}
