/* Lerngruppe (lerngruppe.js). Nur Tokens aus app.css; die Gebietsfarben sind die der Lernuhr (Lernuhr.swift,
   Farben: Blau ZR, Rot SR, Textfarbe ÖR, Grün Probeklausuren), damit Ring und Zeitleiste dort wie hier aussehen. */

:root {
  --lg-zivilrecht: #1853C6;
  --lg-strafrecht: #D42325;
  --lg-oeffrecht: var(--text);
  --lg-klausur: #009342;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lg-zivilrecht: #8EB1F1;
    --lg-strafrecht: #FF645F;
    --lg-klausur: #51C672;
  }
}

.lg-stapel { display: grid; gap: 16px; }
.lg-personen { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.lg-ich { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.lg-ich .lg-person { background: none; border-color: var(--linie); box-shadow: none; }

.lg-person { display: grid; gap: 14px; }
.lg-kopf { display: flex; align-items: center; gap: 18px; }
.lg-wer { min-width: 0; }
.lg-name { font-size: var(--t-titel); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.lg-status { margin-top: 4px; font-size: var(--t-neben); color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg-lernt .lg-status { color: var(--text); font-weight: 600; }
.lg-live { width: 8px; height: 8px; border-radius: 50%; background: var(--gruen); box-shadow: 0 0 0 0 var(--gruen); animation: lg-puls 2s var(--ease) infinite; }
@keyframes lg-puls { 0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, .5); } 70%, 100% { box-shadow: 0 0 0 7px rgba(52, 199, 89, 0); } }
@media (prefers-reduced-motion: reduce) { .lg-live { animation: none; } }

/* Tagesring: Spur, darüber die Gebiete als Segmente ab 12 Uhr. */
.lg-ring { position: relative; width: 112px; height: 112px; flex: none; }
.lg-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lg-ring circle { fill: none; stroke-width: 11; }
.lg-spur { stroke: var(--flaeche); }
.lg-seg { stroke-linecap: butt; transition: stroke-dasharray 400ms var(--ease); }
.lg-seg.lg-zivilrecht { stroke: var(--lg-zivilrecht); }
.lg-seg.lg-strafrecht { stroke: var(--lg-strafrecht); }
.lg-seg.lg-oeffrecht { stroke: var(--lg-oeffrecht); }
.lg-mitte { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.lg-mitte b { font-size: var(--t-betont); font-weight: 700; letter-spacing: -.02em; }
.lg-mitte small { font-size: var(--t-mini); color: var(--text-2); }
.lg-mitte .lg-ohne { color: var(--text-3); font-weight: 500; }

.lg-zeilen .zeile:first-child { border-top: 0; padding-top: 0; }

.lg-woche { display: grid; gap: 6px; }
.lg-woche .rubrik { margin-bottom: 2px; }
.lg-wo { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: var(--t-klein); color: var(--text-2); }
.lg-wo .zahl { min-width: 54px; text-align: right; }

.lg-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }

/* Einladung zum gemeinsamen Lernen: die eine Aufforderung der Seite. */
.lg-einladung { margin-bottom: 16px; border: 1.5px solid var(--studium); }

/* Zeitleiste: je Person eine Bahn von 6 bis 24 Uhr. */
.lg-zeitleiste { margin-top: 16px; }
.lg-spur-zeile { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 12px; padding: 6px 0; }
.lg-spur-name { font-size: var(--t-neben); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-bahn { position: relative; height: 14px; border-radius: var(--r-punkt); background: var(--flaeche); }
.lg-block { position: absolute; top: 0; bottom: 0; border-radius: var(--r-punkt); background: var(--f); }
.lg-block.lg-laufend { opacity: .55; }
.lg-achse { position: relative; height: 14px; }
.lg-achse span { position: absolute; transform: translateX(-50%); font-size: var(--t-mini); color: var(--text-3); font-variant-numeric: tabular-nums; }
.lg-achse span:first-child { transform: none; }
.lg-achse span:last-child { transform: translateX(-100%); }
.lg-legende { display: inline-flex; align-items: center; gap: 5px; margin-left: 12px; }
.lg-legende i { width: 9px; height: 9px; border-radius: 2px; background: var(--f); }

/* Beitritt und Freigaben */
.lg-formular { display: grid; gap: 12px; margin-top: 12px; max-width: 420px; }
.lg-formular label { display: grid; gap: 4px; font-size: var(--t-neben); color: var(--text-2); }
.lg-formular input { min-height: var(--h-knopf); padding: 0 12px; border-radius: var(--r-feld); border: 1px solid var(--linie); background: var(--kachel); color: var(--text); font-size: var(--t-text); }
.lg-formular input[name="code"] { font-variant-numeric: tabular-nums; letter-spacing: .08em; text-transform: uppercase; }
.lg-formular .knopf { justify-self: start; }
.lg-freigaben { margin-bottom: 16px; }
.lg-freigaben .aufgabe-text b { font-weight: 600; }

@media (max-width: 480px) {
  .lg-personen { grid-template-columns: 1fr; }
  .lg-ring { width: 96px; height: 96px; }
  .lg-spur-zeile { grid-template-columns: 64px minmax(0, 1fr); }
}

/* ---------- Ablage (lerngruppe-ablage.js) ---------- */

.lg-liste { list-style: none; margin: 0; padding: 0; }
.lg-liste > li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--linie); }
.lg-liste > li:first-child { border-top: 0; }
.lg-knoepfe:has(> .lg-marke) { align-items: center; }
.lg-liste .lg-knoepfe { flex: none; justify-content: flex-end; }
.lg-marke { font-size: var(--t-klein); color: var(--text-2); }

/* Ablegen: eine Fläche zum Ziehen, darunter Gebiet und Notiz für die nächste Datei. */
.lg-ziel { display: grid; gap: 4px; justify-items: center; text-align: center; margin-top: 12px; padding: 22px 16px; border: 1.5px dashed var(--linie); border-radius: var(--r-kachel); cursor: pointer; transition: border-color 150ms var(--ease), background 150ms var(--ease); }
.lg-ziel:hover, .lg-ziel.lg-ueber { border-color: var(--studium); background: var(--studium-weich); }
.lg-ziel-text { font-size: var(--t-text); }
.lg-ziel-text u { text-decoration-color: var(--studium); text-underline-offset: 3px; }
/* Ziehen gibt es nur mit Maus oder Trackpad; auf dem Touchscreen heißt die Fläche einfach „Datei auswählen“. */
.lg-touch { display: none; }
@media (hover: none) { .lg-maus { display: none; } .lg-touch { display: inline; } }
.lg-ablegen-optionen { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 4px; }
.lg-notiz { flex: 1 1 220px; min-height: var(--h-knopf-klein); padding: 0 12px; border-radius: var(--r-feld); border: 1px solid var(--linie); background: var(--kachel); color: var(--text); font-size: var(--t-neben); }
.lg-pakete { margin-top: 8px; }

.lg-paket-text, .lg-datei-text { flex: 1; min-width: 0; }
.lg-paket-text b { font-size: var(--t-text); font-weight: 600; }
.lg-datei-name { font-size: var(--t-text); font-weight: 600; overflow-wrap: anywhere; }
.lg-hoch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-neben); }
/* Dateityp als Kürzel statt Symbol: PDF, DOCX, PNG. */
.lg-typ { flex: none; align-self: flex-start; margin-top: 2px; width: 44px; padding: 6px 0; border-radius: var(--r-feld); background: var(--flaeche); color: var(--text-2); font-size: var(--t-mini); font-weight: 700; letter-spacing: .04em; text-align: center; }

