/* ==========================================================================
   Anzeigenportal · Struktur (Basis-Schicht der neuen Oberfläche)
   --------------------------------------------------------------------------
   Übernommen aus dem Klickdummy (~/Projekte/_playground/tango/tango.css) und
   auf die --ap-*-Tokens umgestellt. Hier stehen Raster, Komponenten, Formen
   und Bewegung. Farben, Schrift und Marke setzt ein Mandanten-Layer
   (theme/neutral.css, theme/bayern.css), und zwar ausschließlich über Tokens.

   Die Werte unten sind die neutrale Rückfallebene: ohne Layer bleibt das
   Portal benutzbar, nur ohne Marke.
   ========================================================================== */

@view-transition { navigation: auto; }

:root {
  /* --- Bedienfarbe (Auswahl, Schalter, Fortschritt, Hauptknopf) --- */
  --ap-akzent: #3b5566;
  --ap-akzent-dunkel: #2c4150;
  --ap-akzent-85: #566e7d;
  --ap-akzent-50: #9daab3;
  --ap-akzent-38: #b9c3ca;
  --ap-akzent-23: #d5dbe0;
  --ap-akzent-weich: #e3e8ec;
  --ap-akzent-hauch: #f5f7f9;
  --ap-auf-akzent: #ffffff;

  /* --- Signal: der eine Handlungsaufruf je Ansicht (CTA) --- */
  --ap-signal: #f2c200;
  --ap-signal-dunkel: #dcae00;
  --ap-signal-weich: #fdf4d0;
  --ap-signal-tinte: #5c4600;
  --ap-auf-signal: #111111;

  /* --- Fachakzent (Markierung „hier bin ich“, Navigation) --- */
  --ap-fach: #3b5566;

  /* --- Flächen, Linien, Schrift --- */
  --ap-grund: #f3f5f7;
  --ap-flaeche: #ffffff;
  --ap-flaeche-ruhig: #f7f9fa;
  --ap-feld: #ffffff;
  --ap-linie: #dde1e5;
  --ap-linie-kraeftig: #bcc4cb;
  --ap-text: #111111;
  --ap-text-fliess: #1d2126;
  --ap-text-weich: #4b535b;
  --ap-text-leise: #66707a;

  /* --- Zustände --- */
  --ap-gut: #4f8a1c;  --ap-gut-tinte: #355f12;  --ap-gut-weich: #eaf3e0;  --ap-gut-linie: #b5d58f;
  --ap-warn: #b25400; --ap-warn-tinte: #6b3300; --ap-warn-weich: #fdf0e3; --ap-warn-linie: #efbd8f;
  --ap-fehler: #a81a2e; --ap-fehler-weich: #f7e3e6;
  --ap-pflicht-punkt: #e0342b;   /* offene Pflichtangabe: ein klares, warmes Rot (Rückmeldung Daniel 27.11.) */
  --ap-info: #2a6496; --ap-info-tinte: #173a57; --ap-info-weich: #eef4f9; --ap-info-linie: #cfe0ec;

  /* --- Dunkle Ebenen (Toasts, Hinweiskarten, Fuß) --- */
  --ap-dunkel: #1f2a31;
  --ap-auf-dunkel: #eef1f3;
  --ap-schatten-rgb: 20, 28, 34;
  --ap-fuss-grund: #2c4150;
  --ap-fuss-text: #ffffff;

  /* --- Schichtkante (Motiv), Objektsymbole --- */
  --ap-schicht-1: #2c4150; --ap-schicht-2: #566e7d; --ap-schicht-3: #9daab3;
  --ap-schicht-4: #d5dbe0; --ap-schicht-5: #7c8a94;
  --ap-sym-bo: #773120; --ap-sym-gp: #283e85; --ap-sym-so: #627e1b;

  /* --- Schrift --- */
  --ap-schrift: system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --ap-schrift-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --ap-schrift-merkmale: normal;
  --ap-titel-gewicht: 500;
  --ap-titel-sperrung: -.015em;

  /* --- Bewegung: Federkurven über linear() --- */
  --ap-feder: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.077, 1.121 24.2%, 1.149 26.5%, 1.159 28.4%, 1.154 30.9%, 1.129 34.4%, 1.051 42.8%, 1.017 47.9%, 0.997 52.6%, 0.991 58.4%, 1.001 75.7%, 1);
  --ap-feder-weich: linear(0, 0.06 3%, 0.24 7.6%, 0.76 17.6%, 0.95 23%, 1.03 28.8%, 1.05 33%, 1.04 39%, 1.005 52%, 0.997 64%, 1);
  --ap-ease: cubic-bezier(.2, .8, .2, 1);

  /* --- Maße --- */
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --ap-inhalt-max: 1320px;
  --ap-kopf-hoehe: 88px;
  --ap-logo-hoehe: 56px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ap-schrift);
  font-size: 15px;
  line-height: 1.55;
  font-optical-sizing: auto;
  color: var(--ap-text-fliess);
  background: var(--ap-grund);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: var(--ap-schrift-merkmale);
}
h1, h2, h3, h4 { color: var(--ap-text); font-weight: var(--ap-titel-gewicht); line-height: 1.15; margin: 0; text-wrap: balance; }
h1, h2 { font-family: var(--ap-schrift); font-weight: var(--ap-titel-gewicht); letter-spacing: -.005em; }
h1 { letter-spacing: var(--ap-titel-sperrung); line-height: 1.1; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--ap-link); text-underline-offset: 3px; }
a:hover { color: var(--ap-link-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--ap-akzent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--ap-flaeche);
  border-bottom: 1px solid var(--ap-linie);
  view-transition-name: topbar;
}
.topbar__in {
  max-width: var(--ap-inhalt-max); margin: 0 auto;
  padding: 12px var(--gutter-r) 12px var(--gutter-l);
  display: flex; align-items: center; gap: 40px; min-height: var(--ap-kopf-hoehe);
}
/* The TANGO logo is the only graphic in the bar: everything else is type. */
.brand { display: block; flex: none; view-transition-name: brand; }
.brand img { height: var(--ap-logo-hoehe); width: auto; }
.topbar__spacer { flex: 1; }
.lfu { height: 38px; width: auto; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a, .nav button {
  position: relative; border: 0; background: none; padding: 6px 0; cursor: pointer;
  font-size: 15px; color: var(--ap-text-weich); text-decoration: none; white-space: nowrap;
}
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--ap-fach); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ap-feder); }
.nav a:hover { color: var(--ap-text); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--ap-text); }
.nav .k { display: inline-flex; align-items: center; gap: 10px; }
.nav .k span:last-child { font-size: 12px; color: var(--ap-text-leise); border: 1px solid var(--ap-linie-kraeftig); padding: 0 6px; line-height: 20px; }
.me { font-size: 15px; color: var(--ap-text); border: 0; background: none; cursor: pointer; padding: 6px 0; white-space: nowrap; }
@media (max-width: 900px) { .nav a:not([aria-current="page"]) { display: none; } .topbar__in { gap: 20px; } }
@media (max-width: 560px) { .lfu { height: 28px; } .brand img { height: 46px; } .nav { display: none; } }

