/* Montserrat – lokal gehostet (kein Google-Fonts-CDN, DSGVO), OFL 1.1.
   Variable Fonts, Gewichtsachse 400–700. Siehe static/fonts/SOURCE.md. */
@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/montserrat-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
        U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/montserrat-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
        U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
        U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
        U+A720-A7FF;
}

:root {
    --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
    --orange: #e28522;
    --orange-dark: #c46f12;
    --orange-soft: #fbeedd;
    --text: #50656e;
    --muted: #8a969c;
    --border: #e7e0d6;
    --bg: #faf8f4;
    --surface: #ffffff;
    --sidebar-eval: #f4f7fb;
    /* warmes Oliv für „erledigt/freigegeben"-Zustände – harmoniert mit
       Creme/Orange besser als ein kühles Grün */
    --ok: #63702f;
    --ok-border: #cbd3a3;
    --ok-bg: #f3f5e8;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(60, 46, 25, .05), 0 8px 24px rgba(60, 46, 25, .06);
    --shadow-sm: 0 1px 2px rgba(60, 46, 25, .06);
    --nav-w: 236px;
    --nav-rail: 60px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Überschriften: Montserrat Light */
h1, h2, h3, h4 {
    font-weight: 300;
    letter-spacing: -.01em;
    line-height: 1.2;
}

a { color: var(--orange-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Einheitlicher Tastatur-Fokus im Portal */
.portal-main a:focus-visible,
.pnav a:focus-visible,
.portal-header a:focus-visible,
.portal-header button:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Header */
.portal-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.portal-brand { display: flex; align-items: center; }
.portal-logo { height: 38px; width: auto; display: block; }
.portal-usernav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    font-size: .88rem;
}
.portal-user { color: var(--muted); }
.portal-logout { margin: 0; }
.portal-logout button {
    background: none;
    border: none;
    color: var(--orange-dark);
    cursor: pointer;
    font: inherit;
    padding: 0;
}
.portal-logout button:hover { text-decoration: underline; }

.pnav-toggle {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.pnav-toggle:hover { background: var(--orange-soft); border-color: var(--orange); }
.pnav-toggle svg { width: 20px; height: 20px; }

/* Ein-/Ausklappen direkt in der Menükarte */
.pnav-collapse {
    align-self: flex-end;
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin: 0 0 2px auto;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}
.pnav-collapse:hover { background: rgba(226, 133, 34, .12); color: var(--orange-dark); }
.pnav-collapse svg { width: 18px; height: 18px; transition: transform .2s ease; }
.pnav-collapsed .pnav-collapse { align-self: center; margin: 0 auto 4px; }
.pnav-collapsed .pnav-collapse svg { transform: rotate(180deg); }

/* Layout */
.portal-layout {
    display: flex;
    align-items: flex-start;
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px;
    gap: 26px;
}

/* Seitennavigation */
.pnav {
    flex: 0 0 var(--nav-w);
    position: sticky;
    top: 74px;
    align-self: flex-start;
    overflow: visible;
    /* über dem Inhalt der Hauptspalte, damit Flyouts nicht hinter
       Grafiken/Karten verschwinden (unter der Kopfzeile, z-index 30). */
    z-index: 20;
    transition: flex-basis .2s ease;
}
.pnav-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    max-height: calc(100vh - 94px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
/* eingeklappte Schiene: kein Clipping, damit Flyouts herausragen */
.pnav-collapsed .pnav-inner { overflow: visible; max-height: none; }
.pnav-group { position: relative; border-radius: 10px; }
.pnav-group.is-current { background: rgba(226, 133, 34, .06); }

.pnav-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    font-size: .84rem;
    letter-spacing: .01em;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
}
.pnav-head:hover { background: rgba(226, 133, 34, .08); }
.pnav-group.is-current .pnav-head { color: var(--orange-dark); }
.pnav-icon { width: 20px; height: 20px; flex: none; color: var(--muted); }
.pnav-group.is-current .pnav-icon { color: var(--orange); }
.pnav-group.is-eval .pnav-title::after {
    content: " · intern";
    font-weight: 400;
    font-size: .78rem;
    color: var(--muted);
}

.pnav-list {
    list-style: none;
    margin: 0 0 2px;
    padding: 0 4px 4px 40px;
    font-size: .9rem;
    overflow: hidden;
}
.pnav-list li { margin: 1px 0; }
.pnav-list a {
    display: block;
    padding: 5px 10px;
    color: var(--text);
    border-radius: 7px;
    transition: background .12s, color .12s;
}
.pnav-list a:hover { background: rgba(226, 133, 34, .1); text-decoration: none; }
.pnav-list li.aktiv a {
    background: rgba(226, 133, 34, .16);
    color: var(--orange-dark);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--orange);
}

/* Akkordeon (Vollansicht) */
.pnav-group.is-shut .pnav-list { display: none; }

/* Icon-Schiene (Desktop, eingeklappt) */
.pnav-collapsed .pnav { flex-basis: var(--nav-rail); }
.pnav-collapsed .pnav-inner { padding: 6px; }
.pnav-collapsed .pnav-head {
    justify-content: center;
    padding: 10px 0;
}
.pnav-collapsed .pnav-title { display: none; }
.pnav-collapsed .pnav-list { display: none; }

.pnav-collapsed .pnav-group.is-flyout > .pnav-list,
.pnav-collapsed .pnav-group:hover > .pnav-list {
    display: block;
    position: absolute;
    left: calc(100% + 10px);
    top: -4px;
    bottom: auto;
    min-width: 210px;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 40;
}
/* Flyout nach oben aufklappen, wenn unten kein Platz ist (Klasse per JS) */
.pnav-collapsed .pnav-group.flyout-oben.is-flyout > .pnav-list,
.pnav-collapsed .pnav-group.flyout-oben:hover > .pnav-list {
    top: auto;
    bottom: -4px;
}
.pnav-collapsed .pnav-group.is-flyout > .pnav-list::before,
.pnav-collapsed .pnav-group:hover > .pnav-list::before {
    content: attr(data-titel);
    display: block;
    padding: 2px 10px 7px;
    font-weight: 600;
    font-size: .78rem;
    color: var(--muted);
}
.pnav-collapsed .pnav-group.is-flyout::after,
.pnav-collapsed .pnav-group:hover::after {
    content: "";
    position: absolute;
    left: calc(100% + 3px);
    top: 15px;
    border: 6px solid transparent;
    border-right-color: var(--border);
}

/* mobiles Off-Canvas-Menü */
.pnav-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(40, 32, 20, .38);
}

/* Main */
.portal-main {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 28px 34px;
}
.portal-main h1 { color: var(--orange); }
.portal-seite h1 {
    color: var(--orange);
    font-size: 1.9rem;
    margin-top: 0;
}
.portal-seite h2 { color: #444; margin-top: 1.6em; }
.portal-seite img { max-width: 100%; height: auto; }
.portal-seite table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: 1.3em 0;
    font-size: .95rem;
}
.portal-seite th,
.portal-seite td {
    padding: 9px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}
.portal-seite th {
    font-weight: 600;
    color: var(--muted);
    border-bottom: 2px solid var(--text);
}
.portal-seite tbody tr:last-child td { border-bottom: 0; }
.portal-seite tbody tr:hover td { background: rgba(226, 133, 34, .05); }

/* Begrüßungsseite (Logo-Klick) */
.portal-willkommen-bild {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    margin: 0 auto 8px;
}
.portal-willkommen h1 {
    color: var(--orange);
    font-size: 1.9rem;
    margin: 0 0 .4em;
}
.portal-willkommen p { max-width: 46em; }

/* Text-/Info-Seiten mit rechts eingebettetem Bild (Überblick, Vorgehensweise …) */
.portal-ueberblick h1,
.portal-textseite h1 { color: var(--orange); }
.portal-ueberblick h2 {
    color: var(--orange);
    font-size: 1.15rem;
    margin: 1.6em 0 .3em;
}
.portal-ueberblick p,
.portal-textseite p { max-width: 44em; }
.portal-ueberblick-bild,
.portal-textseite-bild {
    float: right;
    width: 300px;
    max-width: 44%;
    height: auto;
    margin: 4px 40px 16px 28px;
}
.portal-textseite-bild { margin-top: 90px; }
.portal-bild-klein { width: 180px; max-width: 30%; margin-top: 20px; }
.portal-bild-da { width: 360px; max-width: 48%; margin: 0 0 12px 30px; }

/* QR-Code auf der Elternumfrage-Seite */
.portal-qr { margin: 18px 0 8px; }
.portal-qr img {
    display: block;
    width: 180px;
    height: 180px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 8px;
}
.portal-qr-links { margin: 8px 0 0; font-size: .9rem; max-width: 44em; }

/* „Eingegangene Antworten prüfen" */
.portal-stand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.portal-stand-ergebnis { color: var(--muted); }

/* Status: Umfrage offen / geschlossen */
.portal-umfrage-status {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--border);
    font-size: .9rem;
    margin: 0 0 1em;
}
.portal-umfrage-status-offen { border-color: var(--ok-border); background: var(--ok-bg); }
.portal-umfrage-status-zu { border-color: #f0d9ad; background: #fff8ec; }

/* Datei-Upload (Dokumentenanalyse) */
.portal-upload { max-width: 44em; margin: 4px 0 12px; }
.portal-upload-zone {
    border: 2px dashed var(--border);
    background: #fafafa;
    padding: 28px 20px;
    text-align: center;
    color: var(--muted);
}
.portal-upload-zone.is-over { border-color: var(--orange); background: #fff6ec; }
.portal-upload-zone p { margin: 0; }
.portal-upload-waehlen {
    color: var(--orange);
    cursor: pointer;
    text-decoration: underline;
}
.portal-upload-liste { list-style: none; padding: 0; max-width: 44em; margin: 10px 0 12px; }
.portal-upload-liste li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.portal-upload-liste li > a { flex: 1 1 auto; }
.portal-upload-loeschen { margin: 0; }

/* Audio-Liste (Material & Orga -> Audios) */
.portal-audio-liste { list-style: none; padding: 0; margin: 6px 0 16px; }
.portal-audio-zeile { padding: 9px 0; border-bottom: 1px solid var(--border); }
.portal-audio-kopf {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
.portal-audio-name { min-width: 0; overflow-wrap: anywhere; font-size: .95rem; }
.portal-audio-zweite {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.portal-audio-zweite audio {
    flex: 0 1 380px;
    min-width: 200px;
    height: 32px;
    /* Ohne dies rendern manche Browser (je nach OS-Farbschema) den nativen
       Player als dunklen Kasten mit eckigen Ecken statt im Seiten-Look. */
    color-scheme: light;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--border);
}
.portal-audio-bereich { margin: 0; flex-shrink: 0; }
.portal-audio-bereich select {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    font: inherit;
    font-size: .8rem;
}
.portal-audio-aktionen { display: flex; gap: 6px; flex-shrink: 0; }
.portal-audio-aktionen form { margin: 0; }
.portal-audio-aktionen .portal-btn { padding: 4px 10px; font-size: .8rem; }
.portal-audio-fehlertext {
    margin: 6px 0 0;
    font-size: .85rem;
    color: #ba2121;
}
.portal-gruppenkopf {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.portal-gruppenkopf .portal-check-gruppe { flex: 1 1 auto; margin-bottom: 0; }
.portal-gruppenkopf form { margin: 0 0 8px; }

/* Checkliste / Dokumente-Seite (Dokumentenanalyse) */
.portal-check-gruppe {
    font-size: 1.05rem;
    color: var(--orange);
    margin: 28px 0 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--border);
}
.portal-check-haken { margin: 0; white-space: nowrap; }
.portal-check-haken input { vertical-align: middle; margin-right: 6px; }
.portal-check-haken-ro { color: var(--ok); font-size: .9rem; white-space: nowrap; }
.portal-check-upload { max-width: 34em; margin: 10px 0 2px; }
.portal-check-upload .portal-upload-zone { padding: 16px 14px; font-size: .9rem; }
.portal-check-gesichtet {
    margin: 6px 0 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 34em;
}
.portal-check-zuordnen { margin: 0; display: flex; align-items: center; gap: 8px; }
.portal-check-gesichtet input[type="number"] { width: 5.5em; }
.portal-check-gesichtet .portal-gesichtet-anzahl { white-space: nowrap; }
.portal-check-gesichtet textarea {
    flex: 1 1 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    font: inherit;
    font-size: .88rem;
    resize: vertical;
}

/* Dokumentenliste (Material & Orga → Dokumente, ganz unten) */
.portal-doku-liste { margin: 28px 0 10px; }
.portal-doku-liste p { margin: 8px 0; }
.portal-doku-liste-text {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    line-height: 1.5;
    resize: vertical;
    overflow: hidden;
}

/* Checkliste als Akkordeon (aufklappbare Zeilen) */
.portal-akk-liste { margin: 0 0 8px; }
.portal-akk {
    border-bottom: 1px solid var(--border);
}
.portal-akk-kopf {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 2px;
    cursor: pointer;
    list-style: none;
}
.portal-akk-kopf::-webkit-details-marker { display: none; }
.portal-akk-kopf:hover { background: #faf7f2; }
.portal-akk-chevron {
    flex: none;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid var(--muted);
    transition: transform .12s ease;
}
.portal-akk[open] > .portal-akk-kopf .portal-akk-chevron { transform: rotate(90deg); }
.portal-akk-titel { flex: 1 1 auto; }
.portal-akk-status {
    flex: none;
    font-size: .74rem;
    font-weight: 400;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: 2px 9px;
    border-radius: 3px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: #fff;
}
.portal-akk-status-ok {
    color: var(--ok);
    border-color: var(--ok-border);
    background: var(--ok-bg);
}
.portal-akk-status-erledigt {
    color: #fff;
    border-color: var(--ok);
    background: var(--ok);
}
.portal-akk-status-offen { color: var(--muted); }
.portal-akk-status-fehler {
    color: #ba2121;
    border-color: #e2a5a5;
    background: #fdecec;
}
.portal-akk-body { padding: 4px 2px 16px 16px; }
.portal-akk-meta {
    margin: 0 0 6px;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
}
.portal-akk-beschreibung { margin: 0 0 10px; color: var(--muted); font-size: .92rem; }
.portal-akk-body .portal-check-haken { margin: 0 0 8px; }
.portal-akk-body .portal-upload-liste { margin-top: 4px; }
.portal-akk-haken { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; }
.portal-akk-haken .portal-check-haken { margin: 0; }
.portal-hinweis {
    border: 1px solid #f0d9ad;
    background: #fff8ec;
    border-radius: 4px;
    padding: 10px 14px;
    margin: 0 0 16px;
    font-size: .92rem;
}
/* Fotogalerie (Material & Orga) */
.portal-fotogalerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin: 0 0 20px;
}
.portal-foto-kachel {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    background: #f2f2f0;
    margin: 0;
}
.portal-foto-oeffnen {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}
.portal-foto-oeffnen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.portal-foto-loeschen { position: absolute; top: 4px; right: 4px; margin: 0; }
.portal-foto-loeschen .portal-btn {
    padding: 2px 8px;
    font-size: .8rem;
    line-height: 1.5;
}
.portal-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.portal-lightbox[hidden] { display: none; }
.portal-lightbox img { max-width: 92vw; max-height: 92vh; }
.portal-lightbox-schliessen {
    position: absolute;
    top: 16px;
    right: 22px;
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}
.portal-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .12);
    border: 0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}
.portal-lightbox-nav:hover { background: rgba(255, 255, 255, .25); }
.portal-lightbox-zurueck { left: 16px; }
.portal-lightbox-weiter { right: 16px; }
.portal-lightbox-zaehler {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    color: #fff;
    font-size: .85rem;
    background: rgba(0, 0, 0, .4);
    padding: 3px 12px;
    border-radius: 999px;
}

.portal-frist { margin: 0 0 1em; }
.portal-vorfrist { color: var(--orange); font-weight: 700; }
a.portal-vorfrist:hover { color: var(--orange-dark); }

/* E-Mail-Vorlage (zum Kopieren) */
.portal-vorlage {
    border: 1px solid var(--border);
    background: #fafafa;
    padding: 16px 20px;
    max-width: 44em;
    margin: 12px 0;
}
.portal-vorlage p { margin: 0 0 .9em; }
.portal-vorlage p:last-child { margin-bottom: 0; }

/* Elternumfrage (SurveyJS) – about-kids-Orange wie in der alten Umfrage */
.portal-umfrage {
    max-width: 900px;
    /* SurveyJS-Theme-Variablen */
    --sjs-primary-backcolor: var(--orange);
    --sjs-primary-backcolor-light: rgba(226, 133, 34, 0.1);
    --sjs-primary-backcolor-dark: var(--orange-dark);
    --sjs-primary-forecolor: #fff;
    --sjs-primary-forecolor-light: rgba(255, 255, 255, 0.25);
    --sjs-special-red: #b3261e;
}
.portal-umfrage-kopf { margin: 0 0 16px; font-size: .9rem; }
.portal-umfrage-kopf select {
    padding: 6px 8px; border: 1px solid var(--border); font: inherit; margin-left: 6px;
}
.portal-umfrage-hinweis {
    border: 1px solid #f0d9ad; background: #fff8ec;
    padding: 14px 18px; margin: 0 0 18px;
}
.portal-umfrage-hinweis p { margin: 0 0 10px; }
.portal-umfrage .sd-root-modern { background: transparent; }

/* Umfrage-Titel auf der Startseite: orange, in Versalien wie früher */
.portal-umfrage-titel {
    color: var(--orange);
    text-transform: uppercase;
    font-size: 1.7rem;
    line-height: 1.25;
    border-bottom: 2px solid var(--orange);
    padding-bottom: .3em;
    margin: 0 0 .6em;
}
/* Seiten-Hinweis („» Bitte füllen Sie …") orange */
.portal-umfrage .sd-page .sd-description,
.portal-umfrage .sd-page__description {
    color: var(--orange);
    font-weight: 600;
}
.portal-umfrage .sd-page .sd-description::before { content: "» "; }
/* Fortschrittsbalken wie früher: kräftiger, orange gefüllt */
.portal-umfrage .sd-body__progress,
.portal-umfrage .sd-progress { height: 14px; background: #ececec; border-radius: 7px; overflow: hidden; }
.portal-umfrage .sd-progress__bar { background: var(--orange); height: 100%; }
.portal-umfrage .sd-progress__text { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* ============================================================
   Umfrage-Bögen: Redesign fuer mehr Kontrast & Orientierung bei
   der Skalenzuordnung (1-7). Farbverlauf von warmem Terrakotta
   ("nicht erfuellt") ueber Amber bis zum bestehenden Marken-Oliv
   ("voll erfuellt", = --ok) - bleibt in der bestehenden Palette,
   statt gruen/rot einzufuehren.
   ============================================================ */
.portal-umfrage {
    --skala-1: #ae5138;
    --skala-2: #bd6c3d;
    --skala-3: #cc8843;
    --skala-4: #d9a24a;
    --skala-5: #b7a34a;
    --skala-6: #8fa040;
    --skala-7: #63702f;
    --skala-na: #aab6bb;
}

/* Seiten-/Abschnittstitel: klare Orientierung, welches Thema gerade dran ist */
.portal-umfrage .sd-page__title {
    color: var(--orange-dark);
    font-size: 1.25rem;
    font-weight: 700;
    padding-bottom: .5em;
    margin-bottom: 1.1em;
    border-bottom: 3px solid var(--orange-soft);
    position: relative;
}
.portal-umfrage .sd-page__title::before {
    content: "";
    position: absolute;
    left: 0; bottom: -3px;
    width: 46px; height: 3px;
    background: var(--orange);
}

/* Jede Frage als eigene Karte - mehr Ruhe & Trennung zwischen den Themen */
.portal-umfrage .sd-question {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px 22px;
    margin-bottom: 18px;
}
.portal-umfrage .sd-question__title {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.45;
}
.portal-umfrage .sd-question__required-text { color: var(--orange-dark); }

/* ---- Bewertungsmatrix ---------------------------------------------- */
.portal-umfrage .sd-matrix-wrapper,
.portal-umfrage .sd-matrix.sd-table-wrapper {
    overflow-x: auto;
    border-radius: calc(var(--radius) - 2px);
}
.portal-umfrage .sd-matrix table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.portal-umfrage .sd-matrix th,
.portal-umfrage .sd-matrix td { padding: 10px 3px; min-width: 0; }
.portal-umfrage .sd-matrix th:first-child,
.portal-umfrage .sd-matrix td:first-child {
    width: 34%;
    padding-right: 16px;
    text-align: right;
}

/* Kopfzeile: farbiger Balken je Skalenposition - sofort erkennbar,
   dass es links "schlecht" und rechts "gut" wird. */
.portal-umfrage .sd-matrix .sd-table__cell--header {
    text-align: center;
    vertical-align: bottom;
    padding-bottom: 10px;
    border-bottom: 4px solid var(--border);
}
.portal-umfrage .sd-matrix thead th:nth-child(2) { border-bottom-color: var(--skala-1); }
.portal-umfrage .sd-matrix thead th:nth-child(3) { border-bottom-color: var(--skala-2); }
.portal-umfrage .sd-matrix thead th:nth-child(4) { border-bottom-color: var(--skala-3); }
.portal-umfrage .sd-matrix thead th:nth-child(5) { border-bottom-color: var(--skala-4); }
.portal-umfrage .sd-matrix thead th:nth-child(6) { border-bottom-color: var(--skala-5); }
.portal-umfrage .sd-matrix thead th:nth-child(7) { border-bottom-color: var(--skala-6); }
.portal-umfrage .sd-matrix thead th:nth-child(8) { border-bottom-color: var(--skala-7); }
.portal-umfrage .sd-matrix thead th:nth-child(9) {
    border-bottom-color: var(--skala-na);
    border-left: 1px dashed var(--border);
}
.portal-umfrage .sd-matrix .sd-table__cell--header .sv-string-viewer {
    display: inline-block;
    font-size: .76rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
    white-space: normal;
    overflow-wrap: anywhere;
}
.portal-umfrage .sd-matrix thead th:nth-child(9) .sv-string-viewer {
    color: var(--muted);
    font-weight: 500;
    font-style: italic;
}

/* Zeilen: deutlicher Zebra-Effekt + Hover, damit klar ist, in welcher
   Zeile man sich gerade befindet. */
.portal-umfrage .sd-matrix tbody tr:nth-child(odd) { background: var(--bg); }
.portal-umfrage .sd-matrix tbody tr:hover { background: var(--orange-soft); }
.portal-umfrage .sd-matrix td.sd-table__cell--row-text {
    font-size: .93rem;
    line-height: 1.4;
    color: var(--text);
}
.portal-umfrage .sd-matrix td:nth-child(9) { border-left: 1px dashed var(--border); }

/* Radio-Punkte: groesser, farblich passend zur Skalenposition, mit klarem
   Hover- und Auswahl-Zustand statt der kleinen Standard-Punkte. */
.portal-umfrage .sd-matrix__label { display: flex; justify-content: center; margin: 0; cursor: pointer; }
.portal-umfrage .sd-item__decorator.sd-radio__decorator {
    width: 24px; height: 24px;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.portal-umfrage .sd-matrix td:nth-child(2) .sd-item__decorator { border-color: var(--skala-1); }
.portal-umfrage .sd-matrix td:nth-child(3) .sd-item__decorator { border-color: var(--skala-2); }
.portal-umfrage .sd-matrix td:nth-child(4) .sd-item__decorator { border-color: var(--skala-3); }
.portal-umfrage .sd-matrix td:nth-child(5) .sd-item__decorator { border-color: var(--skala-4); }
.portal-umfrage .sd-matrix td:nth-child(6) .sd-item__decorator { border-color: var(--skala-5); }
.portal-umfrage .sd-matrix td:nth-child(7) .sd-item__decorator { border-color: var(--skala-6); }
.portal-umfrage .sd-matrix td:nth-child(8) .sd-item__decorator { border-color: var(--skala-7); }
.portal-umfrage .sd-matrix td:nth-child(9) .sd-item__decorator { border-color: var(--skala-na); }

.portal-umfrage .sd-radio--allowhover:hover .sd-item__decorator {
    transform: scale(1.12);
    box-shadow: 0 0 0 5px rgba(226, 133, 34, .12);
}
.portal-umfrage .sd-matrix td:nth-child(2) .sd-item__control:checked + .sd-item__decorator { background: var(--skala-1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--skala-1) 25%, transparent); }
.portal-umfrage .sd-matrix td:nth-child(3) .sd-item__control:checked + .sd-item__decorator { background: var(--skala-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--skala-2) 25%, transparent); }
.portal-umfrage .sd-matrix td:nth-child(4) .sd-item__control:checked + .sd-item__decorator { background: var(--skala-3); box-shadow: 0 0 0 4px color-mix(in srgb, var(--skala-3) 25%, transparent); }
.portal-umfrage .sd-matrix td:nth-child(5) .sd-item__control:checked + .sd-item__decorator { background: var(--skala-4); box-shadow: 0 0 0 4px color-mix(in srgb, var(--skala-4) 25%, transparent); }
.portal-umfrage .sd-matrix td:nth-child(6) .sd-item__control:checked + .sd-item__decorator { background: var(--skala-5); box-shadow: 0 0 0 4px color-mix(in srgb, var(--skala-5) 25%, transparent); }
.portal-umfrage .sd-matrix td:nth-child(7) .sd-item__control:checked + .sd-item__decorator { background: var(--skala-6); box-shadow: 0 0 0 4px color-mix(in srgb, var(--skala-6) 25%, transparent); }
.portal-umfrage .sd-matrix td:nth-child(8) .sd-item__control:checked + .sd-item__decorator { background: var(--skala-7); box-shadow: 0 0 0 4px color-mix(in srgb, var(--skala-7) 25%, transparent); }
.portal-umfrage .sd-matrix td:nth-child(9) .sd-item__control:checked + .sd-item__decorator { background: var(--skala-na); box-shadow: 0 0 0 4px color-mix(in srgb, var(--skala-na) 25%, transparent); }
.portal-umfrage .sd-item__control:checked + .sd-item__decorator { transform: scale(1.05); }

/* ---- Freitext / Mehrfachtext ---------------------------------------- */
.portal-umfrage .sd-comment,
.portal-umfrage .sd-input {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    padding: 10px 14px;
    font-family: var(--font);
    font-size: .95rem;
    color: var(--text);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.portal-umfrage .sd-comment:focus,
.portal-umfrage .sd-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-soft);
}
.portal-umfrage .sd-multipletext__item-title {
    font-size: .85rem;
    color: var(--muted);
    font-weight: 600;
}

/* ---- Navigation (Weiter/Zurueck/Abschliessen) ------------------------ */
.portal-umfrage .sd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 28px;
    border: none;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-family: var(--font);
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background .12s ease, transform .12s ease, box-shadow .12s ease;
    box-shadow: 0 2px 8px rgba(226, 133, 34, .28);
}
.portal-umfrage .sd-btn:hover { background: var(--orange-dark); transform: translateY(-1px); }
.portal-umfrage .sd-btn:active { transform: translateY(0); }
.portal-umfrage .sd-navigation__prev-btn {
    background: transparent;
    color: var(--orange-dark);
    box-shadow: none;
    border: 1px solid var(--border);
}
.portal-umfrage .sd-navigation__prev-btn:hover { background: var(--orange-soft); }

