/* Design-Tokens des Redesigns (R3 Etappe 1, Epic #43; Quelle docs/planung/redesign-r1-entwuerfe/tokens.css).
   Eine Systemschrift, eine Akzentfarbe, Ampelfarben nur für Zustände, Magenta nur für die Route. Lädt als erste Datei;
   styles.css bildet die bisherigen Namen (--ink, --muted, --rule …) auf diese Tokens ab. Dunkel nur am Bildschirm über
   data-theme="dark" (frueh.js setzt es nach Wahl bzw. Systemeinstellung), gedruckt wird immer hell.
   Kontraste nachgerechnet in docs/planung/redesign-r1-richtung.md (Text ≥ 4,5:1, Grafik ≥ 3:1). */

:root {
  color-scheme: light;

  /* Schrift: SF Pro auf Apple-Geräten, sonst die Systemschrift; Ziffern überall tabellarisch (styles.css body) */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Flächen */
  --t-bg: #f2f2f7;              /* gruppierter Grund */
  --t-surface: #ffffff;         /* Gruppe, Sheet */
  --t-surface-2: #f2f2f7;       /* Feld in einer Gruppe */
  --t-fill: rgba(118, 118, 128, 0.12);
  --t-fill-strong: rgba(118, 118, 128, 0.2);
  --t-sep: rgba(60, 60, 67, 0.2);       /* Haarlinie */
  --t-sep-solid: #d8d8dc;               /* Haarlinie als deckende Farbe (Ränder von Feldern) */
  --t-bar: #f9f9fb;                     /* Tab-Leiste und Toolbar, deckend (Lesbarkeit hängt nicht an Unschärfe) */
  --t-bar-edge: rgba(0, 0, 0, 0.12);
  --t-scrim: rgba(0, 0, 0, 0.32);

  /* Text */
  --t-label: #000000;
  --t-label-1: #1c1c1e;         /* Fließtext */
  --t-label-2: #5e5e63;         /* Nebentext: 6,4:1 auf Weiß, 5,8:1 auf --t-bg */
  --t-label-3: #6e6e73;         /* Platzhalter, Achsen: 5,0:1 */

  /* Akzent: Aktionen und Auswahl (Entscheidung Produktinhaber 11.11.2026: #0066CC) */
  --t-accent: #0066cc;          /* Text und Links, 5,6:1 */
  --t-accent-fill: #0066cc;     /* Knopffläche mit weißer Schrift */
  --t-accent-soft: rgba(0, 102, 204, 0.1);
  --t-accent-knopf: #0058b0;    /* Akzentschrift auf grauer Knopffläche (--t-fill über --t-bg): 5,5:1 statt 4,4:1 (axe R3-1) */
  --t-on-accent: #ffffff;

  /* Strecke: Magenta der ICAO-Karte, nur für die Route */
  --t-route: #b0007a;

  /* Zustände: Fläche des Symbols, Glyphe, Text */
  --t-ok-briefing: #526b58;
  --t-ok: #1e8e3e;    --t-ok-glyph: #ffffff;   --t-ok-text: #1a7a36;
  --t-warn: #f5b400;  --t-warn-glyph: #000000; --t-warn-text: #8a5300;
  --t-bad: #d70015;   --t-bad-glyph: #ffffff;  --t-bad-text: #c4000f;
  --t-open: #6e6e73;                           --t-open-text: #5e5e63;
  --t-ok-soft: rgba(30, 142, 62, 0.1);
  --t-warn-soft: rgba(245, 180, 0, 0.14);
  --t-bad-soft: rgba(215, 0, 21, 0.08);
  /* Gelbes Dreieck mit Rand: Gelb hat auf Weiß nur 1,8:1 */
  --t-warn-bild: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.3 2.9a2 2 0 0 1 3.4 0l9.2 16.2a2 2 0 0 1-1.7 3H2.8a2 2 0 0 1-1.7-3z' fill='%23f5b400' stroke='%238a5300' stroke-width='.9'/%3E%3C/svg%3E");

  /* Abstände (4er-Raster) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --gutter: 16px;

  /* Radien nach Ebene */
  --r-control: 8px;
  --r-group: 12px;
  --r-sheet: 22px;
  --r-pill: 999px;

  /* Schatten nur für Schwebendes (Menüs, Sheets, Leisten) */
  --shadow-float: 0 8px 28px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-sheet: 0 -2px 30px rgba(0, 0, 0, 0.18);

  --row-min: 44px;
  --toolbar-h: 52px;
}
@media (min-width: 1024px) and (pointer: fine) { :root { --row-min: 40px; --gutter: 20px; } }