/* --------------------------------------------------------------------------
   Buttons — square, CD-conform, with physical press feedback
   -------------------------------------------------------------------------- */
.btn {
  --b: var(--ap-akzent); --f: var(--ap-auf-akzent);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px; border: 1px solid var(--b);
  background: var(--b); color: var(--f); font-weight: 500; font-size: 15px;
  cursor: pointer; text-decoration: none; user-select: none;
  transition: transform .5s var(--ap-feder), background-color .2s, box-shadow .2s;
}
.btn:hover { background: var(--ap-akzent-dunkel); border-color: var(--ap-akzent-dunkel); }
.btn:active, .btn.is-pressed { transform: scale(.965); transition-duration: .08s; }
.btn--gold { --b: var(--ap-signal); --f: var(--ap-auf-signal); }
.btn--gold:hover { background: var(--ap-signal-dunkel); border-color: var(--ap-signal-dunkel); }
.btn--ghost { --b: transparent; --f: var(--ap-text); border-color: var(--ap-linie-kraeftig); }
.btn--ghost:hover { background: var(--ap-flaeche-ruhig); border-color: var(--ap-akzent); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn .ripple {
  position: absolute; z-index: -1; border-radius: 50%; pointer-events: none;
  background: currentColor; opacity: .18; transform: scale(0);
  animation: ripple .6s var(--ap-ease) forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.btn .arrow { transition: transform .45s var(--ap-feder); }
.btn:hover .arrow { transform: translateX(4px); }

.kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border: 1px solid var(--ap-linie-kraeftig); border-bottom-width: 2px; background: var(--ap-flaeche);
  font-size: 11.5px; color: var(--ap-text-weich); font-family: var(--ap-schrift);
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
.toasts {
  position: fixed; z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px 12px 14px;
  background: var(--ap-dunkel); color: var(--ap-auf-dunkel); font-size: 14px;
  border-left: 3px solid var(--ap-signal);
  animation: toast-in .55s var(--ap-feder) both;
}
.toast.out { animation: toast-out .3s var(--ap-ease) forwards; }
.toast svg { flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* --------------------------------------------------------------------------
   Prototype ribbon + feedback switch
   -------------------------------------------------------------------------- */
.proto {
  position: fixed; z-index: 90;
  left: calc(16px + env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 0;
  background: var(--ap-flaeche); border: 1px solid var(--ap-linie-kraeftig); font-size: 12.5px;
}
.proto span { padding: 8px 12px; color: var(--ap-text-leise); border-right: 1px solid var(--ap-linie); }
.proto button { border: 0; background: none; padding: 8px 12px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; color: var(--ap-text-weich); }
.proto button[aria-pressed="true"] { color: var(--ap-text); }
.proto button[aria-pressed="true"] .dot { background: var(--ap-gut); }
.proto button[data-fill] { border-left: 1px solid var(--ap-linie); color: var(--ap-link); }
.proto .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ap-akzent-50); transition: background .2s; }
@media (max-width: 560px) { .proto span { display: none; } }
body:has(.actionbar) .toasts { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.foot { background: var(--ap-akzent); color: var(--ap-auf-akzent); margin-top: 72px; }
.foot__in {
  max-width: var(--ap-inhalt-max); margin: 0 auto; padding-block: 14px;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; font-size: 14px;
}
.foot a { color: var(--ap-fuss-text); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot .sp { flex: 1; }
.foot .box { border: 1px solid currentColor; padding: 3px 10px; }

/* --------------------------------------------------------------------------
   Shared bits
   -------------------------------------------------------------------------- */
.wrap { max-width: var(--ap-inhalt-max); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.eyebrow { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ap-text-leise); font-weight: 500; }
.fach { display: inline-flex; align-items: center; gap: 8px; }
.fach::before { content: ""; width: 3px; height: 14px; background: var(--ap-fach); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid currentColor;
}
.pill--draft { color: var(--ap-signal-tinte); background: var(--ap-signal-weich); border-color: var(--ap-signal-dunkel); }
.pill--ok { color: var(--ap-gut-tinte); background: var(--ap-gut-weich); border-color: var(--ap-gut-linie); }
.pill--info { color: var(--ap-akzent-dunkel); background: var(--ap-akzent-weich); border-color: var(--ap-akzent-38); }
.pill--warn { color: var(--ap-warn-tinte); background: var(--ap-warn-weich); border-color: var(--ap-warn-linie); }

/* Entry animation for anything marked .rise (visible at rest when motion is off) */
.rise { animation: rise .8s var(--ap-feder-weich) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
  @view-transition { navigation: none; }
}

/* --------------------------------------------------------------------------
   Command palette (⌘K) — shared on all signed-in pages
   -------------------------------------------------------------------------- */
dialog.cmd {
  position: fixed; inset: 0; margin: min(12vh, 120px) auto auto; padding: 0;
  width: min(760px, calc(100vw - 32px)); max-height: min(560px, 76vh);
  border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); color: var(--ap-text-fliess);
  box-shadow: 0 40px 90px -40px rgba(var(--ap-schatten-rgb), .55);
  display: none; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(-12px) scale(.98);
  transition: opacity .2s, transform .5s var(--ap-feder), display .5s allow-discrete, overlay .5s allow-discrete;
}
dialog.cmd[open] { display: flex; opacity: 1; transform: none; }
@starting-style { dialog.cmd[open] { opacity: 0; transform: translateY(-16px) scale(.97); } }
dialog.cmd::backdrop { background: rgba(var(--ap-schatten-rgb), 0); transition: background .3s, display .3s allow-discrete, overlay .3s allow-discrete; }
dialog.cmd[open]::backdrop { background: rgba(var(--ap-schatten-rgb), .42); }
@starting-style { dialog.cmd[open]::backdrop { background: rgba(var(--ap-schatten-rgb), 0); } }
.cmd__bar { display: flex; align-items: center; gap: 14px; padding: 0 20px; border-bottom: 1px solid var(--ap-linie); flex: none; }
.cmd__bar svg { color: var(--ap-text-leise); flex: none; }
.cmd__bar input { flex: 1; min-width: 0; height: 64px; border: 0; outline: 0; background: none; font-size: 19px; color: var(--ap-text); }
.cmd__bar input::placeholder { color: var(--ap-text-leise); }
.cmd__esc { font-size: 12px; color: var(--ap-text-leise); border: 1px solid var(--ap-linie-kraeftig); padding: 0 6px; line-height: 20px; }
.cmd__body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; min-height: 0; flex: 1; }
@media (max-width: 680px) { .cmd__body { grid-template-columns: minmax(0, 1fr); } .cmd__peek { display: none; } }
.cmd__list { list-style: none; margin: 0; padding: 8px 0; overflow-y: auto; min-height: 0; }
.cmd__grp { padding: 14px 20px 6px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ap-text-leise); font-weight: 500; }
.cmd__item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 20px; cursor: pointer; position: relative; }
.cmd__item svg { color: var(--ap-text-leise); }
.cmd__item .t { min-width: 0; display: flex; flex-direction: column; }
.cmd__item .t b { font-weight: 400; font-size: 15px; color: var(--ap-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd__item .t small { font-size: 12.5px; color: var(--ap-text-leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd__item .hk { font-size: 12px; color: var(--ap-text-leise); }
.cmd__item[aria-selected="true"] { background: var(--ap-flaeche-ruhig); }
.cmd__item[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ap-fach); }
.cmd__item[aria-selected="true"] svg { color: var(--ap-fach); }
.cmd__item mark { background: none; color: var(--ap-text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--ap-signal); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.cmd__empty { padding: 28px 20px; color: var(--ap-text-weich); font-size: 14.5px; }
.cmd__peek { border-left: 1px solid var(--ap-linie); padding: 20px; display: flex; flex-direction: column; gap: 12px; background: var(--ap-flaeche-ruhig); overflow-y: auto; }
.cmd__peek .eyebrow { margin-bottom: -4px; }
.cmd__peek h4 { font-size: 17px; font-weight: 500; }
.cmd__peek dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; font-size: 13px; }
.cmd__peek dt { color: var(--ap-text-leise); }
.cmd__peek dd { margin: 0; color: var(--ap-text); }
.cmd__peek .swap { animation: swap .35s var(--ap-feder) both; }
@keyframes swap { from { opacity: 0; transform: translateY(6px); } }
.cmd__foot { display: flex; gap: 18px; padding: 10px 20px; border-top: 1px solid var(--ap-linie); font-size: 12px; color: var(--ap-text-leise); flex: none; }
.cmd__foot span { display: inline-flex; gap: 6px; align-items: center; }
.cmd__foot i { font-style: normal; border: 1px solid var(--ap-linie-kraeftig); padding: 0 5px; line-height: 18px; font-size: 11px; }

/* Object symbols (from docs/09-karte.md): Bohrung ● geologie, Geophysik ■ analytik, Sonstige ◆ natur */
.sym { display: inline-block; width: 12px; height: 12px; flex: none; }
.sym--bo { background: var(--ap-sym-bo); border-radius: 50%; }
.sym--gp { background: var(--ap-sym-gp); }
.sym--so { background: var(--ap-sym-so); transform: rotate(45deg) scale(.85); }


/* --------------------------------------------------------------------------
   Wizard: stepper, step head, sections, action bar — shared by step pages.
   Editorial layout: heading column left, content right, hairlines between.
   -------------------------------------------------------------------------- */
.stepper { display: grid; grid-template-columns: repeat(var(--steps, 5), minmax(0, 1fr)); gap: 8px; padding-block: 36px 0; list-style: none; margin: 0; }
.stepper li { min-width: 0; animation: rise .6s var(--ap-feder-weich) both; animation-delay: calc(var(--i, 0) * 50ms); }
.stepper li.is-leaving { animation: stepout .45s var(--ap-ease) forwards; }
@keyframes stepout { to { opacity: 0; transform: translateY(-6px); } }
.stepper a { display: flex; flex-direction: column; gap: 9px; text-decoration: none; color: var(--ap-text-leise); min-width: 0; }
.stepper .seg { height: 4px; background: var(--ap-akzent-weich); position: relative; overflow: hidden; }
.stepper .done .seg { background: var(--ap-schicht-c, var(--ap-schicht-1)); }
.stepper .done .seg { background: var(--ap-akzent); }
.stepper .now .seg { background: var(--ap-akzent-38); }
.stepper .now .seg::after { content: ""; position: absolute; inset: 0 50% 0 0; background: var(--ap-akzent); }
.stepper .lbl { display: flex; gap: 10px; align-items: baseline; font-size: 14px; min-width: 0; }
.stepper .lbl span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper .n { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ap-text-leise); font-weight: 500; }
.stepper small { font-size: 12px; color: var(--ap-text-leise); }
.stepper .done a, .stepper .now a { color: var(--ap-text); }
.stepper .now .lbl { font-weight: 500; }
.stepper .done small { color: var(--ap-gut-tinte); }
.stepper .warn small { color: var(--ap-warn); }
.stepper a:hover .lbl span:last-child { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (max-width: 760px) { .stepper .lbl span:last-child, .stepper small { display: none; } .stepper .now .lbl span:last-child { display: inline; } }

.stephead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 40px; align-items: end; padding-block: clamp(40px, 5vw, 64px) clamp(28px, 3vw, 40px); }
.stephead h1 { font-size: clamp(30px, 3.4vw, 44px); margin-top: 14px; max-width: 22ch; }
.stephead p { color: var(--ap-text-weich); font-size: 17px; line-height: 1.6; margin-top: 14px; max-width: 60ch; }
@media (max-width: 760px) { .stephead { grid-template-columns: minmax(0, 1fr); } }
.title { display: none; } /* legacy */

.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ap-text-leise); align-items: center; }
.meta .live { display: inline-flex; gap: 8px; align-items: center; }
.meta .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ap-gut); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ap-gut) 55%, transparent); } 70% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ap-gut) 0%, transparent); } 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ap-gut) 0%, transparent); } }
.saved { display: inline-flex; gap: 6px; align-items: center; }
.saved.is-saving svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* White panels on the grey ground: every area that asks something is a
   clearly bounded surface. Information around it stays on the ground. */
