/* Buchhaltung › Anlagen (Bauplan Anlagen A16, A17, A22; Entwürfe „Main“, „HandyListe“, „HandyAkte“), Vorsatz an-.
   Die Seite rollt als Ganzes (wie Offene Posten). Ab 1241 px steht die Akte rechts neben der Liste und bleibt beim Rollen oben
   stehen; schmaler liegt sie als Blatt über der Liste (wie .af-akte in oo.css), am Handy über den ganzen Schirm mit den Knöpfen
   unten. Farbe trägt Bedeutung: E-Fahrzeug violett, Degressiv dunkel, abgeschrieben grün, „zu klären“ bernstein; Blau nur am
   Hauptknopf und am Fokus. ☠️ Obere Grenzen bei …,98 px (wie oo.hauptmenue.css): sonst lässt Windows-Skalierung Bruchpixel zwischen
   zwei Regeln. */

.an-seite { flex: 1 1 auto; min-height: 0; overflow: auto; background: var(--grund); }
.an-innen { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 18px 20px 24px; }

/* ── Kopf ─────────────────────────────────────────────────────────────────────────────────────────────── */
.an-kopf { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.an-titel { flex: 1 1 260px; min-width: 0; }
.an-titel h1 { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -.2px; }
.an-titel p { margin-top: 2px; color: var(--tinte-5); }
.an-jahr { display: flex; align-items: center; gap: 6px; }
.an-jahr-text { color: var(--tinte-5); font-size: 12px; }
.an-jahr-wert { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid var(--linie-stark); border-radius: 3px;
  background: var(--flaeche); color: var(--tinte-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.an-kopf-knoepfe { display: flex; align-items: center; gap: 6px; }
.an-neu { text-decoration: none; }
.an-neu-laden .kreisel { margin-right: 0; }

.an-band { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 3px; font-size: 12.5px; }
.an-band > span { flex: 1 1 auto; min-width: 0; }
.an-band.fehler { background: var(--alarm-grund); color: var(--alarm); }
.an-band.warn { background: var(--warn-grund); color: var(--warn); }
.an-laden { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 140px; color: var(--tinte-5); }
/* Die Hinweisleiste steht hier als eigenes Band zwischen Kennzahlen und Reitern (in den Auswertungen hängt sie unter dem Kopf). */
.an-innen > .hl { padding: 4px 8px 4px 12px; border: 0; border-radius: 3px; }

/* ── Kennzahlen ───────────────────────────────────────────────────────────────────────────────────────── */
.an-kennzahlen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.an-kachel { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); }
.an-kachel-titel { color: var(--tinte-5); font-size: 11.5px; font-weight: 600; }
.an-kachel-wert { overflow: hidden; color: var(--tinte-1); font-size: 22px; font-weight: 600; letter-spacing: -.2px; font-variant-numeric: tabular-nums;
  white-space: nowrap; text-overflow: ellipsis; }
.an-kachel-unter { min-height: 16px; color: var(--tinte-5); font-size: 12px; }
.an-kachel-unter.verlust { color: var(--alarm); }

/* ── Reiter und Suche ─────────────────────────────────────────────────────────────────────────────────── */
.an-leiste { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--linie); }
.an-reiter { display: flex; flex: 1 1 420px; gap: 18px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.an-reiter-kn { display: inline-flex; align-items: center; gap: 6px; height: 34px; margin-bottom: -1px; padding: 0; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--tinte-5); font: inherit; font-weight: 500; white-space: nowrap; cursor: pointer; }
.an-reiter-kn:hover { color: var(--tinte-2); }
.an-reiter-kn.gewaehlt { border-bottom-color: var(--tinte-1); color: var(--tinte-1); font-weight: 600; }
.an-reiter-kn:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.an-reiter-zahl { display: inline-flex; align-items: center; gap: 3px; height: 17px; padding: 0 5px; border-radius: 3px; background: var(--flaeche-2);
  color: var(--tinte-4); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.an-reiter-zahl.offen, .an-reiter-zahl.warn { background: var(--warn-grund); color: var(--warn); }
.an-suche { position: relative; display: flex; flex: 0 1 260px; align-items: center; min-width: 160px; margin-bottom: 4px; }
.an-suche > .sym { position: absolute; left: 8px; color: var(--tinte-6); pointer-events: none; }
.an-suche input { width: 100%; height: 28px; padding: 0 8px 0 28px; border: 1px solid var(--linie-stark); border-radius: 3px; background: var(--flaeche);
  color: var(--tinte-1); font: inherit; outline: none; }
.an-suche input:focus { border-color: var(--akzent); box-shadow: 0 0 0 2px var(--akzent-schein); }
.an-suche input::placeholder { color: var(--tinte-6); }
.an-nur-vorlesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Arbeitsfläche: Liste und Akte ────────────────────────────────────────────────────────────────────── */
.an-arbeit { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 14px; }
.an-arbeit.mit-akte { grid-template-columns: minmax(0, 1fr) clamp(384px, 31vw, 470px); }
.an-flaeche { min-width: 0; overflow: hidden; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); }
.an-schleier { display: none; }

/* Liste: zwei Zeilen je Anlage (Name, darunter Inventarnummer · Typ · Anschaffungswert). Die Liste rollt nicht selbst, die Seite rollt. */
.an-liste .af-tab { min-height: 120px; }
.an-liste .af-z:not(.af-karte) { height: 46px; }
.an-zelle-anlage { display: grid; gap: 1px; min-width: 0; }
.an-zelle-anlage .name, .an-unter { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.an-unter { color: var(--tinte-5); font-size: 11.5px; }
.an-name-verweis { color: var(--tinte-1); font-weight: 600; text-decoration: none; }
.an-name-verweis:hover { text-decoration: underline; text-decoration-color: var(--linie-stark); text-underline-offset: 2px; }
.an-abz-dunkel { background: color-mix(in srgb, var(--tinte-1) 12%, var(--flaeche)); color: var(--tinte-1); }
.an-betrag { color: var(--tinte-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.an-blass { color: var(--tinte-6); }
.an-zelle-stand { display: grid; gap: 3px; min-width: 0; }
.an-balken { display: block; width: 88px; height: 6px; overflow: hidden; border-radius: 3px; background: var(--auswahl); }
.an-balken > span { display: block; height: 100%; background: var(--tinte-3); }
.an-balken.voll > span { background: var(--ok); }
.an-stand { overflow: hidden; color: var(--tinte-4); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }

/* Karten am Handy (Entwurf „HandyListe“): Name und AfA, darunter Verfahren, Balken und Stand. ☠️ Eigener Name: .an-karte sind die
   Verfahren der Maske (Rahmen, Spalte) – mit demselben Namen bekam jede Karte der Liste deren Rahmen, und die AfA stand neben dem Namen. */
.an-liste .af-karte .af-c { padding: 0 4px; }
.an-listenkarte { display: grid; flex: 1 1 auto; align-content: center; gap: 5px; min-width: 0; }
.an-k1, .an-k2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.an-k-name { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--tinte-1); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.an-k-betrag { flex: 0 0 auto; color: var(--tinte-1); font-weight: 600; font-variant-numeric: tabular-nums; }
.an-k2 .an-balken { flex: 0 0 56px; width: 56px; height: 5px; }
.an-k-stand { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--tinte-5); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.an-k-stand.warn { color: var(--warn); }

.an-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; min-height: 36px; padding: 8px 12px; border-top: 1px solid var(--linie-stark);
  color: var(--tinte-4); font-size: 12.5px; }
.an-fuss-anzahl { flex: 1 1 auto; color: var(--tinte-2); font-weight: 600; }
.an-fuss-wert strong { margin-left: 6px; color: var(--tinte-1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-sammelposten-abgang { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--linie); background: var(--flaeche-2);
  color: var(--tinte-3); font-size: 12.5px; }
.an-sammelposten-abgang .sym { flex: 0 0 auto; margin-top: 2px; }

/* Zu klären */
.an-klaeren { margin: 0; padding: 0; list-style: none; }
.an-klaeren li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px; border-bottom: 1px solid var(--linie-fein); }
.an-klaeren li:last-child { border-bottom: 0; }
.an-klaeren-text { display: grid; flex: 1 1 240px; gap: 1px; min-width: 0; }
.an-klaeren-name { overflow: hidden; color: var(--tinte-1); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.an-klaeren-unter { color: var(--tinte-5); font-size: 11.5px; }
.an-klaeren-betrag { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-klaeren-knoepfe { display: flex; gap: 6px; }
.an-klaeren-knoepfe .kn { text-decoration: none; }
.an-klaeren-fehler { display: flex; align-items: center; gap: 9px; padding: 14px 12px; background: var(--warn-grund); color: var(--warn); }
.an-klaeren-fehler > span { flex: 1 1 auto; }
.an-leer { padding: 28px 12px; color: var(--tinte-5); text-align: center; }
.an-klaeren-mehr { padding: 10px 12px; border-top: 1px solid var(--linie-fein); color: var(--tinte-5); font-size: 12px; }

/* ── Akte ──────────────────────────────────────────────────────────────────────────────────────────────── */
.an-akte { position: sticky; top: 12px; display: flex; flex-direction: column; min-width: 0; max-height: calc(100vh - 64px); overflow-y: auto;
  border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); }
.an-akte-kopf { display: flex; align-items: flex-start; gap: 6px; padding: 14px 10px 10px 14px; border-bottom: 1px solid var(--linie); }
.an-akte-titel { flex: 1 1 auto; min-width: 0; }
.an-akte-nr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--tinte-5); font-size: 12px; }
.an-akte-titel h2 { margin-top: 3px; font-size: 17px; line-height: 1.25; font-weight: 600; overflow-wrap: anywhere; }
.an-akte-unter { margin-top: 1px; color: var(--tinte-5); }
.an-akte-zurueck { display: none; }
.an-akte:focus { outline: none; }
.an-akte:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.an-akte-mehr-ort { position: relative; }
/* Ein Klick neben ein offenes Menü ⋯ schließt es (im Stapel der Akte, unter dem Menü mit z-index 25). */
.an-menue-schleier { position: fixed; z-index: 24; inset: 0; background: transparent; }
.an-akte-menue { position: absolute; z-index: 25; top: calc(100% + 4px); right: 0; min-width: 240px; padding: 4px; border: 1px solid var(--linie-stark); border-radius: 3px;
  background: var(--flaeche); box-shadow: var(--schatten); }
.an-akte-menue button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 3px; background: none; color: var(--tinte-1); font: inherit;
  text-align: left; cursor: pointer; }
.an-akte-menue button:hover, .an-akte-menue button:focus-visible { background: var(--flaeche-2); }
.an-akte-inhalt { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px 18px; }
.an-akte-aktionen { display: flex; flex-wrap: wrap; gap: 6px; }
.an-akte-aktionen .kn { text-decoration: none; }
.an-akte-werte { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--linie); border-radius: 3px; }
/* Die Beschriftung bricht um statt abzuschneiden („Buchwert 31.12.2026“ ist neben der angedockten Akte und am Handy zu lang); die
   Werte stehen trotzdem auf einer Linie. */
