/* Redesign: überwiegend Schwarz/Weiß, Orange (--accent, unverändert von
   vorher) nur noch als gezielte Akzentfarbe für CTAs/Highlights – nicht
   mehr als warmer Grundton der ganzen Palette (Grautöne sind jetzt neutral
   statt bräunlich). */
/* Schriften liegen seit 10/2026 bei uns statt bei Google Fonts: Der Abruf von
   Google schickte bei jedem Seitenaufruf die IP-Adresse der Nutzer dorthin
   (stand nicht in der Datenschutzerklärung), und die CSP bräuchte sonst eine
   Ausnahme. Seit 27.10.2026 Padauk statt Inter/Space Grotesk (Wunsch des
   Betreibers: weniger nach KI-Vorlage). Es gibt nur 400 und 700; 500 fällt
   auf 400, 600 und 800 auf 700. Nur Latin (deckt Deutsch samt Umlauten und
   „“ ab), aus @fontsource/padauk 5.3.0. Geändert: Leerzeichen (U+0020,
   U+00A0) von 0,37 bzw. 0,51 em (fett) auf 0,27 em, mit fontTools gesetzt –
   Padauk ist für birmanische Schrift gebaut, im Lateinischen sahen die
   Wortabstände löchrig aus. Wer die Dateien neu holt, muss das wiederholen.
   size-adjust 112 %: Padauks Kleinbuchstaben sind niedriger als bei Inter
   (x-Höhe 0,45 statt 0,55 em), ohne Ausgleich wurde der Fließtext zu klein.
   Lizenz: SIL Open Font License 1.1 (ohne reservierten Namen, Änderung
   erlaubt), Text in docs/schriften/. */
@font-face {
  font-family: "Padauk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("padauk-400.woff2") format("woff2");
  size-adjust: 112%;
}

@font-face {
  font-family: "Padauk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("padauk-700.woff2") format("woff2");
  size-adjust: 112%;
}

:root {
  --bg: #000000;
  --surface: #0D0D0D;
  --surface-2: #0B0B0D;
  --border: #26262B;
  --border-soft: #202020;
  --text: #FAFAFA;
  --text-muted: #9A9A9A;
  --text-dim: #7A7A7A;
  /* Dunkleres Orange seit 28.10.2026 (Wunsch des Betreibers, vorher #F47320
     und #FF9142). Das Logo ist ein Bild und behält das alte Orange. */
  --accent: #C9500F;
  --accent-2: #DE6A26;
  /* Dieselben Farben als Kanäle, für halbtransparente Flächen, Ränder und
     Glows: rgb(var(--accent-rgb) / 0.15). So ändert sich das Orange an einer
     Stelle statt an zwei Dutzend. */
  --accent-rgb: 201 80 15;
  --accent-2-rgb: 222 106 38;
  --accent-text: #FFFFFF;
  --success: #6FCF7A;
  --danger: #E5484D;
  --warning: #F5C542;

  --font-heading: "Padauk", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: "Padauk", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 24px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.6);
  --shadow-card-hover: 0 6px 28px rgba(0, 0, 0, 0.7);

  /* Flächen aller Karten: Tönung, leichter Glanz von oben, feine Lichtkante
     oben (die Namen glass-* stammen aus der früheren Glas-Optik). */
  /* Glanz und Tönung getrennt, damit Elemente mit eigenem Hintergrundbild
     (der Pfeil der Auswahllisten) den Glanz als zusätzliche Ebene bekommen. */
  --glass-gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 45%);
  /* Look „A – Erhoben“ seit 29.10.2026 (Wunsch des Betreibers, aus der
     Vorschau): deckende Flächen, etwas heller als der schwarze Hintergrund,
     damit sich die Fenster abheben. Vorher fast schwarzes, durchscheinendes
     Glas (Tönung schwarz bei 0.55), durch das das Flimmern schien. */
  --glass-tint: #141416;
  --glass-bg: var(--glass-gloss), var(--glass-tint);
  /* Dunklere Variante für Fenster, die über anderem Inhalt liegen
     (Bug-Melden): Dort darf der Text dahinter nicht durchscheinen. */
  --glass-bg-strong:
    linear-gradient(
      155deg,
      rgba(255, 255, 255, 0.14) 0%,
      rgba(255, 255, 255, 0.04) 35%,
      rgba(255, 255, 255, 0.02) 65%,
      rgba(255, 255, 255, 0.06) 100%
    ),
    rgba(20, 20, 20, 0.82);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(30px) saturate(190%);
  --glass-rim: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --glass-shadow: var(--glass-rim), 0 14px 34px rgba(0, 0, 0, 0.6);
  --glass-shadow-hover: var(--glass-rim), 0 28px 70px rgba(0, 0, 0, 0.65), 0 4px 14px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

/* Browser geben Knöpfen und Feldern ihre eigene Schrift (Chromium Arial,
   Safari die Systemschrift) – bis 27.10.2026 liefen so 95 von 123
   Bedienelementen der App nicht in der Hausschrift. */
button,
input,
select,
textarea {
  font-family: inherit;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Ambient-Glow-Hintergrund — auf allen App-Seiten aktiv (index/login/admin
   binden `<div class="bg-glow">` ein); die Landing bringt ihren eigenen mit.
   Liegt fix hinter dem Inhalt; der Inhalt wird per z-index:1 darübergehoben,
   da die App-Seiten keinen eigenen Wrapper haben. */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-glow::before,
.bg-glow::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.bg-glow::before {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, rgb(var(--accent-rgb) / 0.26), transparent 70%);
}

.bg-glow::after {
  width: 460px;
  height: 460px;
  top: 320px;
  right: -160px;
  background: radial-gradient(circle, rgba(255, 178, 90, 0.16), transparent 70%);
}

@media (prefers-reduced-motion: no-preference) {
  .bg-glow::before { animation: glow-float-a 16s ease-in-out infinite; }
  .bg-glow::after { animation: glow-float-b 20s ease-in-out infinite; }
}

/* Wechsel zwischen ganzen Seiten (Startseite → Warteliste, Login → App …)
   überblenden statt hart umschalten. Reines CSS; Browser ohne Unterstützung
   wechseln wie bisher. Die Übergänge innerhalb der App stehen bei view-fade. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 0.3s; }
}

@keyframes glow-float-a { 50% { transform: translate(60px, 50px) scale(1.08); } }
@keyframes glow-float-b { 50% { transform: translate(-50px, 40px) scale(1.12); } }

/* Inhalt über den Glow heben (Seiten haben keinen eigenen Wrapper). */
.site-header,
.container,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Start-Splash (app.html): Vollbild-Logo beim Öffnen, blendet aus, sobald die
   App geladen und die Session geprüft ist – gibt der installierten PWA ein
   natives Startgefühl. */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  background: var(--bg);
  transition: opacity 0.4s ease;
}

.app-splash.hidden {
  opacity: 0;
  pointer-events: none;
}

.app-splash-logo img {
  width: 190px;
  height: auto;
  display: block;
}

.app-splash-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .app-splash-spinner {
    animation: none;
  }
}

.site-header {
  text-align: center;
  padding: var(--space-8) var(--space-4) var(--space-4);
  /* In der installierten PWA läuft die Seite unter die Statusleiste
     (viewport-fit=cover). Ohne den Safe-Area-Abstand sitzt das Logo im
     Bereich, den iOS oben weichzeichnet. Im Browser ist der Wert 0, dort
     bleibt es bei var(--space-8). */
  padding-top: max(var(--space-8), calc(env(safe-area-inset-top) + var(--space-6)));
}

.logo {
  text-align: center;
}

/* Hochformat-Logo (Zeichen über Schriftzug): schmaler als das alte
   Querformat, damit der Kopf nicht zu hoch wird. */
.logo img {
  width: 150px;
  height: auto;
  display: inline-block;
}

.tagline {
  color: var(--text-muted);
  margin-top: var(--space-2);
  font-size: 1rem;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--glass-shadow);
}

.form-card {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

/* Namensabfrage beim ersten Start mittig im Bildschirm (Wunsch des Betreibers,
   30.10.2026). Abstand statt position: fixed – sonst verdeckt auf dem iPhone
   die Tastatur das Feld. 190px ≈ halbe Kartenhöhe plus Kopf über main. */
#handle-capture:not([hidden]) {
  margin-top: max(0px, calc(50vh - 190px));
  margin-top: max(0px, calc(50svh - 190px));
  text-align: center;
}

#handle-capture input {
  text-align: center;
}

/* Auf der Namensabfrage stünde der Footer sonst direkt unter der Karte statt
   am unteren Rand. Nicht für die Geburtsdatum-Abfrage: Deren Karte ist so hoch,
   dass ein fester Footer sie auf kleinen iPhones (667 px) überdeckt. */
body:has(#handle-capture:not([hidden])) .site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
}

/* Login: Clerk bringt seine eigene Karte mit (dunkler Idevo Forge-Hintergrund).
   Deshalb keine zweite .form-card drumherum, sondern nur zentrieren – sonst
   entsteht eine Karte-in-Karte und der Inhalt sitzt links. */
.clerk-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

/* Mount-Punkt auf Kartenbreite begrenzen; align-items:center der .clerk-wrap
   zentriert ihn. Unabhängig von Clerks interner DOM-Struktur (die Karte füllt
   diesen Container). Auf schmalen Screens schrumpft er über max-width. */
#clerk-auth {
  width: 420px;
  max-width: 100%;
}

