/* ==========================================================================
   Inove Hub — minimalista, com comportamento de aplicativo no celular.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Cores. --tinta-3 era #9a9aa0: contraste 2.7:1 sobre branco, reprovado
     no WCAG AA para os textos pequenos de meta e horário. */
  --fundo:      #ffffff;
  --superficie: #fafafa;
  --tinta:      #131314;
  --tinta-2:    #6b6b70;
  --tinta-3:    #75757b;
  --borda:      rgba(19,19,20,.10);
  --acento:     #e9705c;
  --acento-2:   #dd5062;
  --perigo:     #c0392b;

  /* Raio: dois tamanhos e mais nenhum valor solto no arquivo */
  --raio:       16px;      /* folhas e cartões */
  --raio-p:     10px;      /* botões, campos, células */

  /* Larguras. Os breakpoints são os que o próprio Instagram usa: barra
     inferior até 767, coluna de ícones a partir de 768, rótulos em 1264.
     O feed é estreito (470px) para uma publicação inteira caber na tela. */
  --largura:       620px;
  --largura-feed:  470px;
  --lateral:       72px;
  --lateral-larga: 220px;
  --topo:       54px;
  --rodape:     56px;

  /* Movimento: só estas durações e curvas, no arquivo inteiro. Sair é
     sempre mais rápido que entrar. */
  --dur-1: .15s;
  --dur-2: .25s;
  --dur-3: .4s;
  --suave:   cubic-bezier(.2,.7,.3,1);
  --entrada: cubic-bezier(.05,.7,.1,1);
  --saida:   cubic-bezier(.3,0,.8,.15);
  --pulo:    cubic-bezier(.175,.885,.32,1.275);

  /* Esqueleto de carregamento e pontos do carrossel. Os pontos não usam
     --borda porque branco a 10% desaparece no modo escuro. */
  --pele:        #ececef;
  --pele-brilho: #f7f7f9;
  --ponto:       #c4c4ca;

  /* Sombra só no que flutua. Cartão usa borda, como no Instagram. */
  --sombra: 0 4px 32px rgba(11,16,20,.16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fundo:      #0f0f10;
    --superficie: #17171a;
    --tinta:      #f0efee;
    --tinta-2:    #a4a3a8;
    --tinta-3:    #8e8d94;
    --borda:      rgba(255,255,255,.10);
    --pele:        #1d1d21;
    --pele-brilho: #26262b;
    --ponto:       #55555c;
    --sombra: 0 4px 32px rgba(0,0,0,.5);
  }
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--fundo);
  color: var(--tinta);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;

  /* Comportamento de aplicativo: sem toque azulado, sem atraso de 300 ms,
     sem duplo toque dando zoom e sem a página inteira balançando ao puxar. */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior-y: contain;
  overflow-x: hidden;
}

/* Texto de interface não é para ser selecionado por engano ao segurar o dedo.
   Legenda, comentário e nome continuam selecionáveis. */
.topo, .navegacao, .botao, .icone, .abas, .camera-layout, .pontos, .contador {
  user-select: none; -webkit-user-select: none;
}

svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
.sprite { position: absolute; width: 0; height: 0; }
[hidden] { display: none !important; }

/* ── Cabeçalho ───────────────────────────────────────────────────────────── */
header.topo {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--topo) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--fundo) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--borda);
}
.marca-logo { height: 22px; width: auto; display: block; }
.titulo-tela { font-size: 15px; font-weight: 600; }
.topo-acoes { display: flex; align-items: center; gap: 2px; }

/* Barra de carregamento no topo: corre ao trocar de aba, dando sinal
   imediato de que o toque pegou enquanto a próxima página não chega. */
.barra-topo {
  position: fixed; top: 0; left: 0; width: 0; height: 2.5px; z-index: 100;
  background: var(--acento); box-shadow: 0 0 8px var(--acento);
  border-radius: 0 2px 2px 0;
}
.barra-topo.indo { width: 92%; transition: width 6s cubic-bezier(.05,.7,.1,1); }

/* Sino: bolinha de aviso ancorada no canto do ícone */
.sino { position: relative; }
.sino-conta {
  position: absolute; top: 4px; right: 3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 100px; background: var(--acento); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--fundo);
}