.an-akte-werte > div { display: grid; align-content: space-between; gap: 2px; min-width: 0; padding: 8px 10px; border-right: 1px solid var(--linie); }
.an-akte-werte > div:last-child { border-right: 0; }
.an-akte-werte span { color: var(--tinte-5); font-size: 11.5px; overflow-wrap: anywhere; }
.an-akte-werte strong { color: var(--tinte-1); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-angaben { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0; }
.an-angaben > div { min-width: 0; }
.an-angaben dt { color: var(--tinte-5); font-size: 11.5px; }
.an-angaben dd { margin: 1px 0 0; color: var(--tinte-2); font-weight: 500; overflow-wrap: anywhere; }
.an-angabe-zusatz { display: block; color: var(--tinte-5); font-size: 11.5px; font-weight: 400; }
.an-akte-abschnitt h3, .an-akte-block h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.an-akte-block { padding: 12px 14px; border: 1px solid var(--linie); border-radius: 3px; }
.an-akte-block p { color: var(--tinte-3); }
.an-akte-block p + p { margin-top: 4px; }
.an-akte-block .an-angaben { margin-bottom: 2px; }
.an-verweis { display: inline-block; margin-top: 8px; color: var(--tinte-3); font-weight: 500; }
.an-verweis:hover { color: var(--tinte-1); }
.an-akte-satz { color: var(--tinte-4); font-size: 12.5px; }
.an-abgang p { color: var(--tinte-3); }
.an-warn { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; color: var(--warn); font-size: 12.5px; }
.an-warn .sym { flex: 0 0 auto; margin-top: 2px; }
.an-herkunft { color: var(--tinte-5); font-size: 11.5px; }
.an-herkunft > span { display: block; }

/* Güter eines Sammelpostens: ein ausgeschiedenes trägt sein Abzeichen. */
.an-mitglieder { margin: 0; padding: 0; list-style: none; }
.an-mitglieder li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; padding: 7px 0; border-bottom: 1px solid var(--linie-fein); }
.an-mitglieder li:last-child { border-bottom: 0; }
.an-mitglied-name { overflow: hidden; color: var(--tinte-1); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.an-mitglied-unter { grid-column: 1; color: var(--tinte-5); font-size: 11.5px; }
.an-mitglied-betrag { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; text-align: right; }
.an-mitglied-abgang { grid-column: 2; grid-row: 2; justify-self: end; }
.an-mitglieder-satz { margin: -2px 0 6px; }
.an-mitglied-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; grid-column: 1 / -1; margin-top: 4px; }
.an-mitglied-knoepfe .kn { text-decoration: none; }
.an-mitglied-knoepfe .an-akte-mehr-ort { margin-left: auto; }

