/* KI-Knowledgebase & Wiki — Gemeinde Attinghausen
   Aesthetic A · Refined Minimal im Attinghausen-CI (Gelb-Akzent, light only).
   Fonts: Inter Tight (Display) · Inter (Body) · JetBrains Mono (Akzent). */

:root {
    --paper:       #fafaf7;
    --paper-warm:  #f3f1ea;
    --card:        #ffffff;
    --ink:         #14141a;
    --ink-soft:    #3a3a40;
    --ink-mute:    #767680;
    --line:        rgba(20, 20, 26, 0.10);
    --line-soft:   rgba(20, 20, 26, 0.06);

    --yellow:      #ffcc00;
    --yellow-deep: #f0b800;
    --yellow-soft: #fff3b0;
    --yellow-tint: #fff9e0;

    --green:   #2f8f5b;
    --green-t: #e7f4ec;
    --amber:   #c98a12;
    --amber-t: #fbf1da;
    --red:     #c0392b;
    --red-t:   #fbe9e7;

    --sans-d: 'Inter Tight', 'SF Pro Display', -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui, sans-serif;
    --sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', ui-sans-serif, system-ui, sans-serif;
    --mono:   'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, ui-monospace, Menlo, monospace;
    --ease:   cubic-bezier(0.22, 1, 0.36, 1);

    --shadow-s: 0 1px 2px rgba(20,20,26,0.04), 0 2px 8px rgba(20,20,26,0.04);
    --shadow-m: 0 4px 12px -4px rgba(20,20,26,0.10), 0 12px 32px -8px rgba(20,20,26,0.10);
    --shadow-l: 0 20px 60px -16px rgba(20,20,26,0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
em { font-style: italic; }

::selection { background: var(--yellow); color: var(--ink); }
:focus-visible { outline: 2px solid var(--yellow-deep); outline-offset: 2px; border-radius: 4px; }

.kicker {
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 1rem;
}

/* ---------- Status strip ---------- */
.status { background: var(--ink); color: var(--paper); }
.status__in {
    max-width: 1280px; margin: 0 auto;
    padding: 0.55rem clamp(1rem, 4vw, 2.5rem);
    display: flex; align-items: center; gap: 0.7rem;
    font-family: var(--mono); font-size: 0.74rem; flex-wrap: wrap;
}
.status strong { color: var(--yellow); letter-spacing: 0.04em; }
.status .sep { opacity: 0.4; }
.status__tag { color: var(--yellow-soft); }
.status__spacer { flex: 1; }
.status__hosting { opacity: 0.8; }
.dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--yellow);
    box-shadow: 0 0 0 0 rgba(255,204,0,0.7); animation: pulse 2.4s var(--ease) infinite; flex-shrink: 0;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,204,0,0.7); }
    70% { box-shadow: 0 0 0 9px rgba(255,204,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,204,0,0); }
}

/* ---------- Header ---------- */
.head {
    position: sticky; top: 0; z-index: 50;
    background: rgba(250,250,247,0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--line);
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem;
    padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
}
.head__brand img { height: 26px; width: auto; }

.tabs { display: flex; justify-content: center; gap: 0.3rem; }
.tab {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 1.1rem; font-size: 0.95rem; font-weight: 500;
    color: var(--ink-soft); border-radius: 10px;
    transition: background 180ms var(--ease), color 180ms var(--ease);
}
.tab__ico { font-size: 0.95rem; color: var(--yellow-deep); }
.tab:hover { background: var(--yellow-tint); }
.tab.is-active { background: var(--ink); color: var(--paper); }
.tab.is-active .tab__ico { color: var(--yellow); }

.head__role { display: flex; align-items: center; gap: 0.7rem; }
.head__role-lbl {
    font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--ink-mute); white-space: nowrap;
}
.seg {
    display: inline-flex; background: var(--paper-warm);
    border: 1px solid var(--line); border-radius: 9px; padding: 3px;
}
.seg__btn {
    padding: 0.35rem 0.75rem; font-size: 0.82rem; font-weight: 500;
    color: var(--ink-mute); border-radius: 6px;
    transition: all 180ms var(--ease);
}
.seg__btn.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-s); }
.seg__btn:hover:not(.is-active) { color: var(--ink-soft); }

/* ---------- Views ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.view { display: none; }
.view.is-active { display: block; animation: viewIn 500ms var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- KB Hero ---------- */
.kb-hero { padding: clamp(3rem, 7vw, 5.5rem) 0 2rem; max-width: 760px; }
.kb-hero__h {
    font-family: var(--sans-d); font-weight: 600;
    font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.02;
    letter-spacing: -0.025em; margin-bottom: 1.2rem;
}
.kb-hero__h em { color: var(--ink-mute); font-weight: 500; }
.kb-hero__lede { font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--ink-soft); max-width: 60ch; }

/* Ask box */
.ask {
    margin-top: 2.2rem; display: flex; align-items: center; gap: 0.6rem;
    background: var(--card); border: 1.5px solid var(--line);
    border-radius: 16px; padding: 0.6rem 0.6rem 0.6rem 1.1rem;
    box-shadow: var(--shadow-m); transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.ask:focus-within { border-color: var(--yellow-deep); box-shadow: var(--shadow-l), 0 0 0 4px var(--yellow-tint); }
.ask__ico { font-size: 1.3rem; color: var(--ink-mute); flex-shrink: 0; }
.ask__in {
    flex: 1; border: none; background: none; outline: none;
    font-family: var(--sans); font-size: 1.02rem; color: var(--ink); padding: 0.5rem 0;
}
.ask__in::placeholder { color: var(--ink-mute); }
.ask__go {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--ink); color: var(--paper);
    padding: 0.7rem 1.3rem; border-radius: 11px; font-weight: 500; font-size: 0.95rem;
    transition: background 180ms var(--ease), transform 180ms var(--ease);
    flex-shrink: 0;
}
.ask__go:hover { background: #000; transform: translateY(-1px); }
.ask__go span { transition: transform 200ms var(--ease); }
.ask__go:hover span { transform: translateX(3px); }

/* Werkzeuge im Eingabefeld: Dokument beiziehen und Spracheingabe.
   Zurückhaltend gehalten — sie stehen neben der Frage, nicht vor ihr. */
.ask__tool {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.35rem; height: 2.35rem; flex-shrink: 0;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--paper); color: var(--ink-soft); font-size: 0.95rem;
    transition: all 180ms var(--ease);
}
.ask__tool:hover { border-color: var(--ink-mute); color: var(--ink); transform: translateY(-1px); }
.ask__tool.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ask__tool-ico {
    width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor;
    stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

.vh {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.ask__hinweis {
    margin-top: 0.9rem; padding: 0.85rem 1.1rem;
    background: var(--card); border: 1px solid var(--line);
    border-left: 3px solid var(--ink-mute); border-radius: 10px;
    font-size: 0.9rem; line-height: 1.55; color: var(--ink-soft);
}

/* Rückfragefeld unter der Antwort: schmaler als das Feld im Hero, damit klar
   ist, dass es die Fortsetzung ist und nicht der Anfang. */
.ask--folge {
    margin-top: 1.6rem; padding: 0.45rem 0.45rem 0.45rem 1rem;
    border-radius: 13px; box-shadow: none;
    background: var(--paper); border-color: var(--line);
}
.ask--folge .ask__ico { font-size: 1.05rem; }
.ask--folge .ask__in { font-size: 0.96rem; padding: 0.4rem 0; }
.ask--folge .ask__go { padding: 0.58rem 1.05rem; font-size: 0.9rem; }
.ask--folge:focus-within { background: var(--card); }

/* Beigezogene Dokumente in der Quellenliste: gelb markiert, weil sie in der
   Antwort Vorrang haben und das nachvollziehbar sein muss. */
.src--eigen { border-left: 3px solid var(--yellow-deep); }
.src__eigen {
    display: inline-block; margin-left: 0.45rem; vertical-align: 0.08em;
    font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--ink-soft); background: var(--yellow-tint);
    border-radius: 999px; padding: 0.12rem 0.5rem;
}

/* Gesprächsverlauf: frühere Wortwechsel, zurückgenommen dargestellt.
   Der aktuelle Wortwechsel steht darunter in voller Stärke. */
.chatlauf { margin-top: 2.2rem; }
.chatlauf__kopf {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding-bottom: 0.5rem; margin-bottom: 1rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ink-mute);
}
.chatlauf__neu {
    font-size: 0.78rem; letter-spacing: 0.04em; text-transform: none;
    color: var(--ink-soft); border: 1px solid var(--line);
    padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--paper);
    transition: all 180ms var(--ease);
}
.chatlauf__neu:hover { border-color: var(--ink-mute); color: var(--ink); }
.chatlauf__eintrag {
    padding-bottom: 1.4rem; margin-bottom: 1.4rem;
    border-bottom: 1px dashed var(--line);
    opacity: 0.72; transition: opacity 220ms var(--ease);
}
.chatlauf__eintrag:hover { opacity: 1; }
.chatlauf__eintrag:last-child { border-bottom: none; margin-bottom: 0; }
.chatlauf__eintrag .answer, .chatlauf__eintrag .sources { margin-top: 0.8rem; }