.icone {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: none; background: none; color: var(--tinta);
  cursor: pointer; transition: background var(--dur-1), transform var(--dur-1);
  flex-shrink: 0;
}
.icone svg { width: 21px; height: 21px; }
.icone:hover { background: var(--superficie); }
.icone:active { transform: scale(.96); }
.icone.ativo { color: var(--acento); }
.icone.ativo svg { fill: var(--acento); stroke: var(--acento); }

/* Pop do curtir: 1 -> 1.2 -> .95 -> 1, com um overshoot discreto */
.icone.pop svg { animation: pulo-curtir .4s var(--pulo); }
@keyframes pulo-curtir {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.2); }
  70%  { transform: scale(.95); }
  100% { transform: scale(1); }
}

/* ── Navegação inferior, como em aplicativo ──────────────────────────────── */
.navegacao {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--rodape) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: space-around;
  background: color-mix(in srgb, var(--fundo) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--borda);
}
.navegacao a {
  flex: 1; height: 100%;
  display: grid; place-items: center;
  color: var(--tinta-3); transition: color var(--dur-1), transform var(--dur-1);
}
.navegacao a:active { transform: scale(.96); }
.navegacao a svg { width: 23px; height: 23px; flex-shrink: 0; }
.navegacao a.ativa { color: var(--tinta); }
.navegacao a.ativa svg { stroke-width: 2; }
.navegacao .publicar { color: var(--acento); }
.navegacao .publicar svg { stroke-width: 2; }
.navegacao .rotulo { display: none; }

/* ── Estrutura ───────────────────────────────────────────────────────────── */
main {
  width: 100%; max-width: var(--largura); margin: 0 auto;
  padding: 12px 0 calc(var(--rodape) + env(safe-area-inset-bottom) + 24px);
}
.centro { padding: 0 16px; }

/* ── Botões ──────────────────────────────────────────────────────────────── */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; width: 100%;
  border: none; border-radius: var(--raio-p);
  background: var(--acento); color: #fff;
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: filter var(--dur-1), opacity var(--dur-1), transform var(--dur-1);
}
.botao:hover { filter: brightness(1.05); }
.botao:active:not(:disabled) { transform: scale(.98); }
.botao:disabled { opacity: .5; cursor: default; }
.botao.secundario { background: none; border: 1px solid var(--borda); color: var(--tinta); }
.botao.secundario:hover { background: var(--superficie); filter: none; }
.botao.perigo { background: none; border: 1px solid var(--borda); color: var(--perigo); }
.botao svg { width: 18px; height: 18px; }

.texto-botao {
  border: none; background: none; color: var(--tinta-2);
  font: inherit; font-size: 13px; cursor: pointer; padding: 6px 0;
  transition: color var(--dur-1);
}
.texto-botao:hover { color: var(--tinta); }

/* Botão de ação centrado nos estados vazios (substitui os inline soltos) */
.acao-vazio { max-width: 240px; margin: 14px auto 0; }

/* ── Campos ──────────────────────────────────────────────────────────────────
   16px é obrigatório: com fonte menor, o iPhone dá zoom sozinho ao focar o
   campo e a página fica torta depois. Este é o motivo de "fica dando zoom".
   -------------------------------------------------------------------------- */