/* Danke-Seite mit derselben Textbreite */
.portal-umfrage-danke { max-width: 780px; }
.portal-umfrage-danke p { margin: 0 0 1em; }

/* Eingebettetes PDF */
.portal-pdf {
    margin: 8px 0 12px;
    border: 1px solid var(--border);
    background: #f4f4f4;
}
.portal-pdf iframe {
    display: block;
    width: 100%;
    height: 80vh;
    min-height: 480px;
    border: 0;
}
.portal-pdf-aktionen { display: flex; gap: 14px; align-items: baseline; margin: 4px 0 10px; }

/* Formular-Steuerelemente – einheitlicher Look für alle Portal-Formulare.
   Bewusst auf .portal-main begrenzt und via :not([class*="sd-"]/"sv-")
   von den SurveyJS-Feldern der Elternumfrage ausgenommen. */
.portal-main :is(
    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="search"], input[type="tel"],
    input[type="url"], input[type="date"], input[type="datetime-local"],
    input[type="time"], input[type="month"], textarea, select
):not([class*="sd-"]):not([class*="sv-"]) {
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 2px;
    background-color: var(--surface);
    color: var(--text);
    font: inherit;
    line-height: 1.4;
    transition: border-color .12s, box-shadow .12s;
}
.portal-main :is(
    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="search"], input[type="tel"],
    input[type="url"], input[type="date"], input[type="datetime-local"],
    input[type="time"], input[type="month"], textarea, select
):not([class*="sd-"]):not([class*="sv-"]):focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(226, 133, 34, .18);
}
.portal-main :is(input, textarea, select):not([class*="sd-"]):not([class*="sv-"])::placeholder {
    color: var(--muted);
}
.portal-main :is(input, textarea, select):not([class*="sd-"]):not([class*="sv-"]):disabled {
    background-color: var(--bg);
    color: var(--muted);
    cursor: not-allowed;
}
.portal-main select:not([class*="sd-"]):not([class*="sv-"]) {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%238a969c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
}