.doc-panel {
    margin-top: 1rem; padding: 1.1rem 1.2rem;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.doc-panel__lauf {
    margin: 0 0 0.9rem; padding: 0.7rem 0.9rem;
    background: var(--paper); border-left: 3px solid var(--yellow-deep);
    border-radius: 8px; font-size: 0.88rem; line-height: 1.55; color: var(--ink-soft);
}
.doc-panel__hinweis { margin: 0 0 0.8rem; font-size: 0.86rem; color: var(--ink-mute); }

.chips { margin-top: 1.3rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
    font-size: 0.86rem; color: var(--ink-soft);
    background: var(--card); border: 1px solid var(--line);
    padding: 0.5rem 0.9rem; border-radius: 999px;
    transition: all 180ms var(--ease); text-align: left;
}
.chip:hover { border-color: var(--yellow-deep); background: var(--yellow-tint); color: var(--ink); transform: translateY(-1px); }
.chip.is-locked { opacity: 0.62; }
.chip.is-locked::before { content: "🔒 "; }

/* ---------- Answer ---------- */
.answer {
    margin: 1.5rem 0 3rem; background: var(--card);
    border: 1px solid var(--line); border-radius: 18px;
    box-shadow: var(--shadow-m); overflow: hidden;
    animation: answerIn 450ms var(--ease) both;
}
@keyframes answerIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.answer__q { padding: 1.3rem 1.6rem; border-bottom: 1px solid var(--line-soft); background: var(--paper-warm); }
.answer__q-lbl {
    font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--ink-mute); display: block; margin-bottom: 0.35rem;
}
.answer__q p { font-family: var(--sans-d); font-size: 1.15rem; font-weight: 500; line-height: 1.35; }
.answer__body { padding: 1.6rem; }
.answer__status {
    display: flex; align-items: center; gap: 0.7rem;
    font-family: var(--mono); font-size: 0.85rem; color: var(--ink-mute);
}
.spin {
    width: 15px; height: 15px; border: 2px solid var(--line);
    border-top-color: var(--yellow-deep); border-radius: 50%;
    animation: spin 0.7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.answer__text { font-size: 1.04rem; line-height: 1.65; color: var(--ink); }
.answer__text p { margin-bottom: 0.8rem; }
.answer__text .cite {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 4px; margin: 0 1px;
    background: var(--yellow); color: var(--ink); border-radius: 5px;
    font-family: var(--mono); font-size: 0.7rem; font-weight: 500;
    vertical-align: super; line-height: 1; cursor: help;
}
.answer__text .caret {
    display: inline-block; width: 2px; height: 1.05em; background: var(--ink);
    margin-left: 1px; vertical-align: text-bottom; animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.answer__none {
    display: flex; gap: 0.7rem; padding: 1rem 1.1rem; border-radius: 12px;
    background: var(--amber-t); color: #7a560a; font-size: 0.96rem; align-items: flex-start;
}

/* Sources */
.sources { padding: 0 1.6rem 1.6rem; }
.sources__lbl {
    font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--ink-mute); margin-bottom: 0.8rem;
}
.sources__list { display: grid; gap: 0.7rem; }
.src {
    display: grid; grid-template-columns: auto 1fr auto; gap: 0.9rem; align-items: start;
    padding: 0.95rem 1.1rem; border: 1px solid var(--line); border-radius: 12px;
    background: var(--paper); transition: all 180ms var(--ease);
    animation: srcIn 400ms var(--ease) both;
}
@keyframes srcIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.src:hover { border-color: var(--yellow-deep); box-shadow: var(--shadow-s); }
.src__no {
    width: 22px; height: 22px; display: grid; place-items: center;
    background: var(--yellow); color: var(--ink); border-radius: 6px;
    font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
}
.src__doc { font-weight: 600; font-size: 0.95rem; }
.src__loc { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-mute); margin-top: 0.15rem; }
.src__snip { font-size: 0.88rem; color: var(--ink-soft); margin-top: 0.45rem; line-height: 1.5; }
.src__rel { text-align: right; flex-shrink: 0; }
.src__rel-bar { width: 54px; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 0.25rem; }
.src__rel-fill { height: 100%; background: var(--green); border-radius: 3px; }
.src__rel-val { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-mute); }
.src--locked { background: var(--paper-warm); opacity: 0.85; }
.src--locked .src__no { background: var(--ink-mute); color: var(--paper); }
.src__lock { font-family: var(--mono); font-size: 0.76rem; color: var(--red); margin-top: 0.4rem; }

/* ---------- Principles ---------- */
.principles {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
    margin: 1rem 0 5rem;
}
.principle {
    padding: 1.6rem; background: var(--card); border: 1px solid var(--line);
    border-radius: 16px; transition: all 220ms var(--ease);
}
.principle:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); border-color: var(--line); }
.principle__no { font-family: var(--mono); font-size: 0.8rem; color: var(--yellow-deep); }
.principle h3 { font-family: var(--sans-d); font-size: 1.12rem; font-weight: 600; margin: 0.7rem 0 0.5rem; }
.principle p { font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- Wiki ---------- */
.wiki-intro { padding: clamp(3rem, 7vw, 5rem) 0 2rem; max-width: 720px; }
.wiki-intro__h {
    font-family: var(--sans-d); font-weight: 600;
    font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 1rem;
}
.wiki-intro__lede { font-size: clamp(1.02rem, 2vw, 1.15rem); color: var(--ink-soft); max-width: 60ch; }

.wiki { display: grid; grid-template-columns: 230px 1fr; gap: 2.5rem; padding-bottom: 5rem; align-items: start; }
.wiki__nav { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 0.2rem; }
.wnav {
    display: flex; align-items: center; gap: 0.7rem; text-align: left;
    padding: 0.7rem 0.85rem; border-radius: 10px; font-size: 0.95rem; font-weight: 450;
    color: var(--ink-soft); transition: all 160ms var(--ease); width: 100%;
}
.wnav__ico { font-size: 1.05rem; }
.wnav:hover { background: var(--yellow-tint); }
.wnav.is-active { background: var(--ink); color: var(--paper); font-weight: 500; }
.wnav__count { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-mute); }
.wnav.is-active .wnav__count { color: var(--yellow); }

.wiki__content { min-height: 60vh; }
.wcat { animation: viewIn 400ms var(--ease) both; }
.wcat__h { font-family: var(--sans-d); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 0.4rem; }
.wcat__lede { color: var(--ink-soft); margin-bottom: 1.6rem; max-width: 62ch; }

/* Use-case cards */
.ucards { display: grid; gap: 0.9rem; }
.uc {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    padding: 1.3rem 1.4rem; transition: all 200ms var(--ease);
}
.uc:hover { border-color: var(--yellow-deep); box-shadow: var(--shadow-m); transform: translateY(-2px); }
.uc__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.uc__title { font-family: var(--sans-d); font-size: 1.1rem; font-weight: 600; }
.uc__dept { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-mute); margin-top: 0.2rem; }
.uc__desc { font-size: 0.95rem; color: var(--ink-soft); margin: 0.7rem 0 0.9rem; }
.uc__prompt {
    font-family: var(--mono); font-size: 0.84rem; color: var(--ink-soft);
    background: var(--paper-warm); border: 1px solid var(--line-soft);
    border-left: 3px solid var(--yellow); border-radius: 8px; padding: 0.7rem 0.9rem; line-height: 1.5;
}
.uc__prompt b { color: var(--ink); font-weight: 500; }
.uc__foot { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.9rem; flex-wrap: wrap; }
.uc__gain { font-size: 0.85rem; color: var(--green); font-weight: 500; }

