/* Aufbau und Farben wie die Server-Doku: Seitenleiste links, Inhalt, Inhaltsverzeichnis rechts.
   Immer hell (unabhängig vom System). */
:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f0f3f7; --text: #1b2230; --muted: #5d6878; --border: #e1e6ed;
  --accent: #3550d6; --accent-soft: #eaeefd; --accent-text: #2a40ad;
  --bad: #bf2a2a; --bad-bg: #fcecec; --marke: #6b4fa0; --marke-bg: #f0ebf8;
  --inline-code: #eceff5; --code-bg: #f3f5f8;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 2px 8px rgba(16,24,40,.06);
  --radius: 12px; --sidebar: 276px; --toc: 224px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 20px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.62 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
.icon { width: 18px; height: 18px; flex: none; }

/* Raster */
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc); min-height: 100vh; }
.layout.no-toc { grid-template-columns: var(--sidebar) minmax(0, 1fr); }

/* Seitenleiste */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 14px 28px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2f47c7, #6a4bd6); flex: none; }
.brand-mark .icon { width: 20px; height: 20px; }
.brand-title { display: block; font-weight: 680; font-size: 15.5px; line-height: 1.2; }
.brand-sub { display: block; font-size: 12px; color: var(--muted); }
.sb-suche { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--muted); }
.sb-suche:focus-within { border-color: var(--accent); background: var(--surface); }
.sb-suche input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text); padding: 8px 0; outline: none; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); font-size: 14.2px; line-height: 1.3; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a .icon { color: var(--muted); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 620; }
.nav a.active .icon { color: var(--accent); }
.nav-group-title { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 5px; }

/* Seitenbaum */
.baum { flex: 1; }
.baum ul { list-style: none; margin: 0; padding: 0; }
.baum ul ul { padding-left: 14px; margin-left: 9px; border-left: 1px solid var(--border); }
.baum a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text); font-size: 14.2px; line-height: 1.3; }
.baum a:hover { background: var(--surface-2); text-decoration: none; }
.baum a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 620; }
.baum li.blatt > a { margin-left: 18px; }
.baum summary { display: flex; align-items: center; list-style: none; cursor: pointer; border-radius: 8px; }
.baum summary::-webkit-details-marker { display: none; }
.baum summary::before { content: ""; flex: none; width: 18px; height: 18px; margin-right: 0;
  background: no-repeat center / 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6878' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E");
  transition: transform .15s ease; }
