/* ═══════════════════════════════════════════════════════════════
   diacompas — Pilot-Prototyp: EIN Knopf, EIN Strom.
   Designsystem aus dem Hauptsystem: ruhige Klarheit, eine
   Akzentfarbe (Blau), viel Weißraum, Kompassnadel-Motiv.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --gruen:       #1a7f4b;
  --blau:        #2563eb;
  --blau-dunkel: #1d4ed8;
  --blau-tief:   #1b4f8a;
  --blau-zart:   #eef5fb;
  --gelb:        #d4a017;
  --rot:         #c0392b;
  --grau:        #5b6770;
  --tinte:       #1f2933;
  --hell:        #f6f8fb;
  --linie:       #e5e8ec;
  --weiss:       #ffffff;
  --schatten:    0 2px 14px rgba(20, 35, 70, 0.07);
  --radius:      14px;
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  background: var(--hell);
  color: var(--tinte);
  line-height: 1.55;
  min-height: 100dvh;
  /* Platz für den schwebenden Kamera-Knopf */
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
}

/* ── Kompassnadel (Marken-Icon, identisch zum Hauptsystem) ──────── */
.nadel-icon {
  display: inline-block;
  width: 1em; height: 1em;
  vertical-align: -0.14em;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='44' fill='none' stroke='%23000' stroke-opacity='.22' stroke-width='4'/%3E%3Cpolygon points='50,14 61,50 50,53 39,50' fill='%232563eb'/%3E%3Cpolygon points='50,86 39,50 50,47 61,50' fill='%239db8f0'/%3E%3Ccircle cx='50' cy='50' r='4.5' fill='%232563eb'/%3E%3C/svg%3E");
}

/* ── Kopfzeile ──────────────────────────────────────────────────── */
.kopf {
  position: sticky; top: 0; z-index: 50;
  background: var(--weiss);
  border-bottom: 1px solid var(--linie);
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
}
.marke { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.marke .nadel-icon { font-size: 1.35rem; }
.klasse-chip {
  font-size: 0.82rem; font-weight: 600; color: var(--blau-tief);
  background: var(--blau-zart); border: 1px solid #d5e6f7;
  padding: 3px 11px; border-radius: 999px;
}

/* ── Strom ──────────────────────────────────────────────────────── */
#strom {
  max-width: 520px; margin: 0 auto;
  padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 10px;
}

h2.abschnitt {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--grau);
  margin: 8px 2px 0;
}

.karte {
  background: var(--weiss);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 14px 16px;
}

/* Leerer Anfang (direkt nach Reset) */
.leer-karte { text-align: center; padding: 28px 16px; color: var(--grau); }
.leer-karte .gross { font-size: 2rem; }

/* ── Läuft gerade (Warteschlange) ───────────────────────────────── */
.laeuft-zeile {
  display: flex; align-items: center; gap: 10px;
  background: var(--weiss); border-radius: 12px;
  box-shadow: var(--schatten); padding: 10px 14px;
  font-size: 0.95rem;
}
.laeuft-zeile .name { font-weight: 700; flex: 1; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--blau-zart); border-top-color: var(--blau);
  animation: drehen 0.8s linear infinite;
  flex: 0 0 auto;
}
@keyframes drehen { to { transform: rotate(360deg); } }

.scan-code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.85rem; color: var(--grau); font-weight: 600; }

/* ── Schüler-Karte (drei Blickrichtungen) ───────────────────────── */
.ausw-karte { padding: 0; overflow: hidden; }
.ausw-karte.karte-neu { border: 1.5px solid var(--blau); animation: aufleuchten 1.6s ease 1; }
@keyframes aufleuchten {
  0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35); }
  100% { box-shadow: var(--schatten); }
}