/* ── Diagramm (aus Divs wie die Monatsgrafik der GuV) ────────────────────────────────────────────────── */
.an-plan-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 6px; }
.an-plan-kopf h3 { margin: 0; }
.an-legende { display: inline-flex; align-items: center; gap: 5px; color: var(--tinte-4); font-size: 11.5px; }
.an-legende::before { content: ""; width: 9px; height: 9px; border-radius: 2px; }
.an-legende.afa::before { background: var(--tinte-3); }
.an-legende.buchwert::before, .an-saeule-bw { background: color-mix(in srgb, var(--tinte-6) 45%, var(--flaeche)); }
.an-saeulen { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 0 2px; border-bottom: 1px solid var(--linie-stark); }
.an-saeule { position: relative; display: flex; flex: 1 1 0; flex-direction: column; justify-content: flex-end; align-items: stretch; min-width: 0; height: 100%; }
.an-saeule-wert { margin-bottom: 2px; overflow: hidden; color: var(--tinte-5); font-size: 10px; text-align: center; white-space: nowrap; }
.an-saeule-afa { display: block; border-radius: 2px 2px 0 0; background: var(--tinte-3); }
.an-saeule-bw { display: block; }
.an-saeule.gewaehlt .an-saeule-wert { color: var(--tinte-1); font-weight: 700; }
.an-saeule.gewaehlt .an-saeule-afa { background: var(--tinte-1); }
.an-saeule.gewaehlt .an-saeule-bw { background: var(--tinte-6); }
/* Jahre mit Vorschlag: gestreift – die EÜR rechnet sie erst nach der Bestätigung so. */
.an-saeule.vorschlag .an-saeule-afa { background: repeating-linear-gradient(135deg, var(--tinte-3) 0 3px, color-mix(in srgb, var(--tinte-3) 45%, var(--flaeche)) 3px 6px); }
.an-wechselmarke { position: absolute; top: 0; bottom: 0; left: -4px; border-left: 1px dashed var(--tinte-5); }
.an-wechselmarke span { position: absolute; top: 0; left: 4px; color: var(--tinte-4); font-size: 10.5px; white-space: nowrap; }
.an-grafik-jahre { display: flex; gap: 6px; padding: 4px 2px 0; }
.an-grafik-jahre span { flex: 1 1 0; min-width: 0; overflow: hidden; color: var(--tinte-5); font-size: 11px; text-align: center; }
.an-grafik-jahre span.gewaehlt { color: var(--tinte-1); font-weight: 700; }
.an-grafik.viele .an-saeulen, .an-grafik.viele .an-grafik-jahre { gap: 3px; }
.an-grafik.viele .an-saeule-wert { visibility: hidden; }
.an-grafik.viele .an-grafik-jahre span { font-size: 9.5px; }

