/* unterlagen: Lernunterlagen, Klausurenpool, Probeklausuren, Fall. Grundbausteine in app.css, hier nur Präfix ul-. */

/* ---------- Leiste unter dem Kopf: Reiter oder Rechtsgebiet, Trefferzahl ---------- */

.ul-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -8px 0 20px; }
.ul-leiste .segment button, .ul-segment a { min-height: 36px; padding: 0 16px; }
.ul-segment a {
  display: inline-flex; align-items: center; border-radius: 999px; font-size: var(--t-neben); font-weight: 600; color: var(--text-2);
}
.ul-segment a[aria-pressed="true"] { background: var(--glas); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.ul-segment a:focus-visible, .ul-leiste .segment button:focus-visible { outline: 2px solid var(--studium); outline-offset: 2px; }

/* ---------- Abschnitte und Klappen ---------- */

.ul-abschnitt + .ul-abschnitt { margin-top: 28px; }
.ul-rg { margin: 0 0 8px 4px; }
.ul-flaeche { padding: 4px 20px; }
.raster .ul-abschnitt + .ul-abschnitt { margin-top: 20px; }

.ul-klappe + .ul-klappe { border-top: 1px solid var(--linie); }
.ul-klappe > summary {
  list-style: none; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ul-klappe > summary::-webkit-details-marker { display: none; }
.ul-klappe > summary:focus-visible { outline: 2px solid var(--studium); outline-offset: 2px; border-radius: var(--r-feld); }
.ul-klappe-name { flex: 1; min-width: 0; font-weight: 600; }
.ul-klappe-zahl { font-size: var(--t-neben); color: var(--text-2); text-align: right; }
.ul-klappe > summary svg { width: 16px; height: 16px; flex: none; color: var(--text-3); transition: transform 200ms var(--ease); }
.ul-klappe[open] > summary svg { transform: rotate(90deg); }
.ul-klappe-inhalt { padding: 0 0 14px; }
.ul-klappe-inhalt .ul-klappe { margin-left: 12px; }
/* Herkunft (Kiss, Uni Potsdam, Sonstiges): äußere Klappe als Rubrik, die Gruppen darin bündig. */
.ul-herkunft > summary .ul-klappe-name { font-size: var(--t-klein); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.ul-herkunft > .ul-klappe-inhalt { padding-bottom: 4px; }
.ul-herkunft > .ul-klappe-inhalt > .ul-klappe, .ul-herkunft > .ul-klappe-inhalt > .ul-spalten > .ul-klappe { margin-left: 0; }

.ul-rubrik { margin: 14px 0 2px; }
.ul-hinweis { font-size: var(--t-neben); color: var(--text-2); margin: 2px 0 6px; text-wrap: pretty; }
.ul-satz { margin: 2px 0 6px; text-wrap: pretty; }

/* ---------- Zeilen ---------- */

.ul-liste { list-style: none; margin: 0; padding: 0; }
.ul-zeile {
  display: grid; grid-template-columns: 44px 4.4em minmax(0, 1fr) auto; gap: 2px 10px; align-items: start;
  padding: 6px 0; border-top: 1px solid var(--linie);
}
.ul-liste > .ul-zeile:first-child { border-top: 0; }
.ul-rubrik + .ul-liste > .ul-zeile:first-child { border-top: 1px solid var(--linie); }
.ul-nr { font-weight: 600; font-size: var(--t-text); white-space: nowrap; padding-top: 11px; }
/* Probeklausuren: unter dem Leistungsstand stehen geschriebene Klausuren und Lücken nebeneinander, beide als Klappen. */
.ul-zwei { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
@media (max-width: 1100px) { .ul-zwei { grid-template-columns: 1fr; } }
.ul-probe > summary .ul-datum { flex: none; width: 6.2em; padding-top: 0; }
.ul-probe > summary .ul-punkte { padding-top: 0; }
.ul-probe .ul-klappe-name .ul-neben { display: block; font-weight: 400; }
.ul-probe .ul-klappe-inhalt { padding-left: calc(6.2em + 12px); }
.ul-probe .ul-klappe-inhalt .ul-neben { margin: 0 0 6px; }
.ul-probe .ul-klappe-inhalt .ul-links { justify-content: flex-start; padding: 2px 0 0; }
@media (max-width: 700px) { .ul-probe .ul-klappe-inhalt { padding-left: 0; } }
.ul-neben b.ul-gewicht { font-weight: 600; color: var(--text-2); margin-right: 6px; }
.ul-neben b.ul-gewicht.hoch { color: var(--orange); }
.ul-auswertung .ul-summe td { font-weight: 600; }
.ul-einheiten li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--linie); font-size: var(--t-neben); }
.ul-einheiten li:first-child { border-top: 0; }
/* Schwerpunkte der Examensklausuren: volle Breite, Listen in zwei Spalten (Zeilen von links nach rechts). */
.ul-schwerpunkte { margin-top: 16px; }
.ul-spalten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; align-items: start; }
.ul-liste.ul-spalten > :nth-child(2), .ul-einheiten.ul-spalten li:nth-child(2), .ul-spalten > .ul-klappe:nth-child(2) { border-top: 0; }
.ul-rubrik + .ul-liste.ul-spalten > .ul-zeile:nth-child(2) { border-top: 1px solid var(--linie); }
/* Klausuren und Lücken je eine Karte über die volle Breite, untereinander. */
.ul-stapel { display: grid; gap: 16px; margin-top: 16px; }
@media (max-width: 1100px) {
  .ul-spalten { grid-template-columns: minmax(0, 1fr); }
  .ul-liste.ul-spalten > :nth-child(2), .ul-einheiten.ul-spalten li:nth-child(2), .ul-spalten > .ul-klappe:nth-child(2) { border-top: 1px solid var(--linie); }
}
.ul-trenner { margin: 36px 0 12px; padding-top: 20px; border-top: 1px solid var(--linie); }
/* Zeitplan-Karte: oben die nächste Klausur, darunter alle Termine als Tabelle, zuletzt klein das PDF. */
.ul-plan-naechste { font-size: var(--t-betont); font-weight: 700; letter-spacing: -.01em; margin: 2px 0 4px; }
.ul-plan-zeile { font-size: var(--t-neben); color: var(--text-2); margin: 0; }
.ul-plan-tabelle { width: 100%; border-collapse: collapse; margin: 14px 0 10px; font-size: var(--t-neben); }
.ul-plan-tabelle th, .ul-plan-tabelle td { padding: 6px 0; text-align: right; font-weight: 400; border-top: 1px solid var(--linie); white-space: nowrap; }
.ul-plan-tabelle th:first-child { text-align: left; }
.ul-plan-tabelle thead th { border-top: 0; padding-top: 0; font-size: var(--t-klein); color: var(--text-2); }
.ul-plan-tabelle tbody th { font-weight: 600; }
.ul-plan-tabelle .vorbei > * { color: var(--text-3); }
.ul-plan-tabelle .dran > * { color: var(--studium); font-weight: 600; }
.ul-plan-tabelle .ul-plan-pause td { text-align: left; color: var(--text-2); font-size: var(--t-klein); }
.ul-plan-reihe tbody th { font-weight: 400; color: var(--text-2); font-size: var(--t-klein); }
.ul-plan-reihe tr:first-child > * { border-top: 0; }
.ul-plan-reihe small { display: block; font-size: var(--t-mini); color: var(--text-2); }
.ul-plan-reihe td.vorbei, .ul-plan-reihe td.vorbei small { color: var(--text-3); }
.ul-plan-reihe td.dran, .ul-plan-reihe td.dran small { color: var(--studium); font-weight: 600; }
.ul-plan-regeln { margin: 0 0 8px; }
.ul-plan-fuss { font-size: var(--t-klein); color: var(--text-2); margin: 0; }
/* Schmale Karte in der Seitenspalte: ohne Nummernspalte, die Einträge tragen keine. */
.ul-orga .ul-zeile { grid-template-columns: 44px minmax(0, 1fr) auto; }
.ul-orga .ul-nr { display: none; }
.ul-haupt { min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 10px 0 4px; }
.ul-titel { font-weight: 500; text-wrap: pretty; }
.ul-titel a { color: inherit; }
.ul-titel a:hover { color: var(--studium); }
.ul-neben { font-size: var(--t-neben); color: var(--text-2); text-wrap: pretty; }
.ul-neben b { font-weight: 600; color: var(--text); margin-right: 4px; }
.ul-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; padding-top: 6px; }
.ul-zeile:has(.ul-haken[aria-pressed="true"]) .ul-titel { color: var(--text-2); }