/* Risk badge */
.risk {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
    padding: 0.3rem 0.6rem; border-radius: 999px; white-space: nowrap;
}
.risk__dot { width: 8px; height: 8px; border-radius: 50%; }
.risk--green { background: var(--green-t); color: #1d6b40; }
.risk--green .risk__dot { background: var(--green); }
.risk--amber { background: var(--amber-t); color: #8a5e08; }
.risk--amber .risk__dot { background: var(--amber); }
.risk--red { background: var(--red-t); color: #9c2a1d; }
.risk--red .risk__dot { background: var(--red); }

/* Checklist */
.checks { display: grid; gap: 1rem; }
.checkcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem 1.4rem; }
.checkcard h4 { font-family: var(--sans-d); font-size: 1.08rem; font-weight: 600; margin-bottom: 0.9rem; }
.checkitem {
    display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.5rem 0;
    border-bottom: 1px solid var(--line-soft); cursor: pointer; font-size: 0.95rem; color: var(--ink-soft);
    transition: color 150ms var(--ease);
}
.checkitem:last-child { border-bottom: none; }
.checkitem:hover { color: var(--ink); }
.checkbox {
    width: 20px; height: 20px; border: 1.5px solid var(--line); border-radius: 6px;
    flex-shrink: 0; margin-top: 1px; display: grid; place-items: center;
    transition: all 160ms var(--ease); color: transparent; font-size: 0.8rem;
}
.checkitem.done .checkbox { background: var(--yellow); border-color: var(--yellow-deep); color: var(--ink); }
.checkitem.done .checkitem__txt { color: var(--ink-mute); text-decoration: line-through; }

/* Good / bad columns */
.gb { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.gbcol { border-radius: 14px; padding: 1.3rem 1.4rem; border: 1px solid var(--line); }
.gbcol--good { background: var(--green-t); border-color: rgba(47,143,91,0.25); }
.gbcol--bad { background: var(--red-t); border-color: rgba(192,57,43,0.2); }
.gbcol h4 { font-family: var(--sans-d); font-size: 1.08rem; font-weight: 600; margin-bottom: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.gbcol ul { list-style: none; display: grid; gap: 0.7rem; }
.gbcol li { font-size: 0.93rem; line-height: 1.45; padding-left: 1.4rem; position: relative; }
.gbcol--good li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 600; }
.gbcol--bad li::before { content: "✕"; position: absolute; left: 0; color: var(--red); font-weight: 600; }
.gbcol li b { font-weight: 600; }

/* Data guardrails */
.guard { display: grid; gap: 0.9rem; }
.grow {
    display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.4rem;
    border-left-width: 4px;
}
.grow--green { border-left-color: var(--green); }
.grow--amber { border-left-color: var(--amber); }
.grow--red { border-left-color: var(--red); }
.grow__tag {
    font-family: var(--mono); font-size: 0.72rem; font-weight: 500; text-transform: uppercase;
    padding: 0.35rem 0.6rem; border-radius: 7px; white-space: nowrap; align-self: start;
}
.grow--green .grow__tag { background: var(--green-t); color: #1d6b40; }
.grow--amber .grow__tag { background: var(--amber-t); color: #8a5e08; }
.grow--red .grow__tag { background: var(--red-t); color: #9c2a1d; }
.grow h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.grow p { font-size: 0.92rem; color: var(--ink-soft); }
.grow p b { color: var(--ink); font-weight: 600; }

/* Tips */
.tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.tip { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem 1.4rem; transition: all 200ms var(--ease); }
.tip:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); border-color: var(--yellow-deep); }
.tip__no { font-family: var(--mono); font-size: 0.8rem; color: var(--yellow-deep); }
.tip h4 { font-family: var(--sans-d); font-size: 1.05rem; font-weight: 600; margin: 0.5rem 0 0.4rem; }
.tip p { font-size: 0.91rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--paper-warm); margin-top: 2rem; }
.foot__in {
    max-width: 1080px; margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 2.5rem);
    display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.foot__in > div:first-child { max-width: 60ch; }
.foot__note { font-size: 0.84rem; color: var(--ink-mute); margin-top: 0.6rem; line-height: 1.5; }
.foot__by { text-align: right; display: flex; flex-direction: column; gap: 0.1rem; }
.foot__by-lbl { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-mute); }
.foot__by strong { font-size: 1.05rem; }
.foot__by span:last-child { font-size: 0.82rem; color: var(--ink-mute); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .head { grid-template-columns: 1fr; gap: 0.8rem; justify-items: center; }
    .head__brand { order: -1; }
    .principles { grid-template-columns: 1fr; }
    .wiki { grid-template-columns: 1fr; gap: 1.5rem; }
    .wiki__nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .wnav { width: auto; }
    .wnav__count { display: none; }
    .gb, .tips { grid-template-columns: 1fr; }
    .head__role-lbl { display: none; }
}
@media (max-width: 560px) {
    .ask { flex-wrap: wrap; }
    .ask__go { width: 100%; justify-content: center; }
    .src { grid-template-columns: auto 1fr; }
    .src__rel { grid-column: 2; text-align: left; display: flex; align-items: center; gap: 0.5rem; }
    .src__rel-bar { margin-bottom: 0; }
    .status__hosting { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .reveal { opacity: 1; transform: none; }
}

/* Quellenlink auf das Originaldokument der Rechtssammlung */
.src__doc a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.src__doc a:hover { border-bottom-color: var(--ink); }
.src__ext { font-size: 0.75em; opacity: 0.5; }

/* ---------- Anmeldung ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--paper); }
.login__box { width: 100%; max-width: 26rem; display: flex; flex-direction: column; gap: 0.55rem;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 2.25rem 2rem 1.75rem; }
.login__box img { margin-bottom: 0.75rem; }
.login__box h1 { font-family: var(--sans-d); font-size: 1.45rem; font-weight: 600; letter-spacing: -0.01em; }
.login__lede { color: var(--ink-mute); font-size: 0.88rem; line-height: 1.5; margin-bottom: 0.9rem; }
.login__box label { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--ink-mute); margin-top: 0.5rem; }
.login__box input { border: 1px solid var(--line); border-radius: 8px; padding: 0.62rem 0.8rem;
    font-size: 0.95rem; font-family: inherit; background: var(--paper); transition: border-color 160ms var(--ease); }
.login__box input:focus { outline: none; border-color: var(--ink); background: #fff; }
.login__box button[type=submit] { margin-top: 1.1rem; background: var(--ink); color: #fff;
    border-radius: 8px; padding: 0.7rem 1rem; font-weight: 500; font-size: 0.95rem;
    transition: transform 160ms var(--ease), opacity 160ms var(--ease); }
.login__box button[type=submit]:hover { opacity: 0.9; transform: translateY(-1px); }
/* Das Formular ist jetzt ein Kind der Box, nicht die Box selbst: Daneben steht
   die Anmeldung über das Benutzerverzeichnis. Die Abstände der Felder lagen
   vorher am Flex-Layout der Box und müssen hier nachgezogen werden. */
.login__form { display: flex; flex-direction: column; gap: 0.55rem; }

/* Anmeldung der Gemeinde. Bewusst der auffälligere Knopf: Im Betrieb ist das
   der Weg, den alle nehmen. Das lokale Konto ist der Rückfall. */
.login__sso { display: flex; align-items: center; justify-content: space-between;
    gap: 0.5rem; background: var(--ink); color: #fff; border-radius: 8px;
    padding: 0.75rem 1rem; font-weight: 500; font-size: 0.95rem;
    text-decoration: none; transition: transform 160ms var(--ease), opacity 160ms var(--ease); }
.login__sso:hover { opacity: 0.9; transform: translateY(-1px); }

/* Steht die Anmeldung der Gemeinde bereit, tritt das lokale Konto zurück:
   heller Knopf statt schwarzer, damit die Reihenfolge der Wege sichtbar ist. */
.login__sso-block:not([hidden]) ~ .login__form button[type=submit] {
    background: transparent; color: var(--ink); border: 1px solid var(--line); }

.login__trenner { display: flex; align-items: center; gap: 0.7rem;
    margin: 1.1rem 0 0.35rem; font-family: var(--mono); font-size: 0.66rem;
    text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); }
.login__trenner::before, .login__trenner::after {
    content: ""; flex: 1; height: 1px; background: var(--line); }

.login__err { margin-top: 0.85rem; padding: 0.6rem 0.75rem; border-radius: 8px;
    background: var(--red-t); color: var(--red); font-size: 0.85rem; border: 1px solid rgba(192,57,43,0.2); }
.login__foot { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line);
    font-size: 0.76rem; color: var(--ink-mute); line-height: 1.5; }

/* ---------- Sitzungsanzeige im Kopf ---------- */
.who { display: flex; align-items: center; gap: 0.6rem; }
.who strong { font-size: 0.86rem; font-weight: 550; }
.who__rolle { font-family: var(--mono); font-size: 0.64rem; text-transform: uppercase;
    letter-spacing: 0.06em; padding: 0.16rem 0.45rem; border-radius: 5px;
    background: var(--line); color: var(--ink-soft); }
.who__rolle--gr { background: var(--yellow); color: var(--ink); }
.who__out { font-size: 0.78rem; color: var(--ink-mute); border-bottom: 1px solid transparent;
    transition: color 160ms var(--ease), border-color 160ms var(--ease); }
.who__out:hover { color: var(--ink); border-bottom-color: var(--line); }

/* Das hidden-Attribut muss display-Regeln überstimmen, sonst scheinen
   Kopf- und Fusszeile durch die Anmeldemaske. */
[hidden] { display: none !important; }

/* ============================================================
   DOCGEN
   Dokumentengenerator. Eigener Reiter, gleiche Gestaltungssprache
   wie Knowledgebase und Wiki.
   ============================================================ */

.view--dg { max-width: 1240px; margin: 0 auto; padding: 40px 28px 96px; }

.dg-intro { max-width: 760px; margin-bottom: 36px; }
.dg-intro__h { font-family: var(--sans-d); font-size: clamp(28px, 4vw, 44px);
    line-height: 1.08; letter-spacing: -0.025em; font-weight: 600; margin: 10px 0 14px; }
.dg-intro__lede { color: var(--ink-soft); font-size: 16px; line-height: 1.6; max-width: 68ch; }

.dg-h { font-family: var(--sans-d); font-size: 22px; font-weight: 600;
    letter-spacing: -0.015em; margin-bottom: 16px; }

/* -------- Bereichsumschalter -------- */
.dg-bereiche { display: flex; gap: 4px; margin-bottom: 28px;
    border-bottom: 1px solid var(--line); }
.dgb { appearance: none; background: none; border: none; cursor: pointer;
    font: inherit; font-size: 14px; font-weight: 500; color: var(--ink-mute);
    padding: 10px 16px; border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color 160ms var(--ease), border-color 160ms var(--ease); }
.dgb:hover { color: var(--ink); }
.dgb.is-active { color: var(--ink); border-bottom-color: var(--yellow-deep); }

.dg-bereich { display: none; }
.dg-bereich.is-active { display: block; }

/* -------- Vorlagenkarten -------- */
.dg-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px; }
.dgk { display: flex; flex-direction: column; gap: 6px; text-align: left;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    padding: 20px; cursor: pointer; font: inherit; box-shadow: var(--shadow-s);
    transition: transform 200ms var(--ease), box-shadow 200ms var(--ease),
                border-color 200ms var(--ease); }