/* Umschalter Einloggen / Registrieren über der Clerk-Karte. */
.auth-toggle {
  display: flex;
  gap: var(--space-1);
  width: 420px;
  max-width: 100%;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-tab.is-active {
  background: var(--accent);
  color: var(--accent-text);
}

.clerk-wrap .hint {
  max-width: 400px;
  text-align: center;
}

.field {
  margin-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Zwei Felder nebeneinander (Plattform + Länge); stapelt auf schmalen Screens. */
.field-row {
  display: flex;
  gap: var(--space-4);
}

.field-row .field {
  flex: 1;
  min-width: 0;
}

label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.label-optional {
  font-weight: 400;
  color: var(--text-dim);
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.15);
}

/* Geburtsdatum beim ersten Start: drei Rollen mit Scroll-Snap. Die Zeile in
   der Mitte ist die Auswahl (Band per ::before); oben und unten blendet eine
   Maske aus. Höhe der Zeile = --wheel-row, sichtbar sind fünf. */
.date-wheel {
  --wheel-row: 40px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.6fr 1.2fr;
  gap: var(--space-2);
  height: calc(var(--wheel-row) * 5);
  margin: var(--space-4) 0;
}

.date-wheel::before {
  content: "";
  position: absolute;
  inset: calc(var(--wheel-row) * 2) 0 auto;
  height: var(--wheel-row);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  pointer-events: none;
}

.wheel {
  position: relative;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: calc(var(--wheel-row) * 2) 0;
  -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
  mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
  outline: none;
}

.wheel::-webkit-scrollbar {
  display: none;
}

.wheel:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
  border-radius: var(--radius-sm);
}

.wheel-option {
  height: var(--wheel-row);
  line-height: var(--wheel-row);
  text-align: center;
  scroll-snap-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  user-select: none;
}

.wheel-option[aria-selected="true"] {
  color: var(--text);
  font-weight: 600;
}

.underage-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.underage-actions button {
  width: 100%;
}

/* Content-Tab, Format "Bild": Die Videolänge gilt dort nicht. */
select:disabled,
.field:has(select:disabled) label {
  opacity: 0.4;
  cursor: not-allowed;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.primary-btn {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-text);
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 20px rgb(var(--accent-rgb) / 0.18);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgb(var(--accent-rgb) / 0.3);
}

/* Sichtbares Nachgeben beim Antippen – auf dem iPhone gibt es kein Hover. */
.primary-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: var(--space-4) 0 0;
}

.status-area {
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.status-area.error {
  color: var(--danger);
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  min-height: 40vh;
  color: var(--text-muted);
}

.loading-view p {
  margin: 0;
  font-size: 0.95rem;
}

.spinner-lg {
  width: 56px;
  height: 56px;
  border-width: 4px;
}

.top-back-btn {
  position: fixed;
  /* viewport-fit=cover lässt die Seite unter die Statusleiste laufen. Der
     Header schiebt seinen Inhalt per padding darunter weg, ein fixed
     positionierter Button hängt aber am Viewport – ohne den Safe-Area-Abstand
     klebt er auf dem iPhone hinter der Uhr und ist nicht antippbar. */
  /* Gleiche Höhe und Glas-Optik wie die Glocke rechts (.notif-btn). */
  top: calc(env(safe-area-inset-top) + var(--space-5));
  left: var(--space-4);
  z-index: 20;
  height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.top-back-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}

.idea-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--glass-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.idea-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-hover);
}

.idea-card .idea-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.idea-card .idea-number {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.copy-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.idea-card h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

.idea-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.idea-body[hidden] {
  display: none;
}

/* Hook als Aufklapper der Ergebnis-Karte (makeCardToggle in script.js). */
.idea-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.idea-toggle::after {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 0.5em;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.idea-toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

.idea-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  .idea-toggle::after {
    transition: none;
  }
}

.idea-card .section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: var(--space-1);
}

.idea-card ol {
  margin: 0;
  padding-left: var(--space-5);
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.idea-card .cta-box {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: 0.92rem;
  border-left: 3px solid var(--success);
}

.idea-card .trend-box {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-4);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
}

.idea-card .idea-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.angle-badge,
.score-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px var(--space-2);
  border-radius: 999px;
  white-space: nowrap;
}

.angle-badge {
  color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.12);
  border: 1px solid rgb(var(--accent-rgb) / 0.35);
}

.score-badge {
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.idea-card .warum-line {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.like-btn {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
  margin-top: var(--space-2);
}

.like-btn:hover:not(:disabled):not(.liked) {
  border-color: var(--accent);
  color: var(--accent);
}

.like-btn.liked {
  border-color: var(--accent);
  color: var(--accent);
  cursor: default;
}

.like-btn:disabled:not(.liked) {
  opacity: 0.5;
  cursor: not-allowed;
}









.locked-card {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}

.locked-card h2 {
  margin-top: 0;
}

.locked-card .coming-soon {
  font-weight: 700;
  color: var(--accent);
}

.reset-info {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.locked-card .pro-benefits {
  display: inline-block;
  text-align: left;
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
  line-height: 1.6;
}

.locked-card .hint {
  margin-bottom: var(--space-3);
}

#pro-waitlist-status {
  margin-top: var(--space-3);
}

/* Gehört zur Auswahl darüber: Der negative Rand hebt den Flex-Abstand der
   View (gap) auf, sonst schwebt die Zeile allein zwischen den Blöcken. */
.quota-info {
  margin: calc(-1 * var(--space-6)) 0 0;
}

.site-footer {
  text-align: center;
  padding: var(--space-5) var(--space-4) var(--space-7);
  color: var(--text-dim);
  font-size: 0.85rem;
}

textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / 0.15);
}

