/* Mein Fest — Komponenten-Bibliothek (§5 des Design-Briefs)
 * Alle Farben/Radien/Schatten ausschließlich über Tokens aus theme.css. */

/* Icons: Standardgröße, Komponenten überschreiben gezielt ------------------ */
.pf-icon {
  width: 20px;
  height: 20px;
  flex: none;
}
.pf-btn .pf-icon {
  width: 18px;
  height: 18px;
}
.pf-topbar__back .pf-icon {
  width: 20px;
  height: 20px;
}

/* 1 · Topbar ------------------------------------------------------------- */
.pf-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: calc(56px + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.pf-topbar__back {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--touch);
  padding: 0 4px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.pf-topbar__back:hover {
  color: var(--accent-strong);
}
.pf-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch);
  height: var(--touch);
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.pf-iconbtn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.pf-iconbtn svg {
  width: 22px;
  height: 22px;
}

/* Karte (Basis) ----------------------------------------------------------- */
.pf-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  min-width: 0;
}
.pf-card--pad-lg {
  padding: 22px;
}

/* 2 · Modul-Karte ---------------------------------------------------------- */
.pf-module {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 140px;
  padding: 20px 20px 18px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
  overflow: hidden;
}
a.pf-module:hover,
button.pf-module:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: var(--text);
}
a.pf-module--dunkel:hover {
  color: #f6f2ea;
}
button.pf-module {
  text-align: left;
  font: inherit;
  cursor: pointer;
  width: 100%;
}
.pf-module__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.pf-module__icon {
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--text-2);
}
.pf-module__icon svg {
  width: 24px;
  height: 24px;
}
.pf-module__title {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
  letter-spacing: 0.02em;
  min-width: 0;
  overflow: hidden;
  /* bis zu zwei Zeilen statt „Menüwünsche eurer Gäs…" im 3-Spalten-Raster (UX A5) */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.pf-module__text {
  font-size: 15px;
  line-height: 22px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
}
.pf-module__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.pf-module__action {
  font-size: 15px;
  color: var(--accent);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-module__chev {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--text-3);
}
/* Varianten */
.pf-module--jetzt-dran {
  border: 1.5px solid var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%);
}
/* Gesperrt: gedämpft über Icon/Farbe statt Opacity — Text bleibt AA-lesbar (--text-2) */
.pf-module--gesperrt {
  background: var(--bg);
}
.pf-module--gesperrt .pf-module__title {
  color: var(--text-2);
}
.pf-module--gesperrt .pf-module__icon {
  color: var(--text-3);
}
.pf-module--gesperrt .pf-module__action {
  color: var(--text-2);
  font-weight: 400;
}
.pf-module--upsell {
  border: 1px dashed var(--line-strong);
  background: var(--bg);
}
.pf-module--dunkel {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #f6f2ea;
}
.pf-module--dunkel .pf-module__text {
  color: rgba(246, 242, 234, 0.78);
}
.pf-module--dunkel .pf-module__icon,
.pf-module--dunkel .pf-module__chev {
  color: rgba(246, 242, 234, 0.8);
}
.pf-module--dunkel .pf-module__action {
  color: #e8c36a;
}

/* 3 · Status-Chip ---------------------------------------------------------- */
/* HOEHE NICHT FESTNAGELN. `height: 28px` mit `line-height: 1` schnitt die
   Unterlaengen ab: Die Zeilenbox war 13 px hoch, der Text brauchte 15 (gemessen
   am 30.08. an „Eingereicht — Karnbachs prueft" und „Oeffnet am 01.11." —
   scrollHeight 15 vs clientHeight 13, bei overflow:hidden also unten weg).
   Es fiel nur bei Woertern MIT Unterlaenge auf (p, g, ü), deshalb mal ja, mal
   nein. Jetzt bestimmt der Inhalt die Hoehe, `min-height` haelt die Optik der
   28-px-Reihe, und `line-height: 1.35` gibt den Unterlaengen ihren Platz. */
.pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
  white-space: nowrap;
}
.pf-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-chip svg {
  flex: none;
  width: 14px;
  height: 14px;
}
.pf-chip--offen {
  color: var(--text-2);
  border-color: var(--line-strong);
}
.pf-chip--jetzt-dran {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.pf-chip--in-arbeit {
  background: var(--info-soft);
  border-color: transparent;
  color: var(--info);
}
.pf-chip--eingereicht {
  background: var(--warning-soft);
  border-color: transparent;
  color: var(--warning);
}
.pf-chip--freigegeben {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #fffdf8;
}
.pf-chip--upsell {
  border: 1px dashed var(--accent);
  color: var(--accent);
}
.pf-chip--neu {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-strong);
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
}

/* 4 · Buttons -------------------------------------------------------------- */
.pf-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  max-width: 100%;
}
/* Der Text im Knopf muss nachgeben koennen. Ohne das laeuft eine lange
   Beschriftung ueber den Rand hinaus, obwohl der Knopf selbst max-width traegt
   — gemessen am 28.08. auf 360 px. Gilt fuer alle Portal-Seiten. */
.pf-btn > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pf-btn:disabled,
.pf-btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}
.pf-btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}
.pf-btn--primary:hover:not(:disabled) {
  background: var(--accent-strong);
}
.pf-btn--success {
  background: var(--brand-green);
  color: #fffdf8;
}
.pf-btn--secondary {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}
.pf-btn--secondary:hover:not(:disabled) {
  background: var(--accent-soft);
}
.pf-btn--tertiary {
  background: transparent;
  color: var(--accent);
  padding: 0 8px;
  min-height: var(--touch);
}
.pf-btn--tertiary:hover:not(:disabled) {
  color: var(--accent-strong);
  text-decoration: underline;
}
.pf-btn--danger {
  background: transparent;
  color: var(--danger);
  padding: 0 8px;
  min-height: var(--touch);
}
.pf-btn--block {
  width: 100%;
}
.pf-btn--sm {
  min-height: var(--touch); /* 44 px Touch-Regel (CLAUDE.md) */
  padding: 0 16px;
  font-size: 15px;
}
.pf-btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}
.pf-btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--on-accent) transparent var(--on-accent) transparent;
  animation: pf-spin 0.8s linear infinite;
}
.pf-btn--secondary.is-loading::after,
.pf-btn--tertiary.is-loading::after {
  border-color: var(--accent) transparent var(--accent) transparent;
}
@keyframes pf-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 5 · Fortschritts-Leiste -------------------------------------------------- */
.pf-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pf-progress__label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--text-2);
}
.pf-progress__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
}
.pf-progress__seg {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
}
.pf-progress__seg.is-done {
  background: var(--accent);
}
.pf-progress__seg.is-active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* 6 · Donut ---------------------------------------------------------------- */
.pf-donut {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}
.pf-donut svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.pf-donut__track {
  fill: none;
  stroke: var(--line);
  stroke-width: 10;
}
.pf-donut__arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease-out;
}
.pf-donut__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}
.pf-donut__value {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 48px;
  font-weight: 500;
  color: var(--text);
}
.pf-donut__label {
  font-size: 14px;
  line-height: 18px;
  color: var(--text-2);
}
.pf-donut--sm {
  width: 92px;
  height: 92px;
}
.pf-donut--sm .pf-donut__value {
  font-size: 18px;
  line-height: 22px;
}
.pf-donut--sm .pf-donut__label {
  display: none;
}

/* 7 · Balken-Reihe --------------------------------------------------------- */
.pf-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pf-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
}
/* Textspalte: muss schrumpfen dürfen, sonst schiebt ein langer Gerichtsname die Zahl raus */
.pf-bar__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pf-bar__label {
  display: block;
  font-size: 15px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Beilagen dezent unter dem Gerichtsnamen — höchstens zwei Zeilen, nie über den Rand */
.pf-bar__sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-width: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.pf-bar__value {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--text-2);
  flex: none;
  align-self: start;
}
.pf-bar__track {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.pf-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.6s ease-out;
}
.pf-bar:nth-child(2) .pf-bar__fill {
  opacity: 0.7;
}
.pf-bar:nth-child(3) .pf-bar__fill {
  opacity: 0.45;
}
.pf-bar:nth-child(n + 4) .pf-bar__fill {
  opacity: 0.3;
}

