/* Icons (portal.js, Icons): im Fließtext auf Textmitte, in Flex-Zeilen nie gestaucht */
svg.ap-ic { flex: none; vertical-align: -0.15em; }

/* Status der Anzeige im Schrittkopf, gleiche Form wie .badge-whg, Farbe wie .pill der Vorgangsliste */
.ap-statusbadge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500; letter-spacing: .02em; padding: 1px 7px; border: 1px solid; }
.ap-statusbadge.is-entwurf { color: var(--ap-signal-tinte); background: var(--ap-signal-weich); border-color: var(--ap-signal-dunkel); }
.ap-statusbadge.is-aenderung { color: var(--ap-warn-tinte); background: var(--ap-warn-weich); border-color: var(--ap-warn-linie); }

/* ==========================================================================
   Anzeigenportal · Seitenbausteine
   --------------------------------------------------------------------------
   Ergänzt theme/portal.css um Bausteine, die im Klickdummy als <style> in
   den Seiten standen oder die erst das echte Portal braucht (Speicherstatus,
   Rückfragen, Verlauf, Amtsansichten). Nur Struktur — Werte aus Tokens.
   ========================================================================== */

/* --- Wortmarke im Kopf: Punkt + Produktname (kein nachgebautes Logo) --- */
.ap-wortmarke { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ap-text); }
.ap-wortmarke:hover { color: var(--ap-text); }
.ap-wortmarke__punkt { width: 14px; height: 14px; border-radius: 50%; background: var(--ap-signal); flex: none; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ap-text) 12%, transparent); }
.ap-wortmarke__t { display: flex; flex-direction: column; line-height: 1.1; }
.ap-wortmarke__t b { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.ap-wortmarke__t small { font-size: 12.5px; color: var(--ap-text-leise); letter-spacing: .01em; margin-top: 3px; }
.ap-suchknopf { border: 0; background: none; cursor: pointer; }
.ap-anbieter { height: 30px; width: auto; display: block; }
.ap-demo-marke { font-size: 12.5px; opacity: .8; }
/* Demo-Kennzeichen neben der Wortmarke: ruhig, aber auf jeder Seite */
.ap-demo-pille { align-self: center; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; margin-left: 14px; background: var(--ap-signal); color: var(--ap-auf-signal, var(--ap-text)); }
main { min-height: 60vh; }

/* --- Startseite: Bühne in der dunklen Mandantenfarbe, der Kreis angeschnitten --- */
body.ap-start { min-height: 100dvh; display: flex; flex-direction: column; }
body.ap-start main { flex: 1; display: flex; }
body.ap-start .foot { margin-top: 0; }
.hero { position: relative; overflow: hidden; flex: 1; min-height: 600px; background: var(--ap-dunkel); display: flex; isolation: isolate; }
.hero__kreis { position: absolute; z-index: -1; width: min(64vw, 900px); aspect-ratio: 1; border-radius: 50%; background: var(--ap-signal); left: max(-14vw, -200px); top: 58%; animation: kreis 1.6s var(--ap-feder-weich) both; }
@keyframes kreis { from { translate: 0 18%; opacity: 0; } }
.hero__txt { position: relative; z-index: 4; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px); gap: 32px 64px; align-items: start; padding-block: clamp(72px, 11vh, 128px) 120px; }
.hero__copy { display: flex; flex-direction: column; gap: 18px; padding-top: 24px; }
.hero__copy .eyebrow { color: var(--ap-auf-dunkel); opacity: .8; }
.hero__copy .fach::before { background: var(--ap-signal); }
.hero h1 { color: var(--ap-auf-dunkel); font-size: clamp(40px, 5.2vw, 74px); max-width: 12ch; letter-spacing: -.035em; line-height: 1.0; }
.hero p { color: var(--ap-auf-dunkel); opacity: .86; font-size: clamp(17px, 1.5vw, 21px); max-width: 30ch; }
@media (max-width: 900px) {
  .hero__txt { grid-template-columns: minmax(0, 1fr); padding-block: 48px 160px; }
  .hero__kreis { width: 120vw; left: -30vw; top: auto; bottom: -70vw; }
}
.strata { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 3; width: 100%; height: 56px; display: block; }
.strata path { transform-origin: 50% 100%; animation: layer 1.1s var(--ap-feder-weich) both; }
.strata path:nth-child(2) { animation-delay: .08s; } .strata path:nth-child(3) { animation-delay: .16s; }
.strata path:nth-child(4) { animation-delay: .24s; } .strata path:nth-child(5) { animation-delay: .32s; }
@keyframes layer { from { transform: scaleY(0); } }