/* Dunkel: echtes Schwarz als Grund, Gruppen #1c1c1e (iOS-System); Akzent heller für Text, dunkler für Knopfflächen */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --t-bg: #000000;
    --t-surface: #1c1c1e;
    --t-surface-2: #2c2c2e;
    --t-fill: rgba(118, 118, 128, 0.24);
    --t-fill-strong: rgba(118, 118, 128, 0.36);
    --t-sep: rgba(84, 84, 88, 0.65);
    --t-sep-solid: #3a3a3c;
    --t-bar: #1c1c1e;
    --t-bar-edge: rgba(255, 255, 255, 0.12);
    --t-scrim: rgba(0, 0, 0, 0.55);
    --t-label: #ffffff;
    --t-label-1: #f2f2f7;
    --t-label-2: #aeaeb2;
    --t-label-3: #98989d;
    --t-accent: #3d9bff;
    --t-accent-fill: #0a6cd6;
    --t-accent-soft: rgba(61, 155, 255, 0.16);
    --t-accent-knopf: #6cb4ff;  /* auf --t-fill über #1c1c1e: 6,2:1 */
    --t-route: #ff5cc4;
    --t-ok-briefing: #a0b5a5;
    --t-ok: #30d158;   --t-ok-glyph: #000000;  --t-ok-text: #30d158;
    --t-warn: #ffd60a; --t-warn-glyph: #000000; --t-warn-text: #ffd60a;
    --t-bad: #ff453a;  --t-bad-glyph: #000000;  --t-bad-text: #ff6961;
    --t-open: #98989d;                           --t-open-text: #aeaeb2;
    --t-ok-soft: rgba(48, 209, 88, 0.14);
    --t-warn-soft: rgba(255, 214, 10, 0.14);
    --t-bad-soft: rgba(255, 69, 58, 0.16);
    --t-warn-bild: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.3 2.9a2 2 0 0 1 3.4 0l9.2 16.2a2 2 0 0 1-1.7 3H2.8a2 2 0 0 1-1.7-3z' fill='%23ffd60a'/%3E%3C/svg%3E");
    --shadow-float: 0 8px 28px rgba(0, 0, 0, 0.6);
    --shadow-sheet: 0 -2px 30px rgba(0, 0, 0, 0.6);
  }
}

/* ---------- Urteilssymbol (eine Komponente für Urteil, Statuszeile, Tab-Marker; nie schwarz/weiß) ----------
   Form und Farbe tragen den Zustand: grüner Kreis mit Haken, gelbes Dreieck mit Ausrufezeichen, rotes Quadrat mit Kreuz,
   grauer Ring für offen. Das Element enthält weiter das Textzeichen (■ ▲ ● ○) für Tests und Kopien; sichtbar ist nur die
   gezeichnete Form. Größe über --sym (Standard 20 px × Schriftfaktor). */
.sym { --sym: calc(20px * var(--fs, 1)); position: relative; display: inline-grid; place-items: center; flex: none; width: var(--sym); height: var(--sym);
  font-size: 0; line-height: 0; color: transparent; vertical-align: -0.18em; border-radius: 50%; user-select: none; }
.sym::before { font: 700 calc(var(--sym) * 0.62)/1 var(--font); }
.sym.ok { background: var(--t-ok); }
.sym.ok::before { content: "✓"; color: var(--t-ok-glyph); font-size: calc(var(--sym) * 0.6); }
.sym.bad { background: var(--t-bad); border-radius: 22%; }
.sym.bad::before { content: "✕"; color: var(--t-bad-glyph); font-size: calc(var(--sym) * 0.5); }
.sym.warn { background: var(--t-warn-bild) center / contain no-repeat; border-radius: 0; }
.sym.warn::before { content: "!"; color: var(--t-warn-glyph); font-size: calc(var(--sym) * 0.56); padding-top: calc(var(--sym) * 0.2); }
.sym:is(.na, .open) { background: transparent; box-shadow: inset 0 0 0 calc(var(--sym) * 0.12) var(--t-open); }
.sym.uebung { background: var(--t-fill-strong); border-radius: 22%; }
.sym.uebung::before { content: "✎"; color: var(--t-label); font-size: calc(var(--sym) * 0.6); }
@media print { .sym { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* R5 P10: eingehaltene Grenzwerte bei offenem Briefing, auch in der großen Karte.
   Das Hinweis-Symbol nach „Gelesen“ behält seine gelbe Farbe (#63). */
.briefing-offen { --t-ok-text: var(--t-ok-briefing); --ok: var(--t-ok-briefing); }
.verdict.briefing-offen:is(.ok, .warn, .gelesen) .verdict-label, .urteil-satz.briefing-offen .urteil-satz-text,
.urteil-satz.briefing-offen .urteil-satz-kopf, .urteilsleiste.briefing-offen .ul-titel, .status-chip.briefing-offen .status-text,
.druck-urteil.briefing-offen { color: var(--t-ok-briefing); }

/* Grundgrößen der Bildschirmansicht (Entscheidung 13.11.2026). Druck nutzt die bisherigen Fallbacks. */
@media screen {
  :root {
    --fs: 1;
    --schrift-neben: 13px;
    --schrift-text: 15px;
    --schrift-abschnitt: 17px;
    --schrift-titel: 20px;
    --schrift-gross: 22px;
    --zeile-text: 1.4;
    --gruppe-abstand: 12px;
    --gruppe-innen: 16px;
    --kartenhoehe: clamp(420px, 58vh, 760px);
  }
  html[data-schrift="gross"] { --fs: 1.3; }
}
@media screen and (max-width: 767px) {
  :root { --schrift-text: 17px; --schrift-neben: 15px; }
}

@media screen and (min-width: 768px) and (orientation: portrait) {
  :root { --kartenhoehe: clamp(380px, 45vh, 640px); }
}
