/* Igelbox – keine externen Schriften oder CDNs, damit beim Aufruf keine Daten an Dritte gehen. */
:root {
  --bg: #f4f7f6;
  --flaeche: #ffffff;
  --text: #1c2523;
  --leise: #586764;
  --linie: #d7e0dd;
  --akzent: #1f7a72;
  --akzent-dunkel: #165a54;
  --akzent-hell: #e1f0ed;
  --kastanie: #7a4a2f;
  --ok: #2b7a3c; --ok-bg: #e4f2e7;
  --warn: #855400; --warn-bg: #fbefd9;
  --krit: #b0352c; --krit-bg: #f9e2df;
  --neutral-bg: #eaefee;
  --radius: 10px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111715; --flaeche: #18201e; --text: #e3ebe9; --leise: #9aaba7; --linie: #2a3532;
    --akzent: #5cc2b6; --akzent-dunkel: #7fd3c8; --akzent-hell: #1c3431; --kastanie: #d49a74;
    --ok: #7ccf8a; --ok-bg: #1b2f21; --warn: #e8b45a; --warn-bg: #33291a; --krit: #f08b80; --krit-bg: #3a2120; --neutral-bg: #232d2b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.55 var(--schrift); }
a { color: var(--akzent); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 1.7rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin-bottom: 0.6rem; }
p { margin: 0 0 0.6rem; }
code { font-family: var(--mono); font-size: 0.85em; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Rahmen */
body.mit-nav { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.app-spalte { display: flex; flex-direction: column; min-width: 0; }
.app-spalte main { flex: 1; }
.seitenleiste { background: var(--flaeche); border-right: 1px solid var(--linie); padding: 20px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marke { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.25rem; }
.org { color: var(--leise); font-size: 0.85rem; padding: 0 4px; }
.orgwahl { display: flex; gap: 6px; }
.orgwahl select { font-size: 0.88rem; padding: 6px 8px; }
.klein-knopf { padding: 4px 10px; font-size: 0.85rem; }
.konto-link { display: flex; flex-direction: column; text-decoration: none; color: var(--text); min-width: 0; }
.konto-link span { color: var(--leise); font-size: 0.8rem; overflow-wrap: anywhere; }
.konto-link:hover strong { color: var(--akzent); }
.springen { position: absolute; left: -999px; top: 8px; background: var(--akzent); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.springen:focus { left: 8px; }
.seitenleiste nav { display: flex; flex-direction: column; gap: 10px; }
.nav-gruppe { display: flex; flex-direction: column; gap: 1px; }
.nav-titel { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--leise); padding: 6px 10px 2px; font-weight: 600; }
.seitenleiste nav a { color: var(--text); text-decoration: none; padding: 7px 10px; border-radius: 8px; display: flex; align-items: center; gap: 10px; font-size: 0.95rem; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; }
.seitenleiste nav a:hover { background: var(--neutral-bg); }
.seitenleiste nav a.aktiv { background: var(--akzent-hell); color: var(--akzent-dunkel); font-weight: 650; }
.fuss { margin-top: auto; font-size: 0.9rem; display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.klein { color: var(--leise); font-size: 0.8rem; }
main { padding: 28px clamp(16px, 4vw, 44px) 64px; max-width: 1100px; width: 100%; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
body.ohne-nav main { margin: 0 auto; }
@media (max-width: 820px) {
  body.mit-nav { grid-template-columns: 1fr; }
  .seitenleiste { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--linie); }
  .fuss { flex-direction: row; flex-wrap: wrap; gap: 12px; align-items: center; }
}

.kopf { display: flex; flex-direction: column; gap: 6px; }
.kopf-zeile { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.kopf-zeile > div { min-width: 0; max-width: 75ch; }
.zurueck { font-size: 0.9rem; text-decoration: none; color: var(--leise); }
.zurueck:hover { color: var(--akzent); }
.unter { color: var(--leise); margin: 6px 0 0; }

.banner { background: transparent; color: var(--leise); padding: 8px 12px; border: 1px dashed var(--linie); border-radius: var(--radius); font-size: 0.88rem; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.meldung { padding: 10px 14px; border-radius: var(--radius); font-weight: 600; }
.meldung.ok { background: var(--ok-bg); color: var(--ok); }
.meldung.fehler { background: var(--krit-bg); color: var(--krit); }
.hinweis { background: var(--neutral-bg); padding: 12px 14px; border-radius: var(--radius); }
.hinweis.warn { background: var(--warn-bg); }
.hinweis.kritisch { background: var(--krit-bg); color: var(--krit); }

/* Karten & Formulare */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 20px; min-width: 0; }
.stapel { display: flex; flex-direction: column; gap: 14px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
fieldset + fieldset { border-top: 1px solid var(--linie); padding-top: 18px; }
legend { font-weight: 750; font-size: 1.1rem; margin-bottom: 4px; padding: 0; }
.reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feld label, .feld .label { font-weight: 600; font-size: 0.93rem; }
.pflicht { color: var(--krit); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--linie); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
textarea { resize: vertical; min-height: 5.5em; field-sizing: content; max-height: 60vh; line-height: 1.5; }
textarea::placeholder, input::placeholder { color: var(--leise); opacity: 0.8; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--akzent); flex: none; margin-top: 3px; }
input[type="file"] { background: transparent; border-style: dashed; }
.feld.luecke input, .feld.luecke textarea { border-color: var(--warn); background: var(--warn-bg); }
.hilfe { color: var(--leise); font-size: 0.86rem; margin: 0; }
.haken { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.haken.aus { cursor: default; color: var(--leise); align-items: center; }
.haken-liste { display: grid; gap: 8px; }
.haken-liste.zwei { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.aktionen { display: flex; justify-content: flex-end; gap: 14px; align-items: center; flex-wrap: wrap; }
.aktionen.klebend { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--linie); }
.nebenaktion { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

button, .knopf { font: inherit; font-weight: 600; border-radius: 8px; padding: 9px 16px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .knopf:hover { border-color: var(--akzent); }
.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.haupt:hover { background: var(--akzent-dunkel); }
@media (prefers-color-scheme: dark) { .haupt { color: #0d1a18; } }
button.link, a.link { background: none; border: 0; padding: 0; color: var(--akzent); font-weight: 500; text-decoration: underline; cursor: pointer; }
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; }

/* Tabellen */
.tabelle { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--leise); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pille { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pille.ok { background: var(--ok-bg); color: var(--ok); }
.pille.warn { background: var(--warn-bg); color: var(--warn); }
.pille.kritisch { background: var(--krit-bg); color: var(--krit); }
.pille.neutral { background: var(--neutral-bg); color: var(--leise); }
.marker { font-size: 0.72rem; font-family: var(--mono); color: var(--kastanie); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 4px; white-space: nowrap; }

/* Übersicht */
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kennzahl { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 16px 18px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.kennzahl:hover { border-color: var(--akzent); }
.kennzahl .wert { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kennzahl .text { color: var(--leise); font-size: 0.9rem; }
progress { width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--neutral-bg); appearance: none; margin-top: 6px; }
progress::-webkit-progress-bar { background: var(--neutral-bg); border-radius: 3px; }
progress::-webkit-progress-value { background: var(--akzent); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--akzent); border-radius: 3px; }
.aufgaben { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.aufgaben a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; background: var(--flaeche); border: 1px solid var(--linie); border-left: 4px solid var(--linie); border-radius: 10px; text-decoration: none; color: var(--text); }
.aufgaben li.kritisch a { border-left-color: var(--krit); }
.aufgaben li.warn a { border-left-color: var(--warn); }
.aufgaben a span { color: var(--leise); font-size: 0.92rem; }
.aufgaben a:hover strong { color: var(--akzent); }
.leer { text-align: center; padding: 28px 16px; color: var(--leise); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.raster .karte { display: flex; flex-direction: column; align-items: flex-start; }
.raster .karte .knopf { margin-top: auto; }
details.archiv summary { cursor: pointer; color: var(--leise); }

/* Maßnahmen */
.tom-liste { display: flex; flex-direction: column; }
.tom { display: grid; grid-template-columns: 1fr minmax(220px, 320px); gap: 14px; padding: 12px 0; border-top: 1px solid var(--linie); }
.tom:first-child { border-top: 0; }
.tom-text p { color: var(--leise); font-size: 0.9rem; margin: 2px 0 0; }
.tom-eingabe { display: flex; flex-direction: column; gap: 6px; }
.tom.umgesetzt .tom-text strong::before { content: "✓ "; color: var(--ok); }
@media (max-width: 640px) { .tom { grid-template-columns: 1fr; } }

/* Einrichtung */
.schmal { max-width: 760px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.schmal.mini { max-width: 420px; margin-top: 8vh; }
.willkommen { display: flex; gap: 20px; align-items: center; }
@media (max-width: 560px) { .willkommen { flex-direction: column; align-items: flex-start; } }
@media (prefers-reduced-motion: no-preference) {
  .willkommen img { animation: wippen 3s ease-in-out infinite; transform-origin: bottom center; }
  @keyframes wippen { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-3deg); } }
}

/* Ablagebereich */
.ablage { border: 2px dashed var(--linie); border-radius: 12px; background: var(--bg); padding: 24px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transition: border-color .15s, background-color .15s; }
.ablage.ueber { border-color: var(--akzent); background: var(--akzent-hell); }
.ablage.gefuellt { border-style: solid; }
.ablage-titel { font-weight: 700; font-size: 1.05rem; margin: 0; }
.ablage .knopfreihe { justify-content: center; }
.ablage input.sr:focus-visible + label { outline: 3px solid var(--akzent); outline-offset: 2px; }
.ablage-auswahl { width: 100%; text-align: left; border-top: 1px solid var(--linie); padding-top: 10px; }
.ablage-summe { font-weight: 600; margin: 0 0 6px; }
.ablage-summe.fehler { color: var(--krit); }
.ablage-auswahl ul { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; font-size: 0.9rem; }
.ablage-auswahl li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--linie); }
.ablage-auswahl li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.ablage-auswahl li.zu-gross { color: var(--krit); }
button:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .ablage { transition: none; } }

/* Abschnitte, Reiter, Auswahlkarten */
.abschnitt-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 0.6rem; }
.abschnitt-kopf h2 { margin: 0; }
.reiter { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--linie); }
.reiter a { padding: 8px 14px; text-decoration: none; color: var(--leise); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 0.94rem; }
.reiter a.aktiv { color: var(--akzent-dunkel); border-bottom-color: var(--akzent); }
.reiter a:hover { color: var(--text); }
.wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.wahl-karte { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--linie); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: var(--bg); }
.wahl-karte:has(input:checked) { border-color: var(--akzent); background: var(--akzent-hell); }
.wahl-karte input { margin-top: 4px; accent-color: var(--akzent); width: auto; }
.wahl-karte span { font-size: 0.92rem; color: var(--leise); }
.wahl-karte strong { color: var(--text); }
.meldung ul { margin: 4px 0 0; padding-left: 20px; font-weight: 500; }
dl.werte { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.werte dt { color: var(--leise); }
dl.werte dd { margin: 0; }
.tabelle.flach { border: 0; }

/* Vorlagen und Quellen */
.vorlagen-liste { display: flex; flex-direction: column; gap: 10px; }
.vorlage { border-bottom: 1px solid var(--linie); padding-bottom: 10px; }
.vorlage:last-child { border-bottom: 0; }
.vorlage.aus { color: var(--leise); display: flex; gap: 8px; align-items: center; }
.vorlage-quelle { padding-left: 26px; margin-top: 2px; }
.quelle { font-size: 0.82rem; color: var(--leise); }
.quellen-liste { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.marker.neu { color: var(--akzent); }
.vergleich-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
.vergleich-spalten > div { background: var(--bg); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.vergleich-spalten p { margin: 4px 0 0; white-space: pre-wrap; }
.label { font-weight: 600; font-size: 0.85rem; color: var(--leise); }
@media (max-width: 640px) { .vergleich-spalten { grid-template-columns: 1fr; } }

/* Datenschutzhinweise */
.informationstext { max-width: 75ch; }
.informationstext section { margin-top: 16px; }
.informationstext h3 { font-size: 1rem; margin-bottom: 4px; }

/* Notfallschlüssel, Zwei-Faktor */
.notfall { border-color: var(--warn); }
.schluessel { background: var(--bg); border: 2px dashed var(--akzent); border-radius: 10px; padding: 18px; text-align: center; overflow-x: auto; }
.schluessel code { font-size: clamp(0.95rem, 2.4vw, 1.25rem); letter-spacing: 0.04em; font-weight: 700; word-break: break-all; }
.schritte { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.qr { background: #fff; display: inline-block; padding: 8px; border-radius: 8px; margin: 10px 0; }
.qr svg { display: block; width: 180px; height: 180px; }

.menue > summary { display: none; }
.wahl-karte input[type="radio"] { width: 18px; height: 18px; flex: none; }
@media (max-width: 820px) {
  .menue > summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; padding: 8px 12px; border: 1px solid var(--linie); border-radius: 8px; list-style: none; }
  .menue > summary::-webkit-details-marker { display: none; }
  .menue > summary::before { content: "☰"; }
  .menue[open] > nav { margin-top: 10px; }
  .seitenleiste nav { flex-direction: column; }
  .nav-gruppe { flex-direction: row; flex-wrap: wrap; }
  .nav-titel { width: 100%; }
}

/* Ausfüllhilfen */
.ausfuellhilfe { font-size: 0.9rem; }
.ausfuellhilfe > summary { cursor: pointer; color: var(--akzent); font-weight: 600; width: fit-content; }
.ausfuellhilfe[open] { background: var(--bg); border: 1px solid var(--linie); border-radius: 8px; padding: 10px 12px; }
.ausfuellhilfe p { margin: 8px 0; color: var(--text); }
.bausteine { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bausteine li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 6px 0; border-top: 1px solid var(--linie); }
.bausteine li span { min-width: 0; }
.baustein-knopf { flex: none; padding: 3px 10px; font-size: 0.82rem; }
.anleitung > summary { cursor: pointer; }
.anleitung ol { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Löschen, Suche, Kleinkram */
.gefahr { border-color: var(--krit); }
.gefahr > summary { cursor: pointer; color: var(--krit); font-weight: 600; }
.gefahr-knopf { background: var(--krit); border-color: var(--krit); color: #fff; }
.gefahr-knopf:hover { filter: brightness(0.92); }
.suche { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: 560px; }
.suche input { flex: 1; min-width: 200px; }
form.inline { display: inline; }
.umbruch { word-break: break-all; }
.knopfreihe form { margin: 0; }
.raster > form .reihe, .raster > .karte .reihe { grid-template-columns: 1fr; }

/* Amtliche Dokumente */
.amtlich-karte { text-decoration: none; color: var(--text); gap: 6px; }
.amtlich-karte:hover { border-color: var(--akzent); }
.amtlich-karte strong { color: var(--akzent-dunkel); }

/* ===== Einstiegsseiten ===== */
body.auth { min-height: 100vh; }
.auth-rahmen { display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; min-height: 100vh; }
.auth-breit .auth-rahmen { grid-template-columns: minmax(300px, 4fr) 8fr; }
.auth-marke { background: var(--akzent-hell); padding: 40px clamp(24px, 4vw, 56px); display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.auth-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--akzent-dunkel); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.01em; }
.auth-claim { font-size: clamp(1.35rem, 2.2vw, 1.75rem); font-weight: 700; line-height: 1.3; color: var(--text); margin: 0 0 18px; text-wrap: balance; max-width: 22ch; }
.vorteile { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-width: 40ch; }
.vorteile li { position: relative; padding-left: 30px; color: var(--text); }
.vorteile li::before { content: ""; position: absolute; left: 0; top: 0.2em; width: 20px; height: 20px; border-radius: 50%; background: var(--akzent); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10'/%3E%3C/svg%3E"); }
.vorteile li::after { content: ""; position: absolute; left: 6px; top: calc(0.2em + 5px); width: 8px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.auth-maskottchen { margin-top: auto; align-self: flex-start; width: min(200px, 60%); height: auto; }
.auth-inhalt { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px clamp(16px, 5vw, 64px) 24px; gap: 24px; max-width: none; }
.auth-karte { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.auth-breit .auth-karte { max-width: 760px; }
.auth-karte h1 { font-size: 1.85rem; }
.auth-karte .unter { margin-top: -8px; }
.auth-nebenlink { text-align: center; margin: 4px 0 0; font-size: 0.95rem; }
.auth-fuss { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; color: var(--leise); font-size: 0.85rem; margin-top: auto; padding-top: 24px; }
.knopf.breit, button.breit { width: 100%; text-align: center; padding: 11px 16px; }
.schrittfolge { list-style: none; counter-reset: schritt; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; color: var(--leise); font-size: 0.88rem; }
.schrittfolge li { counter-increment: schritt; }
.schrittfolge li::before { content: counter(schritt); display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: var(--neutral-bg); color: var(--text); font-size: 0.75rem; font-weight: 700; }
@media (max-width: 900px) {
  .auth-rahmen, .auth-breit .auth-rahmen { grid-template-columns: 1fr; }
  .auth-marke { position: static; height: auto; padding: 20px 16px; gap: 10px; }
  .auth-botschaft .vorteile, .auth-maskottchen { display: none; }
  .auth-claim { font-size: 1.05rem; margin: 0; max-width: none; font-weight: 600; }
  .auth-inhalt { justify-content: flex-start; padding-top: 28px; }
}

/* ===== Felder ===== */
.passwort-feld { position: relative; display: flex; }
.passwort-feld input { padding-right: 96px; }
.passwort-zeigen { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); padding: 4px 10px; font-size: 0.82rem; font-weight: 600; background: transparent; border: 0; color: var(--akzent); }
.passwort-zeigen:hover { text-decoration: underline; }
input, select, textarea { min-height: 42px; }
input[type="checkbox"], input[type="radio"] { min-height: 0; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--akzent) 45%, var(--linie)); }
input:focus, select:focus, textarea:focus { border-color: var(--akzent); outline: 2px solid color-mix(in srgb, var(--akzent) 35%, transparent); outline-offset: 1px; }
form.karte:has(.pflicht)::before, .auth-karte form:has(.pflicht)::before { content: "Mit * markierte Felder müssen ausgefüllt werden."; font-size: 0.82rem; color: var(--leise); }

/* ===== Formulare nicht zu breit ===== */
main > form.karte, main > form.stapel:not(:has(.tom-liste)), main > section.karte.stapel, main > details.karte, main > .hinweis, main > .meldung, main > .ablage { max-width: 880px; }
main > form.stapel > section.karte { max-width: none; }

/* ===== Rückmeldung beim Absenden ===== */
button[aria-busy="true"] { opacity: 0.75; cursor: progress; }
button[aria-busy="true"]::after { content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-left: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: drehen 0.8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button[aria-busy="true"]::after { animation: none; } }

/* ===== Seitenleiste, Fuß ===== */
.orgwahl { flex-direction: column; align-items: stretch; gap: 4px; }
.orgwahl select { width: 100%; }
.orgwahl-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--leise); font-weight: 600; }
.org { display: flex; flex-direction: column; gap: 2px; color: var(--text); font-weight: 600; font-size: 0.9rem; }
.app-fuss { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 16px clamp(16px, 4vw, 44px) 24px; color: var(--leise); font-size: 0.82rem; border-top: 1px solid var(--linie); max-width: 1100px; }
.rechtslinks { display: flex; gap: 16px; }
.rechtslinks a { color: var(--leise); }
.kopf h1 { font-size: clamp(1.45rem, 2.4vw, 1.75rem); }
.unter { font-size: 0.97rem; max-width: 75ch; }
@media (max-width: 820px) { body.mit-nav { grid-template-columns: 1fr; } }
.auth-inhalt { background: var(--flaeche); justify-content: space-between; }
.auth-karte { margin: auto 0; }
.auth-fuss { margin-top: 0; }
.auth-karte input, .auth-karte select, .auth-karte textarea { background: var(--bg); }
/* Menü-Container: am Desktop unsichtbare Hülle, am Handy aufklappbar */
.menue { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
.menue:not([open]) > :not(summary) { display: none; }
@media (max-width: 820px) {
  .seitenleiste { position: relative; padding: 12px 16px; gap: 0; }
  .marke { min-height: 40px; }
  .menue { gap: 14px; }
  .menue > summary { position: absolute; top: 12px; right: 16px; min-height: 40px; }
  .menue[open] { padding-top: 14px; }
  .menue[open] > nav { margin-top: 0; }
  .fuss { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--linie); }
}
@media (max-width: 820px) { .nav-gruppe { flex-direction: column; } .seitenleiste nav a { min-height: 44px; } }

/* Ruhige Seitenwechsel */
html { scrollbar-gutter: stable; }
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 140ms; animation-timing-function: ease-out; }
  .seitenleiste nav a { transition: background-color 120ms ease, color 120ms ease; }
}
/* Die Seitenleiste bleibt beim Wechsel stehen, nur der Inhalt blendet über */
.seitenleiste { view-transition-name: seitenleiste; }
::view-transition-old(seitenleiste), ::view-transition-new(seitenleiste) { animation: none; }
::view-transition-group(seitenleiste) { animation: none; }

/* Aktiver Menüpunkt deutlich */
.seitenleiste nav a { position: relative; }
.seitenleiste nav a.aktiv { background: var(--akzent-hell); color: var(--akzent-dunkel); font-weight: 650; box-shadow: inset 3px 0 0 var(--akzent); }
.seitenleiste nav a.aktiv .icon { opacity: 1; }
.seitenleiste nav a:focus-visible { outline-offset: -2px; }
.seitenleiste { overscroll-behavior: contain; }

/* Datei-Felder (einzelne Datei) und Ablagefläche */
.feld-label { font-weight: 600; font-size: 0.92rem; }
.dateifeld { position: relative; border: 1.5px dashed var(--linie); border-radius: 10px; background: var(--bg); transition: border-color .15s, background-color .15s, box-shadow .15s; }
.dateifeld:hover { border-color: var(--akzent); }
.dateifeld.ueber { border-color: var(--akzent); border-style: solid; background: var(--akzent-hell); }
.dateifeld:has(input:focus-visible) { border-color: var(--akzent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 30%, transparent); }
.dateifeld.gefuellt { border-style: solid; }
.dateifeld-leer, .dateifeld-gewaehlt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.dateifeld-leer { cursor: pointer; }
.dateifeld-gewaehlt[hidden], .dateifeld-leer[hidden] { display: none; }
.dateifeld-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dateifeld-text strong { overflow-wrap: anywhere; }
.dateifeld-text .hilfe { margin: 0; }
.dateifeld-knopf { color: var(--akzent); font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.leise { color: var(--leise); }
.dateifeld-symbol { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: var(--akzent-hell); color: var(--akzent-dunkel); }
.dateifeld-symbol .icon { width: 20px; height: 20px; opacity: 1; }
.dateifeld-symbol.klein { border-radius: 8px; }
.dateifeld-symbol.gross { width: 52px; height: 52px; }
.dateifeld-symbol.gross .icon { width: 24px; height: 24px; }
.icon-knopf { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 8px; background: transparent; border: 1px solid transparent; color: var(--leise); }
.icon-knopf:hover { background: var(--neutral-bg); border-color: var(--linie); color: var(--text); }
.icon-knopf .icon { width: 16px; height: 16px; opacity: 1; }
.dateifeld .knopf.klein-knopf { flex: none; }
/* Ablagefläche für mehrere Dateien an dieselbe Optik angleichen */
.ablage { border-width: 1.5px; border-radius: 10px; padding: 28px 16px; }
.ablage:hover { border-color: var(--akzent); }
.ablage:has(input:focus-visible) { border-color: var(--akzent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 30%, transparent); }
.ablage .knopf { background: var(--flaeche); }
.ablage .knopfreihe .knopf:first-of-type { background: var(--akzent); border-color: var(--akzent); color: #fff; }
@media (prefers-color-scheme: dark) { .ablage .knopfreihe .knopf:first-of-type { color: #0d1a18; } }
.feld-fehler { color: var(--krit); font-size: 0.88rem; font-weight: 600; margin: 4px 0 0; }
/* Aufklappbare Bereiche: eigenes Pfeilsymbol statt Browser-Dreieck */
details:not(.menue) > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; width: fit-content; }
details:not(.menue) > summary::-webkit-details-marker { display: none; }
details:not(.menue) > summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin: 0 3px 0 1px; transition: transform .15s; opacity: .7; }
details:not(.menue)[open] > summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { details > summary::before { transition: none; } }

/* PDF-Vorschau */
.pdf-ansicht { border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche); overflow: hidden; display: flex; flex-direction: column; }
.pdf-leiste { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--linie); background: var(--flaeche); }
.pdf-leiste[hidden] { display: none; }
.pdf-seiten { font-variant-numeric: tabular-nums; color: var(--leise); font-size: 0.9rem; }
.pdf-zoom { display: flex; align-items: center; gap: 6px; }
.pdf-zoom .icon-knopf { font-size: 1.15rem; font-weight: 600; color: var(--text); }
.pdf-prozent { min-width: 4.5ch; text-align: center; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.pdf-seitenfeld { height: 78vh; min-height: 480px; overflow: auto; background: var(--neutral-bg); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pdf-seite { background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .12), 0 4px 12px rgb(0 0 0 / .08); border-radius: 2px; flex: none; max-width: none; }
.pdf-seite canvas { display: block; width: 100%; height: 100%; }
.pdf-laedt { margin: auto; display: flex; align-items: center; gap: 10px; color: var(--leise); }
.pdf-laedt.fehler { color: var(--krit); }
.lade-kreis { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: drehen 0.8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .lade-kreis { animation: none; } }
/* PDF-Textebene (nach PDF.js) und Suche */
.pdf-seite { position: relative; }
.pdf-seite canvas { position: absolute; inset: 0; }
.textLayer { position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1; text-size-adjust: none; -webkit-text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; caret-color: CanvasText; z-index: 0; }
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; }
.textLayer span.markedContent { top: 0; height: 0; }
.textLayer ::selection { background: rgb(0 90 200 / .25); }
::highlight(pdf-treffer) { background-color: rgb(255 196 0 / .45); }
::highlight(pdf-treffer-aktiv) { background-color: rgb(255 120 0 / .65); }
.pdf-suche { display: flex; align-items: center; gap: 4px; flex: 1 1 260px; max-width: 420px; }
.pdf-suche-feld { position: relative; flex: 1; display: flex; align-items: center; }
.pdf-suche-feld .icon { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--leise); pointer-events: none; }
.pdf-suche-feld input { width: 100%; min-height: 34px; padding: 5px 10px 5px 32px; font-size: 0.9rem; }
.pdf-suchstand { min-width: 9ch; text-align: right; font-size: 0.85rem; color: var(--leise); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pdf-suchstand.ohne { color: var(--krit); }
.pdf-leiste { flex-wrap: wrap; }
@media (max-width: 640px) { .pdf-suche { order: 3; flex-basis: 100%; max-width: none; } }
/* PDF-Steuerung: Seiten, Ansicht, Vollbild */
.pdf-seitenfeld { position: relative; }
.pdf-seitenfeld:focus-visible { outline-offset: -3px; }
.pdf-seiten { display: flex; align-items: center; gap: 4px; color: var(--text); font-size: 0.9rem; }
.pdf-seitenwahl input { width: 3.4em; min-height: 34px; padding: 4px 6px; text-align: center; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.icon-knopf:disabled { opacity: .35; }
.pdf-zoom { flex-wrap: wrap; }
.pdf-zoom .klein-knopf[aria-pressed="true"] { background: var(--akzent-hell); border-color: var(--akzent); color: var(--akzent-dunkel); }
.pdf-trenner { width: 1px; align-self: stretch; background: var(--linie); margin: 4px 4px; }
.pdf-ansicht:fullscreen { border-radius: 0; border: 0; height: 100vh; }
.pdf-ansicht:fullscreen .pdf-seitenfeld { height: auto; flex: 1; min-height: 0; }
@media (max-width: 640px) { .pdf-zoom .klein-knopf { display: none; } .pdf-trenner { display: none; } }
.pdf-suche { min-width: 240px; max-width: 460px; } .pdf-leiste { row-gap: 8px; }
.pdf-suchstand { min-width: 0; } .pdf-suchstand:empty { display: none; } .pdf-suche-feld { min-width: 140px; }
/* Lesetext (Rechtsprüfung) */
.lesetext { max-width: 880px; line-height: 1.6; }
.lesetext h2 { margin-top: 1.4rem; } .lesetext h2:first-child { margin-top: 0; }
.lesetext h3 { font-size: 1.02rem; margin: 1.1rem 0 .4rem; }
.lesetext ul, .lesetext ol { padding-left: 1.3rem; margin: 0 0 .8rem; }
.lesetext li { margin: .2rem 0; }
.lesetext pre { background: var(--bg); border: 1px solid var(--linie); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: .85rem; }
.lesetext blockquote { margin: 0 0 .8rem; padding: 6px 14px; border-left: 3px solid var(--akzent); background: var(--bg); }
.lesetext hr { border: 0; border-top: 1px solid var(--linie); margin: 1.2rem 0; }
.lesetext .tabelle-huelle { overflow-x: auto; margin-bottom: .8rem; }

/* ---------- Vorschau-Sperre (Zugangscode) ---------- */
body.tor { min-height: 100vh; background: var(--bg); }
.tor-inhalt { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; max-width: none; }
.tor-karte { width: 100%; max-width: 400px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 16px; padding: clamp(24px, 5vw, 36px); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.06); }
.tor-karte h1 { font-size: 1.5rem; margin: 0; }
.tor-karte .unter { margin: 0; }
.tor-symbol { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--akzent-hell); color: var(--akzent-dunkel); }
.tor-symbol svg { width: 22px; height: 22px; }
.tor-karte input[name="code"] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; text-transform: uppercase; }