.card { background: var(--ap-flaeche); border: 1px solid var(--ap-linie); }
.login { padding: clamp(22px, 2.6vw, 36px); display: flex; flex-direction: column; gap: 20px; }
.login h2 { font-size: 26px; }
.methods { display: flex; flex-direction: column; gap: 10px; border: 0; padding: 0; margin: 0; }
.method { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 28px; gap: 16px; align-items: center; padding: 12px 16px; border: 1px solid var(--ap-linie); background: var(--ap-flaeche); cursor: pointer; transition: border-color .2s, background-color .2s, transform .55s var(--ap-feder); }
.method:hover { border-color: var(--ap-akzent-50); background: var(--ap-flaeche-ruhig); }
.method:active { transform: scale(.985); transition-duration: .08s; }
.method input { position: absolute; opacity: 0; pointer-events: none; }
.method:has(input:focus-visible) { outline: 2px solid var(--ap-akzent); outline-offset: 2px; }
.method__ic { width: 44px; height: 44px; display: grid; place-items: center; background: var(--ap-akzent-weich); color: var(--ap-akzent-dunkel); transition: background-color .25s, color .25s; }
.method__t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.method__t b { font-weight: 600; font-size: 16px; color: var(--ap-text); }
.method__t span { font-size: 13.5px; color: var(--ap-text-weich); }
.method__chk { width: 26px; height: 26px; border: 1.5px solid var(--ap-akzent-50); display: grid; place-items: center; color: var(--ap-auf-akzent); transition: background-color .2s, border-color .2s; }
.method__chk svg path { stroke-dasharray: 26; stroke-dashoffset: 26; transition: stroke-dashoffset .35s var(--ap-ease) .05s; }
.method:has(input:checked) { border-color: var(--ap-akzent); background: var(--ap-akzent-hauch); box-shadow: inset 3px 0 0 var(--ap-akzent); }
.method:has(input:checked) .method__ic { background: var(--ap-akzent); color: var(--ap-auf-akzent); }
.method:has(input:checked) .method__chk { background: var(--ap-akzent); border-color: var(--ap-akzent); animation: pop .5s var(--ap-feder); }
.method:has(input:checked) .method__chk svg path { stroke-dashoffset: 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.cta { min-width: 280px; }
.cta.is-loading { pointer-events: none; }
.cta .bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--ap-akzent); }
.cta.is-loading .bar { animation: load 1s var(--ap-ease) forwards; }
@keyframes load { to { width: 100%; } }
.swap { animation: swap .38s var(--ap-feder) both; }
/* Demo-Bereich auf der Startseite: wer ist wer, ein Klick wählt den Anmeldeweg */
.ap-demo { margin-top: 28px; max-width: 520px; padding: 20px 22px; background: color-mix(in srgb, var(--ap-dunkel) 86%, transparent); border: 1px solid color-mix(in srgb, var(--ap-auf-dunkel) 18%, transparent); backdrop-filter: blur(6px); color: var(--ap-auf-dunkel); }
.ap-demo h2 { font-size: 17px; color: var(--ap-auf-dunkel); display: flex; align-items: center; gap: 10px; }
.ap-demo h2::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ap-signal); }
.hero .ap-demo p { font-size: 14px; max-width: none; margin-top: 6px; opacity: .8; }
.ap-demo code { font-size: 13px; padding: 0 5px; background: color-mix(in srgb, var(--ap-auf-dunkel) 14%, transparent); color: var(--ap-auf-dunkel); }
.ap-demo__konten { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
.ap-demo__konten li { border-top: 1px solid color-mix(in srgb, var(--ap-auf-dunkel) 14%, transparent); }
.ap-demo__konto { width: 100%; display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 10px 10px; background: none; border: 0; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: background-color .2s; }
.ap-demo__konto:hover { color: inherit; }
.ap-demo__konto:hover, .ap-demo__konto.is-on { background: color-mix(in srgb, var(--ap-auf-dunkel) 10%, transparent); }
.ap-demo__konto.is-on { box-shadow: inset 3px 0 0 var(--ap-signal); }
.ap-demo__wer { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ap-demo__wer b { font-weight: 600; font-size: 15px; }
.ap-demo__wer span { font-size: 13.5px; opacity: .72; }
.ap-demo__zugang { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; white-space: nowrap; }
.ap-demo__zugang span { opacity: .6; }


/* --- Rückfrage-Dialog (statt confirm()) --- */
dialog.ap-frage { border: 1px solid var(--ap-linie-kraeftig); border-top: 3px solid var(--ap-signal); padding: 26px 28px; width: min(480px, calc(100vw - 32px)); background: var(--ap-flaeche); color: var(--ap-text-fliess); box-shadow: 0 30px 70px -34px rgba(var(--ap-schatten-rgb), .7); }
dialog.ap-frage::backdrop { background: rgba(var(--ap-schatten-rgb), .42); }
dialog.ap-frage h2 { font-size: 22px; }
dialog.ap-frage p { margin-top: 10px; color: var(--ap-text-weich); font-size: 15px; }
/* Warnung vor der automatischen Abmeldung (portal.js, Sitzungsuhr) — eigene Klasse, siehe Falle 20 */
dialog.ap-sitzung { border: 1px solid var(--ap-linie-kraeftig); border-top: 3px solid var(--ap-signal); padding: 26px 28px; width: min(440px, calc(100vw - 32px)); background: var(--ap-flaeche); color: var(--ap-text-fliess); box-shadow: 0 30px 70px -34px rgba(var(--ap-schatten-rgb), .7); }
dialog.ap-sitzung::backdrop { background: rgba(var(--ap-schatten-rgb), .42); }
dialog.ap-sitzung h2 { font-size: 22px; }
dialog.ap-sitzung p { margin-top: 10px; color: var(--ap-text-weich); font-size: 15px; }
dialog.ap-sitzung b { color: var(--ap-text-fliess); }
dialog.ap-sitzung .ap-sperre__klein { font-size: 13.5px; }
/* Sperre: „Zu den Vorgängen“ links abgesetzt, die beiden Entscheidungen rechts */
dialog.ap-sitzung--breit { width: min(580px, calc(100vw - 32px)); }
dialog.ap-zertdialog { width: min(480px, calc(100vw - 32px)); }
/* Feedback-Dialog und Fußlink */
dialog.ap-feedback { width: min(560px, calc(100vw - 32px)); }
.ap-feedback-link { display: inline-flex; align-items: center; gap: 6px; }
.ap-feedback__ablage { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px dashed var(--ap-linie-kraeftig); background: var(--ap-flaeche-ruhig); cursor: pointer; transition: border-color .2s, background-color .2s; }
.ap-feedback__ablage:hover, .ap-feedback__ablage:focus-visible, .ap-feedback__ablage.is-ueber { border-color: var(--ap-akzent); background: var(--ap-akzent-hauch); outline: none; }
.ap-feedback__ablage span { display: flex; flex-direction: column; }
.ap-feedback__ablage small { color: var(--ap-text-leise); font-size: 12.5px; }
.ap-feedback__dateien { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ap-feedback__dateien:empty { display: none; }
.ap-feedback__dateien li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.ap-feedback__dateien img { width: 48px; height: 36px; object-fit: cover; border: 1px solid var(--ap-linie); }
.ap-feedback__dateien li > span { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.ap-feedback__dateien small { color: var(--ap-text-leise); }
dialog.ap-zertdialog .field input[type=file] { height: auto; padding: 10px 12px; }
.ap-zertdialog__fehler { margin: 0; color: var(--ap-fehler); font-size: 14px; }
dialog.ap-sitzung .ap-sperre__weg { margin-right: auto; }
@media (max-width: 640px) { dialog.ap-sitzung .ap-frage__f { flex-direction: column-reverse; align-items: stretch; } dialog.ap-sitzung .ap-sperre__weg { margin-right: 0; } }
/* Bearbeitungssperre: Leiste über dem Inhalt, solange die Anzeige hier nur angesehen wird (portal.js) */
.ap-nuransehen { position: sticky; top: var(--ap-kopf-hoehe, 64px); z-index: 49; width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 20px; background: color-mix(in srgb, var(--ap-signal) 14%, var(--ap-flaeche)); border-bottom: 1px solid var(--ap-linie-kraeftig); font-size: 14.5px; line-height: 1.4; }
.ap-nuransehen__symbol { display: inline-flex; flex: none; }
.ap-nuransehen p { margin: 0; min-width: 0; }
.ap-nuransehen b { white-space: nowrap; }
.ap-nuransehen__knoepfe { display: inline-flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .ap-nuransehen { justify-content: flex-start; padding: 8px 16px; font-size: 13.5px; }
  .ap-nuransehen p { flex: 1 1 calc(100% - 40px); }
  .ap-nuransehen__knoepfe { margin-left: 26px; }
}
body.is-nur-ansehen #inhalt > :not(#stepper) { opacity: .72; }
.ap-frage__f { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.btn--gefahr { --b: var(--ap-fehler); --f: #fff; }
.btn--gefahr:hover { background: color-mix(in srgb, var(--ap-fehler) 85%, black); border-color: transparent; }
.btn.is-busy { pointer-events: none; opacity: .65; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* --- Speicherstatus je Feld: fester Platz, nichts springt --- */
.ap-fs { display: block; min-height: 17px; font-size: 12px; font-weight: 400; color: var(--ap-text-leise); transition: color .2s; }
.ap-fs[data-zustand="ok"] { color: var(--ap-gut-tinte); }
.ap-fs[data-zustand="ok"]::before { content: "✓ "; }
.ap-fs[data-zustand="fehler"], .ap-fs[data-zustand="konflikt"] { color: var(--ap-fehler); }
.field.is-fehler input, .field.is-fehler select, .field.is-fehler textarea { border-color: var(--ap-fehler); box-shadow: inset 0 -2px 0 var(--ap-fehler); }
.field label, .field > span.l { display: block; }
.drawer__knopf { width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px 24px; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.drawer__knopf:hover { background: var(--ap-flaeche-ruhig); }
.drawer__knopf .ic { width: 40px; height: 40px; display: grid; place-items: center; background: var(--ap-akzent-weich); color: var(--ap-akzent-dunkel); }
.drawer__knopf b { font-weight: 500; color: var(--ap-text); font-size: 15.5px; }

/* --- Seitenkopf allgemeiner Seiten --- */
.ap-kopf { padding-block: clamp(36px, 5vw, 60px) clamp(22px, 3vw, 34px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; }
.ap-kopf h1 { font-size: clamp(30px, 3.4vw, 44px); margin-top: 10px; }
.ap-kopf p { color: var(--ap-text-weich); font-size: 17px; margin-top: 10px; max-width: 62ch; }
.ap-raster { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .ap-raster { grid-template-columns: minmax(0, 1fr); } }
.ap-stapel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ap-leer { padding: 28px; text-align: center; color: var(--ap-text-weich); }
.ap-tabelle { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ap-tabelle th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--ap-text-leise); letter-spacing: .04em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--ap-linie-kraeftig); white-space: nowrap; }
.ap-tabelle td { padding: 13px 12px; border-bottom: 1px solid var(--ap-linie); vertical-align: top; }
.ap-tabelle tr:hover td { background: var(--ap-flaeche-ruhig); }
.ap-tabelle a.zeile { color: var(--ap-text); text-decoration: none; font-weight: 500; }
.ap-tabelle a.zeile:hover { text-decoration: underline; }
.ap-tabelle small { display: block; color: var(--ap-text-leise); font-size: 12.5px; }
.ap-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.ap-filter .field { min-width: 160px; }
.ap-seiten { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding-top: 16px; font-size: 14px; color: var(--ap-text-leise); }
.ap-knopfzeile { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.panel h2 { font-size: 20px; }
.panel > h2 + * { margin-top: 16px; }
.ap-abschnitt + .ap-abschnitt { margin-top: 28px; }

/* --- Verlauf (Kommunikation) --- */
.ap-verlauf { display: flex; flex-direction: column; gap: 14px; list-style: none; margin: 0; padding: 0; }
.ap-verlauf li { max-width: 78%; padding: 14px 16px; border: 1px solid var(--ap-linie); background: var(--ap-flaeche); }
.ap-verlauf li.von-amt { align-self: flex-start; border-left: 3px solid var(--ap-akzent); }
.ap-verlauf li.von-mir { align-self: flex-end; background: var(--ap-akzent-hauch); border-right: 3px solid var(--ap-signal); }
.ap-verlauf li.intern { align-self: stretch; max-width: none; background: var(--ap-signal-weich); border-style: dashed; }
.ap-verlauf .kopf { display: flex; gap: 10px; font-size: 12.5px; color: var(--ap-text-leise); margin-bottom: 6px; }
.ap-verlauf .kopf b { color: var(--ap-text); font-weight: 500; }
.ap-verlauf p { white-space: pre-wrap; font-size: 14.5px; }

/* --- Kacheln mit Kennzahlen --- */
.ap-kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border: 1px solid var(--ap-linie); background: var(--ap-flaeche); }
.ap-kennzahlen > * { padding: 20px 22px; border-right: 1px solid var(--ap-linie); text-decoration: none; color: inherit; }
.ap-kennzahlen > *:last-child { border-right: 0; }
.ap-kennzahlen b { display: block; font-size: 34px; font-weight: 650; letter-spacing: -.03em; color: var(--ap-text); font-variant-numeric: tabular-nums; }
.ap-kennzahlen span { font-size: 13.5px; color: var(--ap-text-weich); }
a.ap-kachel:hover { background: var(--ap-flaeche-ruhig); }

/* --- Druck (Jahresbericht, Anzeige als PDF über den Browser) --- */
@media print {
  .topbar, .foot, .zipfel, .actionbar, .ap-nicht-drucken, .toasts { display: none !important; }
  body { background: #fff; }
  .panel, .sec { border: 0; padding: 0; }
}

/* --- Vorgänge (Dashboard) — aus dashboard.html des Klickdummys --- */
  /* Dashboard · Meine Vorgänge. Editorial hairlines, one obvious start:
     "Neue Anzeige". Rich, but every block answers one question. */
  :root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }

  .head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 40px; align-items: end; padding-block: clamp(56px, 7vw, 104px) clamp(36px, 4vw, 56px); }
  .head h1 { font-size: clamp(36px, 4.4vw, 58px); margin-top: 16px; letter-spacing: -.02em; }
  .head p { color: var(--ap-text-weich); font-size: clamp(16px, 1.3vw, 18px); margin-top: 14px; max-width: 56ch; }
  .head p b { color: var(--ap-text); font-weight: 500; }
  @media (max-width: 760px) { .head { grid-template-columns: minmax(0, 1fr); } }

  /* KPI strip */
  .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ap-text); border-bottom: 1px solid var(--ap-linie); }
  .kpi { padding: 28px 24px 26px 0; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--ap-linie); min-width: 0; }
  .kpi + .kpi { padding-left: 28px; }
  .kpi:last-child { border-right: 0; }
  .kpi b { font-size: clamp(40px, 4vw, 56px); font-weight: 300; letter-spacing: -.03em; line-height: 1; color: var(--ap-text); font-variant-numeric: tabular-nums; }
  .kpi span { font-size: 13.5px; color: var(--ap-text-weich); }
  .kpi small { font-size: 12px; color: var(--ap-text-leise); }
  .kpi.is-warn b { color: var(--ap-warn); }
  /* Kennzahl als Sprung in die gefilterte Vorgangsliste */
  a.kpi--link { color: inherit; text-decoration: none; position: relative; transition: background .2s; }
  a.kpi--link span { display: inline-flex; align-items: center; gap: 6px; color: var(--ap-fach); font-weight: 500; }
  a.kpi--link span svg { transition: transform .2s var(--ap-feder); }
  a.kpi--link:hover span, a.kpi--link:focus-visible span { text-decoration: underline; text-underline-offset: 3px; }
  a.kpi--link:hover span svg, a.kpi--link:focus-visible span svg { transform: translateX(3px); }
  a.kpi--link:hover b { color: var(--ap-fach); }
  a.kpi--link.is-warn:hover b { color: var(--ap-warn); }
  .kpi.is-bump b { animation: bump .8s var(--ap-feder) .6s both; }
  @keyframes bump { 30% { transform: translateY(-6px); color: var(--ap-fach); } }
  @media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi:nth-child(2) { border-right: 0; } .kpi:nth-child(3) { padding-left: 0; } .kpi:nth-child(n+3) { border-top: 1px solid var(--ap-linie); } }

  /* Start row: new report (primary) + continue */
  .start { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; margin-block: clamp(40px, 5vw, 72px) clamp(64px, 8vw, 112px); }
  @media (max-width: 960px) { .start { grid-template-columns: minmax(0, 1fr); } }
  .card { background: var(--ap-flaeche); border: 1px solid var(--ap-linie); }

  .newtile { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: clamp(28px, 3.4vw, 44px); min-height: 300px; background: var(--ap-akzent); color: var(--ap-auf-akzent); text-decoration: none; transition: background-color .25s, transform .55s var(--ap-feder); isolation: isolate; }
  .newtile:hover { background: var(--ap-akzent-dunkel); color: var(--ap-auf-akzent); }
  .newtile:active { transform: scale(.985); transition-duration: .08s; }
  .newtile .eyebrow { color: color-mix(in srgb, var(--ap-auf-akzent) 80%, transparent); }
  .newtile h2 { color: var(--ap-auf-akzent); font-size: clamp(32px, 3.4vw, 46px); letter-spacing: -.02em; margin-top: 12px; }
  .newtile p { color: color-mix(in srgb, var(--ap-auf-akzent) 88%, transparent); font-size: 17px; line-height: 1.5; max-width: 30ch; margin-top: 12px; }
  .newtile .go { display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; background: var(--ap-signal); color: var(--ap-auf-signal); font-weight: 500; padding: 0 20px; min-height: 46px; }
  .newtile .go svg { transition: transform .45s var(--ap-feder); }
  .newtile:hover .go svg { transform: translateX(5px); }

  .resume { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: center; padding: clamp(28px, 3.4vw, 44px); border-left: 3px solid var(--ap-fach); view-transition-name: resume; }
  .resume__t { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .resume__t h2 { font-size: 22px; }
  .resume__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--ap-text-weich); align-items: center; }
  .steps { display: flex; gap: 4px; margin-top: 4px; }
  .steps span { flex: 1; min-width: 0; height: 5px; background: var(--ap-akzent-weich); position: relative; overflow: hidden; }
  .steps span.done::after, .steps span.part::after { content: ""; position: absolute; inset: 0; background: var(--ap-akzent); transform-origin: left; animation: fill .8s var(--ap-ease) both; animation-delay: calc(.3s + var(--i) * .12s); }
  .steps span.part::after { background: var(--ap-warn); right: 50%; }
  @keyframes fill { from { transform: scaleX(0); } }
  .steplbl { display: flex; gap: 4px; font-size: 11.5px; color: var(--ap-text-leise); }
  .steplbl span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .resume__foot { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
  .resume__foot .note-open { font-size: 13px; color: var(--ap-warn); display: inline-flex; gap: 6px; align-items: center; }
  @media (max-width: 560px) { .resume { grid-template-columns: minmax(0, 1fr); padding: 22px; } }

  /* Section head (editorial) */
  .shead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px 20px; border-top: 1px solid var(--ap-text); padding-top: 22px; margin-bottom: 24px; }
  .shead h2 { font-size: 24px; }
  .shead a { font-size: 13.5px; }

  .grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(40px, 5vw, 72px); padding-bottom: clamp(40px, 6vw, 96px); align-items: start; }
  @media (max-width: 1080px) { .grid { grid-template-columns: minmax(0, 1fr); } }

  /* Toolbar */
  .toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-bottom: 14px; }
  .seg { position: relative; display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); padding: 3px; }
  .seg button { flex: none; position: relative; z-index: 1; border: 0; background: none; padding: 7px 14px; cursor: pointer; font-size: 14px; color: var(--ap-text-weich); display: inline-flex; gap: 8px; align-items: center; transition: color .2s; }
  .seg button[aria-pressed="true"] { color: var(--ap-auf-akzent); }
  .seg button .c { font-size: 12px; min-width: 20px; height: 20px; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--ap-text) 6%, transparent); padding: 0 5px; }
  .seg button[aria-pressed="true"] .c { background: color-mix(in srgb, var(--ap-auf-akzent) 20%, transparent); }
  .seg .ind { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; background: var(--ap-akzent); transition: transform .55s var(--ap-feder), width .55s var(--ap-feder); }
  .tools { display: flex; gap: 8px; flex-wrap: wrap; }
  .search { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); color: var(--ap-text-leise); }
  .search input { border: 0; outline: 0; background: none; width: 170px; font-size: 14px; color: var(--ap-text); }
  .search:focus-within { border-color: var(--ap-akzent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ap-akzent) 14%, transparent); }

  /* Rows */
  .list { background: var(--ap-flaeche); border: 1px solid var(--ap-linie); }
  .rows { list-style: none; margin: 0; padding: 0; }
  /* Zeilen: Titel, eine ruhige Angabenzeile, Zeitraum, Frist, Status — keine Rahmen-Marken */
  .row {
    display: grid; grid-template-columns: minmax(0, 1fr) 150px 170px 130px 36px; gap: 20px; align-items: center;
    padding: 15px 20px; border-top: 1px solid var(--ap-linie); position: relative; cursor: pointer;
    transition: background-color .2s;
  }
  .row:first-child { border-top: 0; }
  .row:hover { background: var(--ap-flaeche-ruhig); }
  .row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ap-akzent); transform: scaleY(0); transition: transform .4s var(--ap-feder); }
  .row:hover::before { transform: scaleY(1); }
  .row[hidden] { display: none; }
  .row.is-fresh { animation: fresh 2.8s var(--ap-ease) .5s both; }
  .row.is-fresh::before { transform: scaleY(1); background: var(--ap-signal); }
  @keyframes fresh { 0%, 70% { background: var(--ap-signal-weich); box-shadow: inset 0 0 0 2px var(--ap-signal); } 100% { background: transparent; box-shadow: inset 0 0 0 0 transparent; } }
  @media (max-width: 860px) { .row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; } .row__zeit, .row__frist, .row .more { display: none; } }
  .row__t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .row__t b { font-weight: 600; color: var(--ap-text); font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
  .row__t b a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
  .row__t .sub { font-size: 13px; color: var(--ap-text-leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row__neu { flex: none; font-size: 11.5px; font-weight: 500; color: var(--ap-warn-tinte); display: inline-flex; align-items: center; gap: 6px; }
  .row__neu::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ap-signal); box-shadow: 0 0 0 3px var(--ap-signal-weich); }
  .row__zeit, .row__frist { font-size: 13px; color: var(--ap-text-weich); }
  .is-warn { color: var(--ap-warn-tinte); font-style: normal; }
  /* Status als Wort mit Punkt statt umrandeter Marke */
  .st { font-size: 13px; color: var(--ap-text-weich); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
  .st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ap-akzent-38); flex: none; }
  .st--draft::before { background: var(--ap-signal); }
  .st--sent::before { background: var(--ap-akzent); }
  .st--due { color: var(--ap-warn-tinte); } .st--due::before { background: var(--ap-warn); }
  .st--done::before { background: var(--ap-gut); }
  .st--storno { color: var(--ap-text-leise); }
  .objs { display: inline-flex; align-items: center; gap: 6px; color: var(--ap-text-weich); }
  .objs .sym { width: 9px; height: 9px; }
  .pill--sent { color: var(--ap-info-tinte); background: var(--ap-info-weich); border-color: var(--ap-info-linie); }
  .ring { --p: 0; --c: var(--ap-akzent); width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--ap-akzent-weich) 0); display: grid; place-items: center; transition: --p 1s; flex: none; }
  .ring::before { content: ""; width: 30px; height: 30px; border-radius: 50%; background: var(--ap-flaeche); grid-area: 1 / 1; }
  .ring b { grid-area: 1 / 1; z-index: 1; font-size: 11px; font-weight: 500; color: var(--ap-text); }
  @property --p { syntax: '<number>'; inherits: false; initial-value: 0; }

  .more { display: grid; place-items: center; color: var(--ap-text-leise); transition: transform .3s var(--ap-feder), color .2s; }
  .row:hover .more { color: var(--ap-akzent); transform: translateX(3px); }
  .listfoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 12px 20px; border-top: 1px solid var(--ap-linie); font-size: 13px; color: var(--ap-text-leise); }

  /* Side column */
  .side { display: flex; flex-direction: column; gap: 64px; }
  .side .shead h2 { font-size: 19px; }
  .dl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
  .dl li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--ap-linie); align-items: center; }
  .date { display: flex; flex-direction: column; align-items: center; border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); line-height: 1.1; padding: 5px 0; }
  .date b { font-family: var(--ap-schrift); font-size: 19px; font-weight: 500; color: var(--ap-text); }
  .date span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ap-text-leise); }
  .dl .w { min-width: 0; }
  .dl .w b { font-weight: 500; color: var(--ap-text); display: block; font-size: 14px; }
  .dl .w span { font-size: 12.5px; color: var(--ap-text-weich); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  .msgs { list-style: none; margin: 0; padding: 0; }
  .msgs li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ap-linie); }
  .msgs .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ap-akzent-38); margin-top: 7px; }
  .msgs li.unread .dot { background: var(--ap-signal); box-shadow: 0 0 0 3px var(--ap-signal-weich); }
  .msgs b { font-weight: 500; color: var(--ap-text); font-size: 14px; display: block; }
  .msgs p { font-size: 13px; color: var(--ap-text-weich); }
  .msgs small { font-size: 12px; color: var(--ap-text-leise); }



/* --- Assistent --- */
.ap-feld[hidden] { display: none !important; }
.ap-stelle { outline: 3px solid var(--ap-signal); outline-offset: 8px; transition: outline-color 1s; }
.ap-kennung { font-family: var(--ap-schrift-mono); font-size: 12.5px; color: var(--ap-link); }
.switchrow b svg { color: var(--ap-akzent); }
.field > span:first-child { display: block; }
/* Eingabe mit Einheit: die Einheit steht im Feld, rechts */
.ap-mitwert { position: relative; display: block; }
.ap-mitwert--einheit input { padding-right: 76px; }
.ap-mitwert em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; font-weight: 400; color: var(--ap-text-leise); pointer-events: none; white-space: nowrap; }
/* Pflicht: ruhiger Punkt hinter der Beschriftung, solange das Feld leer ist —
   kein rotes Sternchen. Freiwillige Felder tragen „optional“. */
.ap-pflicht { display: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ap-pflicht-punkt, var(--ap-fehler)); margin-left: 8px; vertical-align: 2px; }
.ap-feld[data-pflicht].is-leer .ap-pflicht { display: inline-block; }
.ap-feld[data-pflicht] .opt-frei { display: none; }
/* Aus der Prüfung gekommen: offene Pflichtfelder deutlich, aber schlicht */
.ap-feld.is-gesucht { position: relative; }
.ap-feld.is-gesucht::before { content: ""; position: absolute; left: -14px; top: 0; bottom: 0; width: 3px; background: var(--ap-signal); }
.ap-feld.is-gesucht .field input, .ap-feld.is-gesucht .field select, .ap-feld.is-gesucht .field textarea { border-color: var(--ap-signal-dunkel, var(--ap-signal)); background: var(--ap-signal-weich); }
.ap-feld.is-gesucht .chip { border-color: var(--ap-signal-dunkel, var(--ap-signal)); }
.ap-feld.is-gesucht .ap-fs:empty::before { content: "Bitte ergänzen"; color: var(--ap-warn-tinte); }
.field .opt { margin-left: 4px; }
.chips legend .opt { font-weight: 400; color: var(--ap-text-leise); }
#formular { display: flex; flex-direction: column; gap: 16px; }
#formular > .sec + .sec { margin-top: 0; }

