/* FILE-MAP:
purpose: >
  Component and layout styles for the deck engine (audience + presenter) and the
  lead form. Consumes only variables from tokens.css so the Ezon token swap is
  zero-touch here. Includes the .obrigado composition (thanks slide — reuses
  .bio-busto geometry) and the .guia-ref chip (visual-guide pointer, theme-safe
  via tokens).
depends_on:
  - path: ./tokens.css
    uses: [css custom properties]
used_by:
  - ./index.html
  - ./form.html
touches:
  db_tables: []
  env: []
  config_files: []
  cache_keys: []
effects: []
invariants:
  - no hardcoded colors/font sizes — tokens only (shadows keep literal rgba, as
    always; the light-slide shadow follows that precedent)
  - headings (h1, h2, h3, .statement, .num-hero, .kicker) are Sora with
    line-height 0.9 and negative tracking; body copy is Montserrat (Ezon DS §3,
    substituting either face is an anti-pattern)
  - dark slides carry the Galaxy texture — a flat dark background is banned
    (DS §8); slides with data-tema="claro" opt into the Starlight world instead
    (opaque master-light over the canvas; tokens re-resolved in tokens.css)
  - light-slide rules here fix only PHYSICAL consequences (background, logo
    filter, shadows, QR border, teal-as-text) — colour values stay in tokens
  - the .canvas --fs-base-* px values are the single source of the stage type scale;
    06-ensaio/gerar-pdf-backup.mjs replicates them — changing one side means changing both
  - per-slide layout overrides ride the custom props --k/--caixa/--dx/--dy set
    inline by deck.js; the effective --fs-* tier MUST stay declared on .slide
    (var() in a custom property resolves where it is declared)
  - the .bio-busto img bleeds to the stage corner: it is absolutely positioned
    against the POSITIONED .slide (live deck: absolute; PDF print CSS:
    relative) so the photo's baked-in bottom/right hard cuts coincide with the
    slide edges — never return it to flow layout, and any .slide positioning
    change must keep it a containing block
  - an element hidden by layout.els[sel].hide carries .edit-oculto: display none
    everywhere (audience, Apresentar, print), a dashed ghost only in body.editmode
END-FILE-MAP */

* { box-sizing: border-box; }

:root {
  /* Dimensão canônica do slide. O PDF de backup imprime exatamente isto,
     então mexer aqui exige regerar 06-ensaio/deck-backup.pdf. */
  --palco-w: 1600px;
  --palco-h: 900px;
}

html, body {
  margin: 0;
  height: 100%;
  /* Só a base sólida aqui. A textura Galaxy foi movida para o palco (.canvas):
     presa ao viewport, num celular em retrato ela cobria a TELA e não o slide,
     e o recorte não acompanhava a composição. */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Deck shell ---------- */

#deck {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Linha palco + painel do apresentador. Sem o painel, comporta-se como antes. */
.palco-linha {
  flex: 1;
  display: flex;
  min-height: 0;
}

.slide-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Painel do apresentador (estilo PowerPoint) ---------- */
/* Fora do palco: unidades responsivas valem. Só aparece na página do
   apresentador fora do preview (deck.js remove o hidden). */
/* A largura vem de --painel-w (preferência local do apresentador, arrastada
   pelo splitter e salva em localStorage). O clamp re-aperta sozinho quando a
   janela encolhe, mesmo com um valor gordo salvo. A divisa visual é o
   splitter — por isso não há mais border-left aqui. */
.painel-apresentador {
  flex: none;
  width: clamp(240px, var(--painel-w, 340px), 65vw);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.8rem;
  background: var(--bg-elevated);
  min-height: 0;
}

/* Splitter entre palco e painel: arrastar redimensiona (o palco reescala
   sozinho via ResizeObserver), duplo clique volta ao default. touch-action
   none impede o arrasto de virar scroll/gesto no touch. */
.painel-splitter {
  flex: none;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
  position: relative;
}

.painel-splitter::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  background: var(--border);
}

.painel-splitter:hover::after,
.painel-splitter.arrastando::after { background: var(--accent); }

