/* Páginas do convidado (redesign 6.1): 03a Enviar fotos, 03b Seleção + nome, 03c Enviado,
   03d Álbum ao vivo, 03e Gravar story. Mobile first, 390 px de referência.
   Depende de pm.css (tokens e componentes). O tema muda só cores e tipografia, nunca layout. */

/* ------------------------------------------------------------ Temas por evento */
/* Mesmos valores de lib/tema.js (tests/tema.test.js confere as duas cópias). O tema
   'custom' chega como style inline no <html>, com as variáveis abaixo. */

[data-theme="festa"] {
  --tema-bg: #FF5A2C; --tema-rgb: 255 90 44; --tema-titulo: #FFFFFF; --tema-accent: #BBA8FF;
  --tema-soft: #FFE5DA; --tema-fab-bg: #FF5A2C; --tema-fab-fg: #FFFFFF;
}

[data-theme="elegante"] {
  --tema-bg: #16121D; --tema-rgb: 22 18 29; --tema-titulo: #E9D8B4; --tema-accent: #E9D8B4;
  --tema-soft: #F5EEE0; --tema-fab-bg: #E9D8B4; --tema-fab-fg: #16121D;
}

[data-theme="corporativo"] {
  --tema-bg: #1B2557; --tema-rgb: 27 37 87; --tema-titulo: #FFFFFF; --tema-accent: #96D3FF;
  --tema-soft: #E3F3FF; --tema-fab-bg: #1B2557; --tema-fab-fg: #FFFFFF;
}

[data-theme="kids"] {
  --tema-bg: #D8F35A; --tema-rgb: 216 243 90; --tema-titulo: #FFFFFF; --tema-accent: #96D3FF;
  --tema-soft: #F4FCD3; --tema-fab-bg: #16121D; --tema-fab-fg: #FFFFFF;
}

[data-theme="formatura"] {
  --tema-bg: #0E3B2E; --tema-rgb: 14 59 46; --tema-titulo: #F2C14E; --tema-accent: #F2C14E;
  --tema-soft: #E4EFE9; --tema-fab-bg: #0E3B2E; --tema-fab-fg: #FFFFFF;
}

/* ------------------------------------------------------------ Página */

html {
  background: var(--paper);
}

.pagina {
  position: relative;
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  overflow-x: hidden;
}

@media (min-width: 560px) {
  body {
    background: var(--paper-2);
  }

  .pagina {
    box-shadow: var(--sh-md);
  }
}

/* ------------------------------------------------------------ Capa (03a / 03d) */
/* O frame do Figma tem a barra de status do iPhone (~42 px) por cima da capa; no navegador
   ela não faz parte da página. Capa = 290 − 42 + safe-area; barra glass a 16 px do topo. */

.capa {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: calc(248px + env(safe-area-inset-top));
  padding: calc(72px + env(safe-area-inset-top)) 22px 46px;
  background: var(--tema-bg);
  color: var(--tema-titulo);
  overflow: hidden;
}

.capa-foto {
  position: absolute;
  inset: 0;
  z-index: -3;
}

.capa-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Degradê 2 (embaixo): cor do tema de 0% a 92%. */
.capa::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, rgb(var(--tema-rgb) / 0) 0%, rgb(var(--tema-rgb) / .92) 100%);
  pointer-events: none;
}

[data-theme="kids"] .capa::before {
  background: linear-gradient(180deg, rgb(22 18 29 / 0) 0%, rgb(22 18 29 / .55) 100%);
}

/* Degradê 1 (em cima): ink de 35% a 0%, garante a barra glass legível sobre qualquer foto. */
.capa::after {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 55%;
  z-index: -1;
  background: linear-gradient(180deg, rgb(22 18 29 / .35) 0%, rgb(22 18 29 / 0) 100%);
  pointer-events: none;
}

/* Sem foto de capa: brilhos da marca em branco translúcido sobre a cor do tema. */
.capa-brilhos {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: none;
  color: rgb(255 255 255 / 30%);
  pointer-events: none;
}

.capa-foto:empty ~ .capa-brilhos {
  display: block;
}

.brilho {
  position: absolute;
  display: block;
}

