/* Teleprompter · Julius Schade Media — Editor im Markenlook, Prompter dunkel */

@font-face { font-family: "Instrument Sans"; src: url("/teleprompter/fonts/instrument-sans-v4-latin_latin-ext-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/teleprompter/fonts/instrument-sans-v4-latin_latin-ext-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/teleprompter/fonts/instrument-sans-v4-latin-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/teleprompter/fonts/bricolage-grotesque-v9-latin_latin-ext-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/teleprompter/fonts/bricolage-grotesque-v9-latin_latin-ext-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg: #FBFAF8;
  --bg-2: #F4F1EC;
  --surface: #ffffff;
  --text: #1c1a17;
  --muted: #6c655c;
  --line: #e7e1d8;
  --accent: #F25C2B;
  --accent-strong: #d9481b;
  --accent-soft: #fde8df;
  --focus: #F25C2B;
  --shadow: 0 1px 2px rgba(28, 26, 23, .05), 0 6px 22px rgba(28, 26, 23, .06);
  --r-1: 10px;
  --r-2: 14px;
  --r-3: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12110f;
    --bg-2: #1c1a17;
    --surface: #1f1d1a;
    --text: #f3eee7;
    --muted: #a69d92;
    --line: #34302a;
    --accent-soft: #3b2219;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 22px; height: 22px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
}
@media (hover: hover) { .btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); } }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--quiet { background: transparent; color: var(--muted); }
.btn--small { min-height: 36px; font-size: 14px; padding: 0 12px; }
.btn--primary { background: var(--accent); border-color: transparent; color: #fff; }
@media (hover: hover) { .btn--primary:hover { background: var(--accent-strong); border-color: transparent; } }
.btn--primary:disabled { background: color-mix(in srgb, var(--accent) 40%, var(--bg-2)); cursor: not-allowed; box-shadow: none; }
.btn--xl { min-height: 62px; width: min(560px, 100%); padding: 0 34px; font-size: 19px; font-weight: 700; box-shadow: 0 8px 24px rgba(242, 92, 43, .32); }
.btn--xl .i { width: 24px; height: 24px; }

/* ---------- Editor ---------- */
.editor {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.ed-head {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__icon { width: 40px; height: 40px; border-radius: 10px; display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font: 700 21px/1.1 var(--font-head); letter-spacing: -.015em; }
.brand__by { font-size: 13px; color: var(--muted); }

.ed-body {
  flex: 1;
  width: 100%; max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start;
  padding: 20px;
}
@media (max-width: 960px) { .ed-body { grid-template-columns: minmax(0, 1fr); } }

.ed-script { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ed-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.select {
  min-height: 44px; min-width: 0; width: 200px; max-width: 100%; flex: 1 1 200px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23887f74' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  font-size: 16px; font-weight: 600;
  appearance: none; -webkit-appearance: none;
  text-overflow: ellipsis;
}
#script {
  width: 100%;
  min-height: 46vh; min-height: 46dvh;
  padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--r-2);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 19px; line-height: 1.6;
  resize: vertical;
}
#script:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (min-width: 961px) { #script { min-height: calc(100dvh - 300px); } }
.ed-stats { margin: 2px 4px 0; color: var(--text); font-weight: 600; font-size: 15px; }
.ed-hint { margin: 0 4px; color: var(--muted); font-size: 14px; }
.ed-hint b { font-weight: 600; color: var(--text); }

.ed-settings { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel {
  display: grid; gap: 16px;
  padding: 18px 18px 14px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-3);
  box-shadow: var(--shadow);
}
.panel__title { margin: 6px 0 -4px; font: 600 13px/1.2 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.panel__title:first-child { margin-top: 0; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0; font-weight: 600; font-size: 15px; }
.field > legend { margin-bottom: 6px; }
.field output { font-weight: 600; color: #b13c12; font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { .field output { color: #ff8a5f; } }

input[type="range"] { width: 100%; height: 30px; margin: 0; accent-color: var(--accent); background: transparent; cursor: pointer; }

.seg { display: flex; gap: 3px; padding: 3px; background: var(--bg-2); border-radius: 12px; }
.seg label { flex: 1; position: relative; min-width: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; pointer-events: none; }
.seg span {
  display: block; padding: 9px 4px; border-radius: 9px;
  text-align: center; font-size: 14px; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

.switches { display: grid; gap: 10px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__ui {
  flex: none; position: relative; width: 46px; height: 28px; border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, var(--bg-2));
  transition: background-color .2s var(--ease);
}
.switch__ui::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s var(--ease);
}
.switch input:checked + .switch__ui { background: var(--accent); }
.switch input:checked + .switch__ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch__label { display: flex; flex-direction: column; font-weight: 600; font-size: 15px; line-height: 1.25; }
.switch__label small { font-weight: 400; font-size: 13px; color: var(--muted); }

.swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; pointer-events: none; }
.swatch span {
  display: flex; align-items: center; min-height: 44px; padding: 8px 12px;
  border-radius: 12px; border: 2px solid transparent;
  font-size: 14px; font-weight: 600; line-height: 1.2;
}
.swatch--dark span { background: #000; color: #fff; }
.swatch--yellow span { background: #000; color: #ffd84d; }
.swatch--light span { background: #fff; color: #111; border-color: var(--line); }
.swatch--dim span { background: #141414; color: #a8a8a8; }
.swatch input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.swatch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.privacy { margin: 0 6px; font-size: 13px; color: var(--muted); }

.ed-actions {
  position: sticky; bottom: 0; z-index: 9;
  display: flex; justify-content: center;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, color-mix(in srgb, var(--bg) 0%, transparent));
}
.ed-foot { padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: 14px; }
.ed-foot__pitch { max-width: 720px; margin: 0 auto 10px; }
.ed-foot__pitch a { color: var(--text); font-weight: 600; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.ed-foot__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; }
.ed-foot__links a { text-decoration: none; }
.ed-foot__links a:hover { text-decoration: underline; }

.ed-toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: 14px;
  background: #1c1a17; color: #fff; font-size: 15px; line-height: 1.35; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  opacity: 0; pointer-events: none; transform: translate(-50%, 8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.ed-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Hilfe ---------- */
.help {
  width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: var(--r-3);
  background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  overflow: auto;
  overscroll-behavior: contain;
}
.help::backdrop { background: rgba(10, 9, 8, .55); }
.help__inner { padding: 20px 24px 26px; }
.help__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.help h2 { margin: 0; font: 700 24px/1.2 var(--font-head); letter-spacing: -.01em; }
.help h3 { margin: 20px 0 8px; font-size: 16px; }
.help__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 36px; }
.help ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.help p { margin: 0; }
.help__note { margin-top: 10px !important; color: var(--muted); font-size: 14px; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0; font-size: 15px; }
.keys dt { font-weight: 600; }
.keys dd { margin: 0; color: var(--muted); }
kbd {
  display: inline-block; min-width: 1.9em; padding: 1px 6px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
  background: var(--bg-2); font: 600 13px/1.5 var(--font-ui); text-align: center;
}

/* ---------- Prompter ---------- */
html.is-prompting, html.is-prompting body { height: 100%; overflow: hidden; }
html.is-prompting body { background: #000; }

.prompter {
  --p-bg: #000; --p-fg: #fff; --p-fade: rgba(0, 0, 0, .66); --p-cue: #ff8f66; --p-accent: #F25C2B;
  position: fixed; inset: 0; z-index: 20;
  background: var(--p-bg); color: var(--p-fg);
  overflow: hidden;
  touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.prompter[data-theme="yellow"] { --p-fg: #ffd84d; --p-cue: #8fd3ff; }
.prompter[data-theme="light"] { --p-bg: #fff; --p-fg: #111; --p-fade: rgba(255, 255, 255, .7); --p-cue: #c2410c; }
.prompter[data-theme="dim"] { --p-bg: #0b0b0b; --p-fg: #a9a9a9; --p-fade: rgba(11, 11, 11, .62); --p-cue: #d99070; --p-accent: #b8532f; }

.stage { position: absolute; inset: 0; overflow: hidden; transform-origin: 50% 50%; cursor: grab; }
.prompter.is-idle .stage { cursor: none; }
.track { position: absolute; top: 0; left: 0; right: 0; will-change: transform; }
.script {
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; hyphens: manual;
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}
.script strong { font-weight: 700; text-decoration: underline; text-decoration-color: var(--p-accent); text-decoration-thickness: .08em; text-underline-offset: .16em; }
.script .cue { color: var(--p-cue); font-weight: 600; font-style: italic; font-size: .72em; }

.fade, .marker { position: absolute; left: 0; right: 0; pointer-events: none; display: none; }
.prompter.has-fade .fade { display: block; }
.prompter.has-marker .marker { display: block; }
.fade {
  top: 0;
  height: calc(var(--marker-y, 33vh) - var(--line-box, 80px) * .5);
  background: linear-gradient(to bottom, var(--p-fade) 0%, var(--p-fade) 72%, color-mix(in srgb, var(--p-fade) 25%, transparent) 100%);
}
.marker { top: var(--marker-y, 33vh); height: 0; }
.marker::before, .marker::after {
  content: ""; position: absolute; top: -15px; width: 0; height: 0;
  border-top: 15px solid transparent; border-bottom: 15px solid transparent;
}
.marker::before { left: max(2px, env(safe-area-inset-left)); border-left: 20px solid var(--p-accent); }
.marker::after { right: max(2px, env(safe-area-inset-right)); border-right: 20px solid var(--p-accent); }

.countdown {
  position: absolute; left: 50%; top: var(--marker-y, 33vh); z-index: 2;
  width: 180px; height: 180px; margin: -90px 0 0 -90px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--p-bg) 70%, transparent);
  border: 4px solid var(--p-accent);
  color: var(--p-fg);
  font: 700 96px/1 var(--font-head);
  font-variant-numeric: tabular-nums;
}
.countdown.pulse { animation: cd-pulse 1s var(--ease) both; }
@keyframes cd-pulse { 0% { transform: scale(1.25); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.96); opacity: 1; } }

.progress { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: color-mix(in srgb, var(--p-fg) 10%, transparent); }
.progress span { display: block; height: 100%; background: var(--p-accent); transform-origin: 0 50%; transform: scaleX(0); }

.p-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
  pointer-events: none;
  transition: opacity .35s var(--ease);
}
.p-top > * { pointer-events: auto; }
.p-time {
  padding: 8px 14px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 10px;
  padding: 28px max(12px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: linear-gradient(to top, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .6) 65%, rgba(0, 0, 0, 0) 100%);
  color: #fff;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.prompter.is-idle .controls { opacity: 0; transform: translateY(14px); pointer-events: none; }
.prompter.is-idle .p-top { opacity: 0; pointer-events: none; }
.prompter.is-idle .p-top > * { pointer-events: none; }

.ctl {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 50px; height: 50px; padding: 0 14px;
  border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 15px; font-weight: 600;
  transition: background-color .15s var(--ease), transform .12s var(--ease);
}
@media (hover: hover) { .ctl:hover { background: rgba(255, 255, 255, .26); } }
.ctl:active { transform: scale(.94); }
.ctl:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ctl[aria-pressed="true"], .ctl[aria-pressed="true"]:hover { background: #fff; color: #000; }
.ctl--play { min-width: 68px; height: 68px; background: var(--p-accent); }
@media (hover: hover) { .ctl--play:hover { background: var(--accent-strong); } }
.ctl--play .i { width: 30px; height: 30px; }
.ctl--small { min-width: 42px; height: 42px; padding: 0 8px; background: transparent; }
.ctl-group { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.ctl-val { min-width: 76px; text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.aa { font: 700 15px/1 var(--font-ui); }
.aa--l { font-size: 21px; }
#exitBtn { background: rgba(0, 0, 0, .55); }
@media (hover: hover) { #exitBtn:hover { background: rgba(40, 40, 40, .8); } }

.toast {
  position: absolute; left: 50%; top: calc(74px + env(safe-area-inset-top)); z-index: 4;
  padding: 10px 18px; border-radius: 999px;
  background: rgba(20, 20, 20, .88); color: #fff;
  font-size: 16px; font-weight: 600; white-space: nowrap;
  opacity: 0; pointer-events: none; transform: translate(-50%, -6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .ed-head { padding-left: 14px; padding-right: 14px; }
  .ed-body { padding: 14px; gap: 16px; }
  .btn span { display: none; }
  .btn--xl span, .ed-head .btn span { display: inline; }
  .ed-toolbar .btn { min-width: 44px; padding: 0 12px; }
  .ctl { min-width: 46px; height: 46px; padding: 0 12px; }
  .ctl--play { min-width: 62px; height: 62px; }
  .ctl-val { min-width: 62px; font-size: 13px; }
  .countdown { width: 140px; height: 140px; margin: -70px 0 0 -70px; font-size: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Videobotschaft: Kamera-Modus ---------- */
.ed-actions { gap: 12px; flex-wrap: wrap; }
.btn--cam {
  min-height: 62px; padding: 0 28px; font-size: 18px;
  background: var(--surface); border-color: var(--line); color: var(--text);
}
.btn--cam .i { color: #e5372b; width: 24px; height: 24px; }
@media (max-width: 640px) { .ed-actions .btn--xl, .ed-actions .btn--cam { width: 100%; } }
.btn--cam.is-hint { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }

.cam {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
}
.cam.is-mirrored { transform: scaleX(-1); }
.prompter.is-camera { background: #000; }
.prompter.is-camera .stage {
  z-index: 1;
  top: calc(64px + env(safe-area-inset-top));
  bottom: auto;
  height: var(--cam-band, 40%);
  background: linear-gradient(to bottom, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .62) 78%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
}
.prompter.is-camera .fade { background: linear-gradient(to bottom, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .35) 72%, rgba(0, 0, 0, 0) 100%); }
.prompter.is-camera .script { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.prompter.is-camera .p-top { padding-top: calc(10px + env(safe-area-inset-top)); }
.prompter.is-camera .progress { top: auto; bottom: 0; }
.prompter.is-camera #mirrorHBtn, .prompter.is-camera #mirrorVBtn { display: none; }
.prompter.is-camera .countdown { top: 50%; }

.ctl--rec { min-width: 72px; height: 72px; background: rgba(255, 255, 255, .92); color: #e5372b; }
.ctl--rec .i { width: 34px; height: 34px; }
@media (hover: hover) { .ctl--rec:hover { background: #fff; } }
.prompter.is-recording .ctl--rec { background: #e5372b; color: #fff; }
.prompter.is-recording .ctl--rec .i { width: 26px; height: 26px; }

.rec-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(229, 55, 43, .92); color: #fff;
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.rec-badge__dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: rec-blink 1.2s steps(2, start) infinite; }
@keyframes rec-blink { to { visibility: hidden; } }

.mic {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto;
  padding: 9px 12px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff;
}
.mic__icon { width: 16px; height: 16px; }
.mic__bar { position: relative; width: 54px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.mic__bar span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: #4ade80; transition: width .08s linear; }

/* Prüfen-Ansicht und Fehlermeldung */
.sheet {
  position: absolute; inset: 0; z-index: 10;
  display: grid; place-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(10, 9, 8, .72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  overflow: auto;
}
.sheet__inner {
  width: min(720px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 22px;
  border-radius: 22px;
  background: #1c1a17; color: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  display: grid; gap: 14px;
}
.sheet__title { margin: 0; font: 700 24px/1.2 var(--font-head); }
.sheet__video { width: 100%; max-height: 52vh; max-height: 52dvh; border-radius: 14px; background: #000; }
.sheet__meta { margin: 0; color: #c9c2b8; font-size: 14px; font-variant-numeric: tabular-nums; }
.sheet__text { margin: 0; color: #e8e2da; font-size: 16px; line-height: 1.55; }
.sheet__note { margin: 0; color: #a69d92; font-size: 13.5px; line-height: 1.5; }
.sheet__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px;
  background: rgba(255, 255, 255, .08); color: #fff;
  font-size: 16px; font-weight: 600; cursor: pointer; touch-action: manipulation;
}
@media (hover: hover) { .rbtn:hover { background: rgba(255, 255, 255, .16); } }
.rbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.rbtn--primary { background: var(--accent); border-color: transparent; }
@media (hover: hover) { .rbtn--primary:hover { background: var(--accent-strong); } }
.rbtn--quiet { justify-self: start; border-color: transparent; background: transparent; color: #c9c2b8; padding: 0 4px; min-height: 44px; }
@media (max-width: 600px) { .sheet__actions .rbtn { flex: 1 1 100%; } }
.prompter.is-camera .p-top { background: linear-gradient(to bottom, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0)); }
.prompter.is-camera .toast { top: auto; bottom: calc(180px + env(safe-area-inset-bottom)); }
@media (max-width: 560px) { .prompter.is-camera .p-time { display: none; } }

/* ---------- Vereinfachter Editor (Einstellungen in der Schublade) ---------- */
.ed-body { grid-template-columns: minmax(0, 1fr); max-width: 980px; padding-top: 18px; }
.ed-toolbar { justify-content: space-between; flex-wrap: nowrap; }
.ed-toolbar .select { flex: 0 1 360px; }
.ed-title { font: 600 18px/1.2 var(--font-head); color: var(--text); padding-left: 4px; }
.ed-toolbar__end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#script { min-height: max(260px, calc(100vh - 330px)); min-height: max(260px, calc(100dvh - 330px)); font-size: 20px; }
.ed-stats { color: var(--muted); font-weight: 500; }
.btn--icon-only { width: 44px; min-width: 44px; padding: 0; }
.btn--icon-only.btn--small { width: 40px; min-width: 40px; }
.ed-head__actions { display: flex; align-items: center; gap: 4px; }
@media (max-width: 600px) {
  .ed-head .btn span { display: none; }
  .ed-head #openSettings { width: 44px; padding: 0; }
  .ed-toolbar .btn--small span { display: inline; }
}
.ed-foot__privacy { margin: 0 auto 8px; font-size: 13.5px; }

/* Menü „Weitere Aktionen" */
.menu { position: relative; }
.menu__list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .16);
  display: grid;
}
.menu__item {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text);
  font: 500 15px/1 var(--font-ui); text-align: left; cursor: pointer;
}
.menu__item .i { width: 20px; height: 20px; color: var(--muted); }
.menu__item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (hover: hover) { .menu__item:hover { background: var(--bg-2); } }
.menu__item--danger { color: #b42318; }
.menu__item--danger .i { color: #b42318; }

/* Schublade */
.drawer {
  width: min(440px, 100vw); max-width: 100vw;
  height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh;
  margin: 0 0 0 auto; padding: 0; border: 0;
  border-radius: 22px 0 0 22px;
  background: var(--surface); color: var(--text);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .22);
  overflow: hidden;
}
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in .26s var(--ease); }
.drawer::backdrop { background: rgba(10, 9, 8, .38); }
@keyframes drawer-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px 22px;
  border-bottom: 1px solid var(--line);
}
.drawer__title { margin: 0; font: 700 22px/1.2 var(--font-head); }
.drawer__body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 20px 22px; display: grid; gap: 20px; align-content: start; }
.drawer__foot { padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.drawer__done { width: 100%; min-height: 50px; font-size: 17px; }
.more { border-top: 1px solid var(--line); padding-top: 14px; }
.more summary {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 15px; color: var(--text);
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ""; width: 9px; height: 9px; margin-right: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform .2s var(--ease); }
.more[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.more summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.more__body { display: grid; gap: 20px; padding-top: 12px; }
@media (max-width: 640px) {
  .drawer { margin: auto 0 0 0; width: 100vw; height: auto; max-height: 90vh; max-height: 90dvh; border-radius: 22px 22px 0 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .22); }
  .drawer[open] { animation-name: sheet-in; }
  .drawer__head { padding-top: 14px; }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ---------- Prompter: schlanke Leiste + Schnell-Einstellungen ---------- */
.qs {
  position: absolute; z-index: 5;
  right: max(12px, env(safe-area-inset-right)); bottom: calc(96px + env(safe-area-inset-bottom));
  width: min(380px, calc(100vw - 24px));
  padding: 14px; border-radius: 20px;
  background: rgba(24, 23, 21, .96); color: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
  display: grid; gap: 12px;
}
.qs__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.qs__label { font-size: 14px; font-weight: 600; color: #cfc8bf; }
.qs__btns { display: flex; gap: 8px; }
.qs__row--actions { justify-content: flex-start; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .12); }
.ctl--wide { padding: 0 14px; gap: 8px; height: 46px; font-size: 14px; }
.prompter.is-camera .qs__row--mirror { display: none; }
#qsBtn[aria-expanded="true"] { background: #fff; color: #000; }
@media (max-width: 600px) { .qs { bottom: calc(150px + env(safe-area-inset-bottom)); } }
.ed-actions .btn span { display: inline; }
.qs { background: #181715; z-index: 6; }
@media (max-width: 600px) { .qs { bottom: calc(104px + env(safe-area-inset-bottom)); } .prompter.is-camera .qs { bottom: calc(160px + env(safe-area-inset-bottom)); } }
.drawer__title:focus { outline: none; }