.ausw-karte summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;                 /* schmale Displays: Chips rutschen in 2. Zeile */
  padding: 13px 16px;
  -webkit-tap-highlight-color: transparent;
}
.ausw-karte summary::-webkit-details-marker { display: none; }
.sus-name { font-weight: 700; flex: 1; min-width: 0; }
.sus-neu {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em;
  background: var(--blau); color: var(--weiss);
  padding: 2px 8px; border-radius: 999px;
}
.stufen-punkte { display: flex; gap: 4px; flex: 0 0 auto; }
.stufen-punkte i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.s100 { background: var(--gruen); }
.s75  { background: #7bc096; }
.s50  { background: var(--gelb); }
.s25  { background: #de8e7a; }

.ausw-detail { padding: 2px 16px 14px; }

/* Kompetenz-Reiter: eine Einzelkompetenz beherrscht das Feld,
   horizontal wechselbar (bei vielen EKs seitlich scrollbar). */
.ek-reiter {
  display: flex; gap: 6px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0 10px;
}
.ek-reiter::-webkit-scrollbar { display: none; }
.ek-tab {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; flex: 0 0 auto;
  font: inherit; font-size: 0.78rem; font-weight: 700;
  padding: 5px 11px; border-radius: 999px;
  border: 1.5px solid var(--linie); background: var(--weiss); color: var(--grau);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ek-tab i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.ek-tab.aktiv { border-color: var(--blau); background: var(--blau-zart); color: var(--blau-tief); }
.tab-gesamt { border-color: #c9d6e6; color: var(--blau-tief); font-weight: 800; }
.tab-gesamt .nadel-icon { font-size: 0.95rem; }
.tab-gesamt.aktiv { border-color: var(--blau-tief); background: var(--blau-tief); color: var(--weiss); }
.tab-gesamt.aktiv .nadel-icon { filter: brightness(0) invert(1); }

/* ── Gesamtbild: geclusterter Fähigkeiten-Ausweis ───────────────── */
.g-untertitel {
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--grau); opacity: 0.85;
  margin: 12px 0 4px;
}

/* Bereichs-Balken (Cluster): Farbe = Eigenständigkeit, ↗ = Trend,
   n = Evidenz. n < 2 → ausgegraut (Ehrlichkeitsregel). */
.cl-zeile { margin-top: 7px; }
.cl-zeile[data-ek] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cl-kopf { display: flex; align-items: baseline; gap: 6px; font-size: 0.85rem; }
.cl-name { font-weight: 700; }
.cl-trend { font-weight: 800; font-size: 0.85rem; }
.trend-auf    { color: var(--gruen); }
.trend-gleich { color: var(--grau); }
.trend-ab     { color: var(--rot); }
.cl-meta { margin-left: auto; font-size: 0.7rem; color: var(--grau); }
.cl-pfeil { color: var(--grau); font-weight: 700; }
.cl-balken {
  height: 8px; border-radius: 999px; background: var(--hell);
  overflow: hidden; margin-top: 3px;
}
.cl-balken i { display: block; height: 100%; border-radius: 999px; }
.cl-schwach .cl-name { color: var(--grau); }
.cl-schwach .cl-balken i { background: #c3cbd3; }

/* Denkschritte-Treppe: Operatoren nach AFB I–III, ohne Jargon */
.afb-treppe { display: flex; align-items: flex-end; gap: 5px; }
.afb-stufe {
  flex: 1; background: var(--hell); border-radius: 8px;
  padding: 7px 4px 6px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.afb-1 { min-height: 56px; }
.afb-2 { min-height: 68px; }
.afb-3 { min-height: 80px; }
.afb-verb { font-size: 0.7rem; font-weight: 700; }
.afb-stufe i { width: 11px; height: 11px; border-radius: 50%; }
.afb-wort { font-size: 0.66rem; font-weight: 700; color: var(--grau); }
.afb-leer { opacity: 0.55; justify-content: flex-end; }
.afb-leer .afb-wort { font-weight: 500; }

/* Querschnitt: Leitgedanken-Chips (bewusst keine Balken — geringeres
   Gewicht im System, „beobachtet" statt gemessen) */
.lg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-chip {
  font-size: 0.72rem; font-weight: 600; color: var(--blau-tief);
  background: var(--blau-zart); border: 1px solid #d5e6f7;
  padding: 3px 10px; border-radius: 999px;
}

/* Das Feld: Hattie-Trias untereinander — Woher · Was ist · Wohin */
.ek-feld { display: flex; flex-direction: column; gap: 13px; }

.richtung { border-left: 3px solid var(--linie); padding-left: 12px; }
.richtung-heute   { border-left-color: var(--gruen); }
.richtung-zurueck { border-left-color: #9aa8b5; }
.richtung-vor     { border-left-color: var(--blau); }

.richtung-label {
  display: block;
  font-size: 0.64rem; font-weight: 800; letter-spacing: 0.09em;
  text-transform: uppercase; margin-bottom: 2px;
}
.richtung-zurueck .richtung-label { color: #9aa8b5; }
.richtung-heute   .richtung-label { color: var(--gruen); }
.richtung-vor     .richtung-label { color: var(--blau); }

.kernsatz { font-weight: 700; font-size: 0.95rem; line-height: 1.45; }
.richtung-zurueck .kernsatz { color: var(--grau); }
.richtung-vor .kernsatz { color: var(--blau-tief); }

.richtung-text { font-size: 0.9rem; color: var(--grau); margin-top: 5px; }

/* Kreuzungs-Matrix: Niveaustufe (Zeilen) × Eigenständigkeit (Spalten) */
.kreuz {
  display: grid;
  grid-template-columns: 46px repeat(4, 1fr);
  gap: 3px;
  align-items: center;
  margin-top: 8px;
}
.kz-ecke, .kz-kopf {
  font-size: 0.6rem; font-weight: 700; color: var(--grau);
  line-height: 1.2;
}
.kz-kopf { text-align: center; }
.kz-niveau { font-size: 0.72rem; font-weight: 700; color: var(--grau); }
.kz-zelle {
  background: var(--hell); border-radius: 6px; height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.kz-heute, .kz-woher, .kz-ziel {
  width: 13px; height: 13px; border-radius: 50%; display: inline-block;
  flex: 0 0 auto;
}
.kz-heute { background: var(--gruen); }
.kz-woher { background: #9aa8b5; }
.kz-ziel  { background: var(--weiss); border: 2.5px solid var(--blau); }
.kreuz-legende {
  display: flex; gap: 14px; align-items: center;
  font-size: 0.7rem; color: var(--grau);
  margin-top: 5px;
}
.kreuz-legende span { display: inline-flex; align-items: center; gap: 4px; }
.kreuz-legende i { width: 10px; height: 10px; }

/* ── 🔔-Karte (kontextuelle Push-Frage) ─────────────────────────── */
.hinweis-karte { display: flex; align-items: center; gap: 12px; }
.hinweis-karte .text { flex: 1; font-size: 0.88rem; color: var(--grau); }
.hinweis-karte .text strong { color: var(--tinte); }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 0.9rem;
  border: none; border-radius: 999px; cursor: pointer;
  padding: 9px 16px;
  background: var(--blau); color: var(--weiss);
  transition: background 0.15s ease, transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}
.knopf:active { transform: scale(0.97); background: var(--blau-dunkel); }
.knopf-hell { background: var(--weiss); color: var(--blau-tief); border: 1.5px solid var(--blau); }
.knopf-hell:active { background: var(--blau-zart); }
.knopf-leise {
  background: none; border: none; color: var(--grau);
  font: inherit; font-size: 0.84rem; text-decoration: underline; cursor: pointer;
  padding: 8px; align-self: center;
}

/* ── Der eine Knopf ─────────────────────────────────────────────── */
#fab {
  position: fixed; z-index: 70;
  left: 50%; transform: translateX(-50%);
  bottom: calc(22px + env(safe-area-inset-bottom));
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--blau); color: var(--weiss);
  border: 4px solid var(--weiss); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 26px rgba(37, 99, 235, 0.45);
  transition: transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
#fab:active { transform: translateX(-50%) scale(0.93); }
#fab svg { width: 36px; height: 36px; }

/* ── Erkennungs-Blende (über dem Knopf) ─────────────────────────── */
#scan-blende {
  position: fixed; z-index: 65;
  left: 50%; transform: translateX(-50%);
  bottom: calc(112px + env(safe-area-inset-bottom));
  width: min(92vw, 380px);
  background: var(--blau-tief); color: var(--weiss);
  border-radius: 14px; padding: 13px 16px;
  box-shadow: 0 10px 30px rgba(20, 35, 70, 0.35);
  display: flex; align-items: center; gap: 12px;
  font-size: 0.95rem; font-weight: 600;
  animation: blende-rein 0.25s ease;
}
#scan-blende[hidden] { display: none; }
@keyframes blende-rein { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%); } }
#scan-blende .spinner { border-color: rgba(255,255,255,0.25); border-top-color: #fff; }
#scan-blende small { display: block; font-weight: 500; opacity: 0.8; }
#scan-blende .ok { font-size: 1.25rem; }

/* ── Toasts (In-App-Benachrichtigung) ───────────────────────────── */
#toasts {
  position: fixed; left: 12px; right: 12px;
  top: calc(10px + env(safe-area-inset-top));
  z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--blau-tief); color: var(--weiss);
  border-radius: 12px; padding: 12px 16px;
  box-shadow: 0 8px 24px rgba(20, 35, 70, 0.35);
  font-size: 0.92rem; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  animation: toast-rein 0.35s cubic-bezier(0.21, 1.02, 0.73, 1);
  max-width: 520px; margin: 0 auto; width: 100%;
}
.toast small { display: block; font-weight: 500; opacity: 0.85; }
@keyframes toast-rein { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
.toast.raus { animation: toast-raus 0.3s ease forwards; }
@keyframes toast-raus { to { opacity: 0; transform: translateY(-16px); } }

/* ── Größere Bildschirme ────────────────────────────────────────── */
@media (min-width: 700px) {
  body { background: #e8edf4; }
  .kopf { max-width: 520px; margin: 0 auto; }
}
