/* LernDock – statische Vorführung (Roadmap 29.7).
 * Eigenständig, kein Bootstrap. Farbwerte = Tokens aus static/css/style.css
 * (hell: :root, dunkel: :root[data-theme="dark"], Akzent "Lerndock Grün").
 */
:root {
    --bg: #f5f5f0;
    --card: #ffffff;
    --surface-subtle: #fafaf7;
    --surface-hover: #f3f4f1;
    --text: #1a1a1a;
    --text-strong: #0f0f0d;
    --muted: #555;
    --border: #dcded8;
    --border-strong: #c9ccc4;
    --accent: #237a57;
    --accent-rgb: 35, 122, 87;
    --accent-hover: #1b5d42;
    --accent-text: #237a57;
    --accent-subtle: #e5efeb;
    --on-accent: #ffffff;
    --warn: #b54708;
    --warn-subtle: #fef6ee;
    --info: #1e4d6b;
    --info-subtle: #e8f4fa;
    --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-raised: 0 6px 20px rgba(16, 24, 40, 0.08);
    --focus-ring: 0 0 0 3px rgba(var(--accent-rgb), 0.3);
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #10100c;
        --card: #1a1a16;
        --surface-subtle: #151512;
        --surface-hover: #22221e;
        --text: #e8e8e5;
        --text-strong: #f2f2ef;
        --muted: #ababa8;
        --border: #33332f;
        --border-strong: #43433f;
        --accent: #237a57;
        --accent-hover: #0b6b49;
        --accent-text: #54a781;
        --accent-subtle: #1c2f24;
        --warn: #f7b27a;
        --warn-subtle: #2b1d12;
        --info: #8cc4e6;
        --info-subtle: #12222c;
        --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-raised: 0 6px 20px rgba(0, 0, 0, 0.45);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
}

h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: clamp(1.75rem, 4vw, 2.4rem); letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; margin-top: 2.5rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.85rem; }
a { color: var(--accent-text); }
a:hover { color: var(--accent-hover); }
code { font-family: var(--mono); font-size: 0.88em; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-md); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.18em; }

/* ---------- Kopf + Rundgang-Navigation ---------- */