/* --- Schritt 2: Untersuchungen (Liste links, Karte rechts) --- */
.ap-u { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .ap-u { grid-template-columns: minmax(0, 1fr); } .ap-u__karte { order: -1; } }
.ap-u__links { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ap-u__karte { position: sticky; top: calc(var(--ap-kopf-hoehe) + 16px); display: flex; flex-direction: column; gap: 8px; }
.ap-karte { height: min(68vh, 640px); min-height: 380px; border: 1px solid var(--ap-linie); background: var(--ap-akzent-weich); }
.ap-karte.is-skizze, .ap-karte.is-skizze .leaflet-interactive { cursor: crosshair; }
.ap-quelle { margin: 0; }
.ap-reiter { display: flex; border-bottom: 1px solid var(--ap-linie-kraeftig); }
.ap-reiter button { flex: 1; display: inline-flex; gap: 8px; align-items: center; justify-content: center; padding: 14px 10px; border: 0; background: none; cursor: pointer; font-size: 15px; color: var(--ap-text-weich); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.ap-reiter button[aria-selected="true"] { color: var(--ap-text); font-weight: 600; border-bottom-color: var(--ap-fach); }
.ap-reiter .c { font-size: 12px; min-width: 20px; padding: 0 6px; background: var(--ap-akzent-weich); }
.ap-u__liste { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.ap-u__setzen { display: flex; flex-direction: column; gap: 12px; }
.ap-u__setzen .btn { align-self: flex-start; }
.ap-u__setzen .btn:disabled { opacity: .55; cursor: not-allowed; }
.ap-methoden { display: flex; flex-direction: column; gap: 8px; }
.ap-geoart { font-size: 11px; color: var(--ap-text-leise); margin-left: 6px; }
.chip:has(input:checked) .ap-geoart { color: inherit; opacity: .8; }
.ap-objliste { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ap-linie); }
.ap-objliste > li { border-bottom: 1px solid var(--ap-linie); }
.ap-objkopf { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 16px; gap: 12px; align-items: center; padding: 12px 8px; cursor: pointer; transition: background-color .2s; }
.ap-objkopf:hover { background: var(--ap-flaeche-ruhig); }
.ap-objkopf.is-aktiv { background: var(--ap-akzent-hauch); box-shadow: inset 3px 0 0 var(--ap-akzent); }
.ap-objkopf .ap-offen { font-size: 12.5px; color: var(--ap-warn-tinte); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.ap-objkopf .ap-offen::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.ap-objkopf .ap-ok { font-size: 12.5px; color: var(--ap-gut-tinte); white-space: nowrap; }
.ap-objliste .t b { display: block; font-weight: 600; }
.ap-objliste .t small { color: var(--ap-text-leise); font-size: 12.5px; }
.ap-objliste .ap-leer { display: block; cursor: default; padding: 18px 6px; color: var(--ap-text-weich); font-size: 14px; }
.ap-objplatz { padding: 4px 8px 20px 34px; background: var(--ap-akzent-hauch); box-shadow: inset 3px 0 0 var(--ap-akzent); }
.ap-objplatz:empty { display: none; }
.ap-objekt { --objekt-abstand: 16px; display: flex; flex-direction: column; gap: var(--objekt-abstand); animation: rise .45s var(--ap-feder-weich) both; }
.ap-objekt .sp, .ap-objekt__f .sp { flex: 1; }
.ap-objekt .grp { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; border-top: 1px solid var(--ap-linie); }
.ap-objekt .grp:first-child { border-top: 0; padding-top: 12px; }
.ap-objekt .grp h3 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ap-text-weich); display: flex; gap: 10px; align-items: baseline; }
.ap-objekt .grp h3 small { font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ap-text-leise); margin-left: auto; }
.ap-objekt .grp.whg { border-top-color: var(--ap-info-linie); }
/* Lage: ruhige Zeile wie im Klickdummy, keine Tabellenrahmen */
.ap-fakten { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.ap-fakten div { min-width: 0; }
.ap-fakten__breit { grid-column: 1 / -1; }
.ap-fakten dt { font-size: 12px; color: var(--ap-text-leise); }
.ap-fakten dd { margin: 2px 0 0; font-weight: 600; color: var(--ap-text); font-size: 14px; overflow-wrap: anywhere; }
.ap-objekt__f { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 18px; border-top: 1px solid var(--ap-linie); }
.ap-fehlt { font-size: 13px; color: var(--ap-warn); }
.ap-ok { color: var(--ap-gut-tinte); }
.ap-skizze { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--ap-dunkel); color: var(--ap-auf-dunkel); font-size: 14px; animation: rise .4s var(--ap-feder) both; }
.ap-skizze .sp { flex: 1; }
.ap-skizze .btn--ghost { --f: var(--ap-auf-dunkel); border-color: color-mix(in srgb, var(--ap-auf-dunkel) 40%, transparent); }
.ap-skizze .btn--ghost:hover { background: color-mix(in srgb, var(--ap-auf-dunkel) 12%, transparent); }
.ap-skizze .btn:not(.btn--ghost) { --b: var(--ap-signal); --f: var(--ap-auf-signal); }
/* Kartensymbole */
.ap-sym { background: none; border: 0; }
.ap-sym i { display: block; width: 100%; height: 100%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); opacity: .8; }
.ap-sym.is-aktiv i { opacity: 1; }
.ap-sym--bo i { border-radius: 50%; background: var(--ap-sym-bo); }
.ap-sym--gp i { background: var(--ap-sym-gp); }
.ap-sym--so i { background: var(--ap-sym-so); transform: rotate(45deg) scale(.85); }
.ap-sym b { position: absolute; left: calc(100% + 6px); top: 50%; translate: 0 -50%; white-space: nowrap; font: 600 12px var(--ap-schrift); color: var(--ap-text); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; pointer-events: none; }
.ap-sym.is-ziehen i { outline: 3px solid var(--ap-signal); outline-offset: 3px; cursor: grab; }
.ap-vertex { background: none; border: 0; }
.ap-vertex span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--ap-sym-gp); font: 700 11px var(--ap-schrift); color: var(--ap-sym-gp); }
.ap-vertex.is-schliessen span { background: var(--ap-signal); border-color: var(--ap-auf-signal); color: var(--ap-auf-signal); animation: coach-pulse 1.6s infinite; }
.ap-zettel { font: 600 12.5px var(--ap-schrift); border-radius: 0; border: 0; background: var(--ap-dunkel); color: var(--ap-auf-dunkel); box-shadow: none; }
.ap-zettel::before { display: none; }
.ap-geolabel { font: 600 12px var(--ap-schrift); border-radius: 0; }
.ap-einschlag { position: absolute; z-index: 900; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 3px solid var(--ap-signal); pointer-events: none; animation: einschlag .9s var(--ap-ease) forwards; }
@keyframes einschlag { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(9); opacity: 0; } }
.leaflet-container { font-family: var(--ap-schrift); }
.leaflet-bar, .leaflet-control-layers { border-radius: 0 !important; }
.leaflet-bar a { border-radius: 0 !important; }

/* hidden gilt immer, auch gegen display-Regeln einzelner Bausteine */
[hidden] { display: none !important; }

/* --- Schritt 3: Beteiligte --- */
.ap-bet { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .ap-bet { grid-template-columns: minmax(0, 1fr); } }
.ap-bet__buch { position: sticky; top: calc(var(--ap-kopf-hoehe) + 16px); display: flex; flex-direction: column; gap: 14px; }
.ap-bet__k { display: flex; justify-content: space-between; align-items: baseline; }
.ap-suche, .search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--ap-linie-kraeftig); padding: 0 12px; background: var(--ap-feld); }
.ap-suche input { border: 0; outline: 0; height: 42px; flex: 1; background: none; }
.ap-kontakte { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow-y: auto; border-top: 1px solid var(--ap-linie); }
.ap-kontakte li { display: grid; grid-template-columns: 36px minmax(0, 1fr) 28px; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--ap-linie); cursor: grab; transition: background-color .2s; }
.ap-kontakte li:hover { background: var(--ap-flaeche-ruhig); }
.ap-kontakte li.is-gewaehlt { background: var(--ap-akzent-hauch); box-shadow: inset 3px 0 0 var(--ap-akzent); }
.ap-kontakte li.is-zieht { opacity: .5; }
.ap-kontakte .t, .ap-verzeichnis .t, .ap-rolle__inhalt .t { min-width: 0; }
.ap-kontakte .t b, .ap-verzeichnis .t b { display: block; font-weight: 600; font-size: 14.5px; }
.ap-kontakte .t small, .ap-verzeichnis .t small { font-size: 12.5px; color: var(--ap-text-leise); }
.ap-avatar { width: 36px; height: 36px; display: grid; place-items: center; background: var(--ap-akzent-weich); color: var(--ap-akzent-dunkel); font-weight: 700; flex: none; }
.ap-avatar--leise { background: var(--ap-flaeche-ruhig); color: var(--ap-text-leise); border: 1px dashed var(--ap-linie-kraeftig); }
/* Favorit: ruhiger Stern, gefüllt wenn an */
.ap-stern { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: none; cursor: pointer; color: var(--ap-linie-kraeftig); transition: color .2s, transform .4s var(--ap-feder); }
.ap-kontakte li:hover .ap-stern { color: var(--ap-text-leise); }
.ap-stern[aria-pressed="true"] { color: var(--ap-signal-dunkel, var(--ap-signal)); }
.ap-stern[aria-pressed="true"] svg { fill: currentColor; }
.ap-stern:active { transform: scale(.85); }
/* Treffer aus dem Adressverzeichnis */
.ap-verzeichnis { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.ap-verzeichnis ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ap-linie); }
.ap-verzeichnis li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--ap-linie); }
/* Vorschläge beim neuen Kontakt */
.ap-vorschlagfeld { position: relative; }
.ap-vorschlaege { position: absolute; z-index: 5; left: 0; right: 0; top: 76px; list-style: none; margin: 0; padding: 4px 0; background: var(--ap-flaeche); border: 1px solid var(--ap-linie-kraeftig); box-shadow: 0 18px 40px -24px rgba(0,0,0,.45); }
.ap-vorschlaege button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 12px; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; }
.ap-vorschlaege button:hover { background: var(--ap-akzent-hauch); }
.ap-vorschlaege b { font-weight: 600; font-size: 14px; }
.ap-vorschlaege small { grid-column: 1; font-size: 12.5px; color: var(--ap-text-leise); font-weight: 400; }
.ap-vorschlaege span { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 12.5px; color: var(--ap-link); }
.ap-neukontakt > summary { list-style: none; display: inline-flex; }
.ap-neukontakt > summary::-webkit-details-marker { display: none; }
.ap-neukontakt[open] > summary { margin-bottom: 14px; }
/* Rollen wie im Klickdummy: Symbol, Titel, ein Satz, Pflicht/optional rechts, Ablagefläche */
.ap-rollen { padding: 8px 22px; display: flex; flex-direction: column; position: relative; }
.ap-rolle { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--ap-linie); cursor: pointer; }
.ap-rolle:last-child { border-bottom: 0; }
.ap-rolle__ic { width: 34px; height: 34px; display: grid; place-items: center; background: var(--ap-flaeche-ruhig); color: var(--ap-text-weich); }
.ap-rolle.is-belegt .ap-rolle__ic { background: var(--ap-akzent); color: var(--ap-auf-akzent); }
.ap-rolle__kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ap-rolle__kopf b { font-size: 16.5px; font-weight: 600; color: var(--ap-text); }
.ap-rolle__pflicht { font-size: 12px; color: var(--ap-warn-tinte); }
.ap-rolle.is-belegt .ap-rolle__pflicht { color: var(--ap-gut-tinte); }
.ap-rolle__opt { font-size: 12px; color: var(--ap-text-leise); }
.ap-rolle__t > p { margin: 2px 0 10px; font-size: 13.5px; color: var(--ap-text-weich); }
.ap-rolle__inhalt { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border: 1.5px dashed var(--ap-linie-kraeftig); transition: border-color .2s, background-color .2s, transform .4s var(--ap-feder); }
.ap-rolle__inhalt > .ap-leise { flex: 1; text-align: center; font-size: 13.5px; }
.ap-rolle.is-belegt .ap-rolle__inhalt { border-style: solid; border-color: var(--ap-linie); background: var(--ap-flaeche-ruhig); box-shadow: inset 3px 0 0 var(--ap-akzent); }
.ap-rolle__inhalt .t { flex: 1; }
.ap-rolle__inhalt b { display: block; font-size: 15px; font-weight: 600; }
.ap-rolle__inhalt small { font-size: 12.5px; color: var(--ap-text-leise); }
.ap-rolle.is-ueber .ap-rolle__inhalt, .ap-rolle.is-ziel:hover .ap-rolle__inhalt { border-color: var(--ap-akzent); background: var(--ap-akzent-hauch); transform: scale(1.01); }
.ap-rolle.is-ziel .ap-rolle__inhalt { border-color: var(--ap-akzent-50); }
.ap-rolle__hinweis { font-size: 13px; color: var(--ap-warn-tinte); margin: 8px 0 0; }
.ap-rolle__hinweis:empty { display: none; }
/* .panel braucht keine eigene Position: sticky/relative kommen aus dem Baustein */
.panel > .ap-hilfe-ecke { top: 18px; right: 18px; }

/* --- Schritt 4 und 5 --- */
.ap-zeile { display: block; }
.ap-upload { cursor: pointer; }
.slist li > span:last-child { justify-self: end; }
.ap-bereit h2 { font-size: 22px; }
.ap-bereit.is-ok { border-left: 4px solid var(--ap-gut); }
.ap-bereit.is-offen { border-left: 4px solid var(--ap-warn); }
.ap-bereit .slist { margin-top: 16px; }
.ap-ablauf { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.ap-ablauf b { font-weight: 600; }
.ap-senden { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; padding-top: 20px; border-top: 1px solid var(--ap-linie); }
.ap-bestaetigen { display: flex; gap: 12px; align-items: center; font-size: 15px; cursor: pointer; }
.ap-bestaetigen input { width: 20px; height: 20px; accent-color: var(--ap-akzent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.kv .sym { vertical-align: -1px; }

/* --- Vorgang --- */
.ap-eingang { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; margin-top: 40px; padding: clamp(28px, 4vw, 48px); background: var(--ap-flaeche); border: 1px solid var(--ap-linie); border-bottom: 6px solid var(--ap-signal); }
.ap-eingang__kreis { width: 96px; height: 96px; border-radius: 50%; background: var(--ap-signal); color: var(--ap-auf-signal); display: grid; place-items: center; animation: pop .7s var(--ap-feder) both; }
.ap-eingang h1 { font-size: clamp(36px, 4.4vw, 56px); margin: 8px 0; }
.ap-eingang p { color: var(--ap-text-weich); font-size: 17px; }
.ap-haken { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ap-haken li::before { content: "✓ "; color: var(--ap-gut-tinte); font-weight: 700; }
.ap-frist { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--ap-linie); }
.ap-frist.is-bald b::after { content: " · bald fällig"; color: var(--ap-warn); font-weight: 500; }
.ap-frist.is-ueber b::after { content: " · überfällig"; color: var(--ap-fehler); font-weight: 500; }
.ap-frist small { color: var(--ap-text-leise); }
.ap-antrag--beantragt { color: var(--ap-warn) !important; }
.ap-antrag--gewaehrt { color: var(--ap-gut-tinte) !important; }
.ap-verlaengern summary, .ap-storno summary { cursor: pointer; color: var(--ap-link); font-size: 14px; padding: 6px 0; }
.ap-storno summary { color: var(--ap-fehler); }
.ap-nachricht { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--ap-linie); width: 100%; }
.ap-nachricht .field { width: 100%; }
.ap-zeitleiste { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--ap-linie); display: flex; flex-direction: column; gap: 12px; }
.ap-zeitleiste li { position: relative; display: flex; flex-direction: column; }
.ap-zeitleiste li::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--ap-akzent); }
.ap-zeitleiste span { font-size: 13px; color: var(--ap-text-leise); }
/* Fassungen (portal/_fassungen.html): je Einreichung aufklappbar, darin vorher → nachher */
.ap-fassungen__t { margin: 22px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ap-text-weich); }
.ap-fassungen { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--ap-linie); }
.ap-fassungen > li { border-bottom: 1px solid var(--ap-linie); }
.ap-fassungen summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 10px 28px 10px 0; position: relative; }
.ap-fassungen summary::-webkit-details-marker { display: none; }
.ap-fassungen summary::after { content: ""; position: absolute; right: 6px; top: 16px; width: 7px; height: 7px; border-right: 1.6px solid var(--ap-text-weich); border-bottom: 1.6px solid var(--ap-text-weich); transform: rotate(45deg); transition: transform .25s; }
.ap-fassungen details[open] summary::after { transform: rotate(-135deg); top: 19px; }
.ap-fassungen__k { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ap-fassungen__n { font-size: 12.5px; color: var(--ap-akzent); }
.ap-fassungen summary small { font-size: 12.5px; color: var(--ap-text-leise); }
.ap-fassungen .is-offen summary b { color: var(--ap-warn-tinte); }
.ap-fassungen ul { list-style: none; margin: 0 0 12px; padding: 0 0 0 12px; border-left: 2px solid var(--ap-linie); display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.ap-fassungen ul li { display: flex; flex-direction: column; }
.ap-fassungen ul li > span { color: var(--ap-text-weich); }
.ap-fassungen s { color: var(--ap-text-leise); }
.ap-objtabelle { margin-top: 20px; }
.panel h2 + .ap-verlauf { margin-top: 18px; }
.ap-verzicht { grid-template-columns: 28px minmax(0, 1fr) !important; padding-top: 0 !important; }
.ap-inline { display: flex; gap: 8px; width: 100%; }
.ap-inline input { flex: 1; height: 36px; border: 1px solid var(--ap-linie-kraeftig); padding: 0 10px; }
.ap-tabelle small { display: block; }
.ap-balken { display: grid; grid-template-columns: 150px minmax(0, 1fr) 40px; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.ap-balken i { height: 10px; background: var(--ap-akzent-weich); position: relative; }
.ap-balken i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--ap-akzent); animation: fill .9s var(--ap-ease) both; transform-origin: left; }
.ap-tabelle code, .note code { font-size: 12px; word-break: break-word; }
.ap-eingabe { height: 38px; border: 1px solid var(--ap-linie-kraeftig); padding: 0 10px; width: 100%; }

/* Aufgabenzeile ist ein Link, das Raster der Klickdummy-Liste bleibt */
.dl li > a.ap-aufgabe { display: contents; color: inherit; text-decoration: none; }
.dl li:has(> a.ap-aufgabe):hover { background: var(--ap-flaeche-ruhig); }

/* --- Assistent: rechte Spalte „Ihre Angaben“ + „Hilfe“ (Klickdummy) --- */
.ap-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .ap-layout { grid-template-columns: minmax(0, 1fr); } .ap-spalte { display: none; } }
.ap-spalte { position: sticky; top: calc(var(--ap-kopf-hoehe, 64px) + 16px); display: flex; flex-direction: column; gap: 16px; }
.ap-sum { padding: 20px 22px 16px; }
.ap-sum .eyebrow { display: block; margin-bottom: 12px; }
.ap-sum ul { list-style: none; margin: 0; padding: 0; }
.ap-sum li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--ap-linie); align-items: start; }
.ap-sum li .ok { width: 18px; height: 18px; margin-top: 1px; border: 1.5px solid var(--ap-akzent-38); border-radius: 50%; display: grid; place-items: center; color: #fff; transition: background-color .25s, border-color .25s; }
.ap-sum li .ok svg { opacity: 0; transition: opacity .2s; }
.ap-sum li.is-in .ok { background: var(--ap-gut); border-color: var(--ap-gut); }
.ap-sum li.is-in .ok svg { opacity: 1; }
.ap-sum li > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.ap-sum li span { font-size: 12.5px; color: var(--ap-text-leise); }
.ap-sum li b { display: block; font-size: 13.5px; font-weight: 400; color: var(--ap-text-leise); overflow-wrap: anywhere; }
.ap-sum li.is-in b { color: var(--ap-text); }
.ap-sum__legende { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--ap-linie); font-size: 12px; color: var(--ap-text-leise); display: flex; align-items: center; }
.ap-sum__legende .ap-pflicht { display: inline-block; margin: 0 8px 0 0; vertical-align: 0; }
#formular section.sec { transition: box-shadow .3s; }
#formular section.sec.is-help { box-shadow: inset 3px 0 0 var(--ap-akzent); }