.an-wechsel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 2px; padding: 8px 10px; border-radius: 3px; background: var(--flaeche-2);
  color: var(--tinte-3); font-size: 12.5px; }
.an-wechsel p { flex: 1 1 240px; }

/* ── Plan ──────────────────────────────────────────────────────────────────────────────────────────────── */
.an-plan { margin-top: 8px; container: an-plan / inline-size; }
.an-plan-raster { display: grid; grid-template-columns: minmax(0, 1.5fr) 62px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.an-plan-raster > span { min-width: 0; padding: 0 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.an-plan-raster > .rechts { text-align: right; }
.an-plan-kopfzeile { height: 28px; border-bottom: 1px solid var(--linie); color: var(--tinte-5); font-size: 11.5px; font-weight: 600; }
.an-plan-zeile { width: 100%; min-height: 28px; padding: 0; border: 0; border-bottom: 1px solid var(--linie-fein); background: transparent; color: inherit; font: inherit;
  font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: left; }
button.an-plan-zeile { cursor: pointer; }
button.an-plan-zeile:hover { background: var(--grund); }
button.an-plan-zeile:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.an-plan-zeile.gewaehlt { background: var(--auswahl); font-weight: 600; }
.an-plan-zeile.gewaehlt .an-plan-jahr { box-shadow: inset 2px 0 0 var(--tinte-1); }
/* Jahr, Verfahren und „Vorschlag“ brechen in schmalen Spalten um, statt abgeschnitten zu werden. */
.an-plan-jahr { display: flex; flex-wrap: wrap; align-items: center; gap: 1px 5px; }
.an-plan-zeile > .an-plan-jahr { padding-top: 3px; padding-bottom: 3px; }
.an-plan-pfeil { display: inline-block; width: 10px; color: var(--tinte-5); }
.an-plan-art { color: var(--tinte-5); font-size: 11px; font-weight: 400; }
.an-plan-vorschlag { height: 17px; padding: 0 5px; font-size: 10.5px; }
.an-plan-afa { font-weight: 600; }
.an-plan-zeile.vorschlag .an-plan-afa { color: var(--tinte-3); }
.an-monate { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 12px; padding: 6px 8px 10px 20px; border-bottom: 1px solid var(--linie-fein);
  background: var(--grund); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.an-monat { display: flex; justify-content: space-between; gap: 6px; padding: 2px 0; border-bottom: 1px solid var(--linie-fein); }
.an-monat span:first-child { color: var(--tinte-5); }
.an-plan-satz { margin-top: 6px; color: var(--tinte-5); font-size: 11.5px; }
/* Fünf Spalten brauchen gut 480 px; die angedockte Akte (höchstens 470 px) ist schmaler. Dort fehlt „Kumuliert“ wie in der Vorschau der
   Maske (der Wert steht im Namen der Zeile für Vorleser) – sonst schnitt die Spalte jeden Betrag ab („21.700,0…“, bei 1280 px „3.100,…“).
   ☠️ Vor dem Block für das Handy: dort gelten drei Spalten. */
@container an-plan (max-width: 479.98px) {
  .an-plan-raster { grid-template-columns: minmax(0, 1.3fr) 58px minmax(0, 1fr) minmax(0, 1fr); }
  .an-plan-raster > span { padding: 0 6px; }
  .an-plan-raster > span:nth-child(4) { display: none; }
}

/* ── Schmale Fenster ──────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1240.98px) {
  /* Die Akte liegt als Blatt über der Liste, statt ihr Breite zu nehmen (wie .af-akte). */
  .an-arbeit.mit-akte { grid-template-columns: minmax(0, 1fr); }
  .an-akte { position: fixed; z-index: 20; top: 40px; right: 0; bottom: 0; width: min(470px, 100vw); max-height: none; border-width: 0 0 0 1px;
    border-color: var(--linie-stark); border-radius: 0; box-shadow: -14px 0 36px rgba(15, 23, 42, .16); }
  .an-schleier { display: block; position: fixed; z-index: 19; inset: 40px 0 0 0; background: var(--schleier); }
}
@media (max-width: 1099.98px) {
  .an-innen { padding: 16px; }
  .an-kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640.98px) {
  /* Handy (Entwürfe „HandyListe“, „HandyAkte“): Titel und Jahr in einer Zeile, der Hauptknopf nur als „+“, die Suche über die ganze Breite. */
  .an-innen { gap: 10px; padding: 12px 12px 24px; }
  .an-kopf { align-items: center; gap: 8px; }
  .an-titel { flex: 1 1 auto; }
  .an-titel h1 { font-size: 19px; }
  .an-titel p, .an-jahr-text, .an-export, .an-neu-laden { display: none; }
  .an-jahr .kn { width: 36px; height: 36px; }
  .an-neu { width: 36px; height: 36px; padding: 0; }
  .an-neu span { display: none; }
  .an-kachel { padding: 8px 10px; }
  .an-kachel-wert { font-size: 17px; }
  .an-reiter, .an-suche { flex-basis: 100%; }
  .an-suche { margin-bottom: 8px; }
  .an-suche input { height: 36px; }
  /* Die Akte über den ganzen Schirm: oben „‹ Anlagen“ und ⋯, unten die Knöpfe. */
  .an-akte { width: 100vw; border-left: 0; box-shadow: none; }
  .an-akte-kopf { flex-wrap: wrap; padding: 4px 6px 10px 14px; }
  .an-akte-zurueck { display: inline-flex; order: 1; height: 44px; margin-right: auto; margin-left: -8px; }
  .an-akte-mehr-ort { order: 2; }
  .an-akte-mehr { width: 44px; height: 44px; }
  .an-akte-titel { order: 3; flex-basis: 100%; }
  .an-akte-zu { display: none; }
  .an-akte-aktionen { position: sticky; z-index: 2; bottom: 0; order: 99; margin: 0 -14px -18px; padding: 10px 14px; border-top: 1px solid var(--linie); background: var(--flaeche); }
  .an-akte-aktionen .kn { flex: 1 1 0; height: 44px; }
  .an-angaben { grid-template-columns: minmax(0, 1fr); }
  .an-monate { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Plan am Handy: Jahr, Abschreibung, Buchwert. */
  .an-plan-raster { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); }
  .an-plan-raster > span:nth-child(2), .an-plan-raster > span:nth-child(4) { display: none; }
}

/* ── Erfassen und Bearbeiten (A18, Entwurf „Erfassen“): ein Blatt, links die Abschnitte, rechts die Vorschau ───────────────── */
.an-maske-grund { min-height: 100%; }
.an-maske { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 0 24px; align-items: start; }
.an-maske-felder { min-width: 0; margin: 0; padding: 0; border: 0; }
.an-maske .fm-z { grid-template-columns: 132px minmax(0, 1fr); }
.an-maske-hilfe { margin: -2px 0 8px 142px; color: var(--tinte-5); font-size: 11.5px; }
.an-maske-quelle { font-size: 10.5px; }
.an-maske-einjahr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--tinte-3); }
.an-maske-einheit { flex: 0 0 auto; color: var(--tinte-5); }
.an-maske-betrag { flex: 0 1 160px; }
.an-maske-datum { flex: 0 1 160px; }
.an-maske-satz { margin: 6px 0 8px; padding: 8px 10px; border-radius: 3px; background: var(--flaeche-2); color: var(--tinte-3); font-size: 12.5px; }
.an-maske-laeuft { margin: 10px 0 0; color: var(--tinte-4); font-size: 12.5px; }
.an-maske-unklar { margin: 12px 0 2px; }
.an-maske-beleg { flex-wrap: wrap; gap: 2px 10px; }
.an-maske-beleg .an-verweis { margin-top: 0; }

