/* ============================================================================
   Lehrerplaner – eigenes Design-System
   ----------------------------------------------------------------------------
   Wird NACH pico.min.css geladen und überschreibt dessen Vorgaben gezielt.
   Kein Build-Schritt: reine CSS-Datei, ausgeliefert über /static/lp.css.

   Aufbau:
     1. Token (Farben, Radien, Schatten)  – die einzige Quelle für Werte
     2. Grundtypografie
     3. Kopfzeile: Marke, Tabs, Kontextleiste
     4. Kennzahlen und Panels
     5. Tabellen, Chips, Notizen
     6. Kalender (Woche/Tag, Quartal, Jahr)
     7. Kleinteile (Formulare, Verleih, Hausübung, Feiertage)
     8. Kleine Hilfsklassen
     9. Schmale Geräte (Tablet/Handy) und Druck

   WICHTIG für Umbauten: `ul.lp-links` ist die Tabellenleiste – sie wird sowohl
   in der Kopfzeile als auch im Untermenü der Verwaltung verwendet. Wer daran
   dreht, prüft beide Stellen.
   ============================================================================ */

/* ---------------------------------------------------------------- 1. Token */
/* Farbwelt und Maße sind an eduki.com/de angelehnt (dort aus den
   CSS-Variablen ausgelesen): Türkis als einzige starke Markenfarbe, Gelb für
   Hinweise und Hervorhebungen, weiche Mint-/Himmelstöne für Flächen, warmes
   Off-White als Seite, kleine Radien und ein 4-px-Raster. */
:root {
  /* Radien – bewusst klein (eduki: 4/6/8/16) */
  --lp-radius-sm: 4px;
  --lp-radius: 6px;
  --lp-radius-lg: 8px;
  --lp-radius-xl: 16px;
  --lp-radius-pill: 9999px;

  /* Raster: alle Abstände sind Vielfache von 4px */
  --lp-1: 4px;
  --lp-2: 8px;
  --lp-3: 12px;
  --lp-4: 16px;
  --lp-6: 24px;
  --lp-9: 36px;
  --lp-16: 64px;

  /* Marke: Türkis */
  --lp-primary: #26bfbf;
  --lp-primary-deep: #1e9898;
  --lp-primary-ink: #0f4c4c;
  --lp-primary-soft: #effafe;
  --lp-primary-soft-2: #d1f8f8;
  --lp-primary-soft-3: #8ceeee;

  /* Zweitfarben – geben den Unterschied, den es vorher zu wenig gab */
  --lp-pink: #e83e8c;
  --lp-mint: #5ae0c0;
  --lp-twilight: #b1b1f6;
  --lp-yellow: #ffeaa2;
  --lp-yellow-soft: #fef1c3;
  --lp-yellow-ink: #4a3c0a;

  /* Text */
  --lp-text: #262626;
  --lp-text-2: #6c757d;
  --lp-text-3: #a8a8a8;

  /* Linien und Flächen */
  --lp-line: #e7e7e7;
  --lp-line-2: #f0f0f0;
  --lp-soft: #f6f6f6;
  --lp-soft-strong: #ececec;
  --lp-bg: #fffdf6;      /* warmes Off-White – die Seite wirkt heller */
  --lp-card: #ffffff;
  --lp-muted-strong: #495057;

  /* Bedeutungen – je EINE Definition */
  --lp-ok-bg: #e3f6e9;    --lp-ok-fg: #14652f;   --lp-ok-line: #1e8e3e;
  --lp-warn-bg: #fef1c3;  --lp-warn-fg: #6b5308; --lp-warn-line: #dfc626;
  --lp-err-bg: #fdeaec;   --lp-err-fg: #a1031a;  --lp-err-line: #d1031c;
  --lp-info-bg: #effafe;  --lp-info-fg: #0f4c4c; --lp-info-line: #26bfbf;

  /* Ferien und gesetzliche Feiertage – bewusst verschiedene Farben:
     Ferien verwaltet jede Schule selbst, Feiertage sind bundesweit fest. */
  --lp-ferien-bg: #fff5e6; --lp-ferien-fg: #a05a00; --lp-ferien-line: #ffb84d;
  --lp-feiertag-bg: #fdeaec; --lp-feiertag-fg: #a1031a; --lp-feiertag-line: #d1031c;

  --lp-sh: 0 1px 2px rgba(0, 0, 0, .06), 0 1px 3px rgba(0, 0, 0, .04);
  --lp-sh-hover: 0 2px 6px rgba(0, 0, 0, .10), 0 1px 3px rgba(0, 0, 0, .06);

  /* Eingabefelder: ein eigener, deutlicherer Rand – die zarten --lp-line
     (#e7e7e7) verschwimmen auf dem Handy mit der weißen Fläche, ein Feld ist
     dann kaum zu finden. Dazu ein Fokusring, der sofort zeigt, welches Feld
     gerade dran ist. */
  --lp-field-line: #c2c2c2;
  --lp-field-ring: 0 0 0 3px var(--lp-primary-soft-2);
  /* Mindestgröße für Tippziele – Apple HIG und Material nennen 44–48px. */
  --lp-touch: 48px;

  /* Fächer – kräftiger als vorher, damit sich die Spalten deutlich
     unterscheiden. Schlüssel vergibt app/ui.py::fach_schluessel. */
  --f-deu: #2f6fb5;
  --f-ma:  #1f8a52;
  --f-su:  #c07a00;
  --f-mu:  #8250c8;
  --f-we:  #a05840;
  --f-be:  #d94a7c;
  --f-bs:  #0d9aa8;
  --f-re:  #6c757d;
  --f-sonst: #848c94;
}

/* --------------------------------------------------- 2. Grundtypografie */

/* Pico auf unsere Werte ziehen.
   Pico bringt einen eigenen Primärton (#0172ad, ein Blaustich) und eigene
   Radien mit. Dadurch trugen Knöpfe, Kästchen und Fokusringe eine andere Farbe
   als unsere Links, Chips und Tabs – sichtbar etwa am „Zuweisen"-Knopf, der
   neben einem türkisen Reiter blaustichig wirkte. Statt jeden Knopf einzeln zu
   überschreiben, werden hier Picos eigene Variablen belegt: dann passen ALLE
   Bausteine von Pico (Knöpfe, Eingaben, Kästchen, Fokusränder) automatisch.

   Der Selektor ist ABSICHTLICH derselbe wie in Pico selbst
   (``:root:not([data-theme=dark]),[data-theme=light]``). Ein einfaches ``:root``
   verliert hier: Pico hängt seine Farben an ``:root:not(...)`` mit der
   Spezifität (0,2,0), ein blosses ``:root`` hat nur (0,1,0) – die eigenen Werte
   kamen deshalb nie an, und Knöpfe blieben im Pico-Blau. Bei gleicher
   Spezifität entscheidet die Reihenfolge, und diese Datei steht nach Pico. */
:root:not([data-theme=dark]),
[data-theme=light] {
  /* Pico skaliert die Schrift auf breiten Bildschirmen auf 125 % – damit war
     1rem = 20px, und unsere Werte in rem (Tabs, Auswahlfelder) wurden auf
     17,5px aufgeblasen, während der Fließtext bei 15px steht. Die Felder wirkten
     dadurch größer als der Rest. Feste Wurzel = eine Skala für alles. */
  --pico-font-size: 100%;

  --pico-primary: var(--lp-primary);
  --pico-primary-background: var(--lp-primary);
  --pico-primary-border: var(--lp-primary);
  --pico-primary-hover: var(--lp-primary-deep);
  --pico-primary-hover-background: var(--lp-primary-deep);
  --pico-primary-hover-border: var(--lp-primary-deep);
  --pico-primary-focus: var(--lp-primary-soft-2);
  --pico-primary-inverse: #fff;
  --pico-primary-underline: transparent;

  --pico-secondary: var(--lp-text-2);
  --pico-secondary-background: var(--lp-text-2);
  --pico-secondary-hover-background: var(--lp-text);
  --pico-secondary-border: var(--lp-text-2);

  --pico-border-radius: var(--lp-radius);
  --pico-form-element-border-color: var(--lp-field-line);
  --pico-form-element-active-border-color: var(--lp-primary);
  --pico-form-element-focus-color: var(--lp-primary);
  --pico-form-element-background-color: var(--lp-card);
  --pico-form-element-color: var(--lp-text);
  --pico-form-element-placeholder-color: var(--lp-text-3);
  --pico-muted-color: var(--lp-text-2);
  --pico-muted-border-color: var(--lp-line);
  --pico-color: var(--lp-text);
  --pico-background-color: var(--lp-bg);
  --pico-card-background-color: var(--lp-card);
  --pico-card-border-color: var(--lp-line);
  --pico-mark-background-color: var(--lp-yellow-soft);
}