/* „?“ an einem Feld ohne rechte Spalte: rechts oben am Feld, Text im Flyout */
.ap-feld { position: relative; }
.ap-hilfe-ecke { position: absolute; top: -3px; right: 0; z-index: 2; }
.ap-hilfe-ecke summary { list-style: none; cursor: help; }
.ap-hilfe-ecke summary::-webkit-details-marker { display: none; }
.ap-hilfe-ecke .q { width: 20px; height: 20px; display: inline-grid; place-items: center; border: 1.5px solid var(--ap-akzent-50); border-radius: 50%; font-size: 12px; font-weight: 600; color: var(--ap-akzent); background: var(--ap-flaeche); }
.ap-hilfe-ecke summary:hover .q { background: var(--ap-akzent); color: var(--ap-auf-akzent); border-color: var(--ap-akzent); }
.ap-hilfe-ecke[open] .help__b { position: absolute; right: 0; top: 26px; width: min(340px, 80vw); background: var(--ap-flaeche); border: 1px solid var(--ap-linie-kraeftig); padding: 14px 16px; box-shadow: 0 18px 40px -24px rgba(var(--ap-schatten-rgb, 0,0,0), .5); }
.ap-hilfe-ecke:not([open]) .help__b { display: none; }
.helpfly b { display: block; margin-bottom: 4px; }
.helpfly ul { margin: 8px 0 0; padding-left: 18px; }
.helpfly .law { display: block; margin-top: 8px; font-size: 12px; opacity: .75; }
.help.ap-hilfe-ecke, .help.ap-hilfe-ecke[open] { border: 0; background: none; }
.help.ap-hilfe-ecke > summary { padding: 0; gap: 0; }

/* Objektkarte: Felder im Zweierraster; Auswahl, Knöpfe und Text über die volle Breite */
.ap-felder { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 12px; row-gap: 0; align-items: start; }
/* Ruhige Zeilen: jedes Feld belegt vier Rasterzeilen (Beschriftung · Eingabe · Hinweis · Status) und teilt sie per
   Subgrid mit seinen Nachbarn — alle Beschriftungen einer Zeile beginnen oben, alle Eingaben liegen auf einer Linie,
   egal ob eine Beschriftung ein- oder zweizeilig ist. */
.ap-felder > .ap-feld { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; margin-bottom: 14px; }
.ap-felder > .ap-feld > .field { display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; row-gap: 7px; align-items: start; }
.ap-felder > .ap-feld > .field > .ap-label { align-self: start; }
.ap-felder > .ap-feld > .field > .ap-mitwert { align-self: end; }
.ap-label__ende { white-space: nowrap; }
.ap-label .opt { margin-left: 6px; }
.ap-felder > .ap-feld { grid-column: span 2; }
.ap-felder > .ap-feld--auswahl { grid-column: span 3; }
.ap-felder > .ap-feld--chips, .ap-felder > .ap-feld--mehrfach, .ap-felder > .ap-feld--textarea,
.ap-felder > .ap-feld--schalter, .ap-felder > .ap-feld--karten, .ap-felder > .ap-feld--frage { grid-column: 1 / -1; }
@media (max-width: 1200px) { .ap-felder > .ap-feld { grid-column: span 3; } .ap-felder > .ap-feld--auswahl { grid-column: 1 / -1; } }
.ap-felder > .ap-feld--chips .ap-fs, .ap-felder > .ap-feld--mehrfach .ap-fs { margin-top: 4px; }
.ap-mehrfach .chip { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.ap-mehrfach .chip:has(input:checked)::before { content: "✓"; font-size: 12px; }

/* Adressbuch-Seite: eigene Angaben oben */
.ap-ich { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 22px; box-shadow: inset 3px 0 0 var(--ap-signal); }
.ap-ich .ap-avatar { width: 44px; height: 44px; font-size: 18px; }
.ap-ich b { display: block; font-size: 17px; font-weight: 600; margin-top: 2px; }
.ap-ich small { display: block; font-size: 13px; color: var(--ap-text-leise); }
.ap-tabelle .ap-stern { margin: -4px 0; }

/* Neben der rechten Spalte: Abschnittskopf schmaler, damit Listen Platz haben */
.ap-layout .sec { grid-template-columns: minmax(0, 190px) minmax(0, 1fr); gap: 20px 40px; }
@media (max-width: 1240px) { .ap-layout .sec { grid-template-columns: minmax(0, 1fr); } }

/* Karte wie im Klickdummy: Leiste oben links, Zoom oben rechts, Lagezeile darunter */
.ap-buehne { position: relative; }
.ap-kartenleiste { position: absolute; z-index: 500; left: 12px; top: 12px; display: flex; gap: 6px; }
.ap-seg2 { display: inline-flex; background: var(--ap-flaeche); border: 1px solid var(--ap-linie-kraeftig); padding: 3px; }
.ap-seg2 button { border: 0; background: none; padding: 6px 11px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ap-text-weich); transition: background-color .2s, color .2s; }
.ap-seg2 button[aria-pressed="true"] { background: var(--ap-akzent); color: var(--ap-auf-akzent); }
.ap-tog { display: inline-flex; align-items: center; gap: 8px; background: var(--ap-flaeche); border: 1px solid var(--ap-linie-kraeftig); padding: 0 11px; font-size: 13px; cursor: pointer; }
.ap-tog input { accent-color: var(--ap-akzent); width: 15px; height: 15px; margin: 0; }
.ap-karte .leaflet-control-zoom { border: 1px solid var(--ap-linie-kraeftig) !important; border-radius: 0; box-shadow: none; }
.ap-karte .leaflet-control-zoom a { width: 36px; height: 36px; line-height: 36px; border-radius: 0 !important; color: var(--ap-text); }
.ap-karte .leaflet-control-attribution { font-size: 10.5px; }
/* Rahmen um den Kartenbereich */
.ap-u .ap-karte { border: 1px solid var(--ap-linie-kraeftig); box-shadow: 0 10px 28px -24px rgba(var(--ap-schatten-rgb, 20,20,40), .6); }

/* Ortssuche: Lupe neben dem Zoom, das Feld klappt darunter auf (verdeckt die Leiste oben links nicht) */
.ap-ortssuche { position: absolute; z-index: 600; top: 12px; right: 60px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ap-ortssuche__k { width: 38px; height: 38px; display: grid; place-items: center; background: var(--ap-flaeche); border: 1px solid var(--ap-linie-kraeftig); color: var(--ap-text); cursor: pointer; transition: border-color .2s, color .2s; }
.ap-ortssuche__k:hover, .ap-ortssuche__k[aria-expanded="true"] { border-color: var(--ap-akzent); color: var(--ap-akzent); }
.ap-ortssuche__feld { position: relative; width: min(280px, calc(100vw - 110px)); animation: ap-ortssuche-auf .22s var(--ap-feder) both; transform-origin: right top; }
@keyframes ap-ortssuche-auf { from { opacity: 0; transform: translateY(-6px) scale(.96); } to { opacity: 1; transform: none; } }
.ap-ortssuche input { width: 100%; height: 38px; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--ap-akzent); background: var(--ap-flaeche); font: inherit; font-size: 14px; color: var(--ap-text); outline: none; }
.ap-ortssuche ul { list-style: none; margin: 0; padding: 0; position: absolute; left: 0; right: 0; top: 37px; background: var(--ap-flaeche); border: 1px solid var(--ap-linie-kraeftig); box-shadow: 0 14px 30px -18px rgba(var(--ap-schatten-rgb, 20,20,40), .55); max-height: 320px; overflow: auto; }
.ap-ortssuche ul:empty { display: none; }
.ap-ortssuche li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; padding: 9px 12px; cursor: pointer; font-size: 14px; border-top: 1px solid var(--ap-linie); }
.ap-ortssuche li:first-child { border-top: 0; }
.ap-ortssuche li small { color: var(--ap-text-leise); font-size: 12px; }
.ap-ortssuche li[aria-selected="true"] { background: var(--ap-akzent-hauch); box-shadow: inset 3px 0 0 var(--ap-akzent); }
.ap-ortssuche__nichts { color: var(--ap-text-leise); cursor: default !important; }
.ap-ortspuls { border-radius: 50%; background: var(--ap-akzent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ap-akzent) 60%, transparent); animation: ap-ortspuls 1.4s ease-out 3; }
@keyframes ap-ortspuls { to { box-shadow: 0 0 0 22px transparent; } }
.ap-lagezeile { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ap-text-leise); padding-top: 2px; }
.ap-lagezeile .num { font-family: var(--ap-schrift-mono); font-size: 12px; }
.ap-koord { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--ap-flaeche-ruhig); border: 1px solid var(--ap-linie); }
.ap-u__setzen .ap-knopfzeile { display: flex; gap: 8px; flex-wrap: wrap; }

/* Ja/Nein-Frage als eine Zeile */
/* Ja/Nein-Frage wie jedes Feld: Frage oben, Knöpfe direkt darunter, linksbündig — Beschriftung und Aktion
   stehen zusammen, das Auge springt nicht quer über die Breite (Festlegung 28.11.) */
.ap-jn { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 0; }
.ap-jn__t { font-size: 13.5px; font-weight: 500; color: var(--ap-text); }
.ap-jn .chips { flex-wrap: wrap; gap: 6px; }
.ap-jn .chip { min-height: 40px; min-width: 72px; justify-content: center; padding: 0 16px; font-size: 14px; }
.ap-jn .chips { position: relative; }
/* Speicherstatus der Ja/Nein-Frage schwebt rechts neben den Knöpfen — er darf nie eine Zeile einschieben (Falle 10) */
.ap-jn .ap-fs { position: absolute; top: 50%; left: calc(100% + 12px); transform: translateY(-50%); min-height: 0; margin: 0; white-space: nowrap; pointer-events: none; }
.ap-feld--frage.is-gesucht .ap-jn { background: var(--ap-signal-weich); }