/* Formulare (Bericht-Upload, Bescheinigung) */
.portal-formular label,
.portal-besch label { display: block; font-weight: 600; font-size: .9rem; margin-top: 10px; }
.portal-formular input,
.portal-besch input[type="text"],
.portal-besch input[type="number"] {
    padding: 7px;
    border: 1px solid var(--border);
    font: inherit;
}
.portal-formular .helptext,
.portal-besch .helptext { display: block; color: var(--muted); font-size: .82rem; }
.portal-besch { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.portal-besch-felder { flex: 0 0 320px; }
.portal-besch .portal-pdf { flex: 1 1 420px; min-width: 320px; }
.portal-besch .portal-pdf iframe { height: 70vh; }

/* Bescheinigung per E-Mail senden */
.portal-besch-mail {
    margin: 30px 0 0;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 640px;
}
.portal-besch-mail h2 { margin: 0 0 14px; font-size: 1.1rem; }
.portal-besch-mail-form label {
    display: block;
    font-weight: 600;
    font-size: .88rem;
    margin: 12px 0 4px;
}
.portal-besch-mail-form p { margin: 0; }
.portal-besch-mail-form :is(input[type="text"], select, textarea) { width: 100%; }
.portal-besch-mail-form textarea { min-height: 180px; resize: vertical; }
.portal-besch-mail-form #id_an {
    padding: 6px 0 2px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.portal-besch-mail-form #id_an > div { margin: 0; }
.portal-besch-mail-form #id_an label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    font-weight: 400;
    font-size: .88rem;
}
.portal-besch-mail-form #id_an input[type="checkbox"] { width: auto; flex: none; }
.portal-besch-mail-form #id_an:empty::after {
    content: "Keine Personen mit Zugang zu dieser Kita – bitte CC nutzen.";
    color: var(--muted);
    font-size: .85rem;
}
.portal-besch-mail-form .helptext {
    display: block;
    color: var(--muted);
    font-size: .8rem;
    margin-top: 3px;
}
.portal-besch-mail-form .portal-editor-aktionen { margin-top: 16px; }