.kopf {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.kopf-innen {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.55rem 16px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.marke {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-strong);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.marke img { width: 34px; height: 34px; border-radius: var(--radius-md); }
.marke:hover { color: var(--text-strong); }

.pille {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: var(--accent-subtle);
    color: var(--accent-text);
    white-space: nowrap;
}
.pille-grau { background: var(--surface-hover); color: var(--muted); }
.pille-warn { background: var(--warn-subtle); color: var(--warn); }

.rundgang {
    flex: 1 1 auto;
    min-width: 0;
    position: relative; /* Bezug für offsetLeft (showcase.js) */
    overflow-x: auto;
    scrollbar-width: thin;
}
.rundgang ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.25rem;
    justify-content: flex-end;
}
.rundgang li > a, .rundgang li > span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.65rem;
    border-radius: var(--radius-md);
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}
.rundgang li > a:hover { background: var(--surface-hover); color: var(--text); }
.rundgang .nr {
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    font-size: 0.72rem;
    font-weight: 600;
}
.rundgang [aria-current="page"] { color: var(--accent-text); font-weight: 600; background: var(--accent-subtle); }
.rundgang [aria-current="page"] .nr { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.rundgang .gesperrt { opacity: 0.55; cursor: default; }

.hinweisband {
    background: var(--accent-subtle);
    color: var(--text);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.hinweisband p {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.4rem 16px;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.hinweisband .icon { color: var(--accent-text); }

@media (max-width: 760px) {
    .kopf { position: static; }
    .kopf-innen { flex-direction: column; align-items: stretch; gap: 0.35rem; padding-bottom: 0.35rem; }
    .rundgang ol { justify-content: flex-start; }
}

/* ---------- Seitengerüst ---------- */

main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem 16px 3rem;
}

.einleitung { max-width: 46rem; color: var(--muted); font-size: 1.05rem; }

.fuss {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
}
.fuss-innen {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.25rem 16px 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    align-items: center;
    justify-content: space-between;
}

/* ---------- Bausteine ---------- */

.karte {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.15rem 1.2rem;
    box-shadow: var(--shadow-card);
}
.karte > :last-child { margin-bottom: 0; }

.raster {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.raster-eng { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }

.symbolkopf { display: flex; gap: 0.7rem; align-items: flex-start; }
.symbol {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: var(--radius-lg);
    background: var(--accent-subtle);
    color: var(--accent-text);
    flex-shrink: 0;
}
.symbol .icon { width: 1.3rem; height: 1.3rem; }
.symbolkopf h3 { margin-top: 0.3rem; }
.karte .klein, .klein { font-size: 0.9rem; color: var(--muted); }

.knopf {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.05rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--on-accent);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.knopf:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.knopf-zweit { background: transparent; color: var(--accent-text); }
.knopf-zweit:hover { background: var(--accent-subtle); color: var(--accent-text); }

/* ---------- Startseite ---------- */

.held {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2rem;
    align-items: center;
    padding: 1rem 0 0.5rem;
}
.held img { width: 168px; height: 168px; border-radius: 28px; box-shadow: var(--shadow-raised); }
.held .einleitung { margin-bottom: 1.25rem; }
.held-knoepfe { display: flex; flex-wrap: wrap; gap: 0.6rem; }
@media (max-width: 640px) {
    .held { grid-template-columns: 1fr; }
    .held img { width: 96px; height: 96px; border-radius: 18px; order: -1; }
}

.stationen { counter-reset: station; list-style: none; padding: 0; margin: 0; }
.station {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
a.station:hover { border-color: var(--accent); box-shadow: var(--shadow-raised); color: inherit; }
.station .nr {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
    flex-shrink: 0;
}
.station.gesperrt .nr { background: var(--border-strong); color: var(--card); }
.station h3 { margin: 0.2rem 0 0.25rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.station p { margin: 0; font-size: 0.92rem; color: var(--muted); }

.zahlen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 1rem;
}
.zahl { text-align: left; }
.zahl b { display: block; font-size: 1.9rem; color: var(--accent-text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.zahl span { font-size: 0.9rem; color: var(--muted); }

.liste-haken { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.liste-haken li { display: flex; gap: 0.55rem; align-items: flex-start; }
.liste-haken .icon { color: var(--accent-text); margin-top: 0.2rem; }

/* ---------- Architektur ---------- */

.arch {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 900px) { .arch { grid-template-columns: 1fr; } }

.schichten { display: grid; gap: 0.35rem; }
.schicht {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 0.7rem;
    background: var(--surface-subtle);
}
.schicht-titel {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin: 0 0 0.5rem 0.15rem;
}
.schicht-boxen { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.schicht-boxen + .schicht-boxen { margin-top: 0.5rem; }
/* vier Kästen: lieber 2 × 2 als 3 + 1 */
.schicht-boxen-breit { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.schicht-app { border-style: solid; border-color: var(--accent); background: var(--card); }
.schicht-extern { border-color: var(--info); }

.pfeil {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.78rem;
    min-height: 1.6rem;
}
.pfeil::before {
    content: "";
    width: 2px;
    height: 1.2rem;
    background: var(--border-strong);
}

.box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    text-align: left;
    width: 100%;
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-card);
}
.box:hover { border-color: var(--accent); }
.box b { display: flex; gap: 0.4rem; align-items: center; font-size: 0.92rem; color: var(--text-strong); }
.box span { font-size: 0.78rem; color: var(--muted); }
.box .icon { color: var(--accent-text); }
.box[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-subtle); box-shadow: 0 0 0 1px var(--accent); }
.box-schutz .icon { color: var(--warn); }
.schicht-extern .box .icon { color: var(--info); }

.detail { position: sticky; top: 6.5rem; }
@media (max-width: 900px) { .detail { position: static; } }
.detail h3 { display: flex; gap: 0.5rem; align-items: center; font-size: 1.15rem; }
.detail .icon { color: var(--accent-text); }
.detail ul { margin: 0 0 0.85rem; padding-left: 1.15rem; }
.detail li { margin-bottom: 0.3rem; }
.detail .code { font-size: 0.82rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 0.6rem; }

.ablauf { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.ablauf li {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr);
    gap: 0.85rem;
    position: relative;
    padding-bottom: 1.15rem;
}
.ablauf li:not(:last-child)::before {
    content: "";
    position: absolute;
    left: calc(1.1rem - 1px);
    top: 2.2rem;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.ablauf .nr {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--accent);
    color: var(--accent-text);
    font-weight: 700;
}
.ablauf h3 { margin: 0.3rem 0 0.2rem; }
.ablauf p { margin: 0; color: var(--muted); font-size: 0.94rem; }

.vorher-nachher {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 0.5rem;
    margin-top: 0.6rem;
}
.vorher-nachher div {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.5rem 0.7rem;
    background: var(--card);
    font-size: 0.9rem;
}
.vorher-nachher small { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
mark.klar { background: var(--warn-subtle); color: var(--warn); border-radius: 3px; padding: 0 0.2em; }
mark.code { background: var(--accent-subtle); color: var(--accent-text); border-radius: 3px; padding: 0 0.2em; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0; }
.chips li {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.86rem;
}
.chips li b { font-weight: 600; }

/* ---------- Kinderakte (29.7 b) ---------- */

.pfad { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; }
.akte-kopf { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end; justify-content: space-between; }
.akte-kopf h1 { margin-bottom: 0.2rem; }
.akte-code { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; color: var(--muted); margin-bottom: 0.75rem; }
.akte-code code { font-weight: 600; color: var(--accent-text); }
.akte-zahlen { display: flex; gap: 1.5rem; margin-bottom: 0.85rem; }
.akte-zahlen b { display: block; font-size: 1.5rem; color: var(--accent-text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.akte-zahlen span { font-size: 0.8rem; color: var(--muted); }

.reiter {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    margin: 1.5rem 0 1.25rem;
    overflow-x: auto;
}
.reiter [role="tab"] {
    font: inherit;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}
.reiter [role="tab"]:hover { color: var(--text); }
.reiter [aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); }
.reiterfeld { display: grid; gap: 1rem; }
.reiterfeld[hidden] { display: none; }

.raster-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.karte h3 + .klein { margin-bottom: 1rem; }

.felder { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; gap: 0.45rem 1rem; margin: 0 0 0.85rem; font-size: 0.92rem; }
.felder dt { color: var(--muted); font-weight: 600; }
.felder dd { margin: 0; }
@media (max-width: 480px) { .felder { grid-template-columns: 1fr; gap: 0.1rem; } .felder dd { margin-bottom: 0.5rem; } }

.ki-box { border-left: 4px solid var(--accent); }
.feldname { display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0.75rem 0 0.3rem; }
textarea {
    width: 100%;
    font: inherit;
    font-size: 0.92rem;
    color: var(--text);
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.55rem 0.7rem;
    resize: vertical;
}
.knopfzeile { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.85rem; }
.knopf:disabled { opacity: 0.55; cursor: default; }
.status { font-size: 0.9rem; color: var(--muted); display: inline-flex; gap: 0.45rem; align-items: center; }

.kreisel {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent);
    display: inline-block;
    flex-shrink: 0;
}
@media (prefers-reduced-motion: no-preference) {
    .kreisel { animation: drehen 0.8s linear infinite; }
    .plan-bereich.neu { animation: auftauchen 0.4s ease-out; }
}
@keyframes drehen { to { transform: rotate(360deg); } }
@keyframes auftauchen { from { opacity: 0; transform: translateY(6px); } }

.plan { display: grid; gap: 1rem; }
.plan-kopf { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: space-between; }
.plan-kopf h3 { margin: 0; }
.plan-spalten { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.plan-spalten p { margin: 0; font-size: 0.92rem; }
.plan-bereich.leer { border-style: dashed; background: var(--surface-subtle); }
.plan-bereich.neu { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }

.notiz { background: var(--surface-subtle); }
.abstand { margin-top: 0.75rem; }

.verlauf { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.verlauf > li {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 0.75rem 0.9rem;
    box-shadow: var(--shadow-card);
}
.verlauf > li.entfallen { border-left-color: var(--border-strong); background: var(--surface-subtle); box-shadow: none; }
.verlauf > li > p { margin: 0.45rem 0 0; font-size: 0.94rem; }
.verlauf-kopf { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; }
.chips-klein { margin-top: 0.45rem; }
.chips-klein li { font-size: 0.78rem; padding: 0.1rem 0.55rem; background: var(--surface-subtle); }

.schritte { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.4rem; font-size: 0.92rem; }
.schritte li { display: flex; gap: 0.5rem; align-items: center; color: var(--muted); }
.schritte li.erledigt { color: var(--text); }
.schritte li.erledigt .icon { color: var(--accent-text); }

.dokument {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-raised);
    padding: clamp(1.1rem, 4vw, 2.25rem);
    max-width: 46rem;
}
.dokument header { border-bottom: 2px solid var(--accent); padding-bottom: 0.6rem; margin-bottom: 1rem; }
.dokument header h3 { font-size: 1.3rem; margin: 0; }
.dokument header p { margin: 0.2rem 0 0; }
.dokument h4 { font-size: 0.95rem; margin: 1.1rem 0 0.3rem; color: var(--accent-text); }
.dokument p.absatz { margin: 0; font-size: 0.96rem; }
.dokument-fuss { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 0.85rem; }
.dokument-fuss .knopf { margin-left: auto; padding: 0.4rem 0.8rem; font-size: 0.88rem; }

/* ---------- Materialbibliothek (29.7 c) ---------- */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

input[type="search"], input[type="text"] {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 0.5rem 0.7rem;
}
input:focus-visible, textarea:focus-visible { border-color: var(--accent); }

.werkzeugleiste { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 1.25rem 0; }
.suche { flex: 1 1 260px; position: relative; display: block; }
.suche .icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.suche input { padding-left: 2.2rem; }

#upload { margin-bottom: 1.25rem; }

.bibliothek { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 820px) { .bibliothek { grid-template-columns: 1fr; } }
.navi { position: sticky; top: 6.5rem; padding: 0.9rem; }
.navi h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0.25rem 0 0.4rem 0.35rem; }
.navi h3 + .navi-liste { margin-bottom: 0.9rem; }
.navi-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; }
.navi-themen { margin: 0.15rem 0 0.3rem 0.85rem; padding-left: 0.5rem; border-left: 2px solid var(--border); }
.navi-knopf {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    color: var(--text);
    background: none;
    border: 0;
    border-radius: var(--radius-md);
    padding: 0.35rem 0.5rem;
    cursor: pointer;
}
.navi-knopf:hover { background: var(--surface-hover); }
.navi-knopf[aria-pressed="true"] { background: var(--accent-subtle); color: var(--accent-text); font-weight: 600; }
.zahl-klein { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.navi-fuss { border-top: 1px solid var(--border); padding-top: 0.6rem; margin: 0.4rem 0 0 0.35rem; }
.navi-fuss span { font-weight: 700; color: var(--accent-text); }

.ergebnis { margin: 0 0 0.6rem; }
.material-raster { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.material { display: flex; flex-direction: column; gap: 0.35rem; }
.material h3 { margin: 0.2rem 0 0; }
.material p.klein { margin: 0; }
.material .chips { margin-top: auto; padding-top: 0.35rem; }
.material.neu { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.material-kopf { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.taxo { display: flex; gap: 0.35rem; align-items: flex-start; font-size: 0.8rem; color: var(--accent-text); margin: 0.2rem 0 0; }
.taxo .icon { margin-top: 0.15rem; }

.dateiliste { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.dateiliste li { display: flex; gap: 0.6rem; align-items: center; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-subtle); }
.dateiliste li div { display: flex; flex-direction: column; min-width: 0; }
.dateiliste b { font-family: var(--mono); font-size: 0.82rem; font-weight: 600; overflow-wrap: anywhere; }
.datei-status { display: grid; place-items: center; width: 1.3rem; color: var(--muted); }
.dateiliste li.fertig .datei-status { color: var(--accent-text); }
.dateiliste li.warnung .datei-status { color: var(--warn); }

.pruefung { display: grid; gap: 0.75rem; margin-top: 1rem; }
.pruef-zeile { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.75rem 0.85rem; background: var(--card); }
.pruef-zeile .feldname { margin-top: 0.6rem; }
.pruef-zeile > p { margin: 0.4rem 0 0; }
.pruef-zeile > p.klein .icon { color: var(--accent-text); margin-right: 0.3rem; }
.pruef-zeile.duplikat { border-style: dashed; background: var(--surface-subtle); }
.pruef-zeile.duplikat b { font-family: var(--mono); font-size: 0.82rem; }
.tag-ok { border-color: var(--accent) !important; color: var(--accent-text); }
.neuer-tag { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; align-items: center; margin-top: 0.3rem; }
.wahl { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-md); overflow: hidden; margin-left: auto; }
.mini { font: inherit; font-size: 0.8rem; padding: 0.25rem 0.6rem; border: 0; background: var(--card); color: var(--muted); cursor: pointer; }
.mini + .mini { border-left: 1px solid var(--border-strong); }
.mini[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

@media (max-width: 820px) {
    /* schmal: Navigation als umbrechende Chips statt langer Liste */
    .navi { position: static; }
    .navi-liste { display: flex; flex-wrap: wrap; gap: 0.3rem; }
    .navi-liste > li:has(.navi-themen) { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.3rem; }
    .navi-knopf { width: auto; border: 1px solid var(--border); border-radius: 999px; padding: 0.25rem 0.65rem; }
    .navi-themen { margin: 0; padding: 0; border-left: 0; }
}

/* ---------- Wissenssuche (29.7 d) ---------- */
.frage-karte .werkzeugleiste { margin: 0 0 0.9rem; }
.beispiel-titel { margin: 0 0 0.4rem; }
.beispiele { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.beispiel {
    font: inherit;
    font-size: 0.88rem;
    text-align: left;
    color: var(--text);
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
}
.beispiel:hover:not(:disabled) { border-color: var(--accent); }
.beispiel[aria-pressed="true"] { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent-text); }
.beispiel:disabled, .knopf:disabled { cursor: default; opacity: 0.6; }
.frage-karte .status:not(:empty) { margin: 0.75rem 0 0; }

.wissen-ergebnis { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; margin-top: 1.25rem; scroll-margin-top: 6.5rem; }
@media (max-width: 900px) { .wissen-ergebnis { grid-template-columns: 1fr; } }
.antwort h2, .quellen h2 { font-size: 1.15rem; margin: 0; }
.antwort-frage { margin: 0.3rem 0 0.8rem; font-style: italic; }
#antwort p { margin: 0 0 0.75rem; }
a.fn {
    display: inline-grid;
    place-items: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.25rem;
    margin-left: 0.1rem;
    vertical-align: super;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    color: var(--on-accent);
    background: var(--accent);
    border-radius: 999px;
}
a.fn:hover, a.fn:focus-visible { background: var(--accent-text); }
.prompt {
    margin: 0.9rem 0 0;
    padding: 0.8rem 0.9rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.quellen { position: sticky; top: 6.5rem; }
@media (max-width: 900px) { .quellen { position: static; } }
.quellen-liste { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.quellen-liste > li { display: flex; gap: 0.6rem; padding: 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-lg); scroll-margin-top: 7rem; outline: none; }
.quellen-liste > li > div { min-width: 0; flex: 1; }
.quellen-liste > li.aktiv { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.quellen-liste > li.keine { border-style: dashed; }
.quellen-liste > li.keine p { margin: 0; }
.fn-nr { flex: none; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.8rem; font-weight: 700; }
.quelle-meta { display: flex; gap: 0.5rem; align-items: center; margin: 0.25rem 0 0.4rem; }
.quellen blockquote { margin: 0.4rem 0 0; padding: 0.4rem 0.6rem; font-size: 0.86rem; border-left: 3px solid var(--border-strong); background: var(--surface-subtle); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.naehe { display: block; height: 4px; margin-top: 0.4rem; background: var(--border); border-radius: 2px; overflow: hidden; }
.naehe span { display: block; height: 100%; width: 0; background: var(--accent); }
#weitere h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1.1rem 0 0.4rem; }
.weitere-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.weitere-liste li { padding: 0.5rem 0.6rem; border: 1px dashed var(--border); border-radius: var(--radius-lg); color: var(--muted); font-size: 0.88rem; }
.weitere-liste p { margin: 0.2rem 0 0; }
.weitere-liste .naehe span { background: var(--muted); }

/* ---------- Assistent (29.7 e) ---------- */
.assistent { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; margin-top: 1.25rem; }
@media (max-width: 900px) { .assistent { grid-template-columns: 1fr; } }
.chat { display: flex; flex-direction: column; gap: 0.75rem; }
.chat-kopf { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: space-between; }
.chat-kopf h2, .akte-ausschnitt h2 { font-size: 1.15rem; margin: 0; }
.chat-kopf .knopf { padding: 0.4rem 0.8rem; font-size: 0.88rem; }
.ki-legende { border: 1px dashed var(--accent); border-radius: var(--radius-lg); padding: 0.5rem 0.75rem; background: var(--accent-subtle); }
.ki-legende p { margin: 0.15rem 0; }
.verlauf-chat { list-style: none; margin: 0; padding: 0.25rem; display: flex; flex-direction: column; gap: 0.75rem; min-height: 12rem; max-height: 34rem; overflow-y: auto; }
.verlauf-chat:empty::before { content: "Noch keine Nachricht. „Nächste Nachricht“ startet das Beispiel."; color: var(--muted); font-size: 0.9rem; margin: auto; text-align: center; }
.verlauf-chat li { display: flex; }
.verlauf-chat .blase { max-width: 88%; padding: 0.6rem 0.8rem; border-radius: var(--radius-lg); font-size: 0.94rem; min-width: 0; }
.verlauf-chat .nutzer { justify-content: flex-end; }
.verlauf-chat .nutzer .blase { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.verlauf-chat .nutzer mark.code { background: var(--card); }
.verlauf-chat .ki .blase { background: var(--surface-subtle); border: 1px solid var(--border); border-bottom-left-radius: 4px; flex: 1; }
.verlauf-chat .ki p { margin: 0.35rem 0 0; }
.werkzeug { display: flex; gap: 0.4rem; align-items: center; font-size: 0.82rem; color: var(--muted); }
.werkzeug + .werkzeug { margin-top: 0.2rem; }
.werkzeug.erledigt .icon { color: var(--accent-text); }
.verlauf-chat .prompt { margin: 0.3rem 0 0.5rem; font-size: 0.74rem; }
.aktion-karte { margin-top: 0.7rem; padding: 0.7rem 0.8rem; border: 1px solid var(--accent); border-radius: var(--radius-lg); background: var(--card); }
.aktion-karte h3 { font-size: 0.95rem; margin: 0; }
.aktion-karte .felder { margin: 0.5rem 0 0; font-size: 0.88rem; }
.aktion-karte.status-verworfen, .aktion-karte.status-rueckgaengig { border-color: var(--border); border-style: dashed; }
.aktion-karte .knopfzeile { margin-top: 0.6rem; align-items: center; }
.aktion-karte .knopf { padding: 0.4rem 0.85rem; font-size: 0.88rem; }
.hinweis { display: flex; gap: 0.35rem; align-items: flex-start; margin: 0.4rem 0 0; }
.hinweis .icon { flex: none; margin-top: 0.15rem; color: var(--accent-text); }
.chat-eingabe { display: flex; gap: 0.5rem; }
.chat-eingabe input { flex: 1; min-width: 0; }
.chat-fuss { margin: 0; }

.akte-ausschnitt { position: sticky; top: 6.5rem; scroll-margin-top: 6.5rem; }
@media (max-width: 900px) { .akte-ausschnitt { position: static; } }
.akte-ausschnitt > p.klein { margin: 0.3rem 0 0; }
.akte-ausschnitt h3 { display: flex; gap: 0.4rem; align-items: center; font-size: 0.9rem; margin: 1rem 0 0.45rem; }
.eintraege { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.eintraege li { padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: 0.88rem; }
.eintraege li.neu { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.eintraege p { margin: 0.25rem 0 0; }
.eintrag-kopf { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.profil-notizen { white-space: pre-wrap; font-size: 0.88rem; padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-subtle); }

.sprunglink { position: absolute; left: 16px; top: -4rem; z-index: 50; padding: 0.5rem 0.9rem; background: var(--card); color: var(--accent-text); border: 1px solid var(--accent); border-radius: var(--radius-md); }
.sprunglink:focus { top: 0.5rem; }
main:focus { outline: none; box-shadow: none; }

.noscript { background: var(--warn-subtle); color: var(--warn); padding: 0.75rem 16px; text-align: center; }

@media (prefers-reduced-motion: no-preference) {
    .box, a.station, .knopf { transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; }
}

/* Echte Oberfläche (29.8): Übersicht der eingefrorenen Ansichten */
.raster-ansichten { list-style: none; padding: 0; margin: 1.5rem 0 2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.ansicht { display: block; height: 100%; text-decoration: none; color: inherit; }
.ansicht:hover, .ansicht:focus-visible { border-color: var(--accent); box-shadow: var(--shadow-raised); }
.ansicht img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; object-position: top;
    border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-subtle); margin-bottom: 0.75rem; }
.ansicht h3 { margin: 0 0 0.25rem; }
