/* Blätter (rechte Detail- und Bearbeiten-Ansicht) aus js/blatt.js · Präfix bl-.
   Basis (.blatt, .blatt-kopf, .rund, .zweck, .warnung, .fakten) steht in dashboard.css und css/kern.css.
   Nur Variablen, keine Schatten, keine Verläufe. Hell und dunkel über die Tokens. */

/* ── Rahmen ──
   Der Kern merkt sich beim Neuzeichnen die Scroll-Position von .blatt-inhalt. Deshalb scrollt der Inhalt,
   nicht das ganze Blatt: Der Kopf bleibt stehen, und nach jeder Änderung springt das Blatt nicht nach oben. */
.blatt { display: flex; flex-direction: column; overflow: hidden; container: blatt / inline-size; transition: width var(--t-2) var(--ease); }
.blatt.bl-breit { width: min(880px, 100%); }
.blatt-kopf { flex: none; position: relative; }
.blatt-inhalt { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-bottom: 80px; }
.blatt h2 { overflow-wrap: anywhere; }
.blatt h2[tabindex="-1"]:focus { outline: none; }
.blatt h2 .feld-wert { font: inherit; line-height: 1.1; }
.blatt h2 .feld-wert .i { width: 16px; height: 16px; }
.blatt h2 .feld-eingabe { font: inherit; }  /* wie der Titel (dashboard.css, Schrift-Regel 18.11.) */
.blatt[data-blatt="frage"] h2 { font-size: 24px; line-height: 1.2; }
.blatt-knoepfe .rund { display: inline-grid; place-items: center; color: var(--fg); }
.blatt-knoepfe .rund .i { width: 16px; height: 16px; }
.blatt-knoepfe .rund[aria-pressed="true"] { background: var(--flaeche3); border-color: var(--fg); }
.bl-gefahr:focus-visible { color: var(--rot); border-color: var(--rot); } @media (hover: hover) { .bl-gefahr:hover { color: var(--rot); border-color: var(--rot); } }
.bl-gefahr-voll { background: var(--rot-voll); border-color: var(--rot-voll); color: var(--auf-rot); height: 34px; }
@media (hover: hover) { .bl-gefahr-voll:hover { border-color: var(--fg); background: var(--rot-voll); } }  /* volle Fläche bleibt, nur der Rand zeigt Hover */
@media (max-width: 700px) { .bl-nur-breit { display: none; } }

/* Kopf: Status, Fälligkeit, Öffnen */
.bl-kopf-reihe { gap: 8px 10px !important; }
.bl-faellig { font-size: 12.5px; font-weight: 600; color: var(--mut); }
.bl-faellig.rot { color: var(--rot); }
.bl-faellig.gelb { color: var(--gelb); }
.bl-oeffnen { margin-inline-start: auto; }
.bl-oeffnen .i { width: 13px; height: 13px; }
.bl-termin-datum { font: 600 15px/1.3 var(--sans); }
.bl-termin-datum small { font-weight: 400; color: var(--mut); margin-inline-start: 6px; }
.bl-termin-datum small.gelb { color: var(--gelb); font-weight: 600; }

/* Segment-Knöpfe (Status, Art, Wichtigkeit) */
.bl-segment { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid var(--linie-ui); border-radius: var(--r2); background: var(--flaeche); max-width: 100%; }
.bl-segment button { border: 0; background: transparent; border-radius: var(--r2); height: 28px; padding: 0 10px; font: 600 12.5px/1 var(--sans); color: var(--mut); white-space: nowrap; transition: background var(--t-1) var(--ease), color var(--t-1) var(--ease); }
@media (hover: hover) { .bl-segment button:hover { color: var(--fg); background: var(--flaeche2); } }
.bl-segment button[aria-pressed="true"] { background: var(--flaeche3); color: var(--fg); outline: 1px solid var(--fg); outline-offset: -1px; }
.bl-segment button[aria-pressed="true"].ton-ok { background: var(--ok-hg); color: var(--ok); outline: 1px solid var(--ok); outline-offset: -1px; }
.bl-segment button[aria-pressed="true"].ton-blau { background: var(--blau-hg); color: var(--blau); outline: 1px solid var(--blau); outline-offset: -1px; }
.bl-segment button[aria-pressed="true"].ton-gelb { background: var(--gelb-hg); color: var(--gelb); outline: 1px solid var(--gelb); outline-offset: -1px; }
.bl-segment button[aria-pressed="true"].ton-rot { background: var(--rot-hg); color: var(--rot); outline: 1px solid var(--rot); outline-offset: -1px; }
.bl-segment button[aria-pressed="true"].ton-leer { background: var(--flaeche2); color: var(--fg); outline: 1px solid var(--linie2); outline-offset: -1px; }
.bl-segment button[aria-disabled="true"] { cursor: not-allowed; }
@media (hover: hover) { .bl-segment button[aria-disabled="true"]:not([aria-pressed="true"]):hover { background: transparent; color: var(--mut); } }