.painel-apresentador .painel-rotulo {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.painel-apresentador .notas-status { text-transform: none; letter-spacing: 0; font-family: var(--font-sans); font-weight: 400; }
.painel-apresentador .notas-status.ok { color: var(--success); }
.painel-apresentador .notas-status.err { color: var(--danger); }

/* Prévia do próximo slide: um palco 1600x900 de verdade, encolhido por
   transform para caber na coluna — mesma fidelidade do palco principal
   (container queries e tipografia idênticas). */
.prox-wrap {
  position: relative;
  /* Teto de 40vh de altura (via largura × 16:9): com o painel bem largo, a
     prévia não pode comer a área das notas (#notas-campo, flex 1). */
  width: min(100%, calc(40vh * 16 / 9));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex: none;
}

.canvas.mini {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  pointer-events: none; /* prévia é só leitura — clique nenhum vaza para dentro */
}

.prox-wrap .prox-fim {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

#notas-campo {
  flex: 1 1 auto;
  min-height: 90px;
  resize: none;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 0.6em 0.7em;
}

#notas-campo:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* A linha de notas da HUD vira redundante quando o painel está aberto —
   mas volta quando o painel está recolhido. */
body.com-painel:not(.painel-recolhido) .presenter-notes { display: none; }

/* Colapso consciente do painel (botão na HUD; em tela <900px o deck.js já
   nasce recolhido). Classe de estado em vez de @media: o sumiço nunca é
   silencioso e a preferência do apresentador continua mandando. */
body.painel-recolhido .painel-apresentador,
body.painel-recolhido .painel-splitter { display: none; }

/* ── Palco de tamanho fixo ────────────────────────────────────────────────
   O deck é uma peça de proporção 16:9, não um site que reflui. Antes, num
   celular em retrato, o slide era esticado para a tela toda: o astronauta
   virava uma fatia vertical e o texto ia parar em qualquer lugar.
   Agora o palco tem SEMPRE 1600x900 e o JS aplica um `scale` para caber na
   tela. A composição no celular passa a ser idêntica à do projetor.

   Consequência que exige atenção: dentro do palco, `vw`/`vh` e as media
   queries continuariam olhando para o VIEWPORT (a tela do celular), não para
   o palco. Por isso, aqui dentro, toda medida é px fixo e todo breakpoint é
   container query. `container-type: size` faz as unidades `cq*` desta
   subárvore medirem o palco. */
.canvas {
  position: relative;
  flex: none;
  width: var(--palco-w);
  height: var(--palco-h);
  container-type: size;
  transform: scale(var(--escala, 1));
  transform-origin: center center;
  /* Galaxy: a nebulosa da marca sobre a base escura (DS §8), agora ancorada ao
     PALCO. `cover` preenche os 1600x900 inteiros mantendo a proporção do
     arquivo (que é retrato, 650x1193) e recortando o excedente — sem repetição,
     que é o que criava as emendas visíveis no fundo. `soft-light` mantém o
     contraste medido do tipo. */
  background: var(--bg-texture), var(--bg);
  background-size: cover, auto, auto, auto;
  background-position: center, center, center, center;
  background-repeat: no-repeat;
  background-blend-mode: soft-light, normal, normal, normal;
  overflow: hidden;
}

/* Os --fs-* globais são clamp() em vw e servem à HUD, que fica FORA do palco
   e deve continuar respondendo à tela real. Aqui dentro eles viram constantes:
   os mesmos valores que o clamp produz num palco de 1600px, que é o que o
   projetor e o PDF de backup mostram.
   Dois tiers: o .canvas guarda os valores BASE (fonte única dos números — o
   gerador do PDF replica exatamente estes px); o tier efetivo logo abaixo
   multiplica cada um pela escala por-slide --k, que vem do override de layout
   (deck.js seta inline no .slide). */
.canvas {
  --fs-base-hero: 100px;        /* DS hero 60pt */
  --fs-base-title: 73px;
  --fs-base-h2: 60px;           /* DS h2 36pt */
  --fs-base-h3: 53px;           /* DS h3 32pt */
  --fs-base-lead: 40px;         /* DS lead 24pt */
  --fs-base-body-lg: 33px;      /* DS body-lg 20pt */
  --fs-base-body: 30px;         /* DS body 18pt */
  --fs-base-body-sm: 27px;      /* DS body-sm 16pt */
  --fs-base-small: 23px;        /* DS caption 14pt */
  --fs-base-caption-sm: 20px;   /* DS caption-sm 12pt */
  --fs-base-mono: 20px;
}

/* Tier efetivo. Declarado no PRÓPRIO .slide (não no .canvas) de propósito:
   var() dentro de custom property resolve no elemento onde ela é DECLARADA —
   declarado um nível acima, --k congelaria em 1 para todos os slides e a
   escala por-slide nunca teria efeito. O .waiting compartilha a regra só para
   herdar os mesmos tamanhos (nunca recebe --k). */
.canvas .slide, .canvas .waiting {
  --fs-hero: calc(var(--fs-base-hero) * var(--k, 1));
  --fs-title: calc(var(--fs-base-title) * var(--k, 1));
  --fs-h2: calc(var(--fs-base-h2) * var(--k, 1));
  --fs-h3: calc(var(--fs-base-h3) * var(--k, 1));
  --fs-lead: calc(var(--fs-base-lead) * var(--k, 1));
  --fs-body-lg: calc(var(--fs-base-body-lg) * var(--k, 1));
  --fs-body: calc(var(--fs-base-body) * var(--k, 1));
  --fs-body-sm: calc(var(--fs-base-body-sm) * var(--k, 1));
  --fs-small: calc(var(--fs-base-small) * var(--k, 1));
  --fs-caption-sm: calc(var(--fs-base-caption-sm) * var(--k, 1));
  --fs-mono: calc(var(--fs-base-mono) * var(--k, 1));
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* `safe` degrades to flex-start when the slide is taller than the stage;
     plain `center` overflows in BOTH directions and makes the top of a long
     STEP slide unreachable by scrolling. */
  justify-content: safe center;
  /* Caixa de conteúdo e posição por-slide (override de layout — deck.js seta
     --caixa/--dx/--dy inline). --caixa default 1440px reproduz o padding
     lateral de 80px de sempre; estreitar a caixa cresce o padding simétrico,
     preservando o alinhamento interno do slide. `translate` (e não transform)
     porque a transição de entrada já usa transform — as duas compõem.
     Px fixo sempre: o palco é 1600x900 e o recorte é do .canvas. */
  padding: 80px calc((var(--palco-w) - var(--caixa, 1440px)) / 2);
  translate: var(--dx, 0px) var(--dy, 0px);
  overflow-y: auto;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* ── Tema claro por slide (data-tema="claro" — mundo Starlight) ───────────
   Os TOKENS do slide claro já chegam re-resolvidos pelo mapping (tokens.css
   §TEMA CLARO POR SLIDE). Aqui ficam só as consequências físicas do fundo
   claro que tokens não expressam: o fundo OPACO que cobre a galáxia do
   .canvas, logos normalizados para branco voltando a preto, sombras
   calibradas para o escuro ficando mais leves, o QR branco ganhando borda
   para não flutuar, e texto que usava Pulsar Teal (1.9:1 no claro) migrando
   para o par de ênfase Starlight. Px fixo, sem vw/vh/@media — palco. */
.slide[data-tema="claro"] {
  color-scheme: light;
  /* master-light, OPACO — é o que esconde a nebulosa do .canvas atrás. */
  background: var(--bg);
  /* Re-ancora a HERANÇA: o body computou `color: var(--text)` no mundo escuro
     (Starlight creme) e headings sem color própria herdariam isso — título
     invisível no claro. Redeclarar aqui re-resolve contra o --text claro. */
  color: var(--text);
}

/* Pulsar Teal como TEXTO não passa de AA sobre o master-light; o DS §2 manda
   o par de ênfase (Teal Profundo) carregar acentos de texto no claro. */
.slide[data-tema="claro"] .kicker { color: var(--accent-emphasis); }
.slide[data-tema="claro"] .bio-trilho li.novo .ano { color: var(--accent-emphasis); }

/* Sombra dimensionada para o palco escuro vira borrão sujo no claro. */
.slide[data-tema="claro"] :is(.shots img, .shot-solo img, .bio-visual img, .prints img) {
  box-shadow: 0 8px 22px rgba(26, 26, 26, 0.18);
}

/* O QR já é uma placa branca: sobre o master-light flutuaria sem borda. */
.slide[data-tema="claro"] .qr-box.live { border: 1px solid var(--border); }

/* Headings — Sora, lh 0.9, negative tracking (DS §3 signature).
   NOTE: .statement and .num-hero are themselves <h1>, so every rule that must
   beat `.slide h1` (0,1,1) is scoped as `.slide .statement` (0,2,0). */
.slide h1, .slide h2, .slide h3 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

.slide h1 {
  font-size: var(--fs-hero);       /* DS hero 60pt */
  font-weight: 700;
  margin: 0 0 var(--space-2);
  text-wrap: balance;
}

/* Emphasis pair: Aurora Green on dark, Teal Profundo on light (DS §2) */
.slide h1 em { color: var(--accent-emphasis); font-style: normal; }

.slide h3 {
  font-size: var(--fs-h3);         /* DS h3 32pt */
  font-weight: 700;
  letter-spacing: var(--ls-title);
  margin: 0 0 var(--space-2);
}

.slide h2 {
  font-size: var(--fs-h2);         /* DS h2 36pt */
  font-weight: 700;
  letter-spacing: var(--ls-title);
  margin: 0 0 var(--space-3);
}

.slide p, .slide li {
  font-size: var(--fs-body);       /* DS body 18pt — dominant size */
  line-height: var(--lh-body);
  color: var(--text);
}

.slide ul, .slide ol { padding-left: 1.2em; margin: 0; }
.slide li { margin-bottom: var(--space-1); }

.slide .kicker {
  font-family: var(--font-display);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;          /* label, not a title: tracking stays positive */
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--space-2);
}

.slide .subtitle { color: var(--text-muted); font-size: var(--fs-body-lg); }

/* Capa — arquétipo "Cover 1 / Dark" do sistema de slides da Ezon, e não uma
   capa centralizada genérica. Geometria medida sobre 180 slides reais em
   ezon-proposal-slides/kit/DESIGN.md §Hero: astronauta ancorado à direita,
   60,9cqw, sangrando topo/direita/base, crop `bottom right -5.5cqw`.
   Regra do sistema: SEM scrim sobre o hero — o contraste vem da separação
   espacial (coluna de texto à esquerda + respiro), e o título cruza a arte.
   `container-type: size` fica restrito à capa para que as unidades cq batam
   com a spec sem mexer no layout dos outros 50 slides. */
.slide[data-kind="cover"] {
  container-type: size;
  padding: 0;
  text-align: left;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
}
.slide[data-kind="cover"] .hero-cover {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 60.9cqw;
  background-repeat: no-repeat;
  background-position: bottom right -5.5cqw;
  background-size: auto 100%;
  pointer-events: none;
  z-index: 1;
}
.slide[data-kind="cover"] .cover-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  box-sizing: border-box;
  padding: 11cqh 80px 3cqh;
}
/* Coluna de texto ≤58cqw: cruza a arte, mas o miolo do capacete fica livre. */
.slide[data-kind="cover"] h1 { max-width: 58cqw; margin-bottom: 0; }
.slide[data-kind="cover"] .cover-logo { width: 24cqw; height: auto; margin-top: 7cqh; }
.slide[data-kind="cover"] .cover-caption {
  margin-top: auto;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: var(--fs-small);
  letter-spacing: 0.02em;
}

