/* ═══════════════════════════════════════════════════════════════
   RiftVoiceLab
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg:        #0a0b0d;
  --bg-soft:   #0d0f12;
  --surface:   #111418;
  --surface-2: #171b21;
  --surface-3: #1e232a;
  --line:      #232830;
  --line-2:    #2e343e;

  --text:      #f3f5f8;
  --text-2:    #a6b0be;
  --text-3:    #6d7684;

  --accent:    #f2a03d;
  --accent-2:  #ffbc63;
  --accent-dim: rgba(242, 160, 61, .12);
  --accent-line: rgba(242, 160, 61, .34);

  --good:      #56b98d;
  --bad:       #e2604f;
  --info:      #5f9fd6;

  --top-h:     62px;

  --r-xs: 8px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;

  --sh-1: 0 1px 2px rgba(0,0,0,.35);
  --sh-2: 0 2px 6px rgba(0,0,0,.28), 0 12px 28px -14px rgba(0,0,0,.75);
  --sh-3: 0 8px 20px rgba(0,0,0,.35), 0 40px 80px -30px rgba(0,0,0,.9);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.2, .9, .28, 1.06);
  --pad: clamp(16px, 3vw, 30px);
}

*, *::before, *::after { box-sizing: border-box; }

/* Am Handy soll nichts nach Webseite riechen: kein blaues Aufblitzen beim
   Tippen, kein Doppeltipp-Zoom, kein Gummiband am Rand, keine Auswahl auf
   Bedienelementen. */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, a, label, .tabs__tab, .segs__seg, .voice, .mic, .play {
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
}
input, textarea, .entry__text, .clone__say, .note__body, .out, .trow__text {
  -webkit-user-select: text; user-select: text;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  /* Auf iOS steht die Statusleiste über dem Kopf — der Grund darunter
     muss trotzdem dunkel sein, sonst blitzt Weiß durch. */
  background-color: var(--bg);
}
body.is-booting { overflow: hidden; }

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(242,160,61,.28); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.is-hidden, [hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 20px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--line-2); }

/* Sehr weiches Licht im Hintergrund — kein Neon, nur Tiefe */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.bg span:nth-child(1) {
  width: 60vw; height: 60vw; top: -26vw; left: 46vw;
  background: radial-gradient(circle, rgba(242,160,61,.16), transparent 68%);
  animation: drift 26s ease-in-out infinite alternate;
}
.bg span:nth-child(2) {
  width: 46vw; height: 46vw; top: 34vh; left: -18vw;
  background: radial-gradient(circle, rgba(86,185,141,.09), transparent 68%);
  animation: drift 32s ease-in-out infinite alternate-reverse;
}
@keyframes drift { to { transform: translate3d(4vw, 6vh, 0) scale(1.12); } }

/* ═══════════ Intro ═══════════ */
.intro {
  position: fixed; inset: 0; z-index: 300; background: #07080a; overflow: hidden;
  transition: opacity .5s var(--ease);
}
.intro.is-gone { opacity: 0; pointer-events: none; }
.intro__video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.08); animation: introZoom 14s var(--ease) forwards;
}
@keyframes introZoom { to { transform: scale(1); } }
.intro__scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(80% 60% at 50% 50%, transparent 20%, rgba(7,8,10,.72) 100%),
    linear-gradient(180deg, rgba(7,8,10,.4), transparent 30%, transparent 60%, rgba(7,8,10,.9));
}
.intro__center { position: absolute; inset: 0; display: grid; place-content: center; padding: 24px; }
.intro__mark {
  display: flex; justify-content: center;
  font-size: clamp(38px, 9vw, 116px); font-weight: 700; letter-spacing: -.045em;
}
.intro__mark .w {
  display: inline-block; opacity: 0; transform: translateY(.34em);
  clip-path: inset(0 0 102% 0); animation: markIn .95s var(--spring) forwards;
}
.intro__mark .w:nth-child(2) { animation-delay: .1s; }
.intro__mark .w:nth-child(3) { animation-delay: .2s; }
.intro__mark .w--accent { color: var(--accent); }
@keyframes markIn { to { opacity: 1; transform: none; clip-path: inset(-30% -14% -30% -14%); } }
.intro__bar {
  margin: 28px auto 0; width: min(300px, 60vw); height: 2px; border-radius: 2px;
  background: rgba(255,255,255,.1); overflow: hidden;
}
.intro__bar i {
  display: block; height: 100%; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: barGrow 9s cubic-bezier(.1,.7,.2,1) .3s forwards;
}
@keyframes barGrow { to { width: 100%; } }
.intro__skip {
  position: absolute; right: clamp(16px, 4vw, 40px); bottom: clamp(16px, 4vw, 36px);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05);
  backdrop-filter: blur(10px); color: rgba(255,255,255,.8);
  font-size: 13px; font-weight: 500; opacity: 0;
  animation: fadeUp .5s .9s var(--ease) forwards;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--spring);
}
.intro__skip:hover { background: rgba(255,255,255,.11); color: #fff; transform: translateX(2px); }
.intro__skip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.curtain { position: absolute; inset: 0; display: flex; pointer-events: none; }
.curtain i { flex: 1; background: var(--bg); transform: translateY(101%); }
.curtain.is-closing i { animation: slat .7s var(--ease) forwards; }
.curtain.is-closing i:nth-child(2) { animation-delay: .04s; }
.curtain.is-closing i:nth-child(3) { animation-delay: .08s; }
.curtain.is-closing i:nth-child(4) { animation-delay: .12s; }
.curtain.is-closing i:nth-child(5) { animation-delay: .16s; }
.curtain.is-closing i:nth-child(6) { animation-delay: .2s; }
@keyframes slat { to { transform: translateY(0); } }

/* ═══════════ Kopfzeile ═══════════ */
.top {
  position: sticky; top: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) clamp(14px, 3vw, 26px) 0;
  background: rgba(10,11,13,.72); backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  transform: translateY(-101%); transition: transform .55s var(--ease);
}
.top.is-in { transform: none; }