.capa-brilhos .brilho-1 { right: 30px; top: calc(78px + env(safe-area-inset-top)); color: rgb(255 255 255 / 35%); }
.capa-brilhos .brilho-2 { right: 84px; top: calc(122px + env(safe-area-inset-top)); color: rgb(255 255 255 / 25%); }
.capa-brilhos .brilho-3 { right: 54px; top: calc(150px + env(safe-area-inset-top)); color: rgb(255 255 255 / 18%); }

.capa-barra {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill-glass {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 6px;
  border-radius: var(--r-pill);
  background: rgb(255 255 255 / 18%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  color: var(--white);
}

.capa-logo .logo-marca {
  width: 24px;
  height: 24px;
}

.capa-logo .logo-texto {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.capa-acoes {
  display: flex;
  gap: 8px;
}

.capa-acoes .btn-icone {
  --btn-h: 36px;
}

.capa-acoes .btn-icone .ic {
  width: 17px;
  height: 17px;
}

.capa-info {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.chip-tipo {
  padding: 6px 10px;
  background: var(--tema-accent);
  color: var(--ink);
  font-weight: 600;
  font-size: 12.5px;
}

.capa-titulo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 11.8vw, 46px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--tema-titulo);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

[data-title-style="classico"] .capa-titulo {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(37px, 12.7vw, 50px);
  letter-spacing: -0.01em;
  line-height: 1.02;
}

.capa-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  font-weight: 500;
  font-size: 13.5px;
  line-height: 1.3;
  color: rgb(255 255 255 / 92%);
}

.capa-meta:empty {
  display: none;
}

.capa-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.capa-meta-item .ic {
  width: 15px;
  height: 15px;
  flex: none;
}

/* Capa compacta do álbum (03d): 220 − 42 px, sem chip, título de 32 px. */
.capa--compacta {
  min-height: calc(178px + env(safe-area-inset-top));
  padding-bottom: 44px;
}

.capa--compacta .capa-titulo {
  font-size: 32px;
  letter-spacing: -0.03em;
}

[data-title-style="classico"] .capa--compacta .capa-titulo {
  font-size: 35px;
  letter-spacing: -0.01em;
}



/* ------------------------------------------------------------ Conteúdo */

.conteudo {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: -26px;
  padding: 20px 20px calc(28px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--paper);
}

.event-slot:empty {
  display: none;
}

.event-welcome {
  margin: -6px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-70);
  text-align: center;
  overflow-wrap: anywhere;
}

.secao-topo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.secao-titulo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.secao-link {
  position: relative;
  font-size: 13.5px;
}

.secao-link::after {
  content: '';
  position: absolute;
  inset: -12px -8px;
}

/* ------------------------------------------------------------ Stories (03a) */

.stories-bar {
  display: flex;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0 0 2px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  /* o snap alinha pela borda do snapport, que ignora o padding: sem isto o "Gravar" cola na
     borda da tela ao carregar */
  scroll-padding-inline: 20px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.stories-bar::-webkit-scrollbar {
  display: none;
}

.story-item {
  flex: none;
  width: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  border-radius: 14px;
}

.story-gravar-circulo {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--flash-soft);
  border: 2px dashed var(--flash);
  color: var(--flash-dark);
}

.story-nome {
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-70);
}

.story-gravar .story-nome {
  font-weight: 600;
  color: var(--flash-dark);
}

/* ------------------------------------------------------------ Card de envio (03a / 03b) */

.envio-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  box-shadow: inset 0 0 0 1px var(--line), var(--sh-sm);
}

.seletor {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 16px;
  border-radius: 18px;
  border: 1.5px dashed rgb(255 90 44 / 60%);
  background: rgb(255 229 218 / 50%);
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-fast);
}

.seletor:focus-within,
#photoInput:focus-visible + .seletor {
  box-shadow: var(--focus);
}

.envio-card {
  position: relative;
}

.seletor.drag-over {
  background: var(--flash-soft);
}

.seletor-mais {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--flash);
  color: var(--white);
  box-shadow: 0 12px 16px rgb(23 18 28 / 8%), 0 2px 3px rgb(23 18 28 / 5%);
}

.seletor-mais .ic {
  width: 26px;
  height: 26px;
}

.envio-card .campo-caixa {
  min-height: 50px;
}

.envio-card .campo-caixa input {
  height: 48px;
}