body {
  font-size: 15px;
  color: var(--lp-text);
  background: var(--lp-bg);
}
/* Pico ist hier sehr großzügig; auf einem Lehrerinnen-Laptop zählt jedes
   Stück Höhe, das über dem Inhalt verloren geht. */
h1, h2 { font-size: 1.35rem; letter-spacing: -.01em; }
h3 { font-size: 1.02rem; }
h4 { font-size: .92rem; }
hgroup { margin-bottom: .6rem; }
hgroup p { margin-bottom: .2rem; }
main.container { padding-bottom: 3rem; }
/* Erklärsätze unter der Überschrift: hilfreich beim ersten Mal, danach nur
   noch im Weg. Bleibt im DOM (auffindbar, übersetzbar), wird aber leiser. */
main > #lp-content > p:first-of-type { color: var(--lp-text-2); }
a { color: var(--lp-primary); }

/* --------------------------------------------------- 3. Kopfzeile */
.lp-header {
  position: sticky;          /* Navigation geht beim Scrollen nicht verloren */
  top: 0;
  z-index: 30;
  background: var(--lp-card);
  border-bottom: 1px solid var(--lp-line);
  box-shadow: var(--lp-sh);
  padding-block: .5rem 0;
}
.lp-nav { display: block; padding-bottom: .45rem; }
.lp-nav > row { display: block; }

/* Erste Zeile: Marke links, Kontext und Konto rechts */
.lp-kopfzeile {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: .5rem;
}
.lp-brand {
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  color: var(--lp-text);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}
.lp-brand:hover { color: var(--lp-primary); }

/* Kontext: Bereich (Mandant) und Schuljahr – links neben der Marke, weil das
   zum Arbeiten gehört. Rechts steht das Konto (siehe .lp-konto). */
.lp-kontext {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.lp-kontext form { margin: 0; }
.lp-kontext select {
  margin: 0;
  width: auto;
  height: auto;
  padding: .3rem 1.9rem .3rem .6rem;
  font-size: .82rem;
  border-radius: var(--lp-radius-sm);
  border-color: var(--lp-line);
  background-color: var(--lp-card);
  font-weight: 500;
}
.lp-kontext select:hover { border-color: var(--lp-primary); }
.lp-ctx-titel {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
  color: var(--lp-text-3);
}
/* Das Schuljahr steht seit 1.06 nur noch als ruhige Anzeige da – es lässt sich
   nicht mehr verwalten oder umschalten (Kalender = Einstieg, immer heute). */
.lp-ctx-wert {
  font-size: .82rem;
  font-weight: 600;
  color: var(--lp-text-2);
}
/* Konto: rechts oben – Zustand des Bereichs (Testversion, später Abo und
   Zahlung) und das Abmelden. `margin-left: auto` schiebt den Block an den
   rechten Rand, weil Marke und Kontext links stehen. */
.lp-konto {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.lp-konto form { margin: 0; }

/* Abmelden: Kontohandlung – bewusst leise, nicht als Hauptknopf */
a.lp-abmelden {
  border: 1px solid var(--lp-line);
  background: var(--lp-card);
  color: var(--lp-text-2);
  border-radius: var(--lp-radius-sm);
  padding: .3rem .65rem;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
a.lp-abmelden:hover { background: var(--lp-soft); color: var(--lp-text); }

/* Konto-Menü: der Name rechts oben öffnet ein Aufklappmenü mit den
   Kontohandlungen (Abostatus, Sicherheit). Der Auslöser gleicht dem
   Abmelden-Knopf daneben; beim Öffnen bleibt er an Ort und Stelle. */
.lp-konto-menue {
  position: relative;
  display: inline-flex;
}
.lp-konto-menue > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .65rem;
  border: 1px solid var(--lp-line);
  background: var(--lp-card);
  color: var(--lp-text);
  border-radius: var(--lp-radius-sm);
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
}
.lp-konto-menue > summary::-webkit-details-marker { display: none; }
.lp-konto-menue > summary::after {
  content: "\25BE";
  font-size: .7rem;
  line-height: 1;
  color: var(--lp-text-2);
}
.lp-konto-menue > summary:hover,
.lp-konto-menue[open] > summary { background: var(--lp-soft); }
.lp-konto-auswahl {
  position: absolute;
  right: 0;
  top: calc(100% + .4rem);
  min-width: 14rem;
  background: var(--lp-card);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  padding: .3rem;
  z-index: 50;
}
.lp-konto-auswahl a {
  display: block;
  padding: .5rem .7rem;
  border-radius: var(--lp-radius-sm);
  color: var(--lp-text);
  text-decoration: none;
  font-size: .85rem;
  line-height: 1.35;
}
.lp-konto-auswahl a + a { margin-top: .12rem; }
.lp-konto-auswahl a:hover { background: var(--lp-soft); }
.lp-konto-auswahl a.active { background: var(--lp-primary-soft-2); color: var(--lp-primary-ink); }
.lp-konto-auswahl a .lp-muted {
  display: block;
  margin-top: .12rem;
  font-size: .72rem;
  color: var(--lp-text-2);
}
.lp-konto-auswahl a.lp-konto-abmelden {
  margin-top: .3rem;
  padding-top: .55rem;
  border-top: 1px solid var(--lp-line);
  color: var(--lp-text-2);
}
.lp-konto-auswahl a.lp-konto-abmelden:hover { color: var(--lp-text); }

/* --- Tab-Leiste ---------------------------------------------------------
   Vorbild eduki.com/de: die Navigation ist **flache Schrift auf Weiß**, ohne
   umschließende Fläche. Nur der aktive Punkt ist ein gefüllter türkiser Pill.
   Vorher lag jeder Gruppe ein grauer Streifen als Hintergrund unter – das
   wirkte als Block zu groß und nahm der Seite die Leichtigkeit.

   Abgehoben bleiben die Tabs trotzdem, und zwar durch drei Mittel:
     • der aktive Reiter ist die einzige gefüllte Fläche
     • Gruppen tragen eine kleine Beschriftung und sind durch eine Linie getrennt
     • nicht aktive Reiter sind gedämpft und bekommen beim Überfahren einen
       hellen türkisen Ton
   ---------------------------------------------------------------------- */
.lp-tabs { display: flex; align-items: center; gap: var(--lp-3); flex-wrap: wrap; }

.lp-tabs-gruppe { display: flex; align-items: center; gap: var(--lp-2); }
.lp-tabs-gruppe + .lp-tabs-gruppe {
  margin-left: var(--lp-1);
  padding-left: var(--lp-3);
  border-left: 1px solid var(--lp-line);
}
.lp-tabs-titel {
  font-size: .63rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--lp-text-3);
  white-space: nowrap;
}

ul.lp-links {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  flex-wrap: wrap;
}
ul.lp-links > li { margin: 0; }
ul.lp-links a {
  display: block;
  text-decoration: none;
  color: var(--lp-text-2);
  font-size: .875rem;
  font-weight: 500;
  padding: .4rem .6rem;          /* kompakt statt Block */
  border-radius: var(--lp-radius);
  white-space: nowrap;
  transition: background .12s ease-out, color .12s ease-out;
}
ul.lp-links a:hover {
  background: var(--lp-primary-soft);
  color: var(--lp-primary-ink);
}
ul.lp-links a.active {
  background: var(--lp-primary);
  color: #fff;
  font-weight: 600;
}
ul.lp-links a.active:hover { background: var(--lp-primary-deep); color: #fff; }

/* Gast-Kopfzeile (Startseite): Anmelden-Knopf. Die Klasse `lp-anmelden` bleibt
   unverändert – Tests und Durchstich prüfen sie namentlich. */
a.lp-anmelden {
  padding: .35rem 1rem;
  font-size: .9rem;
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--lp-radius-sm);
  background: var(--lp-primary);
  color: #fff;
  border: 1px solid var(--lp-primary);
}
a.lp-anmelden:hover { background: var(--lp-primary-deep); text-decoration: none; }
.lp-spacer { margin-left: auto; }

/* Das Untermenü der Verwaltung nutzt dieselbe Tab-Leiste, nur ohne
   Gruppenbeschriftung. */
nav.lp-nav > ul.lp-links { display: inline-flex; }

/* ------------------------------------------- 4. Kennzahlen und Panels */
.lp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; }
.lp-kpi {
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius-lg);
  padding: var(--lp-3) var(--lp-4);
  background: var(--lp-card);
  box-shadow: var(--lp-sh);
  text-align: left;
}
.lp-kpi b { display: block; font-size: 1.75rem; line-height: 1.15; color: var(--lp-text); }
.lp-kpi span { font-size: .78rem; color: var(--lp-text-2); }
/* Getönte Fläche je Bedeutung – deutlich unterscheidbar statt vier weisser
   Kästen mit gleichem Gewicht. */