/* 8 · Aufklapp-Liste (Accordion) ------------------------------------------- */
.pf-acc {
  border-top: 1px solid var(--line);
}
.pf-acc__item {
  border-bottom: 1px solid var(--line);
}
.pf-acc__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}
.pf-acc__head > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-acc__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.pf-acc__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}
.pf-acc__chev {
  width: 18px;
  height: 18px;
  color: var(--text-3);
  transition: transform 0.2s ease;
}
.pf-acc__item.is-open .pf-acc__chev {
  transform: rotate(180deg);
}
.pf-acc__body {
  display: none;
  padding: 0 0 12px;
}
.pf-acc__item.is-open .pf-acc__body {
  display: block;
}
.pf-acc__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 0;
  border-top: 1px dashed var(--line);
}
.pf-acc__row:first-child {
  border-top: none;
}
.pf-acc__row-name {
  font-family: var(--font-name);
  font-size: 17px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-acc__row-note {
  font-size: 14px;
  color: var(--text-2);
  text-align: right;
  min-width: 0;
  flex: 1;
}
.pf-acc__text {
  font-size: 15px;
  line-height: 22px;
  color: var(--text-2);
  margin: 0;
}

/* 9 · Bottom-Sheet / Modal ------------------------------------------------ */
.pf-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--backdrop);
  animation: pf-fade 0.18s ease-out;
}
.pf-sheet {
  width: 100%;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  animation: pf-slide-up 0.22s ease-out;
  overflow: hidden;
}
.pf-sheet__grabber {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 10px auto 0;
}
.pf-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 14px;
  background: var(--surface-2);
  margin-top: 10px;
}
.pf-sheet__title {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-sheet__body {
  padding: 20px;
  overflow: auto;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}
.pf-sheet__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 20px calc(16px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
@media (min-width: 820px) {
  .pf-sheet-backdrop {
    align-items: center;
    padding: 24px;
  }
  .pf-sheet {
    width: min(520px, 100%);
    max-height: calc(100vh - 96px);
    border-radius: var(--radius-lg);
    animation: pf-pop 0.18s ease-out;
  }
  .pf-sheet__grabber {
    display: none;
  }
  .pf-sheet__head {
    margin-top: 0;
    padding-top: 18px;
  }
  .pf-sheet__actions {
    flex-direction: row-reverse;
    padding-bottom: 16px;
  }
  .pf-sheet__actions .pf-btn {
    flex: 1;
  }
}
@keyframes pf-slide-up {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes pf-pop {
  from {
    transform: scale(0.97);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes pf-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
body.pf-no-scroll {
  overflow: hidden;
}

/* 10 · Stepper ------------------------------------------------------------ */
.pf-stepper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.pf-stepper__label {
  font-size: 13px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}
.pf-stepper__dots {
  display: flex;
  align-items: center;
}
.pf-stepper__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: none;
}
.pf-stepper__dot.is-done {
  background: var(--accent);
}
.pf-stepper__dot.is-active {
  width: 10px;
  height: 10px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.pf-stepper__line {
  width: 32px;
  height: 1px;
  background: var(--line-strong);
}
.pf-stepper__line.is-done {
  background: var(--accent);
}

/* 11 · Banner „Stand von …" ----------------------------------------------- */
.pf-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 16px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  line-height: 18px;
  border-bottom: 1px solid var(--line);
}
.pf-banner__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
}
.pf-banner--ok .pf-banner__dot {
  background: var(--success);
}

/* 12 · Kontakt-Karte ------------------------------------------------------ */
.pf-contact {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px 14px;
  align-items: center;
}
.pf-contact__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-green);
  color: #f6f2ea;
  font-family: var(--font-display);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pf-contact__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pf-contact__name {
  font-family: var(--font-name);
  font-size: 18px;
  line-height: 24px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-contact__role {
  font-size: 13px;
  color: var(--text-2);
}
.pf-contact__actions {
  display: flex;
  gap: 6px;
}
.pf-contact__actions .pf-iconbtn {
  border-color: var(--line);
  color: var(--accent);
}
.pf-contact__hint {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--text-2);
  margin: -4px 0 0;
}
.pf-contact__details {
  grid-column: 1 / -1;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-2);
  margin: -2px 0 0;
  overflow-wrap: anywhere;
}
.pf-contact__details a {
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  line-height: 28px;
  /* 44 px Tippfläche ohne mehr Zeilenabstand: Innenabstand rein, Außenabstand raus (UX A5) */
  padding: 8px 0;
  margin: -8px 0;
}

/* 13 · Leer-Zustand ------------------------------------------------------- */
.pf-empty {
  text-align: center;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.pf-empty__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px dashed var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}
.pf-empty__icon svg {
  width: 28px;
  height: 28px;
}
.pf-empty__title {
  font-size: 16px;
  font-weight: 500;
}
.pf-empty__text {
  font-size: 14px;
  color: var(--text-2);
  max-width: 36ch;
  margin: 0;
}

/* 14 · Toast -------------------------------------------------------------- */
.pf-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-lg);
  animation: pf-slide-up 0.2s ease-out;
}
.pf-toast.is-leaving {
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* 15 · Fehler-Seite ------------------------------------------------------- */
.pf-error {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 16px;
}
.pf-error__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pf-error__text {
  color: var(--text-2);
  margin: 0;
  max-width: 40ch;
}

/* 16 · Lade-Platzhalter (statisch im HTML, bis boot() das Manifest hat) ---- */
.pf-loading {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-2);
  font-size: 15px;
}
.pf-loading__spin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: pf-spin 0.9s linear infinite;
}