.seletor-titulo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.seletor-sub {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-50);
}

.seletor-selecao {
  margin-top: -4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--flash-dark);
}

.com-videos { display: none; }
[data-allow-videos="true"] .so-fotos { display: none; }
[data-allow-videos="true"] .com-videos { display: inline; }

.envio-card .btn-primary .ic {
  width: 21px;
  height: 21px;
}

.mensagem {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-70);
  text-align: center;
}

.mensagem:empty {
  display: none;
}

.mensagem.is-erro {
  color: var(--erro);
  font-weight: 500;
}

.mensagem.is-ok {
  color: var(--ok-text);
  font-weight: 600;
}

.identity-line {
  margin: -2px 0 0;
  font-size: 13px;
  color: var(--ink-50);
  text-align: center;
}

.identity-action {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--flash-dark);
  cursor: pointer;
}

.identity-action::after {
  content: '';
  position: absolute;
  inset: -14px -6px;
}

#identityLineSlot:empty {
  display: none;
}

/* ------------------------------------------------------------ Prova social e rodapé */

.prova {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-70);
  text-align: center;
}

.prova strong {
  font-weight: 700;
  color: var(--ink);
}

.prova .avatar:nth-child(4n + 2) { background: var(--lime); }
.prova .avatar:nth-child(4n + 3) { background: var(--sky); }
.prova .avatar:nth-child(4n + 4) { background: var(--pink); }

.feito-com {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 6px;
  font-size: 12px;
  color: var(--ink-50);
}

.feito-com .logo {
  --logo-h: 16px;
  gap: 5px;
}

.feito-com .logo-texto {
  font-size: 11px;
}

/* ------------------------------------------------------------ 03b · Seleção */

.topo,
.selecao-topo,
.selecao-grade {
  display: none;
}

.pagina[data-view="selecao"] .capa,
.pagina[data-view="selecao"] .event-slot,
.pagina[data-view="selecao"] .stories,
.pagina[data-view="selecao"] .seletor {
  display: none !important;
}

.pagina[data-view="selecao"] .topo {
  display: flex;
}

.pagina[data-view="selecao"] .selecao-topo {
  display: flex;
}

.pagina[data-view="selecao"] .selecao-grade {
  display: grid;
}

.pagina[data-view="selecao"] .conteudo {
  margin-top: 0;
  padding-top: 0;
}

.topo {
  align-items: center;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) 20px 18px;
}

.topo .btn-icone {
  --btn-h: 36px;
  flex: none;
}

.topo .btn-icone .ic {
  width: 17px;
  height: 17px;
}

.topo-textos {
  min-width: 0;
}

.topo-titulo {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.topo-meta {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--ink-50);
}

.topo-meta:empty {
  display: none;
}

.selecao-topo {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selecao-topo .btn-link {
  position: relative;
  font-size: 13.5px;
  color: var(--ink-50);
}

.selecao-topo .btn-link::after {
  content: '';
  position: absolute;
  inset: -12px -10px;
}

.selecao-grade {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sel-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper-2);
}

.sel-botao {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

.sel-botao img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--t-fast);
}

.sel-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-50);
}

.sel-check {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--flash);
  color: var(--white);
}

.sel-check .ic {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

.sel-item.is-desmarcado img {
  opacity: .45;
}

.sel-item.is-desmarcado .sel-check {
  background: rgb(255 255 255 / 85%);
  color: transparent;
}

.sel-item .tile-video {
  top: auto;
  right: auto;
  bottom: 6px;
  left: 6px;
  gap: 6px;
  padding: 3px 7px;
  background: rgb(22 18 29 / 70%);
  font-size: 10.5px;
  font-weight: 700;
}

.sel-item .tile-video .ic {
  width: 10px;
  height: 10px;
}

.sel-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1.5px dashed var(--line-2);
  color: var(--ink-70);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sel-add:focus-within {
  box-shadow: var(--focus);
}

.sel-add .ic {
  width: 22px;
  height: 22px;
}

/* ------------------------------------------------------------ 03b · Bottom sheet do nome */

.name-modal .sheet-titulo {
  margin-top: 0;
}

.name-modal .sheet-texto {
  margin-top: -8px;
}

.name-modal .campo-caixa {
  min-height: 54px;
}

.name-modal-error {
  margin: -8px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--erro);
  text-align: left;
}

