/* Kollegmappe — Oberfläche.
   Trefferflächen ab 44 px, wichtige Bedienelemente unten (Regel 5).
   Palette und Typografie wie im Konzept. */

:root {
  --ground:      #F2F5F3;
  --surface:     #FFFFFF;
  --surface-2:   #E7EDEA;
  --ink:         #131C1A;
  --ink-2:       #4B5A56;
  --ink-3:       #77857F;
  --rule:        #D2DBD7;
  --rule-strong: #B6C3BE;
  --accent:      #0E6A57;
  --accent-soft: #DCEDE6;
  --warn:        #9A5B12;
  --warn-soft:   #F6ECDC;
  --gut:         #1B6B3A;

  --font-display: "Superclarendon", "Charter", "Iowan Old Style", Georgia, serif;
  --font-body: "Avenir Next", "Avenir", -apple-system, system-ui, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --kopf-hoehe: 56px;
  --tab-hoehe: 0px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground:      #0D1413;
    --surface:     #151E1C;
    --surface-2:   #1D2725;
    --ink:         #E3EAE7;
    --ink-2:       #9FAFAA;
    --ink-3:       #798883;
    --rule:        #2A3733;
    --rule-strong: #3B4B46;
    --accent:      #4FC2A4;
    --accent-soft: #12332C;
    --warn:        #E0AC6B;
    --warn-soft:   #2A2115;
    --gut:         #5FBE86;
  }
}

* { box-sizing: border-box; }

/* Muss vor allen display-Regeln stehen und sie schlagen: eine eigene
   display-Angabe überstimmt sonst das hidden-Attribut. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--tab-hoehe);
}

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

.sprung {
  position: absolute; left: -9999px;
}
.sprung:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 99; }

/* ---------- Kopf ---------- */

.kopf {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  height: var(--kopf-hoehe);
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.marke {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.hauptnav { display: flex; gap: 4px; overflow-x: auto; flex: 1; }
.hauptnav a {
  padding: 8px 12px; border-radius: 6px; text-decoration: none;
  color: var(--ink-2); font-size: 15px; white-space: nowrap;
}
.hauptnav a:hover { background: var(--surface-2); color: var(--ink); }
.hauptnav a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.zaehler {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--surface); font-size: 11px;
  font-family: var(--font-mono); text-align: center;
}
.kopf-aktion { display: flex; gap: 6px; }
.knopf-still {
  padding: 8px 12px; border-radius: 6px; border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink-2); font-size: 14px;
  text-decoration: none; cursor: pointer; font-family: inherit;
}
.knopf-still:hover { background: var(--surface-2); color: var(--ink); }

@media (max-width: 760px) {
  :root { --tab-hoehe: 62px; }
  .hauptnav, .kopf-aktion a { display: none; }
  .kopf { justify-content: space-between; }
  .kopf-aktion { display: flex; }
}

/* Tableiste unten — Daumenreichweite (Regel 5) */
.tableiste { display: none; }
@media (max-width: 760px) {
  .tableiste {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--rule);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tableiste a {
    min-height: 56px; display: flex; align-items: center; justify-content: center;
    text-decoration: none; color: var(--ink-3); font-size: 13px; font-weight: 500;
  }
  .tableiste a[aria-current] { color: var(--accent); font-weight: 600; }
}

/* ---------- Grundraster ---------- */

.inhalt { max-width: 1180px; margin: 0 auto; padding: 22px 18px 40px; }