/* Termine-Seite */
.portal-terminliste { margin: 0 0 1.4em; padding-left: 1.3em; }
.portal-terminliste > li { margin: 4px 0; }
.portal-terminliste ul { margin: 4px 0 8px; padding-left: 1.3em; list-style: circle; }
.portal-terminliste ul li { margin: 2px 0; }
.portal-meet { margin: 1.2em 0; }
.portal-offen { color: #c0392b; font-weight: 700; }
.portal-schmetterling {
    display: block;
    width: 180px;
    max-width: 40%;
    height: auto;
    margin: 24px 0 0 auto;
}

.portal-leer, .portal-meta { color: var(--muted); font-size: .9rem; }
.portal-meta { margin-top: 24px; }

.portal-messages {
    list-style: none;
    padding: 10px 14px;
    margin: 0 0 20px;
    background: #fff8ec;
    border: 1px solid #f0d9ad;
}

/* Boxes */
.portal-box {
    margin-top: 26px;
    border: 1px solid var(--border);
    padding: 16px 20px;
    background: #fafafa;
}
.portal-box h2 { margin-top: 0; }
.portal-termine { list-style: none; padding: 0; margin: 0; }
.portal-termine li { padding: 4px 0; display: flex; gap: 12px; flex-wrap: wrap; }
.portal-termine time { font-weight: 700; }
.portal-termin-titel { flex: 1 1 auto; }
.portal-traeger { color: var(--muted); }

/* Todo-Seite: Schieberegler + Checklisten (untereinander) */
.portal-todo-wrap { overflow-x: auto; margin: 14px 0; }
.portal-todo-wrap:last-child { margin-bottom: 26px; }
.portal-todo-beki th[scope="col"]:last-child,
.portal-todo-beki td { text-align: center; }
.portal-todo-angaben {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    align-items: flex-end;
    max-width: 660px;
    margin-bottom: 24px;
}
.portal-todo-angaben label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .85rem;
    color: var(--muted);
}
.portal-todo-angaben-text { flex: 1 1 220px; }
.portal-todo {
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.portal-todo th[scope="col"] {
    padding: 9px 14px;
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(80, 101, 110, .045);
    border-bottom: 1px solid var(--border);
}
.portal-todo td,
.portal-todo th[scope="row"] {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}
.portal-todo th[scope="row"] { text-align: left; font-weight: 500; }
.portal-todo tbody tr:last-child td,
.portal-todo tbody tr:last-child th { border-bottom: 0; }
.portal-todo-kapitel td { text-align: center; }
.portal-todo-kapitel th[scope="col"]:not(:first-child) { text-align: center; }

.portal-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    vertical-align: middle;
}
.portal-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.portal-switch-track {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 999px;
    transition: background .15s;
}
.portal-switch-track::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    transition: transform .15s;
}
.portal-switch input:checked + .portal-switch-track { background: var(--orange); }
.portal-switch input:checked + .portal-switch-track::before { transform: translateX(18px); }
.portal-switch input:disabled { cursor: default; }
.portal-switch input:disabled + .portal-switch-track { opacity: .5; }
.portal-switch input:focus-visible + .portal-switch-track {
    box-shadow: 0 0 0 3px rgba(226, 133, 34, .3);
}
.portal-todo-auto {
    margin-left: 10px;
    font-size: .75rem;
    color: var(--muted);
}