/* Anlagetyp: Treffer der AfA-Tabelle unter dem Feld. */
.an-typ { position: relative; flex: 1 1 auto; min-width: 0; }
.an-typ-treffer { position: absolute; z-index: 5; top: calc(100% + 2px); left: 0; right: 0; padding: 4px; border: 1px solid var(--linie-stark); border-radius: 3px;
  background: var(--flaeche); box-shadow: 0 10px 28px rgba(15, 23, 42, .14); }
.an-typ-liste { max-height: 248px; overflow-y: auto; }
.an-typ-treffer button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 5px 8px; border: 0; border-radius: 3px;
  background: transparent; color: var(--tinte-2); font: inherit; text-align: left; cursor: pointer; }
.an-typ-treffer button:hover, .an-typ-treffer button.gewaehlt { background: var(--flaeche-2); }
.an-typ-treffer button.gewaehlt { box-shadow: inset 2px 0 0 var(--tinte-1); }
.an-typ-name { font-weight: 500; }
.an-typ-unter { color: var(--tinte-5); font-size: 11.5px; }
.an-typ-treffer .an-maske-quelle { margin: 4px 8px 2px; color: var(--tinte-6); }
.an-typ-vorschlag { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 4px; color: var(--tinte-4); font-size: 12px; }

/* Verfahren als Karten; gesperrte sagen ihren Grund. */
.an-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; margin-bottom: 8px; }
.an-karte { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 58px; padding: 8px 10px; border: 1px solid var(--linie-stark);
  border-radius: 3px; background: var(--flaeche); color: var(--tinte-2); font: inherit; text-align: left; cursor: pointer; }