.name-modal-error:empty {
  display: none;
}

.name-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.name-modal-actions .btn-text {
  min-height: 46px;
  font-size: 15px;
  color: var(--ink);
}

/* ------------------------------------------------------------ 03c · Enviado */
/* Figma 2:1149: coluna com pílula no topo, o bloco do meio (colagem, texto, progresso) e os
   botões na base. Padding 64 − 42 (barra de status) + safe-area. */

.enviado {
  position: relative;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(22px + env(safe-area-inset-top)) 24px calc(34px + env(safe-area-inset-bottom));
  overflow: hidden;
  text-align: center;
}

.pagina[data-view="enviado"] .enviado {
  display: flex;
}

.pagina[data-view="enviado"] > :not(.enviado) {
  display: none !important;
}

.enviado > * {
  position: relative;
  z-index: 1;
}

.enviado-brilhos {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.enviado-brilhos .eb-1 { left: 40px; top: calc(98px + env(safe-area-inset-top)); color: var(--flash); }
.enviado-brilhos .eb-2 { left: 320px; top: calc(68px + env(safe-area-inset-top)); color: var(--lilac); }
.enviado-brilhos .eb-3 { left: 300px; top: calc(288px + env(safe-area-inset-top)); color: var(--lime); }
.enviado-brilhos .eb-4 { left: 60px; top: calc(318px + env(safe-area-inset-top)); color: var(--flash); }
.enviado-brilhos .eb-5 { left: 338px; top: calc(428px + env(safe-area-inset-top)); color: var(--sky); }
.enviado-brilhos .eb-6 { left: 330px; top: calc(518px + env(safe-area-inset-top)); color: var(--pink); }

.enviado-evento {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 0;
  padding: 6px 14px 6px 6px;
  border-radius: var(--r-pill);
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.enviado-evento > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enviado-evento-capa {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: var(--tema-bg);
}

.enviado-evento-capa img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.enviado-evento-capa .logo-marca {
  width: 20px;
  height: 20px;
}

.enviado-meio {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Colagem 260 × 200: a 1ª foto enviada no centro (por cima), a 2ª à esquerda e a 3ª à direita. */
.colagem {
  position: relative;
  width: 260px;
  height: 200px;
  margin: 0 auto;
}

.colagem-foto {
  position: absolute;
  width: 120px;
  height: 150px;
  border: 5px solid var(--white);
  border-radius: 16px;
  background: var(--paper-2);
  box-shadow: 0 12px 32px rgb(23 18 28 / 8%), 0 2px 6px rgb(23 18 28 / 5%);
  object-fit: cover;
}

.colagem-foto:nth-of-type(1) { left: 65px; top: 11px; transform: rotate(1deg); z-index: 3; }
.colagem-foto:nth-of-type(2) { left: 6px; top: 39px; transform: rotate(10deg); z-index: 1; }
.colagem-foto:nth-of-type(3) { left: 131px; top: 14px; transform: rotate(-9deg); z-index: 2; }

.colagem-check {
  position: absolute;
  left: 98px;
  top: 138px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 5px solid var(--white);
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  box-shadow: 0 12px 16px rgb(23 18 28 / 8%), 0 2px 3px rgb(23 18 28 / 5%);
  transform: scale(0);
  transition: transform var(--t-slow) var(--ease);
}

.colagem-check .ic {
  width: 28px;
  height: 28px;
  stroke-width: 2.5;
}

.enviado.is-pronto .colagem-check {
  transform: scale(1);
}

.colagem[data-fotos="0"] .colagem-check {
  top: 68px;
}

.enviado-textos {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.enviado-titulo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.enviado-titulo:focus {
  outline: none;
}

.enviado-texto {
  max-width: 342px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-70);
}

.enviado-texto:empty {
  display: none;
}

.progresso-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
}

.progresso-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}

.progresso-pct {
  font-weight: 700;
  color: var(--ink-70);
  font-variant-numeric: tabular-nums;
}

.enviado.is-pronto .progresso-pct {
  color: var(--ok);
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--paper-2);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--flash);
  transition: width 200ms linear, background-color var(--t-med);
}