.panel { background: var(--ap-flaeche); border: 1px solid var(--ap-linie); padding: clamp(22px, 3vw, 40px); }
.sec { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px 64px; padding: clamp(24px, 3.2vw, 44px); background: var(--ap-flaeche); border: 1px solid var(--ap-linie); }
.sec + .sec { margin-top: 16px; }
.sec { transition: border-color .3s; }
.sec.is-help { border-color: var(--ap-akzent-38); }
.sec__h { display: flex; flex-direction: column; gap: 10px; }
.sec__h .no { font-size: 12px; font-weight: 500; color: var(--ap-text-leise); font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.sec__h h2 { font-size: 20px; }
.sec__h p { font-size: 14.5px; line-height: 1.6; color: var(--ap-text-weich); max-width: 34ch; }
.sec__b { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
@media (max-width: 860px) { .sec { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

.actionbar { position: sticky; bottom: 0; z-index: 40; margin-top: 56px; background: var(--ap-flaeche); border-top: 1px solid var(--ap-linie); padding-bottom: env(safe-area-inset-bottom, 0px); }
.actionbar__in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-block: 12px; }
.actionbar .sp { flex: 1; }
.actionbar .btn--gold.is-ready { animation: nudge 2.6s var(--ap-feder) 1.2s 2; }
@keyframes nudge { 0%, 18%, 100% { transform: none; } 6% { transform: translateX(5px); } 12% { transform: translateX(-2px); } }
.meter { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ap-text-weich); }
.meter__ring { --p: 0; width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(var(--ap-akzent) calc(var(--p) * 1%), var(--ap-akzent-weich) 0); display: grid; place-items: center; transition: --p .8s var(--ap-feder-weich); flex: none; }
.meter__ring::before { content: ""; width: 24px; height: 24px; border-radius: 50%; background: var(--ap-flaeche); }
@property --p { syntax: '<number>'; inherits: false; initial-value: 0; }
.meter b { font-weight: 500; color: var(--ap-text); }

/* --------------------------------------------------------------------------
   Form atoms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--ap-text); font-weight: 500; min-width: 0; }
.field .opt { font-weight: 400; color: var(--ap-text-leise); }
.field input, .field select, .field textarea { height: 48px; border: 1px solid var(--ap-linie-kraeftig); border-bottom-color: var(--ap-akzent-50); padding: 0 14px; background: var(--ap-feld); border-radius: 0; font-weight: 400; font-size: 15.5px; color: var(--ap-text); transition: box-shadow .2s, border-color .2s; width: 100%; }
.field textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--ap-akzent); box-shadow: inset 0 -2px 0 var(--ap-akzent), 0 0 0 4px color-mix(in srgb, var(--ap-akzent) 14%, transparent); }
/* Auswahlfelder überall: eigener Pfeil mit festem Abstand zum Rand (der eingebaute klebt am Rand und lässt sich
   nicht verschieben). :not([multiple]):not([size]) hebt die Regel über „.field select“ (das setzt background). */
select:not([multiple]):not([size]) {
  appearance: none; -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366655e' stroke-width='1.8' stroke-linecap='square'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
  cursor: pointer;
}
select:not([multiple]):not([size]):disabled { opacity: .6; cursor: not-allowed; }
.field input.big { height: 58px; font-size: 19px; }
.field .help { font-size: 12.5px; font-weight: 400; color: var(--ap-text-leise); }
.field.is-ok input { border-bottom-color: var(--ap-gut); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.chips legend { font-size: 13.5px; color: var(--ap-text); font-weight: 500; margin-bottom: 9px; padding: 0; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); cursor: pointer; font-size: 14.5px; transition: border-color .2s, background-color .2s, color .2s, transform .5s var(--ap-feder); }
.chip:hover { border-color: var(--ap-akzent); }
.chip:active { transform: scale(.96); transition-duration: .08s; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--ap-akzent); color: var(--ap-auf-akzent); border-color: var(--ap-akzent); }
.chip:has(input:focus-visible) { outline: 2px solid var(--ap-akzent); outline-offset: 2px; }
.reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ap-feder-weich), opacity .3s; opacity: 0; }
.reveal > div { overflow: hidden; min-height: 0; }
.reveal.is-open { grid-template-rows: 1fr; opacity: 1; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
@media (max-width: 520px) { .two { grid-template-columns: minmax(0, 1fr); } }
.unit { position: relative; }
.unit input { padding-right: 76px; font-variant-numeric: tabular-nums; }
.unit em { position: absolute; right: 14px; bottom: 14px; font-style: normal; font-size: 13px; color: var(--ap-text-leise); font-weight: 400; }

/* Square switch (CD: no round corners). */
.switch { position: relative; flex: none; width: 56px; height: 30px; appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; background: var(--ap-akzent-38); transition: background-color .25s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; background: var(--ap-auf-akzent); transition: transform .5s var(--ap-feder); }
.switch:checked { background: var(--ap-akzent); }
.switch:checked::after { transform: translateX(26px); }
.switch:active::after { width: 28px; }
.switch:checked:active::after { transform: translateX(22px); }
.switch:focus-visible { outline: 2px solid var(--ap-akzent); outline-offset: 3px; }

.switchrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 22px 24px; border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); cursor: pointer; transition: border-color .25s, background-color .25s; }
.switchrow:hover { border-color: var(--ap-akzent); }
.switchrow:has(.switch:checked) { border-color: var(--ap-akzent); box-shadow: inset 4px 0 0 var(--ap-info); }
.switchrow b { display: flex; gap: 10px; align-items: center; font-size: 17px; font-weight: 500; color: var(--ap-text); }
.switchrow p { font-size: 14px; color: var(--ap-text-weich); margin-top: 6px; max-width: 60ch; }