.dgk:hover { transform: translateY(-2px); box-shadow: var(--shadow-m);
    border-color: rgba(20,20,26,0.18); }
.dgk__behoerde { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--ink-mute); font-weight: 600; }
.dgk__titel { font-family: var(--sans-d); font-size: 18px; font-weight: 600;
    letter-spacing: -0.01em; }
.dgk__zweck { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.dgk__meta { font-size: 11px; color: var(--ink-mute); font-family: var(--mono);
    margin-top: 4px; }

/* -------- Arbeitskopf -------- */
.dg-kopf { display: flex; align-items: flex-start; justify-content: space-between;
    gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.dg-kopf__typ { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--ink-mute); font-weight: 600; }
.dg-kopf__titel { font-family: var(--sans-d); font-size: 26px; font-weight: 600;
    letter-spacing: -0.02em; margin-top: 4px; }
.dg-kopf__akt { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { appearance: none; font: inherit; cursor: pointer; border-radius: 9px;
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
    padding: 9px 16px; font-size: 14px; font-weight: 500;
    transition: background 160ms var(--ease), border-color 160ms var(--ease),
                transform 120ms var(--ease); }
.btn:hover { border-color: rgba(20,20,26,0.22); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--klein { padding: 6px 12px; font-size: 13px; }
.btn--haupt { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--haupt:hover { background: #000; }

/* -------- Schritte -------- */
.dg-schritte { display: flex; gap: 8px; margin-bottom: 22px; }
.dgs { appearance: none; background: var(--card); border: 1px solid var(--line);
    border-radius: 10px; cursor: pointer; font: inherit; font-size: 14px;
    font-weight: 500; color: var(--ink-mute); padding: 9px 16px;
    display: flex; align-items: center; gap: 8px;
    transition: all 160ms var(--ease); }
.dgs span { display: inline-flex; align-items: center; justify-content: center;
    width: 19px; height: 19px; border-radius: 50%; background: var(--paper-warm);
    font-size: 11px; font-weight: 700; color: var(--ink-mute); }
.dgs:hover { color: var(--ink); }
.dgs.is-active { color: var(--ink); border-color: var(--yellow-deep);
    background: var(--yellow-tint); }
.dgs.is-active span { background: var(--yellow); color: var(--ink); }

.dg-raster { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 28px;
    align-items: start; }
@media (max-width: 980px) { .dg-raster { grid-template-columns: 1fr; } }

.dg-schritt { display: none; }
.dg-schritt.is-active { display: block; animation: viewIn 340ms var(--ease) both; }

/* -------- Formular -------- */
.dg-gruppe { border: 1px solid var(--line); border-radius: 14px; background: var(--card);
    padding: 20px 22px 22px; margin-bottom: 16px; }
.dg-gruppe legend { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
    font-weight: 700; color: var(--ink-mute); padding: 0 8px; }
.dg-pflicht { color: var(--red); font-weight: 600; letter-spacing: 0; text-transform: none; }

.dg-felder { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.dg-felder--block { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.dg-feld { display: flex; flex-direction: column; gap: 5px; grid-column: span 12; }
.dg-feld--schmal { grid-column: span 3; }
.dg-feld--mittel { grid-column: span 6; }
.dg-feld--breit  { grid-column: span 12; }
@media (max-width: 720px) { .dg-feld, .dg-feld--schmal, .dg-feld--mittel { grid-column: span 12; } }

.dg-feld label { font-size: 13px; font-weight: 600; color: var(--ink-soft);
    display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dg-feld input, .dg-feld select, .dg-feld textarea {
    font: inherit; font-size: 14px; color: var(--ink); background: var(--paper);
    border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; width: 100%;
    transition: border-color 160ms var(--ease), background 160ms var(--ease); }
.dg-feld textarea { line-height: 1.55; resize: vertical; font-family: var(--sans); }
.dg-feld input:focus, .dg-feld select:focus, .dg-feld textarea:focus {
    outline: none; border-color: var(--yellow-deep); background: #fff; }
.dg-hilfe { font-size: 12px; color: var(--ink-mute); line-height: 1.45; }

/* -------- KI-Knopf und Vorschlag -------- */
.dg-ki { appearance: none; font: inherit; font-size: 11px; font-weight: 600;
    cursor: pointer; border: 1px solid var(--yellow-deep); background: var(--yellow-tint);
    color: #8a6a00; border-radius: 20px; padding: 3px 11px; white-space: nowrap;
    transition: background 160ms var(--ease); }
.dg-ki:hover { background: var(--yellow-soft); }
.dg-ki:disabled { opacity: 0.6; cursor: default; }

.dg-vorschlag { margin-top: 8px; border: 1px solid var(--yellow-deep);
    border-radius: 11px; background: var(--yellow-tint); padding: 12px 14px; }
.dg-vorschlag__kopf { display: flex; align-items: baseline; gap: 10px;
    flex-wrap: wrap; margin-bottom: 7px; }
.dg-vorschlag__kopf strong { font-size: 12px; text-transform: uppercase;
    letter-spacing: 0.07em; }
.dg-vorschlag__kopf span { font-size: 11px; color: var(--ink-mute); }
.dg-vorschlag__text { font-size: 14px; line-height: 1.6; color: var(--ink);
    background: #fff; border-radius: 8px; padding: 11px 13px; }
.dg-vorschlag__akt { display: flex; gap: 8px; margin-top: 10px; }

.dg-laeuft { font-size: 13px; color: var(--ink-mute); }
.dg-fehler { font-size: 13px; color: var(--red); }
.dg-leer   { font-size: 14px; color: var(--ink-mute); line-height: 1.6; max-width: 62ch; }

/* -------- Rechtsgrundlage suchen -------- */
.dg-rgsuche { border: 1px solid var(--line); border-radius: 14px; background: var(--card);
    padding: 20px 22px; }
.dg-rgsuche h3 { font-family: var(--sans-d); font-size: 16px; font-weight: 600;
    margin-bottom: 4px; }
.dg-rgzeile { display: flex; gap: 8px; margin: 12px 0; }
.dg-rgzeile input { flex: 1; font: inherit; font-size: 14px; padding: 9px 12px;
    border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.dg-rgzeile input:focus { outline: none; border-color: var(--yellow-deep); background: #fff; }

.dg-rg { border-top: 1px solid var(--line-soft); padding: 14px 0; }
.dg-rg__kopf { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dg-rg__kopf strong { font-family: var(--mono); font-size: 13px; }
.dg-rg__kopf span { font-size: 12px; color: var(--ink-mute); }
.dg-rg__text { font-size: 13px; line-height: 1.6; color: var(--ink-soft); margin: 7px 0 9px;
    max-height: 8.5em; overflow: hidden; }
.dg-rg__akt { display: flex; align-items: center; gap: 12px; }
.dg-rg__link { font-size: 12px; color: var(--ink-mute); }

/* -------- Inhalt: Textblöcke -------- */
.dg-abschnitt { border: 1px solid var(--line); border-radius: 14px; background: var(--card);
    padding: 18px 20px 20px; margin-bottom: 14px; }
.dg-abschnitt__kopf { display: flex; align-items: baseline; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.dg-abschnitt__kopf h3 { font-family: var(--sans-d); font-size: 17px; font-weight: 600; }
.dg-abschnitt__art { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--ink-mute); font-weight: 600; }
.dg-abschnitt__hinweis { font-size: 12px; color: var(--ink-mute); line-height: 1.5;
    margin-bottom: 10px; max-width: 74ch; }

.dg-bloecke { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.dg-block { border: 1px solid var(--line-soft); border-radius: 11px; padding: 12px 14px;
    background: var(--paper); transition: border-color 160ms var(--ease),
    background 160ms var(--ease); }
.dg-block.is-gewaehlt { border-color: var(--yellow-deep); background: #fff; }
.dg-block__kopf { display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    cursor: pointer; }
.dg-block__kopf input { accent-color: var(--yellow-deep); width: 15px; height: 15px; }
.dg-block__titel { font-size: 14px; font-weight: 600; }
.dg-block__fest { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--ink-mute); font-weight: 700; border: 1px solid var(--line);
    border-radius: 4px; padding: 1px 5px; }
.dg-block__grundlage { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); }
.dg-block__marke { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
    font-weight: 700; background: var(--paper-warm); color: var(--ink-mute);
    border-radius: 4px; padding: 2px 6px; }
.dg-block__marke--pruefen { background: var(--amber-t); color: var(--amber); }
.dg-block__hinweis { font-size: 12px; color: var(--amber); line-height: 1.5; margin-top: 6px; }
.dg-block__text { font-size: 13px; line-height: 1.65; color: var(--ink-soft);
    white-space: pre-wrap; margin-top: 9px; padding-left: 24px;
    border-left: 2px solid var(--line-soft); }
.dg-block__edit { appearance: none; background: none; border: none; cursor: pointer;
    font: inherit; font-size: 12px; color: var(--ink-mute); padding: 6px 0 0 24px;
    text-decoration: underline; text-underline-offset: 2px; }
.dg-block__edit:hover { color: var(--ink); }

.luecke { background: var(--yellow-soft); color: #7a5c00; font-weight: 600;
    border-radius: 3px; padding: 0 2px; }

/* -------- Vorschau -------- */
.dgv-leiste { display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 16px; font-size: 13px; }
.dgv-leiste label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.dgv-leiste__info { color: var(--ink-mute); font-size: 12px; }

.dgv-blatt { background: #fff; border: 1px solid var(--line); border-radius: 4px;
    box-shadow: var(--shadow-m); padding: 52px 60px 64px; max-width: 820px;
    font-size: 14px; line-height: 1.62; color: var(--ink); }
@media (max-width: 720px) { .dgv-blatt { padding: 28px 24px 34px; } }
.dgv-kopf { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px;
    border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.dgv-kopf strong { font-size: 13px; }
.dgv-kopf span { font-size: 11px; color: var(--ink-mute); }
.dgv-titel { font-family: var(--sans-d); font-size: 24px; font-weight: 700;
    letter-spacing: -0.02em; margin-bottom: 22px; line-height: 1.16; }
.dgv-abschnitt { font-size: 15px; font-weight: 700; margin: 24px 0 10px; }
.dgv-zt { font-size: 14px; font-weight: 700; margin: 16px 0 6px; }
.dgv-blatt p { margin-bottom: 9px; }
.dgv-punkt { padding-left: 18px; position: relative; }
.dgv-punkt::before { content: '–'; position: absolute; left: 0; color: var(--ink-mute); }
.dgv-nr { padding-left: 22px; text-indent: -22px; margin-bottom: 7px; }

/* -------- Seitenspalte: Prüfung -------- */
.dg-seite { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 18px; }
.dg-seite__h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
    font-weight: 700; color: var(--ink-mute); margin-bottom: 10px; }
.dg-pruefung, .dg-hinweise { background: var(--card); border: 1px solid var(--line);
    border-radius: 14px; padding: 18px 20px; }
.dg-pr { margin-bottom: 14px; }
.dg-pr:last-child { margin-bottom: 0; }
.dg-pr h4 { font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; display: flex; align-items: center; gap: 7px;
    margin-bottom: 7px; }
.dg-pr h4 span { display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; border-radius: 9px; font-size: 11px; padding: 0 5px; }
.dg-pr ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.dg-pr li { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft);
    padding-left: 12px; position: relative; }
.dg-pr li::before { content: ''; position: absolute; left: 0; top: 7px;
    width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.4; }
.dg-pr--fehler  h4 { color: var(--red); }
.dg-pr--fehler  h4 span { background: var(--red-t); color: var(--red); }
.dg-pr--warnung h4 { color: var(--amber); }
.dg-pr--warnung h4 span { background: var(--amber-t); color: var(--amber); }
.dg-pr--hinweis h4 { color: var(--ink-mute); }
.dg-pr--hinweis h4 span { background: var(--paper-warm); color: var(--ink-mute); }
.dg-pr-ok { font-size: 12.5px; color: var(--green); line-height: 1.5; }

.dg-merk { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.dg-merk li { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft);
    padding-left: 12px; position: relative; }
.dg-merk li::before { content: ''; position: absolute; left: 0; top: 7px; width: 4px;
    height: 4px; border-radius: 50%; background: var(--yellow-deep); }
.dg-merk__fuss { font-size: 11px; color: var(--ink-mute); margin-top: 11px;
    padding-top: 10px; border-top: 1px solid var(--line-soft); line-height: 1.45; }

/* -------- Übersicht -------- */
.dg-tabelle { width: 100%; border-collapse: collapse; font-size: 13.5px;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    overflow: hidden; }
.dg-tabelle th { text-align: left; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--ink-mute); font-weight: 700;
    padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dg-tabelle td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft);
    vertical-align: top; }
.dg-tabelle tr:last-child td { border-bottom: none; }
.dg-num { text-align: right; white-space: nowrap; }
.dg-klein { font-size: 11px; color: var(--ink-mute); font-family: var(--mono); }
.dg-stand { font-size: 11px; font-weight: 700; border-radius: 5px; padding: 3px 8px;
    white-space: nowrap; }
.dg-stand--ok      { background: var(--green-t); color: var(--green); }
.dg-stand--warnung { background: var(--amber-t); color: var(--amber); }
.dg-stand--fehler  { background: var(--red-t);   color: var(--red); }

/* -------- Katalog -------- */
.dg-katalog__lede { font-size: 14px; color: var(--ink-soft); line-height: 1.6;
    max-width: 74ch; margin-bottom: 18px; }
.dg-katalog__suche { margin-bottom: 22px; }
.dg-katalog__suche input { width: 100%; max-width: 480px; font: inherit; font-size: 14px;
    padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--card); }
.dg-katalog__suche input:focus { outline: none; border-color: var(--yellow-deep); }

.dg-kv { margin-bottom: 34px; }
.dg-kv > h3 { font-family: var(--sans-d); font-size: 20px; font-weight: 600;
    letter-spacing: -0.015em; padding-bottom: 8px; border-bottom: 2px solid var(--yellow);
    margin-bottom: 16px; }
.dg-ka { margin-bottom: 20px; }
.dg-ka > h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
    font-weight: 700; color: var(--ink-mute); margin-bottom: 9px;
    display: flex; align-items: center; gap: 12px; }
.dg-kb { background: var(--card); border: 1px solid var(--line); border-radius: 11px;
    padding: 13px 16px; margin-bottom: 8px; }
.dg-kb__kopf { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.dg-kb__kopf strong { font-size: 14px; }
.dg-kb__kopf code { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); }
.dg-kb__grundlage { display: block; font-family: var(--mono); font-size: 11px;
    color: var(--ink-mute); margin-top: 3px; }
.dg-kb__text { font-family: var(--sans); font-size: 12.5px; line-height: 1.6;
    color: var(--ink-soft); white-space: pre-wrap; margin: 9px 0 10px;
    padding-left: 14px; border-left: 2px solid var(--line-soft); }
.dg-kb__akt { display: flex; gap: 7px; flex-wrap: wrap; }

/* -------- DocGen: ausgefüllte Beispiele -------- */
.dg-beispiele { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.dg-beispiele__lede { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6;
    max-width: 74ch; margin: -6px 0 16px; }
.dgk--beispiel { background: var(--paper-warm); border-style: dashed; }
.dgk--beispiel:hover { background: var(--card); }
.dgk__muster { display: inline-block; background: var(--yellow); color: var(--ink);
    border-radius: 4px; padding: 1px 5px; margin-left: 6px; font-size: 9.5px;
    letter-spacing: 0.06em; }
.dgk__hinweis { font-size: 11.5px; color: var(--ink-mute); line-height: 1.5;
    margin-top: 6px; padding-top: 7px; border-top: 1px dashed var(--line); }
.dg-kopf__typ.is-muster::after { content: 'aus Beispiel'; background: var(--yellow);
    color: var(--ink); border-radius: 4px; padding: 1px 6px; margin-left: 8px;
    font-size: 9.5px; letter-spacing: 0.06em; }

/* -------- Vorschau: Aufbau wie in der Word-Vorlage -------- */
.dgv-kopf__amt { font-size: 11px; letter-spacing: 0.32em; font-weight: 700;
    color: var(--ink-mute); margin-bottom: 4px; }
.dgv-art { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.dgv-titelzeile { display: grid; grid-template-columns: 74px 1fr; gap: 12px;
    align-items: baseline; margin: 18px 0 22px; padding-bottom: 10px;
    border-bottom: 1px solid var(--line); }
.dgv-titelzeile .dgv-nr { font-family: var(--mono); font-size: 12px;
    color: var(--ink-mute); padding-left: 0; text-indent: 0; margin: 0; }
.dgv-titelzeile .dgv-titel { margin-bottom: 0; font-size: 19px; }

/* ============================================================
   ANALYSEN
   Auswertungen auf echten Unterlagen.
   ============================================================ */

/* ---------- Modellschalter in der Statusleiste ---------- */
.modell { display: flex; align-items: center; gap: 0.35rem; }
.modell__lbl { color: rgba(250,250,247,0.55); margin-right: 0.2rem; }
.modell__opt {
    font-family: var(--mono); font-size: 0.72rem;
    padding: 0.22rem 0.6rem; border-radius: 999px;
    color: rgba(250,250,247,0.6);
    border: 1px solid rgba(250,250,247,0.18);
    transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.modell__opt:hover { color: var(--paper); border-color: rgba(250,250,247,0.4); }
.modell__opt.is-active { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.modell--extern .modell__opt.is-active { background: var(--amber); color: #fff; border-color: var(--amber); }

.modellbanner {
    background: var(--amber-t); border-bottom: 1px solid rgba(201,138,18,0.28);
    padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
    font-size: 0.88rem; color: #6d4a06; line-height: 1.5;
}
.modellbanner strong { color: #4a3204; }

/* ---------- Kopf ---------- */
.an-intro { max-width: 1280px; margin: 0 auto; padding: clamp(2.5rem,6vw,4.5rem) clamp(1rem,4vw,2.5rem) 1.5rem; }
.an-intro__h { font-family: var(--sans-d); font-size: clamp(2rem,5vw,3.4rem); line-height: 1.06; letter-spacing: -0.025em; font-weight: 600; }
.an-intro__h em { color: var(--ink-mute); font-weight: 400; }
.an-intro__lede { max-width: 62ch; margin-top: 1.1rem; color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- Modulkarten ---------- */
.an-module {
    max-width: 1280px; margin: 0 auto;
    padding: 0.5rem clamp(1rem,4vw,2.5rem) 2rem;
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
}
.anmod {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    padding: 1.25rem; display: flex; flex-direction: column; gap: 0.55rem;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.anmod:hover { border-color: rgba(20,20,26,0.2); box-shadow: var(--shadow-m); transform: translateY(-2px); }
.anmod.is-active { border-color: var(--yellow-deep); box-shadow: 0 0 0 3px var(--yellow-tint); }
.anmod.is-fehlend { opacity: 0.6; }
.anmod__kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.anmod__kopf h3 { font-family: var(--sans-d); font-size: 1.06rem; font-weight: 600; letter-spacing: -0.01em; }
.anmod__lede { font-size: 0.92rem; color: var(--ink-soft); }
.anmod__zweck { font-size: 0.86rem; color: var(--ink-mute); }
.anmod__quellen, .anmod__fehlt { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-mute); }
.anmod__fehlt { color: var(--red); }
.anmod > button { margin-top: auto; }

/* Auf die Analysen-Ansicht begrenzt: DocGen bringt eine eigene .btn-Regel
   mit, die unverändert bleiben soll. */
#view-analysen .btn {
    background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
    padding: 0.6rem 1.1rem; border-radius: 999px;
    font-size: 0.88rem; font-weight: 500;
    transition: background 0.18s var(--ease), transform 0.18s var(--ease);
}
#view-analysen .btn:hover { background: #2a2a33; transform: translateY(-1px); }
#view-analysen .btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
#view-analysen .btn--block { width: 100%; }
#view-analysen .btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
#view-analysen .btn--ghost:hover { background: var(--paper-warm); }

/* ---------- Stufenkennzeichnung ---------- */
.stufe {
    font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em;
    text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 999px;
    white-space: nowrap;
}
.stufe--ok   { background: var(--green-t); color: var(--green); }
.stufe--warn { background: var(--amber-t); color: var(--amber); }
.stufe--stop { background: var(--red-t);   color: var(--red); }

/* ---------- Ergebnisbereich ---------- */
.an-ergebnis, .an-werkzeug {
    max-width: 1280px; margin: 0 auto 2.5rem;
    padding: 1.75rem clamp(1rem,4vw,2.5rem);
    background: var(--card); border: 1px solid var(--line); border-radius: 18px;
}
.an-ergebnis { margin-left: auto; margin-right: auto; }
.an-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.an-kopf__kicker { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); }
.an-kopf__titel { font-family: var(--sans-d); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; margin-top: 0.2rem; }
.an-kopf__quellen { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-mute); margin-top: 0.4rem; }
.an-kopf__tools { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.an-dauer { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-mute); }

.an-methode {
    margin-top: 1.1rem; padding: 0.85rem 1rem;
    background: var(--paper-warm); border-radius: 10px;
    font-size: 0.88rem; color: var(--ink-soft); line-height: 1.5;
}
.an-methode__ki { color: var(--amber); }
.an-inhalt { margin-top: 1.5rem; }
.an-laedt { display: flex; align-items: center; gap: 0.6rem; color: var(--ink-mute); font-size: 0.92rem; padding: 1.5rem 0; }
.an-fehler { color: var(--red); background: var(--red-t); padding: 0.85rem 1rem; border-radius: 10px; font-size: 0.92rem; }

/* ---------- Kacheln ---------- */
.kacheln { display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); margin-bottom: 1.75rem; }
.kachel { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 12px; padding: 0.95rem 1.05rem; }
.kachel__lbl { display: block; font-size: 0.76rem; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.04em; }
.kachel__wert { display: block; font-family: var(--sans-d); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; margin: 0.25rem 0 0.15rem; }
.kachel__sub { font-size: 0.8rem; color: var(--ink-mute); }
.kachel--gut { border-color: rgba(47,143,91,0.3); background: var(--green-t); }
.kachel--gut .kachel__wert { color: var(--green); }
.kachel--schlecht { border-color: rgba(192,57,43,0.25); background: var(--red-t); }
.kachel--schlecht .kachel__wert { color: var(--red); }
.kachel--warn { border-color: rgba(201,138,18,0.3); background: var(--amber-t); }

/* ---------- Blöcke, Tabellen, Listen ---------- */
.anblock { margin-bottom: 2rem; }
.anblock h3 { font-family: var(--sans-d); font-size: 1.12rem; font-weight: 600; margin-bottom: 0.7rem; letter-spacing: -0.01em; }
.richtung { margin: 1.1rem 0 1.6rem; padding-left: 1rem; border-left: 2px solid var(--line); }
.richtung h4 { font-family: var(--sans-d); font-size: 0.98rem; font-weight: 600; margin-bottom: 0.5rem; }

.antab { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.antab th, .antab td { padding: 0.5rem 0.65rem; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.antab th { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-mute); font-weight: 500; }
.antab td.r, .antab th.r { text-align: right; font-variant-numeric: tabular-nums; }
.antab tbody tr:hover { background: var(--paper); }
.antab .nr { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-mute); margin-right: 0.3rem; }
.antab tr.unvollstaendig { background: rgba(201,138,18,0.06); }

.anliste { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.9rem; }
.anliste li { padding-left: 1rem; position: relative; color: var(--ink-soft); }
.anliste li::before { content: '·'; position: absolute; left: 0.25rem; color: var(--ink-mute); }
.anfakt { font-size: 0.9rem; color: var(--ink-soft); margin: 0.4rem 0; }
.anhint { font-size: 0.84rem; color: var(--ink-mute); margin-top: 0.6rem; line-height: 1.5; }
.anquellen { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-mute); margin-top: 1.2rem; padding-top: 0.8rem; border-top: 1px solid var(--line-soft); }
.an-gut { color: var(--green); }
.an-schlecht { color: var(--red); }
.dim { color: var(--ink-mute); font-size: 0.92em; }

/* ---------- Diagramme ---------- */
.chartbox { margin: 0 0 1.75rem; }
.chartbox figcaption { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-mute); margin-bottom: 0.5rem; }
.chartbox figcaption span { text-transform: none; letter-spacing: 0; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--line-soft); stroke-width: 1; }
.chart__null { stroke: var(--ink-mute); stroke-width: 1; stroke-dasharray: 3 3; }
.chart__ylab, .chart__xlab { font-family: var(--mono); font-size: 10px; fill: var(--ink-mute); }
.chart__ylab { text-anchor: end; }
.chart__xlab { text-anchor: middle; }
.chart__linie { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart__linie--0, .chart__pt--0 { stroke: var(--ink); }
.chart__linie--1, .chart__pt--1 { stroke: var(--yellow-deep); }
.chart__linie--2, .chart__pt--2 { stroke: var(--green); }
.chart__pt { fill: var(--card); stroke-width: 2; }
.chart__bar { fill: var(--ink); }
.chart__bar--neg { fill: var(--red); }
.chart__legende { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-top: 0.5rem; }
.chart__leg { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--ink-soft); }
.chart__sw { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart__sw--0 { background: var(--ink); }
.chart__sw--1 { background: var(--yellow-deep); }
.chart__sw--2 { background: var(--green); }

/* ---------- Zeitband Fahrplan ---------- */
.bedienung { margin: 0.9rem 0 1.4rem; }
.bedienung__kopf { font-size: 0.9rem; color: var(--ink-soft); }
.bandbox { margin-top: 0.5rem; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 10px; padding: 0.6rem 0.8rem 0.3rem; }
.bandbox__titel { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.04em; }
.band { width: 100%; height: auto; overflow: visible; }
.band__grid { stroke: var(--line-soft); }
.band__achse { stroke: var(--line); }
.band__lab { font-family: var(--mono); font-size: 9px; fill: var(--ink-mute); text-anchor: middle; }
.band__seite { font-family: var(--mono); font-size: 9px; fill: var(--ink-mute); }
.band__pt { fill: var(--ink); }
.band__pt--versch { fill: var(--amber); }
.band__pt--neu { fill: var(--green); r: 4.2; }
.band__pt--weg { fill: var(--red); r: 4.2; }

/* ---------- Prüfung Schwellenwerte ---------- */
.pruefung__grid { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); margin-bottom: 0.9rem; }
.pruefung__karte { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 12px; padding: 1rem 1.1rem; }
.pruefung__karte--warn { background: var(--amber-t); border-color: rgba(201,138,18,0.3); }
.pruefung__lbl { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-mute); }
.pruefung__karte strong { display: block; font-family: var(--sans-d); font-size: 1.2rem; font-weight: 600; margin: 0.25rem 0 0.5rem; }
.pruefung__karte p { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 0.4rem; }
.pruefung__warn { color: #8c1d11; font-weight: 500; }
.pruefung__quelle { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-mute); }

.an-werkzeug__kopf h2 { font-family: var(--sans-d); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.an-werkzeug__kopf p { font-size: 0.92rem; color: var(--ink-soft); margin-top: 0.4rem; max-width: 70ch; }
.sw-form { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); align-items: end; margin: 1.3rem 0; }
.sw-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; color: var(--ink-mute); }
.sw-form input[type=number], .sw-form select {
    font-family: var(--sans); font-size: 0.95rem; color: var(--ink);
    padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 9px; background: var(--paper);
}
.sw-check { flex-direction: row !important; align-items: center; gap: 0.5rem !important; }
.sw-ergebnis { margin-top: 0.5rem; }

/* ---------- Eigene Dokumente ---------- */
.up-zone {
    margin: 1.3rem 0 0.8rem; padding: 2rem 1rem;
    border: 1.5px dashed var(--line); border-radius: 14px;
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
    background: var(--paper); text-align: center;
    transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.up-zone:hover, .up-zone.is-ueber { border-color: var(--yellow-deep); background: var(--yellow-tint); }
.up-zone.is-laedt { opacity: 0.4; pointer-events: none; }
.up-laden {
    display: flex; align-items: flex-start; gap: 0.7rem;
    margin-top: 0.8rem; padding: 0.8rem 1rem;
    background: var(--yellow-tint); border-left: 3px solid var(--yellow-deep);
    border-radius: 8px; font-size: 0.9rem; line-height: 1.5;
}
.up-laden .spin { margin-top: 0.15rem; }
.up-laden__sub { display: block; margin-top: 0.15rem; color: var(--ink-soft); font-size: 0.85rem; }
.up-zone__ico { font-size: 1.4rem; color: var(--ink-mute); }
.up-zone__hint { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-mute); }
.up-fehler { color: var(--red); background: var(--red-t); padding: 0.7rem 0.9rem; border-radius: 9px; font-size: 0.88rem; margin-bottom: 0.8rem; }
.up-liste { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); }
.updok { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 12px; padding: 0.9rem 1rem; cursor: pointer; transition: border-color 0.18s var(--ease); }
.updok:hover { border-color: var(--line); }
.updok.is-active { border-color: var(--yellow-deep); box-shadow: 0 0 0 3px var(--yellow-tint); }
.updok__kopf { display: flex; align-items: center; gap: 0.5rem; }
.updok__kopf strong { flex: 1; font-size: 0.92rem; word-break: break-word; }
.updok__weg { color: var(--ink-mute); font-size: 0.9rem; padding: 0.1rem 0.3rem; }
.updok__weg:hover { color: var(--red); }
.updok__meta { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-mute); margin-top: 0.3rem; }
.updok__empf { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.5rem; }
.updok__funde { list-style: none; margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.82rem; }
.updok__bsp { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-mute); }
.updok__verworfen { margin-top: 0.6rem; font-size: 0.8rem; }
.updok__verworfen summary { cursor: pointer; color: var(--ink-mute); font-family: var(--mono); font-size: 0.72rem; }
.updok__verworfen ul { list-style: none; margin: 0.4rem 0; display: flex; flex-direction: column; gap: 0.25rem; color: var(--ink-soft); }
.up-frage { display: flex; gap: 0.6rem; margin-top: 1.1rem; }
.up-frage .ask__in { flex: 1; padding: 0.6rem 0.9rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.95rem; background: var(--paper); }
.up-antwort { margin-top: 1rem; }

/* ---------- Kommentar ---------- */
.an-kommentar { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.an-kommentar__lbl { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-mute); margin-bottom: 0.7rem; }
.an-kommentar__status { display: flex; align-items: center; gap: 0.6rem; color: var(--ink-mute); font-size: 0.9rem; }
.an-kommentar__text { font-size: 0.98rem; line-height: 1.65; color: var(--ink-soft); }
.an-kommentar__text h2, .an-kommentar__text h3 { font-family: var(--sans-d); color: var(--ink); font-size: 1.05rem; font-weight: 600; margin: 1.1rem 0 0.4rem; }
.an-kommentar__text p { margin-bottom: 0.7rem; }
.an-kommentar__text ul, .an-kommentar__text ol { margin: 0.4rem 0 0.8rem 1.2rem; }
.an-kommentar__text li { margin-bottom: 0.25rem; }
.an-kommentar__fuss { margin-top: 1rem; font-size: 0.82rem; color: var(--ink-mute); font-style: italic; }

/* ---------- Synopse ---------- */
.syn { border: 1px solid var(--line-soft); border-radius: 12px; padding: 0.9rem 1.1rem; margin-bottom: 0.8rem; background: var(--paper); }
.syn--neu { border-color: rgba(47,143,91,0.35); background: var(--green-t); }
.syn--gestrichen { border-color: rgba(192,57,43,0.3); background: var(--red-t); }
.syn--geaendert { border-color: rgba(201,138,18,0.3); background: var(--amber-t); }
.syn__kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.5rem; }
.syn__status { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-mute); }
.syn__diff { font-size: 0.92rem; line-height: 1.6; }
.syn__diff del { background: rgba(192,57,43,0.16); color: #8c1d11; text-decoration: line-through; padding: 0 0.15em; }
.syn__diff ins { background: rgba(47,143,91,0.18); color: #1c6b41; text-decoration: none; padding: 0 0.15em; }
.syn__paar { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); }
.syn__lbl { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; color: var(--ink-mute); }
.syn__paar p { font-size: 0.9rem; margin-top: 0.25rem; }

@media (max-width: 720px) {
    .an-kopf { flex-direction: column; }
    .antab { font-size: 0.8rem; }
    .anblock { overflow-x: auto; }
}

/* Zahlen in Auswertungstabellen brechen nicht um: «+761'000 +35.2 %» gehört
   auf eine Zeile, sonst liest sich die Spalte als zwei Werte. */
#view-analysen .antab td.r { white-space: nowrap; }
#view-analysen .antab td.r .dim { white-space: nowrap; }

/* Zeilenweise Synopse: Tabellarische Abschnitte behalten ihre Struktur. */
.syn__zeilen { font-family: var(--mono); font-size: 0.78rem; line-height: 1.5; }
.synz { padding: 0.1rem 0.45rem; border-radius: 4px; white-space: pre-wrap; }
.synz--gleich { color: var(--ink-mute); }
.synz--weg { background: rgba(192,57,43,0.14); color: #8c1d11; text-decoration: line-through; }
.synz--neu { background: rgba(47,143,91,0.16); color: #1c6b41; }

/* ============================================================
   WISSENSBASIS — der verwaltete Dokumentenbestand
   ============================================================ */

.view--wb { max-width: 1100px; margin: 0 auto; padding: 3.5rem 1.5rem 5rem; }

.wb-intro { max-width: 760px; margin-bottom: 2.5rem; }
.wb-intro__h { font-family: var(--sans-d); font-size: clamp(2rem, 4.5vw, 3rem);
    line-height: 1.08; letter-spacing: -0.02em; margin: 0.6rem 0 1rem; }
.wb-intro__h em { font-style: normal; color: var(--ink-mute); }
.wb-intro__lede { color: var(--ink-soft); font-size: 1.02rem; max-width: 62ch; }

/* Kennzahlen */
.wb-kennzahlen { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; }
.wb-kennzahl { background: var(--card); border: 1px solid var(--line-soft);
    border-radius: 12px; padding: 0.85rem 1.15rem; min-width: 150px; }
.wb-kennzahl strong { display: block; font-family: var(--sans-d); font-size: 1.6rem;
    line-height: 1.1; letter-spacing: -0.02em; }
.wb-kennzahl span { font-family: var(--mono); font-size: 0.68rem;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-mute); }
.wb-kennzahl--warn { border-color: var(--amber); background: var(--amber-t); }
.wb-kennzahl--warn strong { color: var(--amber); }

/* Aufnahmeformular */
.wb-neu { background: var(--card); border: 1px solid var(--line-soft);
    border-radius: 16px; padding: 1.5rem; margin-bottom: 2.5rem;
    box-shadow: var(--shadow-s); }
.wb-neu__kopf h2 { font-family: var(--sans-d); font-size: 1.2rem; letter-spacing: -0.01em; }
.wb-neu__kopf p { color: var(--ink-mute); font-size: 0.88rem; margin-top: 0.2rem; }

.wb-zone { margin: 1.15rem 0; border: 1.5px dashed var(--line); border-radius: 12px;
    padding: 1.6rem 1rem; text-align: center; background: var(--paper);
    transition: border-color 0.18s var(--ease), background 0.18s var(--ease); }
.wb-zone:hover, .wb-zone.is-ueber { border-color: var(--yellow-deep); background: var(--yellow-tint); }
.wb-zone.is-gewaehlt { border-style: solid; border-color: var(--green); background: var(--green-t); }
.wb-zone__ico { display: block; font-size: 1.3rem; color: var(--ink-mute); margin-bottom: 0.3rem; }
.wb-zone strong { display: block; font-size: 0.95rem; word-break: break-word; }
.wb-zone__hint { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-mute); }

.wb-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.85rem; }
.wb-feld { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem;
    color: var(--ink-soft); font-weight: 500; }
.wb-feld--voll { grid-column: 1 / -1; }
.wb-feld input, .wb-feld select { font: inherit; font-size: 0.92rem; font-weight: 400;
    color: var(--ink); padding: 0.55rem 0.7rem; border: 1px solid var(--line);
    border-radius: 9px; background: var(--paper); }
.wb-feld input:focus, .wb-feld select:focus { outline: none; border-color: var(--yellow-deep);
    box-shadow: 0 0 0 3px var(--yellow-tint); }
.wb-feld__hilfe { font-weight: 400; font-size: 0.78rem; color: var(--ink-mute); }

.wb-form__fuss { display: flex; align-items: center; gap: 1rem; margin-top: 1.15rem; }
.wb-laden { display: flex; align-items: center; gap: 0.55rem;
    font-size: 0.85rem; color: var(--ink-mute); }

/* Bestand */
.wb-bestand__kopf { display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.wb-bestand__kopf h2 { font-family: var(--sans-d); font-size: 1.35rem; letter-spacing: -0.01em; }
.wb-filter { display: flex; gap: 0.25rem; background: var(--paper-warm);
    border-radius: 999px; padding: 3px; }
.wb-filter__opt { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 0.04em; padding: 0.35rem 0.8rem; border-radius: 999px; color: var(--ink-mute); }
.wb-filter__opt.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-s); }

