:root {
  --base: #08090A;     /* estúdio apagado */
  --paper: #141618;    /* superfícies */
  --ink: #F4F4F1;      /* texto */
  --muted: #8E9399;
  --rule: #26292C;
  --cue: #F5B62E;      /* marca de leitura */
  --tally: #E2362C;    /* luz de gravação */
  --stage: #000;
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--base);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

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

/* ---------- Marca ---------- */
/* O nome é desenhado em traços: MEU fino, TP grosso, e a luz de gravação no alto. */

.logo { display: block; height: 22px; width: auto; color: var(--ink); overflow: visible; }

.slogan { margin: 0; font-size: 0.78rem; letter-spacing: 0.34em; color: var(--muted); white-space: nowrap; }

/* Luz de estúdio: um refletor vindo de cima sobre o fundo preto, com grão de filme. */
.library, .auth { position: relative; isolation: isolate; }
.library::before, .auth::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 70% 60% at 78% -12%, rgba(255, 255, 255, 0.13), transparent 62%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(226, 54, 44, 0.07), transparent 70%);
  background-size: 180px 180px, auto, auto;
}

/* ---------- Abertura ---------- */
/* A luz acende no centro, o nome é traçado enquanto ela desliza para o fim, o slogan entra e a luz pisca. */

.splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.55s ease, visibility 0s linear 0.55s;
}
.splash.done { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { width: min(560px, 72vw); }
.splash-mark { display: block; width: 100%; height: auto; overflow: visible; }

.splash .w {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 0.85s cubic-bezier(0.6, 0, 0.2, 1) forwards;
}
.splash .w1 { animation-delay: 0.55s; }
.splash .w2 { animation-delay: 0.68s; }
.splash .w3 { animation-delay: 0.81s; }
.splash .w4 { animation-delay: 0.98s; }
.splash .w5 { animation-delay: 1.12s; }

.splash .tally {
  transform-box: fill-box;
  transform-origin: center;
  transform: translate(-227px, 38px) scale(0);
  animation:
    tally-on 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) 0.1s both,
    tally-move 0.95s cubic-bezier(0.65, 0, 0.2, 1) 0.6s forwards,
    tally-blink 0.5s ease-in-out 2.45s 1;
  filter: drop-shadow(0 0 14px rgba(226, 54, 44, 0.75));
}