/* Datentabellen (Kriterien-Referenz, Zugänge) – Karte mit Zeilentrennern */
.portal-kriterien-titel { margin: 28px 0 10px; font-size: 1.1rem; }
.portal-abschnitt-titel {
    margin: 28px 0 10px;
    font-size: 1.15rem;
    color: var(--orange);
}
.portal-zugaenge {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: 10px 0 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.portal-zugaenge th {
    padding: 9px 14px;
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(80, 101, 110, .045);
    border-bottom: 1px solid var(--border);
}
.portal-zugaenge td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.portal-zugaenge tbody tr:last-child td { border-bottom: 0; }
.portal-zugaenge tbody tr:hover td { background: rgba(226, 133, 34, .05); }
.portal-zugaenge td form { margin: 0; }

/* Qualitätskriterien-Baum (Bericht-Editor) */
.portal-krit-baum {
    margin: 10px 0 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.portal-krit-suche {
    display: block;
    width: 100%;
    padding: 9px 14px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(80, 101, 110, .045);
    font: inherit;
    font-size: .92rem;
}
.portal-krit-suche:focus { outline: none; box-shadow: inset 0 -2px 0 var(--orange); }
.portal-krit-leer { margin: 0; padding: 12px 14px; color: var(--muted); font-size: .9rem; }
.portal-krit-gruppe { border-bottom: 1px solid var(--border); }
.portal-krit-gruppe:last-child { border-bottom: 0; }
.portal-krit-gruppe > summary,
.portal-krit-solo {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 14px;
    font-size: .92rem;
    list-style: none;
}
.portal-krit-gruppe > summary { cursor: pointer; }
.portal-krit-gruppe > summary::-webkit-details-marker { display: none; }
.portal-krit-gruppe > summary:hover { background: rgba(226, 133, 34, .05); }
.portal-krit-chevron {
    flex: 0 0 auto;
    align-self: center;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(-45deg);
    transition: transform .15s;
}
.portal-krit-gruppe[open] > summary .portal-krit-chevron { transform: rotate(45deg); }
.portal-krit-solo .portal-krit-chevron,
.portal-krit-solo { padding-left: 14px; }
.portal-krit-code {
    flex: 0 0 auto;
    color: var(--orange-dark);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.portal-krit-text { flex: 1 1 auto; }
.portal-krit-anzahl {
    flex: 0 0 auto;
    font-size: .78rem;
    color: var(--muted);
    background: rgba(80, 101, 110, .08);
    border-radius: 999px;
    padding: 1px 8px;
}
.portal-krit-kinder {
    margin: 0;
    padding: 2px 0 8px;
    list-style: none;
}
.portal-krit-kinder li {
    display: flex;
    gap: 10px;
    padding: 6px 14px 6px 31px;
    font-size: .9rem;
}
.portal-krit-kinder li + li { border-top: 1px solid var(--bg); }
.portal-krit-treffer { margin: 0; padding: 0; list-style: none; }
.portal-krit-treffer li {
    display: flex;
    gap: 10px;
    padding: 8px 14px;
    font-size: .9rem;
}
.portal-krit-treffer li + li { border-top: 1px solid var(--border); }
.portal-einladen select,
.portal-einladen input[type="email"] { padding: 7px; border: 1px solid var(--border); font: inherit; }
.portal-einladen button { margin-top: 12px; }

/* Kita-Liste */
.portal-kitaliste { list-style: none; padding: 0; }
.portal-kitaliste li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.portal-kitaliste a { font-size: 1.1rem; }
.portal-traeger { margin-left: 10px; font-size: .9rem; }

/* Login */
.portal-login { max-width: 340px; }
.portal-login h1 { color: var(--orange); }
.portal-login form { display: flex; flex-direction: column; gap: 6px; }
.portal-login label { font-size: .9rem; font-weight: 600; margin-top: 8px; }
.portal-login input[type="text"],
.portal-login input[type="email"],
.portal-login input[type="password"] {
    padding: 8px;
    border: 1px solid var(--border);
    font: inherit;
}
.portal-login button {
    margin-top: 16px;
    padding: 9px;
    background: var(--orange);
    color: #fff;
    border: none;
    font: inherit;
    cursor: pointer;
}
.portal-login button:hover { background: var(--orange-dark); }
.portal-login p { font-size: .9rem; margin: 12px 0 0; }
.portal-login a { color: var(--orange); }
.portal-error { color: #b3261e; }

/* Seitenkopf mit Aktion */
.portal-seitenkopf {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
}
.portal-seitenkopf h1 { color: var(--orange); margin: 0 0 .3em; }

/* Buttons – angelehnt an about-kids.de: flach, eckig, Montserrat.
   Standard = weißer Grund mit gestricheltem Orange-Rahmen,
   .portal-btn-primary = deckend orange. */
.portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 20px;
    border: 1px dashed var(--orange);
    border-radius: 2px;
    background: #fff;
    color: var(--orange-dark);
    font-family: var(--font);
    font-size: .82rem;
    font-weight: 400;
    letter-spacing: .03em;
    text-transform: uppercase;
    line-height: 1.25;
    cursor: pointer;
    white-space: nowrap;
    transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.portal-btn:hover {
    background: var(--orange-soft);
    border-color: var(--orange-dark);
    color: var(--orange-dark);
    text-decoration: none;
}
.portal-btn:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}
.portal-btn[disabled] {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}
.portal-btn-primary {
    border: 1px solid var(--orange);
    background: var(--orange);
    color: #fff;
}
.portal-btn-primary:hover {
    background: var(--orange-dark);
    border-color: var(--orange-dark);
    color: #fff;
}
.portal-btn-danger {
    border: 1px solid #ba2121;
    background: #ba2121;
    color: #fff;
}
.portal-btn-danger:hover { background: #a41515; border-color: #a41515; color: #fff; }
/* neutraler, zurückhaltender Knopf (z. B. „Abbrechen") */
.portal-btn-schlicht {
    border: 1px solid var(--border);
    color: var(--muted);
}
.portal-btn-schlicht:hover {
    background: #f4f1ec;
    border-color: var(--muted);
    color: var(--text);
}
.portal-btn-gruppe { display: inline-flex; gap: 8px; align-items: center; }
.portal-btn-gruppe form { margin: 0; }

/* erledigt-Häkchen */
.portal-erledigt {
    margin: 0 0 18px;
    font-size: .9rem;
    color: var(--muted);
}
.portal-erledigt input { vertical-align: middle; margin-right: 6px; }

/* Editor */
.portal-editor { margin-top: 8px; }
.portal-editor-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.portal-editor-tabs button {
    border: 1px solid var(--border);
    background: #f6f6f6;
    padding: 4px 12px;
    font: inherit;
    font-size: .88rem;
    cursor: pointer;
}
.portal-editor-tabs button.aktiv {
    background: #fff;
    border-bottom-color: #fff;
    font-weight: 600;
}
.portal-md {
    width: 100%;
    font-family: "SF Mono", Consolas, "Liberation Mono", monospace;
    font-size: .95rem;
    padding: 12px;
    border: 1px solid var(--border);
    line-height: 1.5;
    resize: vertical;
}
.portal-md-vorschau {
    border: 1px solid var(--border);
    padding: 16px 20px;
    min-height: 8em;
}
.portal-trix { min-height: 22em; }
/* halbhoher Editor, z. B. für „Empfehlungen" – sonst wie .portal-trix */
.portal-trix-halb { min-height: 11em; }
trix-toolbar .trix-button-group { border-color: var(--border); }
.portal-editor-aktionen {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}
.portal-bereich-notiz {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #fdf8ec;
    border: 1px solid #e7dcb8;
    border-radius: 8px;
}
/* Abstand zwischen dem Editor (Speichern-Leiste) und einem darauf
   folgenden Notiz-/Referenzkasten. */
.portal-editor + .portal-bereich-notiz { margin-top: 28px; }
.portal-bereich-notiz label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 6px;
}
.portal-bereich-notiz textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    font-size: .9rem;
    resize: vertical;
    margin-bottom: 8px;
}
.portal-freigabe-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Kritische Punkte: nach Freigabe je Zeile ankreuzbar */
.portal-kritik-auswahl {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.portal-kritik-auswahl li + li { border-top: 1px solid var(--border); }
.portal-kritik-auswahl label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0;
    padding: 9px 12px;
    cursor: pointer;
    font-size: .92rem;
    font-weight: 400;
    line-height: 1.5;
}
.portal-kritik-auswahl input { margin-top: .25em; flex: 0 0 auto; accent-color: var(--orange); }
.portal-kritik-auswahl li:has(input:checked) { background: rgba(226, 133, 34, .12); }
.portal-kritik-auswahl label:hover { background: rgba(80, 101, 110, .05); }
.portal-kritik-auswahl li:has(input:checked) label:hover { background: rgba(226, 133, 34, .18); }

/* Freigegebener Berichtstext: Nur-Lese-Ansicht, kritische Absätze markiert */
.portal-bericht-freigegeben { margin: 4px 0 14px; }
.portal-bericht-freigegeben > div { margin: 0 0 .2em; }
.portal-bericht-freigegeben > div:empty { margin: 0; }
.portal-bericht-kritisch {
    background: rgba(226, 133, 34, .12);
    box-shadow: 0 0 0 6px rgba(226, 133, 34, .12);
    border-radius: 3px;
}

/* Freigegebener, nicht mehr editierbarer Feldinhalt (nur-Lese-Ansicht) */
.portal-freigabe-text {
    white-space: pre-wrap;
    padding: 9px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--ok-border);
    border-radius: 8px;
    background: #f6faf4;
    color: var(--text);
    font-size: .92rem;
    line-height: 1.5;
}
.portal-freigabe-text:empty::before {
    content: "(leer)";
    color: var(--muted);
}
.portal-freigabe-status {
    font-size: .78rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 3px;
    border: 1px solid var(--border);
}
.portal-freigabe-status-ok {
    color: var(--ok);
    border-color: var(--ok-border);
    background: var(--ok-bg);
}
.portal-freigabe-hinweis,
.portal-feld-hinweis {
    margin: 6px 0 0;
    font-size: .82rem;
    color: var(--muted);
}
.portal-feld-hinweis strong { color: var(--text); }

/* Elternumfrage-Ergebnisse */
.portal-eb-status {
    margin: 8px 0 4px;
    font-size: .9rem;
    color: var(--muted);
}
.portal-eb-status-frei { color: var(--ok); font-weight: 600; }
.portal-eb-ueberblick {
    margin: 18px 0 10px;
    font-size: 1.05rem;
}
.portal-eb-hilfe { margin: 12px 0 18px; }
.portal-eb-hilfe summary { cursor: pointer; font-weight: 600; }
.portal-eb-hilfe p { margin: 8px 0 0; font-size: .9rem; }
.portal-eb-abschnitt {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 0 0 12px;
    background: #fff;
}
.portal-eb-abschnitt > summary {
    cursor: pointer;
    list-style: none;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
}
.portal-eb-abschnitt > summary::-webkit-details-marker { display: none; }
.portal-eb-abschnitt > summary::before {
    content: "\25B8";
    color: var(--orange);
    font-size: .8em;
}
.portal-eb-abschnitt[open] > summary::before { content: "\25BE"; }
.portal-eb-abschnitt-titel { font-weight: 500; color: var(--orange); }
.portal-eb-abschnitt-zahl { color: var(--muted); font-size: .9rem; }

.portal-eb-chart-kopf {
    display: flex;
    justify-content: flex-end;
    padding: 6px 16px 0;
}
.portal-eb-toggle { font-size: .82rem; padding: 4px 10px; }
.portal-eb-chart {
    position: relative;
    padding: 6px 12px 12px;
}
.portal-eb-chart canvas { max-width: 100%; }

.portal-eb-texte { padding: 4px 16px 16px; }
.portal-eb-texte h3 {
    margin: 10px 0 6px;
    font-size: 1rem;
    color: var(--text);
}
.portal-eb-zusammenfassung p { margin: 0 0 6px; }
.portal-eb-bearbeiten { margin-top: 10px; }
.portal-eb-bearbeiten textarea {
    width: 100%;
    box-sizing: border-box;
    margin: 8px 0;
    padding: 8px;
    border: 1px solid var(--border);
    font: inherit;
    border-radius: 4px;
}
.portal-eb-roh-titel {
    margin: 12px 0 4px;
    font-size: .82rem;
    color: var(--muted);
    font-weight: 600;
}
.portal-eb-editor-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.portal-eb-ki { margin: 8px 0 0; display: flex; gap: 8px; align-items: center; }
.portal-eb-ki-hinweis { font-size: .8rem; color: var(--muted); }
.portal-eb-freigabe-status {
    margin: 6px 0 8px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ok);
}
.portal-eb-roh-details { margin: 12px 0 0; }
.portal-eb-roh-details summary {
    cursor: pointer;
    font-size: .82rem;
    color: var(--muted);
    font-weight: 600;
}
.portal-eb-roh {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: .88rem;
    color: var(--muted);
}
.portal-eb-roh li { margin: 4px 0; }