.enviado.is-pronto .progress-bar {
  background: var(--ok);
}

.progresso-card .mensagem {
  text-align: left;
}

.enviado-acoes {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.enviado.is-enviando .enviado-acoes {
  visibility: hidden;
}

/* ------------------------------------------------------------ 03d · Álbum ao vivo */

.pagina--album .conteudo {
  gap: 16px;
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
}

.filtros {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filtros::-webkit-scrollbar {
  display: none;
}

.filtro {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.2;
  color: var(--ink-70);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.filtro::after {
  content: '';
  position: absolute;
  inset: -6px -3px;
}

.filtro.is-active {
  background: var(--ink);
  color: var(--white);
  box-shadow: none;
}

.filtro:focus-visible {
  box-shadow: var(--focus);
}

.filtro-conta:empty {
  display: none;
}

.filtro-conta::before {
  content: ' · ';
  white-space: pre;
}

.album-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ao-vivo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-70);
}

.ao-vivo-ponto {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
}

.ao-vivo-ponto::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--live);
  opacity: .35;
  animation: pulso 1.8s ease-out infinite;
}

@keyframes pulso {
  0% { transform: scale(.5); opacity: .45; }
  100% { transform: scale(1.6); opacity: 0; }
}

.ordem {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: -10px 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.ordem .ic {
  width: 16px;
  height: 16px;
  transition: transform var(--t-fast);
}

.ordem[data-ordem="antigas"] .ic {
  transform: rotate(180deg);
}

.album-vazio {
  margin: 0;
  padding: 28px 18px;
  border-radius: 22px;
  border: 1.5px dashed var(--line-2);
  background: var(--white);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-70);
  text-align: center;
}

.album-vazio.is-erro {
  color: var(--erro);
}

.masonry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.masonry-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.album-item {
  width: 100%;
  min-height: 96px;
  padding: 0;
  border: 0;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  animation: entrar var(--t-slow) var(--ease);
}

.album-item > img {
  height: auto;
  min-height: 96px;
}

.album-item.is-story > img {
  aspect-ratio: 9 / 14;
  height: auto;
}

.album-item-sem-foto {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  color: var(--ink-50);
}

@keyframes entrar {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.fab {
  position: fixed;
  left: 50%;
  bottom: calc(30px + env(safe-area-inset-bottom));
  z-index: 40;
  background: var(--tema-fab-bg);
  color: var(--tema-fab-fg);
  box-shadow: var(--sh-xl);
  transform: translateX(-50%);
}

.fab:active {
  transform: translateX(-50%) scale(.98);
}

/* ------------------------------------------------------------ Lightbox do álbum */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(64px + env(safe-area-inset-top)) 12px calc(64px + env(safe-area-inset-bottom));
  background: rgb(22 18 29 / 94%);
}

.lightbox img,
.lightbox video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
  object-fit: contain;
}

.lightbox-fechar {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  --btn-h: 44px;
}

.lightbox-autor {
  position: absolute;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: rgb(255 255 255 / 14%);
  color: var(--white);
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  transform: translateX(-50%);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------ Modal do QR (qr.js) */

.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgb(22 18 29 / 60%);
}

.qr-card {
  position: relative;
  width: min(340px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 24px 24px;
  border-radius: 28px;
  background: var(--white);
  box-shadow: var(--sh-lg);
  text-align: center;
}

.qr-card h3 {
  margin: 8px 0 0;
  padding: 0 40px; /* não passa por baixo do botão de fechar */
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.qr-moldura {
  position: relative;
  padding: 10px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
}

.qr-moldura img {
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
}

.qr-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  padding: 4px;
  border-radius: 14px;
  background: var(--white);
  transform: translate(-50%, -50%);
}

.qr-logo svg {
  width: 38px;
  height: 38px;
}

.qr-hint {
  margin: 0;
  font-size: 14px;
  color: var(--ink-70);
}

.qr-url {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.qr-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

/* ------------------------------------------------------------ Aviso curto (toast) */

.aviso {
  position: fixed;
  left: 50%;
  bottom: calc(110px + env(safe-area-inset-bottom));
  z-index: 95;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--sh-md);
  transform: translateX(-50%);
}

/* Recusa do servidor (álbum bloqueado, teto de envios): mesmas cores do aviso curto, mas fica
   até recarregar, ocupa a largura e leva o botão do WhatsApp. z-index 50: acima do FAB (40),
   abaixo do lightbox, do gravador e do player de story, que cobrem a tela inteira. */
.aviso--fixo {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
  z-index: 50;
  max-width: none;
  padding: 14px 16px;
  border-radius: var(--r-input);
  transform: none;
}

.aviso--fixo p {
  margin: 0;
}

.aviso-whats {
  justify-self: start;
}

/* ------------------------------------------------------------ 03e · Story: player */

.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: var(--white);
}