/* ── Abschnitte ── */
.blatt .bl-abschnitt { margin-top: 26px; }
.blatt .bl-abschnitt:first-child, .blatt .nur-lesen-band + .bl-abschnitt { margin-top: 18px; }
.bl-abschnitt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; margin-bottom: 8px; }
.bl-abschnitt-kopf h3 { margin: 0 !important; }
.bl-zahl { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--r2); background: var(--flaeche2); color: var(--fg); font: 700 var(--fs-12)/1 var(--sans); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.bl-wofuer { border-inline-start: 3px solid var(--kf); padding-inline-start: 14px; }
.bl-wofuer .zweck { font-size: 16.5px; }
.bl-wofuer .bl-reihen { margin-top: 12px; }
.bl-leer { color: var(--mut); font-size: 13.5px; line-height: 1.5; padding: 4px 0; }
.bl-meta { font-size: 12px; margin-top: 18px !important; }
.bl-band { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: var(--flaeche2); border-radius: var(--r2); padding: 9px 12px; font-size: 13.5px; margin-top: 14px !important; }
.bl-band-lesen { margin-top: 14px; margin-bottom: 0; flex-wrap: wrap; }

/* Hinweis als Warnbox */
.blatt .bl-hinweis { margin-top: 12px; align-items: flex-start; }
.bl-hinweis .feld-wert.block { flex: 1; width: auto; margin: -2px -6px; }
.bl-hinweis .feld-wert:focus-visible { background: var(--gelb-hg); } @media (hover: hover) { .bl-hinweis .feld-wert:hover { background: var(--gelb-hg); } }
.bl-hinweis-leer { margin-top: 10px !important; font-size: 13px; }

/* Reihen: Label links, Wert rechts (schmal: untereinander) */
.bl-reihen { display: grid; border: 1px solid var(--linie); border-radius: var(--r2); background: var(--flaeche); }
.bl-reihe { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 4px 14px; align-items: baseline; padding: 9px 12px; min-width: 0; }
.bl-reihe + .bl-reihe { border-top: 1px solid var(--linie); }
.bl-reihe-label { font-size: 12.5px; color: var(--mut); padding-top: 3px; }
.bl-reihe-wert { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; }
.bl-reihe-wert > .feld-wert.block { flex-basis: 100%; }
.bl-reihe-wert > small { flex-basis: 100%; font-size: 12px; line-height: 1.4; }
.bl-oeffne { height: 24px; padding: 0 6px; }
.bl-oeffne .i { width: 12px; height: 12px; }