/* Large choice cards (radio). */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; border: 0; padding: 0; margin: 0; }
.choice { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px; border: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); cursor: pointer; transition: border-color .2s, box-shadow .25s, transform .5s var(--ap-feder); }
.choice:hover { border-color: var(--ap-akzent); }
.choice:active { transform: scale(.985); transition-duration: .08s; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice b { font-size: 17px; font-weight: 500; color: var(--ap-text); padding-right: 36px; }
.choice span { font-size: 14px; color: var(--ap-text-weich); }
.choice small { font-size: 12.5px; color: var(--ap-text-leise); margin-top: auto; padding-top: 8px; }
.choice .tag { position: absolute; top: -10px; left: 18px; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; background: var(--ap-signal); color: var(--ap-auf-signal); padding: 2px 8px; }
.choice .tick { position: absolute; top: 20px; right: 20px; width: 24px; height: 24px; 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; }
.choice .tick svg path { stroke-dasharray: 26; stroke-dashoffset: 26; transition: stroke-dashoffset .35s var(--ap-ease) .05s; }
.choice:has(input:checked) { border-color: var(--ap-akzent); box-shadow: inset 0 0 0 1px var(--ap-akzent); background: var(--ap-akzent-hauch); }
.choice:has(input:checked) .tick { background: var(--ap-akzent); border-color: var(--ap-akzent); animation: pop .5s var(--ap-feder); }
.choice:has(input:checked) .tick svg path { stroke-dashoffset: 0; }
.choice:has(input:focus-visible) { outline: 2px solid var(--ap-akzent); outline-offset: 2px; }
@keyframes pop { from { transform: scale(.5); } }

/* Key/value summary rows. */
.kv { display: flex; flex-direction: column; border-top: 1px solid var(--ap-linie); }
.kv > div { display: grid; grid-template-columns: minmax(120px, 2fr) minmax(0, 5fr) auto; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--ap-linie); align-items: baseline; font-size: 14.5px; }
.kv dt, .kv .k { color: var(--ap-text-leise); font-size: 13.5px; }
.kv dd, .kv .v { margin: 0; color: var(--ap-text); min-width: 0; }
.kv a { font-size: 13px; white-space: nowrap; }
@media (max-width: 560px) { .kv > div { grid-template-columns: minmax(0, 1fr) auto; } .kv .k { grid-column: 1 / -1; } }