.an-karte:hover:not(:disabled) { background: var(--grund); }
.an-karte.gewaehlt { border-color: var(--tinte-1); box-shadow: inset 0 0 0 1px var(--tinte-1); background: var(--flaeche-2); }
.an-karte:disabled { cursor: default; background: var(--grund); color: var(--tinte-6); }
.an-karte:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
.an-karte-titel { font-weight: 600; }
.an-karte-unter { color: var(--tinte-5); font-size: 11.5px; line-height: 1.35; }
.an-karte:disabled .an-karte-unter { color: var(--tinte-6); }

/* Vorschau: klebt beim Rollen oben, rechnet bei jeder Eingabe. */
.an-maske-vorschau { position: sticky; top: 0; min-width: 0; padding: 15px 0 10px; }
.an-vorschau-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; margin-bottom: 10px; }
.an-vorschau-kopf h3 { margin: 0; font-size: 14px; font-weight: 600; }
.an-vorschau-kopf span { color: var(--tinte-5); font-size: 11.5px; }
.an-vorschau-leer { color: var(--tinte-5); }
.an-vorschau-werte { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 10px; border: 1px solid var(--linie); border-radius: 3px;
  background: var(--flaeche); }
.an-vorschau-werte > div { display: flex; flex-direction: column; justify-content: space-between; gap: 1px; min-width: 0; padding: 8px 10px; border-right: 1px solid var(--linie); }
.an-vorschau-werte > div:last-child { border-right: 0; }
/* „Abgeschrieben September 2040“ und „Buchwert dann 0,00 €“ brechen um, statt über den Rand zu laufen bzw. abgeschnitten zu werden. */
.an-vorschau-werte span { color: var(--tinte-5); font-size: 11.5px; overflow-wrap: anywhere; }
.an-vorschau-werte strong { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-vorschau-werte [data-vorschau="ende"] strong { white-space: normal; }
.an-vergleich, .an-vorschau-satz { margin: 0 0 10px; padding: 8px 10px; border-radius: 3px; background: var(--flaeche-2); color: var(--tinte-3); font-size: 12.5px; }
.an-maske-vorschau .an-plan-raster { grid-template-columns: minmax(0, 1.4fr) 58px minmax(0, 1fr) minmax(0, 1fr); }
/* In der Vorschau ohne „Kumuliert“: die Spalte passt neben die Abschnitte nicht. */
.an-maske-vorschau .an-plan-raster > span:nth-child(4) { display: none; }

@media (max-width: 1099.98px) {
  .an-maske { grid-template-columns: minmax(0, 1fr); }
  .an-maske-vorschau { position: static; border-top: 1px solid var(--linie); }
}
@media (max-width: 640.98px) {
  .an-maske .fm-z { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .an-maske-hilfe { margin-left: 0; }
  .an-karten { grid-template-columns: minmax(0, 1fr); }
  .an-vorschau-werte { grid-template-columns: minmax(0, 1fr); }
  .an-vorschau-werte > div { border-right: 0; border-bottom: 1px solid var(--linie); }
  .an-vorschau-werte > div:last-child { border-bottom: 0; }
  /* Wie der Plan der Akte am Handy: Jahr, Abschreibung, Buchwert. */
  .an-maske-vorschau .an-plan-raster { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); }
  /* Der Fuß trägt hier drei Knöpfe (mit „Speichern und neu“): „Ungespeicherte Änderungen“ steht darüber, und was nicht passt, bricht um –
     sonst lief „Speichern“ bei 390 px rechts aus dem Bild. */
  #anm-blatt .bl-fuss { flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 6px 8px; min-height: 48px; padding: 8px 12px; }
  #anm-blatt .bl-fuss .stand:not(:empty) { flex-basis: 100%; }
}

/* Kaufbeleg verknüpfen (A18): die Belege „zu klären“ mit Suche unter der Zeile „Kaufbeleg“. */
.an-maske-angaben { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--tinte-3); }
.an-belegwahl { display: grid; gap: 6px; margin: 0 0 10px 142px; padding: 8px; border: 1px solid var(--linie-stark); border-radius: 3px; background: var(--flaeche); }
.an-belegwahl > .kn { justify-self: start; }
.an-belegwahl .an-maske-hilfe { margin: 0; }
.an-belegwahl-liste { max-height: 240px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.an-belegwahl-eintrag { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 5px 8px; border: 0; border-radius: 3px;
  background: transparent; color: var(--tinte-2); font: inherit; text-align: left; cursor: pointer; }
.an-belegwahl-eintrag:hover { background: var(--flaeche-2); }
.an-belegwahl-eintrag.gewaehlt { background: var(--flaeche-2); box-shadow: inset 2px 0 0 var(--tinte-1); }
.an-belegwahl-eintrag:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
.an-belegwahl-name { font-weight: 500; }
.an-belegwahl-unter { color: var(--tinte-5); font-size: 11.5px; }
.an-belegwahl-stand { display: flex; align-items: center; gap: 6px; margin: 2px 0; font-size: 12px; }
@media (max-width: 640.98px) {
  .an-belegwahl { margin-left: 0; }
}

/* ── Kopf: „Anlagenverzeichnis ▾“ (A16, A20) – das Menü wie ⋯ der Akte ──────────────────────────────────────────────── */
.an-export { position: relative; }
.an-export-menue { min-width: 220px; }
.an-export-jahr { display: block; padding: 6px 10px 4px; color: var(--tinte-5); font-size: 11.5px; }

/* ── Dialog „Abgang erfassen“ (A19, Entwurf „Abgang“) ────────────────────────────────────────────────────────────── */
.oo-dialog.an-abgang-dialog { top: 8vh; width: min(620px, calc(100vw - 32px)); max-height: 86vh; overflow-y: auto; }
/* Die Grundregel der Absätze (0,2,1) überstimmt .oo-dialog p; die Regeln darunter tragen darum .oo-dialog.an-abgang-dialog (0,3,0). */
.oo-dialog.an-abgang-dialog p { margin: 0; white-space: normal; }
.oo-dialog.an-abgang-dialog .an-ab-unter { margin: 0 0 12px; color: var(--tinte-5); }
.an-ab-felder .fm-z { grid-template-columns: 150px minmax(0, 1fr); }
.an-ab-titel { color: var(--tinte-4); }
.an-ab-art { justify-self: start; min-width: 0; }
.an-ab-art button { padding: 0 12px; white-space: nowrap; }
.an-ab-art button:focus-visible { outline: 2px solid var(--akzent); outline-offset: -1px; }
.an-ab-datum { width: 150px; }
.an-ab-betrag-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.an-ab-betrag { width: 150px; text-align: right; font-variant-numeric: tabular-nums; }
.an-ab-hilfe { color: var(--tinte-5); font-size: 11.5px; }
.oo-dialog.an-abgang-dialog .an-ab-feldfehler { margin: -2px 0 6px 160px; color: var(--alarm); font-size: 12px; }
.oo-dialog.an-abgang-dialog .an-ab-doppelt { margin: -2px 0 6px 160px; color: var(--tinte-5); font-size: 11.5px; }

.an-ab-wirkung { margin-top: 8px; padding: 12px 14px; border: 1px solid var(--linie); border-radius: 3px; background: var(--grund); }
.an-ab-wirkung h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.an-ab-rechnung { display: grid; gap: 5px; margin: 0; }
.an-ab-rechnung > div { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.an-ab-rechnung dt { min-width: 0; color: var(--tinte-3); }
.an-ab-rechnung dd { margin: 0; color: var(--tinte-1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-ab-rechnung .summe { padding-top: 5px; border-top: 1px solid var(--linie); font-weight: 600; }
.an-ab-rechnung .summe dt { color: var(--tinte-1); }
.an-ab-rechnung .gewinn dd { color: var(--ok); }
.an-ab-rechnung .verlust dd { color: var(--alarm); }
.oo-dialog.an-abgang-dialog .an-ab-wirkung p { margin-top: 10px; color: var(--tinte-3); font-size: 12.5px; }
.oo-dialog.an-abgang-dialog .an-ab-wirkung p.an-warn { color: var(--warn); }
.oo-dialog.an-abgang-dialog .an-ab-notiz { margin-top: 10px; padding: 8px 10px; border-radius: 3px; background: var(--flaeche-2); color: var(--tinte-3); font-size: 12px; }
.oo-dialog.an-abgang-dialog .an-ab-fehler { margin-top: 10px; }
.an-abgang-dialog .knoepfe { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--linie); }
.an-ab-speichern .kreisel { margin-right: 6px; }
/* Wechsel zu linear erfassen (A2, P3): derselbe Rahmen wie der Abgang, schmaler. */
.oo-dialog.an-wechsel-dialog { width: min(520px, calc(100vw - 32px)); }
.oo-dialog.an-wechsel-dialog .an-we-satz { margin: 0 0 12px; color: var(--tinte-3); }
.an-we-jahr { width: 200px; max-width: 100%; }
.an-we-speichern .kreisel { margin-right: 6px; }
@media (max-width: 640.98px) {
  .oo-dialog.an-abgang-dialog { top: 4vh; max-height: 92vh; }
  .an-ab-felder .fm-z { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .an-ab-art { justify-self: stretch; }
  .an-ab-art button { height: 36px; padding: 0 6px; white-space: normal; }
  .oo-dialog.an-abgang-dialog .an-ab-feldfehler { margin-left: 0; }
  .oo-dialog.an-abgang-dialog .an-ab-doppelt { margin-left: 0; }
  .an-abgang-dialog .knoepfe .kn { flex: 1 1 0; height: 44px; }
}

/* ── Erzwungene Farben (Windows-Kontrast) ─────────────────────────────────────────────────────────────────────────────── */
/* Hintergründe ersetzt der Browser dort durch die Fläche: Balken, Säulen und die Felder der Legende wären unsichtbar. Darum hier die
   Systemfarben selbst – Abschreibung in der Schriftfarbe, das gewählte Jahr hervorgehoben, Buchwert und Balken umrandet. */
@media (forced-colors: active) {
  .an-balken, .an-balken > span, .an-saeule-afa, .an-saeule-bw, .an-legende::before { forced-color-adjust: none; }
  .an-balken { box-shadow: inset 0 0 0 1px CanvasText; background: Canvas; }
  .an-balken > span, .an-balken.voll > span { background: CanvasText; }
  .an-saeule-afa, .an-legende.afa::before { background: CanvasText; }
  .an-saeule.gewaehlt .an-saeule-afa { background: Highlight; }
  .an-saeule.vorschlag .an-saeule-afa { background: repeating-linear-gradient(135deg, CanvasText 0 3px, Canvas 3px 6px); }
  .an-saeule-bw, .an-saeule.gewaehlt .an-saeule-bw, .an-legende.buchwert::before { box-shadow: inset 0 0 0 1px CanvasText; background: Canvas; }
}