/* ── Aufgabe: großer Haken, Datum schieben ── */
.bl-aufgabe-kopf { align-items: center; }
.bl-aufgabe-kopf > .datum { text-align: start; min-width: 0; }
.bl-haken-gross { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px 0 6px; border: 1px solid var(--linie-ui); border-radius: var(--r2); background: var(--flaeche); font: 600 14px/1 var(--sans); transition: background var(--t-1) var(--ease), border-color var(--t-1) var(--ease), color var(--t-1) var(--ease); }
.bl-haken-gross svg { width: 28px; height: 28px; padding: 5px; border-radius: 50%; border: 1.5px solid var(--linie-ui); stroke: transparent; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: background var(--t-1) var(--ease), border-color var(--t-1) var(--ease), stroke var(--t-1) var(--ease); }
@media (hover: hover) { .bl-haken-gross:hover { border-color: var(--ok); } }
@media (hover: hover) { .bl-haken-gross:hover svg { border-color: var(--ok); stroke: var(--ok); } }
.bl-haken-gross.an { background: var(--ok-hg); border-color: var(--ok); color: var(--ok); }
.bl-haken-gross.an svg { background: var(--ok-voll); border-color: var(--ok-voll); stroke: var(--auf-ok); }
.bl-schieben { display: flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
.bl-aufraeumen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12.5px; }
.bl-aufraeumen .k .i { width: 13px; height: 13px; }

/* Verlauf der Erledigungen */
.bl-verlauf { list-style: none; margin: 0; padding: 0 12px; border: 1px solid var(--linie); border-radius: var(--r2); background: var(--flaeche); }
.bl-verlauf li { display: grid; grid-template-columns: 92px auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 0; font-size: 13.5px; }
.bl-verlauf li + li { border-top: 1px solid var(--linie); }
.bl-verlauf time { font-variant-numeric: tabular-nums; font-weight: 600; }
.bl-verlauf time small { display: block; font-weight: 400; font-size: var(--fs-12); color: var(--mut); }
.bl-von { color: var(--mut); font-size: 12.5px; }
.bl-notiz { min-width: 0; }

/* ── Listen: Links, Pfade, Verknüpfungen ── */
.bl-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bl-liste > li { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 2px 4px 2px 2px; border: 1px solid var(--linie); border-radius: var(--r2); background: var(--flaeche); transition: border-color var(--t-1) var(--ease); }
.bl-liste > li:focus-within { border-color: var(--linie2); } @media (hover: hover) { .bl-liste > li:hover { border-color: var(--linie2); } }
.bl-liste > li.bearbeiten { display: grid; gap: 0; padding: 4px 0 8px; border-color: var(--blau); }
.bl-liste > li.bearbeiten .bl-reihe + .bl-reihe { border-top: 0; }
.bl-liste > li.bearbeiten .bl-form-knoepfe { padding: 0 12px; }
.bl-ziel { all: unset; box-sizing: border-box; cursor: pointer; flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "b i" "s i"; column-gap: 10px; align-items: center; padding: 7px 10px; border-radius: var(--r2); text-decoration: none; }
span.bl-ziel { cursor: default; }
.bl-ziel b { grid-area: b; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-ziel small { grid-area: s; font-size: 12px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-ziel .i { grid-area: i; color: var(--mut); }
.bl-ziel:focus-visible .i { color: var(--fg); } @media (hover: hover) { .bl-ziel:hover .i { color: var(--fg); } }
@media (hover: hover) { .bl-ziel:hover b { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--linie2); } }
.bl-ziel:focus-visible { outline: var(--fokus-breite) solid var(--fokus); outline-offset: 0; }
.bl-icon { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border: 0; border-radius: var(--r2); background: transparent; color: var(--mut); font-size: 13px; transition: background var(--t-1) var(--ease), color var(--t-1) var(--ease), opacity var(--t-1) var(--ease); }
.bl-icon:focus-visible { background: var(--flaeche2); color: var(--fg); } @media (hover: hover) { .bl-icon:hover { background: var(--flaeche2); color: var(--fg); } }
.bl-icon.gefahr:focus-visible { background: var(--rot-hg); color: var(--rot); } @media (hover: hover) { .bl-icon.gefahr:hover { background: var(--rot-hg); color: var(--rot); } }
@media (hover: hover) {
  .bl-liste > li > .bl-icon, .bl-verlauf .bl-icon { opacity: .35; }
  .bl-liste > li:hover > .bl-icon, .bl-liste > li:focus-within > .bl-icon, .bl-verlauf li:hover .bl-icon, .bl-verlauf li:focus-within .bl-icon { opacity: 1; }
}
.bl-verkn { align-items: flex-start !important; padding: 6px 4px 6px 8px !important; }
.bl-richtung { flex: none; width: 18px; padding-top: 4px; color: var(--mut); font-weight: 700; text-align: center; }
.bl-verkn-text { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 3px 0; }
.bl-verkn-text .kat { font-size: 13.5px; color: var(--fg); font-weight: 600; }
.bl-verkn-wie { font-size: 12.5px; color: var(--mut); }
.bl-frei { font-weight: 600; font-size: 13.5px; }

/* Kleine Verweis-Listen (Vorhaben, Fragen, Termine) */
.bl-mini-liste { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.bl-mini { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--linie); border-radius: var(--r2); background: var(--flaeche); font-size: 13.5px; }
.bl-mini > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .bl-mini:hover { border-color: var(--linie2); } }
.bl-mini:focus-visible { outline: var(--fokus-breite) solid var(--fokus); outline-offset: 0; }
.bl-mini .datum { min-width: 0; }
.bl-mini .datum.mut { color: var(--mut); }