/* Status list (documents, completeness). */
.slist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ap-linie); }
.slist li { display: grid; grid-template-columns: 28px minmax(0, 1fr) 150px 124px; gap: 16px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--ap-linie); transition: background-color .3s; }
.slist .t b { display: block; font-weight: 500; color: var(--ap-text); font-size: 15px; }
.slist .t small { font-size: 12.5px; color: var(--ap-text-leise); }
.slist .ic { width: 28px; height: 28px; display: grid; place-items: center; color: var(--ap-text-leise); }
.slist li.is-ok .ic { color: var(--ap-gut-tinte); background: var(--ap-gut-weich); }
.slist li.is-due .ic { color: var(--ap-auf-akzent); background: var(--ap-warn); }
.slist li.is-na { opacity: .55; }
.slist li.is-flash { background: var(--ap-signal-weich); }
.slist .btn { width: 100%; }
.slist .pill { justify-self: start; }
@media (max-width: 560px) { .slist li { grid-template-columns: 28px minmax(0, 1fr) auto; } .slist li > .pill { display: none; } }

.note { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-left: 3px solid var(--ap-info); background: var(--ap-info-weich); font-size: 14px; color: var(--ap-info-tinte); }
.note svg { flex: none; margin-top: 1px; }
.note--warn { border-left-color: var(--ap-warn); background: var(--ap-warn-weich); color: var(--ap-warn-tinte); }
.src { font-size: 12.5px; color: var(--ap-text-leise); display: flex; gap: 6px; align-items: center; }
.ex { font-size: 11px; padding: 0 6px; border: 1px dashed var(--ap-akzent-50); color: var(--ap-text-leise); font-weight: 400; white-space: nowrap; }
.badge-whg { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--ap-info-tinte); border: 1px solid var(--ap-info-linie); padding: 1px 7px; letter-spacing: .02em; }
.ib { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid transparent; background: none; cursor: pointer; color: var(--ap-text-weich); flex: none; }
.ib:hover { border-color: var(--ap-linie-kraeftig); color: var(--ap-text); }