.checkbox-field {
  margin-bottom: var(--space-5);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checkbox-label a {
  color: var(--accent);
  text-decoration: underline;
}

.secondary-btn {
  width: 100%;
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.secondary-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.feedback-form {
  margin-top: var(--space-4);
}

.feedback-status {
  margin: var(--space-4) 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--success);
}

.feedback-status.error {
  color: var(--danger);
}

.history-card {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.history-content {
  margin-top: var(--space-4);
}

.history-item-hook {
  font-weight: 600;
  font-size: 0.95rem;
}

.history-hook-list {
  margin: var(--space-2) 0 0;
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: 0.9rem;
}

.history-empty {
  color: var(--text-dim);
  font-size: 0.88rem;
}

.history-status {
  margin: 0 0 var(--space-3);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.history-status.error {
  color: var(--danger);
}

/* ---- Vault (Kalender + Archiv) ------------------------------------- */

/* Push-Erinnerungen: Zeile über den Vault-Untertabs. Der Button behält seine
   Grundoptik (.secondary-btn), schrumpft hier aber auf Inhaltsbreite. */
/* Profil: Clerk-Avatar links, Name und E-Mail daneben. */
.profile-account {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.profile-account-copy {
  min-width: 0;
}

.profile-handle {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.profile-email {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.profile-handle-form .field {
  margin-bottom: var(--space-3);
}

.profile-links {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-top: 1px solid var(--border-soft);
  padding-top: var(--space-4);
}

.profile-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.profile-links a:hover {
  color: var(--accent);
}

.profile-subheading {
  margin: var(--space-6) 0 var(--space-1);
  font-size: 1rem;
}

.profile-subhint {
  margin-top: 0;
  margin-bottom: var(--space-4);
}

/* Nischen im Profil: Chips plus eigene Nische; fieldset/legend, damit alles
   auch fuer Screenreader als eine Gruppe zusammenhaengt. */
.profile-nischen {
  border: none;
  margin: 0 0 var(--space-5);
  padding: 0;
  /* fieldset ist sonst mindestens so breit wie sein Inhalt – die Chips liefen
     seitlich aus dem Bildschirm. */
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.profile-nischen legend {
  padding: 0;
  margin-bottom: var(--space-2);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.profile-nischen .wizard-chips {
  margin-bottom: var(--space-2);
}

.niche-add-row {
  display: flex;
  gap: var(--space-2);
}

.niche-add-row input {
  flex: 1;
  min-width: 0;
}

.niche-add-row .secondary-btn {
  width: auto;
}

/* Schnellauswahl unter dem Nischenfeld im Create-Tab. */
.niche-favorites {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.niche-chip {
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.niche-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Loesch-Bereich: optisch abgesetzt, damit er nicht wie eine normale
   Einstellung aussieht. Rot bleibt Akzent, nicht Flaeche. */
.danger-zone h3 {
  color: var(--danger);
}

.danger-btn {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.danger-btn:hover:not(:disabled) {
  background: var(--danger);
  color: var(--accent-text);
}

.danger-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.account-delete-confirm {
  margin-top: var(--space-4);
}

/* FAQ als natives details/summary: aufklappbar ohne JavaScript, per
   Tastatur bedienbar und fuer Screenreader korrekt ausgezeichnet. */
.faq {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.faq-item {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.faq-item summary {
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

/* Eigener Pfeil statt des Browser-Dreiecks (Safari zeigt es anders als
   Chrome); ::-webkit-details-marker blendet Safaris Variante aus. */
.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  margin-left: auto;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  margin: 0;
  padding: 0 var(--space-4) var(--space-4);
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Nur fuer Screenreader: Der Sterne-Text ("3 von 5 Sternen") bleibt im
   Baum, verschwindet aber optisch hinter dem Stern-Symbol. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.stars-field {
  border: none;
  margin: 0 0 var(--space-5);
  padding: 0;
}

.stars-field legend {
  padding: 0;
  margin-bottom: var(--space-2);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stars {
  display: flex;
  gap: var(--space-1);
}

.star {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
}

/* Das Radio bleibt im Baum (Tastatur, Screenreader), nur unsichtbar. */
.star input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.star-visual svg {
  width: 28px;
  height: 28px;
  fill: var(--surface-2);
  stroke: var(--border);
  stroke-width: 1.5;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

/* Alle Sterne bis zum gewaehlten einfaerben. data-value setzt das JS. */
.stars[data-value="1"] .star:nth-child(-n + 1) .star-visual svg,
.stars[data-value="2"] .star:nth-child(-n + 2) .star-visual svg,
.stars[data-value="3"] .star:nth-child(-n + 3) .star-visual svg,
.stars[data-value="4"] .star:nth-child(-n + 4) .star-visual svg,
.stars[data-value="5"] .star:nth-child(-n + 5) .star-visual svg {
  fill: var(--accent);
  stroke: var(--accent);
}

/* Fokus muss sichtbar sein, obwohl das Radio selbst unsichtbar ist. */
.star input:focus-visible + .star-visual svg {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-row input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

/* Bug-Knopf: sitzt ueber der Bottom-Nav (die ist fix, bis zu 420px breit) und
   respektiert die Safe Area, damit er auf dem iPhone nicht im Home-Indikator
   klebt. */
.bug-fab {
  position: fixed;
  right: var(--space-4);
  bottom: calc(104px + env(safe-area-inset-bottom));
  z-index: 31;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 52px;
  height: 52px;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(24, 24, 24, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.bug-fab svg {
  width: 18px;
  height: 18px;
}

.bug-fab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.bug-panel {
  position: fixed;
  left: var(--space-4);
  right: var(--space-4);
  bottom: calc(168px + env(safe-area-inset-bottom));
  z-index: 32;
  max-width: 420px;
  margin: 0 auto;
  padding: var(--space-5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow-hover);
  /* Mit Bildern wird das Fenster höher: oben Platz lassen, sonst scrollen. */
  max-height: calc(100dvh - 168px - env(safe-area-inset-bottom) - env(safe-area-inset-top) - var(--space-5));
  overflow-y: auto;
}

.bug-panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.bug-shots {
  margin-bottom: var(--space-4);
}

.bug-shots .hint {
  margin: var(--space-1) 0 0;
}

.bug-shot-list {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.bug-shot-list:empty {
  display: none;
}

.bug-shot {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.bug-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bug-shot-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.bug-shot-remove:focus-visible {
  outline: 2px solid var(--accent);
}

.bug-shot-add {
  width: 100%;
}

.push-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.push-copy {
  flex: 1;
  min-width: 0;
}

.push-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.push-hint {
  margin: 2px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-dim);
}

/* Schalter (iOS-Art): der Push-Hauptschalter ist ein <button role="switch">
   mit aria-checked, die Kategorien sind Checkboxen mit role="switch". Beide
   teilen Maß und Farben. */
.switch,
.switch-input {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface-2);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.switch::after,
.switch-input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s ease;
}

.switch[aria-checked="true"],
.switch-input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.switch[aria-checked="true"]::after,
.switch-input:checked::after {
  transform: translateX(20px);
}

.switch:disabled,
.switch-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.switch:focus-visible,
.switch-input:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .switch,
  .switch-input,
  .switch::after,
  .switch-input::after {
    transition: none;
  }
}

.notif-categories[hidden] {
  display: none;
}

/* Generische Tab-Leiste: Create-Untertabs (Hooks/Ideas/Story),
   Refine-Untermodi (Analysieren/Verbessern) und Vault (Kalender/Archiv)
   teilen sich dieses eine Muster. */
.sub-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.sub-tab {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-rim);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.sub-tab.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.vault-mini-btn {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.vault-mini-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Vault: ruhige Liste mit Status-Streifen ---------------------------- */

.vault-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.vault-chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  margin-top: var(--space-3);
  padding-bottom: 2px;
  scrollbar-width: none;
}

.vault-chips::-webkit-scrollbar {
  display: none;
}

.vault-chip {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 var(--space-3);
  /* Glas wie Karten und Knöpfe: Die Chips laufen beim Scrollen über das
     Logo im Hintergrund und zeichnen es dann ebenfalls weich. */
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vault-chip svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vault-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Streak (Vault, 10/2026): Glas-Karte über den Filtern, Monat aufklappbar. */
.streak-card {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}

.streak-card p {
  margin: 0;
}

.streak-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.streak-flame {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgb(var(--accent-rgb) / 0.14);
  border: 1px solid rgb(var(--accent-rgb) / 0.35);
}

.streak-flame svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.streak-count {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.streak-best {
  margin-top: var(--space-1);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.streak-week {
  margin-top: var(--space-3);
}

.streak-week-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.streak-week-row span:last-child {
  color: var(--text);
  font-weight: 600;
}

.streak-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.streak-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.3s ease;
}

.streak-hint {
  margin-top: var(--space-2);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Tippen auf Serie und Wochenstand klappt den Monat auf: Der Knopf liegt
   unsichtbar über diesem Teil, bleibt aber für Tastatur und Screenreader ein
   echter Knopf. Der Pfeil oben rechts zeigt, dass es aufgeht. */
.streak-summary {
  position: relative;
}

.streak-toggle {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
}

.streak-toggle::after {
  content: "";
  position: absolute;
  top: var(--space-2);
  right: var(--space-1);
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.streak-toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

.streak-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .streak-toggle::after {
    transition: none;
  }
}

.streak-month {
  margin-top: var(--space-4);
}

.streak-month[hidden] {
  display: none;
}

.streak-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.streak-month-head strong {
  font-size: 0.95rem;
}

.streak-arrow {
  width: 44px;
  height: 44px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

.streak-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr) 20px;
  gap: 6px 4px;
  align-items: center;
  text-align: center;
  /* Waagrecht wischen blättert den Monat (script.js), senkrecht scrollt. */
  touch-action: pan-y;
  user-select: none;
}

.streak-weekday {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
}

.streak-day {
  display: grid;
  place-items: center;
  height: 34px;
  border-radius: 50%;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.streak-day.is-empty {
  visibility: hidden;
}

.streak-day.is-planned {
  border: 1.5px solid rgb(var(--accent-rgb) / 0.7);
}

.streak-day.is-routine {
  border: 1.5px dashed rgb(var(--accent-rgb) / 0.6);
}

.streak-day.is-posted {
  background: linear-gradient(160deg, var(--accent-2), var(--accent));
  color: var(--accent-text);
  font-weight: 700;
}

.streak-day.is-today {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.streak-ok {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--success);
}

.streak-card .streak-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.streak-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.streak-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.streak-dot-post {
  background: linear-gradient(160deg, var(--accent-2), var(--accent));
}

.streak-dot-planned {
  border: 1.5px solid rgb(var(--accent-rgb) / 0.7);
}

.streak-dot-routine {
  border: 1.5px dashed rgb(var(--accent-rgb) / 0.7);
}

.streak-legend span[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .streak-bar i {
    transition: none;
  }
}

.vault-feedback {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.vault-feedback[hidden] {
  display: none;
}

.vault-feedback p {
  margin: 0;
}

.vault-feedback p + p {
  margin-top: var(--space-1);
}

.vault-sortrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--space-3) 0 var(--space-2);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.vault-sort-btn {
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.vault-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.vault-item-extra {
  margin-top: var(--space-3);
}

.vault-item-steps {
  margin: 0 0 var(--space-2);
  padding-left: 1.3em;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.vault-more-btn {
  min-height: 44px;
  background: var(--glass-bg);
  border-color: var(--glass-border);
  color: var(--text);
}

/* Der Streifen links trägt den Status: Orange gespeichert, Blau geplant,
   Grün gepostet. Das Badge rechts oben sagt dasselbe in Worten. */
.vault-item {
  --vault-status-color: var(--accent);
  position: relative;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4) 0 calc(var(--space-4) + 3px);
}

.vault-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--vault-status-color);
}

.vault-item-planned {
  --vault-status-color: #60a5fa;
}

.vault-item-posted {
  --vault-status-color: #22c55e;
}

.vault-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.vault-niche {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vault-status-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px var(--space-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Linksbündig die Nische, alle Abzeichen rechts zusammen. */
.vault-item-head .vault-niche {
  margin-right: auto;
}

.vault-video-badge {
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.4);
}

.vault-status-planned {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.4);
}

.vault-status-posted {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.4);
}

.vault-item-hook {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  width: 100%;
  margin: var(--space-2) 0 var(--space-1);
  padding: 0;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.vault-item.is-open .vault-item-hook {
  -webkit-line-clamp: unset;
}

.vault-item-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-1) 0 var(--space-2);
}

.vault-item-details[hidden] {
  display: none;
}

.vault-item-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.vault-item-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.vault-item-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) calc(-1 * var(--space-4)) 0 calc(-1 * (var(--space-4) + 3px));
  padding: var(--space-2) var(--space-4) var(--space-2) calc(var(--space-4) + 3px);
  border-top: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.18);
}

.vault-item-actions .vault-mini-btn {
  min-height: 44px;
}

.vault-post-btn {
  margin-left: auto;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.vault-post-btn:hover:not(:disabled) {
  background: var(--accent-2);
  color: var(--accent-text);
}

.vault-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.vault-icon-btn svg {
  width: 18px;
  height: 18px;
}

.vault-icon-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.vault-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-left: auto;
  padding: 0 var(--space-3);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.vault-like-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.vault-like-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--text);
}

.vault-like-btn[aria-pressed="true"] svg {
  fill: var(--accent);
  stroke: var(--accent);
}

.vault-date-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.vault-date-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  min-height: 44px;
  padding: var(--space-1) var(--space-2);
  font-size: 0.85rem;
}

.vault-remix-result {
  margin-bottom: var(--space-3);
}

.vault-remix-result:empty {
  margin: 0;
}


/* Auswertung unter „Gefällt dir …“ (seit 28.10.2026, vorher fix über der
   Bottom-Nav). */
.vault-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: var(--space-3);
  padding: var(--space-2) 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  text-align: center;
}

.vault-stats-bar div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.vault-stats-bar strong {
  font-family: var(--font-heading);
  font-size: 1.05rem;
}

.vault-stats-bar span {
  color: var(--text-dim);
  font-size: 0.7rem;
}

.vault-stat-accent {
  color: var(--accent);
}

.legal-card {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  line-height: 1.6;
}

.legal-card h2 {
  font-size: 1.1rem;
  margin: var(--space-7) 0 var(--space-2);
}

.legal-card h2:first-of-type {
  margin-top: 0;
}

.legal-card p,
.legal-card li {
  color: var(--text-muted);
  font-size: 0.95rem;
  /* Lange Links (z. B. die Meta-Adresse) sonst breiter als das Handy. */
  overflow-wrap: anywhere;
}

.legal-card ul {
  padding-left: var(--space-5);
}

.legal-note {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  border-left: 3px solid var(--accent);
}

.back-link {
  display: inline-block;
  margin-top: var(--space-5);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  text-decoration: underline;
}

#dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.admin-stats-card,
.admin-likes-card,
.admin-feedback-card,
.admin-hooks-card {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.admin-likes-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 var(--space-4);
}

.admin-stats-card h2,
.admin-likes-card h2,
.admin-feedback-card h2,
.admin-hooks-card h2 {
  margin: 0 0 var(--space-2);
  font-size: 1.1rem;
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Plattform + Sprache über den Create-Untertabs: zwei gleich breite Spalten,
   auf sehr schmalen Geräten untereinander. */
.create-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* Plattform und Sprache über den Create-Untertabs: Glas wie die Karten.
   Der Pfeil (zwei Verläufe aus der select-Regel) bleibt die oberste Ebene,
   darunter liegt der Glanz. */
.create-options select {
  background-color: var(--glass-tint);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%),
    var(--glass-gloss);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%, 0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-color: var(--glass-border);
  box-shadow: var(--glass-rim);
}

/* Gleiche Spezifität wie select:focus, aber später – ohne diese Regel wäre
   der Fokusrand bei Tastaturbedienung weg. */
.create-options select:focus {
  border-color: var(--accent);
  box-shadow: var(--glass-rim), 0 0 0 3px rgb(var(--accent-rgb) / 0.15);
}

@media (max-width: 360px) {
  .create-options {
    grid-template-columns: 1fr;
  }
}

/* Abgeleitete Inhalte: zweite, leichtere Button-Reihe unter den
   Hauptaktionen einer Ideen-Karte. Chips umbrechen auf schmalen Geräten. */
.derive-section {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.derive-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.derive-btn {
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.derive-btn:hover:not(:disabled),
.derive-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* Im Vault: "+ Caption" usw. erzeugt, was noch fehlt – gestrichelt, damit es
   sich von den gespeicherten Inhalten abhebt. */
.derive-btn-new {
  border-style: dashed;
}

/* Im Vault zeigt der Knopf, welcher Inhalt gerade aufgeklappt ist. */
.derive-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.derive-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.derive-result:not(:empty) {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.derive-heading {
  margin: 0 0 var(--space-2);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.derive-subheading {
  margin: var(--space-3) 0 var(--space-1);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.derive-text,
.derive-caption {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}

.derive-meta {
  margin: var(--space-1) 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.derive-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.derive-tag {
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.derive-cta {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.derive-cta:last-of-type {
  border-bottom: none;
}

.derive-cta-strength {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.derive-cta-text {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}

.derive-variant + .derive-variant {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.derive-copy-btn {
  margin-top: var(--space-3);
}

.like-error {
  width: 100%;
  margin: var(--space-2) 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--danger);
}

/* Kennzahl-Kacheln (aktive Nutzer): auf dem Handy zwei pro Reihe, auf
   breiteren Screens so viele wie passen. */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-3);
}

.admin-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.admin-kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.admin-kpi-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-feedback-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-form {
  margin-bottom: var(--space-6);
}

.admin-feedback-item {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--accent);
}

.admin-feedback-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: var(--space-1);
}

.admin-feedback-text {
  margin: 0;
  font-size: 0.92rem;
  white-space: pre-wrap;
}

/* Warteliste (Admin) */
.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-left: var(--space-2);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 800;
  vertical-align: middle;
}

.admin-waitlist-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-waitlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--accent);
}

.admin-waitlist-item {
  flex-wrap: wrap;
}

.admin-waitlist-item.pending {
  border-left-color: var(--warning);
}

.admin-waitlist-item.invited {
  border-left-color: var(--success);
  opacity: 0.75;
}

.admin-waitlist-info {
  min-width: 0;
}

.admin-waitlist-head {
  font-weight: 600;
  font-size: 0.95rem;
  word-break: break-word;
}

.admin-waitlist-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.admin-waitlist-message {
  margin: var(--space-2) 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.admin-waitlist-actions {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.admin-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.admin-filter-chip {
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-filter-chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-launch {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.admin-launch-title {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
}

.admin-launch-btn {
  min-height: 44px;
  padding: 0 var(--space-4);
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: var(--accent-text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-launch-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-waitlist-select {
  margin-top: 0;
}

.admin-copy-btn {
  padding: 6px var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.admin-copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Admin: Tabs ------------------------------------------------------- */

#dashboard[hidden] {
  display: none;
}

/* Sticky Tab-Leiste in Glas-Optik; auf schmalen Geräten horizontal
   scrollbar statt umzubrechen. */
.admin-tabs {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  display: flex;
  gap: var(--space-1);
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-1) var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--glass-bg-strong, var(--glass-bg));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tab {
  position: relative;
  flex: 1 0 auto;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.admin-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

.admin-tab-dot {
  position: absolute;
  top: 10px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

.admin-tab-dot[hidden] {
  display: none;
}

.admin-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.admin-panel[hidden],
.admin-panel .card[hidden] {
  display: none;
}

/* ---- Admin: Übersicht -------------------------------------------------- */

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.admin-overview-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

/* Kacheln im Nutzer-Tab sind Knöpfe, die ihre Liste aufklappen. */
button.admin-overview-tile {
  font: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

button.admin-overview-tile:hover,
button.admin-overview-tile[aria-expanded="true"] {
  border-color: var(--accent);
}

button.admin-overview-tile:active {
  transform: scale(0.98);
}

button.admin-overview-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.admin-overview-tile.alert .admin-overview-value {
  color: var(--danger);
}

.admin-overview-value {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
}

.admin-overview-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-overview-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ---- Admin: Balken & Trichter ------------------------------------------ */

.admin-funnel,
.admin-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-funnel-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-1);
  font-size: 0.88rem;
}

.admin-funnel-numbers {
  flex: none;
  color: var(--text-dim);
}

.admin-funnel-numbers strong {
  color: var(--text);
}

.admin-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.admin-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.admin-day-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-2);
  align-items: end;
}

.admin-day-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.admin-day-slot {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 120px;
}

.admin-day-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}

.admin-day-count {
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-day-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ---- Admin: Top Likes -------------------------------------------------- */

.admin-top-likes {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.admin-like-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.admin-like-rank {
  flex: none;
  width: 22px;
  font-weight: 700;
  color: var(--accent);
}

.admin-like-body {
  flex: 1;
  min-width: 0;
}

.admin-like-hook {
  margin: 0 0 var(--space-1);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-like-count {
  flex: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.admin-tag {
  display: inline-block;
  padding: 2px var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ---- Admin: Nutzerliste ------------------------------------------------ */

.admin-sort {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  overflow-x: auto;
}

.admin-sort-btn {
  flex: none;
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-sort-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--text);
}

.admin-user-list {
  display: flex;
  flex-direction: column;
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-soft);
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-user-handle {
  font-weight: 600;
  word-break: break-word;
}

.admin-user-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.admin-user-count {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.admin-user-count strong {
  font-size: 1.05rem;
  color: var(--text);
}

/* ---- Admin: Feedback & Bugs -------------------------------------------- */

.admin-feedback-item.tone-good {
  border-left-color: var(--success);
}

.admin-feedback-item.tone-mid {
  border-left-color: var(--accent);
}

.admin-feedback-item.tone-bad,
/* Bilder zu einer Bug-Meldung (admin.js, createBugScreenshots). */
.admin-bug-shots {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-2) 0;
}

.admin-bug-shots img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.admin-bug-item {
  border-left-color: var(--danger);
}

.admin-feedback-item.tone-neutral {
  border-left-color: var(--border);
}

.admin-feedback-item .admin-feedback-text + .admin-feedback-text {
  margin-top: var(--space-1);
}

.admin-feedback-item.read {
  opacity: 0.5;
}

.admin-text-btn {
  margin-top: var(--space-2);
  min-height: 36px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-bug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.admin-bug-head .admin-feedback-meta {
  margin: 0;
}

.admin-status-badge {
  flex: none;
  padding: 2px var(--space-2);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-status-badge.status-offen {
  color: var(--danger);
  background: rgba(229, 72, 77, 0.15);
}

.admin-status-badge.status-in_bearbeitung {
  color: var(--warning);
  background: rgba(245, 197, 66, 0.15);
}

.admin-status-badge.status-geloest {
  color: var(--success);
  background: rgba(111, 207, 122, 0.15);
}

.admin-status-select {
  margin-top: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

/* ---- Struktur: Refine / Create / Vault ------------------------------- */

.app-view,
#create-hooks,
#create-ideas,
#create-story {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Create-Tab oben enger (28.10.2026, Wunsch des Betreibers): Wochenstand,
   Untertabs, Plattform/Sprache und Ergebnisse lagen 48 px auseinander –
   Lücke und eigener Rand addierten sich. */
#view-create {
  gap: var(--space-4);
}

#view-create > .sub-tabs,
#view-create > .create-options {
  margin-bottom: 0;
}

#view-create > .quota-info {
  margin-top: calc(-1 * var(--space-2));
}

.view-lead {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 var(--space-4);
}

/* "Einfügen" + "Forge"-Button nebeneinander (Ideas/Story/Refine) statt der
   sonst vollen Breite von .primary-btn/.secondary-btn. */
.forge-row {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.forge-paste-btn {
  width: auto;
  flex: 0 0 auto;
}

.forge-btn {
  width: auto;
  flex: 1;
}

/* Copy/Refine/Like nebeneinander unter einer Ideen-Karte (statt .like-btn
   allein über die volle Breite). */
.idea-actions {
  display: flex;
  gap: var(--space-2);
}

.idea-actions .like-btn,
.idea-actions .copy-btn {
  width: auto;
  flex: 1;
}

.refine-jump-btn {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.refine-jump-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.refine-result {
  margin-top: var(--space-2);
}

/* ---- Bottom-Nav (Refine / Create / Vault) ----------------------------- */

body.has-bottom-nav {
  /* Leiste plus der Teil des Create-Kreises, der oben herausragt. */
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

/* Frei schwebende Glas-Pille, voll gerundet. Seit 28.10.2026 mit einer
   Einbuchtung oben, in der der Create-Kreis sitzt (Vorlage des Betreibers);
   seit 29.10.2026 mit fünf Plätzen (Start vorn), der Kreis damit in der Mitte. Die Fläche liegt deshalb in ::before: Die Maske schneidet dort
   das Loch aus, ohne den Kreis (ein Kind der Leiste) mit wegzuschneiden.
   ::after zieht den orangen Rand um die Einbuchtung nach. */
.bottom-nav {
  --nav-notch-r: 36px;
  --nav-notch-y: 6px;
  /* Mitte der mittleren von fünf gleich breiten Spalten. */
  --nav-notch-x: 50%;
  position: fixed;
  left: var(--space-4);
  right: var(--space-4);
  bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 420px;
  margin: 0 auto;
  border-radius: 999px;
  padding: var(--space-2) var(--space-3);
}

.bottom-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid var(--accent);
  border-radius: inherit;
  background: rgba(24, 24, 24, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  -webkit-mask-image: radial-gradient(circle var(--nav-notch-r) at var(--nav-notch-x) var(--nav-notch-y), transparent calc(var(--nav-notch-r) - 0.5px), #000 var(--nav-notch-r));
  mask-image: radial-gradient(circle var(--nav-notch-r) at var(--nav-notch-x) var(--nav-notch-y), transparent calc(var(--nav-notch-r) - 0.5px), #000 var(--nav-notch-r));
}

.bottom-nav::after {
  content: "";
  position: absolute;
  left: calc(var(--nav-notch-x) - var(--nav-notch-r));
  top: calc(var(--nav-notch-y) - var(--nav-notch-r));
  width: calc(2 * var(--nav-notch-r));
  height: calc(2 * var(--nav-notch-r));
  border: 1px solid var(--accent);
  border-radius: 50%;
  box-sizing: border-box;
  /* Nur der Teil innerhalb der Leiste, oberhalb gibt es keinen Rand. */
  clip-path: inset(calc(var(--nav-notch-r) - var(--nav-notch-y)) 0 0 0);
  pointer-events: none;
}

#nav-tab-start {
  grid-column: 1;
}

#nav-tab-refine {
  grid-column: 2;
}

#nav-tab-vault {
  grid-column: 4;
}

#nav-tab-profile {
  grid-column: 5;
}

.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 44px;
  padding: var(--space-1) 0;
  border: none;
  /* Pillenform wie die Leiste (29.10.2026). */
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.bottom-nav-btn svg {
  width: 22px;
  height: 22px;
}

.bottom-nav-btn:hover,
.bottom-nav-btn.is-active {
  color: var(--accent);
}

.bottom-nav-btn.is-active {
  background: rgb(var(--accent-rgb) / 0.14);
}

/* Create: nur das Plus in einem eigenen Kreis, in der Einbuchtung.
   Aktiv ist der Kreis gefüllt, sonst nur umrandet. */
.bottom-nav-create,
.bottom-nav-create.is-active,
.bottom-nav-create:hover {
  position: absolute;
  left: calc(var(--nav-notch-x) - 28px);
  top: calc(var(--nav-notch-y) - 28px);
  width: 56px;
  height: 56px;
  min-height: 0;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
}

.bottom-nav-create-circle {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: rgb(20, 20, 20);
  color: var(--accent);
  box-shadow: 0 6px 18px rgb(var(--accent-rgb) / 0.3);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.bottom-nav-create.is-active .bottom-nav-create-circle {
  background: var(--accent);
  color: #111;
}

.bottom-nav-btn .bottom-nav-create-circle svg {
  width: 24px;
  height: 24px;
}

.bottom-nav-create:focus-visible {
  outline: none;
}

.bottom-nav-create:focus-visible .bottom-nav-create-circle {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .site-header {
    padding: var(--space-6) var(--space-3) var(--space-3);
    /* Siehe .site-header oben: Abstand zur Statusleiste der PWA. */
    padding-top: max(var(--space-6), calc(env(safe-area-inset-top) + var(--space-5)));
  }

  .container {
    padding: var(--space-4) var(--space-3) var(--space-7);
    gap: var(--space-5);
  }

  .card {
    padding: var(--space-5);
  }

  .field-row {
    flex-direction: column;
    gap: 0;
  }
}

/* ---- Onboarding-Wizard ---------------------------------------------------
   Auswahl-Chips mit 44px Mindesthöhe (Touch-Ziel), Zustand über
   aria-pressed statt einer eigenen Klasse – so stimmen Optik und
   Screenreader-Ansage immer überein. */
.onboarding h2 {
  margin-bottom: var(--space-3);
}

.onb-progress {
  margin: 0 0 var(--space-2);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.onb-step .primary-btn {
  width: 100%;
}

/* S7: Free gegen Pro. Drei schmale Spalten passen auch auf 320 px. */
.plan-compare {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--space-4);
  font-size: 0.85rem;
}

.plan-compare th,
.plan-compare td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--glass-border);
  text-align: left;
  vertical-align: top;
}

.plan-compare thead th {
  color: var(--text-muted);
  font-weight: 600;
}

.plan-compare tbody th {
  font-weight: 600;
}

.plan-compare .plan-soon {
  color: var(--text-muted);
  font-style: italic;
}

.routine-locked {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

[data-step="7"] .secondary-btn,
#settings-routine-save-btn {
  margin-top: var(--space-3);
}

#onb-paywall .secondary-btn {
  margin-top: var(--space-3);
}

#onb-paywall .hint {
  margin-bottom: var(--space-4);
}

.wizard-fieldset {
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 0;
}

.wizard-fieldset legend {
  margin-bottom: var(--space-2);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.wizard-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.wizard-fieldset .wizard-chips {
  margin-bottom: var(--space-2);
}

.wizard-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.wizard-chip:hover {
  border-color: var(--accent);
}

.wizard-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wizard-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.wizard-chip.is-locked {
  color: var(--text-muted);
}

.wizard-chip.is-locked:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wizard-chip.is-locked[aria-pressed="true"] {
  color: var(--accent-text);
}

/* Video/Bild im Content-Tab als ein Schalter: Die orange Fläche gleitet zur
   Auswahl (data-selected setzt script.js). */
.wizard-chips.segmented {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--surface-2);
}

.wizard-chips.segmented::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 22px;
  background: var(--accent);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wizard-chips.segmented[data-selected="bild"]::before {
  transform: translateX(100%);
}

.wizard-chips.segmented .wizard-chip,
.wizard-chips.segmented .wizard-chip[aria-pressed="true"] {
  position: relative;
  justify-content: center;
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}

.wizard-chips.segmented .wizard-chip[aria-pressed="true"] {
  color: var(--accent-text);
}

@media (prefers-reduced-motion: reduce) {
  .wizard-chips.segmented::before {
    transition: none;
  }
}

.lock-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.onb-nav {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.onb-nav .primary-btn {
  flex: 1;
}

/* Nischen-Finder (Schritte 10–16, finder.js). */
.finder-progress {
  height: 4px;
  margin: 0 0 var(--space-4);
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
}

.finder-progress span {
  display: block;
  height: 100%;
  width: 25%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.finder-choice {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.finder-choice-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: 44px;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.finder-choice-card span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.finder-choice-card:hover {
  border-color: var(--accent);
}

.finder-choice-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.finder-loading {
  color: var(--text-muted);
}

.finder-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.finder-card {
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
}

.finder-card.is-picked {
  border-color: var(--accent);
}

.finder-card h3 {
  margin: 0 0 var(--space-1);
}

.finder-card-category {
  margin: 0 0 var(--space-2);
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 600;
}

.finder-card p,
.finder-card ul {
  margin: 0 0 var(--space-2);
  font-size: 0.9rem;
}

.finder-card ul {
  padding-left: var(--space-4);
  color: var(--text-muted);
}

.finder-card .wizard-chip {
  margin-top: var(--space-1);
}

/* Platzhalter, solange die Vorschläge laden – reserviert die Höhe. */
.finder-skeleton {
  height: 180px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  animation: finder-pulse 1.4s ease-in-out infinite;
}

@keyframes finder-pulse {
  50% { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .finder-skeleton { animation: none; }
  .finder-progress span { transition: none; }
}

[data-step="15"] .secondary-btn,
[data-step="16"] .secondary-btn {
  width: 100%;
  margin-top: var(--space-3);
}

.finder-confirm-list {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-5);
  font-weight: 600;
}

.onb-ideas {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* KI-Text kann lange Wörter ohne Umbruchstelle enthalten (Hashtags, URLs) –
   ohne das liefe die Karte seitlich aus dem Bildschirm. */
.onb-idea {
  overflow-wrap: anywhere;
}

.onb-idea h3 {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
}

.onb-idea-hook {
  margin: 0 0 var(--space-2);
  font-weight: 600;
  color: var(--accent-2);
}

.onb-idea ol {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-5);
  color: var(--text-muted);
}

.onb-idea-detail {
  margin: 0 0 var(--space-2);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.onb-idea-cta {
  margin: 0;
  font-size: 0.9rem;
}

/* Bild-Karte im Content-Tab: Die Zeilen bringen eigene Abstände mit. */
.onb-idea .idea-body {
  gap: 0;
  padding-top: var(--space-2);
}

.onb-idea .idea-toggle {
  margin: 0;
  align-items: center;
}

.onb-idea-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.onb-idea-actions .secondary-btn {
  min-height: 44px;
  /* Knopftexte nie mitten im Wort trennen (.onb-idea erlaubt das sonst). */
  overflow-wrap: normal;
}

.onb-idea-actions .like-error {
  grid-column: 1 / -1;
}

@media (prefers-reduced-motion: reduce) {
  .wizard-chip {
    transition: none;
  }
}

/* ---- Erste Schritte (Create-Tab, nach dem Onboarding) ---- */
.getting-started {
  margin-bottom: var(--space-4);
}

.getting-started h2 {
  margin: 0 0 var(--space-2);
  font-size: 1.1rem;
}

.getting-started-tabs {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.getting-started-tabs strong {
  color: var(--text);
}

.getting-started-list {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.getting-started-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 44px;
}

/* Kreis als Marker, erledigt gefüllt mit Haken – die Zustandsangabe steht
   zusätzlich als Text für Screenreader (Farbe ist nie allein der Hinweis). */
.getting-started-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.getting-started-label::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
}

.getting-started-list li.is-done .getting-started-label {
  color: var(--text-muted);
  text-decoration: line-through;
}

.getting-started-list li.is-done .getting-started-label::before {
  border-color: var(--success);
  background: var(--success)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23111' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}

.getting-started-action {
  flex: none;
  width: auto;
  padding: var(--space-2) var(--space-4);
  min-height: 44px;
  white-space: nowrap;
}

.getting-started-pro {
  color: var(--accent);
}

/* ---- Profil: Menü mit Unterseiten -------------------------------------- */

.profile-view,
.profile-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.profile-menu[hidden],
.profile-page[hidden] {
  display: none;
}

/* Profil-Kopf: großes Bild, Name mit Plan-Chip, "Profil anzeigen". Bewusst
   ohne Karte – er steht frei über den Glas-Karten wie eine Titelzeile. */
.profile-hero {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-2) var(--space-1);
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-hero:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-md);
}

.profile-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  border: 2px solid var(--glass-border);
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar [hidden] {
  display: none;
}

.profile-hero-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.profile-hero-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.profile-hero .profile-handle {
  font-family: var(--font-heading);
  font-size: 1.3rem;
}

.profile-hero-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.profile-hero-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-stats-card {
  padding: var(--space-4);
}

.profile-page .profile-account {
  margin-bottom: var(--space-4);
}

.profile-account-copy {
  flex: 1;
}

.profile-since {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-plan-chip {
  flex: none;
  padding: 3px var(--space-3);
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-plan-chip.free {
  border-color: var(--accent);
  color: var(--accent);
}

/* Drei Zahlen nebeneinander, durch feine Linien getrennt. */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.profile-stat {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.profile-stat + .profile-stat {
  border-left: 1px solid var(--border-soft);
}

.profile-stat dt {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.profile-stat dd {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
}

.profile-stat dd.accent {
  color: var(--accent);
}

.profile-quota {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-soft);
}

.profile-quota[hidden] {
  display: none;
}

.profile-quota-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  font-size: 0.85rem;
}

.profile-quota-count {
  color: var(--text-muted);
  text-align: right;
}

.profile-quota-track {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.profile-quota-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .profile-quota-fill {
    transition: none;
  }
}

/* Pro-Hinweis für Free: kompakt wie ein Banner – Kopfzeile mit Knopf rechts,
   darunter vier Vorteile als Icon-Reihe. Glas-Karte mit orangem Schein. */
.profile-pro-card {
  padding: var(--space-4);
  border-color: rgb(var(--accent-rgb) / 0.35);
  background:
    radial-gradient(120% 90% at 0% 0%, rgb(var(--accent-rgb) / 0.22), transparent 60%),
    var(--glass-bg);
}

.profile-pro-card[hidden] {
  display: none;
}

.profile-pro-card {
  cursor: pointer;
}

.profile-pro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.profile-pro-title {
  min-width: 0;
}

.profile-pro-title h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.1rem;
}

.profile-pro-title p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-pro-icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.profile-pro-btn {
  flex: none;
  min-height: 40px;
  padding: 0 var(--space-4);
  border: none;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: var(--accent-text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.profile-pro-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.profile-pro-features li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.profile-pro-features svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Eine Glas-Karte, die Einträge darin durch feine Linien getrennt. */
.profile-nav {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 48px;
  margin-top: var(--space-5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--danger);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.logout-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logout-btn:disabled {
  opacity: 0.6;
}

.profile-nav-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: 0 var(--space-4);
  border: none;
  border-bottom: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.profile-nav-row:last-child {
  border-bottom: none;
}

.profile-nav-row[hidden] {
  display: none;
}

.profile-nav-row:hover,
.profile-nav-row:focus-visible {
  background: rgba(255, 255, 255, 0.04);
}

.profile-nav-row span {
  flex: 1;
}

.profile-nav-icon,
.profile-nav-chevron,
.profile-back svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-nav-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

.profile-nav-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.profile-page-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.profile-page-head h2 {
  margin: 0;
}

.profile-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: calc(-1 * var(--space-2));
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.profile-back svg {
  width: 22px;
  height: 22px;
}

.profile-back:hover {
  background: rgba(255, 255, 255, 0.06);
}

.danger-zone {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-soft);
}

/* ---- Pro-Seite ------------------------------------------------------- */

/* Aufbau wie eine Upgrade-Seite: Schließen oben rechts, Symbol, Titel,
   Umschalter Monatlich/Jährlich, Funktionstabelle Free/Pro, großer Knopf. */
.pro-page {
  position: relative;
  padding: var(--space-6) var(--space-4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  text-align: center;
}

/* Auf der Pro-Seite sitzt das X dort, wo sonst die Glocke ist. Es steht
   außerhalb der Karte: deren backdrop-filter (und beim Wischen transform)
   machte "fixed" sonst relativ zur Karte. */
body.pro-open .notif-btn {
  display: none;
}

.pro-close {
  display: none;
}

body.pro-open .pro-close {
  display: inline-flex;
}

.pro-close {
  position: fixed;
  z-index: 20;
  top: calc(env(safe-area-inset-top) + var(--space-5));
  right: var(--space-4);
  left: auto;
  width: 44px;
  height: 44px;
  margin: 0;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.pro-icon {
  display: block;
  width: auto;
  height: 64px;
  margin: 0 auto;
}

.pro-title {
  margin: var(--space-4) 0 0;
  font-family: var(--font-heading);
  font-size: 1.9rem;
  line-height: 1.15;
}

.pro-lead {
  margin: var(--space-2) 0 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.pro-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: var(--space-6);
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
}

.pro-plan {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pro-plan[aria-checked="true"] {
  border-color: var(--border);
  background: var(--bg);
  color: var(--text);
}

.pro-plan:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pro-plan-badge {
  margin-left: 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.pro-price {
  margin: var(--space-3) 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pro-compare {
  width: 100%;
  margin-top: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.pro-compare th,
.pro-compare td {
  padding: var(--space-3) var(--space-3);
  font-size: 0.95rem;
}

.pro-compare thead th {
  padding-top: var(--space-4);
  color: var(--text-muted);
  font-weight: 700;
}

.pro-compare thead th:last-child {
  color: var(--accent);
}

.pro-compare tbody th {
  padding-left: var(--space-4);
  font-weight: 500;
}

.pro-compare thead th:first-child {
  padding-left: var(--space-4);
}

/* Feste Spaltenbreiten, damit die Textzeile (Generierungen) die übrigen
   Zeilen nicht zusammendrückt. */
.pro-compare {
  table-layout: fixed;
}

.pro-compare thead th:nth-child(2) {
  width: 100px;
}

.pro-compare thead th:nth-child(3) {
  width: 64px;
}

.pro-compare td,
.pro-compare thead th:not(:first-child) {
  text-align: center;
}

.pro-compare tbody tr:last-child > * {
  padding-bottom: var(--space-4);
}

/* Zeile Generierungen: Text statt Haken, darf breiter werden. */
.pro-compare td.pro-text {
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--text-muted);
}

.pro-compare td.pro-text-pro {
  color: var(--accent);
  font-weight: 700;
}

.pro-yes {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.pro-compare td:last-child .pro-yes {
  stroke: var(--accent);
}

.pro-no {
  color: var(--text-dim);
  font-weight: 700;
}

.pro-benefits {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pro-benefits li {
  display: flex;
  gap: var(--space-3);
}

.pro-benefits svg {
  flex: none;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pro-benefits strong {
  display: block;
  margin-bottom: 2px;
}

.pro-benefits p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.pro-join-btn {
  width: 100%;
  min-height: 56px;
  margin-top: var(--space-6);
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.pro-join-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.pro-join-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.pro-join-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.pro-footnote {
  margin: var(--space-3) 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Free-Sperren: grau, Schloss, nicht bedienbar ------------------------ */

.derive-btn.is-locked,
.vault-mini-btn.is-locked,
.vault-chip.is-locked,
.sub-tab.is-locked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0.45;
  cursor: not-allowed;
}

.plan-locked {
  opacity: 0.45;
  pointer-events: none;
}

/* ---- Weiche Seitenwechsel ------------------------------------------------
   Eine CSS-Animation startet neu, sobald ein Element von display:none wieder
   sichtbar wird – deshalb reicht es, sie an die Bereiche zu hängen, die beim
   Wechsel ein- und ausgeblendet werden. Hauptbereiche nur mit Opacity: Ein
   transform würde während der Animation fixed positionierte Kinder (die
   Vault-Auswertung über der Bottom-Nav) mitverschieben. */
@media (prefers-reduced-motion: no-preference) {
  .app-view,
  #create-hooks,
  #create-ideas,
  #create-story,
  #vault-archive-list {
    animation: view-fade 200ms ease-out;
  }

  .profile-menu,
  .profile-page,
  .onb-step,
  .admin-panel {
    animation: view-rise 220ms ease-out;
  }
}

@keyframes view-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes view-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- Benachrichtigungen: Glocke oben rechts + Center ------------------ */

.site-header {
  position: relative;
}

/* App: Das Logo bleibt beim Scrollen stehen, der Inhalt läuft darüber. Die
   Glas-Karten zeichnen es dabei per backdrop-filter weich. Die Glocke liegt
   deshalb nicht mehr im Kopf, sondern fix darüber. */
.site-header--backdrop {
  position: sticky;
  top: 0;
  z-index: 0;
  /* Etwas tiefer als die anderen Seitenköpfe: Am oberen Rand zeichnet iOS
     unter der Statusleiste weich, Logo und Glocken-Zahl gingen darin unter. */
  padding-top: max(var(--space-7), calc(env(safe-area-inset-top) + var(--space-7)));
}

/* App: schwarzer Hintergrund, nur am unteren Rand ein warmer Verlauf hinter
   der Navigation (Wunsch des Betreibers, 28.10.2026). Die anderen Seiten
   behalten die beiden Glow-Kugeln. */
.bg-glow--floor {
  top: auto;
  height: 300px;
  background: radial-gradient(70% 100% at 50% 100%, rgb(var(--accent-rgb) / 0.2), rgb(var(--accent-rgb) / 0.05) 55%, transparent);
}

/* Zwei Lichtflecken wandern gegeneinander am Rand entlang und pulsieren –
   das Flimmern wie bei Gemini. Nur transform und opacity, damit es auf dem
   iPhone auf der GPU läuft. */
.bg-glow--floor::before,
.bg-glow--floor::after {
  top: auto;
  bottom: -140px;
  width: 75%;
  height: 300px;
  filter: blur(50px);
}

.bg-glow--floor::before {
  left: -15%;
  right: auto;
  background: radial-gradient(closest-side, rgb(var(--accent-rgb) / 0.6), transparent);
}

.bg-glow--floor::after {
  left: auto;
  right: -15%;
  background: radial-gradient(closest-side, rgb(var(--accent-2-rgb) / 0.45), transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .bg-glow--floor::before { animation: floor-glow-a 3.5s ease-in-out infinite; }
  .bg-glow--floor::after { animation: floor-glow-b 4.5s ease-in-out infinite; }
}

@keyframes floor-glow-a {
  0%, 100% { transform: translateX(0) scale(1, 1); opacity: 0.75; }
  35% { opacity: 1; }
  50% { transform: translateX(35%) scale(1.15, 0.85); opacity: 0.6; }
  70% { opacity: 0.95; }
}

@keyframes floor-glow-b {
  0%, 100% { transform: translateX(0) scale(1, 0.9); opacity: 0.9; }
  30% { opacity: 0.55; }
  50% { transform: translateX(-35%) scale(1.2, 1.1); opacity: 1; }
  80% { opacity: 0.65; }
}

/* Logo klein oben links auf Höhe der Glocke (Wunsch des Betreibers,
   28.10.2026): fest positioniert, script.js schiebt es beim Scrollen mit dem
   Inhalt nach oben. Der Kopf hält nur den Platz frei. */
.site-header--backdrop {
  position: static;
  height: calc(env(safe-area-inset-top) + var(--space-5) + 44px);
  padding: 0;
}

.logo--corner {
  position: fixed;
  z-index: 20;
  top: calc(env(safe-area-inset-top) + var(--space-5));
  left: var(--space-4);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
}

.logo--corner img {
  width: auto;
  height: 34px;
}

.logo--corner .logo-text {
  height: 12px;
}

/* Im Profil bleibt es beim großen Logo, das hinter dem Inhalt stehen bleibt
   (Wunsch des Betreibers, 28.10.2026). */
.logo--big {
  display: none;
}

body.profile-active .site-header--backdrop {
  position: sticky;
  height: auto;
  text-align: center;
  padding: max(var(--space-7), calc(env(safe-area-inset-top) + var(--space-7))) var(--space-4) var(--space-4);
}

body.profile-active .logo--big {
  display: block;
}

body.profile-active .logo--corner {
  display: none;
}

/* Der Zurück-Knopf sitzt an derselben Stelle. */
body:has(#back-btn:not([hidden])) .logo--corner {
  visibility: hidden;
}

.notif-btn {
  position: fixed;
  z-index: 20;
  top: calc(env(safe-area-inset-top) + var(--space-5));
  right: var(--space-4);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text);
  cursor: pointer;
}

.notif-btn[hidden] {
  display: none;
}

.notif-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notif-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}

.notif-badge[hidden] {
  display: none;
}

/* Vollflächiges Blatt über allem, Rand abgedunkelt. */
.notif-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  padding: max(var(--space-4), env(safe-area-inset-top)) var(--space-3) max(var(--space-4), env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.55);
}

.notif-panel[hidden] {
  display: none;
}

.notif-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: 100%;
  overflow-y: auto;
  padding: var(--space-4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  /* Deckend statt Unschärfe dahinter: Der Blur kostete beim Schließen
     spürbar Zeit (28.10.2026, gemessen rund die Hälfte). Die deckende
     Unterlage verhindert, dass ohne ihn die App durchscheint; der Glanz
     (--glass-gloss) bleibt. */
  background: var(--glass-gloss), rgb(20, 20, 20);
}

@media (prefers-reduced-motion: no-preference) {
  .notif-sheet {
    animation: view-rise 220ms ease-out;
  }
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.notif-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.notif-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.notif-list {
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.notif-item {
  position: relative;
  padding: var(--space-3) var(--space-2) var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
}

/* Der ganze Eintrag ist antippbar (öffnet und markiert als gelesen). */
.notif-open {
  display: flex;
  gap: var(--space-3);
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.notif-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* Ungelesen: Punkt links, Titel kräftiger. */
.notif-item.unread::before {
  content: "";
  position: absolute;
  left: 2px;
  top: calc(var(--space-3) + 8px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.notif-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
}

.notif-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notif-copy {
  min-width: 0;
}

.notif-item-title {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.notif-item.unread .notif-item-title {
  color: var(--text);
  font-weight: 700;
}

/* Unter dem Text, auf Höhe der Schrift (Symbol 36 px + Abstand). */
.notif-weekly {
  margin: var(--space-3) 0 0 calc(36px + var(--space-3));
}

.notif-weekly .secondary-btn {
  margin-top: var(--space-2);
}

.notif-weekly .onb-ideas {
  margin-bottom: var(--space-2);
}

.notif-item-body {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.notif-open[aria-expanded="true"] .notif-item-body {
  -webkit-line-clamp: unset;
}

/* Pfeil nur an Einträgen, die sich aufklappen lassen (aria-expanded gesetzt). */
.notif-open[aria-expanded]::after {
  content: "";
  flex: none;
  align-self: center;
  width: 8px;
  height: 8px;
  margin: 0 var(--space-1) 0 auto;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.notif-open[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

@media (prefers-reduced-motion: reduce) {
  .notif-open[aria-expanded]::after {
    transition: none;
  }
}

.notif-date {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.notif-empty {
  padding: var(--space-5) 0;
  color: var(--text-muted);
  text-align: center;
}

.notif-toggles {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-4);
}

.notif-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 52px;
  border-bottom: 1px solid var(--border-soft);
}

/* ---- Erfolgserlebnisse: Posten-Toast, Wochenziel-Feier ------------------ */

.post-toast-ring {
  display: flex;
  flex: none;
}

.post-toast strong {
  display: block;
}

.post-toast {
  position: fixed;
  z-index: 45;
  left: var(--space-4);
  right: var(--space-4);
  bottom: calc(env(safe-area-inset-bottom) + 160px);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  font-size: 0.9rem;
  animation: toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.post-toast[hidden] {
  display: none;
}

.post-toast span span {
  color: var(--text-muted);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.goal-celebration {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgba(0, 0, 0, 0.75);
  overflow: hidden;
  animation: celebration-fade 0.3s ease-out;
}

.goal-celebration .goal-card {
  animation: celebration-pop 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.topic-popup {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgba(0, 0, 0, 0.6);
  animation: celebration-fade 0.3s ease-out;
}

.topic-popup[hidden] {
  display: none;
}

.topic-card {
  width: 100%;
  max-width: 340px;
  padding: var(--space-6) var(--space-5) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #141414;
  text-align: center;
  animation: celebration-pop 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.topic-icon svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.topic-card h2 {
  margin: var(--space-2) 0;
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

.topic-text {
  margin: 0 0 var(--space-4);
  color: var(--text-muted);
}

.topic-card button {
  width: 100%;
}

.push-ask-actions {
  display: grid;
  gap: var(--space-2);
}

/* Eigene Notiz (Vault): oben statt mittig, damit die iPhone-Tastatur die
   Felder nicht verdeckt. Unter dem Themenfilter-Popup (z-index 60), das beim
   Ausbauen erscheinen kann. */
.note-popup {
  position: fixed;
  z-index: 55;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: calc(env(safe-area-inset-top) + var(--space-6)) var(--space-4) var(--space-4);
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.6);
  animation: celebration-fade 0.3s ease-out;
}

.note-popup[hidden] {
  display: none;
}

.note-card {
  width: 100%;
  max-width: 400px;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #141414;
  animation: celebration-pop 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.note-card h2 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

.note-card textarea {
  resize: vertical;
}

.note-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* "+" vor den Filter-Chips: rund, gleiche Höhe wie die Chips. Gesperrt
   (Free) trägt es zusätzlich das Schloss und wird breiter. */
.vault-chip-add {
  justify-content: center;
  min-width: 44px;
  padding: 0 var(--space-2);
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 500;
}

@keyframes celebration-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes celebration-pop {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

.goal-celebration[hidden] {
  display: none;
}

.goal-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: var(--space-6) var(--space-5);
  border: 1px solid rgb(var(--accent-rgb) / 0.45);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgb(var(--accent-rgb) / 0.2), transparent 60%), #141414;
  text-align: center;
}

/* Orden eines neuen Meilensteins: springt hoch und dreht sich einmal um die
   eigene Achse wie eine Münze (28.10.2026). Neues SVG bei jeder Feier, die
   Animation läuft also jedes Mal von vorn. */
.goal-badge {
  width: 140px;
  height: 140px;
  margin: 0 auto var(--space-2);
  perspective: 600px;
}

.goal-badge[hidden] {
  display: none;
}

.goal-badge svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.55));
  animation: goal-badge-jump 1.1s cubic-bezier(0.3, 0.7, 0.3, 1) 0.15s both;
}

@keyframes goal-badge-jump {
  0% { opacity: 0; transform: translateY(24px) scale(0.6) rotateY(0deg); }
  15% { opacity: 1; }
  45% { transform: translateY(-34px) scale(1.08) rotateY(200deg); }
  70% { transform: translateY(0) scale(1) rotateY(360deg); }
  84% { transform: translateY(-8px) rotateY(360deg); }
  100% { opacity: 1; transform: translateY(0) rotateY(360deg); }
}

.goal-num {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.goal-card h2 {
  margin: var(--space-3) 0 var(--space-2);
  font-family: var(--font-heading);
}

.goal-text {
  margin: 0;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .post-toast,
  .goal-celebration,
  .goal-celebration .goal-card,
  .goal-badge svg,
  .topic-popup,
  .topic-card,
  .milestone-popup,
  .milestone-popup-card,
  .note-popup,
  .note-card { animation: none; }
}

/* ---- Meilensteine im Profil ---------------------------------------------- */

/* Zugeklappt: Kopf, Stapel erreichter Abzeichen, nächstes Ziel. Die ganze
   Fläche ist ein Knopf, damit Antippen überall aufklappt. */
.milestones-toggle {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.milestones-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.milestones-head strong {
  font-family: var(--font-heading);
  font-size: 1rem;
}

.milestones-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.milestones-count svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.milestones-toggle[aria-expanded="true"] .milestones-count svg {
  transform: rotate(180deg);
}

.milestones-stack {
  display: flex;
}

.milestones-stack[hidden],
.milestones-next[hidden] {
  display: none;
}

.milestones-chip {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-text);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
}

.milestones-chip + .milestones-chip {
  margin-left: -10px;
}

/* Stapel oben: kleine Orden statt oranger Kreise. */
.milestones-chip.is-badge {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 0;
  background: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.milestones-chip.is-badge svg {
  width: 100%;
  height: 100%;
}

.milestones-chip.is-more {
  background: var(--surface-2);
  color: var(--text-muted);
}

.milestones-next {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.milestones-next-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.milestones-next-copy strong {
  color: var(--text);
  font-size: 0.88rem;
}

.milestones-bar {
  display: block;
  height: 6px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--border);
}

.milestones-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
}

/* Aufgeklappt: Gruppen mit Zähler und je einem Gitter. */
/* padding statt margin: Die Höhen-Animation (animateCollapse) erfasst den
   Abstand so mit, sonst springt er am Ende. */
.milestones-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-4);
}

.milestones-body[hidden] {
  display: none;
}

.milestones-group-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.milestones-group-count {
  color: var(--accent);
}

.milestones-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.milestone {
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-2) 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 0.68rem;
  line-height: 1.2;
  text-align: center;
}

.milestone-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px dashed var(--border);
  border-radius: 50%;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
}

.milestone-icon svg {
  width: 14px;
  height: 14px;
}

.milestone.is-reached {
  border-color: rgb(var(--accent-rgb) / 0.45);
  color: var(--text);
}

.milestone.is-reached .milestone-icon {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-text);
}

/* Kacheln im Raster: Orden (badges.js) statt Kreis, seit 28.10.2026. */
.milestones-grid .milestone .milestone-icon {
  width: 48px;
  height: 48px;
  border: none;
  background: none;
  color: var(--text-dim);
}

.milestones-grid .milestone .milestone-icon svg.badge {
  width: 100%;
  height: 100%;
}

.milestones-grid .milestone.is-reached .milestone-icon svg.badge {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.milestones-grid .milestone.is-locked .milestone-icon {
  width: 40px;
  height: 40px;
  margin: 4px 0;
  border: 1px dashed var(--border);
}

.milestone.is-locked {
  opacity: 0.55;
}

/* ---- Meilenstein-Popup (openMilestonePopup() in script.js) ---------------- */

.milestone-popup {
  position: fixed;
  z-index: 55;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgba(0, 0, 0, 0.6);
  animation: celebration-fade 0.3s ease-out;
}

.milestone-popup[hidden] {
  display: none;
}

.milestone-popup-card {
  width: 100%;
  max-width: 360px;
  padding: var(--space-6) var(--space-5) var(--space-5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  text-align: center;
  animation: celebration-pop 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.milestone-popup-badge {
  display: grid;
  place-items: center;
  width: 170px;
  height: 170px;
  margin: 0 auto var(--space-3);
  color: var(--text-dim);
}

.milestone-popup-badge svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.55));
}

.milestone-popup-group {
  margin: 0 0 var(--space-1);
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.milestone-popup-card h2 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-heading);
  font-size: 1.3rem;
}

.milestone-popup-state {
  display: inline-block;
  margin-bottom: var(--space-4);
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.milestone-popup-state.is-reached {
  border-color: rgba(111, 207, 122, 0.45);
  background: rgba(111, 207, 122, 0.15);
  color: var(--success);
}

.milestone-popup-howto {
  margin: 0 0 var(--space-4);
  color: var(--text-muted);
  line-height: 1.5;
}

.milestone-popup-progress {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.milestone-popup-progress[hidden] {
  display: none;
}

.milestone-popup-card button {
  width: 100%;
}

/* ---- Start-Tab (29.10.2026): Übersicht als erster Tab ------------------- */

.start-view {
  gap: var(--space-4);
}

.start-hello h1 {
  margin: 0;
  font-size: 1.6rem;
}

.start-hello p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.start-card {
  padding: var(--space-4);
}

.start-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-link {
  min-height: 32px;
  padding: 0 0 0 var(--space-2);
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.start-week-top {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.start-week-ring {
  display: flex;
  flex: none;
}

.start-week-copy strong {
  display: block;
  font-size: 1.1rem;
}

.start-week-copy span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.start-week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: var(--space-4);
  color: var(--text-dim);
  font-size: 0.72rem;
  text-align: center;
}

.start-day-dot {
  display: block;
  width: 28px;
  height: 28px;
  margin: 4px auto 0;
  border: 1.5px solid var(--surface-2);
  border-radius: 50%;
}

.start-day-dot.is-done {
  border-color: var(--accent);
  background: var(--accent);
}

.start-day-dot.is-planned {
  border-color: var(--accent);
}

.start-day-dot.is-today {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text-muted);
}

/* Hinweis-Karten: wischbar, die nächste schaut am Rand hervor. */
.start-tips {
  display: flex;
  gap: var(--space-3);
  /* Bis an den Rand des Inhalts (Innenabstand von .container am Handy). */
  margin: 0 calc(-1 * var(--space-3));
  padding: 2px var(--space-3) 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.start-tips::-webkit-scrollbar {
  display: none;
}

.start-tip {
  flex: 0 0 calc(100% - 28px);
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 84px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgb(var(--accent-rgb) / 0.35);
  border-radius: 22px;
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.28), rgb(var(--accent-rgb) / 0.07) 70%), var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.start-tips.is-single .start-tip {
  flex-basis: 100%;
}

.start-tip-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgb(var(--accent-rgb) / 0.18);
  color: var(--accent);
}

.start-tip-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.start-tip-icon.is-badge {
  background: none;
}

.start-tip-icon.is-badge .badge {
  width: 48px;
  height: 48px;
}

.start-tip-copy strong {
  display: block;
  font-size: 1.02rem;
}

.start-tip-copy span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.start-tip-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: calc(-1 * var(--space-2));
}

.start-tip-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-dim);
  opacity: 0.5;
  transition: width 0.2s ease, opacity 0.2s ease;
}

.start-tip-dots i.is-on {
  width: 22px;
  background: var(--text);
  opacity: 1;
}

.start-ready-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) 0;
  border: none;
  border-top: 1px solid var(--border-soft);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.start-ready-row:first-child {
  padding-top: 0;
  border-top: none;
}

.start-ready-date {
  flex: none;
  min-width: 56px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
}

.start-ready-date.is-today {
  background: rgb(var(--accent-rgb) / 0.14);
  color: var(--accent);
}

.start-ready-hook {
  display: -webkit-box;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.92rem;
}

.start-ready-chevron {
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(-45deg);
}

.start-unplanned {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

.start-unplanned b {
  flex: none;
  color: var(--accent);
}

.start-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.start-chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.start-chart-legend {
  display: flex;
  gap: var(--space-4);
  margin: var(--space-2) 0 0;
  color: var(--text-dim);
  font-size: 0.74rem;
}

.start-chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 3px;
  background: var(--accent);
  vertical-align: -1px;
}

.start-chart-legend i.is-goal {
  width: 14px;
  height: 0;
  border-top: 2px dashed var(--text-dim);
  border-radius: 0;
  background: none;
  vertical-align: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .start-tip-dots i {
    transition: none;
  }
}