/* Schritt 2: Felder breit, Karte schmaler und hochkant (Klickdummy) */
@media (min-width: 1101px) { .ap-u { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.ap-u .ap-karte { height: min(78vh, 760px); }
@media (max-width: 1100px) { .ap-u .ap-karte { height: min(62vh, 560px); } }
@media (max-width: 640px) { .ap-u .ap-karte { height: 52vh; min-height: 300px; } }
.ap-objplatz { padding: 0 8px 18px 22px; }
.ap-textknopf { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 13px; color: var(--ap-link); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.ap-textknopf:hover { text-decoration-color: currentColor; }
.ap-textknopf--leise { color: var(--ap-text-leise); }
.ap-opanel { display: flex; flex-direction: column; gap: 14px; animation: rise .35s var(--ap-feder-weich) both; }
.ap-opanel .grp { padding-top: 12px; }
.ap-opanel .grp:first-child { border-top: 0; padding-top: 4px; }
.ap-opanel__f { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--ap-linie); }
.ap-opanel__f .btn svg { margin-left: 4px; }
.ap-hilfe-ecke.ap-hilfe-inline { position: relative; top: 0; right: auto; display: inline-block; margin-left: 8px; vertical-align: -4px; }
.ap-hilfe-inline[open] .help__b { left: 0; right: auto; }

/* ---- Schritt 2, Feinschliff 27.11.: Liste ruhig, geöffnetes Objekt als weiße Karte ---- */
.ap-u__liste { padding: 20px; gap: 14px; }
.ap-objliste { border-top: 0; display: flex; flex-direction: column; }
.ap-objliste > li { border-bottom: 1px solid var(--ap-linie); }
.ap-objkopf { grid-template-columns: 12px minmax(0, 1fr) auto 20px; gap: 14px; padding: 14px 18px 14px 16px; }
.ap-objkopf:hover { background: var(--ap-flaeche-ruhig); }
/* Akkordeon: Pfeil nach unten = aufklappbar, nach oben = offen; eigener Rahmen, damit er als Bedienelement erkennbar ist */
.ap-objkopf .ap-chev { justify-self: center; box-sizing: border-box; width: 28px; height: 28px; padding: 5px; border: 1px solid var(--ap-linie-kraeftig); color: var(--ap-text-weich); transform: rotate(90deg); transition: transform .35s var(--ap-feder), border-color .2s, color .2s; }
.ap-objkopf:hover .ap-chev { border-color: var(--ap-akzent); color: var(--ap-akzent); }
.ap-objkopf.is-aktiv .ap-chev { transform: rotate(-90deg); color: var(--ap-akzent); border-color: var(--ap-akzent); }
/* offen: Kopf + Angaben bilden eine Karte, abgesetzt von der Liste */
.ap-objliste > li.ap-objkopf.is-aktiv { background: var(--ap-flaeche); box-shadow: none; margin-top: 10px; border: 1px solid var(--ap-linie-kraeftig); border-bottom: 0; border-left: 3px solid var(--ap-akzent); padding-left: 14px; }
.ap-objliste > li.ap-objkopf.is-aktiv .t b { font-size: 16px; }
.ap-objliste > li.ap-objplatz { padding: 4px 18px 18px 30px; background: var(--ap-flaeche); box-shadow: 0 14px 30px -24px rgba(var(--ap-schatten-rgb, 20,20,40), .55); border: 1px solid var(--ap-linie-kraeftig); border-top: 0; border-left: 3px solid var(--ap-akzent); margin-bottom: 10px; }
.ap-objliste > li.ap-objplatz:empty { display: none; }
.ap-objliste > li.ap-objplatz + li { border-top: 0; }

/* Geschlossene Einträge als helle Karten — sie heben sich vom Grund ab und sind als eigene Bereiche erkennbar */
.ap-objliste { gap: 8px; }
.ap-objliste > li.ap-objkopf { background: var(--ap-flaeche); border: 1px solid var(--ap-linie); transition: border-color .2s, box-shadow .2s; }
.ap-objliste > li.ap-objkopf:not(.is-aktiv):hover { background: var(--ap-flaeche); border-color: var(--ap-linie-kraeftig); box-shadow: 0 6px 16px -14px rgba(var(--ap-schatten-rgb, 20,20,40), .6); }
.ap-objliste > li.ap-objkopf.is-aktiv { margin-top: 0; }
.ap-objliste > li.ap-objplatz { margin-top: -8px; margin-bottom: 0; }

/* Lage als eigener Kasten (Klickdummy): amtliche Werte, Schutzgebiete, Knopf zum Bearbeiten */
.ap-lagebox { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; padding: 14px 16px; background: var(--ap-flaeche-ruhig); border: 1px solid var(--ap-linie); }
.ap-lagebox__k { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.ap-lagebox__k h3 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ap-text-weich); }
.ap-lagebox__k small { font-size: 12.5px; color: var(--ap-text-leise); }
.ap-lagebox__k .btn { margin-left: auto; }
.ap-lagebox__leer { margin: 0; font-size: 13.5px; color: var(--ap-warn-tinte); }
.ap-fakten { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 18px; margin: 0; }
.ap-fakten div { min-width: 0; }
.ap-fakten dt { font-size: 12px; color: var(--ap-text-leise); }
.ap-fakten dd { margin: 2px 0 0; font-weight: 600; font-size: 14.5px; color: var(--ap-text); overflow-wrap: anywhere; }
.ap-fakten__zusatz { display: block; font-weight: 400; font-size: 12.5px; color: var(--ap-text-weich); }
.ap-pruefungen { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--ap-linie); display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13.5px; }
.ap-pruefungen li { display: inline-flex; align-items: center; gap: 8px; }
.ap-pruefungen .ok { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
.ap-pruefungen .is-frei .ok { background: var(--ap-gut-weich); color: var(--ap-gut-tinte); }
.ap-pruefungen .is-betroffen .ok { background: var(--ap-warn); color: #fff; }
.ap-pruefungen .is-betroffen { color: var(--ap-warn-tinte); font-weight: 500; }
.ap-pruefungen .is-offen { color: var(--ap-text-leise); }
.ap-pruefungen .is-offen .ok { border: 1px solid var(--ap-linie-kraeftig); }
.ap-lagebox__laeuft { display: inline-flex; align-items: center; gap: 8px; }
.ap-lagebox__laeuft .ap-kreisel { width: 12px; height: 12px; border-width: 2px; }
.ap-lagebox[aria-busy="true"] .ap-fakten { opacity: .75; }
.ap-lagebox.is-neu .ap-fakten, .ap-lagebox.is-neu .ap-pruefungen { animation: rise .4s var(--ap-feder-weich) both; }

/* Reiter im Objekt: Icon vor dem Titel, WHG-Marke am Wasserrecht */
.ap-abschnitte__t { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ap-abschnitte__t svg { color: var(--ap-text-leise); }
.ap-abschnitte button[aria-selected="true"] .ap-abschnitte__t svg { color: var(--ap-akzent); }
.ap-abschnitte__t .badge-whg { font-weight: 500; }
@media (max-width: 640px) { .ap-abschnitte__t svg { display: none; } }
/* Abschnitte: Umschalter statt zweiter Reiterreihe */
/* Reiter im Objekt: echte, eckige Reiter — der gewählte geht nahtlos in seinen Inhalt über */
.ap-abschnitte { display: flex; gap: 0; padding: 0; background: none; border: 0; border-bottom: 1px solid var(--ap-linie-kraeftig); }
.ap-abschnitte button { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 0 -1px -1px 0; padding: 12px 14px 9px; border: 1px solid var(--ap-linie); border-bottom-color: var(--ap-linie-kraeftig); background: var(--ap-flaeche-ruhig); font: inherit; font-size: 13.5px; color: var(--ap-text-weich); cursor: pointer; text-align: left; transition: background-color .2s, color .2s; }
.ap-abschnitte button:last-child { margin-right: 0; }
.ap-abschnitte button:hover { color: var(--ap-text); background: color-mix(in srgb, var(--ap-flaeche) 55%, var(--ap-flaeche-ruhig)); }
/* Akzent oben als innerer Schatten, unten gar kein Rand: farbige bzw. transparente Ränder schneiden die
   Seitenränder in den Ecken schräg an (1–2 px Lücke). Die Fläche deckt die Linie darunter ab (margin -1px). */
.ap-abschnitte button[aria-selected="true"] { position: relative; z-index: 1; background: var(--ap-flaeche); border-color: var(--ap-linie-kraeftig); border-bottom: 0; padding-bottom: 10px; box-shadow: inset 0 3px 0 var(--ap-akzent); color: var(--ap-text); font-weight: 600; }
.ap-abschnitte ~ .ap-opanel { margin-top: calc(-1 * var(--objekt-abstand)); padding: 18px 16px 16px; border: 1px solid var(--ap-linie-kraeftig); border-top: 0; }
.ap-abschnitte small { font-size: 11.5px; font-weight: 400; color: var(--ap-gut-tinte); }
.ap-abschnitte small.is-offen { color: var(--ap-warn-tinte); }
.ap-opanel { gap: 12px; }
.ap-opanel .grp { gap: 10px; padding-top: 14px; }
.ap-opanel .grp:first-child { padding-top: 0; }
.ap-objekt__f { display: flex; gap: 18px; align-items: center; padding-top: 14px; border-top: 1px solid var(--ap-linie); }
.ap-objekt__f .btn span + svg { margin-left: 6px; }
.ap-textknopf--gefahr { color: var(--ap-fehler); text-decoration-color: color-mix(in srgb, var(--ap-fehler) 35%, transparent); }
/* Gefährlicher Knopf in der Aktionsleiste: gleiche Höhe, rote Schrift, links abgesetzt */
.btn--gefahr-leise { color: var(--ap-fehler); border-color: color-mix(in srgb, var(--ap-fehler) 40%, var(--ap-linie-kraeftig)); background: var(--ap-flaeche); }
.btn--gefahr-leise:hover { background: color-mix(in srgb, var(--ap-fehler) 8%, var(--ap-flaeche)); border-color: var(--ap-fehler); color: var(--ap-fehler); }
.actionbar__in form.ap-nicht-drucken { display: contents; }

/* Liste auf ruhigem Grund, das geöffnete Objekt weiß darauf */
.ap-u__liste { background: var(--ap-flaeche-ruhig); }
.ap-objliste > li { border-bottom-color: var(--ap-linie-kraeftig); }
.ap-objkopf { padding-right: 26px; }
.ap-objkopf:hover { background: var(--ap-flaeche); }
.ap-objliste > li.ap-objkopf.is-aktiv { padding-right: 24px; }
.ap-objliste > li.ap-objplatz { padding-right: 24px; }
/* Viele Mehrfachauswahlen: ruhige Häkchenliste in zwei Spalten statt Knopfwand */
.ap-haken { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; border: 0; padding: 0; margin: 0; }
.ap-haken legend { font-size: 13.5px; font-weight: 500; color: var(--ap-text); margin-bottom: 8px; padding: 0; }
.ap-haken label { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; color: var(--ap-text-fliess, var(--ap-text)); cursor: pointer; }
.ap-haken input { accent-color: var(--ap-akzent); width: 16px; height: 16px; margin: 0; flex: none; }
.ap-objekt .field textarea { min-height: 72px; }
/* Gleicher Abstand nach unten wie eine Feldreihe (dort: Hinweis- und reservierte Statuszeile + 14 px) */
.ap-felder > .ap-feld--frage { margin-bottom: 42px; }
.ap-haken legend .opt, .ap-mehrfach legend .opt { margin-left: 6px; }
.ap-objekt .grp h3 { margin-bottom: 2px; }

/* Aktionsleiste über die volle Breite, wie im Klickdummy — auch am Seitenende kein Kasten */
main.wrap > .actionbar { margin-inline: calc(50% - 50vw); }
body { overflow-x: clip; }
.actionbar { box-shadow: 0 -10px 24px -20px rgba(0,0,0,.35); }

/* ---- Prüfen und absenden (Klickdummy pruefen.html) ---- */
.ap-pruef { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .ap-pruef { grid-template-columns: minmax(0, 1fr); } }
.ap-pruef__links { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ap-voll, .ap-blatt { padding: 26px 28px; }
.ap-voll__k { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 14px; border-bottom: 1px solid var(--ap-linie); }
.ap-voll__k h2, .ap-blatt__k h2 { font-size: 20px; }
.ap-voll__k span { font-size: 13px; color: var(--ap-text-weich); }
.ap-voll__k b { font-size: 18px; color: var(--ap-text); margin-right: 2px; }
.ap-voll__liste { list-style: none; margin: 0; padding: 0; }
.ap-voll__liste li { display: grid; grid-template-columns: 28px minmax(0, 1fr) 110px 104px; gap: 14px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--ap-linie); }
.ap-voll__liste .ic { width: 26px; height: 26px; display: grid; place-items: center; }
.ap-voll__liste .is-ok .ic { background: var(--ap-gut-weich); color: var(--ap-gut-tinte); }
.ap-voll__liste .is-offen .ic { background: var(--ap-warn); color: #fff; }
.ap-voll__liste .t b { display: block; font-weight: 600; font-size: 14.5px; }
.ap-voll__liste .t small { font-size: 12.5px; color: var(--ap-text-leise); }
.ap-voll__liste .pill { justify-self: start; }
.ap-voll__liste .btn { width: 100%; justify-content: center; }
.ap-blatt__k { display: flex; justify-content: space-between; align-items: baseline; padding: 26px 0 12px; border-bottom: 1px solid var(--ap-linie); }
.ap-blatt__k:first-child { padding-top: 0; }
.ap-blatt__k a { font-size: 13px; }
.ap-blatt__kv { margin: 0; }
.ap-blatt__kv > div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--ap-linie); font-size: 14px; }
.ap-blatt__kv dt { color: var(--ap-text-leise); font-size: 13px; }
.ap-blatt__kv dd { margin: 0; color: var(--ap-text); }
.ap-blatt__kv small { color: var(--ap-text-leise); margin-left: 8px; }
.ap-blatt__kv .ap-zeile { display: block; }
.ap-rollenmarke { display: inline-block; font-size: 12px; padding: 2px 8px; background: var(--ap-flaeche-ruhig); border: 1px solid var(--ap-linie-kraeftig); }
.ap-blatt__tab { width: 100%; border-collapse: collapse; font-size: 14px; }
.ap-blatt__tab th { text-align: left; font-size: 12px; font-weight: 400; color: var(--ap-text-leise); padding: 10px 8px 6px 0; border-bottom: 1px solid var(--ap-linie); }
.ap-blatt__tab td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--ap-linie); vertical-align: top; }
.ap-blatt__tab td small { display: block; font-size: 12px; color: var(--ap-text-leise); }
.ap-blatt__tab .sym { width: 9px; height: 9px; margin-right: 4px; }
.ap-senden { position: sticky; top: calc(var(--ap-kopf-hoehe, 64px) + 16px); padding: 24px 22px; border-top: 3px solid var(--ap-akzent); display: flex; flex-direction: column; gap: 16px; }
.ap-senden h2 { font-size: 18px; }
.ap-ablauf2 { list-style: none; margin: 0; padding: 0; }
.ap-ablauf2 li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ap-linie); }
.ap-ablauf2 li > span { width: 22px; height: 22px; display: grid; place-items: center; font-size: 12px; background: var(--ap-flaeche-ruhig); border: 1px solid var(--ap-linie-kraeftig); color: var(--ap-text-weich); }
.ap-ablauf2 b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.ap-ablauf2 small { font-size: 12.5px; color: var(--ap-text-leise); }
.ap-senden form { display: flex; flex-direction: column; gap: 14px; }
.ap-senden .ap-bestaetigen { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 13.5px; line-height: 1.45; cursor: pointer; }
.ap-senden .ap-bestaetigen input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--ap-akzent); }
.ap-senden__knopf { justify-content: center; }
.ap-senden__knopf[disabled] { background: var(--ap-flaeche-ruhig); border-color: var(--ap-linie-kraeftig); color: var(--ap-text-leise); opacity: 1; }
.ap-senden__hinweis { margin: 0; font-size: 12.5px; color: var(--ap-warn-tinte); }

/* Feinschliff Felder 27.11. */
.ap-felder > .ap-feld--text { grid-column: span 3; }
.ap-felder > .ap-feld--zahl, .ap-felder > .ap-feld--datum { grid-column: span 2; }
.ap-label { white-space: normal; }
.ap-opanel .grp + .grp { border-top: 1px solid var(--ap-linie); }
.ap-zusatz > summary { list-style: none; cursor: pointer; display: inline-flex; padding: 4px 0; }
.ap-zusatz > summary::-webkit-details-marker { display: none; }
.ap-zusatz[open] > summary { display: none; }
#koord-auf[aria-pressed="true"] { background: var(--ap-akzent); color: var(--ap-auf-akzent); border-color: var(--ap-akzent); }
#koord-auf[aria-pressed="true"]::after { content: "×"; margin-left: 8px; font-size: 16px; line-height: 1; }

/* Kontaktformular: Felder je nach Art */
.ap-kontaktfelder { display: flex; flex-direction: column; gap: 14px; }
.art-person [data-nur="organisation"], .art-organisation [data-nur="person"] { display: none !important; }
/* Seiten mit Aktionsleiste: Leiste sitzt direkt auf dem Fuß, keine Lücke */
main:has(> .actionbar) { padding-bottom: 0; margin-bottom: 0; }
main:has(> .actionbar) + .foot { margin-top: 0; }
.ap-unterkopf { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ap-text-weich); margin-bottom: -6px; padding-top: 4px; }
.ap-unterkopf .opt { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Erzeugte Karten: Bild oder „wird erzeugt“ (fester Platz, nichts springt) */
.ap-kartenbild { margin: 14px 0 6px; }
.ap-kartenbild img, .ap-kartenbild .ap-wird { display: block; width: 100%; aspect-ratio: 16 / 11; object-fit: cover; border: 1px solid var(--ap-linie-kraeftig); }
.ap-kartenbild figcaption { font-size: 11.5px; color: var(--ap-text-leise); padding-top: 6px; }
.ap-wird { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--ap-flaeche-ruhig); color: var(--ap-text-weich); font-size: 14px; }
.ap-wird small { font-size: 12.5px; color: var(--ap-text-leise); }
.ap-kreisel { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--ap-akzent-38); border-top-color: var(--ap-akzent); animation: kreisel 1s linear infinite; }
@keyframes kreisel { to { transform: rotate(360deg); } }
.ap-doks { list-style: none; margin: 0; padding: 0; }
.ap-doks li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--ap-linie); }
.ap-doks .ap-wird { flex-direction: row; background: none; font-size: 12.5px; aspect-ratio: auto; border: 0; }
.ap-doks .ap-kreisel { width: 14px; height: 14px; border-width: 2px; }

/* ---- Finale nach dem Absenden (Klickdummy pruefen.html) ---- */
.ap-finale { position: fixed; inset: 0; z-index: 900; background: var(--ap-dunkel); color: var(--ap-auf-dunkel); display: grid; place-items: center; overflow: auto; clip-path: inset(100% 0 0 0); transition: clip-path .8s cubic-bezier(.7, 0, .2, 1); visibility: hidden; }
.ap-finale.is-on { clip-path: inset(0 0 0 0); visibility: visible; }
.ap-finale__in { width: min(760px, calc(100vw - 32px)); padding-block: 64px 150px; display: flex; flex-direction: column; gap: 22px; }
.ap-finale .eyebrow { color: var(--ap-signal); }
.ap-finale h2 { font-size: clamp(48px, 7vw, 92px); letter-spacing: -.035em; line-height: 1; color: var(--ap-auf-dunkel); overflow: hidden; }
.ap-finale h2 span { display: inline-block; transform: translateY(105%); transition: transform .9s var(--ap-feder-weich); }
.ap-finale h2.is-in span { transform: none; }
.ap-finale [data-f="2"], .ap-finale [data-f="3"], .ap-finale [data-f="4"], .ap-finale [data-f="5"] { opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .6s var(--ap-feder); }
.ap-finale .is-in[data-f] { opacity: 1; transform: none; }
.ap-finale__az { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.ap-finale__az .num { font-family: var(--ap-schrift-mono); font-size: 22px; padding: 6px 12px; border: 1px solid color-mix(in srgb, var(--ap-auf-dunkel) 35%, transparent); }
.ap-finale__az small { font-size: 14px; opacity: .7; }
.ap-finale__zeilen { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid color-mix(in srgb, var(--ap-auf-dunkel) 18%, transparent); }
.ap-finale__zeilen li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid color-mix(in srgb, var(--ap-auf-dunkel) 18%, transparent); }
.ap-finale__zeilen .ok { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--ap-gut); color: #fff; }
.ap-finale__zeilen b { display: block; font-weight: 600; font-size: 16px; }
.ap-finale__zeilen small { font-size: 13.5px; opacity: .7; }
.ap-finale__zeilen time { font-size: 13px; opacity: .6; font-variant-numeric: tabular-nums; }
.ap-finale__pdf .ok { background: color-mix(in srgb, var(--ap-auf-dunkel) 18%, transparent); }
.ap-finale__pdf.is-fertig .ok { background: var(--ap-signal); color: var(--ap-auf-signal); }
.ap-finale .ap-wird { background: none; color: inherit; opacity: .8; flex-direction: row !important; gap: 8px; font-size: 13.5px; aspect-ratio: auto; border: 0; }
.ap-finale .ap-kreisel { width: 16px; height: 16px; border-width: 2px; border-color: color-mix(in srgb, var(--ap-auf-dunkel) 30%, transparent); border-top-color: var(--ap-signal); }
.ap-finale__weiter { padding-top: 6px; }
.ap-finale__weiter ol { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; opacity: .85; }
.ap-finale__knoepfe { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
.ap-finale__hell { background: transparent; color: var(--ap-auf-dunkel); border-color: color-mix(in srgb, var(--ap-auf-dunkel) 45%, transparent); }
.ap-finale__hell:hover { background: color-mix(in srgb, var(--ap-auf-dunkel) 12%, transparent); color: var(--ap-auf-dunkel); }
.ap-finale__schichten { position: fixed; left: 0; right: 0; bottom: 0; z-index: 901; width: 100%; height: 90px; pointer-events: none; visibility: hidden; }
.ap-finale__schichten.is-on { visibility: visible; }
.ap-finale__schichten path { transform-origin: 50% 100%; transform: scaleY(0); }
.ap-finale__schichten.is-on path { animation: schichtHoch 1.1s var(--ap-feder-weich) forwards; }
.ap-finale__schichten.is-on path:nth-child(2) { animation-delay: .1s; }
.ap-finale__schichten.is-on path:nth-child(3) { animation-delay: .2s; }
.ap-finale__schichten.is-on path:nth-child(4) { animation-delay: .3s; }
@keyframes schichtHoch { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Reiter der Objektarten: Offenes auch an nicht gewählten Reitern zeigen */
.ap-reiter button { flex-wrap: wrap; row-gap: 2px; }
.ap-reiter__offen { flex-basis: 100%; text-align: center; font-size: 11.5px; font-weight: 400; color: var(--ap-warn-tinte); display: inline-flex; justify-content: center; align-items: center; gap: 5px; }
.ap-reiter__offen::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ap-warn); }
.ap-reiter__offen:not(.is-an) { visibility: hidden; }