/* Bericht-Grafiken – nutzen die verfügbare Breite */
.portal-bericht-grafik {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 2;
    min-height: 240px;
    max-height: 400px;
    margin: 0 0 26px;
}
/* Netzdiagramm bleibt quadratisch, zentriert, wächst bis zu einer Obergrenze */
.portal-bericht-grafik[data-typ="netz"] {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 560px;
    min-height: 0;
    max-height: none;
    margin-inline: auto;
}
.portal-bericht-grafik[data-typ="netz"][data-gross] {
    max-width: min(100%, 820px);
    margin-top: 30px;
}
.portal-grafik-erklaerung {
    max-width: 820px;
    margin: 0 auto;
}

/* Bericht-Editor: Grundlagen-Akkordion (Transkriptionen + Vor-Ort-Notizen) */
.portal-grundlagen {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 4px 16px;
    margin: 0 0 22px;
}
.portal-grundlagen .portal-akk:last-child { border-bottom: 0; }
.portal-grundlagen .portal-bereich-notiz { margin: 0; padding: 0; border: 0; background: none; }
.portal-transkriptionen h3 {
    margin: 12px 0 4px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--orange-dark);
}
.portal-transkriptionen h3:first-child { margin-top: 0; }
.portal-transkript-text {
    font-size: .92rem;
    line-height: 1.55;
    max-height: 320px;
    overflow-y: auto;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
}
.portal-grafik-erklaerung p { margin: 0; }