/* Wrapper für das Stand-von-Banner in den Seiten */
.pf-stale {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.pf-stale .pf-banner {
  border-bottom: none;
}

/* Hilfen ----------------------------------------------------------------- */
.pf-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .pf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}
@media (min-width: 1024px) {
  .pf-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.pf-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.pf-hint {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 15px;
  line-height: 22px;
}
.pf-placeholder {
  position: relative;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.pf-placeholder::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  opacity: 0.7;
  pointer-events: none;
}
.pf-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Demo-Leisten (Artboard-Navigation + Zustände) ──────────────────────────
 *
 * NUR in der Vorschau sichtbar, nie Teil der Gäste-UI.
 *
 * Sie stehen hier und nicht mehr je Seite im <style>: Bis zum 28.08. brachte
 * jede Seite die Regeln selbst mit — und SECHS von dreizehn hatten sie nicht
 * (07, 09, 10, 11, 12, 13). Dort fiel die Leiste in den Blockfluss und lief bei
 * 390 px über den Rand hinaus (gemessen 432 px). Einmal hier gepflegt, gilt sie
 * überall, auch auf der nächsten neuen Seite.
 *
 * `min-width: 0` auf den Links ist der eigentliche Umbruch-Fix: Ohne ihn
 * behält ein Flex-Kind seine Inhaltsbreite, und ein langer Name wie
 * „Fest im Detail" schiebt die Zeile auf, statt umzubrechen.
 */
.ab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ab-nav a {
  text-decoration: none;
  color: var(--text-2);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
.ab-nav a.is-active { color: var(--accent); font-weight: 600; }
.ab-nav .ab-tag {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--accent);
  min-width: 0;
}
.ab-states {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--text-3);
  border-bottom: 1px dashed var(--line);
  background: var(--bg);
  max-width: 100%;
  min-width: 0;
}
.ab-states button {
  font: inherit;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  min-width: 0;
}
.ab-states button.is-on { border-color: var(--accent); color: var(--accent); }

/* Auf dem Handy hat die Leiste keinen Platz für 14 Namen nebeneinander:
 * eine eigene Scrollfläche ist dort ehrlicher als ein vierzeiliger Block, der
 * die halbe Seite verdeckt. Der Umbruch bleibt ab Tablet. */
@media (max-width: 639px) {
  .ab-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0 12px;
  }
  .ab-nav a, .ab-nav .ab-tag { flex: none; white-space: nowrap; }
  .ab-nav > span:last-child { position: sticky; right: 0; background: var(--surface); padding-left: 8px; }
}