.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; }
.brand__glyph {
  width: 30px; height: 30px; border-radius: var(--r-xs); display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
}
.brand__glyph svg { width: 19px; height: 19px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.brand__glyph g { transform-origin: center; animation: pulseBars 3.4s var(--ease) infinite; }
@keyframes pulseBars { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.72); } }
.brand__name { font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
@media (max-width: 560px) { .brand__name { display: none; } }

.tabs {
  position: relative; display: flex; gap: 2px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.tabs__tab {
  position: relative; z-index: 1; padding: 7px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 550; color: var(--text-3);
  transition: color .28s var(--ease);
}
.tabs__ico { display: none; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.tabs__tab:hover { color: var(--text-2); }
.tabs__tab.is-on { color: var(--text); }
.tabs__pill {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px;
  background: var(--surface-3); box-shadow: var(--sh-1);
  transition: transform .48s var(--spring), width .48s var(--spring);
}

.top__right { display: flex; align-items: center; gap: 10px; justify-self: end; }
.btn--icon { padding: 8px 12px; }
@media (max-width: 820px) { .btn--icon .btn__lbl { display: none; } .btn--icon { padding: 9px; } }
.pill {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px;
  border-radius: 999px; background: var(--accent-dim); border: 1px solid var(--accent-line);
}
.pill__num { font-size: 14px; font-weight: 650; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.pill__lbl { font-size: 11.5px; color: var(--text-3); }
@media (max-width: 640px) { .pill__lbl { display: none; } }
@media (max-width: 700px) {
  .top { grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 12px; }
  .tabs { justify-self: center; padding: 3px; }
  .tabs__tab { padding: 6px 10px; font-size: 12.5px; }
  .tabs__pill { top: 3px; bottom: 3px; }
  .top__right { gap: 6px; }
  .top__right .btn { padding: 8px 11px; font-size: 12.5px; }
  .pill { padding: 5px 9px; }
}

/* ═══════════ Ansagen ═══════════ */
.notes {
  position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 59;
  display: flex; flex-direction: column; gap: 1px;
}
.note {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px clamp(14px, 3vw, 26px);
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(1.4);
  animation: noteIn .42s var(--spring);
}
.note.is-out { animation: noteOut .26s var(--ease) forwards; }
.note__ico { width: 18px; height: 18px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.note__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.note__body b { font-size: 13px; font-weight: 640; letter-spacing: -.01em; }
.note__body span { font-size: 13px; line-height: 1.5; color: var(--text-2); white-space: pre-wrap; }
.note__x {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-3); transition: background .2s var(--ease), color .2s var(--ease);
}
.note__x:hover { background: rgba(255,255,255,.06); color: var(--text); }
.note__x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.note--info { color: var(--info); background: linear-gradient(90deg, rgba(95,159,214,.13), rgba(95,159,214,.05)); }
.note--wichtig { color: var(--bad); background: linear-gradient(90deg, rgba(226,96,79,.15), rgba(226,96,79,.05)); }
.note--wartung { color: var(--accent); background: linear-gradient(90deg, rgba(242,160,61,.15), rgba(242,160,61,.05)); }
.note--info .note__body b, .note--wichtig .note__body b, .note--wartung .note__body b { color: inherit; }
@keyframes noteIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes noteOut { to { opacity: 0; transform: translateY(-8px); } }

/* Werkbank: Ansagen verwalten */
.field--wide { grid-column: 1 / -1; }
.field select {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 13px; outline: none; font-size: 14px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  transition: border-color .22s var(--ease), box-shadow .22s;
}
.field select:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(242,160,61,.08); }
.notelist { display: flex; flex-direction: column; gap: 10px; }
.nrow {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  animation: rowIn .45s var(--ease) backwards;
}
.nrow:not(.is-on) { opacity: .58; }
.nrow__body { flex: 1; min-width: 0; }
.nrow__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nrow__head b { font-size: 14px; font-weight: 620; }
.nrow__when { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.nrow__text { margin-top: 5px; font-size: 13px; line-height: 1.5; color: var(--text-2); white-space: pre-wrap; }
.nrow__acts { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 620px) {
  .nrow { flex-wrap: wrap; }
  .nrow__acts { width: 100%; }
}

/* ═══════════ Knöpfe ═══════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 550; white-space: nowrap;
  transition: background .22s var(--ease), color .22s var(--ease),
              border-color .22s var(--ease), transform .2s var(--spring), box-shadow .22s var(--ease);
}
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: scale(.975); }
.btn--ghost { border: 1px solid var(--line-2); color: var(--text-2); background: var(--surface); }
.btn--ghost:hover { color: var(--text); border-color: var(--text-3); background: var(--surface-2); }
.btn--quiet { color: var(--text-3); padding: 8px 12px; }
.btn--quiet:hover { color: var(--text); background: var(--surface-2); }
.btn--solid {
  background: var(--accent); color: #1b1205; font-weight: 650;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 6px 18px -8px rgba(242,160,61,.8);
}
.btn--solid:hover { background: var(--accent-2); }
.btn--wide { width: 100%; padding: 12px; }
.btn:disabled { opacity: .42; pointer-events: none; }
.linkish { color: var(--text-3); font-size: 13px; }
.linkish:hover { color: var(--accent-2); }
.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums;
}

/* ═══════════ Grundraster ═══════════ */
.app { position: relative; z-index: 1; }
.view { display: none; }
.view.is-on { display: block; animation: viewIn .45s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.shell {
  display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 18px;
  max-width: 1340px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 26px) 40px;
}
.page { max-width: 1100px; margin: 0 auto; padding: 26px clamp(14px, 3vw, 26px) 48px; }
@media (max-width: 940px) { .shell { grid-template-columns: 1fr; } }

.h1 { font-size: clamp(22px, 2.6vw, 27px); font-weight: 680; letter-spacing: -.03em; margin: 0; }
.h2 { font-size: 16px; font-weight: 660; letter-spacing: -.02em; margin: 0; }
.page__sub { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.sub { margin: 4px 0 0; color: var(--text-3); font-size: 13.5px; }
.page__head, .work__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  flex-wrap: wrap; margin-bottom: 18px;
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-2);
}
.empty {
  padding: 34px 18px; text-align: center; color: var(--text-3); font-size: 13.5px;
  border: 1px dashed var(--line-2); border-radius: var(--r);
}
.empty--sm { padding: 18px 10px; font-size: 13px; }

/* ═══════════ Seitenspalte ═══════════ */
.side {
  position: sticky; top: 78px; align-self: start;
  display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - 100px);
}
@media (max-width: 940px) {
  .side { position: static; max-height: none; order: 2; }
  .work { order: 1; }
  .voices { max-height: 290px; }
  .side__top { margin-top: 4px; }
}
.side__top { display: flex; align-items: center; justify-content: space-between; padding: 0 2px; }
.side__title { margin: 0; font-size: 14px; font-weight: 620; letter-spacing: -.01em; }

.search { position: relative; }
.search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; fill: none; stroke: var(--text-3); stroke-width: 1.9; stroke-linecap: round;
}
.search input {
  width: 100%; padding: 10px 12px 10px 34px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  font-size: 13.5px; outline: none; transition: border-color .22s var(--ease), background .22s var(--ease);
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--line-2); background: var(--surface-2); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.voices { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding: 2px; flex: 1; min-height: 120px; }
.voice {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: var(--r-sm); text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .22s var(--ease), background .22s var(--ease), transform .3s var(--spring);
  animation: rowIn .45s var(--ease) both;
}
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.voice:hover { background: var(--surface-2); border-color: var(--line-2); }
.voice.is-on { border-color: var(--accent-line); background: var(--accent-dim); }
.voice__mark {
  width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2);
  font-size: 12px; font-weight: 650; letter-spacing: -.02em;
  transition: background .22s var(--ease), color .22s var(--ease);
}
.voice.is-on .voice__mark { background: var(--accent); color: #1b1205; }
.voice__body { min-width: 0; flex: 1; display: block; }
.voice__name { display: block; font-size: 13.5px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice__sub { display: block; font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice__eq { display: flex; align-items: flex-end; gap: 2px; height: 13px; opacity: 0; transition: opacity .3s var(--ease); }
.voice.is-on .voice__eq { opacity: 1; }
.voice__eq i { width: 2px; border-radius: 2px; background: var(--accent); height: 30%; animation: eq 1.1s var(--ease) infinite; }
.voice__eq i:nth-child(2) { animation-delay: .18s; }
.voice__eq i:nth-child(3) { animation-delay: .36s; }
@keyframes eq { 0%,100% { height: 25%; } 50% { height: 100%; } }

.meter { padding: 13px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.meter__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.meter__label { font-size: 12.5px; color: var(--text-3); }
.meter__val { font-size: 13px; font-weight: 620; font-variant-numeric: tabular-nums; }
.meter__track {
  position: relative; height: 6px; margin: 9px 0 8px; border-radius: 999px;
  background: var(--surface-3); overflow: hidden;
}
.meter__track i {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .6s var(--spring);
}
.meter__track b {
  position: absolute; top: -2px; bottom: -2px; width: 2px; border-radius: 2px;
  background: var(--text); left: 0; opacity: 0;
  transition: left .3s var(--ease), opacity .3s var(--ease);
}
.meter__foot { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--text-3); }

/* ═══════════ Arbeitsfläche ═══════════ */
.work { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.work__head { align-items: center; }
.status {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 12px; color: var(--text-3);
}
.status__dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-3);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.status.is-live .status__dot { background: var(--good); box-shadow: 0 0 0 3px rgba(86,185,141,.16); }
.status.is-busy .status__dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(242,160,61,.18); animation: pulse 1.1s var(--ease) infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(242,160,61,0); } }

.composer { overflow: hidden; transition: border-color .25s var(--ease), box-shadow .25s var(--ease); }
.composer:focus-within { border-color: var(--line-2); box-shadow: var(--sh-2), 0 0 0 3px rgba(242,160,61,.07); }
.composer__input {
  width: 100%; min-height: 190px; resize: vertical; display: block;
  padding: 20px 22px; background: none; border: 0; outline: none;
  font-size: 17px; line-height: 1.62; letter-spacing: -.01em;
}
.composer__input::placeholder { color: var(--text-3); }
.composer__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px 9px 20px; border-top: 1px solid var(--line); background: var(--bg-soft);
}
.composer__acts { display: flex; gap: 4px; }
.count { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.count b { margin-right: 3px; }
.count b { color: var(--text-2); font-weight: 600; transition: color .25s var(--ease); }
.count.is-over b { color: var(--bad); }
.count.is-near b { color: var(--accent); }

/* Der große Knopf */
.run {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 17px 24px; border-radius: var(--r); overflow: hidden;
  background: var(--accent); color: #1b1205;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 30px -12px rgba(242,160,61,.85);
  transition: transform .22s var(--spring), box-shadow .25s var(--ease), background .25s var(--ease), opacity .25s;
}
.run:hover { background: var(--accent-2); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 14px 36px -12px rgba(242,160,61,.95); }
.run:active { transform: scale(.99); }
.run:disabled {
  background: var(--surface); color: var(--text-3); opacity: 1;
  box-shadow: none; border: 1px solid var(--line); cursor: not-allowed;
}
.run:disabled .run__glow { display: none; }
.run__txt { position: relative; font-size: 15px; font-weight: 680; letter-spacing: -.015em; }
.run__hint { position: relative; font-size: 11.5px; font-weight: 550; opacity: .62; }
.run__glow {
  position: absolute; top: 0; bottom: 0; width: 42%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.42), transparent);
  transform: translateX(-160%); animation: sheen 4.6s var(--ease) infinite;
}
@keyframes sheen { 0% { transform: translateX(-160%); } 55%, 100% { transform: translateX(360%); } }
.run__spin {
  position: absolute; left: 22px; width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid rgba(27,18,5,.28); border-top-color: #1b1205; opacity: 0;
  transition: opacity .2s var(--ease);
}
.run.is-busy { pointer-events: none; }
.run.is-busy .run__spin { opacity: 1; animation: spin .8s linear infinite; }
.run.is-busy .run__glow { animation-duration: 1.4s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Bühne */
.stage { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.stage__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.stage__title { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13.5px; color: var(--text-2); }
.stage__badge {
  padding: 3px 9px; border-radius: 999px; background: var(--surface-3);
  font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.stage[data-state="run"] .stage__badge { background: var(--accent); color: #1b1205; }
.stage[data-state="done"] .stage__badge { background: rgba(86,185,141,.16); color: var(--good); }
.stage__nums { font-family: var(--mono); font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.wave {
  width: 100%; height: clamp(96px, 13vw, 132px); border-radius: var(--r-sm);
  background: var(--bg-soft); border: 1px solid var(--line);
}
.stage__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticker { height: 17px; overflow: hidden; flex: 1; }
.ticker span { display: block; font-size: 12.5px; color: var(--text-3); animation: tickIn .4s var(--ease); }
@keyframes tickIn { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }

/* Ergebnis */
.out { border-top: 1px solid var(--line); padding-top: 15px; display: flex; flex-direction: column; gap: 13px; animation: outIn .5s var(--spring); }
@keyframes outIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.out__player { display: flex; align-items: center; gap: 14px; }
.play {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--line-2);
  transition: background .22s var(--ease), transform .25s var(--spring), border-color .22s;
}
.play:hover { background: var(--accent); border-color: var(--accent); }
.play:hover svg { fill: #1b1205; }
.play svg { width: 17px; height: 17px; fill: var(--accent); }
.play .ico-pause, .player-on .play .ico-play { display: none; }
.player-on .play .ico-pause { display: block; }
.peaks { flex: 1; height: 56px; cursor: pointer; min-width: 0; }
.out__time { font-family: var(--mono); font-size: 12px; color: var(--text-3); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.out__bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.out__meta { font-size: 11.5px; color: var(--text-3); }
.out__acts { display: flex; gap: 8px; margin-left: auto; }

/* ═══════════ Archiv ═══════════ */
.ledger { display: flex; flex-direction: column; gap: 8px; }
.entry {
  display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 14px; align-items: center;
  padding: 13px 15px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .22s var(--ease), background .22s var(--ease), transform .3s var(--spring);
  animation: rowIn .5s var(--ease) both;
}
.entry:hover { background: var(--surface-2); border-color: var(--line-2); transform: translateX(3px); }
.entry__no {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px;
  background: var(--surface-3); font-family: var(--mono); font-size: 11px; color: var(--text-3);
}
.entry__body { min-width: 0; }
.entry__text { font-size: 14.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entry__meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.entry__meta b { color: var(--accent); font-weight: 600; }
@media (max-width: 620px) { .entry { grid-template-columns: 38px minmax(0,1fr); } .entry__act { grid-column: 1 / -1; } }

/* ═══════════ Werkbank ═══════════ */
.segs {
  position: relative; display: inline-flex; gap: 2px; padding: 4px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.segs__seg {
  position: relative; z-index: 1; padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 550; color: var(--text-3); transition: color .28s var(--ease);
}
.segs__seg.is-on { color: var(--text); }
.segs__pill {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px;
  background: var(--surface-3); box-shadow: var(--sh-1);
  transition: transform .45s var(--spring), width .45s var(--spring);
}
.bench__panel { display: none; }
.bench__panel.is-on { display: block; animation: viewIn .4s var(--ease); }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: var(--pad); margin-bottom: 18px; }
.form > .btn { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 620px) { .form { grid-template-columns: 1fr; } }
.field { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; font-weight: 560; color: var(--text-2); }
.field label span { color: var(--text-3); font-weight: 400; }
.field input {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 13px; outline: none; font-size: 14px;
  transition: border-color .22s var(--ease), background .22s var(--ease), box-shadow .22s;
}
.field input::placeholder { color: var(--text-3); }
.field input:focus { border-color: var(--accent-line); background: var(--surface); box-shadow: 0 0 0 3px rgba(242,160,61,.08); }
#vId { font-family: var(--mono); font-size: 12.5px; }
.field__count { position: absolute; right: 12px; bottom: 12px; font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }

.shelf { display: flex; flex-direction: column; gap: 8px; }
.vrow {
  display: flex; align-items: center; gap: 14px; padding: 12px 15px;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  transition: border-color .22s var(--ease), background .22s var(--ease);
  animation: rowIn .45s var(--ease) both;
}
.vrow:hover { border-color: var(--line-2); background: var(--surface-2); }
.vrow__name { font-size: 14px; font-weight: 560; flex: none; min-width: 130px; }
.vrow__id {
  flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
  padding: 5px 9px; border-radius: var(--r-xs); background: var(--bg-soft); border: 1px solid var(--line);
  transition: color .22s var(--ease), border-color .22s var(--ease);
}
.vrow__id:hover { color: var(--accent-2); border-color: var(--accent-line); }
.vrow__runs { font-size: 11.5px; color: var(--text-3); }
@media (max-width: 700px) { .vrow { flex-wrap: wrap; } .vrow__name { min-width: 0; } }

.table { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.trow {
  display: grid; grid-template-columns: 1.4fr .62fr .5fr .78fr .9fr auto; gap: 12px; align-items: center;
  padding: 11px 15px; background: var(--surface); font-size: 13px; transition: background .2s var(--ease);
}
.trow:hover { background: var(--surface-2); }
.trow--head { background: var(--bg-soft); font-size: 11px; font-weight: 600; color: var(--text-3); }
.trow__mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow__num { font-variant-numeric: tabular-nums; color: var(--text-2); }
.trow__acts { display: flex; gap: 6px; justify-content: flex-end; }
.trow input {
  width: 68px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-xs);
  padding: 5px 8px; font-size: 12.5px; outline: none; font-variant-numeric: tabular-nums;
}
.trow input:focus { border-color: var(--accent-line); }
.trow--log { grid-template-columns: 1.1fr 2.4fr .5fr .7fr; }
.trow--log .trow__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
@media (max-width: 760px) {
  .trow, .trow--log { grid-template-columns: 1fr 1fr; }
  .trow--head { display: none; }
}
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.stats div {
  flex: 1; min-width: 130px; padding: 14px 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
}
.stats b { display: block; font-size: 24px; font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stats span { font-size: 11.5px; color: var(--text-3); }


/* ═══════════ Voice Cloning ═══════════ */
.tabs__dot, .segs__dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-left: 6px; vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(242,160,61,.16); animation: pulse 1.6s var(--ease) infinite;
}

.note {
  display: flex; gap: 13px; align-items: flex-start; padding: 15px 17px; margin-bottom: 18px;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; line-height: 1.6; color: var(--text-2);
}
.note b { color: var(--text); font-weight: 620; }
.note svg {
  width: 17px; height: 17px; flex: none; margin-top: 2px; fill: none;
  stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.clones { display: flex; flex-direction: column; gap: 10px; }
.clone {
  padding: 16px 18px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line); animation: rowIn .45s var(--ease) both;
  transition: border-color .25s var(--ease);
}
.clone:hover { border-color: var(--line-2); }
.clone__top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.clone__name { font-size: 15px; font-weight: 620; letter-spacing: -.015em; }
.clone__when { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 620; letter-spacing: .01em;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2);
}
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag--wait { background: var(--accent-dim); color: var(--accent-2); border-color: var(--accent-line); }
.tag--wait::before { animation: pulse 1.4s var(--ease) infinite; }
.tag--done { background: rgba(86,185,141,.14); color: var(--good); border-color: rgba(86,185,141,.32); }
.tag--no { background: rgba(226,96,79,.13); color: var(--bad); border-color: rgba(226,96,79,.3); }
.clone__say {
  margin-top: 11px; padding: 11px 13px; border-radius: var(--r-sm); background: var(--bg-soft);
  border: 1px solid var(--line); font-size: 13.5px; line-height: 1.55; color: var(--text-2);
}
.clone__foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 11.5px; color: var(--text-3); }
.clone__acts { display: flex; gap: 8px; margin-left: auto; }
.clone__wait { display: flex; align-items: center; gap: 9px; margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.clone__wait i {
  flex: 1; height: 3px; border-radius: 3px; overflow: hidden;
  background: linear-gradient(90deg, var(--line) 0 40%, var(--accent-line) 50%, var(--line) 60% 100%)
              0 0 / 240% 100%; animation: slide 2.4s linear infinite;
}
@keyframes slide { to { background-position: -240% 0; } }
.clone__player { display: flex; align-items: center; gap: 12px; margin-top: 13px; }
.clone__player audio { flex: 1; min-width: 0; height: 36px; }

/* Schritte im Dialog */
.gate--wide .gate__panel { width: min(660px, 100%); max-height: min(90vh, 940px); overflow: auto; }
.step { display: flex; align-items: center; gap: 10px; margin: 20px 0 10px; }
.step__no {
  width: 21px; height: 21px; border-radius: 7px; display: grid; place-items: center; flex: none;
  background: var(--accent-dim); border: 1px solid var(--accent-line);
  color: var(--accent-2); font-size: 11.5px; font-weight: 700;
}
.step__t { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.step__t b { color: var(--text-3); font-weight: 500; }

.pass {
  padding: 15px 17px; border-radius: var(--r); background: var(--bg-soft);
  border: 1px solid var(--line); font-size: 15px; line-height: 1.72; color: var(--text);
  max-height: 168px; overflow: auto;
}
.pass em { font-style: normal; color: var(--accent-2); }

/* Aufnahme */
.rec { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.mic {
  position: relative; width: 62px; height: 62px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2);
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .2s var(--spring);
}
.mic:hover { border-color: var(--accent-line); background: var(--surface-3); }
.mic:active { transform: scale(.96); }
.mic__ico { width: 25px; height: 25px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mic__ico--stop { display: none; fill: #1b1205; stroke: none; }
.mic__ring { position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--accent); opacity: 0; }
[data-state="rec"] .mic { background: var(--accent); border-color: var(--accent); }
[data-state="rec"] .mic__ico--rec { display: none; }
[data-state="rec"] .mic__ico--stop { display: block; }
[data-state="rec"] .mic__ring { animation: halo 1.6s var(--ease) infinite; }
@keyframes halo { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.42); } }
.rec__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rec__wave { width: 100%; height: 54px; }
.rec__bar { position: relative; height: 4px; border-radius: 4px; background: var(--line); overflow: visible; }
.rec__bar i {
  display: block; height: 100%; width: 0; border-radius: 4px; background: var(--accent);
  transition: width .2s linear, background .3s var(--ease);
}
.rec__bar b { position: absolute; right: 0; top: -4px; width: 2px; height: 12px; border-radius: 2px; background: var(--line-2); }
.rec.is-ok .rec__bar i { background: var(--good); }
.rec__foot { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--text-3); }
.rec__foot span:first-child { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-2); }
.rec__done {
  display: flex; align-items: center; gap: 13px; margin-top: 13px; padding: 12px 14px;
  border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2);
  animation: outIn .4s var(--spring);
}
.rec__meta { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-2); }
.play--sm { width: 38px; height: 38px; flex: none; }
.play--sm svg { width: 14px; height: 14px; }
.rec__done.is-playing .ico-play { display: none; }
.rec__done.is-playing .ico-pause { display: block; }

.prog { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s var(--ease); }
.field textarea {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 13px; font-size: 14px; line-height: 1.55; outline: none; resize: vertical;
  min-height: 96px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(242,160,61,.08); }
.field__count--top { top: 0; bottom: auto; }

/* Werkbank: Sammelaktion + Klon-Anfragen */
.bulk { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 14px; }
.bulk__txt { flex: 1; min-width: 220px; }
.bulk__txt b { display: block; font-size: 13.5px; font-weight: 620; }
.bulk__txt span { font-size: 11.5px; color: var(--text-3); }
.bulk__acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bulk__acts input {
  width: 92px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-xs);
  padding: 9px 11px; font-size: 13.5px; outline: none; font-variant-numeric: tabular-nums;
}
.bulk__acts input:focus { border-color: var(--accent-line); }

.trow__free { font-variant-numeric: tabular-nums; font-weight: 620; color: var(--accent-2); }
.trow.is-flash { animation: flash 1.1s var(--ease); }
@keyframes flash {
  0% { background: rgba(242,160,61,.2); }
  100% { background: var(--surface); }
}

.creqs { display: flex; flex-direction: column; gap: 10px; }
.creq {
  padding: 15px 17px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  animation: rowIn .4s var(--ease) both;
}
.creq__top { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.creq__mail { font-size: 13.5px; font-weight: 600; }
.creq__name { font-size: 12.5px; color: var(--text-3); }
.creq__when { margin-left: auto; font-size: 11.5px; color: var(--text-3); }
.creq__say {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-soft);
  border: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--text-2);
  max-height: 92px; overflow: auto;
}
.creq__acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.creq__acts .prog { flex: 1; min-width: 90px; }
/* Eigene, freigegebene Stimme — im Regal wie in der Karte */
.voice.is-mine .voice__mark { background: rgba(86,185,141,.16); color: var(--good); }
.voice.is-mine.is-on .voice__mark { background: var(--accent); color: #1b1205; }
.clone.is-ready { border-color: rgba(86,185,141,.26); }
.clone__note { margin: 0 0 9px; font-size: 12.5px; color: var(--text-2); }
.clone__make { margin-top: 12px; }
.clone__make textarea {
  display: block; width: 100%; min-height: 78px; resize: vertical; outline: none;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 13px; font-size: 14px; line-height: 1.55;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.clone__make textarea::placeholder { color: var(--text-3); }
.clone__make textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(242,160,61,.08); }
.clone__foot .is-over { color: var(--bad); }
.clone__player .btn { flex: none; }

/* Werkbank: die Kennung, mit der eine Stimme frei wird */
.creq__key { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.creq__key input {
  flex: 1; min-width: 210px; outline: none;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; font-family: var(--mono); font-size: 12.5px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.creq__key input::placeholder { font-family: var(--sans); color: var(--text-3); }
.creq__key input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(242,160,61,.08); }

.up { position: relative; overflow: hidden; }
.up input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
@media (max-width: 640px) {
  .rec { flex-wrap: wrap; }
  .rec__body { min-width: 100%; }
}

/* ═══════════ Fuß ═══════════ */
.foot {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px clamp(14px, 3vw, 26px); border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--text-3);
}
.foot__mid b { color: var(--text-2); font-weight: 600; letter-spacing: .02em; }

/* ═══════════ Konto ═══════════ */
.gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.gate__back { position: absolute; inset: 0; background: rgba(6,7,9,.7); backdrop-filter: blur(6px); animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.gate__panel {
  position: relative; width: min(400px, 100%); padding: 30px 28px 24px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--sh-3); animation: gateIn .5s var(--spring);
}
@keyframes gateIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.gate.is-out .gate__panel { animation: gateOut .28s var(--ease) forwards; }
.gate.is-out .gate__back { animation: fadeOut .28s var(--ease) forwards; }
@keyframes gateOut { to { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes fadeOut { to { opacity: 0; } }
.gate__x {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; color: var(--text-3);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.gate__x:hover { background: var(--surface-2); color: var(--text); }
.gate__x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.gate__glyph {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-dim); border: 1px solid var(--accent-line); margin-bottom: 14px;
}
.gate__glyph svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.gate__title { margin: 0 0 6px; font-size: 20px; font-weight: 660; letter-spacing: -.025em; }
.gate__note { margin: 0 0 4px; font-size: 13.5px; color: var(--text-3); line-height: 1.5; }
.segs--gate { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin: 14px 0 18px; }
.segs--gate .segs__pill { width: calc(50% - 4px); }
.segs--gate.is-up .segs__pill { transform: translateX(100%); }
.form--gate { grid-template-columns: 1fr; gap: 13px; padding: 0; margin: 0; }
.form--gate > .btn { grid-column: 1; justify-self: stretch; margin-top: 4px; }
.form--gate .linkish { justify-self: center; }
.gate__msg { margin: 0; font-size: 12.5px; min-height: 16px; color: var(--bad); text-align: center; }
.gate__msg.is-good { color: var(--good); }
.gate__foot {
  margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--text-3); text-align: center;
}

/* ═══════════ Meldungen ═══════════ */
.toasts {
  position: fixed; right: 16px; top: 74px; z-index: 250;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
  max-width: min(340px, calc(100vw - 32px));
}
.toast {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line-2);
  box-shadow: var(--sh-3); font-size: 13.5px; animation: toastIn .45s var(--spring);
}
.toast::before { content: ""; width: 3px; border-radius: 3px; background: var(--accent); flex: none; }
.toast.is-bad::before { background: var(--bad); }
.toast.is-good::before { background: var(--good); }
.toast.is-out { animation: toastOut .3s var(--ease) forwards; }
.toast__code { display: block; margin-top: 3px; font-family: var(--mono); font-size: 10px; color: var(--text-3); }
@keyframes toastIn { from { opacity: 0; transform: translateX(22px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(22px); } }

/* ═══════════ Handy: untere Leiste, Bögen, sichere Ränder ═══════════
   Ab hier sieht die Seite aus wie eine App: Navigation unten am Daumen,
   Dialoge fahren als Blatt von unten herein, nichts läuft unter die
   Kerbe oder die Wischleiste. */
@media (max-width: 700px) {
  /* Die Polsterung muss hier noch einmal stehen: die schmale Fassung
     weiter oben setzt padding und würde die Kerbe sonst überschreiben. */
  .top { grid-template-columns: auto 1fr; gap: 8px; padding: env(safe-area-inset-top) 12px 0; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    gap: 2px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border: 0; border-top: 1px solid var(--line); border-radius: 0;
    background: rgba(10,11,13,.88); backdrop-filter: blur(22px) saturate(1.4);
  }
  .tabs__tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; min-height: 50px; padding: 6px 2px; border-radius: var(--r-sm);
    font-size: 10.5px; font-weight: 600; letter-spacing: 0;
  }
  .tabs__tab:active { background: rgba(255,255,255,.05); }
  .tabs__ico { display: block; }
  .tabs__pill { display: none; }
  .tabs__tab.is-on { color: var(--accent); }
  .tabs__tab.is-on .tabs__ico { stroke-width: 2.15; }
  .tabs__dot { position: absolute; top: 6px; right: 50%; margin: 0 -16px 0 0; }

  /* Platz für die Leiste — sonst klebt der letzte Knopf darunter. */
  .app { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .foot { display: none; }
  .toasts { top: auto; bottom: calc(68px + env(safe-area-inset-bottom)); right: 12px; left: 12px; max-width: none; }

  /* Dialoge als Blatt von unten */
  .gate { place-items: end stretch; padding: 0; }
  .gate__panel {
    width: 100%; max-width: none; max-height: 92dvh; overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0;
    padding: 12px 20px calc(22px + env(safe-area-inset-bottom));
    animation: sheetIn .44s var(--spring);
  }
  .gate--wide .gate__panel { width: 100%; max-height: 92dvh; }
  .gate__panel::before {
    content: ""; display: block; width: 40px; height: 4px; border-radius: 2px;
    background: var(--line-2); margin: 0 auto 16px;
  }
  .gate.is-out .gate__panel { animation: sheetOut .28s var(--ease) forwards; }
  .gate__x { top: 14px; right: 14px; }

  /* Unter 16px zoomt iOS beim Antippen ins Feld hinein. */
  .field input, .field textarea, .field select,
  .clone__make textarea, .creq__key input, #scriptInput { font-size: 16px; }

  /* Daumengerechte Ziele */
  .btn { min-height: 42px; }
  .btn--quiet { min-height: 38px; }
}
@keyframes sheetIn { from { opacity: .4; transform: translateY(100%); } to { opacity: 1; transform: none; } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(100%); } }

/* Eingebaut gestartet (nicht im Browser-Tab): kein Textmarkieren aus
   Versehen, und die Auswahl fühlt sich an wie in einer nativen App. */
@media (display-mode: standalone) {
  .foot__mid { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