.wb-liste { display: flex; flex-direction: column; gap: 0.85rem; }
.wb-leer { color: var(--ink-mute); font-size: 0.92rem; background: var(--paper-warm);
    border-radius: 12px; padding: 1.5rem; text-align: center; }

.wbdok { background: var(--card); border: 1px solid var(--line-soft);
    border-radius: 14px; padding: 1.15rem 1.25rem; }
/* Ein Entwurf ist nicht durchsuchbar. Das muss man sehen, ohne das Etikett zu
   lesen — deshalb die Kante an der Seite. */
.wbdok--entwurf { border-left: 3px solid var(--amber); }
.wbdok__titelzeile { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.wbdok__titel { font-family: var(--sans-d); font-size: 1.08rem; letter-spacing: -0.01em;
    line-height: 1.25; }
.wbdok__meta { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-mute);
    margin-top: 0.3rem; }
.wbdok__herkunft { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.35rem; }
.wbdok__befund { font-size: 0.85rem; color: var(--ink-soft); background: var(--paper-warm);
    border-radius: 9px; padding: 0.6rem 0.8rem; margin-top: 0.7rem; }
.wbdok__warn { font-size: 0.85rem; color: var(--amber); background: var(--amber-t);
    border-radius: 9px; padding: 0.6rem 0.8rem; margin-top: 0.7rem; }