/* Dateilinks als leise Pillen: groß genug für den Finger, ohne die Zeile zu dominieren. */
.ul-link {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--glas); color: var(--text); font-size: var(--t-text); font-weight: 500; white-space: nowrap;
  border: 1px solid var(--glas-rand); font-family: inherit; cursor: pointer; transition: background 150ms var(--ease);
}
.ul-link:hover { background: var(--studium-weich); }
.ul-link:focus-visible { outline: 2px solid var(--studium); outline-offset: 2px; }
.ul-fehlt { color: var(--text-3); background: none; cursor: default; font-size: var(--t-neben); }
@media (pointer: coarse) { .ul-link { min-height: 44px; padding: 0 14px; } }

/* Haken: 44er Zielfläche, sichtbar ein Kreis wie im Tagesblatt. */
.ul-haken { width: 44px; height: 44px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.ul-haken span {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--text-3); display: grid; place-items: center;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.ul-haken svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.ul-haken[aria-pressed="true"] span { background: var(--studium); border-color: var(--studium); }
.ul-haken[aria-pressed="true"] svg { opacity: 1; }
.ul-haken:active span { transform: scale(.9); }
.ul-haken:focus-visible { outline: 2px solid var(--studium); outline-offset: -2px; border-radius: 50%; }

/* Klausuren: Datum statt Haken, Punkte rechts, Dateien darunter. */
.ul-klausur { grid-template-columns: 6.4em minmax(0, 1fr) auto; }
.ul-datum { font-size: var(--t-text); color: var(--text-2); padding-top: 11px; white-space: nowrap; }
.ul-punkte { font-weight: 600; white-space: nowrap; padding-top: 10px; }
.ul-links-unten { grid-column: 2 / -1; justify-content: flex-start; padding: 0 0 6px; }
.ul-undatiert .ul-klausur { grid-template-columns: minmax(0, 1fr) auto; }
.ul-undatiert .ul-datum { display: none; }
.ul-undatiert .ul-links-unten { grid-column: 1 / -1; }

/* Datei im Ordnerbaum, Lücke, Übungsfall: ohne Nummernspalte. */
.ul-datei { grid-template-columns: minmax(0, 1fr) auto; }
.ul-datei .ul-links { padding-top: 12px; }
.ul-luecke { grid-template-columns: 44px minmax(0, 1fr); }
.ul-luecke .ul-links { grid-column: 2; justify-content: flex-start; padding: 0 0 6px; }
.ul-fallzeile { display: block; padding: 0; }
.ul-fallzeile a { display: flex; align-items: center; gap: 12px; color: inherit; min-height: 56px; padding: 4px 0; }
.ul-fallzeile a > svg { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.ul-fallzeile .ul-haupt { flex: 1; }
.ul-status { font-size: var(--t-neben); color: var(--text-2); white-space: nowrap; }
.ul-status.geloest { color: var(--gruen); }
.ul-status.wiederholen { color: var(--orange); }
.ul-punkte-reihe { display: inline-flex; gap: 3px; vertical-align: 1px; margin-left: 4px; }
.ul-punkte-reihe i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); opacity: .5; }
.ul-punkte-reihe i.an { background: var(--studium); opacity: 1; }