.lp-kpi-info  { background: var(--lp-info-bg); border-color: var(--lp-primary-soft-2); }
.lp-kpi-info b  { color: var(--lp-primary-ink); }
.lp-kpi-ok    { background: var(--lp-ok-bg); border-color: #b9e4c7; }
.lp-kpi-ok b    { color: var(--lp-ok-fg); }
.lp-kpi-warn  { background: var(--lp-warn-bg); border-color: #f0df8f; }
.lp-kpi-warn b  { color: var(--lp-warn-fg); }
.lp-kpi-alarm { background: var(--lp-err-bg); border-color: #f3c4ca; }
.lp-kpi-alarm b { color: var(--lp-err-fg); }
a.lp-kpi-link { display: block; text-decoration: none; color: inherit; }
a.lp-kpi-link:hover { box-shadow: var(--lp-sh-hover); border-color: var(--lp-primary); }

.lp-panel {
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius);
  padding: .9rem;
  background: var(--lp-card);
  box-shadow: var(--lp-sh);
}
.lp-panel > h3:first-child { margin-top: 0; }
.lp-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .9rem; }

/* ------------------------------------------- 5. Tabellen, Chips, Notizen */
table.lp-table { font-size: .88rem; }
table.lp-table th, table.lp-table td { padding: .4rem .5rem; }
table.lp-table thead th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--lp-text-3);
  border-bottom: 1px solid var(--lp-line);
}
table.lp-table tbody tr:hover { background: var(--lp-bg); }
.lp-link { text-decoration: none; font-weight: 600; }

