/* Teleprompter — estilos (sem dependências externas) */
:root {
  --bg: #0a0a0d;
  --surface: #15151b;
  --surface-2: #1e1e26;
  --surface-3: #272731;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f4f6;
  --muted: #9b9ba8;
  --accent: #ff4d5a;
  --accent-press: #e63e4b;
  --accent-soft: rgba(255, 77, 90, 0.16);
  --danger: #ff6b6b;
  --radius: 18px;
  --radius-sm: 12px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body { overflow: hidden; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: 0.38; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.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;
}
.muted { color: var(--muted); }

.ico {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Quadro do app ---------- */
#app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}
@media (min-width: 700px) and (min-height: 560px) {
  body { display: grid; place-items: center; background: #050507; }
  #app {
    width: 420px;
    height: min(calc(100dvh - 40px), 900px);
    border-radius: 32px;
    border: 1px solid var(--line);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  }
}

.view {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  animation: viewIn 0.18s var(--ease);
}
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Barra de topo ---------- */
.appbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(var(--sat) + 8px) calc(var(--sar) + 12px) 8px calc(var(--sal) + 12px);
  min-height: calc(var(--sat) + 60px);
}
.appbar-title { display: flex; align-items: center; gap: 10px; padding-left: 6px; }
.appbar-title h1 { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.appbar-actions { display: flex; align-items: center; gap: 6px; }
.appbar-spacer { width: 44px; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-grid; place-items: center;
  color: var(--text);
  transition: background-color 0.15s, transform 0.12s;
}
.icon-btn:active:not(:disabled) { transform: scale(0.93); background: rgba(255, 255, 255, 0.08); }
.icon-btn.small { width: 40px; height: 40px; min-width: 44px; min-height: 44px; }

.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 14px; border-radius: 22px;
  background: var(--surface-2); font-weight: 600; font-size: 15px;
}
.pill-btn .ico { width: 20px; height: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 14px;
  background: var(--surface-2); color: var(--text);
  font-weight: 650; font-size: 16px;
  transition: background-color 0.15s, transform 0.12s;
}
.btn .ico { width: 20px; height: 20px; }
.btn:active:not(:disabled) { transform: scale(0.97); background: var(--surface-3); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:active:not(:disabled) { background: var(--accent-press); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger-ghost { background: transparent; border: 1px solid rgba(255, 107, 107, 0.35); color: var(--danger); }
.btn.danger { background: #e5484d; color: #fff; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn.big { min-height: 56px; font-size: 17px; border-radius: 16px; }
.btn.full { width: 100%; }

.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px; border-radius: 22px;
  background: var(--surface-2); font-weight: 600; font-size: 15px;
}
.chip-btn .ico { width: 20px; height: 20px; }

.glass {
  background: rgba(16, 16, 22, 0.52);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Lista ---------- */
.list-main {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 4px calc(var(--sar) + 14px) calc(var(--sab) + 110px) calc(var(--sal) + 14px);
  overscroll-behavior: contain;
}
.script-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card {
  display: flex; align-items: stretch;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.card-main {
  flex: 1; min-width: 0; text-align: left;
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 6px 14px 16px;
}
.card-main:active { background: rgba(255, 255, 255, 0.03); }
.card-title { font-size: 17px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-snippet {
  color: var(--muted); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-meta b { color: var(--text); font-weight: 600; }
.card-actions { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 8px 10px 8px 0; }
.card-actions .play { background: var(--accent); color: #fff; }
.card-actions .play .ico { width: 20px; height: 20px; }

.empty { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty h2 { color: var(--text); font-size: 20px; margin: 16px 0 6px; }
.empty p { margin: 0; }
.empty-art { width: 72px; height: 72px; margin: 0 auto; border-radius: 22px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.empty-art .ico { width: 34px; height: 34px; }

.ios-tip {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-soft); border: 1px solid rgba(255, 77, 90, 0.3);
  border-radius: var(--radius-sm); padding: 6px 6px 6px 14px; margin-bottom: 12px; font-size: 14px;
}
.ios-tip p { margin: 0; flex: 1; }

.fab {
  position: absolute; right: calc(var(--sar) + 18px); bottom: calc(var(--sab) + 20px);
  display: inline-flex; align-items: center; gap: 8px;
  height: 58px; padding: 0 22px 0 18px; border-radius: 29px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: 0 10px 30px rgba(255, 77, 90, 0.35);
  transition: transform 0.12s, background-color 0.15s;
}
.fab:active { transform: scale(0.96); background: var(--accent-press); }

/* ---------- Editor ---------- */
.save-state { color: var(--muted); font-size: 14px; }
.editor-main {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  padding: 0 calc(var(--sar) + 16px) 0 calc(var(--sal) + 16px);
}
.ed-title {
  width: 100%; border: 0; background: transparent;
  font-size: 24px; font-weight: 700; letter-spacing: -0.01em;
  padding: 8px 2px 12px; border-bottom: 1px solid var(--line);
}
.ed-title::placeholder, .ed-text::placeholder { color: #5f5f6c; }
.ed-text {
  flex: 1; min-height: 0; width: 100%; resize: none; border: 0; background: transparent;
  font-size: 18px; line-height: 1.55; padding: 14px 2px;
}
.editor-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px calc(var(--sar) + 14px) calc(var(--sab) + 12px) calc(var(--sal) + 14px);
  border-top: 1px solid var(--line); background: var(--bg);
}
.ed-count { flex: 1; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.25; }

/* ---------- Teleprompter ---------- */
.prompter {
  --top-h: calc(var(--sat) + 74px);
  --bottom-h: calc(var(--sab) + 112px);
  --tp-size: 40px;
  --tp-lh: 1.4;
  --tp-margin: 6%;
  --tp-color: #fff;
  --tp-bg: 0.45;
  background: #000;
  animation: none;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.cam {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #000;
  opacity: 0; transition: opacity 0.25s;
}
.cam.on { opacity: 1; }
.cam.mirror { transform: scaleX(-1); }

.stage { position: absolute; inset: 0; z-index: 1; touch-action: none; cursor: grab; }
.stage:active { cursor: grabbing; }

.band {
  position: absolute; left: 0; right: 0;
  top: var(--top-h);
  height: 34%;
  transition: height 0.2s var(--ease);
}
.band[data-area="half"] { height: min(50%, calc(100% - var(--top-h) - var(--bottom-h))); }
.band[data-area="full"] { height: auto; bottom: var(--bottom-h); }
.band-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, var(--tp-bg)); }
.prompter.read-only .band-bg { background: transparent; }

.viewport {
  position: absolute; inset: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 88%, transparent 100%);
}
.flipper { position: absolute; inset: 0; transform-origin: 50% 50%; }
.scroller {
  position: absolute; left: 0; right: 0; top: 0;
  padding: 0 calc(var(--tp-margin) + var(--sar) + 8px) 0 calc(var(--tp-margin) + var(--sal) + 8px);
  will-change: transform;
}
.script-text {
  margin: 0;
  font-size: var(--tp-size);
  line-height: var(--tp-lh);
  color: var(--tp-color);
  font-weight: 560;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  letter-spacing: 0.005em;
}
.prompter.bold .script-text { font-weight: 760; }
.prompter.upper .script-text { text-transform: uppercase; letter-spacing: 0.02em; }
.prompter[data-align="center"] .script-text { text-align: center; }
.script-text .cue { opacity: 0.42; font-weight: 450; font-style: italic; }
.end-mark {
  margin: calc(var(--tp-size) * 0.6) 0 40vh;
  text-align: center; color: var(--tp-color); opacity: 0.35;
  font-size: max(14px, calc(var(--tp-size) * 0.4)); letter-spacing: 0.3em; text-transform: uppercase;
}

.guide {
  position: absolute; left: 0; right: 0; height: 0;
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none; z-index: 2;
}
/* linha bem discreta: quem marca a leitura são as setas; linha forte parece texto riscado */
.guide span { flex: 1; height: 1px; margin: 0 6px; background: linear-gradient(to right, rgba(255, 77, 90, 0.3), transparent 22%, transparent 78%, rgba(255, 77, 90, 0.3)); }
.guide i {
  width: 0; height: 0; border-top: 9px solid transparent; border-bottom: 9px solid transparent;
  margin-top: 0;
}
.guide i:first-child { border-left: 12px solid var(--accent); margin-left: calc(var(--sal) + 2px); }
.guide i:last-child { border-right: 12px solid var(--accent); margin-right: calc(var(--sar) + 2px); }
.prompter:not(.show-guide) .guide { display: none; }

.state-chip {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  padding: 6px 12px; border-radius: 14px;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 13px; font-weight: 600;
  pointer-events: none; white-space: nowrap;
  opacity: 0; transition: opacity 0.2s;
}
.state-chip.show { opacity: 1; }

/* topo do teleprompter */
.tp-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3;
  padding: calc(var(--sat) + 8px) calc(var(--sar) + 10px) 0 calc(var(--sal) + 10px);
  pointer-events: none;
}
.tp-top > * { pointer-events: auto; }
.tp-top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tp-top-actions { display: flex; gap: 8px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 18px;
  font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums;
  max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #777; flex: none; }
.prompter.recording .rec-dot { background: var(--accent); animation: blink 1s steps(2, start) infinite; }
.prompter.recording .status-pill { background: rgba(255, 77, 90, 0.25); border-color: rgba(255, 77, 90, 0.5); }
@keyframes blink { to { visibility: hidden; } }

.tp-progress-row { display: flex; align-items: center; gap: 10px; height: 22px; margin-top: 6px; padding: 0 4px; }
.progress { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.progress-fill { height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.remaining { font-size: 12px; font-weight: 650; color: rgba(255, 255, 255, 0.85); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); min-width: 40px; text-align: right; }

/* trilho de ajustes rápidos */
.tp-rail {
  position: absolute; z-index: 3;
  right: calc(var(--sar) + 10px);
  bottom: calc(var(--bottom-h) + 10px);
  display: flex; flex-direction: column; align-items: center;
  border-radius: 24px; padding: 2px;
}
.rail-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.rail-btn:active { background: rgba(255, 255, 255, 0.12); }
.rail-btn .ico { width: 20px; height: 20px; }
.rail-val { display: flex; flex-direction: column; align-items: center; font-size: 12px; line-height: 1; color: rgba(255, 255, 255, 0.85); padding: 2px 0; }
.rail-val .ico { width: 15px; height: 15px; opacity: 0.7; margin-bottom: 2px; }
.rail-val b { font-variant-numeric: tabular-nums; font-weight: 700; }
.rail-sep { width: 22px; height: 1px; background: rgba(255, 255, 255, 0.18); margin: 4px 0; }

/* rodapé com botão de gravar */
.tp-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  height: var(--bottom-h);
  padding: 0 calc(var(--sar) + 14px) var(--sab) calc(var(--sal) + 14px);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
}
.main-btn {
  width: 78px; height: 78px; border-radius: 50%; flex: none;
  border: 4px solid rgba(255, 255, 255, 0.92);
  display: grid; place-items: center;
  transition: transform 0.12s;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.main-btn:active { transform: scale(0.94); }
.main-inner {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  transition: border-radius 0.2s var(--ease), width 0.2s var(--ease), height 0.2s var(--ease);
}
.main-inner .ico { width: 28px; height: 28px; grid-area: 1 / 1; display: none; }
.main-btn[data-state="recording"] .main-inner { width: 30px; height: 30px; border-radius: 8px; }
.main-btn[data-state="play"] .ico-play { display: block; margin-left: 3px; }
.main-btn[data-state="pause"] .ico-pause { display: block; }
.main-btn[data-state="countdown"] .main-inner { background: rgba(255, 255, 255, 0.25); }

/* aviso de câmera */
.cam-msg {
  position: absolute; z-index: 4;
  left: calc(var(--sal) + 14px); right: calc(var(--sar) + 70px);
  bottom: calc(var(--bottom-h) + 10px);
  border-radius: var(--radius); padding: 14px;
  font-size: 15px;
}
.cam-msg p { margin: 0 0 10px; }
.cam-msg-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* contagem regressiva */
.countdown {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(0, 0, 0, 0.35);
}
.countdown-num {
  font-size: 140px; font-weight: 800; line-height: 1; color: #fff;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
  font-variant-numeric: tabular-nums;
}
.countdown-num.tick { animation: tick 0.9s var(--ease); }
@keyframes tick { from { transform: scale(1.35); opacity: 0.2; } 30% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
.countdown-hint { font-size: 14px; color: rgba(255, 255, 255, 0.8); }

/* paisagem: controles na lateral direita */
@media (orientation: landscape) and (max-height: 560px) {
  .prompter { --top-h: calc(var(--sat) + 70px); --bottom-h: 0px; --side-w: calc(var(--sar) + 104px); }
  .band { right: var(--side-w); height: 50%; }
  .band[data-area="half"] { height: 68%; }
  .band[data-area="full"] { bottom: calc(var(--sab) + 8px); }
  .tp-top { right: var(--side-w); }
  .tp-bottom {
    left: auto; top: 0; height: auto; width: var(--side-w);
    flex-direction: column; justify-content: space-evenly;
    padding: calc(var(--sat) + 6px) var(--sar) calc(var(--sab) + 6px) 0;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.55), transparent);
  }
  .tp-bottom .icon-btn { width: 40px; height: 40px; min-height: 44px; }
  .main-btn { width: 66px; height: 66px; }
  .main-inner { width: 50px; height: 50px; }
  .tp-rail { right: calc(var(--side-w) + 8px); bottom: calc(var(--sab) + 10px); flex-direction: row; }
  .rail-val { padding: 0 2px; }
  .rail-sep { width: 1px; height: 22px; margin: 0 4px; }
  .cam-msg { right: calc(var(--side-w) + 10px); bottom: calc(var(--sab) + 70px); }
  .countdown-num { font-size: 96px; }
}

/* ---------- Resultado ---------- */
.result-head { display: flex; flex-direction: column; align-items: center; }
.result-head h1 { margin: 0; font-size: 18px; font-weight: 700; }
.result-head span { font-size: 13px; font-variant-numeric: tabular-nums; }
.result-main {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 calc(var(--sar) + 16px) 0 calc(var(--sal) + 16px);
}
.res-video {
  width: 100%; max-height: 100%; min-height: 0; flex: 1;
  background: #000; border-radius: var(--radius); object-fit: contain;
}
.res-name { font-size: 13px; margin: 8px 0 0; word-break: break-all; text-align: center; }
.result-actions {
  display: grid; gap: 10px;
  padding: 14px calc(var(--sar) + 16px) calc(var(--sab) + 16px) calc(var(--sal) + 16px);
}
.result-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Painel de ajustes ---------- */
.sheet-wrap { position: absolute; inset: 0; z-index: 10; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.25); opacity: 0; transition: opacity 0.2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 68%;
  display: flex; flex-direction: column;
  background: rgba(22, 22, 29, 0.9);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  transform: translateY(100%);
  transition: transform 0.22s var(--ease);
  touch-action: pan-y;
  -webkit-user-select: none; user-select: none;
}
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 0 calc(var(--sal) + 20px); }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 0 calc(var(--sar) + 20px) calc(var(--sab) + 20px) calc(var(--sal) + 20px);
}
.sheet-section { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin: 18px 0 6px; font-weight: 700; }
.field { padding: 8px 0; }
.field-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.field-top label, .field-label { font-size: 15px; font-weight: 600; display: block; }
.field-label { margin-bottom: 8px; }
.field output { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.field-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.field-note:empty { display: none; }

input[type="range"] {
  width: 100%; height: 36px; margin: 4px 0 0;
  accent-color: var(--accent);
  touch-action: manipulation;
  background: transparent;
}

.seg {
  display: flex; gap: 4px; padding: 4px;
  background: rgba(255, 255, 255, 0.06); border-radius: 14px;
}
.seg button {
  flex: 1; min-height: 40px; padding: 0 8px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background-color 0.15s, color 0.15s;
}
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 77, 90, 0.6); }
.seg.swatches i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; font-size: 15px; font-weight: 600; cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.switch-row small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.switch-row input {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 50px; height: 30px; border-radius: 15px; margin: 0;
  background: rgba(255, 255, 255, 0.18); position: relative; cursor: pointer;
  transition: background-color 0.18s;
}
.switch-row input::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s var(--ease);
}
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::after { transform: translateX(20px); }
.switch-row input:disabled { opacity: 0.4; }

#btnResetSettings { margin-top: 18px; }
.sheet-foot { text-align: center; font-size: 13px; margin: 14px 0 0; }

/* ---------- Diálogo ---------- */
.dialog-wrap { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; }
.dialog-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
.dialog {
  position: relative; width: 100%; max-width: 360px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 22px;
  padding: 22px 18px 16px;
  animation: popIn 0.16s var(--ease);
}
.dialog h2 { margin: 0 4px 6px; font-size: 19px; }
.dialog p { margin: 0 4px 18px; color: var(--muted); }
.dialog p:empty { display: none; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.dialog-actions .btn { flex: 1; }
.dialog.list .dialog-actions { flex-direction: column; }
.dialog.list .dialog-actions .btn { justify-content: flex-start; width: 100%; }
@keyframes popIn { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Toasts ---------- */
.toasts {
  position: absolute; left: 0; right: 0; top: calc(var(--sat) + 12px); z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 16px; pointer-events: none;
}
/* no teleprompter o topo tem o texto e os botões: avisos vão para cima da barra de baixo */
html[data-view="prompter"] .toasts { top: auto; bottom: calc(var(--sab) + 124px); padding: 0 calc(var(--sar) + 70px) 0 calc(var(--sal) + 70px); }
@media (orientation: landscape) and (max-height: 560px) {
  html[data-view="prompter"] .toasts { bottom: calc(var(--sab) + 70px); padding: 0 calc(var(--sar) + 96px) 0 calc(var(--sal) + 16px); }
}
.toast {
  pointer-events: auto;
  max-width: 100%;
  display: flex; align-items: center; gap: 10px;
  background: rgba(40, 40, 50, 0.95); color: #fff;
  border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast-error { border-color: rgba(255, 107, 107, 0.5); }
.toast button { color: var(--accent); font-weight: 700; min-height: 36px; padding: 0 4px; }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .prompter.recording .rec-dot { animation: none; }
}