/* „Ihre Angaben“: jede Zeile ist ein Sprung zum Abschnitt bzw. zur offenen Angabe */
.ap-sum li { display: block; padding: 0; }
.ap-sum li > button { width: 100%; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; padding: 8px 6px; margin: 0 -6px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; transition: background-color .2s; }
.ap-sum li > button:hover { background: var(--ap-flaeche-ruhig); }
.ap-sum li > button > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: baseline; }

/* Schritt 2 wie im Klickdummy: Reiter in der Box, Oberkante bündig mit der Karte */
.ap-u__links { gap: 0; }
.ap-u__liste { padding: 0 20px 20px; }
.ap-u__liste > .ap-reiter { margin: 0 -20px; padding: 0 12px; border-bottom: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); }
.ap-reiter button { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; align-items: center; justify-items: start; padding: 16px 12px 12px; text-align: left; }
.ap-reiter button .sym { grid-row: 1; }
.ap-reiter__t { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ap-reiter__t b { font-size: 15px; font-weight: 500; color: var(--ap-text-weich); }
.ap-reiter button[aria-selected="true"] .ap-reiter__t b { color: var(--ap-text); font-weight: 600; }
.ap-reiter__t small { font-size: 11.5px; color: var(--ap-text-leise); font-weight: 400; }
.ap-reiter__n { justify-self: end; font-size: 22px; font-weight: 500; color: var(--ap-text-leise); font-variant-numeric: tabular-nums; }
.ap-reiter button[aria-selected="true"] .ap-reiter__n { color: var(--ap-text); }
.ap-reiter__offen { grid-column: 2 / -1; grid-row: 2; justify-content: flex-start; flex-basis: auto; text-align: left; }
.ap-u__setzen { padding-top: 18px; }
.ap-anker { scroll-margin-top: calc(var(--ap-kopf-hoehe, 64px) + 24px); }

/* Rolle per Klick besetzen: Auswahlliste unter der Ablagefläche */
.ap-wahl { margin-top: 6px; border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); box-shadow: 0 16px 36px -22px rgba(0,0,0,.45); padding: 10px; display: flex; flex-direction: column; gap: 8px; animation: rise .25s var(--ap-feder-weich) both; cursor: default; }
.ap-wahl .search { width: 100%; }
.ap-wahl .search input { width: 100%; }
.ap-wahl ul { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.ap-wahl li { display: flex; flex-direction: column; padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--ap-linie); }
.ap-wahl li:hover, .ap-wahl li:focus { background: var(--ap-akzent-hauch); outline: 0; }
.ap-wahl li b { font-weight: 600; font-size: 14px; }
.ap-wahl li small { font-size: 12px; color: var(--ap-text-leise); }
.ap-wahl [data-neu] { align-self: flex-start; }

/* ---- Jahresbericht: fällig · demnächst · abgegeben ---- */
.ap-jb { display: flex; flex-direction: column; gap: 40px; padding-bottom: 64px; }
.ap-jb__teil { display: flex; flex-direction: column; gap: 14px; }
.ap-jb__teil .shead { display: flex; justify-content: space-between; align-items: baseline; }
.ap-jb__teil .shead h2 { font-size: 20px; }
.ap-jb__karte { padding: 24px 26px; display: flex; flex-direction: column; gap: 18px; border-top: 3px solid var(--ap-signal); }
.ap-jb__kopf { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.ap-jb__kopf h3 { font-size: 17px; font-weight: 600; }
.ap-jb__kopf p { margin: 2px 0 0; font-size: 13.5px; color: var(--ap-text-weich); }
.ap-jb__fakten { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; margin: 0; padding: 14px 0; border-top: 1px solid var(--ap-linie); border-bottom: 1px solid var(--ap-linie); }
.ap-jb__fakten dt { font-size: 12px; color: var(--ap-text-leise); }
.ap-jb__fakten dd { margin: 2px 0 0; font-size: 14px; color: var(--ap-text); }
@media (max-width: 760px) { .ap-jb__fakten { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ap-jb__form { display: flex; flex-direction: column; gap: 14px; }
.ap-jb__oder { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ap-jb__oder .sp { flex: 1; }
.ap-jb__datei { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ap-link); cursor: pointer; }
.ap-jb__datei input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ap-jb__datei { position: relative; }
.ap-jb__datei:focus-within { outline: 2px solid var(--ap-akzent); outline-offset: 3px; }
.ap-jb__datei.hat-datei span { color: var(--ap-text); font-weight: 500; }
.ap-jb__leer { padding: 22px 26px; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 14px; align-items: start; color: var(--ap-gut-tinte); }
.ap-jb__leer b { display: block; color: var(--ap-text); font-weight: 600; }
.ap-jb__leer span { font-size: 13.5px; color: var(--ap-text-weich); }
.ap-jb__liste { list-style: none; margin: 0; padding: 4px 26px; }
.ap-jb__liste li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--ap-linie); }
.ap-jb__liste li:last-child { border-bottom: 0; }
.ap-jb__liste .t b { display: block; font-weight: 600; font-size: 14.5px; }
.ap-jb__liste .t small { font-size: 12.5px; color: var(--ap-text-leise); }
.ap-jb__tabelle { padding: 8px 26px 12px; }
.ap-jb__tabelle .ap-tabelle { width: 100%; }
.ap-jb__tabelle td small { display: block; font-size: 12px; color: var(--ap-text-leise); }
.ap-rechts { text-align: right; }
.ap-jb__tabelle .ap-wird { display: inline-flex !important; flex-direction: row; background: none; font-size: 12.5px; gap: 6px; }
.ap-jb__tabelle .ap-kreisel { width: 14px; height: 14px; border-width: 2px; }

/* Fuß immer unten, auch auf kurzen Seiten */
body { min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }

/* Raster der Objektkarte: alle Felder einer Zeile gleich hoch — Hinweise stehen
   im Platzhalter bzw. hinter „?“, nicht unter dem Feld (sonst verrutscht die Zeile) */
.ap-felder .field > .help { display: none; }
.ap-felder > .ap-feld[data-feldbox="bezeichnung"] { grid-column: span 2; }

/* Knöpfe als Links: die Link-Hoverfarbe darf die Knopfschrift nicht überschreiben */
a.btn, a.btn:hover, a.btn:focus, a.btn:visited { color: var(--f); text-decoration: none; }
.btn--ghost:hover { color: var(--ap-text); }

/* Wahlknöpfe in der Objektkarte etwas kompakter — vier Möglichkeiten passen in eine Zeile */
.ap-objekt .chip { min-height: 38px; padding: 0 12px; font-size: 14px; }
.ap-objekt .chips { gap: 6px; }

/* Kopfleiste schlicht: Menü links, Name, Demo, Suche, Konto — Bereiche stehen in der Navigation */
.ap-menue { display: inline-flex; align-items: center; gap: 8px; margin-right: 18px; padding: 8px 12px 8px 8px; border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); font: inherit; font-size: 14px; color: var(--ap-text); cursor: pointer; transition: border-color .2s, background-color .2s; }
.ap-menue:hover { border-color: var(--ap-akzent); background: var(--ap-akzent-hauch); }
.resume__foot .note-open { min-width: 0; flex: 1; }
.note-open__t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume__foot { flex-wrap: nowrap; }

/* Datenabgabe: BML-Prüfung, Zuordnung, § 17 */
.ap-bml__k { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.ap-bml__k h2 { margin: 0 0 6px; }
.ap-bml__k p { margin: 0; max-width: 62ch; color: var(--ap-text-leise); font-size: 14px; line-height: 1.5; }
.ap-bml__k .ap-upload { flex: none; display: inline-flex; gap: 8px; align-items: center; }
.ap-bml__datei { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--ap-linie); }
.ap-bml__datei .ic { width: 28px; height: 28px; display: grid; place-items: center; background: var(--ap-gut-weich); color: var(--ap-gut); }
.ap-bml__datei:not(.is-gueltig):not(.is-schema_fehlt) .ic { background: color-mix(in srgb, var(--ap-fehler) 10%, transparent); color: var(--ap-fehler); }
.ap-bml__datei .t { display: grid; gap: 3px; min-width: 0; }
.ap-bml__datei .t b { overflow-wrap: anywhere; }
.ap-bml__datei small { color: var(--ap-text-leise); font-size: 13px; line-height: 1.45; }
.ap-bml__hinweis { color: var(--ap-text-leise); }
.ap-bml__hinweis.is-fehler { color: var(--ap-fehler); }
.ap-bml__fehler summary { cursor: pointer; font-size: 13px; color: var(--ap-fehler); }
.ap-bml__fehler ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; max-height: 220px; overflow: auto; font-size: 12.5px; }
.ap-bml__fehler .num { display: inline-block; min-width: 72px; color: var(--ap-text-leise); }
.ap-bml__h { margin: 22px 0 10px; font-size: 16px; }
.ap-bml__tab td { vertical-align: middle; }
.ap-bml__tab td small { display: block; color: var(--ap-text-leise); font-size: 12.5px; }
.ap-bml__tab select { width: 100%; min-width: 220px; min-height: 38px; }
.ap-bml__tab tr.is-offen td:first-child { box-shadow: inset 3px 0 0 var(--ap-warn); }
.ap-bml__tab .ap-ok { color: var(--ap-gut); font-weight: 600; }
.ap-abschluss form { gap: 18px; }
.ap-kat { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.ap-kat legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.ap-kat > label:not(.field) { display: flex; gap: 10px; align-items: center; font-size: 15px; cursor: pointer; }
.ap-kat input[type=radio] { width: 18px; height: 18px; accent-color: var(--ap-akzent); margin: 0; }
.ap-kat__text { margin: 4px 0 0 28px; }
.ap-abschluss .ap-bestaetigen { align-items: flex-start; line-height: 1.45; }
.ap-abschluss .ap-bestaetigen input { margin-top: 1px; flex: none; }
.ap-inline input { flex: 1 1 auto; min-width: 0; }
.ap-inline .btn { flex: none; width: auto; }

/* Brotkrumen über dem Inhalt: wo bin ich, ein Klick zurück */
.ap-pfad { box-sizing: border-box; width: 100%; max-width: var(--ap-inhalt-max); margin: 18px auto -6px; padding-left: var(--gutter-l); padding-right: var(--gutter-r); font-size: 13px; color: var(--ap-text-leise); }
.ap-pfad ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; }
.ap-pfad li { display: inline-flex; align-items: center; min-width: 0; }
.ap-pfad li + li::before { content: "›"; margin: 0 8px; color: var(--ap-linie-kraeftig); }
.ap-pfad a { color: var(--ap-text-leise); text-decoration: none; padding: 4px 0; }
.ap-pfad a:hover, .ap-pfad a:focus-visible { color: var(--ap-akzent); text-decoration: underline; text-underline-offset: 3px; }
.ap-pfad [aria-current] { color: var(--ap-text); max-width: 42ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Mobil und Tablet
   Tablet ≤ 1080 px: eine Spalte, „Ihre Angaben“ entfällt (steht beim Prüfen).
   Handy ≤ 640 px: Kopfleiste kompakt, Karte oben, Knöpfe in voller Breite,
   Tippflächen ≥ 44 px (WCAG 2.5.5), keine waagerechte Scrollleiste.
   ========================================================================== */
.ap-suchknopf--klein { display: none; }
/* Zipfel am Rand: auf Touchgeräten und schmal überflüssig (Menüknopf), verdeckt Inhalt */
@media (max-width: 760px), (hover: none) { .zipfel { display: none !important; } }

@media (max-width: 640px) {
  .topbar__in { gap: 10px; padding-top: 8px; padding-bottom: 8px; }
  .ap-menue { margin-right: 0; padding: 0; width: 44px; height: 44px; justify-content: center; }
  .ap-menue span { display: none; }
  .ap-wortmarke { gap: 8px; min-width: 0; }
  .ap-wortmarke__t b { font-size: 17px; white-space: nowrap; }
  .ap-wortmarke__t small { display: none; }
  .ap-wortmarke__punkt { width: 11px; height: 11px; }
  .ap-demo-pille { margin-left: 0; font-size: 10px; padding: 2px 6px; }
  .topbar .me { display: none; }
  .ap-suchknopf--klein { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; color: var(--ap-text); }
}

@media (max-width: 640px) {
  /* Reiter der Objektarten: Unterzeile weg, drei gleiche Felder */
  .ap-reiter button { padding: 12px 4px; gap: 4px; font-size: 14px; min-width: 0; }
  .ap-reiter__t small { display: none; }
  .ap-reiter__t b { font-weight: inherit; }
  /* Ja/Nein: Frage oben, Antworten darunter */
  .ap-jn .chip, .chip { min-height: 44px; }
  /* Tabellen: jede Zeile eine Karte, Spaltenname vor dem Wert (data-label aus portal.js) */
  .ap-tabelle, .ap-tabelle tbody, .ap-tabelle tr, .ap-tabelle td { display: block; width: 100%; box-sizing: border-box; }
  .ap-tabelle thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ap-tabelle tr { padding: 12px 0; border-bottom: 1px solid var(--ap-linie); }
  .ap-tabelle td { border: 0 !important; padding: 3px 0 !important; text-align: left !important; }
  .ap-tabelle td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ap-text-leise); margin-bottom: 1px; }
  .ap-tabelle td:first-child { font-weight: 600; }
  .ap-tabelle td:empty { display: none; }
  .ap-tabelle select { min-width: 0 !important; }
}

@media (max-width: 640px) {
  /* Brotkrumen: nur der Weg eine Ebene zurück */
  .ap-pfad { margin-top: 10px; }
  .ap-pfad li { display: none; }
  .ap-pfad li:nth-last-child(2) { display: inline-flex; }
  .ap-pfad li:nth-last-child(2)::before { content: "‹"; margin: 0 6px 0 0; font-size: 16px; color: var(--ap-text-leise); }
  .ap-pfad li:nth-last-child(2) a { padding: 10px 0; }
}

/* Untereinander kleben die Seitenspalten nicht (Karte, Adressbuch, Absenden) */
@media (max-width: 1100px) { .ap-u__karte, .ap-bet__buch, .ap-senden { position: static; } }