@media (max-width: 700px) {
  .ul-flaeche { padding: 2px 14px; }
  .ul-zeile { grid-template-columns: 44px minmax(0, 1fr); column-gap: 6px; }
  .ul-nr { display: none; }
  .ul-zeile:not(.ul-klausur):not(.ul-datei) .ul-links { grid-column: 2; justify-content: flex-start; padding: 0 0 6px; }
  .ul-haupt { padding-bottom: 2px; }
  .ul-klausur { grid-template-columns: minmax(0, 1fr) auto; }
  .ul-klausur .ul-datum { grid-column: 1 / -1; padding-top: 8px; font-size: var(--t-neben); }
  .ul-klausur .ul-haupt { padding-top: 0; }
  .ul-klausur .ul-punkte { padding-top: 0; }
  .ul-links-unten { grid-column: 1 / -1; }
  .ul-klappe-inhalt .ul-klappe { margin-left: 0; }
  .ul-leiste { margin-top: -4px; }
}

/* ---------- Probeklausuren ---------- */

.ul-kennzahlen { display: flex; flex-wrap: wrap; gap: 12px 40px; align-items: flex-end; margin-bottom: 8px; }
.ul-gross { font-size: var(--t-zahl); line-height: 1; font-weight: 700; letter-spacing: -.03em; }
.ul-mittel { font-size: var(--t-seite); line-height: 1.05; font-weight: 700; letter-spacing: -.02em; }
.ul-gross small, .ul-mittel small { font-size: .45em; font-weight: 600; letter-spacing: 0; color: var(--text-2); }