h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 32px); line-height: 1.15; letter-spacing: -0.01em;
  margin: 0 0 4px; text-wrap: balance;
}
h2 { font-family: var(--font-display); font-size: 20px; margin: 30px 0 10px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
.unterzeile { color: var(--ink-2); margin: 0 0 22px; font-size: 15px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.leer { color: var(--ink-3); font-style: italic; padding: 24px 0; }

.karte {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 8px; padding: 16px 18px;
}
.raster { display: grid; gap: 14px; }
.raster-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.raster-3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* ---------- Stundenkarten ---------- */

.stundenliste { display: grid; gap: 10px; }
.stundenkarte {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 5px solid var(--fach, var(--rule-strong));
  border-radius: 8px; padding: 14px 16px; min-height: 72px;
  text-decoration: none; color: inherit;
}
.stundenkarte:hover { border-color: var(--rule-strong); background: var(--surface-2); }
.stundenkarte .zeit { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.stundenkarte .zeit b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
.stundenkarte .wer { display: block; font-weight: 600; font-size: 17px; }
.stundenkarte .was {
  display: block; color: var(--ink-2); font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stundenkarte .rechts { text-align: right; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
@media (max-width: 560px) {
  .stundenkarte { grid-template-columns: 76px 1fr; }
  .stundenkarte .rechts { grid-column: 2; text-align: left; }
}

/* ---------- Tabellen ---------- */

.tabelle-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 560px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 600; background: var(--surface-2);
}
tbody tr:last-child td { border-bottom: none; }
td.zahl, th.zahl { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.notiz { display: block; color: var(--ink-3); font-size: 13px; }

.spine { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.spine::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--fach, var(--ink-3)); flex: none; }

.marke-chip {
  display: inline-block; font-family: var(--font-mono); font-size: 11px;
  padding: 2px 7px; border-radius: 4px; border: 1px solid var(--rule-strong); color: var(--ink-2);
}

/* ---------- Jahresplanung ---------- */

.plan { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 620px; }
.plan th, .plan td { padding: 9px 14px; border-bottom: 1px solid var(--rule); }
.plan .kopfzeile td {
  background: var(--surface-2); font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.plan .frei td { color: var(--ink-3); }
.plan .eng td { background: var(--warn-soft); color: var(--warn); }
.balken {
  display: block; height: 5px; border-radius: 3px; margin-bottom: 6px;
  background: var(--fach, var(--accent)); width: var(--w, 20%); min-width: 14px;
}
.balken.gestrichelt {
  background: repeating-linear-gradient(135deg, var(--rule-strong) 0 4px, transparent 4px 8px);
}

/* ---------- Filter-Rail ---------- */

.mit-rail { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .mit-rail { grid-template-columns: 1fr; } }
.rail { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 14px; }
.rail-gruppe { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); margin: 16px 0 6px; }
.rail-gruppe:first-child { margin-top: 0; }
.rail a {
  display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 8px;
  border-radius: 6px; text-decoration: none; color: var(--ink-2); font-size: 14.5px;
}
.rail a:hover { background: var(--surface-2); }
.rail a.an { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.rail .punkt { width: 9px; height: 9px; border-radius: 3px; background: var(--fach, var(--rule-strong)); flex: none; }

/* ---------- Materialkarten ---------- */

.matkarte {
  display: block; background: var(--surface); border: 1px solid var(--rule);
  border-top: 3px solid var(--fach, var(--rule-strong));
  border-radius: 8px; padding: 12px 13px; text-decoration: none; color: inherit;
  min-height: 96px;
}
.matkarte:hover { background: var(--surface-2); }
.matkarte .t { font-weight: 600; display: block; margin-bottom: 4px; line-height: 1.3; }
.matkarte .m { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); display: block; }
.matkarte .fund { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; display: block; }
.matkarte .fund b { background: var(--accent-soft); color: var(--accent); }
.matkarte img { width: 100%; height: 90px; object-fit: cover; object-position: top;
  border-radius: 4px; margin-bottom: 8px; border: 1px solid var(--rule); }

/* ---------- Formulare ---------- */

input[type="text"], input[type="search"], input[type="password"], textarea, select {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: 6px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 72px; resize: vertical; line-height: 1.5; }
label { display: block; font-size: 13px; color: var(--ink-2); margin: 12px 0 4px; }
.feldpaar { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.knopf:hover { filter: brightness(1.08); }
.knopf.sekundaer { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }

/* ---------- Phasen ---------- */

.phasen { display: grid; gap: 0; }
.phase {
  display: grid; grid-template-columns: 74px 1fr 40px; gap: 12px; align-items: start;
  padding: 10px 0; border-bottom: 1px dashed var(--rule);
}
.phase:last-child { border-bottom: none; }
.phase input[type="text"] { min-height: 40px; }
.phase .dauer { font-family: var(--font-mono); text-align: center; }
.phase .weg {
  min-height: 40px; width: 36px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--surface); color: var(--ink-3); cursor: pointer; font-size: 18px;
}

/* ---------- Anhänge ---------- */

/* Zwei Zeilen: oben der Titel über die volle Breite, darunter Rolle und Lösen.
   Nebeneinander gequetscht brach jeder Materialtitel in eine Buchstabensäule. */
.anhang {
  display: grid; grid-template-columns: auto 1fr auto;
  grid-template-areas: "art titel weg" ".   rolle rolle";
  align-items: center; gap: 6px 10px; padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.anhang:last-of-type { border-bottom: none; }
.anhang .art {
  grid-area: art; align-self: start; margin-top: 2px;
  font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--rule-strong);
  border-radius: 4px; padding: 2px 5px; color: var(--ink-3);
}
.anhang a {
  grid-area: titel; text-decoration: none; color: var(--ink);
  font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere;
}
.anhang select { grid-area: rolle; width: 100%; min-height: 36px; font-size: 13px; padding: 4px 8px; }
.anhang .weg {
  grid-area: weg; align-self: start; border: none; background: none;
  color: var(--ink-3); cursor: pointer; font-size: 18px; min-height: 32px; padding: 0 4px;
}

/* ---------- Ablegen ---------- */

.ablage {
  border: 2px dashed var(--rule-strong); border-radius: 10px;
  padding: 28px 20px; text-align: center; color: var(--ink-2);
  background: var(--surface); margin-bottom: 18px;
}
.ablage.aktiv { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ablage input[type="file"] { display: none; }

/* ---------- Suchschicht ---------- */

.suchschicht {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.35);
  display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
}
.suchkasten {
  width: min(640px, 100%); background: var(--surface); border-radius: 12px;
  border: 1px solid var(--rule-strong); padding: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.suchtreffer { max-height: 44vh; overflow-y: auto; margin-top: 10px; }
.suchtreffer a {
  display: block; padding: 10px 12px; border-radius: 6px; text-decoration: none;
  color: var(--ink); min-height: 44px;
}
.suchtreffer a:hover, .suchtreffer a.aktiv { background: var(--surface-2); }
.suchtreffer .m { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.suchhinweis { font-size: 12.5px; color: var(--ink-3); margin: 10px 4px 2px; }

/* ---------- Hinweis ---------- */

.hinweis {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-hoehe) + 16px); z-index: 70;
  background: var(--ink); color: var(--ground);
  padding: 10px 18px; border-radius: 20px; font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

/* ---------- Meldungen ---------- */

.warnkasten {
  background: var(--warn-soft); border-left: 3px solid var(--warn);
  padding: 12px 16px; border-radius: 0 6px 6px 0; margin: 16px 0; font-size: 14.5px;
}
.gutkasten {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 0 6px 6px 0; margin: 16px 0; font-size: 14.5px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* ---------- Stundenmaterial: drei Gruppen ---------- */

/* Was die Klasse bekommt und was nur du siehst, darf sich nicht mischen —
   im Unterricht wird sonst der Erwartungshorizont mit ausgeteilt. */
.karte.gruppe-klasse { border-left: 3px solid var(--accent); }
.karte.gruppe-lehrkraft { border-left: 3px solid var(--warn); background: var(--warn-soft); }
.karte.gruppe-lehrkraft .eyebrow { color: var(--warn); }
.karte.gruppe-lehrkraft .art { border-color: var(--warn); color: var(--warn); }
.karte.gruppe-klasse .anhang,
.karte.gruppe-lehrkraft .anhang { grid-template-areas: "art titel weg"; }

/* Netzquellen sind keine Dateien, sondern Adressen. Der eigene Rahmen sagt
   das vor dem Klick — sonst sucht man im Unterricht ein PDF, das es nicht gibt. */
.karte.gruppe-netz { border-left: 3px solid var(--link, #3b6ea5); }
.anhang.netz { align-items: flex-start; }
.anhang.netz .quellzeile {
  grid-area: rolle;
  margin: 2px 0 0;
  font-size: .78rem;
  color: var(--gedaempft, #6b7280);
}

/* ---------- QR an der Wand ---------- */

/* Weisser Grund unabhängig vom Farbschema: ein QR-Code auf dunklem Untergrund
   wird von keiner Kamera erkannt. */
.qr-buehne {
  display: inline-flex; flex-direction: column; align-items: center; gap: 12px;
  background: #fff; padding: 26px 30px; border-radius: 12px;
  border: 1px solid var(--rule);
}
.qr-bild { line-height: 0; }
.qr-adresse { font-size: 12px; color: #444; margin: 0; word-break: break-all; max-width: 340px; text-align: center; }
.anhang .qr-link { grid-area: rolle; font-size: 12.5px; color: var(--ink-3); }