/* Vorschau einer Datei der Ablage */
.lg-vorschau { width: min(960px, calc(100vw - 32px)); height: min(88vh, 1100px); padding: 0; border: 1px solid var(--glas-rand); border-radius: var(--r-karte); background: var(--grund); color: var(--text); box-shadow: var(--glas-schatten); }
.lg-vorschau[open] { display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }
.lg-vorschau::backdrop { background: rgba(0, 0, 0, .35); }
.lg-vorschau-kopf { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--linie); }
.lg-vorschau-kopf b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-vorschau-kopf .rechts { margin-left: auto; display: flex; gap: 8px; }
.lg-vorschau iframe { width: 100%; height: 100%; border: 0; }
.lg-vorschau img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }

@media (max-width: 600px) {
  .lg-liste > li { flex-wrap: wrap; }
  .lg-liste .lg-knoepfe { width: 100%; justify-content: flex-start; }
  .lg-liste > li.lg-datei .lg-knoepfe { padding-left: 56px; }
}

/* ---------- Skills des Agenten und Änderungen ---------- */

.lg-skill .check { flex: none; }
.lg-skill.lg-aus .lg-paket-text { opacity: .55; }
.lg-teilen code, .karte code { font-size: .92em; padding: 1px 5px; border-radius: 5px; background: var(--flaeche); overflow-wrap: anywhere; }

/* Dialog für Skill und Paketinhalt: Kopf mit Aktionen, darunter scrollt der Inhalt. */
.lg-skill-dialog { height: auto; max-height: min(88vh, 900px); }
.lg-skill-form { max-width: none; margin: 0; gap: 0; height: 100%; display: grid; grid-template-rows: auto 1fr; }
.lg-skill-felder { display: grid; gap: 12px; padding: 14px; overflow: auto; }
.lg-skill-text textarea { min-height: 260px; padding: 10px 12px; border-radius: var(--r-feld); border: 1px solid var(--linie); background: var(--kachel); color: var(--text); font: inherit; font-size: var(--t-neben); line-height: 1.5; resize: vertical; }
.lg-paket-inhalt { padding: 14px; overflow: auto; }
.lg-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--t-neben); line-height: 1.55; }
.lg-diff { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: var(--t-klein); white-space: pre; overflow-x: auto; }
.lg-diff .lg-plus { color: var(--gruen); }
.lg-diff .lg-minus { color: var(--rot); }
.lg-diff .lg-kopfzeile { color: var(--text-3); }