.splash .slogan {
  margin-top: clamp(18px, 3.4vw, 30px);
  text-align: center;
  font-size: clamp(0.72rem, 2vw, 1.05rem);
  letter-spacing: 0.6em;
  margin-right: -0.6em;
  color: #C9CCD0;
  opacity: 0;
  animation: slogan-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 1.75s forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes tally-on {
  from { transform: translate(-227px, 38px) scale(0); }
  to { transform: translate(-227px, 38px) scale(1.5); }
}
@keyframes tally-move {
  from { transform: translate(-227px, 38px) scale(1.5); }
  to { transform: none; }
}
@keyframes tally-blink { 50% { opacity: 0.12; } }
@keyframes slogan-in {
  from { opacity: 0; letter-spacing: 0.9em; margin-right: -0.9em; }
  to { opacity: 1; letter-spacing: 0.42em; margin-right: -0.42em; }
}

/* ---------- Apresentação ---------- */
/* O filme toca antes da tela de boas-vindas. No fim, a luz vermelha estoura no vídeo e
   esta camada continua a explosão pela tela toda, abrindo um círculo que revela a entrada. */

.intro { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: #000; }
.intro video, .intro-cover { grid-area: 1 / 1; display: block; height: 100dvh; max-width: 100vw; aspect-ratio: 9 / 16; object-fit: contain; background: #000; }
/* Quando o aparelho não deixa o vídeo começar sozinho (economia de energia), a capa do
   filme aparece com um botão grande no lugar da tela preta. */
.intro-play {
  position: absolute;
  left: 50%;
  top: 79%;
  translate: -50% -50%;
  display: grid;
  justify-items: center;
  gap: 16px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
}
.intro-play-icon { width: 92px; height: 92px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.8); }
.intro-play-icon svg { width: 36px; height: 36px; margin-left: 5px; fill: #000; }
.intro-play:active .intro-play-icon { transform: scale(0.95); }

.intro-bar { position: absolute; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.intro-bar .btn { background: rgba(0, 0, 0, 0.6); }
.intro-bar .btn-quiet { color: #C9CCD0; }

.burst {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: var(--tally);
  clip-path: circle(var(--grow, 0px) at var(--x, 50%) var(--y, 50%));
  -webkit-mask-image: radial-gradient(circle at var(--x, 50%) var(--y, 50%), transparent var(--hole, 0px), #000 calc(var(--hole, 0px) + 1.5px));
  mask-image: radial-gradient(circle at var(--x, 50%) var(--y, 50%), transparent var(--hole, 0px), #000 calc(var(--hole, 0px) + 1.5px));
}

/* ---------- Botões e campos ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 22px;
  font-weight: 700;
  font-size: 0.98rem;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.6); }
.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #000; }
.btn-primary:hover { background: #fff; border-color: #fff; }
.btn-go { background: var(--cue); border-color: var(--cue); color: #000; box-shadow: 0 10px 34px -10px rgba(245, 182, 46, 0.55); }
.btn-go:hover { background: #FFC849; border-color: #FFC849; }
.btn-quiet { border-color: transparent; background: none; font-weight: 400; color: var(--muted); padding-inline: 12px; }
.btn-quiet:hover { border-color: transparent; color: var(--ink); }
.btn-wide { width: 100%; padding-block: 15px; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.link-btn { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.link-btn:hover { text-decoration-thickness: 2px; }

.meta { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Entrada ---------- */

.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr; }

/* Metade esquerda: o próprio teleprompter rodando, explicando o que o app faz. */
.auth-stage { position: relative; overflow: hidden; background: #000; border-right: 1px solid var(--rule); }
.demo { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 62%, transparent); mask-image: linear-gradient(transparent, #000 22%, #000 62%, transparent); }
.demo-copy {
  position: absolute;
  left: clamp(40px, 7vw, 96px);
  right: clamp(32px, 5vw, 72px);
  top: 36%;
  font-size: clamp(1.7rem, 3.2vw, 3rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
  animation: demo-roll 26s linear infinite;
}
.demo-copy p { margin: 0 0 1.1em; }
.demo-cue { position: absolute; left: 0; top: 36%; margin-top: 0.3em; border-block: 11px solid transparent; border-left: 15px solid var(--cue); font-size: clamp(1.7rem, 3.2vw, 3rem); }
/* As duas primeiras falas se repetem no fim: o laço recomeça sem salto. */
@keyframes demo-roll { to { transform: translateY(-66.6%); } }

.auth-side { display: grid; place-items: center; padding: 40px clamp(20px, 5vw, 64px); }
.auth-box { width: min(380px, 100%); }
/* Assinatura: o slogan define a largura e o logo estica até a última letra dele. */
.lockup { display: inline-grid; margin-bottom: 52px; }
.lockup .logo { width: 0; min-width: 100%; height: auto; }
.lockup .slogan { margin-top: 16px; margin-right: -0.34em; }
.auth h1 { margin: 0 0 26px; font-size: 2rem; font-weight: 300; letter-spacing: -0.02em; line-height: 1.15; }
.auth label { display: block; margin-bottom: 18px; color: var(--muted); font-size: 0.92rem; }
.auth input {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 1.05rem;
  transition: border-color 0.15s, background 0.15s;
}
.auth input:focus { outline: none; border-color: var(--ink); background: rgba(255, 255, 255, 0.07); }
.auth small { display: block; margin-top: 6px; }
.form-error { margin: 0 0 16px; color: #FF8A80; }
.auth-note { margin: 0 0 22px; color: #C9CCD0; line-height: 1.5; }
.auth-switch { margin: 24px 0 0; color: var(--muted); }

/* ---------- Início ---------- */

.library { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(20px, 6vw, 80px);
}
.account { margin: 0; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.95rem; }
.avatar {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-weight: 700;
}

.home { width: 100%; max-width: 1240px; margin: 0 auto; padding: clamp(20px, 6vh, 72px) clamp(20px, 6vw, 80px) 40px; }

.greeting { margin: 0 0 clamp(32px, 6vh, 60px); font-size: clamp(2.4rem, 6.6vw, 5rem); line-height: 1.02; letter-spacing: -0.035em; font-weight: 300; }
.greeting strong { display: block; font-weight: 700; }
.greeting span { display: block; color: #AEB2B7; }
.library:not([hidden]) .greeting strong { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.library:not([hidden]) .greeting span { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.12s both; }
@keyframes rise { from { opacity: 0; transform: translateY(0.25em); } }

.install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: clamp(24px, 4vh, 40px);
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}
.install-card p { margin: 0; font-size: 1.05rem; }
.install-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.home-install { margin: clamp(40px, 7vh, 72px) 0 0; text-align: center; }
.home-install + .home-slogan { margin-top: 22px; }
.steps { margin: 6px 0 20px; padding-left: 1.3em; }
.steps li { margin-bottom: 10px; line-height: 1.45; }
.share-icon { width: 1.35em; height: 1.35em; margin: 0 0.15em; vertical-align: -0.3em; fill: none; stroke: #4A9DFF; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#installNote { margin: 0 0 12px; }

/* Destaque: o último roteiro, já rodando num teleprompter em miniatura. */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015) 60%);
  box-shadow: 0 40px 80px -40px #000;
}
.feature-info { display: flex; flex-direction: column; justify-content: center; padding: clamp(26px, 4vw, 52px); }
.feature-label { margin: 0 0 14px; color: var(--cue); font-size: 0.92rem; }
.feature h2 { margin: 0 0 8px; font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.1; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.feature-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(24px, 4vw, 40px); }

.prompter-card {
  position: relative;
  min-height: clamp(240px, 32vw, 380px);
  overflow: hidden;
  background: #000;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.prompter-copy {
  position: absolute;
  left: clamp(34px, 4vw, 56px);
  right: clamp(22px, 3vw, 44px);
  top: 34%;
  font-size: clamp(1.2rem, 2.1vw, 1.9rem);
  font-weight: 700;
  line-height: 1.3;
  -webkit-mask-image: none;
}
.prompter-copy p { margin: 0 0 0.8em; }
.prompter-copy.long { animation: card-roll 30s ease-in-out infinite alternate; }
@keyframes card-roll { to { transform: translateY(-58%); } }
.prompter-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(#000, transparent 26%, transparent 58%, #000 96%);
  pointer-events: none;
}
.prompter-cue { position: absolute; z-index: 1; left: 0; top: 34%; margin-top: 0.42em; border-block: 9px solid transparent; border-left: 12px solid var(--cue); font-size: clamp(1.2rem, 2.1vw, 1.9rem); }

.list-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: clamp(44px, 8vh, 80px) 0 20px; }
.list-title { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.tile:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.05); transform: translateY(-3px); }
.tile-open { flex: 1; display: flex; flex-direction: column; border: 0; background: none; padding: 0; text-align: left; }
.tile-excerpt {
  height: 132px;
  margin: 0;
  padding: 20px 20px 0;
  overflow: hidden;
  background: #000;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.32;
  color: #E9EAE7;
  -webkit-mask-image: linear-gradient(#000 45%, transparent);
  mask-image: linear-gradient(#000 45%, transparent);
}
.tile-body { padding: 16px 70px 18px 20px; }
.tile-body strong { display: block; font-size: 1.12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-body span { color: var(--muted); font-size: 0.86rem; }
.row-play {
  position: absolute;
  right: 16px; bottom: 16px;
  width: 44px; height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s;
}
.row-play svg { width: 17px; height: 17px; fill: var(--ink); margin-left: 2px; }
.row-play:hover, .tile:hover .row-play { background: var(--cue); border-color: var(--cue); }
.row-play:hover svg, .tile:hover .row-play svg { fill: #000; }
.empty { grid-column: 1 / -1; margin: 0; padding: 30px 24px; border: 1px dashed rgba(255, 255, 255, 0.16); border-radius: 18px; color: var(--muted); }

.home-slogan { margin-top: clamp(48px, 9vh, 96px); text-align: center; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-stage { display: none; }
  .feature { grid-template-columns: 1fr; }
  .prompter-card { order: -1; min-height: 200px; border-left: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .account-name { display: none; }
}

/* ---------- Administração ---------- */

.admin { width: 100%; max-width: 880px; margin: 0 auto; padding: 8px clamp(20px, 6vw, 80px) 64px; }
.admin h1 { margin: 22px 0 clamp(28px, 5vh, 48px); font-size: clamp(2.2rem, 5.4vw, 3.6rem); letter-spacing: -0.035em; line-height: 1.05; }
.admin-block { margin-bottom: clamp(36px, 6vh, 56px); }
.admin-block h2 { margin: 0 0 8px; font-size: 1.35rem; letter-spacing: -0.015em; }
.invite-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.invite-form input {
  flex: 1 1 240px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.05rem;
}
.invite-form input:focus { outline: none; border-color: var(--ink); }
.invite-result { margin-top: 18px; padding: 20px 22px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 18px; background: rgba(255, 255, 255, 0.04); }
.invite-result p { margin: 0 0 10px; }
.invite-link { color: var(--muted); font-size: 0.92rem; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.admin-list { list-style: none; margin: 14px 0 0; padding: 0; }
.admin-list li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 16px 0; border-top: 1px solid var(--rule); }
.admin-list li:last-child { border-bottom: 1px solid var(--rule); }
.admin-list strong { display: block; font-size: 1.08rem; }
.admin-list span { color: var(--muted); font-size: 0.9rem; }
.admin-list .row-actions { display: flex; gap: 16px; }
.admin-list .danger { color: #FF8A80; }
.admin-empty { color: var(--muted); }
.account { flex-wrap: wrap; justify-content: flex-end; }
.account .link-btn { margin-left: 4px; white-space: nowrap; }
.topbar .logo { flex: none; }

/* ---------- Editor ---------- */

.editor { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 1040px; height: calc(100dvh - 72px); padding: 0 clamp(20px, 6vw, 72px); }
.editor-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0 18px; }
.editor-bar { flex-wrap: wrap; }
.save-state { margin: 0 0 0 auto; color: var(--muted); font-size: 0.88rem; text-align: right; }

/* Assistente de voz: comandos falados que alteram o texto. */
.btn-mic { padding: 9px 16px; font-size: 0.92rem; font-weight: 400; }
.mic-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.btn-mic[aria-pressed="true"] { border-color: var(--tally); color: #fff; }
.btn-mic[aria-pressed="true"] .mic-dot { background: var(--tally); animation: tally 1.2s steps(2, jump-none) infinite; }
.assistant {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}
.assistant p { margin: 0; }
.assistant-said { color: var(--muted); }
.assistant-reply { font-weight: 700; }
.assistant-reply:empty { display: none; }

.title-input {
  border: 0;
  background: none;
  padding: 8px 0;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.title-input:focus, .text-input:focus { outline: none; }
.title-input::placeholder, .text-input::placeholder { color: #565B61; }

.text-input {
  flex: 1;
  min-height: 0;
  resize: none;
  border: 0;
  background: none;
  padding: 10px 0 24px;
  max-width: 68ch;
  font-size: 1.22rem;
  line-height: 1.62;
  color: #E4E5E2;
}

.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0 22px;
  border-top: 1px solid var(--rule);
}
.stats { margin: 0; color: var(--muted); font-size: 0.92rem; }
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- Palco ---------- */

.stage {
  position: fixed;
  inset: 0;
  background: var(--stage);
  color: #fff;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  --size: 64;
  --leading: 1.35;
  --width: 78;
  --cue-pos: 38;
}

.mirror { position: absolute; inset: 0; z-index: 1; }
.surface { position: absolute; inset: 0; overflow: hidden; touch-action: none; }

.copy {
  position: absolute;
  left: 50%;
  top: calc(var(--cue-pos) * 1% - var(--size) * var(--leading) * 0.5px);
  width: calc(var(--width) * 1%);
  padding-bottom: 100vh;
  font-size: calc(var(--size) * 1px);
  line-height: var(--leading);
  font-weight: 700;
  transform: translate3d(-50%, 0, 0);
  will-change: transform;
}
.copy.jump { transition: transform 0.22s ease-out; }
.copy p { margin: 0 0 0.7em; }
.copy .s { transition: opacity 0.2s; }
.copy .s.past { opacity: 0.38; }

.cue {
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--cue-pos) * 1%);
  height: 0;
  border-top: 1px solid rgba(245, 182, 46, 0.28);
  pointer-events: none;
}
.cue::before, .cue::after {
  content: "";
  position: absolute;
  top: -11px;
  border-block: 11px solid transparent;
}
.cue::before { left: 0; border-left: 15px solid var(--cue); }
.cue::after { right: 0; border-right: 15px solid var(--cue); }
.stage.no-cue .cue { display: none; }

.listen-note {
  position: absolute;
  left: 50%;
  top: calc(var(--cue-pos) * 1% - var(--size) * var(--leading) * 0.5px - 3.4rem);
  translate: -50% 0;
  margin: 0;
  padding: 6px 16px;
  border-radius: 4px;
  background: var(--cue);
  color: #000;
  font-weight: 700;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  white-space: nowrap;
  pointer-events: none;
}
.listen-badge { margin: 0; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cue); font-weight: 700; }

.hud {
  position: absolute;
  z-index: 2;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px max(14px, env(safe-area-inset-left)) 12px max(14px, env(safe-area-inset-right));
  transition: opacity 0.25s;
}
.hud-top { top: 0; padding-top: max(14px, env(safe-area-inset-top)); background: linear-gradient(#000, rgba(0, 0, 0, 0)); }
.hud-bottom {
  bottom: 0;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  padding-top: 44px;
  background: linear-gradient(rgba(0, 0, 0, 0), #000 38%);
}
.stage.idle .hud { opacity: 0; pointer-events: none; }
.stage.idle { cursor: none; }

.group { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }

.progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(255, 255, 255, 0.14); }
.progress span { display: block; height: 100%; width: 0; background: var(--cue); }

.stage-title { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, 0.72); }
.clock { margin: 0; font-variant-numeric: tabular-nums; }

.rec-badge { margin: 0; display: flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; font-weight: 700; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--tally); animation: tally 1.2s steps(2, jump-none) infinite; }
@keyframes tally { 50% { opacity: 0.25; } }

.chip {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 8px 12px;
  font-size: 0.92rem;
  white-space: nowrap;
}
.chip:hover { border-color: #fff; }
.chip[aria-pressed="true"], .chip[aria-expanded="true"] { background: #fff; color: #000; border-color: #fff; }
.chip-square { width: 40px; padding-inline: 0; font-size: 1.2rem; line-height: 1.1; }
.chip-rec[aria-pressed="true"] { background: var(--tally); border-color: var(--tally); color: #fff; }

.play {
  width: 58px; height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--cue);
  display: grid;
  place-items: center;
  margin-inline: 6px;
}
.play svg { width: 26px; height: 26px; fill: #000; }
.play .i-pause { display: none; }
.stage.playing .play .i-play { display: none; }
.stage.playing .play .i-pause { display: block; }

.speed { margin: 0; min-width: 8.2em; text-align: center; font-size: 0.92rem; }
.speed strong { font-variant-numeric: tabular-nums; font-size: 1.1rem; }

/* ---------- Assistente na tela ---------- */
/* A luz de gravação do logo vira o assistente: aparece quando é chamada, pulsa enquanto
   ouve e fica âmbar enquanto responde. O texto do roteiro recua para dar lugar a ela. */

.orb-wrap { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 55vh;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 65% 100% at 50% 100%, rgba(226, 54, 44, 0.34), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s;
}
.stage.assisting::after { opacity: 1; }
.copy, .cue { transition: opacity 0.4s; }
.stage.assisting .copy { opacity: 0.14; }
.stage.assisting .cue { opacity: 0.3; }

.orb {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(120px, 22vh, 220px);
  display: grid;
  justify-items: center;
  gap: 26px;
  opacity: 0;
  transform: translateY(28px) scale(0.85);
  transition: opacity 0.35s, transform 0.5s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.orb.on { opacity: 1; transform: none; }
.orb-text {
  margin: 0;
  max-width: min(84vw, 760px);
  padding: 0 16px;
  text-align: center;
  font-size: clamp(1.25rem, 3vw, 2.1rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 18px #000, 0 0 4px #000;
}
.orb-body { position: relative; width: clamp(84px, 11vw, 124px); aspect-ratio: 1; }
.orb-body i { position: absolute; inset: 0; border-radius: 50%; }
.orb-glow { inset: -70% !important; background: radial-gradient(circle, rgba(226, 54, 44, 0.6), transparent 60%); animation: orb-breathe 2.4s ease-in-out infinite; }
.orb-swirl { background: conic-gradient(from 0deg, #E2362C, #FF7A59, #F5B62E, #FF3D6E, #9B1C14, #E2362C); filter: blur(8px) saturate(1.3); animation: orb-spin 3.4s linear infinite; }
.orb-swirl.b { inset: 12% !important; mix-blend-mode: screen; opacity: 0.85; animation-duration: 2.2s; animation-direction: reverse; }
.orb-core { inset: 24% !important; background: radial-gradient(circle at 36% 30%, #fff, #FF9A8C 28%, #E2362C 72%); box-shadow: 0 0 34px rgba(226, 54, 44, 0.85); transition: background 0.4s; }
.orb.speaking .orb-swirl { animation-duration: 1.3s; }
.orb.speaking .orb-core { background: radial-gradient(circle at 36% 30%, #fff, #FFE1A1 32%, #F5B62E 76%); box-shadow: 0 0 40px rgba(245, 182, 46, 0.9); }
.orb.speaking .orb-body { animation: orb-talk 0.62s ease-in-out infinite alternate; }
.orb.beat .orb-body { animation: orb-beat 0.42s ease-out; }
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-breathe { 50% { transform: scale(1.18); opacity: 0.7; } }
@keyframes orb-beat { 30% { transform: scale(1.22); } }
@keyframes orb-talk { to { transform: scale(1.14); } }

/* A câmera fica atrás do texto, esmaecida: quem lê olha para o texto e para a lente ao mesmo tempo. */
.cam-box { position: absolute; inset: 0; z-index: 0; background: #000; pointer-events: none; }
.cam-box video { display: block; width: 100%; height: 100%; object-fit: cover; opacity: var(--cam, 0.35); }
.cam-box.selfie video { transform: scaleX(-1); }
.stage.cam-on .copy { text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95), 0 0 3px rgba(0, 0, 0, 0.9); }

.panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: min(360px, 100vw);
  overflow-y: auto;
  padding: 22px 22px 28px;
  background: #15191C;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  z-index: 3;
}
.panel h2 { margin: 0 0 14px; font-size: 1.1rem; }
.panel h2:not(:first-child) { margin-top: 26px; }
.panel label { display: block; margin-bottom: 16px; font-size: 0.95rem; }
.panel output { float: right; color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; }
.panel input[type="range"] { display: block; width: 100%; margin-top: 8px; accent-color: var(--cue); }
.panel .check { display: flex; align-items: center; gap: 10px; }
.panel .check input { width: 20px; height: 20px; accent-color: var(--cue); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 0.92rem; }
.keys dt { font-weight: 700; }
.keys dd { margin: 0; color: rgba(255, 255, 255, 0.75); }
.panel select { display: block; width: 100%; margin-top: 8px; padding: 8px; border: 1px solid rgba(255, 255, 255, 0.34); border-radius: 4px; background: #000; color: #fff; }
.hint.hint-top { margin: 0 0 16px; }
.hint { margin: 16px 0 0; font-size: 0.88rem; color: rgba(255, 255, 255, 0.6); }

.dialog {
  width: min(400px, calc(100vw - 32px));
  border: 0;
  border-radius: 6px;
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
.dialog h2 { margin: 0 0 8px; font-size: 1.35rem; }
.dialog p { margin: 0 0 14px; }
.qr { display: block; width: 220px; height: 220px; margin: 0 auto 14px; }
.link { font-size: 0.86rem; overflow-wrap: anywhere; color: var(--muted); user-select: text; -webkit-user-select: text; }
.status { font-weight: 700; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast {
  position: fixed;
  left: 50%; bottom: 110px;
  translate: -50% 0;
  max-width: min(520px, calc(100vw - 32px));
  margin: 0;
  padding: 11px 16px;
  border-radius: 4px;
  background: #fff;
  color: #000;
  font-weight: 700;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

/* ---------- Controle remoto ---------- */

.remote {
  background: #15191C;
  color: #fff;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  gap: 16px;
  touch-action: manipulation;
}
.remote-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.remote-head h1 { margin: 0; font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-state { margin: 0; font-size: 0.86rem; color: rgba(255, 255, 255, 0.65); white-space: nowrap; }
.link-state.off { color: var(--cue); }

.preview { flex: 1; min-height: 120px; display: flex; flex-direction: column; justify-content: center; gap: 12px; overflow: hidden; }
.preview p { margin: 0; }
.preview .near { color: rgba(255, 255, 255, 0.4); font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preview .now { font-size: 1.5rem; font-weight: 700; line-height: 1.3; border-left: 4px solid var(--cue); padding-left: 12px; }

.remote .progress { position: static; border-radius: 2px; overflow: hidden; }
.remote-times { display: flex; justify-content: space-between; margin: 0; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.7); font-size: 0.92rem; }

.pad { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pad button {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: none;
  color: #fff;
  padding: 16px 8px;
  font-size: 1rem;
}
.pad button:active { background: rgba(255, 255, 255, 0.14); }
.pad .big {
  grid-column: 1 / -1;
  border: 0;
  background: var(--cue);
  color: #000;
  font-weight: 700;
  font-size: 1.3rem;
  padding: 24px 8px;
}
.pad .big:active { background: #d99c1a; }
.pad .speed-row { grid-column: 1 / -1; display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; align-items: center; }
.pad .speed-row p { margin: 0; text-align: center; }
.pad .speed-row button { font-size: 1.4rem; padding-block: 12px; }

@media (max-width: 760px) {
  .hud-bottom { gap: 8px 12px; }
  .chip { padding: 7px 9px; font-size: 0.84rem; }
  .play { width: 50px; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .orb-body, .orb-body i { animation: none !important; }
  .orb { transition: opacity 0.2s; transform: none; }
  .splash .w, .splash .tally, .splash .slogan { animation: none; stroke-dashoffset: 0; opacity: 1; transform: none; }
  .demo-copy, .prompter-copy.long, .greeting strong, .greeting span { animation: none !important; }
  .copy.jump, .copy .s, .hud { transition: none; }
  .dot { animation: none; }
}
.qr { border-radius: 4px; background: #fff; }