@media (max-width: 640px) {
  /* Aktionsleiste in einer Zeile: Ring, Löschen als Symbol, Zurück, Weiter */
  .actionbar { margin-top: 32px; }
  .actionbar__in { flex-wrap: nowrap; gap: 8px; padding-block: 8px; }
  .actionbar .meter > span:last-child, .actionbar .ap-lang { display: none; }
  .actionbar .btn { min-height: 44px; padding-inline: 14px; white-space: nowrap; }
  .actionbar .btn--gefahr-leise { width: 44px; padding: 0; justify-content: center; }
  .actionbar .btn--gold { flex: 0 1 auto; }
  body:has(.actionbar) .toasts { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
}

/* Leaflet stapelt seine Ebenen bis z-index 1000, die Kartenleiste liegt bei 500 — Karte und Bühne
   bekommen einen eigenen Stapel, sonst liegen sie beim Scrollen über der Kopfleiste (z-index 50) */
.leaflet-container, .ap-buehne { isolation: isolate; z-index: 0; }   /* .ap-buehne: Kartenleiste z-index 500 */

@media (max-width: 640px) {
  .ap-reiter .sym { display: none; }
  .ap-reiter__n { font-size: 13px; margin-left: 6px; min-width: 0; }
  .ap-u__setzen .btn { flex: 1 1 100%; justify-content: center; min-height: 44px; }
}

@media (max-width: 640px) {
  /* Felder einzeln untereinander; Einrückungen der Objektkarte verkleinern */
  .ap-felder > .ap-feld, .ap-felder > .ap-feld[data-feldbox] { grid-column: 1 / -1 !important; }
  .ap-u__liste { padding: 12px; }
  .ap-objplatz { padding: 16px 12px 16px 14px !important; }
  .panel { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 640px) {
  /* Status-Listen (Vollständigkeit, Datenabgabe): Symbol + Text, Knopf darunter; Pille entfällt */
  .ap-voll__liste li, .slist li { grid-template-columns: 28px minmax(0, 1fr) !important; row-gap: 8px; }
  .ap-voll__liste li > .pill, .slist li > .pill { display: none; }
  .ap-voll__liste li > span:last-child, .slist li > span:last-child { grid-column: 2; }
  .ap-voll__liste li > span:last-child:empty, .slist li > span:last-child:empty { display: none; }
  .ap-verzicht .ap-inline { flex-wrap: wrap; }
  .ap-verzicht .ap-inline input { flex-basis: 100%; height: 44px; }
}

@media (max-width: 640px) {
  /* Filterreiter: waagerecht wischbar statt abgeschnitten (Anzeiger gleitet mit) */
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: none; min-height: 40px; }
  .search { width: 100%; }
  .search input { width: 100%; min-height: 44px; }
  .ap-bml__k { flex-direction: column; gap: 12px; }
  .ap-bml__k .ap-upload { align-self: stretch; justify-content: center; min-height: 44px; }
}

@media (max-width: 640px) {
  .toolbar > .tools, .toolbar > .seg { width: 100%; }
  .tools .search { flex: 1 1 100%; }
  /* Wischbare Reiter: rechter Rand blendet aus — man sieht, dass es weitergeht */
  .seg { mask-image: linear-gradient(to right, #000 85%, transparent); }
  .ap-jb__liste li > span:last-child { display: none; }
}

/* ==========================================================================
   Schrittleiste als Punkte — „Der Punkt ist ein Status“ (Logo-Reise, Kapitel Verwandlung):
   eine Linie, jeder Schritt ein Punkt, der gelbe Punkt steht beim aktuellen Schritt und
   wandert beim Wechsel dorthin (schritte.js setzt --von/--pos). Markup unverändert.
   ========================================================================== */
.stepper { position: relative; gap: 0; padding-block: 32px 0; --punkt: 14px; --zeile: 22px; }
.stepper li { position: relative; }
.stepper a { align-items: center; text-align: center; gap: 0; padding: 0 4px; }
/* Linie: jede Zelle zeichnet ihren Teil; erledigt = Akzent bis zum aktuellen Punkt */
.stepper li::before { content: ""; position: absolute; top: calc(var(--zeile) / 2); left: 0; right: 0; height: 2px; margin-top: -1px; background: var(--ap-linie-kraeftig); }
.stepper li:first-child::before { left: 50%; }
.stepper li:last-of-type::before { right: 50%; }
.stepper li.done::before { background: var(--ap-akzent); }
.stepper li.now::before { background: linear-gradient(to right, var(--ap-akzent) 50%, var(--ap-linie-kraeftig) 50%); }
.stepper li:first-child.now::before { background: var(--ap-linie-kraeftig); }
/* Punkt */
.stepper li .seg, .stepper li.done .seg, .stepper li.now .seg, .stepper li.warn .seg { position: relative; z-index: 1; display: block; width: var(--zeile); height: var(--zeile); max-width: none; background: none; border: 0; overflow: visible; mask-image: none; flex: none; }   /* .seg ist auch der Vorgangsfilter — hier nichts davon */
.stepper .seg::before { content: ""; position: absolute; left: 50%; top: 50%; width: var(--punkt); height: var(--punkt); transform: translate(-50%, -50%); border-radius: 50%; box-sizing: border-box; background: var(--ap-flaeche); border: 2px solid var(--ap-linie-kraeftig); transition: transform .3s var(--ap-feder), background-color .3s, border-color .3s; }
.stepper .now .seg::after { display: none; }
.stepper .done .seg::before { background: var(--ap-akzent); border-color: var(--ap-akzent); }
.stepper .warn .seg::before { border-color: var(--ap-warn); background: var(--ap-warn-weich); }
.stepper .now .seg::before { width: var(--zeile); height: var(--zeile); border-color: var(--ap-text); background: var(--ap-flaeche); }
.stepper a:hover .seg::before { transform: translate(-50%, -50%) scale(1.18); }
.stepper .lbl { justify-content: center; margin-top: 10px; font-size: 14px; }
.stepper .lbl span:last-child { white-space: normal; overflow: visible; text-overflow: clip; hyphens: auto; line-height: 1.25; }
.stepper small { margin-top: 3px; }
/* Der gelbe Punkt — sitzt im Ring des aktuellen Schritts */
.stepper__laeufer { position: absolute; z-index: 2; top: var(--y, 0); left: var(--x, 0); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--ap-signal); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ap-text) 18%, transparent); pointer-events: none; transition: left var(--weg-zeit) var(--weg-kurve); }
/* Der Weg: blaue Linie vom ersten Punkt bis zum aktuellen, wächst im selben Takt wie der gelbe Punkt */
.stepper { --weg-zeit: 1.1s; --weg-kurve: cubic-bezier(.3, 0, .15, 1); }
.stepper__weg { position: absolute; z-index: 0; top: var(--y, 0); left: var(--x0, 0); height: 2px; margin-top: -1px; width: max(0px, calc(var(--x, 0px) - var(--x0, 0px))); background: var(--ap-akzent); pointer-events: none; transition: width var(--weg-zeit) var(--weg-kurve); }
/* Mit Weg-Element: Linien links vom aktuellen Schritt grau — der Weg zeichnet sie (sonst sähe man das Wachsen nicht) */
.stepper.hat-weg li.ist-vor::before, .stepper.hat-weg li.now::before { background: var(--ap-linie-kraeftig); }
.stepper.hat-weg li.now:first-child::before { background: var(--ap-linie-kraeftig); }
/* Einblenden als Ganzes, ohne Hochrutschen der einzelnen Schritte (ruckelte gegen Punkt und Weg) */
.stepper li { animation: none !important; }
.stepper { animation: stepper-ein .5s ease-out both; }
@keyframes stepper-ein { from { opacity: 0; } }
.stepper__laeufer.ist-unterwegs { animation: laeufer-atmen 1.1s ease-in-out; }
@keyframes laeufer-atmen { 50% { transform: scale(.75); } }
@media (prefers-reduced-motion: reduce) { .stepper__laeufer, .stepper__weg { transition: none; } .stepper { animation: none; } }

@media (max-width: 760px) {
  .stepper .lbl span:last-child, .stepper small { display: revert; }
}
@media (max-width: 640px) {
  .stepper { padding-block: 18px 0; }
  .stepper a { padding: 0 2px 8px; }
  .stepper .lbl { margin-top: 8px; font-size: 11.5px; letter-spacing: .01em; }
  .stepper small { display: none !important; }
}