.portal-grafik-bereich {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 14px 12px;
    margin: 0 0 14px;
}
.portal-grafik-bereich legend {
    font-weight: 600;
    padding: 0 6px;
}
.portal-grafik-form { container-type: inline-size; }
.portal-grafik-felder {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px 14px;
    align-items: end;
}
/* Ohne 6-Spalten-Raster (wenig Platz) werden die Leerzellen nicht
   gebraucht – sie würden nur Lücken reißen. */
.portal-grafik-leer { display: none; }
/* Genug Platz: feste 6-Spalten-Raster, damit „Elternbefragung", „Gesamt"
   und die gleichnamigen Quellen über alle Bereiche exakt untereinander
   stehen. */
@container (min-width: 640px) {
    .portal-grafik-felder {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        max-width: 720px;
    }
    .portal-grafik-felder > .portal-grafik-leer { display: block; }
}
.portal-grafik-felder label {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 3px;
    font-size: .78rem;
    color: var(--muted);
    min-width: 0;
}
.portal-grafik-felder label span {
    -webkit-hyphens: auto;
    hyphens: auto;
    overflow-wrap: break-word;
    line-height: 1.2;
}
.portal-grafik-felder input {
    width: 100%;
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font: inherit;
}
.portal-grafik-auto output {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 5px 7px;
    border: 1px dashed var(--border);
    border-radius: 4px;
    background: #faf8f4;
    font-weight: 600;
    color: var(--text);
}
.portal-grafik-gesamt output { border-style: solid; }
.portal-grafik-form > .portal-btn { margin-top: 4px; }

