/* Repetitor – ruhig, gut lesbar, große Ziele für den Daumen. */

:root {
  --grund: #f6f5f1;
  --flaeche: #ffffff;
  --flaeche-2: #efede7;
  --text: #1d1e21;
  --leise: #6b6d73;
  --linie: #dddad2;
  --akzent: #1d1e21;
  --akzent-text: #ffffff;
  --gefahr: #b3261e;
  --warten: #a15c00;
  --warten-grund: #fdf1de;
  --mark: #fff0a8;

  /* Eine Farbe je Säule */
  --s-zivilrecht: #2f62c9;
  --s-strafrecht: #c43d36;
  --s-oeffentliches_recht: #23845a;
  --s-grundlagen: #7a5cc4;
  --s-schwerpunkt: #b27a12;
  --s-ohne: #9a9ca2;

  --rund: 14px;
  --schrift: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #16171a;
    --flaeche: #1f2024;
    --flaeche-2: #2a2b30;
    --text: #ececee;
    --leise: #9a9ca3;
    --linie: #34353b;
    --akzent: #ececee;
    --akzent-text: #16171a;
    --gefahr: #f2867d;
    --warten: #f0b45c;
    --warten-grund: #3a2e1a;
    --mark: #5b4d12;
    --s-zivilrecht: #6c95ec;
    --s-strafrecht: #ec7b74;
    --s-oeffentliches_recht: #5cc28f;
    --s-grundlagen: #a58ef0;
    --s-schwerpunkt: #e2ad4a;
    --s-ohne: #7b7d84;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 17px/1.5 var(--schrift);
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

a { color: inherit; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0.4em 0 0.5em; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 1.6em 0 0.6em; }
p { margin: 0.5em 0; }
.leise { color: var(--leise); font-size: 0.92rem; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

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

.kopf {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  max-width: 760px; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--grund) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.marke { font-weight: 700; text-decoration: none; letter-spacing: 0.01em; }
.kopf-suche { flex: 1; }
.kopf-suche input {
  width: 100%; padding: 8px 12px; font-size: 16px;
  border: 1px solid var(--linie); border-radius: 10px;
  background: var(--flaeche); color: var(--text);
}

/* --- Navigation unten ----------------------------------------------------- */

.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around; align-items: center;
  max-width: 760px; margin: 0 auto;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--flaeche) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--linie);
}
.leiste a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 60px; padding: 6px 4px;
  font-size: 0.7rem; text-decoration: none; color: var(--leise);
}
.leiste a[aria-current="page"] { color: var(--text); font-weight: 600; }
.leiste svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.leiste a.plus {
  min-width: 52px; height: 52px; border-radius: 50%;
  justify-content: center;
  background: var(--akzent); color: var(--akzent-text);
}
.leiste a.plus svg { width: 26px; height: 26px; stroke-width: 2.2; }

/* --- Knöpfe und Formulare ------------------------------------------------- */

.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 12px;
  background: var(--akzent); color: var(--akzent-text);
  font: 600 1rem var(--schrift); text-decoration: none; cursor: pointer;
}
.knopf.gross { width: 100%; min-height: 54px; font-size: 1.05rem; }
.knopf.zweit { background: var(--flaeche-2); color: var(--text); }
.knopf.gefahr { background: transparent; color: var(--gefahr); border: 1px solid currentColor; }
.knopf[disabled] { opacity: 0.5; }
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; }

.formular { display: grid; gap: 14px; }
.formular label { display: grid; gap: 4px; font-weight: 600; font-size: 0.92rem; }
.formular input:not([type="file"]):not([type="checkbox"]),
.formular select,
.formular textarea {
  width: 100%; min-height: 44px; padding: 8px 12px;
  font: 16px var(--schrift); color: var(--text);
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px;
}
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .zwei { grid-template-columns: 1fr; } }

.ablage {
  position: relative;
  display: grid !important; gap: 6px;
  padding: 26px 18px; text-align: center;
  border: 2px dashed var(--linie); border-radius: var(--rund);
  background: var(--flaeche);
  font-weight: 400 !important; cursor: pointer;
}
.ablage input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ablage-text { color: var(--leise); }
.ablage-text strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 4px; }
.ablage-auswahl:not(:empty) { font-weight: 600; color: var(--text); }

/* --- Säulenfarben --------------------------------------------------------- */

.s-zivilrecht { --s: var(--s-zivilrecht); }
.s-strafrecht { --s: var(--s-strafrecht); }
.s-oeffentliches_recht { --s: var(--s-oeffentliches_recht); }
.s-grundlagen { --s: var(--s-grundlagen); }
.s-schwerpunkt { --s: var(--s-schwerpunkt); }
.s-ohne { --s: var(--s-ohne); }

.chip {
  display: inline-block; padding: 2px 10px; border-radius: 99px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--s); background: color-mix(in srgb, var(--s) 14%, transparent);
}
.chip.leer { color: var(--leise); background: var(--flaeche-2); }

/* --- Listen --------------------------------------------------------------- */

.liste { display: grid; gap: 8px; }
.zeile {
  display: grid; gap: 4px;
  padding: 12px 14px 12px 16px;
  background: var(--flaeche); border-radius: var(--rund);
  border-left: 4px solid var(--s, var(--s-ohne));
  text-decoration: none;
}
.zeile-titel { font-weight: 600; line-height: 1.3; }
.zeile-info { color: var(--leise); font-size: 0.86rem; }
.zeile .chip { justify-self: start; }
.warten { color: var(--warten); font-weight: 600; font-size: 0.82rem; }

.titelzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filter {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-radius: 10px; background: var(--flaeche-2);
}
.leer-hinweis { color: var(--leise); padding: 24px 0; text-align: center; }
.fuss-link { margin-top: 28px; text-align: center; font-size: 0.9rem; color: var(--leise); }