ol.steps { list-style: none; counter-reset: step; padding: 0; }
ol.steps li {
  counter-increment: step;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
ol.steps li::before {
  content: counter(step);
  flex: none;
  font-weight: 700;
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: 50%;
  width: 1.6em;
  height: 1.6em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-small);
}

/* ---------- Placeholder fields (step slides) ---------- */

.placeholders {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: flex-end;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2);
  margin-bottom: var(--space-3);
}

.placeholders label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: var(--fs-caption-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.placeholders input {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--fs-caption-sm);
  padding: 0.55em 0.8em;
  min-width: 12ch;
}

.placeholders input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.btn {
  font: inherit;
  font-size: var(--fs-caption-sm);
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0.55em 1em;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.btn:hover { border-color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

/* ---------- Prompt block ---------- */

.prompt-block {
  position: relative;
  margin-top: var(--space-3);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.prompt-block pre {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 405px;
  overflow-y: auto;
}

.prompt-block .ph-value { color: var(--accent-emphasis); font-weight: 600; }
.prompt-block .ph-empty { color: var(--warning); font-weight: 600; }

.copy-btn {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
}

.copy-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: var(--accent-contrast);
}

/* ---------- Downloads ---------- */

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.downloads a {
  color: var(--accent-emphasis);
  font-size: var(--fs-caption-sm);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55em 1em;
}

.downloads a:hover { border-color: var(--accent); }

.downloads a::before { content: "↓ "; }

/* ---------- Waiting screen (audience, locked slide) ---------- */

.waiting {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-align: center;
  background: var(--bg-texture), var(--bg);
  z-index: 10;
  padding: var(--space-3);
}

.waiting.visible { display: flex; }

.waiting .pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s var(--ease) infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.8); opacity: 0.35; }
}

.waiting h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-title);
}
.waiting p { color: var(--text-muted); font-size: var(--fs-body-sm); margin: 0; }

.slide.unlocking { animation: unlock var(--dur-slow) var(--ease); }

@keyframes unlock {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Modo de edição direta (estilo Canva — ?edit=1) ---------- */

/* A barra vive FORA do palco, como a HUD: unidades responsivas valem aqui.
   INVISÍVEL por padrão via CSS — o atributo hidden sozinho PERDE para uma
   regra de classe com display (foi exatamente o bug: participante via os
   sliders). Só body.editmode (ligado após confirmação do token) exibe. */
.editbar { display: none; }

body.editmode .editbar {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0.45rem 1rem;
  border-top: 1px solid var(--border-accent);
  background: var(--bg-elevated);
  font-size: var(--fs-caption-sm);
  color: var(--text-muted);
}

.editbar .eb-label {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.editbar .eb-alvo {
  font-family: var(--font-mono);
  color: var(--text);
  max-width: 26ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editbar .eb-grupo { display: inline-flex; align-items: center; gap: 0.6em; }
/* o display acima venceria o atributo hidden do grupo x/y/larg */
.editbar [hidden] { display: none !important; }
.editbar label { display: inline-flex; align-items: center; gap: 0.35em; white-space: nowrap; }

.editbar input[type="number"] {
  width: 5.5em;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-caption-sm);
  padding: 0.25em 0.4em;
}

.editbar input[type="range"] { width: 90px; accent-color: var(--accent); }
/* Fonte e caixa do slide: valores curtos ("2.5", "1600"); estreitos para a
   barra não ganhar uma linha a mais. */
.editbar #eb-kn, .editbar #eb-caixan { width: 4.6em; }

.editbar select {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--fs-caption-sm);
  padding: 0.25em 0.4em;
}

.editbar .eb-swatches { display: inline-flex; gap: 0.3em; align-items: center; }

.editbar .eb-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
}