.story-viewer video,
.story-viewer > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity var(--t-fast);
}

.story-switching {
  opacity: 0;
}

.story-progress {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  gap: 4px;
}

.story-progress-track {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: rgb(255 255 255 / 30%);
}

.story-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--white);
}

.story-viewer-topo {
  position: absolute;
  top: calc(24px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.story-viewer-topo > * {
  pointer-events: auto;
}

.story-viewer-autor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 6px rgb(0 0 0 / 40%);
}

.story-viewer-autor:empty {
  visibility: hidden;
}

.story-viewer-autor .avatar {
  --av: 28px;
  text-shadow: none;
}

.story-overlay-close {
  --btn-h: 44px;
  margin-left: auto;
}

.story-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 3;
  max-height: 4.5em;
  margin: 0;
  overflow: hidden;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgb(22 18 29 / 45%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
  overflow-wrap: anywhere;
}

.story-caption.expanded {
  max-height: 60vh;
  overflow-y: auto;
}

.story-tap {
  position: absolute;
  top: calc(80px + env(safe-area-inset-top));
  bottom: calc(110px + env(safe-area-inset-bottom));
  z-index: 2;
}

.story-tap-left { left: 0; width: 35%; }
.story-tap-right { right: 0; width: 65%; }

/* ------------------------------------------------------------ 03e · Story: gravador */

.story-recorder {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: hidden;
  background: #000;
  color: var(--white);
}

.story-recorder video,
.story-recorder .rec-midia {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-recorder video.mirrored {
  transform: scaleX(-1);
}

.rec-grad-topo,
.rec-grad-base {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}

.rec-grad-topo {
  top: 0;
  height: calc(178px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgb(22 18 29 / .75) 0%, rgb(22 18 29 / 0) 100%);
}

.rec-grad-base {
  bottom: 0;
  height: calc(340px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgb(22 18 29 / 0) 0%, rgb(22 18 29 / .85) 100%);
}

.rec-progresso {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  z-index: 2;
  height: 4px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: rgb(255 255 255 / 30%);
}

.rec-progresso-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--white);
}

.rec-topo {
  position: absolute;
  top: calc(28px + env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rec-topo .btn-icone {
  --btn-h: 46px;
  flex: none;
}

.rec-topo .btn-icone .ic,
.rec-controles .flip-button .ic {
  width: 19px;
  height: 19px;
}

.rec-topo .btn-icone[aria-pressed="true"] {
  background: var(--white);
  color: var(--ink);
}

.rec-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 42px;
  padding: 0 14px 0 6px;
  border-radius: var(--r-pill);
  background: rgb(255 255 255 / 16%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.rec-pill > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  overflow: hidden;
  border: 1.5px solid var(--white);
  border-radius: 50%;
  background: var(--tema-bg);
}

.rec-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rec-avatar .logo-marca {
  width: 22px;
  height: 22px;
}

.rec-chip {
  position: absolute;
  top: calc(94px + env(safe-area-inset-top));
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: rgb(22 18 29 / 55%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
}

.rec-chip::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rec);
  animation: piscar 1s steps(2, start) infinite;
}

@keyframes piscar {
  to { visibility: hidden; }
}

.rec-base {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(19px + env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 35px;
  padding: 0 20px;
}

/* Legenda: caixa de 300 px, raio 16, ink a 45% com blur (Figma 2:1595). Fonte de 16 px no
   campo: abaixo disso o iOS dá zoom no foco (o Figma usa 14,5). */
.rec-legenda {
  width: 100%;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgb(22 18 29 / 45%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--white);
}

.rec-legenda .ic {
  width: 18px;
  height: 18px;
  flex: none;
}

.rec-legenda input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--white);
  font-size: 16px;
  line-height: 1.3;
}

