/* Sprachnachricht · Glaslook, Farben über Variablen, Stil dunkel oder hell */
.zsn {
  --zsn-accent: #FBBA00;
  --zsn-ink: #111417;
  --zsn-text: rgba(255, 255, 255, 0.96);
  --zsn-soft: rgba(255, 255, 255, 0.72);
  --zsn-line: rgba(255, 255, 255, 0.24);
  --zsn-glass: rgba(14, 18, 22, 0.8);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--zsn-text);
  -webkit-font-smoothing: antialiased;
}
.zsn *, .zsn *::before, .zsn *::after { box-sizing: border-box; margin: 0; }
.zsn [hidden] { display: none !important; }
.zsn button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.zsn svg { display: block; fill: currentColor; }
.zsn :focus-visible { outline: 2px solid var(--zsn-accent); outline-offset: 3px; }

/* Schwebender Knopf, Gegenstück zum Menüknopf */
.zsn-launcher {
  position: fixed;
  z-index: 20;
  top: calc(22px + env(safe-area-inset-top, 0px));
  right: 22px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15) !important;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  color: rgba(255, 255, 255, 0.96);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
}
.zsn-launcher svg { width: 24px; height: 24px; }
.zsn-launcher:hover { background: rgba(255, 255, 255, 0.28) !important; transform: scale(1.06); }
.zsn--unten-rechts .zsn-launcher { top: auto; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
.zsn--unten-links .zsn-launcher { top: auto; right: auto; left: 22px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
body.hell .zsn-launcher { background: rgba(0, 0, 0, 0.05) !important; border-color: rgba(0, 0, 0, 0.65) !important; color: rgba(0, 0, 0, 0.88); }
body.hell .zsn-launcher:hover { background: rgba(0, 0, 0, 0.1) !important; border-color: rgba(0, 0, 0, 0.9) !important; }
body.menu-offen .zsn-launcher { opacity: 0; pointer-events: none; }
.zsn.is-open .zsn-launcher { opacity: 0; pointer-events: none; }

/* Pumpende Ringe als Hinweis auf den Knopf */
.zsn-launcher::before,
.zsn-launcher::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
  opacity: 0;
  animation: zsn-ring 3.2s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
.zsn-launcher::after { animation-delay: 0.55s; }
body.hell .zsn-launcher::before, body.hell .zsn-launcher::after { border-color: rgba(0, 0, 0, 0.7); }
.zsn-launcher:hover::before, .zsn-launcher:hover::after, .zsn.is-open .zsn-launcher::before, .zsn.is-open .zsn-launcher::after { animation-play-state: paused; opacity: 0; }
@keyframes zsn-ring {
  0% { transform: scale(1); opacity: 0.7; }
  55% { transform: scale(1.65); opacity: 0; }
  100% { transform: scale(1.65); opacity: 0; }
}

/* Abdunkelung und Fenster */
.zsn-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 14, 18, 0.52);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.zsn.is-open .zsn-backdrop { opacity: 1; }

.zsn--float .zsn-dialog {
  position: fixed;
  z-index: 61;
  top: 50%;
  left: 50%;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  transform: translate(-50%, calc(-50% + 14px));
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.36s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.zsn--float.is-open .zsn-dialog { opacity: 1; transform: translate(-50%, -50%); }

.zsn-dialog {
  padding: 30px 28px 26px;
  border-radius: 22px;
  background: var(--zsn-glass);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  border: 1px solid var(--zsn-line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  text-align: left;
}
.zsn--inline .zsn-dialog { position: relative; max-width: 520px; margin: 0 auto; }

.zsn-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--zsn-soft);
  transition: background 0.2s ease, color 0.2s ease;
}
.zsn-close svg { width: 20px; height: 20px; }
.zsn-close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.zsn-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--zsn-accent); margin-bottom: 6px; }
.zsn-title { font-size: 22px; line-height: 1.25; font-weight: 700; color: #fff; margin: 0 40px 14px 0; }
.zsn-text { font-size: 15px; line-height: 1.55; color: var(--zsn-soft); }
.zsn-hint { font-size: 13px; color: var(--zsn-soft); text-align: center; margin-top: 12px; }

/* Schritte */
.zsn-step { animation: zsn-in 0.3s ease; }
.zsn-step[data-step="start"], .zsn-step[data-step="rec"], .zsn-step[data-step="done"] { text-align: center; }
.zsn-step[data-step="start"] .zsn-text { text-align: left; margin-bottom: 26px; }

.zsn-rec {
  width: 96px;
  height: 96px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--zsn-accent) !important;
  color: var(--zsn-ink) !important;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--zsn-accent) 50%, transparent);
  transition: transform 0.2s ease;
}
.zsn-rec svg { width: 40px; height: 40px; }
.zsn-rec:hover { transform: scale(1.05); }
.zsn-rec.is-live { animation: zsn-pulse 1.6s ease-out infinite; }
.zsn-rec.is-live svg { width: 30px; height: 30px; }

.zsn-wave { display: block; width: 100%; height: 72px; margin: 4px 0 10px; }
.zsn-time { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 18px; }
.zsn-time-max { font-size: 16px; font-weight: 400; color: var(--zsn-soft); }
.zsn.is-ending .zsn-time [data-el="elapsed"] { color: var(--zsn-accent); }