.editbar .eb-swatch:hover { border-color: var(--accent); }

.editbar .eb-swatch-herdar {
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
}

.editbar input[type="color"] {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  cursor: pointer;
}
.editbar input[type="text"] {
  width: 9em;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-caption-sm);
  padding: 0.25em 0.4em;
}
.editbar .eb-status { flex: 1 1 auto; text-align: right; }
.editbar .eb-status.sujo { color: var(--warning); }
.editbar .eb-status.ok { color: var(--success); }
.editbar .eb-status.err { color: var(--danger); }
.editbar .eb-acoes { display: inline-flex; gap: 0.4em; }

/* Affordance dentro do palco: blocos editáveis acendem no hover; o selecionado
   ganha contorno cheio e a alça de largura na borda direita. Px fixo — palco. */
body.editmode .slide.active { cursor: default; }

.slide .edit-sel {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Em edição de texto: contorno tracejado + caret na cor da marca. */
.slide .edit-texto {
  outline: 2px dashed var(--accent-emphasis);
  outline-offset: 3px;
  cursor: text;
  caret-color: var(--accent-emphasis);
}
.slide .edit-texto:focus { outline-style: dashed; }

.slide .edit-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--accent-contrast);
  cursor: ew-resize;
  z-index: 20;
  touch-action: none;
}

/* ---------- HUD (bottom bar) ---------- */

.hud {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: var(--fs-caption-sm);
  color: var(--text-muted);
}

.hud .nav { display: flex; gap: var(--space-1); }

.hud .hud-left,
.hud .hud-right { display: flex; align-items: center; gap: var(--space-2); flex: none; }

/* Slide footer signature (DS §6 "Rodapé de slide"): the simple "ezon" wordmark
   left, @brunodaezon right. Simple wordmark (not the full Partners lockup) is
   what logos.md prescribes for nav-height strips — the PARTNERS descriptor turns
   to mush below ~40px. SVGs are cleaned exports from the canonical library:
   Illustrator metadata stripped (600KB -> 2KB) and viewBox retightened to the
   mark's own bounds so plain height sizing works. */
.hud .brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  flex: none;
}

.hud .wordmark {
  height: 1.05em;   /* wordmark is 4.39:1 — reads clean at HUD height */
  width: auto;
  display: block;
}

.hud .handle {
  color: var(--text-muted);
  font-size: var(--fs-caption-sm);
  white-space: nowrap;
}

/* A HUD vive FORA do palco e continua respondendo à tela real. */
@media (max-width: 720px) {
  .hud .handle { display: none; }
  .hud { flex-wrap: wrap; }
}

.hud .presenter-only { display: none; align-items: center; gap: var(--space-2); }

body.presenter .hud .presenter-only { display: flex; }

/* Preview embutido no /editor (?preview=1): é a página do apresentador — vê
   todos os slides sem liberar — mas com os controles de palco escondidos, para
   um clique dentro do preview nunca liberar slide por acidente. Depois da
   regra de cima de propósito: mesma especificidade, a ordem decide. */
body.preview .hud .presenter-only { display: none; }

.hud .clients::before {
  content: "●";
  color: var(--success);
  margin-right: 0.4em;
}

.hud .clients.offline::before { color: var(--danger); }

.presenter-notes {
  display: none;
  font-size: var(--fs-caption-sm);
  color: var(--warning);
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.presenter .presenter-notes { display: block; }

.release-state { color: var(--text-muted); white-space: nowrap; }
.release-state strong { color: var(--text); }

/* The HUD is a single row: only the presenter note may shrink/ellipsize, every
   other item keeps its natural width (otherwise the chrome wraps mid-word). */
.hud .clients, .hud .btn { white-space: nowrap; }
.hud .presenter-notes { flex: 1 1 auto; min-width: 0; }

/* No apresentador a HUD carrega muito mais controle (hands-free, edição,
   liberar, copiar prompt) e estourava a largura — as setas de navegação
   saíam da tela. Quebra em linhas quando faltar espaço, e o @handle sai
   (o apresentador sabe o próprio arroba; espaço vale mais). */
body.presenter .hud { flex-wrap: wrap; row-gap: 0.3rem; }
body.presenter .hud .handle { display: none; }

/* ---------- Lead form ---------- */

.form-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
}

.form-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-3);
}

/* The lead form is a phone-first web page, not a slide: it rides the page scale
   (see --fs-page-* in tokens.css), never the 1280-stage roles. */
.form-card h1 {
  font-family: var(--font-display);
  font-size: var(--fs-page-title);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-title);
  margin: 0 0 var(--space-1);
}
.form-card .subtitle { color: var(--text-muted); margin: 0 0 var(--space-3); font-size: var(--fs-page-body); }

.form-card label {
  display: block;
  font-size: var(--fs-page-body);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.form-card input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  padding: 0.7em 0.9em;
}

.form-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.form-card .btn-primary { width: 100%; padding: 0.85em; font-size: 1rem; margin-top: var(--space-1); }

.form-msg { margin-top: var(--space-2); font-size: var(--fs-page-body); min-height: 1.4em; }
.form-msg.ok { color: var(--success); }
.form-msg.err { color: var(--danger); }

/* ---------- Content layouts (F1 — storyboard archetypes) ---------- */

.center { text-align: center; }

/* FRASE — giant centered statement */
.frase {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: center;
  flex: 1;
  /* Sem isto o item flex assume a altura intrínseca do conteúdo e uma FRASE
     com print embaixo (p-matheus) estoura o palco: min-height 0 deixa a cadeia
     .shot-solo (flex 1 + min-height 0 + img max-height 100%) ceder altura. */
  min-height: 0;
}

/* The DS Impact Statement is 66pt, but it carries ~15-char lines. The FRASE
   slides here run 25–32 chars per line, which overflows the stage at 6.88vw, so
   .statement is anchored one role down, on DS title (44pt). lh/tracking unchanged. */
.slide .statement {
  font-size: var(--fs-title);
  font-weight: 700;
  margin: 0;
  text-wrap: balance;
}