.wbdok__akt { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; }
.wbdok__bearbeiten { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line-soft);
    display: flex; flex-direction: column; gap: 0.85rem; align-items: flex-start; }
.btn--weg { color: var(--red); }
.btn--weg:hover { border-color: var(--red); background: var(--red-t); }

/* Etiketten. Die Schutzstufe ist die wichtigste Angabe der Ansicht und wird
   darum als einzige farbig kräftig gesetzt. */
.wb-badge { font-family: var(--mono); font-size: 0.64rem; text-transform: uppercase;
    letter-spacing: 0.05em; padding: 0.22rem 0.55rem; border-radius: 999px;
    white-space: nowrap; }
.wb-badge--vw { background: var(--paper-warm); color: var(--ink-soft); }
.wb-badge--gr { background: var(--yellow); color: var(--ink); font-weight: 600; }
.wb-badge--frei { background: var(--green-t); color: var(--green); }
.wb-badge--entwurf { background: var(--amber-t); color: var(--amber); }

/* Verwaltungsprotokoll */
.wb-protokoll { margin-top: 2.5rem; background: var(--card); border: 1px solid var(--line-soft);
    border-radius: 14px; padding: 1rem 1.25rem; }
.wb-protokoll summary { cursor: pointer; font-family: var(--mono); font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-mute); }
.wb-protokoll__liste { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.wbprot { display: grid; grid-template-columns: 130px 170px 150px 1fr; gap: 0.75rem;
    font-size: 0.82rem; padding: 0.4rem 0; border-top: 1px solid var(--line-soft);
    align-items: baseline; }
.wbprot__zeit { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-mute); }
.wbprot__rolle { font-family: var(--mono); font-size: 0.64rem; color: var(--ink-mute); display: block; }
.wbprot__was { font-weight: 600; }
.wbprot__detail { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-mute); }

@media (max-width: 720px) {
    .wbprot { grid-template-columns: 1fr; gap: 0.15rem; }
    .wb-bestand__kopf { flex-direction: column; align-items: flex-start; }
}
/* Mitgeliefert: kam aus dem Image, nicht von einer Person. Bewusst blass —
   die Angabe ist Herkunft, nicht Schutzstufe, und darf diese nicht überstrahlen. */
.wb-badge--korpus { background: transparent; color: var(--ink-mute);
    border: 1px dashed var(--line); }