.baum details[open] > summary::before { transform: rotate(90deg); }
.baum summary a { flex: 1; min-width: 0; }
.sb-fuss { margin-top: 22px; padding: 12px 10px 0; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.sb-fuss form { margin: 0; }

/* Inhalt */
.content { padding: 36px 48px 80px; min-width: 0; }
.page { max-width: 860px; margin: 0 auto; }
.page-head { margin: 0 0 26px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.crumb { font-size: 12.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 6px; }
.crumb a { color: inherit; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.015em; }
.meta { color: var(--muted); font-size: 14px; }
h2 { font-size: 21px; line-height: 1.3; margin: 36px 0 12px; letter-spacing: -.01em; }
h3 { font-size: 16.5px; margin: 26px 0 8px; }
.inhalt { overflow-wrap: anywhere; }
.inhalt > :first-child { margin-top: 0; }
.inhalt h1 { font-size: 24px; margin: 30px 0 10px; }
.inhalt ul, .inhalt ol { padding-left: 1.4em; }
.inhalt li { margin: 3px 0; }
.tabelle { overflow-x: auto; margin: 14px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.inhalt table { border-collapse: collapse; width: 100%; }
.inhalt th, .inhalt td { border-bottom: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; overflow-wrap: normal; -webkit-hyphens: auto; hyphens: auto; }
.inhalt tr:last-child td { border-bottom: 0; }
.inhalt th { background: var(--surface-2); font-weight: 650; white-space: nowrap; }
.inhalt code { font: 13.5px var(--mono); background: var(--inline-code); padding: 1px 5px; border-radius: 5px; }
.inhalt pre { background: var(--code-bg); border: 1px solid var(--border); padding: 12px 14px; border-radius: 10px; overflow-x: auto; }
.inhalt pre code { background: none; padding: 0; }
.inhalt blockquote { margin: 14px 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; color: var(--text); }
.inhalt img { max-width: 100%; height: auto; border-radius: 8px; }
.inhalt hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.unterseiten { margin-top: 36px; padding-top: 4px; border-top: 1px solid var(--border); }
.unterseiten ul { padding-left: 1.2em; }
.marke { display: inline-block; font-size: 11.5px; font-weight: 650; color: var(--marke); background: var(--marke-bg); border-radius: 999px; padding: 1px 8px; vertical-align: 1px; }
.hint { color: var(--muted); font-size: 14px; padding: 8px 10px; }
.liste { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.liste li { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.liste li:last-child { border-bottom: 0; }
.liste .zeit { display: block; color: var(--muted); font-size: 13px; }
.treffer { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin: 10px 0; color: var(--text); box-shadow: var(--shadow); }
.treffer:hover { border-color: var(--accent); text-decoration: none; }
.treffer-titel { display: block; font-weight: 650; color: var(--accent-text); }
.r-snip { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; line-height: 1.45; }
mark { background: #dfe5fd; color: var(--text); border-radius: 3px; padding: 0 2px; }

/* Inhaltsverzeichnis rechts */
.toc { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 40px 18px 24px 4px; font-size: 13.5px; }
.toc-title { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 4px 10px; color: var(--muted); line-height: 1.35; }
.toc a:hover { color: var(--accent-text); text-decoration: none; }
.toc .toc-3 a { padding-left: 22px; font-size: 13px; }

/* Einfache Seiten: Anmeldung, Zugriff erlauben */
.kopf { display: flex; align-items: center; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.kopf .brand { padding: 0; }
.einfach-main { padding: 24px 16px 48px; }
.karte { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.schmal { max-width: 440px; margin: 24px auto; }
.karte h1 { font-size: 24px; }
label { display: block; font-size: 13.5px; color: var(--muted); margin: 14px 0 0; }
input[type=email], input[type=password] { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; color: var(--text);
  background: #fff; border: 1px solid #cdd4de; border-radius: 9px; }
input[type=email]:focus, input[type=password]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
button { font: inherit; font-weight: 620; padding: 10px 16px; border-radius: 9px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; margin-top: 18px; }
button.zweit { background: #fff; color: var(--accent-text); }
button.link { background: none; border: 0; color: var(--accent-text); padding: 0; margin: 0; font-weight: 400; font-size: inherit; }
button.link:hover { text-decoration: underline; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }
.fehler { color: var(--bad); background: var(--bad-bg); border-radius: 9px; padding: 8px 12px; }
.hinweis { color: var(--muted); font-size: 14px; }
.rechte { padding-left: 1.2em; }

/* Mobil */
.topbar, .backdrop { display: none; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); cursor: pointer; }
@media (max-width: 1200px) { .layout { grid-template-columns: var(--sidebar) minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 860px) {
  .layout, .layout.no-toc { display: block; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .topbar-title { flex: 1; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 290px; max-width: 86vw; height: auto; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .sidebar.open { transform: none; }
  .backdrop.show { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(8,12,20,.45); }
  .content { padding: 20px 16px 60px; }
  h1 { font-size: 25px; }
  html { scroll-padding-top: 70px; }
}
@media print {
  .sidebar, .toc, .topbar, .backdrop { display: none !important; }
  .layout { display: block; } .content { padding: 0; } body { background: #fff; }
}

/* ---------------------------------------------------------------- Bearbeiten */
[hidden] { display: none !important; }
.zahl { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 0 7px; }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
a.knopf, .aktionen a { display: inline-flex; align-items: center; gap: 7px; font-weight: 620; font-size: 14px; padding: 7px 12px; border-radius: 9px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; text-decoration: none; }
a.knopf .icon { width: 16px; height: 16px; }
a.knopf.zweit { background: var(--surface); color: var(--accent-text); border-color: var(--border); }
a.knopf.zweit:hover { border-color: var(--accent); }
a.knopf.leise { color: var(--muted); }
a.knopf:hover { text-decoration: none; }
button.gefahr { background: var(--bad); border-color: var(--bad); }
.erfolg { color: #157a3a; background: #e6f5ea; border-radius: 9px; padding: 8px 12px; margin: 0 0 16px; }
.warnung { color: #6b4500; background: #fff3d4; border: 1px solid #f1d79a; border-radius: 10px; padding: 10px 14px; margin: 0 0 18px; }
.warnung form.inline { display: inline; }
.warnung button { margin: 0 8px 0 4px; padding: 5px 10px; font-size: 13.5px; }
.liste li.mit-knopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.liste li.mit-knopf button { margin: 0; padding: 6px 12px; font-size: 13.5px; }
.liste li.frisch { background: var(--accent-soft); }

.editor-form .felder { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px 16px; margin-bottom: 14px; }
.editor-form label { margin: 0; }
.editor-form input[type=text], .editor-form select { display: block; width: 100%; margin-top: 4px; padding: 9px 12px; font: inherit; color: var(--text);
  background: #fff; border: 1px solid #cdd4de; border-radius: 9px; }
.editor-form .titel input { font-size: 18px; font-weight: 620; }
.editor-form input:focus, .editor-form select:focus, .quelltext:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.werkzeuge { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: var(--surface);
  border: 1px solid var(--border); border-bottom: 0; border-radius: 10px 10px 0 0; }
.werkzeuge .gruppe { display: flex; gap: 2px; padding-right: 6px; border-right: 1px solid var(--border); }
.werkzeuge .gruppe:last-child, .werkzeuge .gruppe.rechts { border-right: 0; }
.werkzeuge .gruppe.rechts { margin-left: auto; }
.werkzeuge button { margin: 0; padding: 5px 9px; font-size: 13.5px; font-weight: 500; line-height: 1.3; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 7px; white-space: nowrap; }
.werkzeuge button:hover { background: var(--surface-2); border-color: var(--border); }
.werkzeuge button.aktiv, .werkzeuge button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); border-color: #c9d3fb; }
.werkzeuge button:disabled { opacity: .35; cursor: default; background: transparent; border-color: transparent; }
.werkzeuge .nur-tabelle { display: none; }
.werkzeuge.in-tabelle .nur-tabelle { display: flex; }
.werkzeuge.nur-quelltext .gruppe:not(.rechts) { opacity: .35; pointer-events: none; }
.editor, .quelltext { display: block; width: 100%; min-height: 55vh; background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 10px 10px; }
.quelltext { padding: 14px 16px; font: 14px/1.6 var(--mono); color: var(--text); resize: vertical; border-radius: 10px; }
#werkzeuge:not([hidden]) ~ .quelltext { border-radius: 0 0 10px 10px; }
.editor-flaeche { min-height: 55vh; padding: 16px 20px 40px; outline: none; }
.editor-flaeche p.is-editor-empty:first-child::before { content: attr(data-placeholder); float: left; height: 0; color: var(--muted); pointer-events: none; }
.editor-flaeche ul[data-type="taskList"], .inhalt ul.contains-task-list { list-style: none; padding-left: 4px; }
.editor-flaeche ul[data-type="taskList"] li { display: flex; gap: 8px; align-items: flex-start; }
.editor-flaeche ul[data-type="taskList"] li > label { margin: 3px 0 0; }
.editor-flaeche ul[data-type="taskList"] li > div { flex: 1; }
.editor-flaeche .tableWrapper { overflow-x: auto; margin: 14px 0; border: 1px solid var(--border); border-radius: 10px; }
.editor-flaeche table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.editor-flaeche th, .editor-flaeche td { border: 1px solid var(--border); padding: 7px 10px; vertical-align: top; position: relative; min-width: 4em; }
.editor-flaeche th { background: var(--surface-2); }
.editor-flaeche .selectedCell { background: var(--accent-soft); }
.editor-flaeche hr.ProseMirror-selectednode { outline: 2px solid var(--accent); }
.editor-flaeche a { text-decoration: underline; }
.knoepfe.fuss { position: sticky; bottom: 0; align-items: center; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.knoepfe.fuss button, .knoepfe a.knopf { margin-top: 0; }
.tipp { color: var(--muted); font-size: 13px; }
@media (max-width: 860px) {
  .editor-form .felder { grid-template-columns: 1fr; }
  .werkzeuge { flex-wrap: nowrap; overflow-x: auto; top: 59px; }
  .werkzeuge .gruppe.rechts { margin-left: 0; }
  .editor-flaeche { padding: 12px 14px 32px; }
  .tipp { display: none; }
}
.editor-flaeche li > p, .editor-flaeche td > p, .editor-flaeche th > p { margin: 0; }
.editor-flaeche td, .editor-flaeche th { padding: 8px 12px; }
.werkzeuge button[data-cmd="rueck"], .werkzeuge button[data-cmd="vor"] { font-size: 17px; line-height: 1; padding: 4px 9px; }

/* ---------------------------------------------------------------- Dateien */
.anhaenge { margin-top: 36px; }
.anhaenge .liste li { padding: 8px 12px; }
a.anhang { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); }
a.anhang:hover { text-decoration: none; }
a.anhang:hover .anhang-name { color: var(--accent-text); text-decoration: underline; }
.anhang > span { display: flex; flex-direction: column; min-width: 0; }
.anhang-name { font-weight: 600; overflow-wrap: anywhere; }
.vorschau { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex: none; background: var(--surface-2); }
.datei-typ { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); font-size: 11.5px; font-weight: 700; letter-spacing: .03em; }
.anhang-knoepfe { display: flex; align-items: center; gap: 14px; flex: none; font-size: 13.5px; }
.anhang-knoepfe form { margin: 0; }
button.link.leise { color: var(--muted); font-size: 13.5px; }
.inhalt img { display: block; margin: 14px 0; box-shadow: var(--shadow); }
.editor-flaeche img { max-width: 100%; height: auto; border-radius: 8px; }
.editor-flaeche img.ProseMirror-selectednode { outline: 3px solid var(--accent); }
.editor.ziehen { outline: 3px dashed var(--accent); outline-offset: -6px; background: var(--accent-soft); }
.werkzeuge button.laedt { opacity: .6; cursor: progress; }
@media (max-width: 560px) {
  .anhaenge .liste li.mit-knopf { flex-direction: column; align-items: stretch; }
  .anhang-knoepfe { padding-left: 60px; }
}

/* Inhaltsverzeichnis als Schublade unter 1200 px (iPad, Handy) */
.toc-btn { display: none; }
@media (max-width: 1200px) {
  .toc { display: block; position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; height: 100vh; height: 100dvh; width: 290px; max-width: 86vw; max-height: none; align-self: auto;
    padding: 24px 18px; background: var(--surface); border-left: 1px solid var(--border); box-shadow: 0 0 40px rgba(0,0,0,.25);
    transform: translateX(102%); transition: transform .22s ease; }
  .toc.open { transform: none; }
  .toc a { padding: 8px 10px; font-size: 15px; }
  .toc-btn { display: inline-flex; align-items: center; gap: 8px; position: fixed; z-index: 40; right: 18px; bottom: 18px; margin: 0;
    padding: 11px 16px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 620;
    box-shadow: 0 6px 20px rgba(53,80,214,.35); }
  .toc-btn .icon { width: 18px; height: 18px; }
  .backdrop.show { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(8,12,20,.45); }
}

/* ======================================================================
   Design 0.5 (10.11.2026): freundlicher Look nach dem Mockup
   Salbei-Hintergrund, Petrol-Akzent, Outfit für Überschriften, Inter für Text,
   runde Karten, eine Farbe je Bereich (b0–b5). Bewusst nur hell.
   ====================================================================== */
@font-face { font-family: "Outfit"; font-weight: 500; font-display: swap; src: url("fonts/outfit-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 600; font-display: swap; src: url("fonts/outfit-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 700; font-display: swap; src: url("fonts/outfit-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #f2f6f4; --surface: #ffffff; --surface-2: #f2f6f4; --text: #1f2a27; --muted: #61706b; --border: #e1e9e5;
  --accent: #2f7d6d; --accent-soft: #e2f1ec; --accent-text: #22604f;
  --marke: #6a4ee0; --marke-bg: #efebfe;
  --inline-code: #edf2ef; --code-bg: #f4f7f5;
  --shadow: 0 1px 2px rgba(31,42,39,.04), 0 8px 24px rgba(31,42,39,.06);
  --radius: 18px; --sidebar: 268px; --toc: 220px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --kopf: "Outfit", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --b: #2f7d6d; --b-w: #e2f1ec; --b-t: #22604f;
}
.b0 { --b: #2f9e83; --b-w: #dff4ee; --b-t: #1f6d5a; }
.b1 { --b: #5b7cfa; --b-w: #e8edff; --b-t: #3651c4; }
.b2 { --b: #e59a2f; --b-w: #fdf0dc; --b-t: #95600f; }
.b3 { --b: #d0607e; --b-w: #fbe8ee; --b-t: #9c3653; }
.b4 { --b: #8a63d2; --b-w: #f0eafb; --b-t: #5f3fa6; }
.b5 { --b: #2e93b8; --b-w: #e0f2f8; --b-t: #1d6886; }

body { font-family: var(--font); }
h1, h2, h3, .brand-title, .nav-group-title, .toc-title { font-family: var(--kopf); }
h1 { font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
h2, h3 { font-weight: 600; }

/* Raster mit Abstand: Leiste, Inhalt und Verzeichnis als Karten */
@media (min-width: 861px) {
  .layout { gap: 20px; padding: 16px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
  .sidebar { top: 16px; height: calc(100vh - 32px); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
  .content { padding: 0; }
  .page { max-width: 900px; }
}
.sidebar { padding: 20px 14px 22px; }
.brand { padding: 4px 8px 16px; }
.brand-mark { width: 40px; height: 40px; border-radius: 14px; background: var(--accent); font: 700 19px var(--kopf); color: #fff; }
.brand-title { font-size: 17px; font-weight: 600; }
.brand-sub { font-size: 12.5px; }
.sb-suche { border: 0; border-radius: 999px; background: var(--bg); padding: 0 14px; margin-bottom: 12px; }
.sb-suche:focus-within { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.neu-knopf { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 12px; padding: 10px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14.5px; }
.neu-knopf:hover { text-decoration: none; background: var(--accent-text); }
.neu-knopf .icon { width: 17px; height: 17px; }
.nav a { border-radius: 12px; }
.nav-group-title { font-weight: 600; font-size: 12px; letter-spacing: .06em; padding: 14px 10px 6px; }
.baum a { border-radius: 10px; padding: 6px 10px; }
.baum > ul > li > a, .baum > ul > li > details > summary > a { font-weight: 500; }
.baum ul ul { border-left: 2px solid var(--border); margin-left: 13px; }
.baum a.active { background: var(--accent-soft); color: var(--accent-text); }
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 4px; background: var(--b); margin-right: 10px; vertical-align: 0; flex: none; }
.sb-fuss { border-top: 1px solid var(--border); }

/* Artikel als Karte mit getöntem Kopf in der Bereichsfarbe */
.karte-artikel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.karte-artikel .band { margin: 0; padding: 28px 36px 24px; border-bottom: 0; background: linear-gradient(180deg, var(--b-w), var(--surface)); }
.karte-artikel h1 { font-size: 34px; line-height: 1.15; }
.artikel-inhalt { padding: 6px 36px 36px; }
.artikel-inhalt > .inhalt { max-width: 74ch; }
.crumb { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.crumb a { color: var(--muted); }
.bereich-chip { display: inline-flex; padding: 3px 11px; border-radius: 999px; background: var(--surface); color: var(--b-t) !important; font-weight: 600; font-size: 12.5px; }
.marke { background: var(--marke-bg); color: var(--marke); font-size: 12px; padding: 2px 10px; }
.aktionen { margin-top: 18px; }
a.knopf, .aktionen a, button { border-radius: 999px; }
a.knopf.zweit { border-color: var(--border); }
.knoepfe.fuss button, .knoepfe a.knopf { border-radius: 999px; }
.inhalt h2 { font-size: 22px; margin: 30px 0 10px; }
.inhalt blockquote { border: 0; border-radius: 14px; background: #fdf0dc; color: var(--text); padding: 12px 16px; }
.inhalt blockquote::before { content: "Merke"; display: block; font: 600 13px var(--kopf); color: #95600f; margin-bottom: 2px; }
.tabelle { border: 0; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--border); }
.inhalt th { background: var(--bg); }
.inhalt img { border-radius: 14px; }
.anhaenge .liste, .liste { border: 0; border-radius: 16px; background: var(--bg); box-shadow: none; }
.liste li { border-bottom-color: var(--border); }
.liste .punkt { margin-right: 8px; }
.datei-typ { border-radius: 12px; background: var(--surface); }
.erfolg { border-radius: 14px; }

/* Inhaltsverzeichnis als Karte */
@media (min-width: 1201px) {
  .toc { padding: 18px 14px; top: 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); max-height: calc(100vh - 32px); }
  .toc ul { border-left: 0; }
}
.toc a { border-radius: 10px; }
.toc a:hover { background: var(--accent-soft); color: var(--accent-text); }

/* Suche, Formulare, Editor im selben Look */
.treffer { border: 0; border-radius: 16px; }
.karte, .editor-form input[type=text], .editor-form select { border-radius: 14px; }
.werkzeuge { border-radius: 16px 16px 0 0; }
.editor, .quelltext { border-radius: 0 0 16px 16px; }
.toc-btn { background: var(--accent); border-color: var(--accent); box-shadow: 0 6px 20px rgba(47,125,109,.35); }

@media (max-width: 860px) {
  .karte-artikel { border-radius: 16px; }
  .karte-artikel .band, .artikel-inhalt { padding-left: 18px; padding-right: 18px; }
  .karte-artikel h1 { font-size: 27px; }
}

/* Textmarker (==Text==): gelb, wie mit dem Stift über die Zeile gezogen */
.inhalt mark, .editor-flaeche mark {
  background: linear-gradient(transparent 12%, #fff07a 12%, #ffe75c 88%, transparent 88%);
  color: inherit; padding: 0 .12em; border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.werkzeuge .tm { background: linear-gradient(transparent 15%, #fff07a 15%, #ffe75c 85%, transparent 85%); padding: 0 3px; border-radius: 2px; }

/* Freigaben */
.freigabe-neu { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px 14px; align-items: end; margin-bottom: 8px; }
.freigabe-neu label, .karte label { margin: 0; }
.freigabe-neu button { margin: 0; }
.freigabe-neu input, .kopierfeld input { display: block; width: 100%; margin-top: 4px; padding: 9px 12px; font: inherit; color: var(--text);
  background: #fff; border: 1px solid #cdd4de; border-radius: 12px; }
.leser { margin: 16px 0; padding: 16px 18px; border-radius: 16px; background: var(--bg); }
.leser-kopf strong { display: block; font-family: var(--kopf); font-size: 17px; }
.leser .zeit { display: block; color: var(--muted); font-size: 13px; }
.freigabe-baum { margin: 12px 0 4px; padding: 10px 14px; background: var(--surface); border-radius: 12px; max-height: 360px; overflow: auto; }
.freigabe-baum ul { list-style: none; margin: 0; padding-left: 20px; }
.freigabe-baum > ul { padding-left: 0; }
.freigabe-baum label { display: flex; align-items: center; gap: 8px; margin: 3px 0; color: var(--text); font-size: 14.5px; cursor: pointer; }
.freigabe-baum input { width: 17px; height: 17px; accent-color: var(--accent); }
.leser .knoepfe button { margin-top: 8px; }
.leser-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 10px; font-size: 14px; }
.leser-aktionen form { margin: 0; }
.leser-aktionen details summary { cursor: pointer; color: var(--muted); }
.leser-aktionen details button { margin-top: 6px; }
.einladung { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: #fdf0dc; }
.kopierfeld { display: flex; gap: 8px; margin-top: 8px; }
.kopierfeld input { margin: 0; font-size: 13.5px; }
.kopierfeld button { margin: 0; white-space: nowrap; }
@media (max-width: 760px) { .freigabe-neu { grid-template-columns: 1fr; } }

/* ======================================================================
   Lernen (0.10): Stapel, Karteikarten, Quiz, Druckvorschau. Alles unter .lern bzw. lk-…
   ====================================================================== */
.page:has(> .lern) { max-width: 1160px; }
.lern { --ok: #23804f; --ok-bg: #e2f3e9; --warn: #8f5c0e; --warn-bg: #fdf0dc; --bad-bg: #fbe8ea; --bad: #b93a45; }
.lern button { margin-top: 0; }
.lern .band.kompakt { padding-top: 22px; padding-bottom: 18px; }
.lern .band.kompakt h1 { font-size: 28px; }
.lern .artikel-inhalt { padding-top: 10px; }
.lern h2 { font-size: 19px; margin: 0; }
.lern h3 { font-size: 15px; margin: 0; }
a.knopf.klein { padding: 6px 12px; font-size: 13.5px; }
a.knopf.gross { padding: 11px 20px; font-size: 15px; }
a.knopf .icon, .lern button .icon { width: 16px; height: 16px; }
.lk-hilfe { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.lk-hilfe a .icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.lk-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; line-height: 1.5; }
.lk-chip .icon { width: 12px; height: 12px; }
.lk-chip.ki { background: var(--marke-bg); color: var(--marke); }
.lk-chip.warn { background: var(--warn-bg); color: var(--warn); }
.lk-chip.typ { background: var(--b-w); color: var(--b-t); }

/* Formulare */
.lk-form { display: flex; flex-direction: column; gap: 14px; }
.lk-schmal { max-width: 560px; }
.lern .lk-feld { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.lern .lk-feld legend { padding: 0; margin-bottom: 6px; }
.lern .lk-feld input[type=text], .lern .lk-feld textarea, .lern .lk-feld select, .lk-optionen input[type=text] {
  display: block; width: 100%; margin: 0; padding: 9px 12px; font: 400 14.5px/1.5 var(--font); color: var(--text); background: #fff; border: 1px solid #cdd4de; border-radius: 12px; }
.lern .lk-feld textarea { resize: vertical; }
.lern .lk-feld input:focus, .lern .lk-feld textarea:focus, .lern .lk-feld select:focus, .lk-optionen input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.lk-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.lk-knoepfe button.link { margin-left: auto; }
.lk-segment { display: inline-flex; align-self: flex-start; padding: 3px; gap: 2px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); }
.lern .lk-segment label { position: relative; margin: 0; cursor: pointer; }
.lk-segment input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lk-segment label > span { display: block; padding: 6px 15px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); }
.lk-segment input:checked + span { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(31,42,39,.12), 0 2px 6px rgba(31,42,39,.06); }
.lk-segment input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.lern .lk-schalter { position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; font-weight: 400; color: var(--text); cursor: pointer; user-select: none; -webkit-user-select: none; }
.lk-schalter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lk-schiene { width: 36px; height: 22px; border-radius: 999px; background: var(--border); position: relative; flex: none; transition: background .15s; }
.lk-schiene::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(31,42,39,.3); transition: transform .15s; }
.lk-schalter input:checked + .lk-schiene { background: var(--accent); }
.lk-schalter input:checked + .lk-schiene::after { transform: translateX(14px); }
.lk-schalter input:focus-visible + .lk-schiene { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Übersicht */
.lk-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding-top: 8px; }
.lk-kachel { border-radius: 16px; box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; display: flex; flex-direction: column; background: var(--surface); }
.lk-kachel-kopf { display: flex; align-items: center; font-size: 12.5px; color: var(--b-t); font-weight: 600; background: var(--b-w); padding: 9px 18px; }
.lk-kachel-koerper { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lk-kachel h2 { font-size: 18px; }
.lk-kachel h2 a { color: var(--text); }
.lk-zahlen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13.5px; color: var(--muted); }
.lk-zahlen b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.lk-stand { margin: 0; font-size: 13px; color: var(--muted); }
.lk-kachel-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.lk-hinweis { display: flex; gap: 14px; margin-top: 22px; padding: 16px 18px; border-radius: 16px; background: var(--marke-bg); }
.lk-hinweis > .icon { color: var(--marke); width: 22px; height: 22px; margin-top: 1px; }
.lk-hinweis h3 { color: var(--marke); margin-bottom: 4px; }
.lk-hinweis p { margin: 0; font-size: 14px; max-width: 72ch; }
.lk-hinweis.leser { background: var(--accent-soft); }
.lk-hinweis.leser > .icon, .lk-hinweis.leser h3 { color: var(--accent-text); }

/* Stapel */
.lk-raster { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; align-items: start; }
@media (max-width: 1100px) { .lk-raster { grid-template-columns: minmax(0, 1fr); } }
.lk-abschnitt { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 10px; }
.lk-zahl { color: var(--muted); font-weight: 500; }
.lk-liste { list-style: none; margin: 0; padding: 0; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.lk-liste > li { border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.lk-liste > li:first-child { border-top: 0; }
.lk-zeile { display: grid; grid-template-columns: 26px minmax(0, 1fr) 34px; gap: 10px; padding: 12px 12px 12px 14px; align-items: start; }
.lk-zeile:target { background: var(--accent-soft); }
.lk-nr { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; padding-top: 1px; }
.lk-zeile-titel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-weight: 600; }
.lk-zeile-text { font-size: 14.2px; margin-top: 2px; overflow-wrap: anywhere; }
.lk-antworten-kurz { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.lk-antworten-kurz .r { color: var(--ok); font-weight: 500; }
.lk-stift { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--muted); }
.lk-stift:hover { background: var(--bg); color: var(--text); }
.lk-leer { padding: 14px 16px; color: var(--muted); font-size: 14px; }
.lk-editor { padding: 16px; background: var(--bg); }
.lk-editor-titel { font: 600 14px var(--kopf); color: var(--b-t); }
.lk-optionen { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lk-optionen li { display: grid; grid-template-columns: 22px 16px minmax(0, 1fr); gap: 8px; align-items: center; }
.lk-optionen input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--ok); }
.lk-buchstabe { font: 600 13px var(--kopf); color: var(--muted); text-align: center; }
.lk-seite { display: flex; flex-direction: column; gap: 14px; padding-top: 20px; }
.lk-box { border-radius: 16px; box-shadow: inset 0 0 0 1px var(--border); padding: 16px; display: flex; flex-direction: column; gap: 12px; margin: 0; scroll-margin-top: 80px; }
.lk-box p { margin: 0; }
.lk-stand-zeilen { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.lk-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.lk-links a { display: inline-flex; align-items: center; gap: 8px; }
.lk-links a.leise { color: var(--muted); }

/* Karten lernen */
.lk-optionen-leiste { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 14px; }
.lk-buehne { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 14px 0 6px; }
.lk-fortschritt { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lk-fortschritt-zeile { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lk-balken { height: 6px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; width: 100%; }
.lk-balken span { display: block; height: 100%; background: var(--b); border-radius: 999px; transition: width .3s; }
.lk-flip { width: 100%; max-width: 640px; aspect-ratio: 105 / 74; min-height: 270px; perspective: 1400px; cursor: pointer; border-radius: 22px; -webkit-tap-highlight-color: transparent; }
.lk-flip-innen { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.lk-flip.gedreht .lk-flip-innen { transform: rotateY(180deg); }
.lk-kseite { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 22px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(31,42,39,.06), 0 14px 34px rgba(31,42,39,.12), inset 0 0 0 1px var(--border); padding: 18px 24px; display: flex; flex-direction: column; }
.lk-kseite.vorne { background: linear-gradient(180deg, var(--b-w), var(--surface) 60%); }
.lk-kseite.hinten { transform: rotateY(180deg); }
.lk-kseite-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lk-kseite-kopf .bereich-chip { background: var(--surface); }
.lk-kmitte { flex: 1; display: grid; place-items: center; text-align: center; padding: 8px; min-height: 0; }
.lk-begriff { font: 700 clamp(28px, 5vw, 46px)/1.1 var(--kopf); letter-spacing: -.01em; overflow-wrap: anywhere; }
.lk-kseite-fuss { text-align: center; font-size: 12.5px; color: var(--muted); }
.lk-ktext { flex: 1; min-height: 0; overflow: auto; font-size: clamp(15px, 2vw, 18px); line-height: 1.55; padding-top: 12px; white-space: pre-line; overflow-wrap: anywhere; }
.lk-ktext.mittig { display: grid; place-items: center; text-align: center; padding: 8px; }
.lk-klein-begriff { font: 600 14px var(--kopf); color: var(--b-t); }
@keyframes lk-rein { from { transform: translateY(8px); opacity: .5; } to { transform: none; opacity: 1; } }
.lk-flip.neu { animation: lk-rein .25s ease-out; }
.lk-lern-knoepfe { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lern button.gross { padding: 12px 22px; font-size: 15.5px; display: inline-flex; align-items: center; gap: 8px; }
.lern button.nochmal { background: var(--surface); color: var(--warn); border-color: var(--border); }
.lern button.nochmal:hover { background: var(--warn-bg); }
.lk-tastatur { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.lk-ergebnis { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 8px 0 4px; }
.lk-ergebnis p { margin: 0; }
.lk-gross-zahl { font: 700 52px/1 var(--kopf); color: var(--b-t); font-variant-numeric: tabular-nums; }
.lk-ergebnis .lk-balken { max-width: 320px; margin-top: 6px; }
.lk-mittig { justify-content: center; }
@media (prefers-reduced-motion: reduce) { .lk-flip-innen, .lk-balken span { transition: none; } .lk-flip.neu { animation: none; } }

/* Quiz */
.lk-quiz { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-top: 12px; }
.lk-quiz-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.lk-frage { margin: 0; font: 600 clamp(20px, 2.6vw, 24px)/1.3 var(--kopf); text-wrap: balance; white-space: pre-line; }
.lk-hinweis-mehrere { margin: -6px 0 0; font-size: 13.5px; color: var(--b-t); font-weight: 500; }
.lk-antworten { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lern .lk-antwort { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; border-radius: 14px; background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--border); padding: 12px 16px; font: 400 15px/1.45 var(--font); color: var(--text); margin: 0; }
.lern .lk-antwort:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--b); background: var(--bg); }
.lk-bst { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--bg); font: 600 13px var(--kopf); color: var(--muted); flex: none; }
.lern .lk-antwort.gewaehlt { box-shadow: inset 0 0 0 2px var(--b); background: var(--b-w); }
.lk-antwort.gewaehlt .lk-bst { background: var(--b); color: #fff; }
.lern .lk-antwort.richtig { box-shadow: inset 0 0 0 2px var(--ok); background: var(--ok-bg); }
.lk-antwort.richtig .lk-bst { background: var(--ok); color: #fff; }
.lern .lk-antwort.falsch { box-shadow: inset 0 0 0 2px var(--bad); background: var(--bad-bg); }
.lk-antwort.falsch .lk-bst { background: var(--bad); color: #fff; }
.lern .lk-antwort.verpasst { box-shadow: none; outline: 2px dashed var(--ok); outline-offset: -2px; }
.lern .lk-antwort:disabled { cursor: default; opacity: 1; }
.lk-status { margin-left: auto; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.richtig .lk-status, .verpasst .lk-status { color: var(--ok); }
.falsch .lk-status { color: var(--bad); }
.lk-bin { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lern .lk-bin .lk-antwort { justify-content: center; font: 600 17px var(--kopf); padding: 18px; }
.lk-rueck { border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.lk-rueck p { margin: 0; white-space: pre-line; }
.lk-rueck.ok { background: var(--ok-bg); }
.lk-rueck.bad { background: var(--bad-bg); }
.lk-rueck b { font: 600 16px var(--kopf); }
.lk-rueck.ok b { color: var(--ok); }
.lk-rueck.bad b { color: var(--bad); }
.lk-rueck details { font-size: 14px; }
.lk-rueck summary { cursor: pointer; color: var(--accent-text); font-weight: 500; }
.lk-quiz-fuss { display: flex; justify-content: flex-end; gap: 10px; min-height: 8px; }
.lk-start { display: flex; flex-direction: column; gap: 18px; max-width: 560px; width: 100%; margin: 0 auto; }
.lk-typwahl { display: flex; flex-wrap: wrap; gap: 8px; }
.lern .lk-typknopf { border: 0; border-radius: 999px; padding: 8px 14px; margin: 0; background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--border); font: 400 14px var(--font); display: inline-flex; gap: 8px; align-items: center; }
.lern .lk-typknopf[aria-pressed="true"] { background: var(--b-w); box-shadow: inset 0 0 0 1.5px var(--b); color: var(--b-t); font-weight: 600; }
.lk-typknopf .lk-zahl { font-variant-numeric: tabular-nums; }
.lk-falsch-box { border-radius: 14px; box-shadow: inset 0 0 0 1px var(--border); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.lk-falsch-liste { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; font-size: 14.2px; }
.lk-falsch-liste .r { display: block; color: var(--ok); font-weight: 500; font-size: 13.5px; }
.lk-alles { margin: 0; text-align: center; font: 600 16px var(--kopf); color: var(--ok); }

/* Drucken */
.lk-druck { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; padding-top: 10px; }
@media (max-width: 980px) { .lk-druck { grid-template-columns: minmax(0, 1fr); } }
.lk-info { border-radius: 14px; background: var(--bg); padding: 12px 14px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.lk-warn { border-radius: 14px; background: var(--warn-bg); color: var(--warn); padding: 12px 14px; font-size: 13.5px; }
.lk-vorschau { background: var(--bg); border-radius: 16px; padding: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; align-items: start; }
.lk-bogen-rahmen { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lk-bogen-rahmen figcaption { font-size: 12.5px; color: var(--muted); font-weight: 500; }
/* Raster statt absoluter Positionen (die CSP verbietet style-Attribute); Schriftgrößen in cqw = mm / Blattbreite × 100 */
.lk-bogen { display: grid; grid-template-columns: 1fr 1fr; width: 100%; background: #fff; box-shadow: 0 1px 3px rgba(31,42,39,.16), 0 6px 18px rgba(31,42,39,.08); container-type: inline-size; overflow: hidden; }
.lk-bogen.f-A7 { aspect-ratio: 210 / 297; grid-template-rows: repeat(4, 1fr); --fb: 3.024cqw; --ft: 1.848cqw; --fk: 1.008cqw; --pad: 2.381cqw; }
.lk-bogen.f-A6 { aspect-ratio: 297 / 210; grid-template-rows: repeat(2, 1fr); --fb: 3.088cqw; --ft: 1.544cqw; --fk: .832cqw; --pad: 2.357cqw; }
.lk-pk { position: relative; min-width: 0; min-height: 0; padding: var(--pad); display: flex; flex-direction: column; overflow: hidden; color: var(--text); }
.lk-bogen.linien .lk-pk.leer { border: 0; }
.lk-bogen.linien .lk-pk { border: 1px dashed #b3c1ba; }
.lk-bogen .lk-pk.falz, .lk-bogen.linien .lk-pk.falz { border-left: 1.5px dotted var(--accent); }
.lk-pk-kopf { font-size: var(--fk); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.lk-pk-kopf::before { content: ""; display: inline-block; width: .8em; height: .8em; border-radius: .2em; background: var(--b); margin-right: .45em; vertical-align: -.08em; }
.lk-pk-begriff { flex: 1; display: grid; place-items: center; text-align: center; font: 700 var(--fb)/1.15 var(--kopf); overflow-wrap: anywhere; }
.lk-pk-text { flex: 1; min-height: 0; overflow: hidden; font-size: var(--ft); line-height: 1.38; padding-top: calc(var(--fk) * .9); }
.lk-pk-nr { position: absolute; right: var(--pad); bottom: calc(var(--pad) * .55); font-size: var(--fk); color: var(--muted); font-variant-numeric: tabular-nums; }
.lk-pk.zu-lang { background: var(--bad-bg); }
.lk-pk-warn { position: absolute; left: var(--pad); bottom: calc(var(--pad) * .55); font-size: var(--fk); font-weight: 600; color: var(--bad); }

/* Block auf der Wiki-Seite */
.lk-seitenblock { margin-top: 36px; }
.lk-seitenblock h2 { font-size: 22px; margin: 0 0 10px; }
.lk-mini { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 16px; background: var(--bg); margin-bottom: 8px; }
.lk-mini .zeit { display: block; color: var(--muted); font-size: 13px; }
.lk-mini-knoepfe { display: flex; gap: 8px; }
.lk-mini-knoepfe .knopf { padding: 6px 12px; font-size: 13.5px; }
@media (max-width: 640px) {
  .lern .band.kompakt h1 { font-size: 25px; }
  .lk-zeile { grid-template-columns: 22px minmax(0, 1fr) 32px; padding-left: 10px; }
}
.lk-hilfe.warn { color: var(--warn); }
.lk-mittig-text { text-align: center; margin: 0; }
@media (hover: none) { .lk-tastatur { display: none; } }

/* ======================================================================
   Übersicht als Dashboard (0.11): Kopf mit Gruß und Kennzahlen, Kacheln auf dem Salbei-Grund
   ====================================================================== */
.ds { display: flex; flex-direction: column; gap: 16px; }
.ds h1 { font-size: 34px; line-height: 1.15; margin: 0; }
.ds h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0; }
.ds h2 .icon { color: var(--muted); width: 18px; height: 18px; }
.ds-kopf { border-radius: var(--radius); background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); box-shadow: var(--shadow); padding: 28px 32px 24px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 24px; align-items: flex-end; }
.ds-kopf-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ds-datum { margin: 0; font-size: 14px; color: var(--muted); }
.ds-zahlen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ds-zahl { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); font-size: 13.5px; color: var(--muted); }
.ds-zahl b { font: 600 15px var(--kopf); color: var(--text); font-variant-numeric: tabular-nums; }
.ds-kopf-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.ds-reihe { display: grid; gap: 16px; align-items: start; }
.ds-reihe.breit-schmal { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.ds-reihe.halb { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .ds-reihe.breit-schmal, .ds-reihe.halb { grid-template-columns: minmax(0, 1fr); } }
.ds-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ds-box-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.ds-box-kopf > a { font-size: 13.5px; }
.ds-hilfe { margin: 0; font-size: 12.5px; color: var(--muted); }
.ds-leer { margin: 0; color: var(--muted); font-size: 14.5px; }
.ds .zeit { display: block; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ds .zeit a { color: var(--muted); }
.lern a.knopf.klein .icon { width: 15px; height: 15px; }
.lern button.klein { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; }
.lern button.klein .icon { width: 15px; height: 15px; }
.lk-chip.ok { background: var(--ok-bg); color: var(--ok); }
.lk-chip.bad { background: var(--bad-bg); color: var(--bad); }

/* Weiterlernen */
.ds-lernliste, .ds-ereignisse, .ds-geaendert, .ds-aufgaben, .ds-markierungen, .ds-freigegeben { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ds-lernliste > li, .ds-ereignisse > li, .ds-geaendert > li, .ds-aufgaben > li, .ds-markierungen > li, .ds-freigegeben > li { border-top: 1px solid var(--border); }
.ds-lernliste > li:first-child, .ds-ereignisse > li:first-child, .ds-geaendert > li:first-child, .ds-aufgaben > li:first-child, .ds-markierungen > li:first-child, .ds-freigegeben > li:first-child { border-top: 0; padding-top: 2px; }
.ds-lernliste > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 0; }
.ds-lern-titel { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-weight: 600; }
.ds-lern-titel a { color: var(--text); }
.ds-lern-ort { display: flex; align-items: center; font-size: 12.5px; color: var(--b-t); font-weight: 500; margin-top: 2px; }
.ds-lern-ort .punkt, .ds-freigegeben .punkt { width: 8px; height: 8px; border-radius: 3px; margin-right: 6px; }
.ds-lern-stand { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ds-lern-knoepfe { display: flex; gap: 6px; }
.ds-meter { -webkit-appearance: none; appearance: none; width: 110px; height: 6px; border: 0; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.ds-meter::-webkit-meter-bar { background: transparent; border: 0; border-radius: 999px; height: 6px; }
.ds-meter::-webkit-meter-optimum-value { background: var(--ok); border-radius: 999px; }
.ds-meter::-webkit-meter-suboptimum-value { background: var(--warn); border-radius: 999px; }
.ds-meter::-webkit-meter-even-less-good-value { background: var(--bad); border-radius: 999px; }
.ds-meter.gut::-moz-meter-bar { background: var(--ok); }
.ds-meter.mittel::-moz-meter-bar { background: var(--warn); }
.ds-meter.schwach::-moz-meter-bar { background: var(--bad); }
@media (max-width: 560px) { .ds-lernliste > li { grid-template-columns: minmax(0, 1fr); } }

/* Karte des Tages */
.ds-flip { display: block; width: 100%; max-width: 100%; aspect-ratio: 105 / 74; min-height: 200px; perspective: 1200px; margin: 0; padding: 0; border: 0; border-radius: 18px;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ds-flip-innen { display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.ds-flip.gedreht .ds-flip-innen { transform: rotateY(180deg); }
.ds-seite { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 18px; padding: 14px 18px; display: flex; flex-direction: column;
  background: var(--surface); box-shadow: 0 1px 2px rgba(31,42,39,.06), 0 10px 26px rgba(31,42,39,.1), inset 0 0 0 1px var(--border); }
.ds-seite.vorne { background: linear-gradient(180deg, var(--b-w), var(--surface) 65%); }
.ds-seite.hinten { transform: rotateY(180deg); }
.ds-seite-kopf { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 400; }
.ds-seite-kopf b { color: var(--b-t); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-begriff { flex: 1; display: grid; place-items: center; text-align: center; font: 700 clamp(24px, 3vw, 32px)/1.15 var(--kopf); letter-spacing: -.01em; overflow-wrap: anywhere; }
.ds-erkl { display: block; flex: 1; min-height: 0; overflow: auto; font-size: 14.5px; font-weight: 400; line-height: 1.5; padding-top: 8px; white-space: pre-line; }
.ds-seite-fuss { display: block; text-align: center; font-size: 12px; color: var(--muted); font-weight: 400; }
.ds-karte-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .ds-flip-innen { transition: none; } }

/* KI-Assistent, zuletzt geändert */
.ds-ereignisse > li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 10px 0; }
.ds-ereignis-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--marke-bg); color: var(--marke); }
.ds-ereignis-icon .icon { width: 17px; height: 17px; }
.ds-ereignis-was { font-size: 12.5px; color: var(--muted); }
.ds-ereignis-titel { font-weight: 600; color: var(--text); display: inline-flex; align-items: center; }
.ds-ereignis-detail { font-size: 13px; color: var(--muted); }
.ds-geaendert > li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; }
.ds-geaendert .punkt { margin: 6px 0 0; }
.ds-geaendert-text { flex: 1; min-width: 0; }
.ds-geaendert-text > a { color: var(--text); font-weight: 500; }

/* Bereiche */
.ds-bereiche { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ds-bereiche.sp-1 { grid-template-columns: minmax(0, 1fr); }
.ds-bereiche.sp-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ds-bereiche.sp-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .ds-bereiche.sp-3, .ds-bereiche.sp-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .ds-bereiche.ds-bereiche { grid-template-columns: minmax(0, 1fr); } }
.ds-bereich { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 16px; background: var(--b-w); color: var(--text); }
.ds-bereich:hover { text-decoration: none; box-shadow: inset 0 0 0 2px var(--b); }
.ds-bereich-name { display: flex; align-items: center; font: 600 16px var(--kopf); color: var(--b-t); }
.ds-bereich-zahlen { font-size: 13px; }
.ds-bereich-zuletzt { font-size: 12.5px; color: var(--muted); }

/* Für dich freigegeben, Aufgaben, Markierungen */
.ds-freigegeben > li { padding: 9px 0; }
.ds-freigegeben ul { list-style: none; margin: 6px 0 0 18px; padding: 0 0 0 10px; border-left: 2px solid var(--border); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.ds-aufgaben > li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; transition: opacity .3s; }
.ds-aufgaben input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.lern .ds-aufgaben label { flex: 1; min-width: 0; margin: 0; cursor: pointer; font-size: 15px; color: var(--text); }
.ds-aufgaben li.erledigt { opacity: .5; }
.ds-aufgaben li.erledigt .ds-aufgabe-text { text-decoration: line-through; }
.ds-markierungen > li { padding: 10px 0; display: flex; flex-direction: column; gap: 3px; }
.ds mark, .ds-markseite mark { background: linear-gradient(transparent 12%, #fff07a 12%, #ffe75c 88%, transparent 88%); color: inherit; padding: 0 .12em; border-radius: 3px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ds-markseite { margin: 18px 0 8px; }
.ds-markseite h2 { display: flex; align-items: center; font-size: 18px; margin: 0 0 4px; }
.ds-markseite h2 a { color: var(--b-t); }
@media (max-width: 640px) {
  .ds-kopf { padding: 22px 20px 20px; }
  .ds h1 { font-size: 27px; }
  .ds-box { padding: 18px 18px 20px; }
}

/* Konto (Plattform-Modus): Passwort ändern, Export, Wiki löschen */
.unter-formular { margin: 16px 0 0; }
.konto-daten { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; margin: 0 0 8px; }
.konto-daten dt { color: var(--muted); }
.konto-daten dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.konto h2 { margin-top: 34px; }
.konto-form { display: grid; gap: 12px; max-width: 420px; }
.konto-form label { margin: 0; }
.konto-form input[type=text] { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.konto-form button { margin-top: 4px; }
button.mit-icon { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
button.mit-icon .icon { width: 17px; height: 17px; }
.gefahrzone { border: 1px solid #f0c9c9; border-radius: 14px; padding: 4px 18px; background: #fffafa; }
.gefahrzone[open] { padding-bottom: 18px; }
.gefahrzone summary { cursor: pointer; padding: 12px 0; font-weight: 620; color: var(--bad); }
/* Rechtliches (nur Plattform-Modus, src/rechtstexte.php) */
.recht-links { font-size: 12px; color: var(--muted); }
.recht-links a { color: var(--muted); }
.recht-links a:hover { color: var(--text); }
.sb-recht { margin-top: 8px; line-height: 1.6; }
.einfach-fuss { text-align: center; padding: 0 16px 32px; }
label.zustimmung, .karte label.zustimmung { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 4px; color: var(--text); font-size: 14px; line-height: 1.5; cursor: pointer; }
label.zustimmung input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
/* Mit KI verbinden (nur Plattform-Modus, src/verbinden.php): Seite /verbinden und Hinweis auf der Übersicht */
.ki-adresse { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }
.ki-adresse input { flex: 1 1 260px; min-width: 0; padding: 10px 12px; font: 15px/1.4 var(--mono); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.ki-adresse input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ki-adresse button { margin: 0; white-space: nowrap; }
.ki-hinweis { background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.ki-hinweis h2 .icon { color: var(--accent); }
.ki-hinweis .ki-text { margin: 0; }
.ki-leise { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.ki-verbinden .inhalt h2 { margin: 30px 0 10px; }   /* .lern h2 setzt sonst 0 */
.ki-verbinden .ki-status + h2 { margin-top: 18px; }
.ki-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.ki-status .icon { width: 16px; height: 16px; }
.ki-status.an { background: #dff4ee; color: #1d6b58; }
.ki-status.aus { background: #fdf0dc; color: #8a5a00; }
.ki-kurz { border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; margin: 10px 0; background: var(--surface); }
.ki-kurz summary { cursor: pointer; padding: 12px 0; font-weight: 620; }
.ki-kurz[open] { padding-bottom: 4px; }
.ki-kurz ol { margin: 0 0 8px; padding-left: 22px; }
.ki-kurz li { margin: 6px 0; }
.hl-ui { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: .93em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ki-prompt { display: grid; gap: 10px; justify-items: start; margin: 10px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.ki-prompt p { margin: 0; }
.ki-prompt p::before { content: "„"; } .ki-prompt p::after { content: "“"; }
.ki-prompt button { margin: 0; padding: 6px 14px; font-size: 14px; }
/* Plus (nur Plattform-Modus, src/abo_web.php) */
.plus-liste { margin: 0 0 22px; padding-left: 20px; line-height: 1.6; }
.plus-form { display: grid; gap: 6px; max-width: 560px; }
.plus-wahlen { border: 0; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plus-wahlen legend { font-weight: 620; margin-bottom: 10px; padding: 0; }
.plus-wahl { display: grid; gap: 2px; border: 1.5px solid var(--border); border-radius: 14px; padding: 14px 16px 14px 44px; position: relative; cursor: pointer; margin: 0; background: var(--surface); }
.plus-wahl input { position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.plus-wahl:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.plus-wahl-titel { font-weight: 650; }
.plus-wahl-preis { font-size: 20px; font-weight: 700; color: var(--accent-text); }
.plus-wahl-zusatz { font-size: 13px; color: var(--muted); }
.plus-form .hint, .konto .hint { padding-left: 0; padding-right: 0; }
.plus-form button[type=submit] { margin-top: 10px; }
meter.speicher-balken { display: block; width: 100%; max-width: 320px; height: 10px; margin-top: 6px; }
.wiki-liste { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; max-width: 640px; }
.wiki-liste li { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.wiki-liste form { margin: 0; }
.wiki-liste button { padding: 6px 12px; font-size: 13.5px; }
/* KI-Helfer im Konto (src/ki_punkte.php): Buchungen als Zahlen */
.ki-buchungen { overflow-x: auto; max-width: 640px; margin: 8px 0 14px; border: 1px solid var(--border); border-radius: 12px; }
.ki-buchungen table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ki-buchungen th, .ki-buchungen td { padding: 7px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.ki-buchungen th { background: var(--surface-2); font-weight: 650; color: var(--muted); }
.ki-buchungen tr:last-child td { border-bottom: 0; }
.ki-buchungen .ki-zahl { text-align: right; font-variant-numeric: tabular-nums; }
.knopfreihe .marke { align-self: center; }
form.knopfreihe > button { margin-top: 0; }
.wiki-neu { margin: 0 0 18px; }
.wiki-neu summary { cursor: pointer; color: var(--accent-text); font-weight: 600; padding: 6px 0; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 4px; }
.knopfreihe form { margin: 0; }
.konto-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.konto-form legend { font-weight: 620; margin-bottom: 4px; padding: 0; }
.konto-form .pl-check { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-weight: 400; cursor: pointer; }
.konto-form .pl-check input { margin-top: 3px; accent-color: var(--accent); }
.konto-form textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; border: 1px solid var(--border); border-radius: 10px; }
@media (max-width: 640px) { .plus-wahlen { grid-template-columns: 1fr; } }
/* Plus: Widerruf hervorgehoben (§ 356a BGB), Erklärung mit Inhalt, Endtermin, Links zu Kündigen/Widerrufen */
.widerruf-kasten { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 14px 0; padding: 14px 16px; border: 1.5px solid var(--accent); border-radius: 14px; background: var(--surface); }
.widerruf-kasten p { margin: 0; flex: 1 1 260px; }
.konto-form input[type="date"] { display: block; margin: 2px 0 0 26px; padding: 8px 10px; font: inherit; border: 1px solid var(--border); border-radius: 10px; }
.erklaerung { margin: 12px 0 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.erklaerung-satz { margin: 0 0 10px; font-weight: 620; }
.erklaerung-daten { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; margin: 0; font-size: 14px; }
.erklaerung-daten dt { color: var(--muted); }
.erklaerung-daten dd { margin: 0; overflow-wrap: anywhere; }
.recht-links a.recht-vertrag { color: var(--accent-text); font-weight: 620; }
@media (max-width: 640px) { .erklaerung-daten { grid-template-columns: 1fr; } .erklaerung-daten dd { margin-bottom: 6px; } }

/* ======================================================================
   Plus auf der Übersicht (src/tarif.php): Box „Dein Tarif“ und Zeile in der Seitenleiste
   ====================================================================== */
.tarif { container-type: inline-size; }
.tarif .ds-box-kopf form { margin: 0; }
.tarif .ds-box-kopf button.link.leise { margin: 0; }
.tarif h2 .icon { color: var(--accent); }
.tarife { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 12px; }
@container (max-width: 560px) { .tarife { grid-template-columns: minmax(0, 1fr); } }
.tk { border-radius: 14px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tk.aktuell { box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); }
.tk.plus { background: linear-gradient(165deg, var(--accent-soft), var(--surface) 75%); box-shadow: inset 0 0 0 1px var(--border); }
.tk-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-name { font: 600 17px var(--kopf); }
.tk-preis { display: flex; flex-direction: column; gap: 1px; }
.tk-gross { font: 700 26px/1.1 var(--kopf); letter-spacing: -.01em; }
.tk-gross small { font: 500 14px var(--font); color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.tk-zusatz { font-size: 12.5px; color: var(--muted); }
.tk-oder { margin: 0; font-size: 13px; border-top: 1px dashed var(--border); padding-top: 8px; }
.tk-oder strong { font-weight: 600; }
.tk ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.tk li { display: flex; gap: 8px; align-items: flex-start; }
.tk li .icon { width: 15px; height: 15px; color: var(--accent); margin-top: 3px; }
.tk-speicher { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.tk-speicher.voll { color: var(--warn, #8f5c0e); font-weight: 500; }
.tk-knopf { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tarif-warn { display: flex; gap: 9px; align-items: flex-start; margin: 0; background: #fdf0dc; color: #6b4500; border-radius: 11px; padding: 9px 12px; font-size: 13.5px; }
.tarif-warn .icon { color: #8f5c0e; margin-top: 2px; }
/* Speicherbalken (meter) in Box und Leiste, Farben wie im Lernen */
.tk-meter, .sb-meter { -webkit-appearance: none; appearance: none; display: block; width: 100%; border: 0; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.tk-meter { height: 7px; }
.sb-meter { height: 5px; }
.tk-meter::-webkit-meter-bar, .sb-meter::-webkit-meter-bar { background: transparent; border: 0; border-radius: 999px; height: 100%; }
.tk-meter::-webkit-meter-optimum-value, .sb-meter::-webkit-meter-optimum-value { background: var(--accent); border-radius: 999px; }
.tk-meter::-webkit-meter-suboptimum-value, .sb-meter::-webkit-meter-suboptimum-value { background: #c98a1c; border-radius: 999px; }
.tk-meter::-webkit-meter-even-less-good-value, .sb-meter::-webkit-meter-even-less-good-value { background: #b93a45; border-radius: 999px; }
.tk-meter::-moz-meter-bar, .sb-meter::-moz-meter-bar { background: var(--accent); border-radius: 999px; }
.tk-meter:-moz-meter-sub-optimum::-moz-meter-bar, .sb-meter:-moz-meter-sub-optimum::-moz-meter-bar { background: #c98a1c; }
.tk-meter:-moz-meter-sub-sub-optimum::-moz-meter-bar, .sb-meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: #b93a45; }
.sb-tarif { margin: 6px 0 2px; padding: 10px 11px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.sb-tarif-kopf { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.sb-tarif-kopf strong { color: var(--text); font-weight: 600; }
.sb-tarif-links { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.sb-tarif-links form { margin: 0; }
.sb-tarif-links button.link { font-size: 13px; }

/* ======================================================================
   KI-Helfer (nur Plattform-Modus, src/ki_oberflaeche.php, public/assets/ki.js)
   KI erkennbar an Violett (--marke), Aktionen und Knöpfe bleiben Petrol. Panel am Desktop rechts, unter 861 px von unten.
   ====================================================================== */
:root { --ki-rand: #d9d0fb; --ki-hell: #f8f6ff; --ki-text: #4a33b0; --ki-ok: #1f7a4d; --ki-ok-bg: #e3f4ea; --ki-warn: #6b4500; --ki-warn-bg: #fff3d4; --ki-warn-rand: #f1d79a; }
.aktionen button.knopf { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-weight: 620; font-size: 14px; padding: 7px 12px; border-radius: 999px; }
.aktionen button.knopf .icon { width: 16px; height: 16px; }
.knopf.ki { background: var(--marke-bg); color: var(--marke); border-color: var(--ki-rand); }
.knopf.ki:hover { border-color: var(--marke); }
.knopf.ki.aus { background: var(--surface); color: var(--muted); border-color: var(--border); }
a.knopf.ki { display: inline-flex; align-items: center; gap: 7px; }
.sb-neu { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin: 0 0 12px; }
.sb-neu .neu-knopf { margin: 0; }
.neu-ki { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 999px; background: var(--marke-bg); color: var(--marke); font-weight: 600; font-size: 14px; }
.neu-ki:hover { text-decoration: none; background: #e4dcfd; }
.neu-ki .icon { width: 15px; height: 15px; }
.ki-neu-hinweis { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; padding: 9px 14px; border-radius: 12px; background: var(--marke-bg); color: var(--ki-text); font-size: 14px; }
.ki-neu-hinweis .icon { color: var(--marke); width: 16px; height: 16px; }
.ki-neu-hinweis a { color: var(--ki-text); font-weight: 600; text-decoration: underline; }

/* Kennzeichnung an der Seite (ki_hinweis_html) */
p.hint.ki-hinweis { display: flex; gap: 10px; align-items: flex-start; margin: 0 36px 6px; padding: 10px 14px; border-radius: 12px; background: var(--marke-bg); color: var(--ki-text); font-size: 14px; }
p.hint.ki-hinweis .icon { width: 17px; height: 17px; color: var(--marke); margin-top: 2px; }
.ds-ereignis-icon.fremd { background: var(--surface-2); color: var(--muted); }
.ds-ereignis-was .lk-chip { margin-left: 4px; }
.tk li.ki-li { background: var(--marke-bg); border-radius: 10px; padding: 5px 8px; margin: 2px -4px 0; }
.tk li.ki-li .icon { color: var(--marke); }

/* Funke an Überschriften: Abschnitt umformulieren */
.inhalt .ki-ueber { display: inline-grid; place-items: center; width: 30px; height: 30px; margin: 0 0 0 6px; padding: 0; vertical-align: middle; border: 0; border-radius: 9px;
  background: transparent; color: var(--marke); opacity: .4; }
.inhalt .ki-ueber .icon { width: 15px; height: 15px; }
.inhalt h2:hover .ki-ueber, .inhalt h3:hover .ki-ueber, .inhalt .ki-ueber:focus-visible { opacity: 1; background: var(--marke-bg); }
@media (hover: none) { .inhalt .ki-ueber { opacity: .85; } }
@media print { .ki-ueber, .ki-panel, .ki-chip, .ki-abdunkeln { display: none !important; } }

/* Panel */
.ki-panel { position: fixed; z-index: 70; top: 16px; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 16px; width: 400px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: 0 12px 48px rgba(31,42,39,.22); overflow: hidden; }
.ki-panel[hidden] { display: none !important; }
.ki-abdunkeln { display: none; }
.ki-griff { display: none; }
.ki-kopf { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.ki-zeichen { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--marke-bg); color: var(--marke); flex: none; }
.ki-kopf-text { flex: 1; min-width: 0; }
.ki-kopf-text h2 { margin: 0; font-size: 17px; line-height: 1.2; outline: none; }
.ki-kopf-text span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ki-panel button { margin: 0; }
.ki-zu { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); flex: none; }
.ki-zu:hover { color: var(--text); border-color: var(--muted); }
.ki-rumpf { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 18px 18px; }
.ki-ansicht { display: flex; flex-direction: column; gap: 12px; }
.ki-ansicht[hidden] { display: none; }
.ki-ansicht p { margin: 0; }
.ki-fuss { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.ki-fuss .icon, .ki-fuss-inline .icon { width: 15px; height: 15px; color: var(--marke); margin-top: 2px; }
.ki-fuss-inline { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13px; color: var(--muted); }
.ki-stand { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; background: var(--surface-2); border-radius: 12px; padding: 9px 12px; font-size: 13.5px; }
.ki-stand strong { font-size: 15.5px; font-variant-numeric: tabular-nums; }
.ki-stand a { font-size: 13px; }
.ki-stoerung, .ki-panel .warnung, .ki-form .warnung { margin: 0; }
.ki-gruppe-titel { margin: 4px 0 -4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ki-aktionen { display: flex; flex-direction: column; gap: 8px; }
.ki-aktion { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; margin: 0; padding: 10px 12px; text-align: left;
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; cursor: pointer; }
.ki-aktion:hover { border-color: var(--ki-rand); background: var(--ki-hell); text-decoration: none; }
.ki-aktion strong { display: block; font-size: 14.5px; font-weight: 600; }
.ki-aktion small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.ki-aktion-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.ki-punkte { font-size: 12px; font-weight: 600; color: var(--marke); background: var(--marke-bg); border-radius: 999px; padding: 2px 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ki-punkte:empty { display: none; }
.ki-zurueck { align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--accent-text); font-weight: 500; font-size: 14px; }
.ki-zurueck .icon { width: 16px; height: 16px; }
.ki-titel { margin: 0; font-size: 18px; line-height: 1.25; outline: none; overflow-wrap: anywhere; }
.ki-ziel { font-size: 13px; color: var(--muted); margin-top: -6px !important; }
.ki-klein { font-size: 12.5px; color: var(--muted); margin: 0; }
.ki-form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.ki-feld { display: block; margin: 0; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.ki-eingabe { display: block; width: 100%; margin: 4px 0 0; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--text); background: #fff; border: 1px solid #cdd8d3; border-radius: 11px; }
.ki-eingabe:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea.ki-eingabe { resize: vertical; line-height: 1.55; min-height: 220px; }
.ki-check { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 14px; color: var(--text); }
.ki-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.ki-wahlen { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.ki-wahlen legend { padding: 0; margin: 0 0 6px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.ki-wahl { position: relative; display: block; margin: 0; padding: 10px 10px 10px 36px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; color: var(--text); font-size: 13.5px; }
.ki-wahl input { position: absolute; left: 11px; top: 12px; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.ki-wahl strong { display: block; font-size: 14px; }
.ki-wahl small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.ki-wahl:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ki-wahl:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.ki-zahlen { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.ki-zahlen[hidden] { display: none; }
.ki-zahl-feld label { margin: 0 0 4px; font-size: 13.5px; font-weight: 500; }
.ki-stepper { display: inline-flex; align-items: stretch; border: 1px solid #cdd8d3; border-radius: 11px; overflow: hidden; background: #fff; }
.ki-stepper button { width: 42px; padding: 0; border: 0; border-radius: 0; background: var(--surface-2); color: var(--text); font-size: 19px; font-weight: 500; }
.ki-stepper input { width: 58px; border: 0; text-align: center; font: inherit; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 8px 0; -moz-appearance: textfield; appearance: textfield; }
.ki-stepper input::-webkit-outer-spin-button, .ki-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ki-schaetzung { display: flex; flex-direction: column; gap: 4px; padding: 11px 14px; border-radius: 14px; background: var(--ki-hell); border: 1px solid var(--ki-rand); font-size: 13.5px; }
.ki-schaetzung[hidden], .ki-schaetzung:empty { display: none; }
.ki-schaetzung-zeile { display: flex; justify-content: space-between; gap: 10px; }
.ki-schaetzung-zeile strong { font-variant-numeric: tabular-nums; }
.ki-schaetzung p { color: var(--muted); font-size: 12.5px; }
.ki-schaetzung.reicht-nicht { background: var(--ki-warn-bg); border-color: var(--ki-warn-rand); }
.ki-schaetzung.reicht-nicht p { color: var(--ki-warn); }
.ki-warnung { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.ki-warnung[hidden] { display: none; }
.ki-warnung .icon { flex: none; margin-top: 2px; }
.ki-warnung p { margin: 0 0 6px; }
.ki-warnung .knopfreihe { margin-top: 6px; align-items: center; }
.ki-warnung button { padding: 6px 12px; font-size: 13.5px; }
.ki-warnung button.link { color: #6b4500; text-decoration: underline; padding: 0; }
.fund { background: #fde3a7; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.ki-form .fehler { margin: 0; font-size: 14px; }
.ki-form .fehler[hidden] { display: none; }
.ki-form .fehler a, .ki-form .fehler button.link { color: var(--bad); font-weight: 600; text-decoration: underline; }
.ki-start { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 2px 0 0; padding: 12px 16px; border-radius: 999px; font-size: 15px; }
.ki-start:disabled, .ki-panel button:disabled { opacity: .5; cursor: default; }
.ki-panel .knopfreihe, .ki-ergebnis .knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; }
.ki-panel .knopfreihe button, .ki-panel .knopfreihe .knopf { padding: 8px 14px; font-size: 14px; border-radius: 999px; }
.ki-panel button.zweit { border-color: var(--border); }
.ki-panel button.leise { color: var(--muted); }
.ki-panel a.knopf { display: inline-flex; align-items: center; gap: 7px; font-weight: 620; border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.ki-panel a.knopf.zweit { background: var(--surface); color: var(--accent-text); border-color: var(--border); }
.ki-panel a.knopf:hover { text-decoration: none; }

/* Lauf */
.ki-lauf-kopf { display: flex; gap: 12px; align-items: center; }
.ki-lauf-kopf small { display: block; font-size: 12.5px; color: var(--muted); }
.ki-lauf-status { font-weight: 600; font-size: 15px; }
.ki-spinner { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 3px solid var(--marke-bg); border-top-color: var(--marke); animation: ki-drehen 1s linear infinite; }
@keyframes ki-drehen { to { transform: rotate(360deg); } }
.ki-balken { position: relative; height: 6px; border-radius: 999px; background: var(--marke-bg); overflow: hidden; }
.ki-balken::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; border-radius: 999px; background: var(--marke); animation: ki-laufen 1.6s ease-in-out infinite; }
@keyframes ki-laufen { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .ki-spinner { animation-duration: 4s; } .ki-balken::after { animation: none; width: 100%; opacity: .35; } }
.ki-schritte { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ki-schritte li { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: 14px; }
.ki-schritte li .icon { width: 17px; height: 17px; margin-top: 2px; color: var(--ki-ok); }
.ki-schritte li.nochmal { color: var(--muted); }
.ki-schritte li.nochmal .icon { color: #8f5c0e; }
.ki-bisher { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ki-bisher strong { color: var(--text); }
.ki-weiter { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 9px 12px; }

/* Ergebnis */
[data-ki-ergebnis] { display: flex; flex-direction: column; gap: 12px; }
.ki-ergebnis-kopf { display: flex; gap: 10px; align-items: center; }
.ki-ok { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ki-ok-bg); color: var(--ki-ok); }
.ki-ok.grenze { background: var(--ki-warn-bg); color: #8f5c0e; }
.ki-ok.fehler { background: var(--bad-bg); color: var(--bad); }
.ki-ziel-karte { display: flex; gap: 12px; align-items: center; padding: 11px 13px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); }
.ki-ziel-karte:hover { border-color: var(--accent); text-decoration: none; }
.ki-ziel-karte strong { display: block; overflow-wrap: anywhere; }
.ki-ziel-karte small { color: var(--muted); font-size: 12.5px; }
.ki-ziel-karte.weg { opacity: .6; }
.ki-nachricht { font-size: 14px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.ki-nachricht-titel { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.ki-antwort { font-size: 14.5px; background: var(--ki-hell); border-radius: 12px; padding: 12px 14px; }
.ki-nachricht.inhalt > div > :first-child, .ki-antwort > div > :first-child, .ki-vergleich .inhalt > div > :first-child { margin-top: 0; }
.ki-nachricht.inhalt > div > :last-child, .ki-antwort > div > :last-child, .ki-vergleich .inhalt > div > :last-child { margin-bottom: 0; }
.ki-pruefen { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--ki-text); background: var(--marke-bg); border-radius: 12px; padding: 9px 12px; }
.ki-pruefen .icon { width: 16px; height: 16px; color: var(--marke); margin-top: 2px; }
.ki-melden { font-size: 13px; color: var(--muted); margin-top: -4px !important; }
.ki-panel .erfolg { margin: 0; }
.ki-vorschlag { display: flex; flex-direction: column; gap: 10px; }
.ki-vergleich { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ki-vergleich > div { min-width: 0; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.ki-vergleich .alt { background: var(--surface-2); color: var(--muted); }
.ki-vergleich .neu { background: var(--ki-hell); border: 1px solid var(--ki-rand); }
.ki-vergleich h4 { margin: 0 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ki-vergleich[data-zeige="neu"] .alt, .ki-vergleich[data-zeige="alt"] .neu { display: none; }
.ki-reiter { display: inline-flex; align-self: flex-start; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.ki-reiter button { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 7px 15px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.ki-reiter button .icon { width: 16px; height: 16px; }
.ki-reiter button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(31,42,39,.12); }
.ki-verlauf { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.ki-verlauf li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.ki-verlauf li > div { min-width: 0; }
.ki-verlauf small { display: block; font-size: 12px; color: var(--muted); }
.ki-verlauf button.link { font-size: 13.5px; white-space: nowrap; }

/* Schwebender Hinweis während eines Laufs */
.ki-chip { position: fixed; z-index: 45; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 10px;
  margin: 0; padding: 9px 16px 9px 10px; border-radius: 999px; background: var(--surface); color: var(--text); border: 1px solid var(--ki-rand);
  box-shadow: 0 6px 22px rgba(106,78,224,.25); font-size: 14px; font-weight: 600; }
.ki-chip[hidden] { display: none; }
.ki-chip .ki-spinner { width: 22px; height: 22px; border-width: 3px; }
.ki-chip .ki-ok { width: 24px; height: 24px; }
.ki-chip .ki-ok .icon { width: 14px; height: 14px; }
.ki-chip.fertig { border-color: #b8e2c9; box-shadow: 0 6px 22px rgba(31,122,77,.22); }
.toc-btn ~ .ki-chip { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

/* Neue Seite mit KI (/neu/ki) */
.ki-seite-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.ki-seite-form h1 { display: flex; align-items: center; gap: 10px; margin: 0; }
.ki-seite-form h1 .icon { width: 26px; height: 26px; color: var(--marke); }
.ki-lead { margin: 0; color: var(--muted); max-width: 70ch; }
.ki-reiter-inhalt { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ki-reiter-inhalt[hidden] { display: none; }
.ki-unter { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.ki-fotos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ki-fotos:empty { display: none; }
.ki-foto { position: relative; aspect-ratio: 3 / 4; max-width: 100%; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.ki-foto img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; border-radius: 0; box-shadow: none; }
.ki-foto-name { font-size: 12px; color: var(--muted); padding: 6px; overflow-wrap: anywhere; text-align: center; }
.ki-foto-weg { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; margin: 0; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; font-size: 18px; line-height: 1; }
.ki-foto-wahl { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; border: 2px dashed var(--ki-rand); border-radius: 16px; background: var(--ki-hell); font-size: 13.5px; color: var(--muted); }
.ki-foto-wahl .knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; }
.ki-datei { position: relative; display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 10px 16px; border-radius: 999px; font-weight: 620; font-size: 14.5px; cursor: pointer; border: 1px solid var(--border); }
.ki-datei.zweit { background: var(--surface); color: var(--accent-text); }
.ki-datei input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.ki-datei:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.ki-datei.aus { opacity: .45; pointer-events: none; }
.ki-felder-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px 16px; }
.ki-seite-form .ki-start { align-self: flex-start; width: auto; padding: 12px 22px; }

/* Lernplan auf /lernen */
.ki-lernplan { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 22px; padding: 18px 20px; border: 1px solid var(--ki-rand); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--ki-hell), var(--surface) 70%); scroll-margin-top: 80px; }
.ki-lernplan-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; }
.ki-lernplan h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.ki-lernplan h2 .icon { color: var(--marke); }
.ki-lernplan .ki-start { align-self: flex-start; width: auto; padding: 11px 20px; }

/* Schmal: Panel von unten (iPad hochkant, Handy) */
@media (max-width: 860px) {
  .ki-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: 86vh; max-height: 86dvh; border-radius: 22px 22px 0 0; }
  .ki-griff { display: block; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 999px; background: var(--border); }
  .ki-kopf { padding-top: 8px; }
  .ki-abdunkeln:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(8,12,20,.38); }
  html.ki-offen, html.ki-offen body { overflow: hidden; }
  p.hint.ki-hinweis { margin: 0 18px 6px; }
}
@media (min-width: 861px) { .ki-vergleich { grid-template-columns: minmax(0, 1fr); } .ki-vergleich-reiter { display: inline-flex; } }
@media (max-width: 600px) {
  .ki-felder-2 { grid-template-columns: minmax(0, 1fr); }
  .ki-fotos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ki-wahlen { grid-template-columns: minmax(0, 1fr); }
  .ki-seite-form .ki-start, .ki-lernplan .ki-start { width: 100%; }
  .ki-chip { left: 16px; right: 16px; justify-content: center; }
}

/* Herkunft an Karten und Fragen (V6): Chip „KI“, Klartext nur für Screenreader */
.nur-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lk-kopf-rechts { display: inline-flex; align-items: center; gap: 8px; }
.lk-chip.ki { position: relative; }

/* KI-Helfer: mitlaufender Text, Hilfe-Hinweis, Erstattung (V3, V8) */
.ki-mitlauf { font-size: 14px; background: var(--ki-hell); border-radius: 12px; padding: 10px 12px; white-space: pre-line; max-height: 40vh; overflow-y: auto; }
.ki-mitlauf[hidden] { display: none; }
.ki-ok.hilfe { background: var(--accent-soft); color: var(--accent-text); }
.ki-hilfe { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; color: var(--text); }
.ki-hilfe p { margin: 0; white-space: pre-line; }
.ki-erstattet { display: inline-flex; align-items: center; gap: 5px; color: #1f7a4d; font-weight: 600; }
.ki-erstattet .icon { width: 14px; height: 14px; }