.badge {
  display: inline-block;
  padding: .12rem .5rem;
  border-radius: var(--lp-radius-pill);
  font-size: .72rem;
  font-weight: 650;
  white-space: nowrap;
  background: var(--lp-soft);
  color: var(--lp-text-2);
}
/* Notenskala 1–5 */
.grade-1 { background: var(--lp-ok-bg); color: var(--lp-ok-fg); }
.grade-2 { background: #e4f5d5; color: #365314; }
.grade-3 { background: var(--lp-warn-bg); color: var(--lp-warn-fg); }
.grade-4 { background: #fde3cd; color: #7c2d12; }
.grade-5 { background: var(--lp-err-bg); color: var(--lp-err-fg); }
.grade-none { background: var(--lp-soft); color: var(--lp-text-2); border: 1px solid var(--lp-line); }
/* Verhaltensbeurteilung */
.beh-1 { background: var(--lp-ok-bg); color: var(--lp-ok-fg); }
.beh-2 { background: #e4f5d5; color: #365314; }
.beh-3 { background: var(--lp-warn-bg); color: var(--lp-warn-fg); }
.beh-4 { background: var(--lp-err-bg); color: var(--lp-err-fg); }
.beh-none { background: var(--lp-soft); color: var(--lp-text-2); }
/* Notiz-Kategorien */
.cat-konferenz { background: #e6efff; color: #1b4fa8; }
.cat-elterngespraech { background: #f6e9fb; color: #7b2ea0; }
.cat-vertretung { background: var(--lp-warn-bg); color: var(--lp-warn-fg); }
.cat-fortbildung { background: #e2f7f7; color: #0d6b6b; }
.cat-gedankengut { background: #e3f6e9; color: var(--lp-ok-fg); }
.cat-none { background: var(--lp-soft); color: var(--lp-text-2); }
/* Kontakte: Zugehörigkeit (privat / geteilt / Kontakt der Schule) */
.scope-privat { background: var(--lp-soft); color: var(--lp-text-2); border: 1px solid var(--lp-line); }
.scope-geteilt { background: var(--lp-primary-soft-2); color: var(--lp-primary-ink); }
.scope-team { background: #e3f6e9; color: var(--lp-ok-fg); }

.lp-empty { color: var(--lp-text-3); font-style: italic; font-size: .87rem; }

/* --- Auswahlfelder (Dropdowns) ------------------------------------------
   Pico zeichnet seine eigenen Pfeile und größere Innenabstände. Zwischen
   unseren 6-px-Radien, dem 4-px-Raster und den türkisen Akzenten fielen sie
   dadurch als Fremdkörper auf – besonders auf „Benutzer" und „Verwaltung",
   wo mehrere direkt nebeneinander stehen.

   Deshalb EINE Regel für alle `<select>`, statt jede Stelle einzeln zu putzen.
   Bewusst ohne `width`: Pico setzt in Formularen `width: 100%`, und das soll
   für Felder in einem Formularraster auch so bleiben. Wo eine schmale
   Auswahl gewünscht ist, steht `width: auto` direkt am Element.
   ---------------------------------------------------------------------- */
select,
select:not([multiple]),
select:not([multiple]):not([size]) {
  margin: 0;
  height: auto;
  padding: var(--lp-2) var(--lp-9) var(--lp-2) var(--lp-3);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--lp-text);
  background-color: var(--lp-card);
  border: 1px solid var(--lp-field-line);
  border-radius: var(--lp-radius);
  box-shadow: none;
  /* Eigener Pfeil statt Picos – gleiche Strichstärke wie die übrigen Symbole */
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right var(--lp-3) center;
  background-size: 12px 12px;
  transition: border-color .12s ease-out, box-shadow .12s ease-out;
}
select:hover { border-color: var(--lp-primary-soft-3); }
select:focus,
select:focus-visible {
  border-color: var(--lp-primary);
  box-shadow: 0 0 0 3px var(--lp-primary-soft-2);
  outline: none;
}
select:disabled { background-color: var(--lp-soft); color: var(--lp-text-3); }

/* --- Fokus auf Eingabefeldern ------------------------------------------
   Eindeutiger Fokus: türkiser Rand plus ein weicher Ring – man sieht sofort,
   welches Feld gerade dran ist. Auf dem Handy besonders wichtig, weil der
   Finger beim Tippen genau dort liegt. Gleiche Anmutung wie die
   Auswahlfelder darüber. Die Typenliste ist Absicht – so bleiben Kästchen
   (`checkbox`), Radio und Knöpfe unberührt; ein blosses `input` fasst sie mit. */
:is(input[type="text"], input[type="email"], input[type="password"], input[type="search"],
    input[type="url"], input[type="tel"], input[type="number"], input[type="date"],
    input[type="time"], input[type="month"], input[type="week"], input[type="datetime-local"],
    input:not([type]), textarea):focus {
  border-color: var(--lp-primary);
  box-shadow: var(--lp-field-ring);
  outline: none;
}

/* Rückmeldung nach dem Speichern (Administration) */
.lp-hinweis-ok {
  background: var(--lp-ok-bg);
  color: var(--lp-ok-fg);
  border-left: 3px solid var(--lp-ok-line);
  border-radius: 0 var(--lp-radius) var(--lp-radius) 0;
  padding: var(--lp-3) var(--lp-4);
  margin-bottom: var(--lp-4);
  font-size: .88rem;
}

/* Filterleiste (Kalender-Werkzeuge, Kind-Detailseite). Pico gibt Formularen
   untereinander Abstand – in einer Zeile muss der weg. */
.lp-switch { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.lp-switch > * { margin: 0; }
.lp-switch form { margin: 0; }
.lp-switch select {
  margin: 0;
  width: auto;
  height: auto;
  padding: .3rem 1.9rem .3rem .6rem;
  font-size: .82rem;
  border-radius: var(--lp-radius-sm);
  border-color: var(--lp-line);
  background-color: var(--lp-card);
}
.lp-switch .std-tab { border-radius: var(--lp-radius-sm); }

.lp-note-item {
  border-left: 3px solid var(--lp-line);
  padding: .5rem .8rem;
  margin-bottom: .6rem;
  background: var(--lp-card);
  border-radius: 0 var(--lp-radius-sm) var(--lp-radius-sm) 0;
}
.lp-toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.lp-toolbar > * { margin: 0; }
.htmx-request { opacity: .55; transition: opacity .15s; }

/* Pico setzt für Buttons width:100%. Spezifität: Pico stylt
   `button[type=submit]` (0,1,1) – eine reine Klasse (0,1,0) verliert dagegen,
   deshalb `button.lp-btn-auto`. */
button.lp-btn-auto { width: auto; }

/* Noten-Auswahlfelder */
select.lp-note {
  padding: .15rem 1.6rem .15rem .4rem;
  font-size: .82rem;
  height: auto;
  margin: 0;
  border-radius: var(--lp-radius-sm);
  min-width: 9.5rem;
}
select.note-g1, select.note-b1 { border-color: #16a34a; background: #f0fdf4; }
select.note-g2, select.note-b2 { border-color: #65a30d; background: #f7fee7; }
select.note-g3, select.note-b3 { border-color: #d97706; background: #fffbeb; }
select.note-g4 { border-color: #ea580c; background: #fff7ed; }
select.note-g5, select.note-b4 { border-color: var(--lp-err-line); background: var(--lp-err-bg); }

/* --------------------------------------------------- 6. Kalender */
.std-tab, .std-nav { padding: .25rem .8rem; font-size: .82rem; }
.std-scroll { overflow-x: auto; }
/* Wochenrahmen: am Rechner die Tabelle, am Handy die Tagesliste
   (siehe Abschnitt „Schmale Geräte“). */
.std-woche-mobil { display: none; }

table.std-tabelle { min-width: 860px; table-layout: fixed; }
table.std-tabelle th, table.std-tabelle td { border: 1px solid var(--lp-line); }
table.std-tabelle th.std-std {
  width: 62px;
  text-align: right;
  font-size: .76rem;
  color: var(--lp-text-2);
  background: var(--lp-bg);
}
/* Die Stundennummer in der ersten Spalte bleibt kräftig: früher steckte sie neben
   der Uhrzeit in einem <b>, das mit den Uhrzeiten entfallen ist. Die Kopfzelle
   („Std.“) bleibt gedämpft. */
table.std-tabelle tbody th.std-std { color: var(--lp-text); font-weight: 700; }
/* Gleich hohe Zeilen: die Zelle wächst nicht mehr mit dem Text, der Text wird
   stattdessen gekürzt. Vorher ergab umbrechender Fächertext ein zerfranstes
   Raster. */
table.std-tabelle td { vertical-align: top; padding: .2rem; height: 74px; }
td.std-heute, th.std-heute { background: var(--lp-primary-soft); }
th.std-heute { color: var(--lp-primary-ink); }
td.std-we, th.std-we { background: #fbfcfd; }
th.std-we { color: var(--lp-text-3); }

.std-zelle {
  position: relative;
  font-size: .78rem;
  line-height: 1.25;
  height: 100%;
  min-height: 66px;
  padding-right: 1.1rem;
  border-left: 3px solid transparent;
}
/* Geplante Stunde: Fachkante in der Fachfarbe */
.std-zelle.std-hat-plan { border-left-color: var(--f-sonst); }
.std-fach {
  display: inline-block;
  font-weight: 650;
  background: var(--lp-soft);
  color: var(--lp-text);
  border-radius: .35rem;
  padding: 0 .35rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.std-thema { margin-top: .2rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
             -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.std-hue { margin-top: .2rem; color: var(--lp-warn-fg); overflow: hidden; text-overflow: ellipsis;
           white-space: nowrap; }

/* Ungeplante Stunde: LEISE. Vorher stand hier in jeder Zelle „noch nicht
   geplant" – 25-mal pro Woche, und das Auge hatte keinen Anker mehr. Jetzt ist
   die Zelle still und bekommt beim Überfahren ein „+". */
.std-frei { color: var(--lp-text-3); font-style: italic; }
.std-leer { cursor: pointer; }
.std-leer:hover { background: var(--lp-primary-soft); }
.std-plus {
  position: absolute;
  right: .3rem;
  bottom: .25rem;
  color: var(--lp-text-3);
  font-weight: 700;
  opacity: 0;
  transition: opacity .12s;
}
.std-leer:hover .std-plus { opacity: 1; }

/* Bearbeiten-Stift: größere Trefferfläche (Tablet im Unterricht), erscheint
   beim Überfahren statt dauerhaft zu blinken. */
.std-edit {
  position: absolute;
  top: 0;
  right: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: .78rem;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: .3rem;
  color: var(--lp-text-3);
  opacity: 0;
  transition: opacity .12s;
}
.std-zelle:hover .std-edit { opacity: 1; }
.std-edit:focus-visible { opacity: 1; border-color: var(--lp-primary); }
.std-edit:hover { background: var(--lp-card); border-color: var(--lp-line); color: var(--lp-text); }

/* Eingabefelder in der Zelle */
.std-in { margin: 0 0 .2rem 0; padding: .15rem .3rem; font-size: .78rem; height: auto; }
.std-in-fach { font-weight: 700; }
.std-in-hue { color: var(--lp-warn-fg); }
.std-actions { display: flex; gap: .25rem; }
.std-actions .std-btn { width: auto; flex: 0 0 auto; }
.std-btn { padding: .1rem .6rem; font-size: .74rem; margin: 0; }
.std-btn-sec { background: transparent; border: 1px solid var(--lp-line); color: inherit; }
.std-stunde-kopf { display: flex; gap: .6rem; align-items: baseline; margin-bottom: .35rem; }

/* Fachfarben: Punkt im Fachnamen und Kante links. */
.std-fach::before {
  content: "";
  display: inline-block;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  margin-right: .3rem;
  vertical-align: baseline;
  background: var(--f-sonst);
}
.std-fach.f-deu { background: #eaf1f8; color: #234b73; } .std-fach.f-deu::before { background: var(--f-deu); }
.std-fach.f-ma  { background: #e8f3ed; color: #1f5b41; } .std-fach.f-ma::before  { background: var(--f-ma); }
.std-fach.f-su  { background: #f8f1e3; color: #6f4a13; } .std-fach.f-su::before  { background: var(--f-su); }
.std-fach.f-mu  { background: #f1ecf8; color: #58407c; } .std-fach.f-mu::before  { background: var(--f-mu); }
.std-fach.f-we  { background: #f6efea; color: #6b452c; } .std-fach.f-we::before  { background: var(--f-we); }
.std-fach.f-be  { background: #faebf0; color: #833f53; } .std-fach.f-be::before  { background: var(--f-be); }
.std-fach.f-bs  { background: #e7f3f4; color: #175f69; } .std-fach.f-bs::before  { background: var(--f-bs); }
.std-fach.f-re  { background: #eef0f2; color: #4b5563; } .std-fach.f-re::before  { background: var(--f-re); }

.std-zelle.f-deu.std-hat-plan { border-left-color: var(--f-deu); }
.std-zelle.f-ma.std-hat-plan  { border-left-color: var(--f-ma); }
.std-zelle.f-su.std-hat-plan  { border-left-color: var(--f-su); }
.std-zelle.f-mu.std-hat-plan  { border-left-color: var(--f-mu); }
.std-zelle.f-we.std-hat-plan  { border-left-color: var(--f-we); }
.std-zelle.f-be.std-hat-plan  { border-left-color: var(--f-be); }
.std-zelle.f-bs.std-hat-plan  { border-left-color: var(--f-bs); }
.std-zelle.f-re.std-hat-plan  { border-left-color: var(--f-re); }

/* Legende unter dem Raster */
.std-legende-liste { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .76rem; color: var(--lp-text-2); }
.std-legende-liste span { display: inline-flex; align-items: center; gap: .35rem; }
.std-legende-liste i { width: .55rem; height: .55rem; border-radius: 50%; font-style: normal; display: inline-block; }

/* Jahresübersicht */
.std-jahr { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .9rem; }
.std-monat { border: 1px solid var(--lp-line); border-radius: var(--lp-radius); padding: .55rem;
             background: var(--lp-card); box-shadow: var(--lp-sh); }
.std-monat h4 { margin: 0 0 .35rem 0; font-size: .85rem; text-align: center; }
table.std-mini { font-size: .72rem; margin: 0; width: 100%; }
table.std-mini th { padding: 0 0 .15rem; color: var(--lp-text-3); font-weight: 650; text-align: center; }
table.std-mini td { padding: 0; text-align: center; border: none; }
a.std-tag { display: block; padding: .1rem 0; border-radius: .25rem; text-decoration: none; color: inherit; }
a.std-tag:hover { background: var(--lp-soft); }
a.std-hat-plan { background: var(--lp-primary-soft); font-weight: 700; }
a.std-tag.std-ferientag { background: var(--lp-ferien-bg); color: var(--lp-ferien-fg); }
a.std-tag.std-hat-plan.std-ferientag { background: #e8ddf5; color: #4c1d95; }
/* Gesetzliche Feiertage: berechnet (app/feiertage.py), bundesweit fest –
   deshalb eine andere Farbe als Ferien. Steht nach den Ferien-Regeln, damit
   die Feiertagsfarbe gewinnt, wenn ein Tag in eine Ferienzeit fällt. */
a.std-tag.std-feiertag { background: var(--lp-feiertag-bg); color: var(--lp-feiertag-fg); font-weight: 700; }
a.std-tag.std-hat-plan.std-feiertag { background: #f7cccc; color: #7f1d1d; }
a.std-tag-heute { outline: 2px solid var(--lp-primary); outline-offset: -1px; }
.std-legende { font-weight: 700; }
.std-legende-plan { color: var(--lp-primary-ink); }
.std-legende-ferien { color: var(--lp-ferien-fg); }
.std-legende-feiertag { color: var(--lp-feiertag-fg); }

/* Quartalsübersicht */
table.std-quartal td { height: auto; vertical-align: top; padding: .3rem .35rem; }
table.std-quartal th.std-kw, table.std-quartal td.std-summe { width: 88px; text-align: center; font-size: .75rem; }
table.std-quartal th.std-kw { font-weight: 700; }
table.std-quartal th.std-kw div { white-space: nowrap; font-weight: 400; }
table.std-quartal td.std-summe { color: var(--lp-text-2); font-weight: 700; }
td.std-qzelle { background: var(--lp-card); min-width: 120px; }
td.std-ausserhalb { background: var(--lp-soft); }
td.std-ausserhalb a.std-qtag { color: var(--lp-muted-strong); }
td.std-ferientag { background: var(--lp-ferien-bg); }
td.std-feiertag { background: var(--lp-feiertag-bg); }
td.std-qzelle.std-heute { background: var(--lp-primary-soft); }
a.std-qtag { display: block; text-decoration: none; color: var(--lp-text-3); font-size: .7rem; }
a.std-qtag:hover { color: var(--lp-primary); }
.std-qferien { font-size: .68rem; font-weight: 700; color: var(--lp-ferien-fg); }
.std-qfeiertag { font-size: .68rem; font-weight: 700; color: var(--lp-feiertag-fg); }
.std-qplan { margin-top: .2rem; font-size: .74rem; line-height: 1.25; }
.std-qstd { color: var(--lp-text-2); font-weight: 700; }
.std-qfach { font-weight: 600; }
.std-qthema { overflow-wrap: anywhere; }
.std-qhue { display: inline-block; margin-top: .1rem; padding: 0 .3rem; border-radius: var(--lp-radius-pill);
            background: #fde68a; color: #78350f; font-size: .65rem; font-weight: 700; }
.std-qhue-badge { background: #fde68a; color: #78350f; }

/* ------------------------------- 7. Kleinteile: Ferien, Feiertage, Rest */
/* Ferienverwaltung */
.lp-ferien-item {
  display: flex;
  gap: .6rem;
  align-items: baseline;
  padding: .45rem .6rem;
  border-left: 3px solid var(--lp-ferien-line);
  border-radius: 0 var(--lp-radius-sm) var(--lp-radius-sm) 0;
  margin-bottom: .4rem;
  background: var(--lp-ferien-bg);
}
.lp-ferien-item .lp-ferien-name { font-weight: 700; }
.badge.ferien { background: #fed7aa; color: #7c2d12; }

/* Warnung, wenn an einem gesetzlichen Feiertag etwas geplant ist */
.lp-feiertag-warnung {
  background: #fff1f1;
  border-left: 4px solid var(--lp-feiertag-line);
  color: #7f1d1d;
  padding: .6rem .75rem;
  margin-bottom: .7rem;
  font-size: .85rem;
  border-radius: 0 var(--lp-radius-sm) var(--lp-radius-sm) 0;
}
.lp-feiertag-warnung strong { display: block; margin-bottom: .2rem; }
.lp-feiertag-warnung ul { margin: .2rem 0 0 1rem; padding: 0; }
.lp-feiertag-warnung li { margin: 0 0 .15rem; }
.lp-feiertag-hinweis {
  background: var(--lp-feiertag-bg);
  border-left: 4px solid var(--lp-feiertag-line);
  color: #7f1d1d;
  padding: .5rem .7rem;
  margin-bottom: .7rem;
  font-size: .85rem;
  border-radius: 0 var(--lp-radius-sm) var(--lp-radius-sm) 0;
}
.lp-feiertag-hinweis strong { margin-right: .3rem; }

.lp-klasse-row.sel { background: var(--lp-soft-strong); }

/* Tab „Planung“: Wochenrahmen – ein Feld je Stunde und Wochentag.
   Ein Formular je Zeile in einem CSS-Gitter, kein <form> zwischen
   Tabellenzeilen (das ist ungültiges HTML und die Felder gingen beim Absenden
   verloren), je Zelle zwei Felder: Fach und Raum.
   Bis 1.02 stand hier der Verweis auf die Stundenzeiten-Matrix – die gibt es
   nicht mehr, das Gitter ist geblieben. */
.lp-plan-gitter {
  display: grid;
  /* Die letzte Spalte hat eine FESTE Breite – mit `auto` wäre sie in der
     Kopfzeile 0 breit und in den Zeilen so breit wie der Knopf; weil jede Zeile
     ein eigenes Gitter ist, säßen die Spaltenüberschriften dann nicht über ihren
     Spalten. */
  grid-template-columns:
    minmax(7rem, .9fr) repeat(var(--lp-stunden, 5), minmax(9.5rem, 1fr)) 5.5rem;
  gap: var(--lp-1) var(--lp-2);
  align-items: center;
  padding: var(--lp-2);
  border-radius: var(--lp-radius);
}
.lp-plan-kopf {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: var(--lp-text-3);
  border-bottom: 1px solid var(--lp-line);
  padding-bottom: var(--lp-2);
}
.lp-plan-kopf > span:not(:first-child) { text-align: center; }
.lp-plan-kopf small { display: block; font-weight: 500; letter-spacing: 0; text-transform: none; }
form.lp-plan-gitter { margin: 0; }
form.lp-plan-gitter:nth-of-type(odd) { background: var(--lp-card); }
form.lp-plan-gitter:nth-of-type(even) { background: var(--lp-soft); }
form.lp-plan-gitter:hover { background: var(--lp-primary-soft); }
.lp-plan-gitter .lp-plan-tag { font-weight: 600; font-size: .85rem; min-width: 0; }
/* Die Stunde eines Feldes – am Rechner steht sie in der Kopfzeile des Gitters,
   auf schmalen Geräten (Abschnitt „Schmale Geräte“) direkt an der Zeile. */
.lp-plan-std { display: none; }
.lp-plan-zelle { display: flex; align-items: center; gap: var(--lp-1); }
.lp-plan-zelle input[type="text"] {
  width: 100%;
  margin: 0;
  padding: .2rem .35rem;
  font-size: .8rem;
  border-radius: var(--lp-radius-sm);
  border-color: var(--lp-line);
}
.lp-plan-zelle input[type="text"]:focus { border-color: var(--lp-primary); }
.lp-plan-zelle .lp-plan-raum { max-width: 4.5rem; font-size: .72rem; color: var(--lp-text-2); }
.lp-plan-gitter .std-btn { justify-self: end; }

/* Ein Eintrag, der aus dem Jahresplan kommt: gedämpft und kursiv, damit der
   Unterschied zu einem eigenen Eintrag dieses Zeitraums sichtbar ist. */
.lp-plan-aus-jahr input[type="text"] {
  color: var(--lp-text-2);
  background: var(--lp-soft);
  font-style: italic;
}

.lp-plan-zeitraum { margin: .2rem 0 .4rem; font-size: .88rem; }
.lp-plan-hinweis {
  background: var(--lp-info-bg);
  color: var(--lp-info-fg);
  border: 1px solid var(--lp-info-line);
  border-radius: var(--lp-radius);
  padding: .45rem .6rem;
  margin: .4rem 0;
  font-size: .88rem;
}
/* Zeitraum, der ohne Semesterferien nicht planbar ist – sichtbar, aber nicht klickbar. */
.lp-tab-gesperrt { opacity: .45; cursor: not-allowed; }

/* Hausübungs-Kontrolle */
.lp-hue-check { border: 1px solid var(--lp-line); border-radius: var(--lp-radius);
                padding: .6rem; background: var(--lp-bg); }
.lp-hue-btn { min-width: 6.5rem; width: auto; }
.lp-hue-da { background: var(--lp-ok-bg); color: var(--lp-ok-fg); border: 1px solid var(--lp-ok-line); }
.lp-hue-fehlt { background: var(--lp-err-bg); color: var(--lp-err-fg); border: 1px solid var(--lp-err-line); }

/* Kind anlegen: aufklappbares Formular über der Schülerliste */
.lp-kid-add { margin-bottom: .6rem; border: 1px dashed var(--lp-line);
              border-radius: var(--lp-radius); padding: .5rem .7rem; background: var(--lp-card); }
.lp-kid-add > summary { cursor: pointer; font-size: .85rem; font-weight: 650; }
.lp-kid-add form { margin-top: .5rem; }
.lp-kid-add label { margin-bottom: .3rem; }

.lp-klasse-add { border: 1px dashed var(--lp-line); border-radius: var(--lp-radius);
                 padding: .5rem .7rem; background: var(--lp-card); }

/* Verleih: überfällige Ausleihen deutlich markieren */
.lp-loan-overdue { border-left-color: var(--lp-err-line); background: #fff7f7; }
.lp-loan-overdue strong { color: #7f1d1d; }

/* Kontaktzeilen im Formular */
.lp-kontakt-zeilen { display: grid; gap: .5rem; }
.lp-kontakt-zeile { border: 1px solid var(--lp-line); border-radius: var(--lp-radius-sm);
                    padding: .5rem .6rem; background: var(--lp-bg); }

/* --------------------------------------------------- 8. Hilfsklassen */
.lp-muted { color: var(--lp-text-2); }
.lp-soft { background: var(--lp-soft); }
.lp-soft-strong { background: var(--lp-soft-strong); }
.lp-muted-strong { color: var(--lp-muted-strong); }
.lp-mt { margin-top: .7rem; }
.lp-mb { margin-bottom: .7rem; }

/* --------------------------------------------------- 8b. Konto und Abrechnung */
/* Der Konto-Bereich wohnt rechts oben in der Kopfzeile (`.lp-konto`) – hier
   steht nur, wie sein Einstieg und die Konto-Seite aussehen. */
.lp-konto-link {
  font-size: .82rem;
  font-weight: 600;
  color: var(--lp-text-2);
  text-decoration: none;
  padding: .22rem .6rem;
  border-radius: var(--lp-radius-pill);
  border: 1px solid transparent;
}
.lp-konto-link:hover { background: var(--lp-soft); color: var(--lp-text); }
.lp-konto-link.active {
  background: var(--lp-primary-soft-2);
  color: var(--lp-primary-ink);
  border-color: var(--lp-primary-soft-3);
}

/* Fehlermeldung – das Gegenstück zu .lp-hinweis-ok. */
.lp-hinweis-fehler {
  background: var(--lp-err-bg);
  color: var(--lp-err-fg);
  border-left: 3px solid var(--lp-err-line);
  border-radius: 0 var(--lp-radius) var(--lp-radius) 0;
  padding: var(--lp-3) var(--lp-4);
  margin-bottom: var(--lp-4);
  font-size: .88rem;
}

/* Eine Tarifzeile: links die Angaben, rechts die Schaltfläche. Bewusst kein
   <table> – auf schmalen Geräten rutscht der Knopf unter den Text, statt die
   Tabelle seitwärts zu schieben. */
.lp-tarif-zeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--lp-3);
  padding: .5rem .6rem;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius);
  margin-bottom: .4rem;
  background: var(--lp-card);
}
.lp-tarif-zeile button { margin: 0; white-space: nowrap; }
.lp-tarif-zeile button[disabled] { opacity: .5; cursor: not-allowed; }

/* Abo und Rechnungen im Konto. Alles mobil zuerst: eine Spalte, gestapelte
   Karten statt Tabellen (ein Rechnungsblatt mit sechs Spalten schiebt auf dem
   Handy seitwärts, und genau dort wird diese Seite benutzt). */
.lp-abo-zustand {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: 1rem;
  margin: .2rem 0 .4rem;
  flex-wrap: wrap;
}
.lp-abo-punkt {
  width: .6rem;
  height: .6rem;
  border-radius: 999px;
  background: var(--lp-text-2);
  flex: 0 0 auto;
}
.lp-abo-punkt--ok { background: #1e6b3a; }
.lp-abo-punkt--warn { background: #b8801a; }
.lp-abo-punkt--info { background: #1e3a5f; }
.lp-abo-daten {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .15rem .8rem;
  margin: .6rem 0 .2rem;
  font-size: .9rem;
}
.lp-abo-daten dt { color: var(--lp-muted-strong); }
.lp-abo-daten dd { margin: 0; font-weight: 600; }
.lp-abo-aktionen { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 .6rem; }
.lp-abo-aktionen form { margin: 0; }
.lp-abo-aktionen button { margin: 0; width: auto; }

/* Die zwei Abo-Modelle – auf dem Handy untereinander, ab 560 px nebeneinander. */
.lp-modelle {
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem;
  margin: .3rem 0 .8rem;
}
@media (min-width: 560px) {
  .lp-modelle { grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); align-items: stretch; }
}
.lp-modell {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--lp-radius);
  padding: .95rem 1.05rem;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.lp-modell--aktiv { border: 2px solid var(--pico-primary); }
.lp-modell-name {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--lp-muted-strong);
}
.lp-modell-preis { font-size: 1.7rem; font-weight: 700; line-height: 1.15; margin: .2rem 0 .3rem; }
.lp-modell-preis span { font-size: .9rem; font-weight: 400; color: var(--pico-muted-color); }
.lp-modell-liste { list-style: none; padding: 0; margin: .3rem 0 .7rem; font-size: .88rem; }
.lp-modell-liste li { position: relative; padding-left: 1.2rem; margin-bottom: .25rem; color: var(--lp-muted-strong); }
.lp-modell-liste li::before { content: "✓"; position: absolute; left: 0; color: #1e6b3a; font-weight: 700; }
.lp-modell form { margin: 0; margin-top: auto; }
.lp-modell button { margin: 0; width: auto; }
.lp-modell-grund { font-size: .85rem; color: var(--lp-muted-strong); margin: auto 0 0; }
.lp-preis-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin: .5rem 0 .6rem; }
.lp-preis-form label { margin: 0; flex: 1 1 8rem; font-size: .88rem; }
.lp-preis-form input { margin-bottom: 0; }
.lp-preis-form button { margin: 0; width: auto; }

/* Rechnungen: gestapelte Karten, je Zeile Nummer und Betrag zuerst. */
.lp-rechnungen { display: grid; gap: .6rem; }
.lp-rechnung {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--lp-radius);
  padding: .7rem .85rem;
}
.lp-rechnung-kopf { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.lp-rechnung-betrag { font-weight: 700; white-space: nowrap; }
.lp-rechnung-meta { font-size: .82rem; color: var(--pico-muted-color); margin-top: .15rem; }
.lp-rechnung-aktionen { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .55rem; }
.lp-rechnung-aktionen form { margin: 0; }
.lp-rechnung-aktionen button, .lp-rechnung-aktionen a[role=button] {
  margin: 0;
  width: auto;
  font-size: .82rem;
  padding: .3rem .7rem;
}

/* Fußzeile: schmal, immer sichtbar, trägt die Version der Anwendung. */
.lp-footer {
  border-top: 1px solid var(--pico-muted-border-color);
  margin-top: 1.5rem;
  padding: .7rem 0 .9rem;
  font-size: .78rem;
  color: var(--pico-muted-color);
}
.lp-footer-inhalt {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1rem;
  justify-content: space-between;
  align-items: baseline;
}
.lp-footer-version { font-variant-numeric: tabular-nums; }

/* Prüfliste „was muss eingerichtet sein" – Häkchen oder offener Punkt. */
ul.lp-check { list-style: none; padding: 0; margin: .3rem 0 0; }
ul.lp-check li { position: relative; padding-left: 1.6rem; margin-bottom: .6rem; font-size: .9rem; }
ul.lp-check li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
ul.lp-check li.ok::before { content: "✓"; color: #1e6b3a; }
ul.lp-check li.fehlt::before { content: "✗"; color: #a33; }

/* ------------------------------------------------------- Sitzpläne (1.09) */
/* Ein Sitzplan ist ein Raster: je Platz eine Zelle, darin ein Kind. Bewegt wird
   per Pointer-Events (app/static/sitzplan.js) – deshalb `touch-action: none`
   auf den Kindern: sonst scrollt das Handy die Seite, statt das Kind zu ziehen. */
.std-plan-reiter {
  display: inline-block;
  padding: .3rem .75rem;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-radius-pill);
  font-size: .85rem;
  text-decoration: none;
  white-space: nowrap;
}
.std-plan-reiter.std-aktiv {
  border-color: var(--lp-primary);
  background: var(--lp-primary-soft);
  font-weight: 700;
}

.std-raster-rahmen { overflow-x: auto; padding-bottom: .2rem; }
.std-raster {
  display: grid;
  grid-template-columns: repeat(var(--spalten, 5), minmax(4.5rem, 1fr));
  gap: .4rem;
}
.std-sitz {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  padding: .25rem;
  border: 1px dashed var(--lp-field-line);
  border-radius: var(--lp-radius);
  background: var(--lp-card);
  text-align: center;
}
.std-sitz.std-belegt { border-style: solid; border-color: var(--lp-line); }
.std-sitz.std-ueber {
  border-color: var(--lp-primary);
  box-shadow: var(--lp-field-ring);
}

.std-kind {
  display: block;
  width: 100%;
  padding: .35rem .3rem;
  border-radius: var(--lp-radius-sm);
  background: var(--lp-primary-soft-2);
  font-size: .85rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.std-kind.std-zieht { opacity: .35; }
.std-kind.std-ausgewaehlt { outline: 2px solid var(--lp-primary); outline-offset: 1px; }
.std-kind.std-nurlesen { cursor: default; }

/* Die schwebende Kopie unter dem Finger darf keine Klicks abfangen – sonst
   findet `elementFromPoint` den Platz darunter nicht mehr. */
.std-geist {
  position: fixed;
  z-index: 4000;
  max-width: 12rem;
  pointer-events: none;
  opacity: .92;
  box-shadow: var(--lp-sh-hover);
}

.std-pool {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  min-height: 3rem;
  padding: .5rem;
  border: 1px dashed var(--lp-field-line);
  border-radius: var(--lp-radius);
  background: var(--lp-soft);
}
.std-pool .std-kind { width: auto; }

.std-gespeichert { font-size: .8rem; color: var(--lp-text-2); }
.std-gespeichert.std-offen { color: #a05a00; font-weight: 700; }

/* Klassen-Zuordnung im Lehrkräfte-Tab (1.09): der Klassenname steht der
   Auswahlliste voran, damit „2a Bearbeiten [Speichern]" lesbar bleibt. */
.std-klasse-name {
  display: inline-block;
  min-width: 3.2rem;
  font-weight: 700;
}

/* In der Lehrkräfte-Tabelle stehen **mehrere** Bedienelemente in einer Zelle
   (Klassenname, Stufe, Speichern, Entfernen). Pico gibt Formularelementen
   `width: 100%` – in einem Flex-Kasten bricht damit jedes Element in eine eigene
   Zeile, die Zelle wird meterhoch und die Tabelle zerfällt. Hier deshalb
   ausdrücklich kompakt; die Spezifität schlägt Picos Regeln (lp.css lädt nach
   Pico, siehe Kopf dieser Datei). */
.lp-lehrkraefte form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
  margin: 0;
}
.lp-lehrkraefte form select,
.lp-lehrkraefte form input[type="text"],
.lp-lehrkraefte form button {
  width: auto;
  margin: 0;
}
.lp-lehrkraefte tbody td { vertical-align: top; }

/* --------------------------------------------------- 9. Schmale Geräte */
/* Bisher gab es KEINE Medienabfrage. Auf Tablet und Handy stapelten sich
   Marke, zehn Reiter und die Kontextleiste, und die Tabellen schoben seitwärts. */
@media (max-width: 1000px) {
  .lp-tabs-gruppe + .lp-tabs-gruppe { padding-left: .6rem; border-left: 0; }
  .lp-tabs-titel { display: none; }        /* Platz: die Reiter sprechen für sich */
  ul.lp-links a { padding: .3rem .55rem; font-size: .82rem; }
}
@media (max-width: 700px) {
  body { font-size: 14.5px; }
  .lp-header { position: static; }         /* klebende Leiste frisst sonst die halbe Höhe */
  .lp-kopfzeile { gap: .5rem; }
  .lp-kontext { margin-left: 0; width: 100%; }
  .lp-kontext select { flex: 1 1 7rem; min-width: 0; }
  .lp-ctx-titel { display: none; }
  .lp-cards { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .lp-kpi b { font-size: 1.45rem; }
  .lp-grid-2 { grid-template-columns: 1fr; }
  h1, h2 { font-size: 1.2rem; }

  /* Reiter-Leiste: EINE Zeile zum Wischen statt fünf gestapelter Zeilen.
     Nachgemessen bei 375 px Breite: vorher 5 Zeilen und 297 px Höhe – ein
     Drittel des Bildschirms, bevor überhaupt Inhalt kommt. Die Reiter sind
     elf; sie passen auf kein Telefon in eine umbrechende Leiste.
     `flex-wrap: nowrap` plus `overflow-x: auto` macht daraus eine Wischleiste.
     Die Kastenhöhe bleibt bei einer Reiterzeile (34 px) statt 297 px. */
  .lp-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;              /* die Wischgeste ist die Bedienung; */
    -webkit-overflow-scrolling: touch;  /* eine Leiste würde nur Platz kosten */
    scroll-padding-inline: .75rem;
  }
  .lp-tabs::-webkit-scrollbar { display: none; }
  /* Gruppen nicht schrumpfen lassen und ohne Trenner aneinanderreihen – sonst
     bricht die Leiste trotz nowrap wieder um. */
  .lp-tabs-gruppe { flex: 0 0 auto; }
  .lp-tabs-gruppe + .lp-tabs-gruppe { margin-left: 0; padding-left: 0; }
  ul.lp-links { width: auto; flex-wrap: nowrap; }
  ul.lp-links a { flex: 0 0 auto; }
}

/* ------------------------------------------ 9b. Eingabefelder am Handy */
/* Auf dem Handy waren Felder zu blass, zu klein und lösten beim Antippen den
   Seitwärts-Zoom von iOS aus (Schrift kleiner als 16px). Hier werden sie
   treffsicher und lesbar: mindestens 48px hoch, 16px Schrift, mehr
   Innenabstand. Die Typenliste hält Kästchen und Knöpfe heraus; die
   kompakten Felder (Noten-Auswahl, Stundenplan, Kopfzeile) stehen einzeln
   dabei, weil ihre eigenen Regeln sonst gewinnen. */
@media (max-width: 767px) {
  /* 16px verhindert das automatische Heranzoomen von Safari; 48px ist die
     empfohlene Mindestgröße für Tippziele (Apple HIG / Material: 44–48px). */
  :is(input[type="text"], input[type="email"], input[type="password"], input[type="search"],
      input[type="url"], input[type="tel"], input[type="number"], input[type="date"],
      input[type="time"], input[type="month"], input[type="week"], input[type="datetime-local"],
      input:not([type]), textarea, select, select.lp-note,
      .lp-switch select, .lp-kontext select,
      .lp-plan-zelle input[type="text"], .lp-plan-zelle .lp-plan-raum,
      .lp-preis-form input, .lp-preis-form select) {
    font-size: 1rem;
    min-height: var(--lp-touch);
    padding: .65rem .8rem;
  }
  /* Auswahlfelder behalten rechts Platz für den eigenen Pfeil. Die
     Grundregel für `<select>` ist spezifischer als der :is()-Block oben,
     deshalb steht sie hier noch einmal ausdrücklich. */
  select,
  select:not([multiple]):not([size]),
  select.lp-note,
  .lp-switch select,
  .lp-kontext select { padding-right: 2.2rem; }
  textarea { min-height: 8rem; }

  /* Beschriftungen: gut lesbar und mit Abstand direkt über dem Feld. */
  form label, .lp-preis-form label {
    display: block;
    font-size: .95rem;
    font-weight: 600;
    color: var(--lp-text);
    margin-bottom: .3rem;
  }

  /* Schaltflächen mit Text werden genauso treffsicher wie die Felder. Die
     kleinen Werkzeug-Knöpfe in dichten Rastern (`.std-*`) bleiben kompakt. */
  button:not(.std-tab):not(.std-nav):not(.std-btn):not(.std-edit),
  input[type="submit"] { min-height: var(--lp-touch); }

  /* Noten-Auswahl: breit genug, dass die Note sichtbar bleibt. */
  select.lp-note { min-width: 6.5rem; }

  /* --- Notentabelle (Beurteilung): aus der Zeile wird ein Block ----------
     Bisher standen Kriterium (60 %), Auswahlfeld und Datum in EINER Zeile –
     am Handy blieben dem Feld rund 50 px, die Note war unsichtbar. Jetzt:
     Kriterium als Überschrift, darunter das Feld über die volle Breite und
     rechts das Datum. */
  .lp-noten tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: .6rem;
    row-gap: .3rem;
    padding: .6rem .1rem;
    border-bottom: 1px solid var(--lp-line);
  }
  .lp-noten tbody tr:last-child { border-bottom: 0; }
  .lp-noten tbody td { display: block; width: auto !important; padding: 0; }
  .lp-noten tbody td:nth-child(1) { grid-column: 1 / -1; font-weight: 600; }
  .lp-noten tbody td:nth-child(2) { grid-column: 1; }
  .lp-noten tbody td:nth-child(3) { grid-column: 2; text-align: right; }
  .lp-noten select.lp-note { width: 100%; }

  /* --- Stundenplan (Planung): je Tag eine Karte, je Stunde eine Zeile ----
     Das Gitter ist am Rechner breit (fünf Stundenspalten à 152 px) und am
     Handy nur seitwärts zu erreichen; in einer Zelle standen Fach UND Raum
     nebeneinander in je ~76 px. Hier wird daraus eine senkrechte Liste –
     „1. Std  [Fach]  [Raum]“ –, jedes Feld in brauchbarer Breite. */
  .lp-plan-gitter-rahmen { overflow-x: visible; }
  .lp-plan-kopf { display: none; }
  .lp-plan-gitter {
    grid-template-columns: 1fr;
    gap: .5rem;
    padding: .7rem;
    border: 1px solid var(--lp-line);
    margin-bottom: .6rem;
  }
  .lp-plan-gitter .lp-plan-tag { font-size: 1rem; }
  .lp-plan-gitter .lp-plan-zelle {
    display: grid;
    grid-template-columns: 4.2rem 1fr 4.2rem;
    gap: .45rem;
    align-items: center;
  }
  .lp-plan-std { display: block; font-size: .8rem; color: var(--lp-text-2); }
  .lp-plan-gitter button.std-btn { justify-self: end; }

  /* --- Kalender: die Woche als Liste statt als 860-px-Raster ------------
     Das Raster war am Handy nur seitwärts zu erreichen, und die Schrift der
     Zellen war mit 0,78rem (~12px) winzig. Jetzt steht jeder Tag als Karte
     untereinander und jede Stunde als Zeile. Der Bearbeiten-Stift war bisher
     nur beim Überfahren zu sehen – ohne Maus blieb er unsichtbar, ein Planen
     war damit kaum möglich. */
  .std-woche-rahmen { display: none; }
  .std-woche-mobil { display: block; }
  .std-tagkarte {
    border: 1px solid var(--lp-line);
    border-radius: var(--lp-radius);
    padding: .55rem .65rem;
    margin-bottom: .6rem;
    background: var(--lp-card);
  }
  .std-tagkarte.std-heute { border-color: var(--lp-primary); background: var(--lp-primary-soft); }
  .std-tagkarte.std-feiertag { border-color: var(--lp-feiertag-line); background: var(--lp-feiertag-bg); }
  .std-tagkarte-kopf {
    margin: 0 0 .35rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--lp-line);
    padding-bottom: .3rem;
  }
  .std-tagzeile {
    display: grid;
    grid-template-columns: 1.5rem 1fr;
    gap: .5rem;
    align-items: start;
    padding: .5rem 0;
    border-top: 1px solid var(--lp-line-2);
  }
  .std-tagzeile:first-of-type { border-top: 0; }
  .std-std-mobil { font-weight: 700; color: var(--lp-text-2); font-size: .85rem; padding-top: .12rem; }
  /* Größere Schrift als im Raster und voller Text statt abgeschnitten. */
  .std-zelle { font-size: .95rem; min-height: 0; padding-right: 2.9rem; }
  .std-zelle .std-thema,
  .std-zelle .std-hue {
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
    white-space: normal;
  }
  /* Der Stift ist groß und immer sichtbar – auf dem Handy gibt es kein
     „Überfahren“, und ohne ihn ließe sich keine Stunde planen. */
  .std-edit { opacity: 1; width: 2.6rem; height: 2.6rem; font-size: 1.1rem; }

  /* --- Jahres- und Quartalsübersicht ------------------------------------
     Beide passen in der Breite (Jahr: eine Monatsspalte; Quartal: seitwärts
     scrollbar). Nur Schrift und Tagesfelder waren für den Finger zu klein. */
  .std-mini th, .std-mini td { font-size: .95rem; }
  a.std-tag { padding: .35rem 0; }
  table.std-quartal, table.std-quartal .std-qplan { font-size: .85rem; }
  a.std-qtag, .std-qferien, .std-qfeiertag { font-size: .78rem; }

  /* --- Sitzpläne: kleinere Zellen, damit das Raster in die Breite passt ----
     Fünf Plätze je Reihe sind der Normalfall und gehen sich am Handy knapp aus;
     mehr Spalten schieben seitwärts (der Rahmen scrollt), statt zu schrumpfen. */
  .std-raster {
    gap: .3rem;
    grid-template-columns: repeat(var(--spalten, 5), minmax(3.6rem, 1fr));
  }
  .std-sitz { min-height: 3rem; padding: .2rem; }
  .std-kind { font-size: .8rem; padding: .3rem .2rem; }
  .std-pool { padding: .4rem; }

  /* --- Lehrkräfte-Verwaltung: je Person ein Block statt einer breiten Zeile --
     Fünf Spalten (Name, E-Mail, Rolle, Klassen, Entfernen) liessen sich am Handy
     nur seitwärts lesen. Jetzt steht jedes Feld untereinander, mit seiner
     Beschriftung davor – die kommt aus dem Attribut `data-label` der Zelle. */
  .lp-lehrkraefte thead { display: none; }
  .lp-lehrkraefte tbody tr {
    display: block;
    padding: .6rem 0;
    border-bottom: 1px solid var(--lp-line);
  }
  .lp-lehrkraefte tbody td {
    display: block;
    padding: .15rem 0;
    border: 0;
  }
  .lp-lehrkraefte tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: .1rem;
    font-size: .72rem;
    font-weight: 700;
    color: var(--lp-text-2);
  }
}

@media print {
  .lp-header, .lp-toolbar, .std-edit, .lp-abmelden { display: none !important; }
  body { background: #fff; }
  .std-panel, .lp-panel { box-shadow: none; border-color: #ccc; }
}

/* --------------------------------------------------------------------------
   KI-Dokumentenanalyse
   Zwei Formulare nebeneinander (Datei / Kamera), darunter die Liste der
   Dokumente; auf der Detailseite Original und Vorschlag in zwei Spalten.
   -------------------------------------------------------------------------- */
.lp-ki-upload {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: .4rem;
}
.lp-ki-form input[type=file] { margin-bottom: .4rem; }
.lp-ki-werkzeuge {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: .6rem 0 1rem;
}
.lp-ki-zwei {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
  align-items: start;
}
/* Die Bearbeitungstabelle bleibt schmal: viele Spalten mit Eingabefeldern
   werden sonst unlesbar, bevor die Seite überhaupt scrollt. */
.lp-ki-tabelle input[type=text],
.lp-ki-tabelle input[type=number],
.lp-ki-tabelle select {
  margin: 0;
  padding: .2rem .35rem;
  font-size: .85rem;
  height: auto;
}
.lp-ki-tabelle td { padding: .2rem .3rem; vertical-align: middle; }
.lp-ki-tabelle input[type=checkbox] { margin: 0; }
/* Der Wochentag braucht Platz für „Donnerstag“ – sonst steht überall „Dien…“. */
.lp-ki-tabelle select { min-width: 7.5rem; }

/* Pausenzeilen im KI-Vorschlag: sichtbar, aber zurückgenommen – sie sind
   keine Unterrichtsstunde und bleiben abgewählt. */
.lp-ki-tabelle tr.lp-ki-pause td { color: #6b7280; }
.lp-ki-tabelle tr.lp-ki-pause input[value="1"] { opacity: .6; }

/* Upload-Felder der KI-Analyse: Das Feld selbst ist der Knopf. Ein <label>
   darüber löst auf iOS nicht zuverlässig aus, das Feld schon – also bekommt es
   die Größe und den Rahmen eines Knopfes. */
.lp-ki-feld-titel {
  margin: 0 0 .3rem;
  font-size: .9rem;
  font-weight: 600;
}
input.lp-ki-datei {
  width: 100%;
  padding: .6rem .7rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-background-color);
  min-height: 3rem;
  cursor: pointer;
}
input.lp-ki-datei::file-selector-button {
  margin-right: .7rem;
  padding: .35rem .8rem;
  border-radius: var(--pico-border-radius);
  border: 1px solid var(--pico-primary);
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  cursor: pointer;
}

/* Ziel-Auswahl beim Übernehmen (vorhandene Klasse oder neue). */
.lp-ki-ziel { display: block; }
.lp-ki-ziel .lp-ki-feld-titel { display: block; }
.lp-ki-ziel-aus { opacity: .45; }
