:root {
  --canvas: #F7F5EF; --surface: #FFFFFF; --ink: #0A0A0A; --ink-2: #3A3A3A; --mute: #6B6B6B; --line: #E4E0D6; --line-soft: #EEEBE3;
  --blue: #5260FE; --blue-50: #F2F3FF; --orange: #FE7C52; --orange-ink: #7A2A0A; --orange-50: #FFF1EB;
  --purple: #C871FD; --purple-ink: #4D1A78; --purple-50: #FBF7FF; --green-ink: #1F5A1B; --green-50: #F6FCF5;
  --sh-pop: 0 8px 24px rgba(10,10,10,.10), 0 0 0 1px rgba(10,10,10,.06); --sh-deep: 0 24px 60px rgba(10,10,10,.18), 0 0 0 1px rgba(10,10,10,.06);
  --f: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: ui-monospace, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.5 var(--f); }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.lade, .meldung { padding: 40px; color: var(--mute); text-align: center; }
.meldung.fehler { color: #9A2A12; }
.knopf { font-weight: 600; font-size: 13px; padding: 5px 11px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); white-space: nowrap; }
.knopf.haupt { background: var(--blue); border-color: var(--blue); color: #fff; }
.knopf.klein { font-size: 12px; padding: 2px 8px; }
.knopf:disabled { opacity: .55; cursor: default; }
a.knopf { display: inline-block; text-decoration: none; }

.app { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; }
.oben { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-height: 56px; padding: 8px 16px; background: var(--canvas); border-bottom: 1px solid var(--line); }
.marke { font-weight: 700; font-size: 13px; color: var(--orange-ink); background: var(--orange-50); border: 1px solid #FFD9C9; padding: 2px 9px; border-radius: 6px; }
.titel { font-weight: 650; font-size: 15px; margin-right: auto; }
.pille { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--line-soft); color: var(--ink-2); }
.pille.live { background: var(--orange-50); color: var(--orange-ink); font-weight: 600; }
.pille.stufe { background: var(--purple-50); color: var(--purple-ink); font-weight: 600; }
.pille.leitlinie { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mitte { display: grid; grid-template-columns: 210px minmax(0, 1fr) 300px; min-height: 0; }
.nav { background: #FCFBF8; border-right: 1px solid var(--line); padding: 12px 10px; overflow-y: auto; }
.abschnitt { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); margin: 4px 2px 8px; }
.nav .abschnitt:not(:first-child) { margin-top: 18px; }
.eintrag { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 7px 9px; border-radius: 7px; border: 0; background: transparent; color: var(--ink-2); }
.eintrag:hover { background: var(--line-soft); }
.eintrag { align-items: flex-start; }
.eintrag > span:last-child { flex: 0 1 auto; min-width: 0; max-width: 48%; font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eintrag .e-name { flex: 1 1 auto; min-width: 0; font-size: inherit; color: inherit; white-space: normal; }
.eintrag.an { background: var(--orange-50); color: var(--ink); font-weight: 650; box-shadow: inset 3px 0 0 var(--orange); }
.eintrag.an > span:last-child { color: var(--orange-ink); font-weight: 600; }
.stand { font-size: 12px; padding: 4px 9px; color: var(--ink-2); }
.stand.sicherung { color: var(--mute); font-style: italic; }
.seite { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; background: #F3F1EA; }
.seitenleiste { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.seitenleiste .platz { margin-right: auto; }
.rahmen { width: 100%; height: 100%; border: 0; background: var(--canvas); }
.rechts { border-left: 1px solid var(--line); background: var(--surface); padding: 12px; overflow-y: auto; }
.k { border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; margin-bottom: 8px; }
.k.vorschlag { border-color: #E3C4FB; background: var(--purple-50); }
.k.erledigt { border-color: #CFEFC9; background: var(--green-50); }
.k.hervor { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(254,124,82,.35); transition: box-shadow .3s; }
a.marke { text-decoration: none; }
a.marke:hover { background: #FFE6DB; }
.k-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-size: 12.5px; }
.k-kopf span { font-size: 11.5px; color: var(--mute); }
.k p { margin: 4px 0 6px; color: var(--ink-2); white-space: pre-wrap; }
.k del { color: #9A2A12; }
.k ins { color: var(--green-ink); text-decoration: none; border-bottom: 1.5px solid var(--green-ink); }
.k-fuss { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--mute); }
.antwort { margin: 6px 0 0 10px; padding-left: 8px; border-left: 2px solid var(--line); font-size: 13px; }
.antwortfeld { width: 100%; min-height: 48px; margin-top: 6px; font: inherit; padding: 6px; border: 1px solid var(--line); border-radius: 6px; }
.geaendert { color: var(--orange-ink); font-weight: 600; }
.leer-k { color: var(--mute); font-size: 13px; }
.raeume { max-width: 760px; margin: 40px auto; padding: 0 16px; }
.raeume a { display: block; padding: 12px 14px; margin-bottom: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.raeume a span { color: var(--mute); font-size: 12.5px; margin-left: 8px; }

@media (max-width: 1100px) { .mitte { grid-template-columns: 180px minmax(0, 1fr) 260px; } }
@media (max-width: 860px) {
  .mitte { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(60vh, 1fr) auto; }
  .nav { border-right: 0; border-bottom: 1px solid var(--line); display: flex; gap: 4px; overflow-x: auto; padding: 8px; }
  .nav .abschnitt, .nav .stand { display: none; }
  .eintrag { width: auto; white-space: nowrap; }
  .rechts { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- Kapsel, Glocke, Suche, KI-Chat: wie in Projectra (TopBarCluster, NotificationCenter, SearchPalette,
   KiChatPanel), Akzent schwarz statt blau; Maße aus dem Projectra-Code ---------- */
.kapsel { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(10,10,10,.10), 0 2px 8px rgba(10,10,10,.22); }
.kp-knopf { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: #fff; transition: background-color 150ms cubic-bezier(.4,0,.2,1); }
.kp-knopf:hover { background: rgba(255,255,255,.15); }
.kp-knopf.an, .kp-knopf[aria-expanded="true"], .kp-knopf[aria-pressed="true"] { background: rgba(255,255,255,.22); }
.kapsel button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.kp-zahl { position: absolute; top: -4px; right: -4px; height: 17px; min-width: 17px; padding: 0 4px; border-radius: 999px; background: var(--orange); color: #fff; font: 700 10px/17px var(--f); font-variant-numeric: tabular-nums; text-align: center; box-shadow: 0 0 0 2px var(--ink); }
.kp-zahl[hidden] { display: none; }
.kp-glocke { position: relative; display: inline-flex; }
.kp-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-left: 2px; border-radius: 999px; background: #EBEBEB; color: var(--ink); font-size: 11px; font-weight: 600; letter-spacing: .025em; }
.knopf.schwarz { background: var(--ink); border-color: var(--ink); color: #fff; }
.anwesend { display: inline-flex; padding-left: 6px; }
.kopf-person { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: -6px; border-radius: 50%; background: #EBEBEB; color: var(--ink); font-size: 10.5px; font-weight: 600; letter-spacing: .025em; box-shadow: 0 0 0 2px var(--canvas); }
.e-name { display: flex; flex-direction: column; min-width: 0; }
.eintrag .e-personen { font-size: 11px; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eintrag .e-personen::before { content: '● '; color: #3E9A36; }
.dreht { display: inline-grid; }
.dreht svg { animation: drehen 1s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 90; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: min(520px, calc(100vw - 32px)); padding: 9px 14px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: var(--sh-pop); }
.toast.fehler { background: #9A2A12; }

/* Glocke */
.gl-panel { position: absolute; right: 0; top: 100%; margin-top: 10px; z-index: 50; width: 400px; max-width: calc(100vw - 16px); max-height: min(72vh, 580px); display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid #E5E5E5; border-radius: 14px; box-shadow: var(--sh-pop); color: #0A0A0A; text-align: left; font-size: 14px; }
.gl-panel[hidden] { display: none; }
.gl-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px 4px; }
.gl-kopf h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: #0A0A0A; }
.gl-alle { border: 0; background: none; padding: 0; font-size: 12px; color: #6B6B6B; }
.gl-alle:hover { text-decoration: underline; text-underline-offset: 2px; }
.gl-tabs { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid #EEEEEE; }
.gl-tablist { display: flex; gap: 20px; }
.gl-tab { margin-bottom: -1px; display: flex; align-items: center; gap: 6px; border: 0; border-bottom: 2px solid transparent; background: none; padding: 4px 0 8px; font-size: 13px; font-weight: 500; color: #6B6B6B; }
.gl-tab.an { border-bottom-color: #0A0A0A; color: #0A0A0A; font-weight: 600; }
.gl-tabzahl { min-width: 18px; padding: 0 6px; line-height: 18px; border-radius: 999px; font-size: 10.5px; font-weight: 600; text-align: center; background: #F3F4F6; color: #3A3A3A; }
.gl-tab.an .gl-tabzahl { background: #0A0A0A; color: #fff; }
.gl-liste { flex: 1; overflow-y: auto; }
.gl-leer { padding: 48px 24px; text-align: center; }
.gl-leer-titel { font-size: 13px; font-weight: 500; color: #3A3A3A; }
.gl-leer-text { margin-top: 4px; font-size: 12px; color: #6B6B6B; }
.gl-lade { padding: 32px 16px; text-align: center; font-size: 13px; color: #6B6B6B; }
.gl-gruppe { position: sticky; top: 0; z-index: 1; padding: 6px 16px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9A9A9A; background: #F9FAFB; border-bottom: 1px solid #EEEEEE; }
.gl-zeile { position: relative; display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #EEEEEE; }
.gl-zeile.neu { background: #F3F3F3; }
.gl-zeile:not(.neu):hover { background: #F9FAFB; }
.gl-zeile.erledigt { opacity: .62; }
.gl-avatar { position: relative; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: #F3F3F3; color: #0A0A0A; }
.gl-zeile.neu .gl-avatar:not(.person):not(.s-warning):not(.s-error) { background: #E6E6E6; }
.gl-avatar.s-warning { background: #FFF4D1; color: #6B4B00; }
.gl-avatar.s-error { background: #FDE9E1; color: #7A2A0A; }
.gl-avatar.person { background: #EBEBEB; color: #0A0A0A; font-size: 11px; font-weight: 600; letter-spacing: .025em; }
.gl-abzeichen { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px #E5E5E5; color: #0A0A0A; }
.gl-abzeichen.s-warning { color: #6B4B00; }
.gl-abzeichen.s-error { color: #7A2A0A; }
.gl-inhalt { flex: 1; min-width: 0; }
.gl-oeffnen { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; }
.gl-oeffnen.ohne-ziel { cursor: default; }
.gl-oeffnen:focus-visible { outline: none; text-decoration: underline; }
.gl-titel { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-right: 48px; font-size: 13px; line-height: 1.4; font-weight: 500; color: #1F1F1F; }
.gl-zeile.neu .gl-titel { font-weight: 600; }
.gl-text { display: block; margin-top: 4px; font-size: 12px; color: #6B6B6B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-meta { display: flex; gap: 6px; align-items: center; margin-top: 4px; font-size: 11.5px; color: #9A9A9A; }
.gl-erledigt { padding: 1px 6px; border-radius: 999px; background: #F3F4F6; color: #6B6B6B; font-size: 10.5px; font-weight: 500; }
.gl-punkt { position: absolute; top: 16px; right: 16px; width: 8px; height: 8px; border-radius: 999px; background: #0A0A0A; transition: opacity 150ms; }
.gl-zeile:hover .gl-punkt { opacity: 0; }
.gl-aktionen { position: absolute; top: 10px; right: 10px; display: flex; gap: 2px; opacity: 0; transition: opacity 150ms; }
.gl-zeile:hover .gl-aktionen, .gl-zeile:focus-within .gl-aktionen { opacity: 1; }
.gl-aktion { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #6B6B6B; }
.gl-aktion:hover { background: rgba(0,0,0,.05); }
.gl-fuss { padding: 6px 8px; border-top: 1px solid #EEEEEE; }
.gl-ki { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; font-weight: 500; color: #0A0A0A; }
.gl-ki:hover { background: #F3F3F3; }
.gl-menue { position: fixed; z-index: 70; width: 288px; padding: 6px; background: #fff; border: 1px solid #E5E5E5; border-radius: 10px; box-shadow: var(--sh-pop); }
.gl-menue-eintrag { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; font-size: 13px; color: #1F1F1F; text-align: left; }
.gl-menue-eintrag svg { flex: none; margin-top: 1px; }
.gl-menue-eintrag:hover { background: #F3F4F6; }
@media (hover: none) { .gl-punkt { display: none; } .gl-aktionen { opacity: 1; } }
@media (max-width: 767px) { .gl-panel { position: fixed; left: 8px; right: 8px; top: 62px; width: auto; margin-top: 0; } .kp-zahl { box-shadow: none; } }

/* Suche */
.sp-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 12px 0; background: rgba(10,10,10,.32); }
.sp-overlay[hidden] { display: none; }
.sp-dialog { width: 100%; max-width: 640px; max-height: 72vh; display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid #E5E5E5; border-radius: 14px; box-shadow: var(--sh-deep); }
.sp-zeile { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid #EEEEEE; }
.sp-ikon { display: inline-grid; color: #6B6B6B; }
.sp-feld { flex: 1; min-width: 0; height: 56px; padding: 0; border: 0; outline: none; box-shadow: none; background: #fff; font: 16px var(--f); color: #0A0A0A; }
.sp-feld:focus-visible { outline: none; }
.sp-feld::placeholder { color: #6B6B6B; }
.sp-kbd { padding: 2px 6px; border: 1px solid #E5E5E5; border-radius: 6px; font: 11px var(--f); color: #6B6B6B; }
.sp-liste { flex: 1; overflow-y: auto; padding: 6px 0; }
.sp-gruppe { padding: 10px 16px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9A9A9A; }
.sp-option { display: flex; align-items: center; gap: 12px; width: calc(100% - 12px); margin: 0 6px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: #0A0A0A; text-align: left; }
.sp-option.an { background: #F3F3F3; }
.sp-kachel { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: #F3F4F6; color: #3A3A3A; }
.sp-option.an .sp-kachel { background: #EBEBEB; color: #0A0A0A; }
.sp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-titel { font-size: 13px; font-weight: 500; color: #0A0A0A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-unter { font-size: 12px; color: #6B6B6B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-enter { flex: none; display: inline-grid; color: #0A0A0A; }
.sp-laeuft { padding: 8px 16px 6px; font-size: 12px; color: #9A9A9A; }
.sp-leer { padding: 32px 16px; text-align: center; font-size: 13px; color: #6B6B6B; }
.sp-fuss { display: flex; justify-content: space-between; padding: 8px 16px; border-top: 1px solid #EEEEEE; font-size: 11.5px; color: #6B6B6B; }
@media (max-width: 639px) { .sp-kbd, .sp-fuss { display: none; } }

/* KI-Chat: links angedockt (Kopfzeile bleibt frei), Großmodus über die ganze Fläche */
.kc-aussen { position: fixed; left: 0; right: 0; bottom: 0; top: var(--kopf-h, 56px); z-index: 50; display: flex; justify-content: flex-start; pointer-events: none; }
.kc-aussen[hidden] { display: none; }
.kc-panel { position: relative; height: 100%; width: max(256px, var(--left-rail-width, 0px)); max-width: 100%; display: flex; flex-direction: column; background: var(--canvas); border-right: 1px solid #EEEEEE; box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); pointer-events: auto; color: #0A0A0A; }
.kc-panel.rein { animation: rein-links .3s ease-out; }
@keyframes rein-links { from { transform: translateX(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
.kc-aussen.gross { z-index: 40; justify-content: center; background: var(--canvas); pointer-events: auto; }
.kc-aussen.gross .kc-panel { width: 100%; max-width: 860px; border-right: 0; box-shadow: none; animation: none; }
.kc-kopf { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #EEEEEE; }
.kc-kopf > svg { flex: none; }
.kc-name { font-size: 14px; font-weight: 600; }
.kc-bezug-ort { display: inline-flex; min-width: 0; }
.kc-bezug { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; padding: 2px 2px 2px 8px; border: 1px solid #E5E5E5; border-radius: 999px; background: #fff; font-size: 11px; font-weight: 500; color: #1F1F1F; }
.kc-bezug > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-bezug-x { display: inline-grid; place-items: center; padding: 2px; border: 0; border-radius: 999px; background: none; color: inherit; }
.kc-bezug-x:hover { background: rgba(0,0,0,.05); }
.kc-bezug.aus { gap: 4px; padding: 2px 8px; border-style: dashed; background: transparent; color: #6B6B6B; white-space: nowrap; }
.kc-knoepfe { display: flex; gap: 2px; flex: none; margin-left: auto; }
.kc-knopf { display: grid; place-items: center; padding: 6px; border: 0; border-radius: 4px; background: transparent; color: #6B6B6B; }
.kc-knopf:hover { background: rgba(0,0,0,.05); }
.kc-knopf.an { color: #0A0A0A; }
.kc-geschichte { position: absolute; left: 8px; right: 8px; top: 100%; margin-top: 4px; z-index: 50; overflow: hidden; background: var(--canvas); border: 1px solid #E5E5E5; border-radius: 10px; box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }
.kc-geschichte[hidden] { display: none; }
.kc-gk { padding: 8px 12px; border-bottom: 1px solid #E5E5E5; font-size: 11px; font-weight: 600; color: #6B6B6B; }
.kc-gliste { max-height: 288px; overflow-y: auto; }
.kc-gzeile { display: flex; align-items: center; gap: 6px; padding: 6px 12px; }
.kc-gzeile:hover { background: rgba(0,0,0,.05); }
.kc-gzeile.an { background: rgba(0,0,0,.06); }
.kc-gwahl { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0; border: 0; background: none; text-align: left; }
.kc-gtitel { font-size: 12px; color: #0A0A0A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-gdatum { font-size: 10px; color: #9A9A9A; }
.kc-gweg { display: grid; padding: 2px; border: 0; background: none; color: #6B6B6B; opacity: .6; }
.kc-gweg:hover { opacity: 1; }
.kc-gleer { padding: 10px 12px; font-size: 12px; color: #6B6B6B; }
.kc-liste { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; }
.kc-leer { margin-top: 24px; font-size: 14px; line-height: 20px; color: #6B6B6B; }
.kc-leer p { margin: 0 0 8px; }
.kc-leer .kc-beispiel { font-size: 12px; color: #9A9A9A; }
.kc-ich { align-self: flex-end; max-width: 92%; padding: 8px 10px; border-radius: 12px 12px 2px 12px; background: #0A0A0A; color: #F7F5EF; font-size: 14px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.kc-ki { padding: 8px 10px; border: 1px solid #EEEEEE; border-radius: 12px 12px 12px 2px; background: #fff; color: #0A0A0A; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.kc-md p { margin: 0 0 .55em; }
.kc-md > :last-child { margin-bottom: 0; }
.kc-md ul, .kc-md ol { margin: .3em 0 .55em; padding-left: 1.2em; }
.kc-md li { margin: .15em 0; }
.kc-md h1, .kc-md h2, .kc-md h3, .kc-md h4 { margin: .7em 0 .35em; font-size: 1.02em; font-weight: 700; }
.kc-md table { display: block; overflow-x: auto; margin: 0 0 .55em; border-collapse: collapse; font-size: .95em; }
.kc-md th, .kc-md td { padding: 3px 7px; border: 1px solid #E5E5E5; }
.kc-md th { background: rgba(0,0,0,.04); }
.kc-md code { padding: 0 3px; border-radius: 4px; background: rgba(0,0,0,.06); font: .92em var(--mono); }
.kc-md blockquote { margin: 0 0 .55em; padding-left: .7em; border-left: 3px solid #E5E5E5; opacity: .85; }
.kc-md a { color: #0A0A0A; text-decoration: underline; }
.kc-md hr { margin: .7em 0; border: 0; border-top: 1px solid #E5E5E5; }
.kc-laden { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #6B6B6B; }
.kc-fehler { padding: 8px 12px; border: 1px solid rgba(220,38,38,.3); border-radius: 8px; background: rgba(220,38,38,.06); font-size: 12px; color: #b91c1c; }
.kc-karte { margin-top: 8px; padding: 8px; border: 1px solid rgba(10,10,10,.25); border-radius: 8px; background: rgba(10,10,10,.04); font-size: 12px; line-height: 1.5; }
.kc-frage { margin-bottom: 4px; font-weight: 600; color: #0A0A0A; }
.kc-karte-text { margin-bottom: 6px; color: #6B6B6B; white-space: pre-wrap; }
.kc-karte del { color: #9A2A12; }
.kc-karte ins { color: var(--green-ink); text-decoration: none; }
.kc-meta { margin-bottom: 6px; font-size: 10px; color: #9A9A9A; }
.kc-karte-knoepfe { display: flex; gap: 8px; }
.kc-ja, .kc-nein { padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.kc-ja { border: 0; background: #0A0A0A; color: #fff; }
.kc-nein { border: 1px solid #E5E5E5; background: transparent; color: #6B6B6B; }
.kc-zustand { display: flex; align-items: center; gap: 6px; color: #6B6B6B; }
.kc-zustand.ok { color: #16a34a; }
.kc-zustand.aus { color: #9A9A9A; }
.kc-zustand.fehler { color: #dc2626; }
.kc-eingabe { padding: 8px 12px 12px; }
.kc-rahmen { border: 1px solid #E5E5E5; border-radius: 14px; background: #fff; transition: box-shadow 150ms; }
.kc-rahmen:focus-within { border-color: #0A0A0A; box-shadow: 0 0 0 3px rgba(10,10,10,.08); }
.kc-feld { display: block; width: 100%; resize: none; overflow-y: hidden; padding: 10px 12px 4px; border: 0; outline: none; background: transparent; font: 14px/20px var(--f); color: #000; }
.kc-feld:focus-visible { outline: none; }
.kc-feld::placeholder { color: #6B6B6B; }
.kc-knopfzeile { display: flex; align-items: center; gap: 4px; padding: 0 6px 6px; }
.kc-luecke { flex: 1; }
.kc-senden { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: #0A0A0A; color: #F7F5EF; }
.kc-senden:disabled { opacity: .4; cursor: default; }
@media (max-width: 767px) { .kc-panel { width: min(86vw, 320px); } }

/* Sprachaufnahme */
.aufnahme { position: fixed; z-index: 60; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 9px 14px; background: var(--ink); color: #fff; border-radius: 12px; box-shadow: 0 12px 30px rgba(10,10,10,.3); font-size: 13px; }
.aufnahme .zeit { font-variant-numeric: tabular-nums; color: #E9E7E1; }
.aufnahme .knopf { background: #fff; color: var(--ink); border-color: #fff; }
.punkt-rot { width: 10px; height: 10px; border-radius: 50%; background: #E5484D; animation: puls 1.2s infinite; }
@keyframes puls { 50% { opacity: .35; } }
/* Rechte Spalte: nur Kommentare */
.rechts { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.r-inhalt { flex: 1; overflow-y: auto; padding: 12px; min-height: 0; }

/* Aufbau übernehmen: Dialog im Stil der Suche */
.nav-aufbau { display: flex; align-items: center; gap: 7px; width: 100%; margin-top: 6px; padding: 6px 9px; border: 1px dashed var(--line); border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 12.5px; text-align: left; }
.nav-aufbau:hover { border-color: var(--ink); color: var(--ink); background: #fff; }
.au-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 12px 0; background: rgba(10,10,10,.32); }
.au-overlay[hidden] { display: none; }
.au-dialog { width: 100%; max-width: 640px; max-height: 84vh; display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid #E5E5E5; border-radius: 14px; box-shadow: var(--sh-deep); color: #0A0A0A; }
.au-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 2px; }
.au-kopf h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.au-sub { margin: 0; padding: 0 16px 12px; font-size: 12.5px; color: #6B6B6B; border-bottom: 1px solid #EEEEEE; }
.au-body { flex: 1; overflow-y: auto; padding: 4px 0 8px; }
.au-abschnitt { padding: 12px 16px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9A9A9A; }
.au-quellen, .au-teile { display: flex; flex-direction: column; gap: 4px; padding: 0 10px; }
.au-quelle { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: left; color: #0A0A0A; }
.au-quelle:hover { background: #F9FAFB; }
.au-quelle.an { background: #F3F3F3; border-color: #E5E5E5; }
.au-punkt { flex: none; width: 14px; height: 14px; margin-top: 2px; border-radius: 999px; border: 1.5px solid #9A9A9A; }
.au-quelle.an .au-punkt { border: 4.5px solid #0A0A0A; }
.au-q-text, .au-t-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.au-q-titel { font-size: 13px; font-weight: 500; }
.au-q-meta { font-size: 12px; color: #6B6B6B; }
.au-teil { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.au-teil:hover { background: #F9FAFB; }
.au-teil.aus { cursor: default; opacity: .6; }
.au-teil input { margin: 3px 0 0; accent-color: #0A0A0A; width: 15px; height: 15px; flex: none; }
.au-t-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.au-t-name { font-size: 13px; font-weight: 600; }
.au-t-kurz { font-size: 12px; color: #9A9A9A; }
.au-marke { padding: 0 6px; border-radius: 999px; background: #F3F4F6; color: #3A3A3A; font-size: 10.5px; font-weight: 600; line-height: 17px; }
.au-marke.ersetzt { background: var(--orange-50); color: var(--orange-ink); }
.au-marke.gesperrt { background: #FDE9E1; color: #7A2A0A; }
.au-t-plan { font-size: 12.5px; color: #3A3A3A; }
.au-t-warn { font-size: 12px; color: var(--orange-ink); }
.au-leer { display: flex; align-items: center; gap: 8px; padding: 14px 16px; font-size: 13px; color: #6B6B6B; }
.au-fehler { margin: 0 16px 8px; padding: 8px 12px; border: 1px solid rgba(220,38,38,.3); border-radius: 8px; background: rgba(220,38,38,.06); font-size: 12px; color: #b91c1c; }
.au-fehler[hidden] { display: none; }
.au-fuss { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid #EEEEEE; }
.au-hinweis { margin-right: auto; font-size: 11.5px; color: #6B6B6B; }
.au-ab { padding: 6px 12px; border: 1px solid #E5E5E5; border-radius: 8px; background: #fff; font-size: 13px; font-weight: 500; color: #1F1F1F; }
.au-los { padding: 6px 14px; border: 0; border-radius: 8px; background: #0A0A0A; color: #fff; font-size: 13px; font-weight: 600; }
.au-los:disabled { opacity: .4; cursor: default; }
@media (max-width: 860px) { .nav-aufbau { width: auto; margin-top: 0; white-space: nowrap; } }