/* --------------------------------------------------------------------------
   Help — inline disclosures and the contextual help panel.
   Calm blue reference colour, one icon, a clear title, short body, and the
   legal basis as a quiet footer. Opens with a soft height transition.
   -------------------------------------------------------------------------- */
.help { border: 1px solid var(--ap-info-linie); background: var(--ap-info-weich); transition: background-color .25s, border-color .25s; }
/* Closed: a small "? Hilfe" link. Open: the full box. */
.help:not([open]) { align-self: flex-start; background: none; border-color: transparent; }
.help:not([open]) > summary { padding: 4px 0; }
.help:not([open]) > summary .chev { margin-left: 2px; }
.help > summary { list-style: none; cursor: pointer; display: flex; gap: 12px; align-items: center; padding: 12px 16px; font-size: 14px; color: var(--ap-link); user-select: none; }
.help > summary::-webkit-details-marker { display: none; }
.help > summary .q { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border: 1.5px solid currentColor; border-radius: 50%; font-size: 12px; font-weight: 700; line-height: 1; }
.help > summary .chev { margin-left: auto; display: grid; color: var(--ap-text-leise); transition: transform .4s var(--ap-feder); }
.help[open] > summary .chev { transform: rotate(90deg); }
.help > summary:hover { color: var(--ap-link-hover); }
.help::details-content { block-size: 0; overflow: hidden; transition: block-size .45s var(--ap-feder-weich), content-visibility .45s allow-discrete; }
.help[open]::details-content { block-size: auto; }
@supports (interpolate-size: allow-keywords) { :root { interpolate-size: allow-keywords; } }
.help__b { padding: 2px 16px 16px 50px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.6; color: var(--ap-info-tinte); }
.help__b ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.help__b .law { font-size: 12.5px; color: var(--ap-text-leise); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--ap-info-linie); }

/* Contextual help panel: follows the section the user is working in. */
.guide { background: var(--ap-flaeche); border: 1px solid var(--ap-linie); border-top: 3px solid var(--ap-akzent); }
.guide__h { display: flex; gap: 10px; align-items: center; padding: 18px 22px 0; }
.guide__h .eyebrow { margin-right: auto; }
.guide__c { padding: 14px 22px 22px; display: flex; flex-direction: column; gap: 12px; }
.guide__c.is-swap { animation: swap .4s var(--ap-feder) both; }
.guide__c h3 { font-size: 17px; font-weight: 500; }
.guide__c p { font-size: 14px; line-height: 1.6; color: var(--ap-text-weich); }
.guide__c .do { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.guide__c .do li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--ap-text-fliess); }
.guide__c .do li svg { color: var(--ap-gut-tinte); margin-top: 1px; }
.guide__c .law { font-size: 12.5px; color: var(--ap-text-leise); padding-top: 12px; border-top: 1px solid var(--ap-linie); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Inline field hint: a single quiet line with an info dot. */
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--ap-text-leise); font-weight: 400; }
.hint svg { flex: none; margin-top: 2px; color: var(--ap-akzent); }

/* --------------------------------------------------------------------------
   Menu button + slide-in navigation (left)
   -------------------------------------------------------------------------- */