.slide .statement em { color: var(--accent-emphasis); font-style: normal; }

.punch { margin-top: var(--space-3); }

/* Pending-image placeholder (dashed, swap later) */
.img-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 220px;
  width: 100%;
  padding: var(--space-2);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-2);
}

.img-ph .ph-label {
  font-family: var(--font-mono);
  font-size: var(--fs-caption-sm);
  letter-spacing: 0.06em;
}

.img-ph .ph-hint {
  font-size: var(--fs-caption-sm);
  opacity: 0.7;
  max-width: 34ch;
}

.img-ph.small { min-height: 110px; max-width: 460px; margin-inline: auto; }
.img-ph.wide { min-height: 180px; }
.img-ph.ghost { opacity: 0.55; }

/* TIT+VIS — title left, dominant visual right */
.titvis {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-4);
  align-items: center;
}

/* COMP — compared columns */
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.cols-3 { grid-template-columns: repeat(3, 1fr); }

.col-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.col-card h3 {
  margin: 0 0 var(--space-1);
  font-family: var(--font-display);
  font-size: var(--fs-body-lg);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-title);
  color: var(--accent-emphasis);
}

.col-card p, .col-card li { font-size: var(--fs-body-sm); }
.col-card ul { padding-left: 1.1em; }

/* NUM — metric band: number in Aurora Green, Sora 800 (DS §6 "Metric band") */
.slide .num-hero {
  font-size: var(--fs-hero);
  font-weight: 800;
  margin: 0 0 var(--space-2);
  text-wrap: balance;
}

.slide .num-hero em { color: var(--accent-emphasis); font-style: normal; }

.num-sub { font-size: var(--fs-body-lg); margin: 0 0 var(--space-2); }

/* MATRIZ — 3x3 autonomy grid with labeled axes */
.matriz-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-1);
  width: 100%;
  max-width: min(100%, 1080px);
  margin: var(--space-2) auto 0;
}

.matriz-wrap .axis-x {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-caption-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.matriz-wrap .axis-y {
  grid-column: 1;
  grid-row: 2;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-caption-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.matriz {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(108px, auto);
  gap: 6px;
}

.matriz .mhead {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3em 0.5em;
  font-family: var(--font-display);
  font-size: var(--fs-caption-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.matriz .cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
  padding: 0.5em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-muted);
  text-align: center;
}

.matriz .cell.dim { opacity: 0.45; }

.matriz .cell.hl {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-elevated));
  color: var(--text);
}

.matriz .cell.hl.strong {
  border-width: 2px;
  background: color-mix(in srgb, var(--accent) 30%, var(--bg-elevated));
}

.matriz .cell.danger {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 16%, var(--bg-elevated));
  color: var(--text);
}

.matriz .cell .c-t { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-small); line-height: 1.05; }
.matriz .cell .c-d { font-size: var(--fs-caption-sm); color: var(--text-muted); }

/* Archetype art (Bruno's 9 renders). The `.nine` grid shows all of them at once,
   so rows get taller and the art carries the cell; a highlighted single cell in
   the earlier builds uses `.big` and shows the art larger. */
/* Fanned product shots: three real screens stacked with a slight offset so the
   set reads as "a product", not as one screenshot. Front-to-back order is
   reversed with z-index so the first (Raio-X, the thesis screen) sits on top. */
.shots {
  position: relative;
  align-self: center;
  display: flex;
  justify-content: center;
  min-height: 0;
}

/* `wide` = pilha num slide de coluna única (o painel de recursos, embaixo do
   número-herói), onde há largura sobrando mas pouca altura. */
.shots.wide {
  width: min(74%, 1080px);
  margin: var(--space-2) auto 0;
  flex: 1 1 auto;
}
.shots.wide img { max-height: 100%; object-fit: contain; }

/* The FIRST shot stays in normal flow so the stack has an intrinsic height —
   with every image absolute the container collapses to a hairline. The other two
   are absolute and offset behind it. */
.shots img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.shots img:nth-child(n + 2) {
  position: absolute;
  inset: 0;
  margin: auto;
}

/* O leque abre só para a direita/baixo: abrir para a esquerda jogava a tela de
   trás por cima da coluna de texto do layout .titvis.
   A POSIÇÃO no leque é dada por classe (atribuída em ciclo pelo deck.js), não
   por nth-child: assim as telas se revezam na frente e o slide deixa de ser
   uma pilha parada. O z-index não anima, mas trocar de camada no meio de uma
   transição de transform/opacity é justamente o que dá a leitura de "carta
   sendo puxada do monte". */
/* ── Bio: timeline em 3 estados ───────────────────────────────────────────
   Portado dos slides 3–5 da proposta Calezza. Lá são três slides que revelam
   a mesma timeline por partes; aqui viram três estados do mesmo layout, com
   o marco novo entrando aceso e os anteriores recuando para texto secundário.
   O busto recortado fica à direita em todos, como no original. */
.bio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38%;
  gap: var(--space-3);
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}
.bio-col { display: flex; flex-direction: column; min-height: 0; }