.ul-chart { margin: 14px 0 4px; min-height: 150px; }
.ul-chart svg { display: block; overflow: visible; }
.ul-chart-linie { stroke: var(--linie); stroke-width: 1; }
.ul-chart-grenze { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 4; }
.ul-chart-text { font-size: var(--t-mini); fill: var(--text-2); font-variant-numeric: tabular-nums; }
.ul-chart-wert { font-size: var(--t-neben); font-weight: 600; fill: var(--text); }
.ul-chart-pfad { fill: none; stroke: var(--studium); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ul-chart-punkt { fill: var(--studium); stroke: var(--grund); stroke-width: 2; }
.ul-chart-pfad.alt { stroke: var(--text-3); }
.ul-chart-punkt.alt { fill: var(--text-3); }
.ul-chart-trenner { stroke: var(--text-2); stroke-width: 1; }

.ul-tabelle-rahmen { overflow-x: auto; margin: 12px 0 10px; container-type: inline-size; }
.ul-tabelle { width: 100%; border-collapse: collapse; font-size: var(--t-text); font-variant-numeric: tabular-nums; }
.ul-tabelle th { font-size: var(--t-klein); font-weight: 600; color: var(--text-2); text-align: right; padding: 0 0 6px 10px; white-space: nowrap; }
.ul-tabelle td { text-align: right; padding: 9px 0 9px 10px; border-top: 1px solid var(--linie); white-space: nowrap; }
.ul-tabelle th:first-child, .ul-tabelle td:first-child { text-align: left; padding-left: 0; }
.ul-tabelle td:first-child { font-weight: 500; }
@container (max-width: 520px) { .ul-zuletzt { display: none; } }

.ul-tagesluecken { margin-top: 14px; }
.ul-spiel { width: 44px; height: 44px; flex: none; border: 0; background: none; color: var(--studium); display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.ul-spiel svg { width: 18px; height: 18px; }
.ul-spiel:focus-visible { outline: 2px solid var(--studium); outline-offset: -2px; }
/* Reiter Fallkarten: je Karte (Fälle, Meinungsstreite) eine Spalte je Rechtsgebiet, Klausurtechnik in zwei Spalten. */
.fk-karte + .fk-karte { margin-top: 16px; }
.fk-gebiete { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; align-items: start; }
@media (max-width: 1100px) { .fk-gebiete { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.fk-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 44px; border-top: 1px solid var(--linie); }
.fk-gebiet > .fk-zeile:first-child, .fk-technik > .fk-zeile:first-child, .fk-technik > .fk-zeile:nth-child(2) { border-top: 0; }
@media (max-width: 1100px) { .fk-technik > .fk-zeile:nth-child(2) { border-top: 1px solid var(--linie); } }
.fk-name { min-width: 0; padding: 8px 0; text-wrap: pretty; }
.fk-kopf .fk-name { font-weight: 600; }
.fk-stand { display: flex; align-items: center; gap: 8px; font-size: var(--t-neben); color: var(--text-2); white-space: nowrap; }
.fk-stand .balken { width: 48px; }
.fk-faellig { color: var(--studium); font-weight: 600; }
.karte-kopf .fk-alle { margin: -12px -10px -12px 4px; }

/* ---------- Fall ---------- */


.ul-lese { padding: 28px 32px 32px; font-size: var(--t-lese); line-height: 1.6; }
.ul-lese .titel-gross { font-size: var(--t-seite); margin: 6px 0 4px; }
.ul-lese h2 { font-size: var(--t-betont); line-height: 1.3; letter-spacing: -.015em; margin: 32px 0 8px; }
.ul-lese h3 { font-size: var(--t-lese); margin: 22px 0 6px; }
.ul-lese p { margin: 0; text-wrap: pretty; }
.ul-lese p + p, .ul-lese ul + p, .ul-lese ol + p { margin-top: .8em; }
.ul-lese ul, .ul-lese ol { padding-left: 1.4em; margin: .6em 0; }
.ul-lese li + li { margin-top: .35em; }
.ul-lese strong { font-weight: 600; }
.ul-lese table { border-collapse: collapse; margin: 12px 0; font-size: var(--t-text); display: block; overflow-x: auto; }
.ul-lese td, .ul-lese th { border-top: 1px solid var(--linie); padding: 8px 12px 8px 0; text-align: left; vertical-align: top; }
.ul-lese > * { max-width: 68ch; }
/* Die Fallfrage ist der Satz, auf den alles zielt: größer und schwerer statt eingerahmt. */
.ul-fallfrage { font-size: var(--t-betont); line-height: 1.45; font-weight: 600; letter-spacing: -.01em; }
.ul-lese-klappe { margin-top: 24px; border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); }
.ul-lese-klappe + .ul-lese-klappe { margin-top: 0; border-top: 0; }
.ul-lese-klappe > summary .ul-klappe-name { font-size: var(--t-betont); }
.ul-themen { margin-top: 12px; }
.ul-themen span { font-size: var(--t-neben); padding: 4px 10px; border-radius: 999px; background: var(--flaeche); color: var(--text-2); line-height: 1.3; }

.ul-voll { display: flex; width: 100%; }
.ul-voll button { flex: 1; min-height: 36px; }
.ul-bewertung { display: flex; align-items: center; gap: 0; margin: 10px 0 6px; }
.ul-bewertung button { width: 40px; height: 44px; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.ul-bewertung i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--text-3); transition: background 150ms var(--ease), border-color 150ms var(--ease); }
.ul-bewertung button[aria-pressed="true"] i { background: var(--studium); border-color: var(--studium); }
.ul-bewertung button:focus-visible { outline: 2px solid var(--studium); outline-offset: -4px; border-radius: var(--r-feld); }
.ul-bewertung span { margin-left: 8px; }
.ul-notiz {
  width: 100%; min-height: 96px; resize: vertical; margin-top: 6px; padding: 10px 12px; border-radius: var(--r-feld);
  border: 1px solid var(--linie); background: var(--kachel); font: inherit; font-size: var(--t-text); line-height: 1.45; color: var(--text);
}
.ul-notiz:focus { outline: 2px solid var(--studium); outline-offset: 1px; }
.ul-zeile-block { flex-direction: column; gap: 6px; }
.ul-zeile-block .ul-themen { margin-top: 0; }
.ul-kompakt .ul-zeile { grid-template-columns: minmax(0, 1fr); }
.ul-kompakt .ul-haupt { padding: 6px 0; }

@media (max-width: 700px) {
  .ul-lese { padding: 20px 18px 24px; }
  .ul-lese .titel-gross { font-size: var(--t-titel); }
  .ul-gross { font-size: var(--t-zahl); }
}

/* ---------- Falltraining-Suche (Probeklausuren) ---------- */

.ft-liste { list-style: none; margin: 0 0 6px; padding: 0; }
.ft-treffer { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--linie); }
.ft-liste > .ft-treffer:first-child { border-top: 0; }
.ft-titel { font-weight: 500; color: var(--text); text-wrap: pretty; }
.ft-titel:hover { color: var(--studium); }
.ft-auszug { font-size: var(--t-neben); color: var(--text-2); text-wrap: pretty; }
.ft-auszug mark { background: var(--studium-weich); color: var(--text); border-radius: 2px; padding: 0 1px; }
.ft-sinn { color: var(--studium); }
/* Lückenblatt: dieselbe Lücke in anderen Klausuren. */
.lb-verwandt .ft-treffer:first-of-type { border-top: 0; }