.rec-legenda input::placeholder {
  color: rgb(255 255 255 / 75%);
}

.rec-legenda:focus-within {
  box-shadow: 0 0 0 2px var(--flash);
}

.rec-ao-vivo {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rec-ao-vivo .mode-toggle { margin-bottom: 24px; }
.rec-ao-vivo .rec-controles { margin-bottom: 17px; }

.rec-revisao {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.mode-toggle {
  display: inline-flex;
  gap: 0;
  padding: 4px;
  border-radius: var(--r-pill);
  background: rgb(255 255 255 / 16%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.mode-chip {
  min-height: 33px;
  padding: 8px 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.mode-chip.active {
  background: var(--white);
  color: var(--ink);
}

.rec-controles {
  width: 100%;
  max-width: 290px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

/* Label nativo da galeria: no iPhone, <label for> num input sr-only abre o seletor sem JS */
.rec-miniatura {
  justify-self: start;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 2.5px solid var(--white);
  border-radius: 14px;
  background: rgb(255 255 255 / 14%);
  color: var(--white);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rec-miniatura:active {
  transform: scale(.96);
}

#storyGalleryInput:focus-visible + .rec-ao-vivo .rec-miniatura {
  box-shadow: var(--focus);
}

.rec-miniatura img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rec-controles .flip-button {
  justify-self: end;
  --btn-h: 46px;
}

.record-button {
  position: relative;
  width: 86px;
  height: 86px;
  padding: 0;
  border: 5px solid var(--white);
  border-radius: 50%;
  background: transparent;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.record-button::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--flash);
  transition: transform var(--t-fast) var(--ease);
}

.record-button:active::before {
  transform: scale(.94);
}

.record-button.recording::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 7px;
  background: var(--white);
}

.recorder-hint {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: rgb(255 255 255 / 70%);
}

.recorder-hint.is-erro {
  color: #FFB4AE;
  font-weight: 600;
}

.review-actions {
  width: 100%;
  max-width: 420px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

.recorder-message {
  min-height: 0;
  color: var(--white);
}

.recorder-message.is-erro {
  color: #FFB4AE;
}

/* ------------------------------------------------------------ Faixa de envio do story */

.story-upload-strip {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  z-index: 75;
  width: min(360px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--sh-lg);
  transform: translateX(-50%);
}

.story-upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.story-upload-retry {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--flash-soft);
  color: var(--flash-dark);
  font-size: 13px;
  font-weight: 600;
}

.story-upload-track {
  height: 6px;
}

/* ------------------------------------------------------------ Álbum bloqueado (D-71) */
/* bloqueado.html: o servidor só troca o nome no título e o link do WhatsApp; não há tema do
   evento (a página não carrega identidade). Coluna única centralizada, com a mesma largura e
   a mesma moldura da .pagina do convidado. */

.bloqueio {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: calc(48px + env(safe-area-inset-top)) 24px calc(40px + env(safe-area-inset-bottom));
  background: var(--paper);
  text-align: center;
}

@media (min-width: 560px) {
  .bloqueio {
    box-shadow: var(--sh-md);
  }
}

.bloqueio-icone {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink);
}

.bloqueio-icone .ic {
  width: 28px;
  height: 28px;
}

.bloqueio-titulo {
  max-width: 100%;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.bloqueio-texto {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.bloqueio-sub {
  max-width: 360px;
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-70);
}

.bloqueio-acoes {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.bloqueio-acoes .btn {
  width: 100%;
}

/* 19 px em 700 é texto grande no WCAG: branco sobre o flash (3,1:1) passa no AA de texto
   grande (3:1), o que não acontece com os 17 px em 600 do .btn-lg. */
.bloqueio-whats {
  font-size: 19px;
  font-weight: 700;
}

/* ------------------------------------------------------------ Evento privado (tela de senha) */
/* senha-do-evento.html: a mesma moldura do bloqueio, com o campo da senha e o botão de entrar.
   Sem tema do evento de propósito (a tela não revela nada do evento). */

.senha-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
  text-align: left;
}

.senha-form .campo-hint.is-erro {
  margin: 0;
}

.senha-evento > .btn-ghost {
  margin-top: 4px;
}