.bio-trilho { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
.bio-trilho li {
  position: relative;
  padding-left: var(--space-3);
  padding-bottom: var(--space-3);
  border-left: 2px dotted var(--border);
  margin: 0;
}
.bio-trilho li:last-child { border-left-color: transparent; padding-bottom: 0; }
.bio-trilho li::before {
  content: "";
  position: absolute;
  left: -9px; top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
}
.bio-trilho .ano {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  letter-spacing: var(--ls-title);
  color: var(--text-muted);
  line-height: 1.05;
}
.bio-trilho .marco { display: block; font-size: var(--fs-body); color: var(--text-muted); }
/* O marco que ESTE estado acabou de revelar. */
.bio-trilho li.novo::before { background: var(--accent); border-color: var(--accent); }
.bio-trilho li.novo .ano { color: var(--accent); }
.bio-trilho li.novo .marco { color: var(--text); }

.bio-visual { margin-top: auto; display: flex; align-items: flex-end; gap: var(--space-2); min-height: 0; }
.bio-visual img {
  max-height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
/* Folha única com os 9 logos corporativos (alpha preservado), no rodapé da
   coluna de texto — margin-top:auto pinça como o grid antigo pinçava. Os
   slides de bio são tema claro: os logos COLORIDOS assentam direto, sem
   filter. 800px cabem na coluna (~869px útil) e param bem antes do busto
   sangrado (pixels visíveis a partir de ~1146px). Aspect ratio próprio da
   folha (1400x388) — nunca esticar. */
.bio-logos-folha { margin-top: auto; width: 800px; max-width: 100%; height: auto; }

/* ── Busto sangrado (bio + obrigado) ──────────────────────────────────────
   A foto é um RECORTE transparente com três cortes secos: embaixo (linha
   inteira), à direita (do ombro para baixo) e um fio do braço encostando na
   borda esquerda. Solução "fundo infinito": a imagem sai do fluxo e ancora
   bottom/right no PALCO (o .slide, position:absolute, é o bloco contentor),
   sangrando por cima do padding — os cortes inferior e direito coincidem com
   as bordas do slide e deixam de existir visualmente. O fio esquerdo dissolve
   num mask-image de 140px, então a figura nasce do fundo em qualquer tema
   (não há fundo próprio a fundir — o recorte é transparente). A célula
   .bio-busto segue no grid só como RESERVA de largura para o texto não correr
   por baixo da foto. 760px de altura ≈ 84% do palco: presença de hero sem
   engolir a coluna (largura resultante ~579px < os 38% reservados).
   Px fixo, sem vw/vh/@media — palco 1600x900. Preto/transparent no mask são
   alfa de máscara, não cor de design (mesmo precedente das sombras). */
.bio-busto { min-height: 0; }
.bio-busto img {
  position: absolute;
  bottom: 0;
  right: 0;
  height: 760px;
  width: auto;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 140px);
  mask-image: linear-gradient(to right, transparent 0, #000 140px);
}
/* Colunas de texto acima do busto se algum override de layout as empurrar
   para a direita — o busto nunca pode cobrir texto. */
.bio-col, .obrigado-col { position: relative; z-index: 1; }

/* Prints de proporções díspares (página inteira retrato + tela paisagem) lado
   a lado, largura total do slide. Cada print mantém o PRÓPRIO aspect ratio —
   sem crop, sem distorção; a faixa cede altura como flex item (min-height 0) e
   cada imagem se limita por max-height 100%, então a largura sai da proporção.
   O leque .shots não serve aqui: ele dá width 100% à primeira imagem, e um
   retrato de 786x1708 nessa largura estoura o palco em ~1000px. */
.prints {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.prints img {
  max-height: 100%;
  max-width: 100%;
  min-width: 0;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

/* Print único, sem leque: a peça real aparece com a mesma moldura das telas
   empilhadas, para o slide não misturar dois tratamentos de imagem. */
.shot-solo {
  margin: 0;
  align-self: center;
  display: flex;
  justify-content: center;
  /* `flex: 1 1 auto` + `min-height: 0` é o par que faz a imagem CEDER altura
     quando o slide já gastou espaço com título. Sem o min-height, o item flex
     assume a altura intrínseca da imagem e o pé do print sai cortado — foi o
     que decepou a resposta do Matheus, que é justamente o desfecho da história. */
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
.shot-solo img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

/* No grid .titvis a linha mede pelo conteúdo — max-height:100% não tem contra
   o que resolver, e um print RETRATO (renata-vsl 560x1000) na largura da coluna
   passa de 1400px de altura. Teto em px: 700 = os 740 úteis do palco menos a
   folga de borda. Prints paisagem ficam abaixo do teto e não mudam. */
.titvis .shot-solo img { max-height: 700px; }

/* Mesmo caso dentro de um .col-card (recap): o print retrato é evidência em
   miniatura, não a peça — teto baixo para o par de cards caber no palco. */
.col-card .shot-solo { margin-top: var(--space-2); }
.col-card .shot-solo img { max-height: 210px; }

/* A primeira tela segue em fluxo (é ela que dá altura ao contêiner), mas
   precisa de `position: relative` para o z-index valer quando ela for para
   trás no ciclo. */
.shots img:nth-child(1) { position: relative; }
.shots img {
  transition:
    transform var(--dur-slow) var(--ease),
    opacity var(--dur-slow) var(--ease);
}
.shots img.pos-frente { z-index: 3; transform: translate(7%, 7%) rotate(1.5deg); opacity: 1; }
.shots img.pos-meio   { z-index: 2; transform: translate(3%, 0) rotate(-1deg); opacity: 0.96; }
.shots img.pos-fundo  { z-index: 1; transform: translate(-2%, -7%) rotate(2deg); opacity: 0.9; }

/* Sem JS (ou antes do primeiro ciclo) a pilha ainda precisa ficar de pé. */
.shots img:nth-child(1):not([class*="pos-"]) { z-index: 3; transform: translate(7%, 7%) rotate(1.5deg); }
.shots img:nth-child(2):not([class*="pos-"]) { z-index: 2; transform: translate(3%, 0) rotate(-1deg); }
.shots img:nth-child(3):not([class*="pos-"]) { z-index: 1; transform: translate(-2%, -7%) rotate(2deg); opacity: 0.9; }

/* Full-bleed photo slide with the statement laid over it. The scrim is a hard
   requirement, not decoration: a room photo has bright laptop screens and the
   headline has to clear 4.5:1 wherever it lands. */
.photo-hero {
  position: relative;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.photo-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-hero figcaption {
  position: relative;
  width: 100%;
  padding: 45px 64px;
  background: linear-gradient(to top,
    rgba(10, 10, 10, 0.94) 0%,
    rgba(10, 10, 10, 0.82) 42%,
    rgba(10, 10, 10, 0) 100%);
}

.photo-hero figcaption .statement { margin-bottom: var(--space-1); }

/* Every matriz build has to fit a 720p stage without scrolling (the smallest
   projector we plan for), so the grid claims the leftover column height instead
   of asking for a fixed row size: header row auto, three content rows split what
   is left, art scales to whatever each cell ends up being. */
.slide:has(.matriz) .matriz-wrap { flex: 1 1 auto; min-height: 0; }
.matriz {
  height: 100%;
  grid-auto-rows: unset;
  grid-template-rows: auto repeat(3, minmax(0, 1fr));
}

.matriz .cell.arq { gap: 0.1em; padding: 0.3em 0.3em 0.4em; justify-content: flex-end; min-height: 0; }

.matriz .cell.arq img {
  width: auto;
  max-width: 88%;
  height: 0;
  min-height: 0;
  flex: 1 1 auto;
  object-fit: contain;
  /* The renders are lit for white; a soft drop keeps them from floating on the
     Galaxy background without adding a plate behind each one. */
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.55));
}

.slide:has(.matriz) .matriz-cap { margin-top: var(--space-2); flex: none; }
.slide:has(.matriz) > h2 { flex: none; }

.matriz .cell.arq .c-t { font-size: var(--fs-caption-sm); text-wrap: balance; }
.matriz .cell.arq.danger .c-t { color: var(--danger); }

/* Same contract as .arq: the art absorbs whatever height the labels leave, so a
   single tall cell can never spill into the row below it. */
.matriz .cell.big { min-height: 0; padding: 0.35em 0.4em 0.45em; gap: 0.1em; overflow: hidden; }

.matriz .cell.big img {
  width: auto;
  max-width: 94%;
  /* height:0 + grow makes the art size purely from what the flex row leaves,
     never from its intrinsic pixels — a percentage flex-basis here resolves
     against the image's own aspect and overflows the cell. */
  height: 0;
  min-height: 0;
  flex: 1 1 auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.6));
}

.matriz .cell.tiger { padding: 0.2em; overflow: visible; position: relative; }
.matriz .cell .img-ph { min-height: 100%; margin-top: 0; flex: 1; border-color: var(--danger); }

/* Fortune Tiger: transborda a célula de propósito — a piada é o exagero.
   Absoluto para não esticar a linha do grid (as 3 linhas ficam iguais). */
.matriz .cell .tiger-img {
  position: absolute;
  top: 46%;
  left: 50%;
  width: 128%;
  max-width: none;
  transform: translate(-50%, -50%) rotate(-6deg);
  transform-origin: center;
  filter: drop-shadow(0 10px 28px color-mix(in srgb, var(--danger) 55%, transparent));
  animation: tiger-in 420ms cubic-bezier(.2, 1.3, .4, 1) both;
  pointer-events: none;
  z-index: 2;
}
.matriz .cell .tiger-mini { width: 76%; max-width: none; margin-bottom: 0.15em; }

@keyframes tiger-in {
  from { opacity: 0; transform: translate(-50%, -50%) rotate(-6deg) scale(0.55); }
  to   { opacity: 1; transform: translate(-50%, -50%) rotate(-6deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .matriz .cell .tiger-img { animation: none; }
}

.matriz-cap {
  text-align: center;
  margin: var(--space-3) 0 0;
  color: var(--text);
  font-size: var(--fs-body);
  position: relative;
  z-index: 3;
}

/* MAP3 / flow — boxes joined by arrows */
.map3 {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.map3 .box {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
}

.map3 .box .t { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-body-lg); line-height: var(--lh-tight); }
.map3 .box .d { color: var(--text-muted); font-size: var(--fs-body-sm); }
.map3 .arrow { align-self: center; color: var(--accent); font-size: var(--fs-h2); flex: none; }

/* QR — central placeholder box */
.qr-box {
  width: 396px;
  max-width: 100%;
  aspect-ratio: 1;
  margin: var(--space-3) auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-2);
}

/* Botão-espelho do QR: mesmo destino do código, para quem já está com o deck
   aberto na URL (não dá para escanear a própria tela). <a> com cara de .btn. */
a.btn { text-decoration: none; display: inline-block; }
.qr-acao { margin-top: 4px; }

/* Arte vetorial solta (frutas): SEM moldura nem sombra — o fundo do SVG é
   transparente e a composição precisa do palco atrás, não de um card. */
.frutas-art { margin: 0; display: flex; justify-content: center; min-height: 0; }
.frutas-art img { width: 100%; max-height: 640px; object-fit: contain; }

.qr-box .ph-label { font-family: var(--font-mono); font-size: var(--fs-caption-sm); }
.qr-box .ph-hint { font-size: var(--fs-caption-sm); opacity: 0.7; max-width: 28ch; }

/* Slides de QR: o código manda no espaço vertical e o resto cede. As margens
   default de <p> (1em ≈ 30-33px por lado) somadas a título + QR + botão +
   legenda passavam dos 740px úteis; margens enxutas devolvem o slide ao palco
   sem encolher o QR (tamanho = escaneabilidade do fundo da sala). */
.slide:has(.qr-box.live) p.center { margin-block: var(--space-1); }
.slide:has(.qr-box.live) .qr-box { margin-block: var(--space-2); }
/* QR de verdade: fundo branco, sem moldura tracejada. O leitor do celular
   depende do contraste claro/escuro e da margem quieta em volta do código —
   por isso o QR ganha o box inteiro, e não o tratamento de placeholder. */
.qr-box.live {
  background: #fff;
  border: none;
  padding: var(--space-1);
  gap: 0;
}
.qr-box.live img { width: 100%; height: 100%; display: block; }
/* 220px (era 260): o slide do quiz soma cards + QR + botão e passava 36px do
   palco; o QR pequeno é reforço do botão /quiz, não o scan principal. */
.qr-box.small { width: 220px; margin: var(--space-2) auto 0; }

/* STEP — checkpoint block */
/* STEP slides: prompt beside checkpoint+fallback so nothing essential falls below
   the fold on a projector. Single column below 1100px (laptops scroll naturally). */
.step-grid { display: grid; gap: var(--space-3); margin-top: var(--space-3); }

@container (min-width: 1100px) {
  .step-grid { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); align-items: start; }
  .step-grid .prompt-block { margin-top: 0; }
  .step-grid .checkpoint,
  .step-grid .downloads { margin-top: 0; }
  .step-side { display: flex; flex-direction: column; gap: var(--space-2); }
  /* The prompt is copied, not read off the screen — capping it keeps the title,
     the copy button and the checkpoint above the fold. It scrolls internally.
     300px (era 342): o slide de briefing tem 7 campos de placeholder em duas
     linhas e estourava o palco em 39px — o corte sai do pre, que já rola. */
  .step-grid .prompt-block pre { max-height: 300px; }
  /* Tighter intro on step slides: they carry a placeholder bar the others lack. */
  .slide[data-kind="step"] h2 { margin-bottom: var(--space-2); }
  .slide[data-kind="step"] > p { margin-bottom: 0; }
  /* The briefing slide has 7 fields and wraps to two rows; a denser bar keeps the
     checkpoint on screen without shrinking the tap targets below usable size. */
  .placeholders { gap: var(--space-1) var(--space-2); padding: var(--space-2) var(--space-2); }
  .placeholders label { gap: 0.2rem; }
  .placeholders input { padding: 0.4em 0.7em; min-width: 10ch; }
}

.checkpoint {
  margin-top: var(--space-3);
  border-left: 4px solid var(--success);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}

.checkpoint .cp-label {
  display: block;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--font-display);
  font-size: var(--fs-caption-sm);
  font-weight: 700;
  margin-bottom: 0.3em;
}

.checkpoint p { margin: 0; font-size: var(--fs-body-sm); }

/* Error build trail (previous errors, muted) */
.err-trail {
  list-style: none;
  padding: 0;
  margin-top: var(--space-4);
  color: var(--text-muted);
  opacity: 0.6;
}

.err-trail li { font-size: var(--fs-body-sm); margin-bottom: 0.4em; }

/* Seeding thumbnails (real images) */
.thumbs {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.thumbs figure { flex: 1 1 280px; margin: 0; max-width: 480px; }

.thumbs img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.thumbs figcaption {
  margin-top: var(--space-1);
  font-size: var(--fs-caption-sm);
  color: var(--text-muted);
}

/* ---------- Slide de agradecimento (c-obrigado) ---------- */

/* Mesma geometria da .bio (coluna direita 38%, busto ancorado embaixo — o
   .bio-busto é reutilizado tal qual); a coluna esquerda centra o bloco
   Obrigado + logo na vertical (margin: auto absorve o espaço livre acima e
   abaixo) e o handle fica preso no rodapé da coluna. Slide escuro: o logo
   servido já é o branco. */
.obrigado {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38%;
  gap: var(--space-3);
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}
.obrigado-col { display: flex; flex-direction: column; min-height: 0; }
.obrigado-centro { margin: auto 0; }
.obrigado-centro h1 { margin-bottom: 0; }
.obrigado-logo { display: block; width: 380px; height: auto; margin-top: var(--space-4); }
.obrigado-handle { margin: 0; }

/* ---------- Chip de referência ao guia visual (kit do Drive) ---------- */

/* Aponta a plateia para uma seção REAL do 05-guia-visual-setup.html que ela
   tem no kit. Discreto por design (caption, borda fina) e válido nos DOIS
   temas: só consome tokens, que o data-tema="claro" re-resolve sozinho. */
.guia-ref {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55em;
  padding: 0.5em 0.95em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  color: var(--text-muted);
  font-size: var(--fs-caption-sm);
}
.guia-ref strong { color: var(--text); font-weight: 600; }

/* ---------- Elemento escondido (layout.els[sel].hide) ---------- */

/* display none tira o elemento do fluxo: o resto do slide fecha o espaço e o
   palco 1600x900 segue intacto. Fora do modo Editar (plateia, Apresentar,
   miniatura) ele não existe; no Editar vira fantasma selecionável, para dar
   para "Mostrar" de novo. A impressão esconde sempre, até a partir do Editar. */
body:not(.editmode) .slide .edit-oculto { display: none !important; }
body.editmode .slide .edit-oculto {
  opacity: 0.28;
  outline: 2px dashed var(--text-muted);
  outline-offset: 3px;
}
@media print {
  .slide .edit-oculto { display: none !important; }
}

/* ---------- Tela única do apresentador: modos e painéis ---------- */

.modos { display: inline-flex; gap: 0; }
.modos[hidden] { display: none; }
.modos .btn { border-radius: 0; }
.modos .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.modos .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.modos .btn + .btn { margin-left: -1px; }

/* Cada modo mostra o seu bloco do painel; os filhos "soltos" (prévia e
   notas) são o bloco do Apresentar. */
.painel-apresentador .pa-editar,
.painel-apresentador .pa-historico { display: none; }
body.modo-editar .painel-apresentador > :not(.pa-editar),
body.modo-historico .painel-apresentador > :not(.pa-historico) { display: none; }
body.modo-editar .painel-apresentador > .pa-editar,
body.modo-historico .painel-apresentador > .pa-historico {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* Botões do painel menores que os da HUD: a coluna é estreita. */
.painel-apresentador .btn { font-size: 0.8rem; padding: 0.3em 0.75em; }
.pa-editar .ed-ordem { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pa-editar .ed-ordem a.btn { text-decoration: none; }
.pa-editar .ed-campo { display: flex; flex-direction: column; gap: 0.3rem; }
.pa-editar .ed-nome {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.pa-editar .ed-nome .ed-editado { color: var(--warning); font-weight: 700; margin-left: 0.4em; }
.pa-editar textarea {
  width: 100%;
  min-height: 3.2em;
  resize: vertical;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.45;
  padding: 0.5em 0.6em;
}
.pa-editar textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pa-editar .ed-campo.editado textarea { border-color: var(--warning); }
/* Rascunho não salvo: borda e rótulo no accent, distinto do "editado"
   (override salvo), e a lista do que ainda só existe nesta tela. */
.pa-editar .ed-nome .ed-naosalvo { color: var(--accent); font-weight: 700; margin-left: 0.4em; }
.pa-editar .ed-campo.rascunho textarea { border-color: var(--accent); border-style: dashed; }
.pa-editar .ed-pendentes {
  margin: 0;
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.35em 0.6em;
}
.pa-editar .ed-pendentes[hidden] { display: none; }
.pa-editar .ed-acoes { display: flex; gap: 0.4rem; }

.pa-historico .hist-vazio { color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.pa-historico .hist-vazio.err { color: var(--danger); }
.pa-historico .hist-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.pa-historico .hist-meta { color: var(--text-muted); }
.pa-historico .hist-meta strong { color: var(--text); font-weight: 600; }
.pa-historico .hist-lado { display: flex; gap: 0.4rem; align-items: baseline; }
.pa-historico .hist-lado > span:first-child {
  flex: none;
  width: 4.6em;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.pa-historico .hist-lado code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
  overflow-wrap: anywhere;
}
.pa-historico .hist-item .btn { align-self: flex-start; }
.pa-historico .hist-mais { align-self: center; }

/* ---------- Responsive ---------- */

/* Aqui existiam refluxos de celular: coluna única, mapa na vertical, eixo da
   matriz escondido. Com o palco fixo em 1600x900 eles nunca mais valem — o
   slide não reflui, ele encolhe inteiro. Mantê-los como container query só
   deixaria código morto que um dia alguém tentaria "consertar". Removidos.
   A HUD, que É responsiva, ficou no @media acima.
   `.presenter-notes` também é HUD e segue no bloco de cima se precisar. */