/* ===== Responsiv ===== */
@media (max-width: 899px) {
    .portal-layout { padding: 16px; gap: 0; }
    .pnav {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 40;
        width: min(82vw, 300px);
        max-height: 100vh;
        height: 100vh;
        padding: 12px;
        background: var(--surface);
        border-right: 1px solid var(--border);
        transform: translateX(-100%);
        transition: transform .22s ease;
    }
    .pnav-inner { border: 0; box-shadow: none; padding: 0; }
    .pnav-open .pnav { transform: translateX(0); box-shadow: var(--shadow); }
    .pnav-title { display: inline !important; }
    .pnav-list { display: block !important; }
}

@media (min-width: 900px) {
    .pnav-scrim { display: none; }
    .pnav-toggle { display: none; }
}
@media (max-width: 899px) {
    .pnav-collapse { display: none; }
}

@media (max-width: 560px) {
    .portal-main { padding: 20px 18px; border-radius: 10px; }
    .portal-header { padding: 8px 14px; }
    .portal-user { display: none; }
}

/* ============================================================
   Angebotsformular (about-kids.de/angebot/, per iframe in WP
   eingebunden - siehe angebote-App).
   ============================================================ */
.ab-formular { max-width: 480px; margin: 0 auto; }
.ab-feld { margin-bottom: 18px; position: relative; }
.ab-feld label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.ab-feld input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    font-family: var(--font);
    font-size: .95rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.ab-feld input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-soft);
}
.ab-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ab-vorschlaege {
    position: absolute;
    z-index: 5;
    left: 0; right: 0; top: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    box-shadow: var(--shadow);
    margin-top: 4px;
    overflow: hidden;
}
.ab-vorschlag {
    padding: 10px 14px;
    font-size: .88rem;
    cursor: pointer;
}
.ab-vorschlag:hover { background: var(--orange-soft); }
.ab-fehler { color: var(--orange-dark); font-size: .88rem; margin: -6px 0 14px; }
/* Gleicher Button-Stil wie auf der Website (Kalium-Theme) und im Portal:
   gestrichelter Rahmen, weiß, orange - kein neu erfundener Button-Look. */
.ab-btn {
    display: inline-block;
    width: 100%;
    padding: 12px 24px;
    border: 1px dashed var(--orange);
    border-radius: 0;
    background: #fff;
    color: var(--orange);
    font-family: var(--font);
    font-weight: 400;
    font-size: .95rem;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.ab-btn:hover { background: var(--orange); color: #fff; }
.ab-erfolg {
    background: var(--ok-bg);
    border: 1px solid var(--ok-border);
    border-radius: var(--radius);
    padding: 24px 26px;
    text-align: center;
}
.ab-erfolg h2 { color: var(--ok); margin: 0 0 .5em; }