/* Beteiligte: leere Pflichtrolle trägt denselben roten Punkt wie ein offenes Pflichtfeld */
.ap-rolle__pflicht { display: inline-flex; align-items: center; gap: 6px; }
.ap-rolle:not(.is-belegt) .ap-rolle__pflicht::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ap-pflicht-punkt, var(--ap-fehler)); order: -1; }
.ap-rolle:not(.is-belegt) .ap-rolle__pflicht { color: var(--ap-text); }
.ap-wahl__stern { color: var(--ap-signal-dunkel, #e2b90c); display: inline-flex; vertical-align: -1px; margin-left: 4px; }
.ap-wahl__stern svg { fill: currentColor; }

/* Datenabgabe: Begründung erst auf Wunsch, Abschluss in klaren Blöcken */
.ap-verzicht { padding-block: 0 12px !important; border-bottom: 1px solid var(--ap-linie) !important; }
.slist li:has(+ .ap-verzicht) { border-bottom: 0; }
.ap-verzicht__d summary { list-style: none; cursor: pointer; font-size: 13px; display: inline-block; }
.ap-verzicht__d summary::-webkit-details-marker { display: none; }
.ap-verzicht__d[open] summary { margin-bottom: 8px; }
.ap-verzicht .ap-inline input { height: 40px; }

.ap-abschluss h2 { margin-bottom: 4px; }
.ap-abschluss__f { display: flex; flex-direction: column; gap: 0; }
.ap-abschluss__teil { padding-block: 22px; border-top: 1px solid var(--ap-linie); }
.ap-abschluss__f > fieldset.ap-abschluss__teil { border: 0; margin: 0; padding: 14px 0 22px; min-width: 0; }   /* vor dem Fieldset stehen versteckte Felder — :first-child greift nicht */
.ap-abschluss .field { display: grid; gap: 8px; }
.ap-abschluss .field > span { font-size: 14px; font-weight: 500; color: var(--ap-text); }
.ap-abschluss textarea { width: 100%; box-sizing: border-box; padding: 12px 14px; font: inherit; line-height: 1.5; }
.ap-abschluss__hilfe { margin: 0 0 14px; font-size: 13.5px; color: var(--ap-text-leise); }
.ap-kat legend { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.ap-kat__wahl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ap-kat__karte { display: grid !important; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; padding: 16px; border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.ap-kat__karte:hover { border-color: var(--ap-akzent); }
.ap-kat__karte:has(input:checked) { border-color: var(--ap-akzent); box-shadow: inset 0 0 0 1px var(--ap-akzent); background: var(--ap-akzent-hauch, var(--ap-flaeche)); }
.ap-kat__karte input { margin: 2px 0 0; }
.ap-kat__karte b { display: block; font-size: 14.5px; font-weight: 600; }
.ap-kat__karte small { display: block; margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--ap-text-leise); }
.ap-kat__text { margin: 16px 0 0 !important; }
.ap-abschluss__ende { display: flex; flex-direction: column; gap: 18px; }
.ap-abschluss__ende .ap-bestaetigen { padding: 14px 16px; background: var(--ap-flaeche-ruhig, #f6f5f1); border: 1px solid var(--ap-linie); }
@media (max-width: 640px) {
  .ap-kat__wahl { grid-template-columns: minmax(0, 1fr); }
  .ap-abschluss__ende .ap-knopfzeile .btn { width: 100%; justify-content: center; }
}

/* Meldungen auf Seiten mit Aktionsleiste oben rechts unter der Kopfleiste — unten verdeckten sie
   „Weiter“, sobald der Seitenfuß sichtbar war (die Leiste sitzt dann höher als 80 px) */
body:has(.actionbar) .toasts { top: calc(var(--ap-kopf-hoehe, 64px) + 14px); bottom: auto !important; }

/* Drei-Punkte-Menü (portal.js Mehr) */
.ap-mehr { position: relative; display: inline-flex; flex: none; }
.ap-mehr__k { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid transparent; background: none; color: var(--ap-text-weich); cursor: pointer; transition: background-color .15s, border-color .15s; }
.ap-mehr__k:hover, .ap-mehr.is-offen .ap-mehr__k { background: var(--ap-flaeche); border-color: var(--ap-linie-kraeftig); color: var(--ap-text); }
.ap-mehr__l { position: absolute; z-index: 60; right: 0; top: calc(100% + 4px); min-width: 240px; padding: 6px 0; background: var(--ap-flaeche); border: 1px solid var(--ap-linie-kraeftig); box-shadow: 0 12px 32px -12px rgba(0,0,0,.28); animation: mehr-auf .16s ease-out; }
.ap-mehr.nach-oben .ap-mehr__l { top: auto; bottom: calc(100% + 4px); }
@keyframes mehr-auf { from { opacity: 0; transform: translateY(-4px); } }
.ap-mehr__l [role=menuitem] { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; padding: 9px 16px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ap-text); text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap; }
.ap-mehr__l [role=menuitem]:hover, .ap-mehr__l [role=menuitem]:focus-visible { background: var(--ap-akzent-hauch, #eef0f8); outline: none; }
.ap-mehr__l [role=menuitem] svg { flex: none; color: var(--ap-text-leise); }
.ap-mehr__l .is-gefahr { color: var(--ap-fehler); }
.ap-mehr__l .is-gefahr svg { color: currentColor; }
.ap-mehr__l hr { margin: 6px 0; border: 0; border-top: 1px solid var(--ap-linie); }
.ap-mehr__l form { display: contents; }
@media (max-width: 640px) { .ap-mehr__k { width: 44px; height: 44px; } .ap-mehr__l [role=menuitem] { padding: 12px 16px; } }
.ap-objkopf { grid-template-columns: 12px minmax(0, 1fr) auto 36px 28px; }
.ap-objkopf .ap-mehr__k { width: 32px; height: 32px; }
@media (max-width: 640px) { .ap-objkopf { grid-template-columns: 10px minmax(0, 1fr) auto 40px 28px; gap: 8px; padding-right: 10px; } .ap-objkopf .ap-mehr__k { width: 40px; height: 40px; } }
.ap-anbieter-link { display: inline-flex; transition: opacity .2s; }
.ap-anbieter-link:hover { opacity: .8; }
/* Zeilen mit Einblend-Animation bilden eigene Ebenen — die mit offenem Menü muss über den folgenden liegen */
li:has(.ap-mehr.is-offen), .row:has(.ap-mehr.is-offen), .panel:has(.ap-mehr.is-offen) { position: relative; z-index: 30; }

/* Profil, Erstanmeldung, Abgleich */
.ap-profil { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .ap-profil { grid-template-columns: minmax(0, 1fr); } }
.ap-profil__form h2 { margin-bottom: 4px; }
.ap-profil__teil { padding-block: 20px; border-top: 1px solid var(--ap-linie); border-left: 0; border-right: 0; border-bottom: 0; margin: 0; min-width: 0; }
.ap-profil__form > h2 + .ap-profil__teil { border-top: 0; padding-top: 12px; }
fieldset.ap-profil__teil { padding-inline: 0; }
.ap-profil__zwischen { margin: 0 0 12px; font-size: 13.5px; color: var(--ap-text-leise); }
.ap-profil__zwischen b { color: var(--ap-text); font-weight: 600; font-size: 14.5px; }
.ap-profil__zeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.ap-profil__feld { display: grid; gap: 6px; }
.ap-profil__feld > span { font-size: 13.5px; font-weight: 500; }
.ap-profil__feld input { min-height: 44px; padding: 0 12px; border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-feld, #fff); font: inherit; }
.ap-profil__feld.is-fehler input { border-color: var(--ap-fehler); box-shadow: inset 0 0 0 1px var(--ap-fehler); }
.ap-profil__fehler { color: var(--ap-fehler); font-size: 12.5px; margin: 6px 0 0; }
.ap-kat__wahl--vier { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ap-profil__schalter { align-items: flex-start !important; }
.ap-profil__schalter b { display: block; font-size: 14.5px; }
.ap-profil__schalter small { display: block; margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--ap-text-leise); }
.ap-profil__schalter.is-fehler { color: var(--ap-fehler); }
.ap-profil .ap-knopfzeile { padding-top: 20px; border-top: 1px solid var(--ap-linie); }
.ap-idp__k { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ap-idp__hinweis { font-size: 13px; color: var(--ap-text-leise); line-height: 1.5; margin: 8px 0 14px; }
.ap-idp__liste { margin: 0; display: grid; }
.ap-idp__liste div { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--ap-linie); font-size: 14px; }
.ap-idp__liste dt { color: var(--ap-text-leise); }
.ap-idp__liste dd { margin: 0; overflow-wrap: anywhere; }
.ap-abgleich__alt { color: var(--ap-text-leise); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ap-text-leise) 50%, transparent); }
.ap-abgleich__neu { font-weight: 600; }
.ap-abgleich .ap-knopfzeile { margin-top: 18px; }
@media (max-width: 640px) { .ap-kat__wahl--vier { grid-template-columns: minmax(0, 1fr); } }
a.me { text-decoration: none; }
a.me:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Formbearbeitung: Griffe ziehen, Zwischenpunkte einfügen, gewählten Punkt löschen */
.ap-vertex--griff span { cursor: grab; transition: transform .15s; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.ap-vertex--griff:hover span { transform: scale(1.15); }
.ap-vertex--griff.is-gewaehlt span { background: var(--ap-sym-gp); color: #fff; transform: scale(1.2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ap-signal) 70%, transparent); }
.ap-vertex--mitte span { width: 14px; height: 14px; border-width: 2px; background: color-mix(in srgb, #fff 80%, transparent); opacity: .85; cursor: copy; }
.ap-vertex--mitte:hover span { opacity: 1; transform: scale(1.25); }
.leaflet-dragging .ap-vertex--griff span { cursor: grabbing; }
@media (hover: none) { .ap-vertex--griff span { width: 28px; height: 28px; } .ap-vertex--mitte span { width: 20px; height: 20px; } }
.ap-sicherheit__knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }
.ap-sicherheit__knoepfe .btn { display: inline-flex; gap: 8px; align-items: center; }
.ap-sicherheit__knoepfe .is-aus { opacity: .45; cursor: not-allowed; }
/* Zeichen-/Bearbeitungsleiste: Hinweis eine Zeile, Knöpfe darunter — klemmte in der Kartenspalte */
.ap-skizze { flex-wrap: wrap; row-gap: 8px; }
.ap-skizze__t { flex: 1 1 100%; line-height: 1.4; }
.ap-skizze .sp { display: none; }
.ap-skizze .btn { white-space: nowrap; }
.ap-skizze [data-skizze=fertig] { margin-left: auto; }
/* Leiste liegt unten IN der Karte — darunter verschwand sie hinter der Aktionsleiste */
.ap-buehne > .ap-skizze { position: absolute; z-index: 600; left: 10px; right: 10px; bottom: 26px; box-shadow: 0 10px 28px -10px rgba(0,0,0,.45); }

/* VIS-Übertragung (Amt) */
.ap-vis__kpis { margin-bottom: 22px; }
.ap-vis__von { font-size: .45em; color: var(--ap-text-leise); letter-spacing: 0; }
.ap-vis__filter { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.ap-vis__filter a { padding: 8px 14px; border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); color: var(--ap-text-weich); text-decoration: none; font-size: 14px; }
.ap-vis__filter a[aria-current] { background: var(--ap-akzent); border-color: var(--ap-akzent); color: var(--ap-auf-akzent, #fff); }
.ap-vis__filter .c { font-size: 12px; padding: 0 6px; background: var(--ap-akzent-weich); color: var(--ap-text); margin-left: 4px; }
.ap-vis__filter .c.is-warn { background: var(--ap-warn-weich); color: var(--ap-warn-tinte); }
.ap-vis { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .ap-vis { grid-template-columns: minmax(0, 1fr); } }
.ap-vis__zeile { cursor: pointer; }
.ap-vis__zeile:hover td { background: var(--ap-flaeche-ruhig); }
.ap-vis__zeile.is-gewaehlt td { background: var(--ap-akzent-hauch); }
.ap-vis__zeile.is-gewaehlt td:first-child { box-shadow: inset 3px 0 0 var(--ap-akzent); }
.ap-vis__liste a { color: var(--ap-text); text-decoration: none; }
.ap-vis__liste td small { display: block; color: var(--ap-text-leise); font-size: 12.5px; }
.ap-vis__st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.ap-vis__st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ap-akzent); }
.ap-vis__st.is-uebertragen { color: var(--ap-gut-tinte); } .ap-vis__st.is-uebertragen::before { background: var(--ap-gut); }
.ap-vis__st.is-wartend { color: var(--ap-text-weich); } .ap-vis__st.is-wartend::before { background: var(--ap-signal-dunkel, #e2b90c); }
.ap-vis__st.is-fehler { color: var(--ap-fehler); font-weight: 500; } .ap-vis__st.is-fehler::before { background: var(--ap-fehler); }
.ap-vis__detail { position: sticky; top: calc(var(--ap-kopf-hoehe, 64px) + 16px); }
@media (max-width: 1100px) { .ap-vis__detail { position: static; } }
.ap-vis__dk { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ap-vis__dk h2 { margin: 6px 0 0; font-size: 19px; }
.ap-vis__dl { margin: 14px 0; display: grid; }
.ap-vis__dl div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--ap-linie); font-size: 14px; }
.ap-vis__dl dt { color: var(--ap-text-leise); }
.ap-vis__dl dd { margin: 0; overflow-wrap: anywhere; }
.ap-vis__hinweis { background: color-mix(in srgb, var(--ap-fehler) 7%, transparent); border-left: 3px solid var(--ap-fehler); padding: 10px 12px; font-size: 13.5px; line-height: 1.5; }
.ap-vis__detail h3 { margin: 20px 0 8px; font-size: 15px; }
.ap-vis__schritte { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.ap-vis__schritte > li { padding: 12px 0 12px 14px; border-top: 1px solid var(--ap-linie); border-left: 3px solid var(--ap-gut-linie); margin-left: 2px; }
.ap-vis__schritte > li.is-pending { border-left-color: var(--ap-signal); }
.ap-vis__schritte > li.is-failed { border-left-color: var(--ap-fehler); }
.ap-vis__sk { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ap-vis__sk b { flex: 1 1 auto; font-size: 14px; }
.ap-vis__richtung { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ap-text-leise); flex: 0 0 100%; }
.ap-vis__schritte small { color: var(--ap-text-leise); font-size: 12.5px; }
.ap-vis__daten, .ap-vis__ggv { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.ap-vis__daten li { display: flex; gap: 6px; align-items: center; }
.ap-vis__ggv li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; column-gap: 8px; align-items: baseline; }
.ap-vis__ggv li span:not(.ap-vis__punkt) { grid-column: 2; font-size: 12.5px; color: var(--ap-text-leise); }
.ap-vis__ggv em { grid-column: 3; grid-row: 1; font-style: normal; font-size: 12.5px; color: var(--ap-text-leise); }
.ap-vis__punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--ap-signal-dunkel, #e2b90c); align-self: center; }
.ap-vis__punkt.is-complete { background: var(--ap-gut); } .ap-vis__punkt.is-failed { background: var(--ap-fehler); }
.ap-vis__schritte form { margin-top: 8px; }
.ap-vis__leer { padding: 18px 4px; } .ap-vis__leer p { color: var(--ap-text-leise); font-size: 14px; margin: 6px 0 0; }
.ap-vis__liste td.num { white-space: nowrap; }
.ap-vis__liste td small.ap-vis__fehlerzahl { color: var(--ap-fehler); }

/* Impressum, Datenschutz, Barrierefreiheit; Kontaktblock in der Hilfe */
.ap-recht .sec__b ul { margin: 0; padding-left: 1.2em; }
.ap-recht .sec__b li + li { margin-top: 6px; }
.ap-recht .sec__b p + p { margin-top: 10px; }
.ap-recht__adr { margin: 10px 0 0; }
.ap-recht__adr dt { font-weight: 600; }
.ap-recht__adr dd { margin: 2px 0 0; }


/* Feedback (portal/feedback/*, portal/amt/feedback.html) */
.ap-fb { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.ap-fb__kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ap-fb__kopf small { color: var(--ap-text-leise); }
.ap-fb__status { font-size: 12.5px; padding: 2px 8px; border: 1px solid var(--ap-linie-kraeftig); }
.ap-fb__status.is-neu { color: var(--ap-akzent); border-color: var(--ap-akzent); }
.ap-fb__status.is-rueckfrage { color: var(--ap-warn-tinte); border-color: var(--ap-warn-linie); background: var(--ap-warn-weich); }
.ap-fb__status.is-erledigt { color: var(--ap-gut-tinte); border-color: var(--ap-gut-tinte); }
.ap-fb__status.is-verworfen { color: var(--ap-text-leise); }
.ap-fb__text { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.ap-fb__dateien { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ap-fb__dateien img { display: block; width: 160px; height: 110px; object-fit: cover; border: 1px solid var(--ap-linie-kraeftig); transition: border-color .2s, transform .2s; }
.ap-fb__dateien a:hover img { border-color: var(--ap-akzent); }
.ap-fb__dateien a[data-lightbox] { cursor: zoom-in; }
.ap-fb__datei { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--ap-linie-kraeftig); font-size: 13.5px; }
.ap-fb__antworten { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--ap-linie); display: flex; flex-direction: column; gap: 10px; }
.ap-fb__antworten .kopf { display: flex; gap: 10px; font-size: 13px; }
.ap-fb__antworten .kopf span { color: var(--ap-text-leise); }
.ap-fb__antworten p { margin: 2px 0 0; font-size: 14.5px; }
.ap-fb__antworten .von-verwaltung b { color: var(--ap-akzent); }
.ap-fb__form { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--ap-linie); }
.ap-fb__form > .btn { align-self: flex-start; }
/* Detail rechts: ein Rhythmus — jeder Block 16 px Abstand, nichts klebt */
.ap-fb-detail { display: flex; flex-direction: column; gap: 16px; }
.ap-fb-detail .ap-vis__dl { margin: 0; }
.ap-fb-detail .ap-fb__antworten { padding-top: 2px; }
/* Status, Speichern, Erledigt: eine Zeile, gleiche Höhe */
.ap-fb__aktionen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ap-fb__aktionen .sp { flex: 1; }
.ap-fb__aktionen .btn { height: 38px; }
.ap-fb__status-wahl { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; }
.ap-fb__status-wahl select { height: 38px; border: 1px solid var(--ap-linie-kraeftig); background-color: var(--ap-feld, var(--ap-flaeche)); padding: 0 40px 0 12px; font: inherit; font-size: 14px; }
.ap-fb__suche { display: flex; gap: 8px; align-items: center; }
.ap-fb__suche input, .ap-fb__suche select { height: 34px; border: 1px solid var(--ap-linie-kraeftig); padding: 0 10px; background: var(--ap-flaeche); font: inherit; font-size: 13.5px; }

/* Karte: Objekt hervorheben, wenn die Maus über seinem Listeneintrag ist (untersuchungen.js, Karte.hervorheben) */
/* Leaflet setzt transform am Marker selbst — animiert wird nur das innere Element */
.ap-hervor { pointer-events: none; }
.ap-hervor span { display: block; width: 100%; height: 100%; box-sizing: border-box; border-radius: 50%; border: 3px solid var(--ap-signal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ap-signal) 35%, transparent); animation: ap-hervor .55s var(--ap-feder) both; }
@keyframes ap-hervor { from { transform: scale(1.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ap-hervor-linie { animation: ap-hervor-linie .5s ease-out both; }
@keyframes ap-hervor-linie { from { stroke-opacity: 0; } to { stroke-opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .ap-hervor span, .ap-hervor-linie { animation: none; } }

/* Mein Arbeitsgebiet (Profil): kleine Vorschau, Dialog mit festem Rahmen */
.ap-ag .ap-ag__vorschau { height: 180px; border: 1px solid var(--ap-linie-kraeftig); margin: 8px 0; isolation: isolate; }
.ap-ag__stand { margin: 0 0 10px; font-size: 14px; color: var(--ap-text-weich); }
dialog.ap-agdialog { width: min(760px, calc(100vw - 32px)); }
.ap-agdialog__karte { position: relative; height: min(60vh, 480px); border: 1px solid var(--ap-linie-kraeftig); isolation: isolate; }
.ap-agdialog__karte > div { position: absolute; inset: 0; }
.ap-agdialog__rahmen { position: absolute; inset: 9% 10%; z-index: 500; pointer-events: none; border: 3px solid var(--ap-signal); box-shadow: 0 0 0 9999px rgba(20, 20, 30, .28); }

/* Amt: Entscheidungen (Schutzbedarf, Verzicht, Veröffentlichung, Fristen, Deaktivieren, Kategorisierung) */
.ap-entscheid form { display: flex; flex-direction: column; gap: 12px; }
.ap-entscheid__liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
/* Je Zeile zwei Spalten: Text links (darf umbrechen), Knöpfe rechts — immer auf derselben Linie */
.ap-entscheid__liste > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--ap-linie); }
.ap-entscheid__liste > li > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.ap-entscheid__liste small { color: var(--ap-text-leise); font-size: 12.5px; }
.ap-entscheid__k { display: inline-flex; gap: 6px; justify-self: end; white-space: nowrap; }
.ap-entscheid__kat .field { grid-column: 1 / -1; grid-row: 2; }

/* Lightbox für Screenshots (portal.js, Lightbox): groß ansehen, Pfeile blättern, Esc schließt */
dialog.ap-lightbox { padding: 0; border: 0; background: transparent; max-width: 94vw; max-height: 94vh; overflow: visible; }
dialog.ap-lightbox::backdrop { background: rgba(15, 15, 20, .82); }
.ap-lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ap-lightbox img { max-width: 94vw; max-height: 84vh; object-fit: contain; background: #fff; box-shadow: 0 20px 60px -20px rgba(0,0,0,.6); }
.ap-lightbox figcaption { color: #fff; font-size: 14px; display: flex; gap: 14px; align-items: center; }
.ap-lightbox figcaption a { color: #fff; }
.ap-lightbox__k { position: fixed; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; display: grid; place-items: center; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.ap-lightbox__k:hover { background: rgba(255,255,255,.26); }
.ap-lightbox__k[data-lb="zurueck"] { left: 16px; } .ap-lightbox__k[data-lb="vor"] { right: 16px; }
.ap-lightbox__zu { position: fixed; top: 14px; right: 14px; width: 42px; height: 42px; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; display: grid; place-items: center; }

/* Archivierte Mail (amt/mail.html) */
.ap-mailansicht { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
.ap-mailansicht__inhalt iframe { width: 100%; height: 760px; border: 1px solid var(--ap-linie); background: #f4f3ef; }
.ap-mailansicht__inhalt pre { white-space: pre-wrap; font: inherit; font-size: 14.5px; margin: 0; }
@media (max-width: 1100px) { .ap-mailansicht { grid-template-columns: minmax(0, 1fr); } }

/* Karte und Statistik (amt/karte.html): Filterleiste, Karte mit Liste „Im Ausschnitt“, Zahlen darunter */
.ap-ak__filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.ap-ak__filter select, .ap-ak__suche { height: 40px; border: 1px solid var(--ap-linie-kraeftig); background-color: var(--ap-flaeche); font: inherit; font-size: 14px; }
.ap-ak__filter select { padding: 0 36px 0 12px; max-width: 180px; text-overflow: ellipsis; }
.ap-ak__suche { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; flex: 1 1 200px; max-width: 300px; color: var(--ap-text-leise); }
.ap-ak__suche input { border: 0; outline: 0; background: none; font: inherit; color: var(--ap-text); width: 100%; height: 100%; }
.ap-ak__suche:focus-within { border-color: var(--ap-akzent); }
.ap-ak__chips { display: inline-flex; gap: 0; border: 0; margin: 0; padding: 0; }
.ap-ak__chip { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); font-size: 13.5px; cursor: pointer; user-select: none; }
.ap-ak__chip + .ap-ak__chip { border-left: 0; }
.ap-ak__chip input { position: absolute; opacity: 0; pointer-events: none; }
.ap-ak__chip:has(input:not(:checked)) { color: var(--ap-text-leise); background: transparent; }
.ap-ak__chip:has(input:not(:checked)) .sym { opacity: .3; }
.ap-ak__chip:has(input:focus-visible) { outline: 2px solid var(--ap-akzent); outline-offset: 2px; }

.ap-ak { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; height: min(72vh, 760px); min-height: 480px; }
.ap-ak__karte { position: relative; isolation: isolate; border: 1px solid var(--ap-linie-kraeftig); min-height: 0; }
.ap-ak__karte .ap-karte { position: absolute; inset: 0; height: auto; }
.ap-ak__liste { display: flex; flex-direction: column; min-height: 0; padding: 0; }
.ap-ak__listenkopf { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 4px; white-space: nowrap; padding: 16px 18px 12px; border-bottom: 1px solid var(--ap-linie); }
.ap-ak__listenkopf b { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ap-ak__listenkopf span { color: var(--ap-text-weich); font-size: 13.5px; }
.ap-ak__knoepfe { margin-left: auto; display: inline-flex; gap: 14px; }
.ap-ak__eintraege { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.ap-ak__eintraege li { border-bottom: 1px solid var(--ap-linie); }
.ap-ak__eintraege a { display: flex; flex-direction: column; gap: 4px; padding: 11px 18px 12px; color: inherit; text-decoration: none; border-left: 3px solid transparent; transition: background-color .15s, border-color .15s; }
.ap-ak__eintraege a:hover, .ap-ak__eintraege li.is-markiert a { background: var(--ap-signal-weich); border-left-color: var(--ap-signal); }
.ap-ak__z1 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ap-ak__z1 b { font-weight: 500; font-size: 14.5px; line-height: 1.35; min-width: 0; }
.ap-ak__st { flex: none; font-size: 11.5px; color: var(--ap-text-weich); border: 1px solid var(--ap-linie-kraeftig); padding: 0 6px; white-space: nowrap; }
.ap-ak__z2 { font-size: 12.5px; color: var(--ap-text-leise); font-variant-numeric: tabular-nums; }
.ap-ak__z3 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; color: var(--ap-text-weich); }
.ap-ak__z3 > span { display: inline-flex; align-items: center; gap: 5px; }
.ap-ak__mehr { padding: 14px 18px; font-size: 13px; color: var(--ap-text-leise); }

.ap-ak__statistik { margin-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.ap-ak__diagramme { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ap-ak__diagramme h2 { font-size: 16px; margin: 0 0 12px; }
.ap-ak__balken { display: flex; flex-direction: column; gap: 8px; }
.ap-ak__balken > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; row-gap: 3px; font-size: 13.5px; }
.ap-ak__balken > div span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-ak__balken > div i { grid-column: 1 / -1; height: 6px; background: var(--ap-linie); display: block; }
.ap-ak__balken > div em { display: block; height: 100%; background: var(--ap-akzent); transition: width .3s; }
@media (max-width: 1100px) {
  .ap-ak { grid-template-columns: minmax(0, 1fr); height: auto; }
  .ap-ak__karte { height: 60vh; min-height: 360px; }
  .ap-ak__liste { max-height: 420px; }
  .ap-ak__diagramme { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ap-ak__statistik .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-ak__suche { max-width: none; flex-basis: 100%; }
  .ap-ak__filter select { flex: 1 1 45%; }
}