/* --- Start ---------------------------------------------------------------- */

.karte-hinweis {
  padding: 20px; border-radius: var(--rund);
  background: var(--flaeche); border: 1px solid var(--linie);
}
.karte-hinweis .gross { font-size: 1.25rem; font-weight: 700; margin-top: 0; }
.zahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.zahlen div { padding: 12px; border-radius: var(--rund); background: var(--flaeche); }
.zahlen dt { color: var(--leise); font-size: 0.8rem; }
.zahlen dd { margin: 0; font-size: 1.5rem; font-weight: 700; }

/* --- Gliederung ----------------------------------------------------------- */

.saeule { margin: 20px 0; }
.saeule h2 {
  margin: 0 0 8px; padding-left: 12px;
  border-left: 5px solid var(--s); color: var(--s);
}
.saeule ul { list-style: none; margin: 0; padding: 0; }
.saeule > ul { background: var(--flaeche); border-radius: var(--rund); overflow: hidden; }
.saeule ul ul { padding-left: 18px; }
.saeule li a {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  min-height: 48px; padding: 10px 14px;
  text-decoration: none; border-bottom: 1px solid var(--linie);
}
.saeule > ul > li:last-child > a { border-bottom: 0; }
.anzahl {
  min-width: 28px; padding: 1px 8px; border-radius: 99px; text-align: center;
  font-size: 0.8rem; font-weight: 700;
  color: var(--s); background: color-mix(in srgb, var(--s) 14%, transparent);
}
.anzahl.null { color: var(--leise); background: transparent; }
.marke-gz {
  margin-left: 4px; padding: 1px 7px; border-radius: 6px;
  font-size: 0.7rem; font-weight: 600; vertical-align: 2px;
  color: var(--leise); background: var(--flaeche-2);
}

/* --- Unterlage ------------------------------------------------------------ */

.quelle-kopf { border-left: 5px solid var(--s); padding-left: 14px; margin: 12px 0 16px; }
.quelle-kopf h1 { margin: 0.1em 0 0.3em; }
.oberzeile { color: var(--s); font-weight: 600; font-size: 0.85rem; margin: 0; }
.warten-box, .hinweis-box {
  padding: 10px 14px; border-radius: 10px;
  background: var(--warten-grund); color: var(--warten); font-weight: 600; font-size: 0.9rem;
}
.hinweis-box { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--text); }

.bearbeiten {
  margin: 0 0 18px; padding: 4px 14px; border-radius: var(--rund); background: var(--flaeche);
}
.bearbeiten summary { padding: 10px 0; cursor: pointer; font-weight: 600; }
.bearbeiten form { margin-bottom: 14px; }

.seiten { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.seite {
  padding: 14px 16px; border-radius: var(--rund); background: var(--flaeche);
  scroll-margin-top: 80px;
}
.seite:target { outline: 2px solid var(--akzent); }
.seite-kopf { display: flex; justify-content: space-between; margin-bottom: 6px; }
.seite-nr { color: var(--leise); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.seite-text { white-space: pre-line; font-size: 0.98rem; line-height: 1.55; overflow-wrap: anywhere; }
.seitenbild, .bild-auf img {
  display: block; width: 100%; height: auto; margin-top: 10px;
  border-radius: 8px; border: 1px solid var(--linie); background: #fff;
}
.bild-auf summary { margin-top: 8px; color: var(--leise); font-size: 0.88rem; cursor: pointer; }

/* --- Hochladen-Ergebnis, ZIP-Auswahl -------------------------------------- */

.meldungen { list-style: none; padding: 0; display: grid; gap: 8px; }
.meldungen li {
  display: grid; gap: 2px; padding: 12px 14px;
  border-radius: var(--rund); background: var(--flaeche);
  border-left: 4px solid var(--linie);
}
.meldungen li.ok { border-left-color: var(--s-oeffentliches_recht); }
.meldungen li.nicht { border-left-color: var(--warten); }
.meldungen span { color: var(--leise); font-size: 0.9rem; }
.meldungen form { margin-top: 6px; }

.auswahl { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.auswahl label {
  display: flex !important; gap: 12px; align-items: flex-start;
  padding: 10px 12px; border-radius: 10px; background: var(--flaeche);
  font-weight: 400 !important; overflow-wrap: anywhere;
}
.auswahl input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.auswahl em { display: block; color: var(--leise); font-size: 0.85rem; font-style: normal; }

/* --- Suche ---------------------------------------------------------------- */

.such-formular { display: flex; gap: 8px; }
.such-formular input {
  flex: 1; min-height: 44px; padding: 8px 12px; font: 16px var(--schrift);
  color: var(--text); background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: 10px;
}
.treffer { list-style: none; padding: 0; display: grid; gap: 8px; }
.treffer a {
  display: grid; gap: 4px; padding: 12px 14px;
  border-radius: var(--rund); background: var(--flaeche); text-decoration: none;
}
.treffer-titel { font-weight: 600; }
.treffer-auszug { font-size: 0.92rem; }
.treffer .chip { justify-self: start; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }

/* --- Anmeldung ------------------------------------------------------------ */

.kopf-knopf {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; color: var(--leise);
}
.kopf-knopf svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round;
}
.anmelden {
  display: grid; gap: 14px; max-width: 420px;
  margin: 12vh auto 0; text-align: center;
}
.anmelden .formular { text-align: left; }
.anmelden-logo { justify-self: center; border-radius: 22px; }
.anmelden h1 { margin-bottom: 0; }
.meldung { margin: 0; font-weight: 600; }
.meldung.fehler { color: var(--gefahr); }