.campo { display: block; margin-bottom: 14px; }
.campo span { display: block; font-size: 12px; color: var(--tinta-2); margin-bottom: 6px; }
.campo input, .campo textarea, textarea.legenda, .busca input {
  width: 100%; padding: 12px 13px;
  border: 1px solid var(--borda); border-radius: var(--raio-p);
  background: var(--fundo); color: var(--tinta);
  font-family: inherit; font-size: 16px; line-height: 1.4;
  resize: vertical;
  -webkit-appearance: none; appearance: none;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.campo input:focus, .campo textarea:focus, textarea.legenda:focus, .busca input:focus {
  outline: none; border-color: var(--acento);
  box-shadow: 0 0 0 1px var(--acento);
}

/* Anel de foco só para teclado: mouse e toque não ganham anel */
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.campo input:focus-visible, .campo textarea:focus-visible,
textarea.legenda:focus-visible, .busca input:focus-visible { outline: none; }
.novo-comentario input:focus-visible {
  outline: none; box-shadow: inset 0 -1.5px 0 var(--acento);
}
.dica { font-size: 12px; color: var(--tinta-3); margin-top: -6px; margin-bottom: 14px; }

/* ── Entrar ──────────────────────────────────────────────────────────────── */
.entrada { max-width: 380px; margin: 0 auto; padding: 48px 20px 40px; }
.entrada .marca-logo { height: 34px; margin: 0 auto 10px; }
.entrada .sub { text-align: center; color: var(--tinta-2); font-size: 14px; margin-bottom: 30px; }
.abas { display: flex; gap: 4px; padding: 4px; background: var(--superficie); border-radius: var(--raio-p); margin-bottom: 22px; }
.abas button {
  flex: 1; height: 38px; border: none; border-radius: 8px;
  background: none; color: var(--tinta-2); font: inherit; font-size: 15px; cursor: pointer;
}
.abas button.ativa { background: var(--fundo); color: var(--tinta); font-weight: 500; }

/* ── Entrar com Google e Apple ───────────────────────────────────────────── */
#area-social { margin-bottom: 4px; }
#botao-google { display: flex; justify-content: center; min-height: 44px; }
#botao-google:empty { min-height: 0; }

.botao-apple {
  width: 100%; height: 44px; margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 22px;
  background: #000; color: #fff;
  font: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer; -webkit-appearance: none; appearance: none;
}
.botao-apple:disabled { opacity: .6; cursor: default; }
.botao-apple svg { width: 19px; height: 19px; margin-top: -2px; }
@media (prefers-color-scheme: dark) {
  .botao-apple { background: #fff; color: #000; }
}

/* Risco com a palavra "ou" no meio, separando os dois jeitos de entrar */
.ou {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 18px; color: var(--tinta-3); font-size: 12px;
}
.ou::before, .ou::after {
  content: ''; flex: 1; height: 1px; background: var(--borda);
}

/* Segundo passo: quem chegou pelo provedor escolhe o usuário */
.boas-vindas { text-align: center; margin-bottom: 26px; }
.boas-vindas .avatar { margin: 0 auto 14px; }
.boas-vindas h1 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.boas-vindas .sub { margin-bottom: 0; font-size: 13px; }
#form-social .texto-botao { display: block; width: 100%; text-align: center; margin-top: 12px; }

/* ── Avatar ──────────────────────────────────────────────────────────────── */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; background: var(--superficie);
  display: grid; place-items: center;
  font-size: 14px; font-weight: 600; color: var(--tinta-2);
  border: 1px solid var(--borda);
}
.avatar.g { width: 84px; height: 84px; font-size: 30px; }
.avatar.p { width: 30px; height: 30px; font-size: 12px; }

/* ── Publicação ──────────────────────────────────────────────────────────── */
.post { border-bottom: 1px solid var(--borda); padding-bottom: 8px; margin-bottom: 18px; }
.post-topo { display: flex; align-items: center; gap: 10px; padding: 0 16px 12px; }
.post-quem { flex: 1; min-width: 0; }
.post-nome { font-size: 14px; font-weight: 600; display: block; }
.post-meta { font-size: 12px; color: var(--tinta-3); display: block; }

.midias { position: relative; background: var(--superficie); }
.trilho {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.trilho::-webkit-scrollbar { display: none; }
.trilho > * { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }

/* A caixa da mídia nasce com a proporção certa (aspect-ratio vem inline do
   JS, com os dados que o servidor mediu). Sem isso a altura só se descobre
   quando a imagem baixa, e o feed inteiro pula — o famoso layout shift. */
.trilho img, .trilho video {
  width: 100%; height: auto; max-height: 76vh;
  object-fit: cover; background: var(--superficie);
}
.trilho img { opacity: 0; transition: opacity .3s ease; }
.trilho img.carregou { opacity: 1; }

.contador {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 3px 9px; border-radius: 100px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; font-weight: 500;
  backdrop-filter: blur(4px);
}

/* Pontinhos com a janela do Instagram: os 3 centrais cheios, os vizinhos
   encolhem com a distância e o resto some. Cada ponto vive num espaço fixo
   de 10px (largura + margens), então nada ao redor pula quando ele muda. */
.pontos { display: flex; justify-content: center; align-items: center; gap: 0; padding: 10px 0 0; min-height: 16px; }
.pontos i {
  border-radius: 50%; background: var(--ponto);
  transition: width .3s ease-in-out, height .3s ease-in-out, margin .3s ease-in-out, background var(--dur-1);
}
.pontos .d0 { width: 6px; height: 6px; margin: 0 2px; }
.pontos .d1 { width: 4px; height: 4px; margin: 0 3px; }
.pontos .d2 { width: 2px; height: 2px; margin: 0 4px; }
.pontos .d3 { width: 0;  height: 0;  margin: 0 5px; }
.pontos i.ativo { background: var(--acento); }

/* Setas do carrossel: só aparecem onde existe mouse */
.seta {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.92); color: #1a1a1a;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  display: none; place-items: center; cursor: pointer;
}
.seta svg { width: 14px; height: 14px; stroke-width: 2; }
.seta.ant { left: 10px; }
.seta.prox { right: 10px; }
@media (hover: hover) and (min-width: 768px) {
  .midias:hover .seta:not([hidden]) { display: grid; }
}

/* Botão de som do vídeo, no canto de baixo como no Instagram */
.som {
  position: absolute; right: 10px; bottom: 10px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.55); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  backdrop-filter: blur(4px);
}
.som svg { width: 14px; height: 14px; }