/* Player */
.zsn-player { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--zsn-line); margin-bottom: 22px; }
.zsn-play { flex: none; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--zsn-accent) !important; color: var(--zsn-ink) !important; }
.zsn-play svg { width: 24px; height: 24px; }
.zsn-play svg + svg, .zsn.is-playing .zsn-play svg:first-child { display: none; }
.zsn.is-playing .zsn-play svg + svg { display: block; }
.zsn-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); overflow: hidden; cursor: pointer; }
.zsn-bar i, .zsn-progress i { display: block; height: 100%; width: 0; background: var(--zsn-accent); border-radius: inherit; transition: width 0.15s linear; }
.zsn-player-time { flex: none; min-width: 40px; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--zsn-soft); }

/* Knöpfe */
.zsn-row { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.zsn-row--center { justify-content: center; margin-top: 22px; }
.zsn .zsn-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; font-size: 15px !important; font-weight: 600 !important; transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, opacity 0.2s ease; }
.zsn-btn svg { width: 18px; height: 18px; }
.zsn-btn--primary { background: var(--zsn-accent) !important; color: var(--zsn-ink) !important; }
.zsn-btn--primary:hover { transform: translateY(-1px); }
.zsn-btn--ghost { border: 1px solid rgba(255, 255, 255, 0.45) !important; color: #fff !important; }
.zsn-btn--ghost:hover { background: rgba(255, 255, 255, 0.1) !important; border-color: #fff !important; }
.zsn button:disabled { opacity: 0.5; cursor: default; transform: none; }

/* Formular */
.zsn-form { display: flex; flex-direction: column; gap: 14px; }
.zsn-field { display: flex; flex-direction: column; gap: 6px; }
.zsn-field span { font-size: 13px; color: var(--zsn-soft); }
.zsn-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.zsn-field input:focus { outline: none; border-color: var(--zsn-accent); background: rgba(255, 255, 255, 0.12); }
.zsn-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--zsn-soft); cursor: pointer; }
.zsn-consent input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--zsn-accent); }
.zsn-consent a { color: var(--zsn-accent); text-decoration: underline; text-underline-offset: 2px; }
.zsn-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.zsn-progress { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.zsn-error { min-height: 1.2em; font-size: 14px; line-height: 1.45; color: #ffc2a8; }
.zsn-error:empty { min-height: 0; }

.zsn-done-icon { width: 72px; height: 72px; margin: 6px auto 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--zsn-accent); color: var(--zsn-ink); }
.zsn-done-icon svg { width: 38px; height: 38px; }
.zsn-step[data-step="done"] .zsn-text { text-align: center; }

@keyframes zsn-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--zsn-accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 22px color-mix(in srgb, var(--zsn-accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--zsn-accent) 0%, transparent); }
}
@keyframes zsn-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Handy: Blatt von unten */
@media (max-width: 600px) {
  .zsn--float .zsn-dialog {
    top: auto;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    padding: 26px 20px calc(22px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
  }
  .zsn--float.is-open .zsn-dialog { transform: translateY(0); }
  .zsn-row .zsn-btn { flex: 1; }
}

/* Heller Stil für helle Websites */
.zsn--hell {
  --zsn-text: rgba(17, 20, 23, 0.94);
  --zsn-soft: rgba(17, 20, 23, 0.66);
  --zsn-line: rgba(17, 20, 23, 0.14);
  --zsn-glass: rgba(255, 255, 255, 0.92);
}
.zsn--hell .zsn-launcher { background: rgba(255, 255, 255, 0.85) !important; border-color: rgba(17, 20, 23, 0.55) !important; color: rgba(17, 20, 23, 0.9); }
.zsn--hell .zsn-launcher:hover { background: #fff !important; }
.zsn--hell .zsn-launcher::before, .zsn--hell .zsn-launcher::after { border-color: rgba(17, 20, 23, 0.55); }
.zsn--hell .zsn-backdrop { background: rgba(240, 240, 238, 0.55); }
.zsn--hell .zsn-dialog { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18); }
.zsn--hell .zsn-title { color: rgba(17, 20, 23, 0.96); }
.zsn--hell .zsn-close:hover { background: rgba(17, 20, 23, 0.06); color: #111; }
.zsn--hell .zsn-player { background: rgba(17, 20, 23, 0.04); }
.zsn--hell .zsn-bar, .zsn--hell .zsn-progress { background: rgba(17, 20, 23, 0.12); }
.zsn--hell .zsn-btn--ghost { border-color: rgba(17, 20, 23, 0.4) !important; color: #111 !important; }
.zsn--hell .zsn-btn--ghost:hover { background: rgba(17, 20, 23, 0.06) !important; border-color: #111 !important; }
.zsn--hell .zsn-field input { border-color: rgba(17, 20, 23, 0.22); background: #fff; color: #111; }
.zsn--hell .zsn-field input:focus { background: #fff; }
.zsn--hell .zsn-error { color: #b3261e; }

@media (prefers-reduced-motion: reduce) {
  .zsn *, .zsn *::before, .zsn *::after { animation: none !important; transition: none !important; }
}