/* Edge tab ("Zipfel") on the left that opens the navigation. */
.zipfel { position: fixed; z-index: 60; left: 0; top: 50%; transform: translateY(-50%); width: 22px; height: 88px; padding: 0; border: 0; background: var(--ap-akzent); color: var(--ap-auf-akzent); cursor: pointer; display: grid; place-items: center; transition: width .35s var(--ap-feder), background-color .2s; }
.zipfel:hover, .zipfel:focus-visible { width: 30px; background: var(--ap-akzent-dunkel); }
dialog.drawer { position: fixed; inset: 0 auto 0 0; margin: 0; width: min(380px, 88vw); height: 100dvh; max-height: none; max-width: none; padding: 0; border: 0; border-right: 1px solid var(--ap-linie-kraeftig); background: var(--ap-flaeche); color: var(--ap-text-fliess); display: none; flex-direction: column; transform: translateX(-100%); transition: transform .5s var(--ap-feder-weich); }
dialog.drawer[open] { display: flex; transform: none; }
dialog.drawer.is-closing { transform: translateX(-100%); transition: transform .26s var(--ap-ease); }
@starting-style { dialog.drawer[open] { transform: translateX(-100%); } }
dialog.drawer::backdrop { background: rgba(var(--ap-schatten-rgb), .38); }
.drawer__h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 16px 24px; border-bottom: 1px solid var(--ap-linie); min-height: var(--ap-kopf-hoehe); }
.demo { display: flex; flex-direction: column; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--ap-linie); }
.demo__row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--ap-text); cursor: pointer; }
.demo__row .switch { width: 44px; height: 24px; }
.demo__row .switch::after { width: 18px; height: 18px; }
.demo__row .switch:checked::after { transform: translateX(20px); }
.demo__fill { align-self: flex-start; border: 0; background: none; padding: 4px 0; color: var(--ap-link); font-size: 14px; cursor: pointer; }
.drawer__nav { display: flex; flex-direction: column; padding: 12px 0; overflow-y: auto; flex: 1; }
.drawer__nav a { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px 24px; text-decoration: none; color: inherit; position: relative; animation: rise .5s var(--ap-feder-weich) both; animation-delay: calc(var(--i) * 35ms + 80ms); }
.drawer__nav a:hover { background: var(--ap-flaeche-ruhig); color: inherit; }
.drawer__nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--ap-fach); }
.drawer__nav .ic { width: 40px; height: 40px; display: grid; place-items: center; background: var(--ap-akzent-weich); color: var(--ap-akzent-dunkel); }
.drawer__nav b { display: block; font-weight: 500; color: var(--ap-text); font-size: 15.5px; }
.drawer__nav small { display: block; font-size: 13px; color: var(--ap-text-leise); }
.drawer__nav hr { border: 0; border-top: 1px solid var(--ap-linie); margin: 10px 24px; }
.drawer__f { padding: 16px 24px; border-top: 1px solid var(--ap-linie); font-size: 13px; color: var(--ap-text-leise); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drawer__f b { color: var(--ap-text); font-weight: 500; }

/* Help flyout (hover) and the small "bling" when help appears. */
.helpfly { position: fixed; z-index: 120; background: var(--ap-flaeche); border: 1px solid var(--ap-linie-kraeftig); border-left: 3px solid var(--ap-akzent); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.6; color: var(--ap-text-fliess); box-shadow: 0 18px 40px -24px rgba(var(--ap-schatten-rgb), .45); pointer-events: none; opacity: 0; transform: translateX(-8px); transition: opacity .18s, transform .45s var(--ap-feder); }
.helpfly.is-on { opacity: 1; transform: none; pointer-events: auto; animation: bling .9s var(--ap-ease); }
.helpfly ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.helpfly .law { font-size: 12.5px; color: var(--ap-text-leise); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--ap-linie); }
@keyframes bling { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ap-signal) 55%, transparent), 0 18px 40px -24px rgba(var(--ap-schatten-rgb), .45); } 100% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--ap-signal) 0%, transparent), 0 18px 40px -24px rgba(var(--ap-schatten-rgb), .45); } }
.guide.is-bling { animation: bling .9s var(--ap-ease); }
.guide.is-bling .guide__h svg { animation: twinkle .7s var(--ap-feder); color: var(--ap-signal-dunkel); }
@keyframes twinkle { 0% { transform: scale(.4) rotate(-45deg); } 60% { transform: scale(1.25) rotate(10deg); } 100% { transform: none; } }
.help > summary:hover .q { background: var(--ap-link); color: var(--ap-auf-akzent); border-color: var(--ap-link); }
.help > summary .q { transition: background-color .2s, color .2s; }

/* --------------------------------------------------------------------------
   Tour (first visit) and coach marks
   The spotlight is one element whose huge spread shadow dims the page; JS
   moves it on a spring, so it glides from stop to stop and follows scrolling.
   Gold corner marks frame the stop, like crop marks on a map sheet.
   -------------------------------------------------------------------------- */
dialog.drawer.is-tour { z-index: 1150; }
.tour { position: fixed; inset: 0; z-index: 1200; pointer-events: none; }
.tour__veil { position: absolute; inset: 0; pointer-events: auto; cursor: default; }
.tour__spot {
  --c: var(--ap-signal);
  position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; will-change: transform, width, height;
  box-shadow: 0 0 0 200vmax rgba(var(--ap-schatten-rgb), 0);
  outline: 1px solid rgba(255, 255, 255, 0);
  transition: box-shadow .55s var(--ap-ease), outline-color .4s;
}
.tour.is-on .tour__spot { box-shadow: 0 0 0 200vmax rgba(var(--ap-schatten-rgb), .62); outline-color: rgba(255, 255, 255, .55); }
.tour__spot::before {
  content: ""; position: absolute; inset: -5px; opacity: 0; transition: opacity .3s;
  background:
    linear-gradient(var(--c), var(--c)) top left / 18px 3px, linear-gradient(var(--c), var(--c)) top left / 3px 18px,
    linear-gradient(var(--c), var(--c)) top right / 18px 3px, linear-gradient(var(--c), var(--c)) top right / 3px 18px,
    linear-gradient(var(--c), var(--c)) bottom left / 18px 3px, linear-gradient(var(--c), var(--c)) bottom left / 3px 18px,
    linear-gradient(var(--c), var(--c)) bottom right / 18px 3px, linear-gradient(var(--c), var(--c)) bottom right / 3px 18px;
  background-repeat: no-repeat;
}
.tour.is-on .tour__spot:not(.is-bare)::before { opacity: 1; }
.tour.is-on .tour__spot.is-bare { outline-color: transparent; }
.tour__spot::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--c); opacity: 0; }
.tour__spot.is-ping:not(.is-bare)::after { animation: tour-ping 1.2s var(--ap-ease) .42s; }
@keyframes tour-ping { 0% { opacity: .9; inset: 0; } 100% { opacity: 0; inset: -18px; } }