.post-acoes { display: flex; align-items: center; gap: 2px; padding: 6px 10px 0; }
.post-curtidas { padding: 2px 16px 0; font-size: 13px; font-weight: 600; }
.post-legenda { padding: 6px 16px 0; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.post-legenda b { font-weight: 600; margin-right: 6px; }

/* ── Comentários ─────────────────────────────────────────────────────────── */
.abrir-comentarios { padding: 6px 16px 0; }
.comentarios { padding: 10px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.comentario { display: flex; gap: 9px; align-items: flex-start; }
.comentario .avatar { width: 28px; height: 28px; font-size: 11px; }
.comentario-corpo { flex: 1; min-width: 0; font-size: 14px; word-break: break-word; }
.comentario-corpo b { font-weight: 600; margin-right: 6px; }
.comentario-quando { font-size: 11px; color: var(--tinta-3); display: block; margin-top: 2px; }
.comentario .icone { width: 28px; height: 28px; }
.comentario .icone svg { width: 15px; height: 15px; }

.novo-comentario { display: flex; gap: 8px; align-items: center; padding: 12px 16px 4px; }
.novo-comentario input {
  flex: 1; border: none; background: none; color: var(--tinta);
  font-family: inherit; font-size: 16px; padding: 6px 0;
}
.novo-comentario input:focus { outline: none; }
.novo-comentario button {
  border: none; background: none; color: var(--acento);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.novo-comentario button:disabled { color: var(--tinta-3); cursor: default; }

/* ── Folha (publicar, editar, foto obrigatória) ──────────────────────────── */
.folha {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px;
  opacity: 0; transition: opacity var(--dur-2) ease;
}
.folha.aberta { opacity: 1; }
.folha-caixa {
  width: 100%; max-width: 460px; max-height: 86vh; overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--fundo); border-radius: var(--raio); padding: 20px;
  box-shadow: var(--sombra);
  transform: translateY(14px) scale(.98);
  transition: transform var(--dur-3) var(--entrada);
}
.folha.aberta .folha-caixa { transform: none; }
.folha:not(.aberta) .folha-caixa { transition: transform .2s var(--saida); }

/* No celular a folha vira cartão que sobe do rodapé */
@media (max-width: 480px) {
  .folha { place-items: end stretch; padding: 0; }
  .folha-caixa {
    max-width: none; max-height: 92vh;
    border-radius: var(--raio) var(--raio) 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }
}
.folha-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.folha-topo h2 { font-size: 16px; font-weight: 600; }

.solta {
  border: 1px dashed var(--borda); border-radius: var(--raio);
  padding: 26px 16px; text-align: center; cursor: pointer;
  color: var(--tinta-2); font-size: 14px; transition: border-color .15s, background .15s;
}
.solta:hover, .solta.sobre { border-color: var(--acento); background: var(--superficie); }
.solta svg { width: 26px; height: 26px; margin-bottom: 8px; color: var(--tinta-3); }

.previas { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 14px 0; }
.previa { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--superficie); }
.previa img, .previa video { width: 100%; height: 100%; object-fit: cover; }
.previa button {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.6); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
/* Alvo de toque de 44px sem crescer o botão (22 + 2 x 11) */
.previa button::before { content: ''; position: absolute; inset: -11px; }
.previa button svg { width: 12px; height: 12px; stroke-width: 2; }
.previa .marca-video {
  position: absolute; left: 5px; bottom: 5px;
  font-size: 10px; color: #fff; background: rgba(0,0,0,.6);
  padding: 1px 6px; border-radius: 100px;
}

.barra-envio { height: 3px; background: var(--superficie); border-radius: 100px; overflow: hidden; margin-bottom: 12px; }
.barra-envio i { display: block; height: 100%; width: 0; background: var(--acento); transition: width .2s; }

/* ── Tela de publicar ────────────────────────────────────────────────────── */
.acao-topo {
  border: none; background: none; color: var(--acento);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  padding: 8px 4px;
}
.acao-topo:disabled { color: var(--tinta-3); cursor: default; }

.campos { padding: 20px 16px 0; border-top: 1px solid var(--borda); margin-top: 18px; }
.contador-texto { text-align: right; font-size: 11px; color: var(--tinta-3); margin: -8px 0 14px; }
.solta-dica { font-size: 12px; margin-top: 4px; color: var(--tinta-3); }

.previa .ordem {
  position: absolute; left: 5px; top: 5px;
  min-width: 18px; height: 18px; border-radius: 100px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
/* touch-action:none é o que permite arrastar com o dedo sem a página rolar */
.previa { cursor: grab; touch-action: none; }
.previa.arrastando { opacity: .6; z-index: 5; }

.etiquetas { display: flex; flex-wrap: wrap; gap: 7px; }
.etiqueta {
  padding: 8px 14px; border-radius: 100px;
  border: 1px solid var(--borda); background: none; color: var(--tinta-2);
  font: inherit; font-size: 13px; cursor: pointer;
  transition: background var(--dur-1), color var(--dur-1), border-color var(--dur-1), transform var(--dur-1);
}
.etiqueta:active { transform: scale(.96); }
.etiqueta.ativa { background: var(--acento); border-color: var(--acento); color: #fff; }

.marcados { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.marcado {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 8px 6px 12px; border-radius: 100px;
  background: var(--superficie); font-size: 13px;
}
.marcado button {
  position: relative;
  width: 18px; height: 18px; border-radius: 50%; border: none;
  background: var(--borda); color: var(--tinta-2);
  display: grid; place-items: center; cursor: pointer;
}
.marcado button::before { content: ''; position: absolute; inset: -13px; }
.marcado button svg { width: 10px; height: 10px; stroke-width: 2.4; }

.sugestoes {
  border: 1px solid var(--borda); border-radius: var(--raio-p);
  margin-top: 6px; overflow: hidden;
}
.sugestao {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: none; background: none; color: var(--tinta);
  font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.sugestao:hover { background: var(--superficie); }
.sugestao b { font-weight: 600; }
.sugestao span { color: var(--tinta-3); font-size: 13px; }
.sugestao b + * { margin-left: 4px; }

.opcao {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--borda);
}
.opcao b { display: block; font-size: 14px; font-weight: 500; }
.opcao span { display: block; font-size: 12px; color: var(--tinta-3); margin-top: 2px; }
.opcao input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 46px; height: 28px; border-radius: 100px;
  background: var(--borda); position: relative; cursor: pointer;
  transition: background .2s; flex-shrink: 0;
}
.opcao input[type="checkbox"]::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  transition: transform .2s;
}
.opcao input[type="checkbox"]:checked { background: var(--acento); }
.opcao input[type="checkbox"]:checked::after { transform: translateX(18px); }

/* ── Coração do duplo toque ──────────────────────────────────────────────── */
.coracao-duplo {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none; z-index: 2;
}
.coracao-duplo svg {
  width: 92px; height: 92px; fill: #fff; stroke: none;
  filter: drop-shadow(0 3px 14px rgba(0,0,0,.45));
  animation: pulsar-coracao .9s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes pulsar-coracao {
  0%   { transform: scale(.3); opacity: 0; }
  22%  { transform: scale(1.15); opacity: 1; }
  42%  { transform: scale(.97); opacity: 1; }
  70%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.1); opacity: 0; }
}

/* Detalhes da publicação */
.post-detalhes { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px 0; align-items: center; }
.post-etiqueta {
  font-size: 11px; padding: 3px 9px; border-radius: 100px;
  background: var(--superficie); color: var(--tinta-2);
}
.post-local { font-size: 12px; color: var(--tinta-3); display: inline-flex; align-items: center; gap: 4px; }
.post-local svg { width: 13px; height: 13px; }
.post-marcados { padding: 6px 16px 0; font-size: 13px; color: var(--tinta-2); }
.post-marcados a { color: var(--acento); }
.comentarios-desligados { padding: 12px 16px 4px; font-size: 12px; color: var(--tinta-3); }

/* ── Busca ───────────────────────────────────────────────────────────────── */
.busca { padding: 4px 16px 16px; }
.busca input { border-radius: 100px; }
.resultados { display: flex; flex-direction: column; }
.pessoa {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  transition: background var(--dur-1);
}
.pessoa:hover { background: var(--superficie); }
.pessoa-dados { flex: 1; min-width: 0; }
.pessoa-nome { font-size: 14px; font-weight: 600; display: block; }
.pessoa-meta { font-size: 12px; color: var(--tinta-3); display: block; }
.pessoa-numero { font-size: 12px; color: var(--tinta-3); }

/* ── Destaques ───────────────────────────────────────────────────────────── */
.periodos { display: flex; gap: 6px; padding: 0 16px 14px; }
.periodos button {
  padding: 7px 14px; border-radius: 100px;
  border: 1px solid var(--borda); background: none; color: var(--tinta-2);
  font: inherit; font-size: 13px; cursor: pointer;
  transition: background var(--dur-1), color var(--dur-1), border-color var(--dur-1), transform var(--dur-1);
}
.periodos button:active { transform: scale(.96); }
.periodos button.ativa { background: var(--tinta); color: var(--fundo); border-color: var(--tinta); }

.secao-titulo {
  padding: 18px 16px 10px; font-size: 13px; font-weight: 600;
  color: var(--tinta-2); letter-spacing: .02em;
}
.podio { display: flex; flex-direction: column; }
.podio .pessoa { gap: 12px; }
.posicao {
  width: 22px; text-align: center; flex-shrink: 0;
  font-size: 13px; font-weight: 700; color: var(--tinta-3);
}
.posicao.ouro { color: var(--acento); }

.grade-destaque { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.grade-destaque a { position: relative; aspect-ratio: 1; background: var(--superficie); overflow: hidden; }
.grade-destaque img { width: 100%; height: 100%; object-fit: cover; }
.grade-destaque .curtidas-selo {
  position: absolute; left: 6px; bottom: 6px;
  display: flex; align-items: center; gap: 4px;
  color: #fff; font-size: 12px; font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.grade-destaque .curtidas-selo svg { width: 13px; height: 13px; fill: #fff; }

/* ── Perfil ──────────────────────────────────────────────────────────────── */
.perfil-topo { display: flex; gap: 20px; align-items: center; padding: 8px 16px 18px; }
.perfil-nome { font-size: 18px; font-weight: 600; }
.perfil-usuario { color: var(--tinta-3); font-size: 13px; }
.perfil-bio { font-size: 14px; margin-top: 8px; white-space: pre-wrap; }
.perfil-instagram {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; font-size: 13px; color: var(--acento);
}
.perfil-instagram svg { width: 15px; height: 15px; }
.numeros { display: flex; gap: 22px; margin-top: 10px; }
.numeros div { font-size: 13px; color: var(--tinta-2); }
.numeros b { display: block; font-size: 16px; color: var(--tinta); }

.grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.grade a { position: relative; aspect-ratio: 1; background: var(--superficie); overflow: hidden; }
.grade img { width: 100%; height: 100%; object-fit: cover; }
.grade .selo { position: absolute; top: 6px; right: 6px; color: #fff; z-index: 2; }
.grade .selo svg { width: 15px; height: 15px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }

/* Véu com as contagens ao passar o mouse na grade, como no Instagram.
   Só onde há mouse; no toque, tocar já abre a publicação. */
.veu {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  background: rgba(0,0,0,.35); color: #fff;
  font-size: 14px; font-weight: 600;
  opacity: 0; transition: opacity var(--dur-1);
}
.veu span { display: inline-flex; align-items: center; gap: 5px; }
.veu svg { width: 16px; height: 16px; fill: #fff; stroke: none; }
@media (hover: hover) {
  .grade a:hover .veu, .grade-destaque a:hover .veu { opacity: 1; }
}
.grade a:focus-visible .veu, .grade-destaque a:focus-visible .veu { opacity: 1; }

/* ── Notificações ────────────────────────────────────────────────────────── */
.lista-notif { display: flex; flex-direction: column; }
.notif {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; transition: background var(--dur-1);
}
.notif:hover { background: var(--superficie); }
/* Ainda não vistas ganham um toque do acento e uma marca à esquerda */
.notif.nova { background: color-mix(in srgb, var(--acento) 7%, transparent); }
.notif.nova::before {
  content: ''; position: absolute; left: 0; width: 3px; height: 40px;
  border-radius: 0 3px 3px 0; background: var(--acento);
}
.notif { position: relative; }
.notif-texto { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
.notif-texto b { font-weight: 600; }
.notif-quando { color: var(--tinta-3); font-size: 12px; margin-left: 5px; white-space: nowrap; }
.notif-capa {
  width: 44px; height: 44px; border-radius: 6px; flex-shrink: 0;
  object-fit: cover; background: var(--superficie);
}

/* ── Estados ─────────────────────────────────────────────────────────────── */
.vazio { text-align: center; padding: 54px 24px; color: var(--tinta-3); font-size: 14px; }
.vazio svg { width: 34px; height: 34px; margin-bottom: 12px; }
.carregando { text-align: center; padding: 26px; color: var(--tinta-3); font-size: 13px; }

/* ── Esqueleto: a página nasce com a silhueta do conteúdo ────────────────── */
.pele { background: var(--pele); border-radius: var(--raio-p); position: relative; overflow: hidden; }
.pele::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--pele-brilho), transparent);
  transform: translateX(-100%);
  animation: pele-brilho 1.5s infinite;
}
@keyframes pele-brilho { to { transform: translateX(100%); } }
.pele.redonda { border-radius: 50%; }

/* Spinner discreto: comentários abrindo e rolagem infinita */
.girando {
  width: 26px; height: 26px; margin: 16px auto; border-radius: 50%;
  border: 2.5px solid var(--borda); border-top-color: var(--tinta-2);
  animation: girar .9s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.aviso {
  position: fixed; left: 50%; z-index: 90;
  bottom: calc(var(--rodape) + env(safe-area-inset-bottom) + 18px);
  transform: translate(-50%, 16px); opacity: 0;
  padding: 10px 18px; border-radius: 100px;
  background: var(--tinta); color: var(--fundo);
  font-size: 13px; white-space: nowrap; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.aviso.visivel { opacity: 1; transform: translate(-50%, 0); }

.erro { color: var(--perigo); font-size: 13px; margin-bottom: 12px; }

@media (max-width: 480px) {
  .post-topo, .post-legenda, .post-curtidas, .comentarios, .novo-comentario,
  .abrir-comentarios, .post-detalhes, .post-marcados, .comentarios-desligados {
    padding-left: 14px; padding-right: 14px;
  }
}

/* ── Desktop: a barra do rodapé vira coluna à esquerda ──────────────────────
   Breakpoints do próprio Instagram: 768 liga a coluna de ícones, 1264 alarga
   e mostra os rótulos. O feed estreita para 470px pela mesma razão de lá:
   uma publicação inteira, com cabeçalho e ações, cabendo numa altura de tela.
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  body { padding-left: var(--lateral); }
  main { padding-bottom: 40px; }

  .navegacao {
    top: 0; bottom: 0; right: auto; width: var(--lateral); height: auto;
    flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: 14px 10px; padding-bottom: 14px;
    border-top: none; border-right: 1px solid var(--borda);
    background: var(--fundo); backdrop-filter: none;
  }
  .navegacao a {
    flex: 0 0 auto; width: 100%; height: 48px; border-radius: var(--raio-p);
    display: flex; align-items: center; justify-content: center; gap: 14px;
    transition: background var(--dur-1), color var(--dur-1), transform var(--dur-1);
  }
  .navegacao a:hover { background: var(--superficie); color: var(--tinta); }

  body.tela-feed main { max-width: var(--largura-feed); }
  .trilho img, .trilho video { max-height: 585px; }   /* 470px em 4:5 */

  /* O aviso não precisa desviar de rodapé nenhum */
  .aviso { bottom: 28px; }
}

@media (min-width: 1264px) {
  body { padding-left: var(--lateral-larga); }
  .navegacao { width: var(--lateral-larga); }
  .navegacao a { justify-content: flex-start; padding: 0 14px; }
  .navegacao a.ativa { font-weight: 600; }
  .navegacao .rotulo { display: inline; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  /* 0.01ms, e não 0: os eventos transitionend continuam disparando, e o JS
     das folhas depende deles para esconder depois de fechar. */
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .pele::after { animation: none; }
}