/* Plus-Knöpfe */
.bl-plus { gap: 4px; text-decoration: none !important; color: var(--mut); }
.bl-plus:focus-visible { color: var(--fg); background: var(--flaeche2); } @media (hover: hover) { .bl-plus:hover { color: var(--fg); background: var(--flaeche2); } }
.bl-plus .i { width: 13px; height: 13px; }
.bl-plus-reihe { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 8px; }
.bl-mehr { margin-top: 6px; }
.blatt .bl-erledigt { margin-top: 6px; }

/* Einordnung: jede Ordnung eine Zeile */
.bl-zuordnung { margin: 0; display: grid; border: 1px solid var(--linie); border-radius: var(--r2); background: var(--flaeche); }
.bl-zu-zeile { display: grid; grid-template-columns: 136px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 12px; }
.bl-zu-zeile + .bl-zu-zeile { border-top: 1px solid var(--linie); }
.bl-zu-zeile.aktiv { background: var(--flaeche2); }
.bl-zu-zeile.aktiv:first-child { border-radius: var(--r2) var(--r2) 0 0; }
.bl-zu-zeile.aktiv:last-child { border-radius: 0 0 var(--r2) var(--r2); }
.bl-zu-zeile dt { font-size: 12.5px; color: var(--mut); }
.bl-zu-zeile.aktiv dt { color: var(--fg); font-weight: 600; }
.bl-zu-zeile dd { margin: 0; min-width: 0; }
.bl-zu-wert { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.bl-zu-wert .kat { color: var(--fg); font-size: 13.5px; }
.bl-herkunft { font-size: var(--fs-12); }
.bl-zu-aktion .k { height: 24px; padding: 0 4px; font-size: var(--fs-12); }

/* Vorhaben: Fortschritt, Dienst-Chips */
.bl-fortschritt { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12.5px; color: var(--mut); font-variant-numeric: tabular-nums; }
.bl-fortschritt .balken { flex: 1; }
.bl-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bl-chip { display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 2px 0 10px; border: 1px solid var(--linie-ui); border-radius: var(--r2); background: var(--flaeche); max-width: 100%; }
.bl-chip .kat { color: var(--fg); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.bl-chip .link-knopf { min-width: 0; }
.bl-chip .bl-icon { width: 24px; height: 24px; border-radius: var(--r2); font-size: var(--fs-12); }
.bl-chip:not(:has(.bl-icon)) { padding-inline-end: 10px; }
.bl-chip-plus select { height: 30px; border: 1px dashed var(--linie-ui); border-radius: var(--r2); background: transparent; padding: 0 12px; font-size: 13px; color: var(--mut); max-width: 100%; cursor: pointer; }
@media (hover: hover) { .bl-chip-plus select:hover { border-color: var(--fg); color: var(--fg); } }

/* Build: Startbefehl */
.bl-befehl { flex: 1; min-width: 0; padding: 3px 3px 3px 10px; }
.bl-befehl code { display: flex; min-width: 0; }
.bl-befehl .feld-wert { font: inherit; }

/* ── Formulare (Unterformulare, Neu) ── */
.bl-unterform { margin-top: 8px; padding: 12px; border: 1px solid var(--blau); border-radius: var(--r2); background: var(--flaeche); }
.blatt fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.blatt fieldset:disabled { opacity: .6; }
.bl-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.bl-feld { display: grid; gap: 5px; align-content: start; min-width: 0; }
.bl-feld.breit { grid-column: 1 / -1; }
.bl-feld > span { font-size: 12.5px; font-weight: 600; color: var(--fg); }
.bl-feld > span b { color: var(--rot); font-weight: 700; }
.bl-feld > small { font-size: 12px; color: var(--mut); line-height: 1.4; }
.bl-feld input, .bl-feld select, .bl-feld textarea { width: 100%; min-width: 0; min-height: 38px; border: 1px solid var(--linie-ui); border-radius: var(--r2); background: var(--bg); padding: 7px 10px; font: 400 15px/1.4 var(--sans); color: var(--fg); transition: border-color var(--t-1) var(--ease); }
.bl-feld select { appearance: none; padding-inline-end: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 14px; cursor: pointer; }
.bl-feld textarea { resize: vertical; line-height: 1.5; }
@media (hover: hover) { .bl-feld input:hover, .bl-feld select:hover, .bl-feld textarea:hover { border-color: var(--fg); } }
.bl-feld input:focus, .bl-feld select:focus, .bl-feld textarea:focus { outline: var(--fokus-breite) solid var(--fokus); outline-offset: -1px; border-color: var(--fokus); }
.bl-feld input::placeholder, .bl-feld textarea::placeholder { color: var(--mut); opacity: .8; }
.bl-feld .bl-gross, .bl-feld input.bl-gross { font-size: 18px; min-height: 44px; font-weight: 500; }
.bl-feld.fehler input, .bl-feld.fehler select, .bl-feld.fehler textarea { border-color: var(--rot); }
.bl-fehlertext { color: var(--rot) !important; font-weight: 600; }
.bl-feld .bl-chips { min-height: 38px; }
.bl-form-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.bl-form-knoepfe kbd, .bl-form-fuss kbd { font-size: var(--fs-12); padding: 1px 4px; }

/* Neu: Typ-Wahl oben, Fuß klebt unten */
.bl-typen { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0 4px; }
.bl-typen button { height: 30px; padding: 0 12px; border: 1px solid var(--linie-ui); border-radius: var(--r2); background: transparent; font: 600 12.5px/1 var(--sans); color: var(--mut); }
@media (hover: hover) { .bl-typen button:hover { color: var(--fg); border-color: var(--fg); } }
.bl-typen button[aria-current="true"] { background: var(--flaeche3); border-color: var(--fg); color: var(--fg); }
.bl-neu { margin-top: 16px; }
.bl-form-fuss { position: sticky; bottom: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 20px -22px 0; padding: 12px 22px 14px; background: var(--bg); border-top: 1px solid var(--linie); }
.bl-form-fuss .schalter { margin-inline-end: auto; }

/* Schnell-Eingabe (natürliche Sprache) */
.bl-schnell { margin-top: 8px; }
.bl-schnell fieldset { display: flex; align-items: center; gap: 6px; padding: 3px 3px 3px 10px; border: 1px dashed var(--linie2); border-radius: var(--r2); background: transparent; transition: border-color var(--t-1) var(--ease), background var(--t-1) var(--ease); }
.bl-schnell fieldset:focus-within { border-style: solid; border-color: var(--fokus); background: var(--flaeche); }
.bl-schnell-plus { display: inline-grid; place-items: center; color: var(--mut); }
.bl-schnell-eingabe { flex: 1; min-width: 0; height: 34px; border: 0; background: transparent; font: 400 14.5px/1 var(--sans); color: var(--fg); outline: none; }
.bl-schnell .bl-schnell-eingabe:focus { outline: none; }
.bl-schnell-eingabe::placeholder { color: var(--mut); }
.bl-schnell .k { flex: none; }
.bl-schnell:not(:focus-within) .k { opacity: 0; pointer-events: none; }
.bl-schnell:has(.bl-schnell-eingabe:not(:placeholder-shown)) .k { opacity: 1; pointer-events: auto; }
.bl-vorschau { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-height: 22px; margin-top: 5px !important; font-size: 12px; color: var(--mut); }
.bl-vorschau .etikett { height: 20px; font-size: var(--fs-12); }
.bl-tipp { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.bl-tipp kbd { font-size: var(--fs-12); padding: 1px 4px; opacity: .6; }
.bl-schnell:not(:focus-within) .bl-vorschau:has(.bl-tipp) { visibility: hidden; }

/* ── rOSe: Wer kümmert sich (Zugewiesen an, Abteilung) als direkte Auswahl ── */
.bl-wahl { position: relative; display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.bl-wahl > i { position: absolute; inset-inline-start: 11px; width: 9px; height: 9px; border-radius: var(--r1); background: var(--kf-tief, var(--kf)); pointer-events: none; }
.bl-wahl select { min-width: 0; max-width: 100%; min-height: 38px; border: 1px solid var(--linie-ui); border-radius: var(--r2); background-color: var(--bg); padding: 6px 30px 6px 10px; font: 400 15px/1.4 var(--sans); color: var(--fg); appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 14px; transition: border-color var(--t-1) var(--ease); }
.bl-wahl > i ~ select { padding-inline-start: 28px; }
@media (hover: hover) { .bl-wahl select:hover { border-color: var(--fg); } }
.bl-wahl select:focus-visible { outline: var(--fokus-breite) solid var(--fokus); outline-offset: 1px; }
.bl-wahl select:disabled { opacity: .6; cursor: default; }
.bl-mir { min-height: 38px; }
@media (pointer: coarse) { .bl-wahl select, .bl-mir { min-height: 44px; } }

/* ── Breites Blatt: Reihen in zwei Spalten, wo es Platz gibt ── */
@container blatt (min-width: 760px) {
  .blatt-inhalt > .bl-abschnitt { max-width: 760px; }
  .bl-raster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Schmal (Handy ab 375 px) ── */
@container blatt (max-width: 520px) {
  .blatt-kopf { padding: 14px 16px 12px; }
  .blatt-inhalt { padding: 4px 16px 32px; }
  .blatt h2 { font-size: var(--fs-19); }
  .blatt[data-blatt="frage"] h2 { font-size: var(--fs-17); }
  .bl-reihe, .bl-zu-zeile { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .bl-reihe-label { padding-top: 0; font-size: var(--fs-12); }
  .bl-zu-zeile { grid-template-columns: minmax(0, 1fr) auto; }
  .bl-zu-zeile dt { grid-column: 1 / -1; font-size: var(--fs-12); }
  .bl-raster { grid-template-columns: minmax(0, 1fr); }
  .bl-feld input, .bl-feld select, .bl-feld textarea, .bl-schnell-eingabe, .bl-wahl select { font-size: 16px; } /* kein Zoom auf iOS */
  .bl-wahl { flex: 1 1 100%; }
  .bl-wahl select { width: 100%; }
  .bl-schieben { margin-inline-start: 0; width: 100%; }
  .bl-oeffnen { margin-inline-start: 0; }
  .bl-verlauf li { grid-template-columns: 82px minmax(0, 1fr) auto; }
  .bl-von { display: none; }
  .bl-form-fuss { margin: 20px calc(-16px / var(--zoom, 1)) 0; padding: 12px 16px; }
  .bl-form-fuss .schalter { flex-basis: 100%; }
  .bl-segment button { padding: 0 8px; }
  .fakten { grid-template-columns: minmax(0, 1fr); }
  .blatt-knoepfe { gap: 4px; }
  .blatt-knoepfe .rund { width: 32px; height: 32px; }
}

/* Dichte kompakt */
[data-dichte="kompakt"] .blatt .bl-abschnitt { margin-top: 18px; }
[data-dichte="kompakt"] .bl-reihe { padding: 6px 12px; }

@media (prefers-reduced-motion: reduce) {
  .blatt { transition: none; }
  .bl-segment button, .bl-haken-gross, .bl-haken-gross svg, .bl-icon, .bl-liste > li, .bl-wahl select { transition: none; }
}

/* B1: Tippziele auf Touch mind. 44px (--ziel-min) */
@media (pointer: coarse) {
  .bl-segment button, .bl-chip, .bl-chip-plus select, .bl-feld input, .bl-feld select, .bl-typen button, .bl-haken-gross { min-height: var(--ziel-min); }
  .bl-icon { min-width: var(--ziel-min); min-height: var(--ziel-min); }
  .bl-chip .bl-icon { min-width: 40px; min-height: 40px; }
}

/* ══ Sonne 2 (js/Sonne2_Spezifikation.md) ══
   Nur unter :root.sonne, Dunkel bleibt unberührt. Blatt-Titel 20/600 (dashboard.css), Abschnittsköpfe 12/600 --mut2 über .blatt h3,
   Felder am Rechner 14 px wie .eingabe. */
:root.sonne .blatt h2 .feld-eingabe { font: 600 20px/1.25 var(--sans); letter-spacing: -0.01em; }
:root.sonne .blatt .bl-abschnitt { margin-top: 20px; }
:root.sonne[data-dichte="kompakt"] .blatt .bl-abschnitt { margin-top: 14px; }
:root.sonne .bl-zahl { font-weight: 600; }
:root.sonne .bl-wofuer .zweck { font-size: var(--fs-15); }
@media (pointer: fine) and (min-width: 861px) {
  :root.sonne .bl-feld :is(input, select, textarea):not(.bl-gross) { min-height: 36px; font-size: var(--fs-14); }
  :root.sonne .bl-wahl select { min-height: 36px; font-size: var(--fs-14); }
}

/* ══════════ Projekt-Auswahl (Doc 42 §14, js/blatt.js projektWahlHtml) ══════════
   Knopf wie ein Feld, darunter ein Klappfeld mit Suche. Am Handy ein Sheet von unten. Keine Schatten, Altrosa nur als Fokuslinie. */
.pw { position: relative; display: block; min-width: 0; }
.pw-knopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--linie-ui); border-radius: var(--r2, 8px); background: var(--flaeche); color: var(--fg); font: inherit; text-align: start; cursor: pointer; }
.pw-knopf .i { flex: none; width: 16px; height: 16px; color: var(--mut); transition: transform var(--t-1, .15s); }
.pw.offen .pw-knopf .i { transform: rotate(180deg); }
.pw-wert { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-wert.leer { color: var(--mut); }
.pw-knopf:focus-visible, .pw-wahl:focus-visible, .pw-zu:focus-visible { outline: 2px solid var(--hier); outline-offset: 2px; }
@media (hover: hover) { .pw-knopf:hover { border-color: var(--fg); } }
.pw-knopf[aria-disabled="true"] { cursor: default; opacity: .7; }
/* So breit wie das Feld (nie über den Inhaltsbereich des Blatts hinaus), mindestens so breit, dass Titel lesbar bleiben */
/* Seiten-Check 23 (Fehler aus Notizen, Ramin 18.11.): Das Panel war so breit wie sein Feld. In schmalen Feldern (Notizen-Bezugszeile)
   brachen Titel dreizeilig um und das ✕ ragte heraus. Jetzt mindestens 380 px (höchstens Fensterbreite − 32 px), am Anfang des Felds
   ausgerichtet; ragt es rechts hinaus, setzt blatt.js .pw-ende (am Ende des Felds ausgerichtet). Am Handy Bottom Sheet wie bisher. */
.pw-panel { position: absolute; z-index: 40; top: calc(100% + 6px); inset-inline-start: 0; inset-inline-end: auto; inline-size: max(100%, min(380px, calc(100vw - 32px))); min-width: 0; box-sizing: border-box; display: grid; gap: 8px; padding: 10px; background: var(--sheet, var(--flaeche2)); border: 1px solid var(--linie-ui); border-radius: var(--r, 12px); }
.pw-panel.pw-ende { inset-inline-start: auto; inset-inline-end: 0; }
.pw-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pw-kopf b { font-size: var(--fs-14, 14px); }
.pw-zu { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; border-radius: var(--r2, 8px); background: transparent; color: var(--mut); cursor: pointer; }
.pw-zu .i { width: 18px; height: 18px; }
.pw-such { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 1px solid var(--linie-ui); border-radius: var(--r2, 8px); background: var(--flaeche); }
.pw-such .i { flex: none; width: 16px; height: 16px; color: var(--mut); }
/* Höhere Spezifität: Formular- und Notiz-Regeln (.bl-feld input, .nz-bezug-feld input) sollen das Suchfeld nicht rahmen */
.pw .pw-such > .pw-suche { flex: 1; min-width: 0; height: auto; min-height: 42px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--fg); font: inherit; outline: none; box-shadow: none; }
.pw-liste { max-height: min(52vh, 420px); overflow: auto; overscroll-behavior: contain; }
.pw-ul, .pw-ul ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pw-gruppe { margin-top: 8px; }
.pw-gruppe h4 { margin: 0 0 4px; padding: 0 10px; font-size: var(--fs-12, 12px); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.pw-wahl { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: var(--r2, 8px); background: transparent; color: var(--fg); font: inherit; text-align: start; cursor: pointer; }
.pw-wahl .pw-titel { min-width: 0; overflow-wrap: anywhere; }
.pw-wahl .pw-meta { grid-column: 1; color: var(--mut); font-size: var(--fs-12, 12px); }
.pw-wahl .i { grid-column: 2; grid-row: 1 / span 2; width: 16px; height: 16px; }
.pw-wahl[aria-pressed="true"] { background: var(--flaeche3); }
.pw-ohne .pw-titel { color: var(--mut); }
@media (hover: hover) { .pw-wahl:hover { background: var(--flaeche3); } }
.pw-hinweis { margin: 6px 10px 2px; color: var(--mut); font-size: var(--fs-12, 12px); }
/* Handy: Sheet von unten über die ganze Breite */
@media (max-width: 700px) {
  .pw-panel { position: fixed; z-index: 400; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; top: auto; width: auto; max-height: 82vh; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-radius: var(--r, 12px) var(--r, 12px) 0 0; border-bottom: 0; grid-template-rows: auto auto minmax(0, 1fr); }
  .pw-liste { max-height: none; min-height: 0; }
}
/* iOS Safari zoomt beim Fokus in Felder unter 16 px: auf Touch-Geräten und am Handy die Suche immer mit 16 px */
@media (max-width: 700px), (pointer: coarse) {
  .pw .pw-such > .pw-suche { font-size: 16px; }
}
/* Abschnitt „Verlauf dieses Eintrags“ (blatt.js, Seiten-Check 23): ruhig, unten im Blatt, lädt beim Aufklappen */
.bl-verlauf-abschnitt { margin-block-start: var(--s5, 24px); border-top: 1px solid var(--linie); padding-block-start: var(--s2, 8px); }
.bl-verlauf > summary { list-style: none; cursor: pointer; display: flex; align-items: center; min-height: var(--ziel-min, 44px); }
.bl-verlauf > summary::-webkit-details-marker { display: none; }
.bl-verlauf > summary h3 { margin: 0; }
.bl-verlauf > summary::after { content: ""; margin-inline-start: auto; width: 8px; height: 8px; border-inline-end: 1.5px solid var(--mut); border-block-end: 1.5px solid var(--mut); transform: rotate(45deg); }
.bl-verlauf[open] > summary::after { transform: rotate(-135deg); }
.bl-verlauf > summary:focus-visible { outline: var(--fokus-breite) solid var(--fokus); outline-offset: 2px; }
.bl-verlauf-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3, 12px); }
.bl-verlauf-liste li { display: grid; gap: 2px; font-size: var(--fs-14); }
.bl-verlauf-liste small { color: var(--mut2); }
.bl-verlauf-liste .mut { font-size: var(--fs-13); overflow-wrap: anywhere; }
.bl-verlauf-mehr { margin-block-start: var(--s3, 12px); }