.tour__card {
  position: fixed; left: 0; top: 0; width: min(400px, calc(100vw - 24px)); pointer-events: auto;
  background: var(--ap-flaeche); border: 1px solid var(--ap-linie-kraeftig); border-top: 3px solid var(--ap-signal);
  padding: 18px 22px 18px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 30px 70px -34px rgba(var(--ap-schatten-rgb), .7);
  opacity: 0; transition: opacity .35s var(--ap-ease);
}
.tour.is-on .tour__card { opacity: 1; }
.tour__card.is-nudge { animation: tour-nudge .6s var(--ap-feder); }
@keyframes tour-nudge { 0%, 100% { translate: 0; } 20% { translate: 6px 0; } 45% { translate: -4px 0; } 70% { translate: 2px 0; } }
.tour__h { display: flex; align-items: center; gap: 12px; margin: -4px -8px -4px 0; }
.tour__n { font-family: var(--ap-schrift-mono); font-size: 12px; color: var(--ap-text-leise); margin-right: auto; font-variant-numeric: tabular-nums; }
.tour__c { animation: tour-in .5s var(--ap-feder-weich) both; }
.tour__c h2 { font-size: 26px; letter-spacing: -.015em; }
.tour__c p { margin: 8px 0 0; color: var(--ap-text-weich); font-size: 15.5px; line-height: 1.55; text-wrap: pretty; }
@keyframes tour-in { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }
.tour__bar { display: flex; gap: 4px; }
.tour__bar span { flex: 1; height: 4px; background: var(--ap-akzent-weich); position: relative; overflow: hidden; }
.tour__bar span.done { background: var(--ap-akzent); }
.tour__bar span.now::after { content: ""; position: absolute; inset: 0; background: var(--ap-signal); transform-origin: left; animation: tour-fill .6s var(--ap-ease) both; }
@keyframes tour-fill { from { transform: scaleX(0); } }
.tour__f { display: flex; align-items: center; gap: 8px; }
.tour__f .sp { flex: 1; }
.tour__f .btn { white-space: nowrap; }
.tour__skip { border: 0; background: none; padding: 6px 0; white-space: nowrap; color: var(--ap-text-leise); font-size: 13.5px; cursor: pointer; }
.tour__skip:hover { color: var(--ap-text); text-decoration: underline; text-underline-offset: 3px; }

/* Welcome card: the one big moment. Logo, a short statement, strata edge. */
.tour__card.is-intro { width: min(560px, calc(100vw - 24px)); padding: clamp(28px, 5vw, 48px) clamp(24px, 5vw, 48px) clamp(34px, 5vw, 52px); border-top: 0; gap: 32px; overflow: hidden; }
.tour__intro { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; animation: tour-in .7s var(--ap-feder-weich) .15s both; }
.tour__intro img { height: 65px; width: auto; margin-bottom: 18px; }
.tour__intro h2 { font-size: clamp(32px, 5vw, 46px); letter-spacing: -.025em; line-height: 1.05; }
.tour__intro p { margin: 0; color: var(--ap-text-weich); font-size: 17px; line-height: 1.55; max-width: 40ch; }
.tour__card.is-intro .tour__f { animation: tour-in .7s var(--ap-feder-weich) .3s both; }
.tour__strata { position: absolute; left: 0; right: 0; bottom: 0; display: flex; height: 8px; }
.tour__strata i { flex: var(--f, 1); transform-origin: left; animation: tour-fill .9s var(--ap-ease) both; }
.tour__strata i:nth-child(1) { background: var(--ap-schicht-1); --f: 3; animation-delay: .35s; }
.tour__strata i:nth-child(2) { background: var(--ap-schicht-2); --f: 1.4; animation-delay: .45s; }
.tour__strata i:nth-child(3) { background: var(--ap-schicht-3); --f: 2.2; animation-delay: .55s; }
.tour__strata i:nth-child(4) { background: var(--ap-schicht-4); --f: 1; animation-delay: .65s; }
.tour__strata i:nth-child(5) { background: var(--ap-schicht-5); --f: 1.8; animation-delay: .75s; }

@media (max-width: 560px) {
  .tour__card:not(.is-intro) { width: calc(100vw - 24px); }
  .tour__c h2 { font-size: 22px; }
}

/* Coach mark: ring + small card with a square notch pointing at the element. */
.coach { position: fixed; inset: 0; z-index: 1100; pointer-events: none; }
.coach__ring { position: fixed; left: 0; top: 0; border: 2px solid var(--ap-signal); opacity: 0; transition: opacity .3s; }
.coach.is-on .coach__ring { opacity: 1; animation: coach-pulse 2s var(--ap-ease) .4s infinite; }
@keyframes coach-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ap-signal) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--ap-signal) 0%, transparent); } }
.coach__card {
  --n: 24px;
  position: fixed; left: 0; top: 0; width: min(300px, calc(100vw - 32px)); pointer-events: auto;
  background: var(--ap-dunkel); color: var(--ap-auf-dunkel); padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 8px;
  font-size: 14px; line-height: 1.55; box-shadow: 0 22px 50px -26px rgba(var(--ap-schatten-rgb), .7);
  opacity: 0; scale: .96; transition: opacity .25s var(--ap-ease), scale .5s var(--ap-feder);
}
.coach.is-on .coach__card { opacity: 1; scale: 1; }
.coach__card p { margin: 0; text-wrap: pretty; }
.coach__t { display: flex; align-items: center; gap: 8px; color: var(--ap-signal); }
.coach__t b { color: var(--ap-auf-dunkel); font-weight: 500; font-size: 15px; }
.coach__ok { align-self: flex-end; border: 0; background: none; padding: 4px 0; color: var(--ap-signal); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.coach__ok:hover { text-decoration: underline; text-underline-offset: 3px; }
.coach__notch { position: absolute; width: 12px; height: 12px; background: var(--ap-dunkel); rotate: 45deg; }
.coach__card[data-side="right"] .coach__notch { left: -6px; top: calc(var(--n) - 6px); }
.coach__card[data-side="left"] .coach__notch { right: -6px; top: calc(var(--n) - 6px); }
.coach__card[data-side="below"] .coach__notch { top: -6px; left: calc(var(--n) - 6px); }
.coach__card[data-side="above"] .coach__notch { bottom: -6px; left: calc(var(--n) - 6px); }
.coach__card[data-side="none"] .coach__notch { display: none; }
