/* ════════════════════════════════════════════════════════
   CMS Dra. Jennifer Humbelino
   Design system herdado de css/style.css do site principal.
   Os tokens abaixo são cópia literal do site; os componentes
   são próprios do painel (o site é editorial, o painel é
   denso e orientado a formulário).
   ════════════════════════════════════════════════════════ */

/* O painel usa somente a paleta clara, inclusive quando o aparelho ou o
   navegador pede tema escuro. `only` também bloqueia o Auto Dark Theme. */
:root { color-scheme: only light; }

:root {
  --creme:    #f5f0e8;
  --areia:    #e8ddc8;
  --terracota:#a05f3c;
  --argila:   #8c5a3c;
  --mogno:    #4a2e1a;
  --cinza:    #5c534c;
  --branco:   #faf8f4;
  --sombra:   rgba(74,46,26,.10);

  /* Terracota como LETRA. O --terracota é superfície: como letra ele não
     alcança os 4,5:1 que texto pequeno pede. Mesma divisão do site.
     No painel ele é mais escuro que no site (#85543a) desde 23/09/2026:
     rótulo miúdo sobre a areia ficava em 4,7:1, no limite, e em tela
     de baixa qualidade sumia. #7a4a30 dá 6,5:1 no creme e 5,5:1 na areia. */
  --terracota-texto: #7a4a30;

  --f-display: 'Cormorant Garamond', Georgia, serif;
  --f-body:    'Jost', sans-serif;

  --bg-page:      var(--creme);
  --bg-section:   var(--branco);
  --bg-alt:       var(--areia);
  --text-primary: var(--mogno);
  /* Texto secundário do painel. Não é o --cinza, que é cópia do site:
     o painel é lido o dia inteiro, em monitor de consultório, e o
     #5c534c em Jost fino sumia. #4f463f dá 8,1:1 no creme, 8,7:1 no
     branco e 6,8:1 na areia (o balão enviado). 23/09/2026. */
  --text-muted:   #4f463f;
  --border:       var(--areia);

  /* Tokens exclusivos do painel */
  /* Escurecidos em 23/08/2026: como letra dos selos, os anteriores
     (#3f7d58 e #a8522f) ficavam em 3,6:1 e 4,0:1 sobre a areia. De novo
     em 23/09/2026, pelo mesmo motivo do --terracota-texto: os de agosto
     paravam em 4,7:1 na areia. Agora 5,6:1 e 5,5:1. */
  --sucesso: #2f5e42;
  --alerta:  #8a4125;
  --raio:    10px;
  --raio-sm: 7px;
  --sidebar: 286px;
}

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

/* Jost 400, e não o 300 do site, desde 23/09/2026. O traço do 300 é fino
   demais para monitor comum: as cores passavam na conta e o texto sumia
   assim mesmo. Pelo mesmo motivo saiu o `-webkit-font-smoothing:
   antialiased`, que afina ainda mais a letra no macOS. */
body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--f-body);
  font-weight: 400;
  line-height: 1.7;
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* Grão sutil, igual ao do site. */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 999; opacity: .5;
}

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

[hidden] { display: none !important; }

/* ── Tipografia compartilhada ── */
.tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--terracota-texto);
}

.titulo-display {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: .01em;
}
.titulo-display em { font-style: italic; color: var(--terracota-texto); }

/* ════════════════════════════
   BOTÕES
   ════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-family: var(--f-body);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .8rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 50px;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  color: var(--text-primary);
  transition: background .22s ease, color .22s ease,
              border-color .22s ease, transform .24s cubic-bezier(0.16,1,0.3,1),
              box-shadow .22s ease;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primario {
  background: var(--terracota);
  color: #faf8f4;
  box-shadow: 0 2px 10px rgba(181,112,74,.32);
}
.btn-primario:hover { background: var(--argila); }

.btn-contorno {
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-contorno:hover { border-color: var(--terracota); color: var(--terracota-texto); }

.btn-fantasma { color: var(--text-muted); padding: .55rem .75rem; }
.btn-fantasma:hover { color: var(--terracota-texto); }

.btn-perigo { color: var(--alerta); border-color: transparent; }
.btn-perigo:hover { border-color: var(--alerta); }

.btn-sm { font-size: .7rem; padding: .5rem 1rem; letter-spacing: .08em; }

.btn svg { width: 16px; height: 16px; flex: none; }

/* ════════════════════════════
   LOGIN
   ════════════════════════════ */
.tela-login {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.login-card {
  width: min(100%, 420px);
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 18px 48px var(--sombra);
  padding: clamp(2rem, 5vw, 3rem);
  text-align: center;
}

.login-logo {
  width: 68px; height: 68px;
  border-radius: 50%;
  margin: 0 auto 1.25rem;
  object-fit: cover;
}
.login-card h1 {
  font-family: var(--f-display);
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1.2;
}
.login-card h1 em { font-style: italic; color: var(--terracota-texto); }

.login-sub {
  font-size: .84rem;
  color: var(--text-muted);
  margin: .4rem 0 2rem;
}

.tela-login .campo { text-align: left; }
.tela-login .btn { width: 100%; margin-top: .5rem; }

/* ── A abertura do aplicativo ─────────────────────────────────────────────
   Enquanto a sessão é conferida, a tela era a palavra "Carregando" solta no
   creme, sem nada que dissesse que o painel estava vivo. Agora é o monograma
   da casa com um arco terracota girando em volta, e o selo respirando de
   leve. O logo é raster, então quem desenha o movimento é o SVG do arco. */
.tela-inicio { gap: 1.6rem; align-content: center; }
.inicio-marca {
  position: relative;
  width: 156px; height: 156px;
  display: grid; place-items: center;
}
.inicio-marca img {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 28px var(--sombra);
}
.inicio-anel {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
}
.inicio-anel-trilho { stroke: var(--border); }
.inicio-anel-arco {
  stroke: var(--terracota);
  stroke-dasharray: 60 240;
  transform-origin: 50% 50%;
}
.tela-inicio .tag { margin: 0; color: var(--text-muted); letter-spacing: .28em; font-size: .78rem; }
@media (prefers-reduced-motion: no-preference) {
  .inicio-marca img { animation: inicio-respira 2.4s ease-in-out infinite; }
  .inicio-anel-arco { animation: inicio-gira 1.3s cubic-bezier(.55, .15, .45, .85) infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .inicio-anel-arco { animation: inicio-pulsa 1.8s ease-in-out infinite; }
}
@keyframes inicio-gira { to { transform: rotate(360deg); } }
@keyframes inicio-respira { 0%, 100% { transform: scale(.97); } 50% { transform: scale(1.02); } }
@keyframes inicio-pulsa { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ════════════════════════════
   ESTRUTURA DO PAINEL
   ════════════════════════════ */
.painel {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100svh;
}

/* ── Barra lateral ── */
.barra-lateral {
  background: var(--bg-section);
  border-right: 1px solid var(--border);
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 0;
  height: 100svh;
  overflow-y: auto;
}

.marca {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 .5rem;
}
.marca img {
  width: 40px; height: 40px;
  /* O reset da folha impõe `max-width: 100%` em toda imagem. Na barra
     recolhida a caixa da marca é mais estreita que 40px, e o teto encolhia
     a largura sem tocar na altura: o disco saía achatado. */
  max-width: none;
  border-radius: 50%;
  flex: none;
  transition: opacity .18s ease;
}
.marca-texto { line-height: 1.25; }
.marca-nome {
  font-family: var(--f-display);
  font-size: 1.02rem;
  letter-spacing: .03em;
}
.marca-nome em { font-style: italic; color: var(--terracota-texto); }
.marca-papel {
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* O botão nasce oculto: a barra lateral continua intacta no desktop. */
.menu-mobile {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-section);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  transition: background .2s ease, border-color .2s ease, transform .2s cubic-bezier(.16,1,.3,1);
}
.menu-mobile:hover { background: var(--bg-alt); border-color: var(--terracota); }
.menu-mobile:active { transform: scale(.96); }
.menu-mobile span {
  display: block;
  width: 20px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
  transition: transform .24s cubic-bezier(.16,1,.3,1), opacity .18s ease;
}
.barra-lateral.menu-aberto .menu-mobile span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.barra-lateral.menu-aberto .menu-mobile span:nth-child(2) { opacity: 0; }
.barra-lateral.menu-aberto .menu-mobile span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-secao {
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 .75rem;
  margin-bottom: .6rem;
}

.nav-lista { list-style: none; display: flex; flex-direction: column; gap: .15rem; }

.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .65rem .75rem;
  border: none;
  background: none;
  border-radius: var(--raio-sm);
  font-family: var(--f-body);
  font-size: .88rem;
  font-weight: 400;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background .18s ease, color .18s ease;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .6; }
.nav-item:hover { background: var(--bg-alt); }
.nav-item[aria-current="page"] {
  background: var(--bg-alt);
  color: var(--terracota-texto);
  font-weight: 500;
}
.nav-item[aria-current="page"] svg { opacity: 1; }

.nav-item:disabled {
  opacity: .4;
  cursor: default;
}
/* Não lidas do WhatsApp. Sempre visível, inclusive no rail recolhido: é o
   único sinal de mensagem nova fora da tela de Conversas. */
.nav-badge {
  margin-left: auto;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 .38rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--terracota);
  color: var(--branco);
  font-size: .7rem;
  font-weight: 500;
  line-height: 1;
}
.nav-badge[hidden] { display: none; }
.painel.rail .nav-item { position: relative; }
/* Menu aberto: a contagem ocupa a margem direita, longe do ícone e do texto. */
.nav-item[data-secao="conversas"] > .nav-badge { flex: none; }
.nav-item:disabled:hover { background: none; }

.nav-em-breve {
  margin-left: auto;
  padding-left: .5rem;
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  flex: none;
}

.rodape-lateral {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .3rem;
}
.usuario-email {
  font-size: .74rem;
  color: var(--text-muted);
  padding: 0 .75rem;
  word-break: break-all;
}

/* ── Área principal ── */
.conteudo {
  padding: clamp(1.75rem, 3.5vw, 3rem);
  max-width: 1000px;
  width: 100%;
}

.cabecalho {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.cabecalho h2 {
  font-family: var(--f-display);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 400;
  line-height: 1.15;
}
.cabecalho h2 em { font-style: italic; color: var(--terracota-texto); }
.cabecalho-acoes { display: flex; gap: .6rem; align-items: center; }

/* ════════════════════════════
   LISTA DE REGISTROS
   ════════════════════════════ */
.lista { display: flex; flex-direction: column; gap: .6rem; }

.lista-item {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  text-align: left;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  padding: 1.1rem 1.35rem;
  cursor: pointer;
  font-family: var(--f-body);
  color: var(--text-primary);
  transition: border-color .2s ease, box-shadow .2s ease, transform .24s cubic-bezier(0.16,1,0.3,1);
}
.lista-item:hover {
  border-color: var(--terracota);
  box-shadow: 0 8px 22px var(--sombra);
  transform: translateY(-2px);
}

.item-ordem {
  font-family: var(--f-display);
  font-size: 1.5rem;
  color: var(--terracota-texto);
  line-height: 1;
}

.item-corpo { min-width: 0; }
/* Os dois precisam ser bloco: `overflow` e `text-overflow` não fazem nada em
   caixa inline, então o texto não cortava e vazava para fora do cartão. */
.item-nome,
.item-meta { display: block; }
.item-nome {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-meta {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selos { display: flex; gap: .4rem; align-items: center; flex: none; }

.selo {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .3rem .7rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.selo-publicado { color: var(--sucesso); border-color: currentColor; }
.selo-destaque  { color: var(--terracota-texto); border-color: currentColor; }

/* Os quatro estados reais de uma publicação. Ver situacaoDoPost() em
   cms/js/posts.js: "publicado" na tabela não quer dizer visível no site. */
.selo-no-ar     { color: var(--sucesso); border-color: currentColor; }
.selo-rascunho  { color: var(--text-muted); border-color: currentColor; }
.selo-agendado  { color: var(--terracota-texto); border-color: currentColor; }
.selo-sem-data  { color: var(--alerta); border-color: currentColor; }
.selo-pendencia { color: var(--alerta); border-color: currentColor; cursor: help; }

/* ── Estados ── */
.vazio {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--raio);
}

/* A espera genérica, para onde não há forma melhor a imitar: três barras de
   esqueleto com o mesmo brilho das telas do painel. Ela dividia a regra com
   `.vazio`, e a borda tracejada fazia a espera parecer caixa vazia. Houve um
   anel girando no lugar por algumas horas de 23/09/2026, e Rafael o recusou
   ao ver: "péssimo". A legenda fica para leitor de tela; na tela, só a forma. */
.carregando {
  position: relative;
  overflow: hidden;
  padding: 1.2rem 0;
  min-height: 5.2rem;
  border-radius: var(--raio);
}
.carregando::before {
  content: '';
  display: block;
  height: 3.6rem;
  background:
    linear-gradient(var(--bg-alt), var(--bg-alt)) 0 0 / 62% .82rem no-repeat,
    linear-gradient(var(--bg-alt), var(--bg-alt)) 0 1.45rem / 100% .7rem no-repeat,
    linear-gradient(rgba(232, 221, 200, .6), rgba(232, 221, 200, .6)) 0 2.75rem / 40% .7rem no-repeat;
}
.carregando::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 18%, rgba(255, 253, 249, .85) 50%, transparent 82%);
  transform: translateX(-110%);
}
.carregando > * {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (prefers-reduced-motion: no-preference) {
  .carregando::after { animation: carregando-brilho 1400ms cubic-bezier(.45, 0, .25, 1) infinite; }
}
@keyframes carregando-brilho {
  0% { transform: translateX(-110%); }
  72%, 100% { transform: translateX(110%); }
}
.vazio h3 {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: .4rem;
}
.vazio p { font-size: .88rem; max-width: 42ch; margin: 0 auto 1.5rem; }

.erro-caixa {
  background: var(--bg-section);
  border: 1px solid var(--alerta);
  border-radius: var(--raio-sm);
  padding: .9rem 1.1rem;
  font-size: .84rem;
  color: var(--alerta);
  margin-bottom: 1.25rem;
}

/* ════════════════════════════
   FORMULÁRIO
   ════════════════════════════ */
.campo { margin-bottom: 1.35rem; }

.campo label,
.campo .rotulo {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.campo input[type="text"],
.campo input[type="email"],
.campo input[type="password"],
.campo input[type="number"],
.campo input[type="date"],
.campo input[type="time"],
.campo select,
.campo textarea {
  width: 100%;
  font-family: var(--f-body);
  font-size: .95rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--raio-sm);
  padding: .75rem .95rem;
  transition: border-color .2s ease, background .2s ease;
}
.campo textarea { resize: vertical; min-height: 96px; }

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  outline: none;
  border-color: var(--terracota);
}

/* Antes disso a única pista de campo inválido era a linha de texto abaixo
   dele — fácil de passar batido, porque o campo em si continuava com a
   mesma borda neutra de sempre. `mostrarErro()`, em dialogo.js e em
   coluna-acao.js, já marca `aria-invalid` no campo — isto só dá a ele uma
   borda que combina com a mensagem de erro. */
.campo input[aria-invalid="true"],
.campo select[aria-invalid="true"],
.campo textarea[aria-invalid="true"] {
  border-color: var(--alerta);
}
.campo input[aria-invalid="true"]:focus,
.campo select[aria-invalid="true"]:focus,
.campo textarea[aria-invalid="true"]:focus {
  border-color: var(--alerta);
  box-shadow: 0 0 0 1px var(--alerta);
}

.campo input:read-only {
  color: var(--text-muted);
  background: var(--bg-alt);
  cursor: not-allowed;
}

.campo-dica {
  font-size: .74rem;
  color: var(--text-muted);
  margin-top: .4rem;
  line-height: 1.5;
}

/* ════════════════════════════
   EDITOR DE TEXTO FORMATADO
   Sem moldura: o texto tem que parecer documento, não formulário.
   A barra de botões só aparece quando o campo está em edição.
   ════════════════════════════ */
.editor-rico {
  position: relative;
  border: 1px solid transparent;
  border-radius: var(--raio-sm);
  transition: border-color .18s ease, background .18s ease;
}
.editor-rico:hover { border-color: var(--border); }
.editor-rico:focus-within { border-color: var(--terracota); }

.editor-barra {
  /* Ancorada na linha do rótulo, à direita: ali não há conteúdo, então
     ela não cobre nem o rótulo nem a primeira linha do texto. */
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: .1rem;
  padding: .2rem .3rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-section);
  box-shadow: 0 6px 18px var(--sombra);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .2s cubic-bezier(0.16,1,0.3,1), visibility .16s;
}
.editor-rico:focus-within .editor-barra {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.editor-barra-wrap { display: contents; }

/* No celular o editor vira uma superfície de escrita completa. A barra fica
   sempre visível e rola na horizontal, como nos editores móveis nativos. */
@media (max-width: 620px) {
  .editor-rico {
    overflow: hidden;
    border-color: rgba(140,90,60,.34);
    border-radius: 12px;
    background: var(--bg-section);
  }
  .editor-rico:hover { border-color: rgba(140,90,60,.34); }
  .editor-rico:focus-within {
    border-color: var(--terracota);
    outline: 3px solid rgba(181,112,74,.16);
    outline-offset: 1px;
  }
  .editor-barra-wrap {
    position: relative;
    display: block;
    background: var(--bg-alt);
  }
  .editor-barra-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 1px;
    z-index: 1;
    width: 28px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--bg-alt));
    opacity: 0;
    transition: opacity .16s ease;
  }
  .editor-barra-wrap.tem-mais-direita::after { opacity: 1; }
  .editor-barra {
    position: static;
    display: flex;
    width: 100%;
    margin: 0;
    padding: .45rem .5rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: .2rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg-alt);
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    -webkit-overflow-scrolling: touch;
  }
  .editor-barra::-webkit-scrollbar { display: none; }
  .editor-barra .editor-botao {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--bg-section);
    color: var(--text-primary);
  }
  .editor-barra .editor-botao:active,
  .editor-barra .editor-botao[aria-pressed="true"] {
    border-color: rgba(181,112,74,.34);
    background: rgba(181,112,74,.12);
    color: var(--argila);
    transform: scale(.96);
  }
  .editor-barra .editor-botao svg { width: 18px; height: 18px; }

  .editor-rico .editor-area {
    min-height: clamp(18rem, 42dvh, 22rem) !important;
    padding: 1rem;
    background: var(--bg-section);
    font-size: 1rem;
    line-height: 1.72;
    scroll-margin-top: 5.5rem;
  }
  .campo-dica-editor {
    margin-top: .65rem;
    color: var(--text-primary);
    max-width: 52ch;
  }
}

/* Bolha de seleção: aparece junto do trecho marcado, como em editor de
   texto moderno. A barra de cima continua existindo — ela é o mapa do que
   dá para fazer; a bolha é o atalho de quem já sabe. */
.editor-bolha {
  position: absolute;
  top: 0; left: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: .1rem;
  padding: .2rem .3rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-section);
  box-shadow: 0 8px 24px var(--sombra);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px) scale(.97);
  transition: opacity .14s ease, transform .18s cubic-bezier(0.16,1,0.3,1), visibility .14s;
}
.editor-bolha.visivel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.editor-botao {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.editor-botao:hover { color: var(--terracota-texto); background: var(--bg-alt); }
.editor-botao[aria-pressed="true"] { color: var(--terracota-texto); background: var(--bg-alt); }
.editor-botao svg { width: 15px; height: 15px; }

.editor-area {
  position: relative;
  padding: .5rem .7rem;
  font-family: var(--f-body);
  font-size: .97rem;
  font-weight: 400;
  line-height: 1.75;
  color: var(--text-primary);
  caret-color: var(--terracota);
  outline: none;
  overflow-wrap: break-word;
}

.editor-area.editor-area-vazia::before {
  content: attr(data-placeholder);
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--text-muted);
  font-style: italic;
  pointer-events: none;
}

.editor-area p { margin-bottom: .95rem; }
.editor-area p:last-child { margin-bottom: 0; }
.editor-area ul { margin: 0 0 .95rem; padding-left: 1.35rem; }
.editor-area ul:last-child { margin-bottom: 0; }
.editor-area li { margin-bottom: .45rem; }
.editor-area li:last-child { margin-bottom: 0; }

/* Mesma aparência que o texto terá no site. */
.editor-area strong { font-weight: 500; color: var(--text-primary); }
.editor-area em { font-style: italic; }
.editor-area u { text-decoration: underline; text-underline-offset: 2px; }
.editor-area a { color: var(--terracota-texto); text-decoration: underline; }
.editor-area mark {
  background: rgba(181,112,74,.20);
  color: inherit;
  padding: 0 .12em;
  border-radius: 2px;
}
/* ── Campo com botão embutido (mostrar senha) ── */
.campo-com-acao { position: relative; }
.campo-com-acao input { padding-right: 3.1rem; }

.btn-olho {
  position: absolute;
  top: 50%;
  right: .45rem;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--raio-sm);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .18s ease;
}
.btn-olho:hover { color: var(--terracota-texto); }
.btn-olho svg { width: 18px; height: 18px; }

.contador { font-variant-numeric: tabular-nums; }
.contador.excedido { color: var(--alerta); font-weight: 500; }

.linha-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.25rem;
}

/* ── Interruptor de publicação ── */
.campo-troca {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.5rem;
}
/* .campo-troca não é .campo, então o rótulo precisa do estilo próprio. */
.campo-troca .rotulo {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .3rem;
}
.campo-troca .campo-dica { margin-top: 0; }

.interruptor {
  position: relative;
  width: 46px; height: 26px;
  flex: none;
  border: none;
  border-radius: 50px;
  /* Desligado, o trilho precisa aparecer: em areia sobre creme ele ficava em
     1,2:1 e o controle sumia. Esta mistura passa dos 3:1 de controle. */
  background: color-mix(in srgb, var(--text-muted) 55%, var(--areia));
  cursor: pointer;
  transition: background .22s ease;
}
.interruptor::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--branco);
  box-shadow: 0 1px 4px var(--sombra);
  transition: transform .24s cubic-bezier(0.16,1,0.3,1);
}
.interruptor[aria-checked="true"] { background: var(--sucesso); }
.interruptor[aria-checked="true"]::after { transform: translateX(20px); }

/* ── Seções recolhíveis ── */
.secao-form {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  margin-bottom: .85rem;
  overflow: hidden;
}

.secao-form > summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 1.35rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-primary);
  transition: color .18s ease;
}
.secao-form > summary::-webkit-details-marker { display: none; }
.secao-form > summary:hover { color: var(--terracota-texto); }

.secao-form > summary::before {
  content: '';
  width: 7px; height: 7px;
  flex: none;
  border-right: 1.5px solid var(--terracota);
  border-bottom: 1.5px solid var(--terracota);
  transform: rotate(-45deg);
  transition: transform .24s cubic-bezier(0.16,1,0.3,1);
}
.secao-form[open] > summary::before { transform: rotate(45deg); }

.secao-form .secao-nota {
  margin-left: auto;
  font-size: .7rem;
  letter-spacing: .1em;
  color: var(--text-muted);
  text-transform: none;
}

.secao-corpo {
  padding: .35rem 1.35rem 1.35rem;
  border-top: 1px solid var(--border);
}

/* ── Barra fixa de ações do editor ── */
.barra-acoes {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem 0;
  margin-top: 1.5rem;
  background: linear-gradient(to top, var(--bg-page) 70%, transparent);
}
.barra-acoes .espaco { margin-left: auto; }

.estado-salvo {
  font-size: .76rem;
  color: var(--text-muted);
}
.estado-salvo.sujo { color: var(--alerta); }

/* ════════════════════════════
   PRÉ-VISUALIZAÇÃO
   ════════════════════════════ */
.previa-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(74, 46, 26, .38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: clamp(.75rem, 2vw, 1.5rem);
  gap: .85rem;
  animation: previa-entra .24s cubic-bezier(0.16,1,0.3,1);
}

@keyframes previa-entra {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.previa-barra {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  padding: .7rem 1.1rem;
}
.previa-barra .espaco { margin-left: auto; }

.previa-titulo {
  font-family: var(--f-display);
  font-size: 1.15rem;
  font-weight: 400;
}
.previa-titulo em { font-style: italic; color: var(--terracota-texto); }

.previa-larguras { display: flex; gap: .25rem; }

.previa-larguras button {
  border: 1px solid transparent;
  background: none;
  border-radius: 50px;
  padding: .4rem .9rem;
  font-family: var(--f-body);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.previa-larguras button:hover { color: var(--terracota-texto); }
.previa-larguras button[aria-pressed="true"] {
  color: var(--terracota-texto);
  border-color: var(--border);
  background: var(--bg-alt);
}

.previa-palco {
  display: grid;
  place-items: start center;
  overflow: auto;
  border-radius: var(--raio);
}

.previa-quadro {
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--raio);
  background: #f5f0e8;
  box-shadow: 0 20px 50px rgba(74,46,26,.22);
  transition: max-width .3s cubic-bezier(0.16,1,0.3,1);
}
.previa-quadro[data-largura="tablet"] { max-width: 834px; }
.previa-quadro[data-largura="celular"] { max-width: 414px; }

.previa-nota {
  font-size: .72rem;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .previa-titulo, .previa-nota { display: none; }
}

/* ════════════════════════════
   AVISO FLUTUANTE
   ════════════════════════════ */
.avisos {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  align-items: flex-end;
  pointer-events: none;
}

.aviso {
  display: flex;
  align-items: baseline;
  gap: .65rem;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--raio-sm);
  box-shadow: 0 12px 32px var(--sombra);
  padding: .85rem 1.15rem;
  font-size: .85rem;
  max-width: 340px;
  pointer-events: auto;
  animation: aviso-entra .28s cubic-bezier(0.16,1,0.3,1);
}

/* O estado é sinalizado por um ponto, não por barra lateral:
   o site não usa barras de destaque em nenhum componente. */
.aviso::before {
  content: '';
  width: 6px; height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--terracota);
  transform: translateY(-1px);
}
.aviso-ok::before   { background: var(--sucesso); }
.aviso-erro::before { background: var(--alerta); }
.aviso.saindo { animation: aviso-sai .22s ease forwards; }

@keyframes aviso-entra {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes aviso-sai {
  to { opacity: 0; transform: translateY(6px); }
}

/* ════════════════════════════
   CAIXAS DE DIÁLOGO
   Substituem confirm() e prompt() do navegador, que ignoram o tema,
   mostram o domínio no cabeçalho e travam a aba inteira.
   Acima da prévia (z-index 900): dá para confirmar algo com ela aberta.
   ════════════════════════════ */
.dialogo-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
  background: rgba(74, 46, 26, .42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: dialogo-entra .2s ease;
}
.dialogo-overlay.saindo { animation: dialogo-sai .16s ease forwards; }

.dialogo-card {
  width: min(430px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 1.6rem 1.7rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--raio);
  background: var(--bg-section);
  box-shadow: 0 24px 60px var(--sombra);
  animation: dialogo-card-entra .24s cubic-bezier(0.16, 1, 0.3, 1);
}
.dialogo-overlay.saindo .dialogo-card { animation: none; }

.dialogo-titulo {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-primary);
}
.dialogo-mensagem {
  margin-top: .5rem;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.dialogo-campo { margin-top: 1.2rem; }
.dialogo-dica {
  margin-top: .35rem;
  font-size: .72rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.dialogo-erro {
  margin-top: .35rem;
  font-size: .74rem;
  color: var(--alerta);
}

.dialogo-acoes {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1.5rem;
}
/* Exclusão é irreversível: o botão precisa parecer o que é, não um
   contorno discreto como na barra de ações do editor. */
.btn-perigo-cheio {
  background: var(--alerta);
  border-color: var(--alerta);
  color: #faf8f4;
}
.btn-perigo-cheio:hover { background: var(--alerta); border-color: var(--alerta); filter: brightness(1.08); }

@keyframes dialogo-entra {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes dialogo-sai {
  to { opacity: 0; }
}
@keyframes dialogo-card-entra {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .dialogo-overlay,
  .dialogo-card { animation: none; }
}

@media (max-width: 520px) {
  .dialogo-acoes { flex-direction: column-reverse; }
  .dialogo-acoes .btn { width: 100%; }
}

/* ════════════════════════════
   RECORTE DE IMAGEM
   ════════════════════════════ */
.recorte-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: clamp(.75rem, 3vw, 2rem);
  background: rgba(74, 46, 26, .5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: dialogo-entra .2s ease;
}

.recorte-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 1rem;
  width: min(880px, 100%);
  max-height: 100%;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--raio);
  background: var(--bg-section);
  box-shadow: 0 24px 60px var(--sombra);
}

.recorte-topo {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.recorte-proporcoes {
  display: flex;
  gap: .25rem;
  margin-left: auto;
}
.recorte-proporcoes button {
  border: 1px solid transparent;
  border-radius: 50px;
  padding: .4rem .85rem;
  background: none;
  font-family: var(--f-body);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.recorte-proporcoes button:hover { color: var(--terracota-texto); }
.recorte-proporcoes button[aria-pressed="true"] {
  color: var(--terracota-texto);
  border-color: var(--border);
  background: var(--bg-alt);
}

.recorte-palco {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--raio-sm);
  background: var(--bg-page);
}
.recorte-quadro {
  position: relative;
  line-height: 0;
  /* O molde só faz sentido sobre a imagem: fora dela não há o que cortar. */
  touch-action: none;
}
.recorte-imagem {
  max-width: 100%;
  max-height: min(60vh, 520px);
  user-select: none;
}

/* O que fica de fora do molde escurece. A sombra gigante é o truque que
   evita uma segunda camada de máscara só para isso. */
.recorte-moldura {
  position: absolute;
  box-shadow: 0 0 0 9999px rgba(26, 21, 18, .55);
  outline: 1px solid rgba(250, 248, 244, .9);
  cursor: move;
  touch-action: none;
}
.recorte-moldura:focus-visible { outline: 2px solid var(--terracota); }

/* Terços: ajudam a posicionar o rosto sem precisar de régua. */
.recorte-moldura::before,
.recorte-moldura::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .35;
}
.recorte-moldura::before {
  background:
    linear-gradient(to right, transparent 33.33%, #faf8f4 33.33%, #faf8f4 calc(33.33% + 1px), transparent calc(33.33% + 1px)),
    linear-gradient(to right, transparent 66.66%, #faf8f4 66.66%, #faf8f4 calc(66.66% + 1px), transparent calc(66.66% + 1px));
}
.recorte-moldura::after {
  background:
    linear-gradient(to bottom, transparent 33.33%, #faf8f4 33.33%, #faf8f4 calc(33.33% + 1px), transparent calc(33.33% + 1px)),
    linear-gradient(to bottom, transparent 66.66%, #faf8f4 66.66%, #faf8f4 calc(66.66% + 1px), transparent calc(66.66% + 1px));
}

.recorte-alca {
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid #faf8f4;
  background: rgba(26, 21, 18, .35);
  z-index: 1;
}
.recorte-alca[data-canto="no"] { top: -2px; left: -2px; border-right: 0; border-bottom: 0; cursor: nwse-resize; }
.recorte-alca[data-canto="ne"] { top: -2px; right: -2px; border-left: 0; border-bottom: 0; cursor: nesw-resize; }
.recorte-alca[data-canto="so"] { bottom: -2px; left: -2px; border-right: 0; border-top: 0; cursor: nesw-resize; }
.recorte-alca[data-canto="se"] { bottom: -2px; right: -2px; border-left: 0; border-top: 0; cursor: nwse-resize; }

.recorte-acoes {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.recorte-acoes .espaco { margin-left: auto; }
.recorte-medida {
  font-size: .74rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 620px) {
  .recorte-card { padding: 1rem; }
  .recorte-topo .dialogo-titulo { font-size: 1.2rem; }
  .recorte-proporcoes { margin-left: 0; width: 100%; justify-content: space-between; }
  .recorte-acoes .btn { flex: 1 1 auto; }
  .recorte-medida { width: 100%; }
}

/* ════════════════════════════
   RESPONSIVO
   ════════════════════════════ */
@media (max-width: 900px) {
  /* Empilhado, o painel deixa de ser grade, e são dois defeitos de uma vez.
     `align-content` normal em grade é `stretch`: com `min-height: 100svh` e
     conteúdo curto, a sobra era repartida entre as duas linhas e o cabeçalho
     crescia até meia tela, com a marca boiando num bloco creme vazio — em tela
     cheia de conteúdo o defeito sumia sozinho, o que o fazia parecer coisa de
     uma página só. E o `position: sticky` da barra não grudava: item de grade
     é contido pela própria linha, que tem a altura dele, então não sobra
     percurso para deslizar. Em coluna flex a contenção passa a ser o painel
     inteiro, e a barra fica onde precisa ficar. */
  .painel { display: flex; flex-direction: column; }
  .barra-lateral {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: .75rem clamp(1rem, 4vw, 1.5rem);
    background: rgba(250,248,244,.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: visible;
  }
  .marca { min-width: 0; padding: 0; }
  .marca img { width: 38px; height: 38px; }
  .marca-nome { font-size: .96rem; }
  .marca-papel { font-size: .64rem; letter-spacing: .14em; }
  .menu-mobile { display: inline-flex; }

  .barra-lateral nav,
  .barra-lateral .rodape-lateral { display: none; }
  .barra-lateral.menu-aberto nav {
    display: block;
    grid-column: 1 / -1;
    padding-top: .8rem;
    border-top: 1px solid var(--border);
    animation: menu-mobile-entra .22s cubic-bezier(.16,1,.3,1);
  }
  .barra-lateral.menu-aberto .rodape-lateral {
    display: flex;
    grid-column: 1 / -1;
    animation: menu-mobile-entra .22s cubic-bezier(.16,1,.3,1);
  }
  .barra-lateral .nav-secao { display: none; }
  .nav-lista { flex-direction: column; flex-wrap: nowrap; gap: .25rem; }
  .nav-item {
    min-height: 46px;
    padding: .7rem .8rem;
    font-size: .9rem;
  }
  .rodape-lateral {
    margin-top: 0;
    margin-left: 0;
    border-top: 1px solid var(--border);
    padding: .85rem .15rem .1rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
  }
  .usuario-email { padding: 0 .65rem; word-break: normal; overflow-wrap: anywhere; }
  .conteudo { padding-top: clamp(1.5rem, 5vw, 2.25rem); }
  .linha-2 { grid-template-columns: minmax(0, 1fr); }
  .lista-item { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .selos { grid-column: 1 / -1; }
}

@keyframes menu-mobile-entra {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ════════════════════════════
   BLOCO PRINCIPAL DO EDITOR
   Os campos que a Jennifer usa no dia a dia ficam soltos na página,
   sem seção recolhível. O encanamento técnico vai para "ajustes
   avançados", fechado por padrão.
   ════════════════════════════ */
.bloco-principal {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  padding: 1.6rem 1.35rem .4rem;
  margin-bottom: .85rem;
}

.nota-automatico {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  background: var(--bg-alt);
  border-radius: var(--raio-sm);
  padding: .9rem 1.1rem;
  margin: .35rem 0 1.5rem;
}
.nota-automatico p {
  font-size: .8rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0;
}
.nota-automatico .btn { flex: none; }

/* Sugestões aparecem em itálico, mas preservam contraste de leitura. */
.campo input::placeholder,
.campo textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
  font-style: italic;
}

/* Endereço da página: informação, não campo. Não se edita depois de publicado. */
.endereco-pagina {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .35rem;
  font-variant-numeric: tabular-nums;
}

/* Agrupamento dentro dos ajustes avançados. */
.subsecao { margin-bottom: 2rem; }
.subsecao:last-child { margin-bottom: .5rem; }

.subsecao-titulo {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terracota-texto);
  padding-bottom: .6rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

/* ════════════════════════════
   BLOG
   ════════════════════════════ */

/* ── Linha da lista, com miniatura da capa ── */
.lista-item-post { grid-template-columns: 72px minmax(0, 1fr) auto; }

.item-capa {
  width: 72px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-alt);
}
.item-capa-vazia {
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.item-capa-vazia svg { width: 20px; height: 20px; }

/* ── Campo da imagem de capa ── */
.capa {
  position: relative;
  border-radius: var(--raio);
  overflow: hidden;
}

.capa-previa {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--raio);
  background: var(--bg-alt);
}

.capa-acoes {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  display: flex;
  gap: .5rem;
}
.capa-acoes .btn {
  background: var(--bg-section);
  border-color: var(--border);
}

.capa-vazia {
  width: 100%;
  min-height: 168px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .35rem;
  border: 1px dashed var(--border);
  border-radius: var(--raio);
  background: var(--bg-page);
  color: var(--text-muted);
  font-family: var(--f-body);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.capa-vazia:hover {
  border-color: var(--terracota);
  color: var(--terracota-texto);
  background: var(--bg-section);
}
.capa-vazia svg { width: 26px; height: 26px; }
.capa-vazia span { font-size: .85rem; }
.capa-vazia small { font-size: .72rem; }

.capa-progresso {
  min-height: 168px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  border-radius: var(--raio);
  color: var(--text-muted);
  font-size: .85rem;
}

/* ── Blocos do editor em modo artigo ── */
.editor-area h2 {
  font-family: var(--f-display);
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.3;
  margin: 1.6rem 0 .7rem;
  color: var(--text-primary);
}
.editor-area h2:first-child { margin-top: 0; }

.editor-area h3 {
  font-family: var(--f-body);
  font-size: 1.02rem;
  font-weight: 500;
  margin: 1.3rem 0 .5rem;
}

.editor-area blockquote {
  margin: 1.2rem 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--terracota);
  font-family: var(--f-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-muted);
}

.editor-area figure { margin: 1.4rem 0; }
.editor-area figure img {
  width: 100%;
  border-radius: var(--raio-sm);
  border: 1px solid var(--border);
}
.editor-area figcaption {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .5rem;
  text-align: center;
}

.editor-area ol { margin: 0 0 .95rem; padding-left: 1.35rem; }

/* Blocos inseridos pela barra, com a mesma leitura que terão no site. */
.editor-area hr {
  width: 80px;
  margin: 1.6rem auto;
  border: 0;
  border-top: 1px solid var(--border);
}

.editor-area aside {
  margin: 1.4rem 0;
  padding: .9rem 1.1rem;
  border-left: 2px solid var(--terracota);
  background: var(--bg-alt);
}
.editor-area aside p:last-child { margin-bottom: 0; }

.editor-area table {
  width: 100%;
  margin: 1.4rem 0;
  border-collapse: collapse;
  font-size: .9rem;
}
.editor-area th,
.editor-area td {
  padding: .5rem .6rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.editor-area th {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-alt);
}

/* O vídeo no editor é ilustração: clique dentro dele roubaria o cursor
   para o iframe, e de lá não dá para apagar o bloco. */
.editor-area iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: var(--raio-sm);
  pointer-events: none;
}

/* Mesmo enquadramento do site: o que o painel mostra tem de ser o que sai.
   Aqui a borda usa o token do painel, que é o equivalente do --areia lá.
   A proporção é só o palpite inicial — editor-rico.js escuta a medida real. */
.editor-area iframe[src^="https://www.instagram.com/"] {
  aspect-ratio: 3 / 4;
  max-width: 440px;
  margin-inline: auto;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  filter: saturate(.72) sepia(.08);
}

.editor-area iframe[src*="/reel/"],
.editor-area iframe[src*="/tv/"] {
  aspect-ratio: 5 / 8;
}

/* Seletor de tipo, no mesmo traço dos demais campos. */
.campo select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c534c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8rem center;
  background-size: 16px;
  padding-right: 2.4rem;
  cursor: pointer;
}

/* ════════════════════════════════════════════════════════
   Documentos internos — guias e pesquisas

   O documento vive dentro de um iframe, então o CSS daqui
   cuida só da moldura: altura, borda e a divisão entre o
   campo de edição e a prévia.
   ════════════════════════════════════════════════════════ */

.documento-nota {
  font-size: .82rem;
  color: var(--text-muted);
  margin: -.6rem 0 1.4rem;
}

.documento-titulo {
  font-family: var(--f-display);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.15;
  margin-top: .5rem;
}

.documento-meta {
  font-size: .74rem;
  color: var(--text-muted);
  letter-spacing: .04em;
  margin-top: .25rem;
}

.documento-quadro {
  display: block;
  width: 100%;
  height: min(78vh, 900px);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  background: var(--bg-section);
  box-shadow: 0 8px 26px var(--sombra);
}

.documento-editor {
  display: grid;
  gap: 1.6rem;
  align-items: start;
}

/* Lado a lado só quando há largura para os dois. Abaixo disso a prévia
   desce para o fim da tela, que é onde ela atrapalha menos. */
@media (min-width: 1180px) {
  .documento-editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .documento-previa { position: sticky; top: 1.5rem; }
}

.documento-linha {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0 1rem;
}

/* Editar HTML pede fonte de largura fixa e muita altura: os guias passam
   de setecentas linhas. */
.campo textarea.documento-fonte {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.65;
  min-height: 60vh;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  tab-size: 2;
}

.documento-previa .rotulo {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .6rem;
}

.documento-quadro-previa { height: min(70vh, 780px); }

/* ── Citação com @ no corpo do artigo ──
   Lista flutuante presa ao <body>: dentro do editor ela seria cortada pelo
   overflow do campo. Ver cms/js/citacoes.js. */
.citacoes {
  position: fixed;
  z-index: 60;
  min-width: 280px;
  max-width: min(440px, calc(100vw - 32px));
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  box-shadow: 0 14px 34px var(--sombra);
  padding: .35rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.citacao {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .9rem;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--raio-sm);
  padding: .55rem .7rem;
  cursor: pointer;
  font-family: var(--f-body);
  font-size: .86rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.35;
}

.citacao-titulo {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.citacao-tipo {
  flex: none;
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.citacao.ativa,
.citacao:hover {
  background: var(--bg-alt);
  color: var(--mogno);
}
.citacao.ativa .citacao-tipo,
.citacao:hover .citacao-tipo { color: var(--terracota-texto); }

/* ── Ajustes de interface ── */
.ajuste { margin-top: 1.6rem; }
.ajuste h3 {
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: .2rem;
}
.ajuste-nota { font-size: .82rem; color: var(--text-muted); margin-bottom: 1.1rem; }

.ajuste-opcoes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 720px;
}

.ajuste-opcao {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .5rem;
  text-align: left;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  padding: 1.1rem 1.2rem 1.2rem;
  cursor: pointer;
  font-family: var(--f-body);
  color: var(--text-primary);
  transition: border-color .2s ease, box-shadow .2s ease, transform .24s cubic-bezier(.16,1,.3,1);
}
.ajuste-opcao:hover { border-color: var(--terracota); transform: translateY(-2px); }
.ajuste-opcao.ativa { border-color: var(--terracota); box-shadow: 0 0 0 1px var(--terracota) inset; }

.ajuste-desenho { width: 100%; height: auto; max-width: 190px; }
.ajuste-desenho rect { fill: none; stroke: var(--border); stroke-width: 1.5; }
.ajuste-desenho rect.cheio { fill: var(--bg-alt); stroke: none; }
.ajuste-opcao.ativa .ajuste-desenho rect { stroke: var(--terracota); }
.ajuste-opcao.ativa .ajuste-desenho rect.cheio { fill: var(--terracota); opacity: .28; }

.ajuste-opcao-nome { font-size: .95rem; font-weight: 500; }
.ajuste-opcao-texto { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }
.ajuste-marca {
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--terracota-texto);
  margin-left: .4rem;
}

/* ── Foco da imagem no cartão ── */
.foco { margin-top: 1rem; }

/* A moldura tem a proporção do recorte no formato deitado. É nela que a
   pessoa vê o que entra e o que fica de fora. */
.foco-palco {
  position: relative;
  aspect-ratio: 320 / 240;
  max-width: 320px;
  border-radius: var(--raio-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: crosshair;
  touch-action: none;
  background: var(--bg-alt);
}
.foco-palco:focus-visible { outline: 2px solid var(--terracota); outline-offset: 2px; }
.foco-palco img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }

.foco-alvo {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--terracota), 0 2px 8px rgba(0,0,0,.35);
  pointer-events: none;
}
.foco-alvo::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--terracota);
}

.foco-acoes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 320px;
  margin-top: .5rem;
}
.foco-acoes .campo-dica { margin: 0; }

/* ── Ordem manual da listagem do blog ── */
.ordenacao-aviso {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bg-alt);
  border-radius: var(--raio);
  padding: .85rem 1.1rem;
  margin: -.4rem 0 1.2rem;
}
.ordenacao-aviso p { font-size: .82rem; color: var(--text-muted); margin: 0; }

/* Em modo de ordenação a linha deixa de ser botão: clicar nela abriria o
   editor no meio de um arrasto de posição. */
.lista-item-ordenando {
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  cursor: default;
}
.lista-item-ordenando:hover { transform: none; box-shadow: none; border-color: var(--border); }

.item-posicao {
  font-family: var(--f-display);
  font-size: 1.35rem;
  color: var(--terracota-texto);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.mover { display: flex; gap: .2rem; flex: none; }
.mover .btn { padding: .45rem .5rem; }
.mover svg { width: 15px; height: 15px; }

/* ════════════════════════════════════════════════════════
   BLOG — LISTA E EDITOR LADO A LADO

   A tela do blog abandona a coluna estreita: a lista ocupa a
   largura toda e o editor abre numa coluna à direita, no lugar
   de substituir a página. Abaixo de 1180px não há espaço para
   duas colunas — o editor volta a tomar a tela inteira.
   ════════════════════════════════════════════════════════ */
.conteudo-largo { max-width: none; }

.area-mestre {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.25rem, 2.2vw, 2rem);
}
.area-mestre.com-detalhe {
  grid-template-columns: minmax(0, 1fr) minmax(0, clamp(400px, 38vw, 560px));
}

.coluna-lista { min-width: 0; }

/* ── Alternador de formato ── */
.alternar-visual {
  display: inline-flex;
  gap: .15rem;
  padding: .2rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-section);
}

.visual-opcao {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .42rem .85rem;
  border: none;
  border-radius: 50px;
  background: none;
  font-family: var(--f-body);
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.visual-opcao svg { width: 15px; height: 15px; flex: none; }
.visual-opcao:hover { color: var(--terracota-texto); }
.visual-opcao[aria-pressed="true"] {
  background: var(--bg-alt);
  color: var(--terracota-texto);
  font-weight: 500;
}

/* ════════════════════════════
   Formato em cartões
   ════════════════════════════ */
.grade-cartoes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: .85rem;
}

.cartao-post {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: start;
  gap: 1.05rem;
  width: 100%;
  text-align: left;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  padding: 1.05rem 1.15rem;
  cursor: pointer;
  font-family: var(--f-body);
  color: var(--text-primary);
  transition: border-color .2s ease, box-shadow .2s ease, transform .24s cubic-bezier(0.16,1,0.3,1);
}
.cartao-post:hover {
  border-color: var(--terracota);
  box-shadow: 0 8px 22px var(--sombra);
  transform: translateY(-2px);
}
.cartao-post.selecionado {
  border-color: var(--terracota);
  box-shadow: 0 0 0 1px var(--terracota), 0 8px 22px var(--sombra);
}

.cartao-capa {
  width: 92px;
  height: 68px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-alt);
}

.cartao-corpo { min-width: 0; }
.cartao-corpo .item-nome { white-space: normal; overflow: visible; }
.cartao-corpo .selos { margin-top: .6rem; flex-wrap: wrap; }

/* ════════════════════════════
   Formato em planilha
   ════════════════════════════ */
.planilha {
  /* Valor de partida. O conjunto real de colunas é decidido em
     cms/js/posts.js, que escreve esta variável conforme a largura. */
  --grade-planilha: 44px minmax(0, 1fr) 118px 122px;
  border: 1px solid var(--border);
  border-radius: var(--raio);
  background: var(--bg-section);
  overflow: hidden;
}

.planilha-cabecalho,
.planilha-linha {
  display: grid;
  grid-template-columns: var(--grade-planilha);
  align-items: center;
  gap: .9rem;
  width: 100%;
  padding: .5rem .95rem;
  text-align: left;
  font-family: var(--f-body);
}

.planilha-cabecalho {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.planilha-linha {
  border: none;
  border-top: 1px solid var(--border);
  background: none;
  color: var(--text-primary);
  font-size: .84rem;
  padding-block: .6rem;
  cursor: pointer;
  transition: background .16s ease, box-shadow .16s ease;
}
.planilha-linha:first-of-type { border-top: none; }
.planilha-linha:hover { background: var(--bg-page); }
.planilha-linha.selecionado {
  background: var(--bg-alt);
  color: var(--terracota-texto);
}

/* Toda célula é uma linha só: a planilha se lê varrendo a coluna. */
.planilha-linha > span,
.planilha-cabecalho > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planilha-capa {
  width: 44px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg-alt);
}
.planilha-capa.item-capa-vazia svg { width: 15px; height: 15px; }

.pl-titulo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 500;
}
.pl-titulo .selo { flex: none; font-size: .64rem; padding: .18rem .5rem; }

/* text-overflow não age sobre filho de flex: sem esta caixa própria, título
   comprido era cortado a seco, sem reticências. */
.pl-titulo-texto {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-tipo,
.pl-data,
.pl-ordem,
.pl-busca,
.pl-pendencias {
  font-size: .75rem;
  color: var(--text-muted);
}
.pl-data,
.pl-ordem,
.pl-busca { font-variant-numeric: tabular-nums; }

/* Número se compara pela direita. */
.pl-ordem,
.pl-busca,
.planilha-cabecalho .pl-ordem,
.planilha-cabecalho .pl-busca { text-align: right; padding-right: .35rem; }
.pl-busca [title] { cursor: help; }

.pl-situacao {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .75rem;
  color: var(--text-muted);
}
.ponto {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: currentColor;
}
.ponto-no-ar    { color: var(--sucesso); }
.ponto-rascunho { color: var(--text-muted); }
.ponto-agendado { color: var(--terracota-texto); }
/* Publicado mas invisível no site. Vermelho porque é engano, não estado. */
.ponto-sem-data { color: var(--alerta); }

/* ── Pendências ── */
.aviso-pendencia { color: var(--alerta); cursor: help; }
.sem-dado { color: var(--text-muted); }

/* Célula escondida pelo ajuste de colunas. Precisa vencer o `display:flex`
   de .pl-titulo e .pl-situacao, que são regras de autor. */
.planilha [hidden] { display: none !important; }

/* ════════════════════════════
   Coluna do editor
   ════════════════════════════ */
.coluna-detalhe {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: sticky;
  top: clamp(1rem, 2vw, 1.5rem);
  height: calc(100svh - clamp(2rem, 4vw, 3rem));
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  box-shadow: 0 18px 44px -34px var(--sombra);
  overflow: hidden;
  animation: detalhe-entra .26s cubic-bezier(0.16,1,0.3,1);
}

@keyframes detalhe-entra {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: none; }
}

.detalhe-topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex: none;
  padding: 1.25rem 1.35rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-section);
}
.detalhe-titulo { min-width: 0; }
.detalhe-titulo h2 {
  font-family: var(--f-display);
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.2;
}
.detalhe-titulo h2 em { font-style: italic; color: var(--terracota-texto); }

.detalhe-acoes {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: none;
}

.btn-fechar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.btn-fechar:hover {
  color: var(--terracota-texto);
  border-color: var(--border);
  background: var(--bg-alt);
}
.btn-fechar svg { width: 17px; height: 17px; }

/* Só o miolo rola: cabeçalho e barra de ações ficam sempre à vista. */
.detalhe-corpo {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 1.35rem 1.35rem .25rem;
}

.coluna-detalhe .barra-acoes {
  position: static;
  flex: none;
  margin-top: 0;
  padding: .9rem 1.35rem;
  border-top: 1px solid var(--border);
  background: var(--bg-section);
}

/* Dentro do painel, o bloco branco sobre fundo branco sumiria. */
.coluna-detalhe .bloco-principal { background: var(--bg-section); }

/* ── Uma coluna só ── */
@media (max-width: 1180px) {
  /* Sem largura para as duas, o editor assume a tela, como antes. */
  .area-mestre.com-detalhe { grid-template-columns: minmax(0, 1fr); }
  .area-mestre.com-detalhe .coluna-lista { display: none; }

  .coluna-detalhe {
    position: static;
    height: auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: none;
    overflow: visible;
    animation: none;
  }
  .detalhe-topo {
    padding: 0 0 1.25rem;
    border-bottom: 1px solid var(--border);
    background: none;
  }
  .detalhe-titulo h2 { font-size: clamp(1.8rem, 4.5vw, 2.3rem); }
  .detalhe-corpo {
    overflow: visible;
    padding: 1.5rem 0 0;
  }
  .coluna-detalhe .barra-acoes {
    position: sticky;
    bottom: 0;
    padding: 1.1rem 0;
    border-top: none;
    background: linear-gradient(to top, var(--bg-page) 70%, transparent);
  }
}

@media (max-width: 620px) {
  .grade-cartoes { grid-template-columns: minmax(0, 1fr); }
  .visual-opcao span { display: none; }
  .visual-opcao { padding: .45rem .7rem; }
}

/* Numa coluna estreita, campos lado a lado ficam apertados demais para
   digitar. A referência é a largura do painel, não a da janela. */
@media (min-width: 1181px) {
  .coluna-detalhe { container-type: inline-size; }

  @container (max-width: 560px) {
    .linha-2 { grid-template-columns: minmax(0, 1fr); }
    .nota-automatico { gap: .85rem; }
  }
}

/* ── Caixa de pendências do editor ── */
.pendencias {
  border-radius: var(--raio-sm);
  background: var(--bg-alt);
  padding: .9rem 1.1rem;
  margin-bottom: 1.1rem;
}
.pendencias-titulo {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--alerta);
  margin-bottom: .45rem;
}
.pendencias ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.pendencias li {
  font-size: .8rem;
  line-height: 1.5;
  color: var(--text-muted);
  padding-left: 1rem;
  position: relative;
}
.pendencias li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .62em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--alerta);
  opacity: .6;
}

/* Publicação completa não merece caixa nenhuma: vira uma linha de texto. */
.pendencias-ok {
  background: none;
  padding: 0;
  margin-bottom: .9rem;
}
.pendencias-ok p {
  font-size: .78rem;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════
   BARRA LATERAL EM RAIL

   Recolhida, a barra ocupa 76px e mostra só os ícones. Ela continua sendo
   item da grade: expandir empurra o conteúdo, não o cobre.

   A abertura é por clique, e só por clique. Até 20/09/2026 passar o mouse
   sobre a barra a abria sozinha, sobreposta e com transição de largura e de
   sombra num elemento `fixed` — o movimento engasgava e a barra abria quando
   ninguém pediu. O botão de expandir é o de sempre; o que mudou é onde ele
   aparece com a barra recolhida: em cima da marca, que se troca por ele ao
   receber o mouse, como no Perplexity.

   Tudo aqui é desktop: abaixo de 900px a barra já é faixa de topo.
   ════════════════════════════════════════════════════════ */
.btn-rail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  padding: 0;
  flex: none;
  border: 1px solid transparent;
  border-radius: var(--raio-sm);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}
.btn-rail:hover {
  color: var(--terracota-texto);
  border-color: var(--border);
  background: var(--bg-alt);
}
.btn-rail svg { width: 16px; height: 16px; }

@media (max-width: 900px) {
  .btn-rail { display: none; }
}

@media (min-width: 901px) {
  .painel.rail { --sidebar: 76px; }
  .painel.rail .nav-item > .nav-badge { position: absolute; left: 34px; top: 6px; margin: 0; }

  .painel.rail .barra-lateral {
    padding: 1.75rem .9rem;
    overflow: hidden;
  }

  /* Rótulos ficam no lugar e apenas somem: assim nada reflowa quando a
     barra volta ao tamanho cheio. */
  .painel.rail .marca-texto,
  .painel.rail .nav-rotulo,
  .painel.rail .nav-em-breve,
  .painel.rail .nav-secao,
  .painel.rail .usuario-email {
    opacity: 0;
  }

  /* Recolhida, cada item vira um quadrado com o ícone no meio. O texto
     continua no DOM, só é empurrado para fora do recorte. */
  .painel.rail .nav-item,
  .painel.rail .btn-fantasma {
    white-space: nowrap;
  }
  .painel.rail .nav-item {
    padding-left: .95rem;
    padding-right: .95rem;
  }

  /* Menu recolhido: o ícone fica no mesmo eixo dos outros, sem deslocamento.
     O contador se ancora no canto superior direito do ícone (que ocupa de
     15,2px a 32,2px do item), sobrepõe só a quina e leva um anel da cor do
     fundo para recortar o desenho, como o selo de notificação do sistema. */
  .painel.rail .nav-item[data-secao="conversas"] > .nav-badge {
    left: 28px;
    right: auto;
    top: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    font-size: 9px;
    box-shadow: 0 0 0 2px var(--bg-section);
  }
  .painel.rail .nav-item[data-secao="conversas"]:hover > .nav-badge,
  .painel.rail .nav-item[data-secao="conversas"][aria-current="page"] > .nav-badge {
    box-shadow: 0 0 0 2px var(--bg-alt);
  }

  .painel.rail .nav-secao {
    height: 0;
    margin: 0;
    overflow: hidden;
  }

  /* Recolhida, a folga lateral da marca cede para os 40px do disco caberem
     inteiros nos 47,2px de área útil do rail, alinhados aos ícones do menu. */
  .painel.rail .marca {
    position: relative;
    padding: 0 .2rem;
  }

  /* O botão ocupa exatamente o lugar do disco, e a marca se troca por ele ao
     receber o mouse. `focus-visible` está aqui porque o botão é tabulável:
     sem isso o teclado pousaria num controle invisível. */
  .painel.rail .btn-rail {
    position: absolute;
    left: .2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    margin: 0;
    opacity: 0;
  }
  /* O par de seletores do teclado é `:has(...:focus-visible)`, e não
     `:focus-within`: recolher com o mouse deixa o botão em foco sem
     `:focus-visible`, e o `:focus-within` apagaria a marca enquanto o botão
     continua invisível — 40px de barra vazia até o foco sair dali. */
  .painel.rail .marca:hover img,
  .painel.rail .marca:has(.btn-rail:focus-visible) img {
    opacity: 0;
  }
  .painel.rail .marca:hover .btn-rail,
  .painel.rail .btn-rail:focus-visible {
    opacity: 1;
  }

  .painel.rail .rodape-lateral { align-items: stretch; }
}

/* ── Desempenho da publicação no Google ── */
.metricas {
  border-radius: var(--raio-sm);
  background: var(--bg-section);
  border: 1px solid var(--border);
  padding: .95rem 1.1rem .8rem;
  margin-bottom: 1.1rem;
}

/* Três por linha na coluna do editor. Cinco cabiam na largura, mas rótulo de
   duas palavras quebrava em duas linhas e a explicação embaixo desalinhava
   tudo — mais colunas estreitas ficam menos legíveis, não mais. */
.metricas-numeros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 1.1rem .9rem;
  align-items: start;
}

.metrica { min-width: 0; }
.metrica-valor {
  display: block;
  font-family: var(--f-display);
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--terracota-texto);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.metrica-rotulo {
  display: block;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: .2rem;
}

.metricas-legenda {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .8rem;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
}

/* Publicação que ainda não apareceu na busca não merece um painel de zeros. */
.metricas-vazia {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: .9rem;
}
.metricas-vazia p {
  font-size: .78rem;
  color: var(--text-muted);
}

/* ── Variação contra o período anterior ── */
.metrica-variacao {
  display: block;
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  margin-top: .25rem;
}

/* A seta segue o número; a cor segue o julgamento. Em posição de busca, cair
   de 8 para 3 é melhora — sai `▼ -21%` em verde. Quem decide o julgamento é
   painel-metricas.js, com menorEhMelhor. */
.metrica-variacao.subiu::before { content: '▲ '; font-size: .7em; }
.metrica-variacao.caiu::before  { content: '▼ '; font-size: .7em; }
.metrica-variacao.melhorou { color: var(--sucesso); }
.metrica-variacao.piorou   { color: var(--alerta); }

.metrica[title] { cursor: help; }

/* ── Filtro por tipo de conteúdo ── */
.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: -1.2rem 0 1.4rem;
}

.filtro-opcao {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .85rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-section);
  font-family: var(--f-body);
  font-size: .78rem;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.filtro-opcao:hover { border-color: var(--terracota); color: var(--terracota-texto); }
.filtro-opcao[aria-pressed="true"] {
  background: var(--bg-alt);
  border-color: var(--terracota);
  color: var(--terracota-texto);
  font-weight: 500;
}

.filtro-conta {
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}

/* ── Abas da coluna do editor ── */
.detalhe-abas {
  display: flex;
  gap: .25rem;
  flex: none;
  padding: 0 1.35rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-section);
}

.detalhe-aba {
  padding: .7rem .9rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-family: var(--f-body);
  font-size: .74rem;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
.detalhe-aba:hover { color: var(--terracota-texto); }
.detalhe-aba[aria-selected="true"] {
  color: var(--terracota-texto);
  border-bottom-color: var(--terracota);
  font-weight: 500;
}

/* A aba de desempenho é leitura, não formulário: sem bloco branco por dentro. */
.detalhe-corpo[data-aba="desempenho"] .metricas {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 1180px) {
  .detalhe-abas {
    padding: 0;
    background: none;
    margin-top: 1.25rem;
  }
}

/* ════════════════════════════════════════════════════════
   ABA DE DESEMPENHO
   ════════════════════════════════════════════════════════ */
.metricas-periodo {
  display: inline-flex;
  gap: .15rem;
  padding: .2rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-section);
}

.periodo-opcao {
  padding: .38rem .85rem;
  border: none;
  border-radius: 50px;
  background: none;
  font-family: var(--f-body);
  font-size: .72rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.periodo-opcao:hover { color: var(--terracota-texto); }
.periodo-opcao[aria-pressed="true"] {
  background: var(--bg-alt);
  color: var(--terracota-texto);
  font-weight: 500;
}

/* ── Seções ── */
.metricas-secao {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.metricas-secao-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .7rem;
}
.metricas-secao-topo .metricas-subtitulo { margin-bottom: 0; }

.metricas-subtitulo {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: .7rem;
}

/* Diz o que o número quer dizer, para ninguém traduzir de cabeça. */
.metrica-explicacao {
  display: block;
  font-size: .7rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin-top: .3rem;
}

/* ── Gráfico dia a dia ── */
.grafico-opcoes { display: inline-flex; gap: .3rem; }

.grafico-opcao {
  padding: .25rem .6rem;
  border: 1px solid transparent;
  border-radius: 50px;
  background: none;
  font-family: var(--f-body);
  font-size: .72rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.grafico-opcao:hover { color: var(--terracota-texto); }
.grafico-opcao[aria-pressed="true"] {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--terracota-texto);
}

.grafico-topo {
  display: flex;
  justify-content: flex-end;
  font-size: .7rem;
  color: var(--text-muted);
  margin-bottom: .3rem;
}

/* `preserveAspectRatio: none` estica o desenho na largura da coluna; a altura
   fica fixa aqui para a barra não virar um fio nem uma torre. */
.grafico svg {
  display: block;
  width: 100%;
  height: 120px;
  overflow: visible;
}
.grafico-barra {
  fill: var(--terracota);
  opacity: .8;
  transition: opacity .15s ease;
}
.grafico-barra:hover { opacity: 1; }

.grafico-eixo {
  display: flex;
  justify-content: space-between;
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .35rem;
  font-variant-numeric: tabular-nums;
}

.grafico-vazio {
  padding: 1.5rem 0;
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--raio-sm);
}

/* ── Recortes: buscas, aparelhos, cidades ── */
.recorte {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

/* O nome pode ser longo e a coluna é estreita: ele encolhe, os números não. */
.recorte li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  font-size: .8rem;
}

.recorte-nome {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recorte-numeros {
  flex: none;
  font-size: .72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.recorte-com-barra li { align-items: center; }
.recorte-barra {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-alt);
  overflow: hidden;
}
.recorte-barra > span {
  display: block;
  height: 100%;
  background: var(--terracota);
  opacity: .65;
}

.metricas-legenda {
  font-size: .72rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 1.5rem;
  padding-top: .8rem;
  border-top: 1px solid var(--border);
}

.metricas-nota {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .5rem;
}

.metricas-recado {
  padding: 1.5rem 0;
  font-size: .82rem;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════
   Seletor de opção
   --------------------------------------------------------
   Substitui o `<select>`, cujo menu é desenhado pelo sistema
   operacional e ignora todo token daqui. Ver comum/js/seletor.js.
   ════════════════════════════════════════════════════════ */
.seletor { position: relative; }

.seletor-botao {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .72rem .9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-alt);
  font-family: var(--f-body);
  font-size: .92rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.seletor-botao:hover { border-color: var(--terracota-texto); }
.seletor-botao:focus-visible,
.seletor-botao[aria-expanded="true"] {
  outline: none;
  border-color: var(--terracota-texto);
  box-shadow: 0 0 0 1px var(--terracota-texto);
}

.seletor-valor,
.seletor-opcao-conteudo {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex: 1;
  min-width: 0;
}

.seletor-valor {
  overflow: hidden;
}

.seletor-seta { display: flex; flex: none; color: var(--text-muted); }
.seletor-seta svg { width: 16px; height: 16px; }
.seletor-botao[aria-expanded="true"] .seletor-seta { transform: rotate(180deg); }

.seletor-lista {
  position: absolute;
  z-index: 40;
  top: calc(100% + .3rem);
  left: 0;
  right: 0;
  max-height: 15rem;
  overflow-y: auto;
  margin: 0;
  padding: .3rem;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-section);
  box-shadow: 0 12px 32px rgba(74, 46, 26, .14);
}

.seletor-opcao {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .6rem;
  border-radius: 7px;
  font-size: .9rem;
  cursor: pointer;
}
/* Realce vem do teclado e do mouse pelo mesmo caminho, então é uma classe
   só: dois estados visuais para a mesma ideia confundiriam a leitura. */
.seletor-opcao.realcada { background: var(--bg-alt); }
.seletor-opcao[aria-selected="true"] { color: var(--terracota-texto); font-weight: 500; }

.seletor-opcao-marca { display: flex; flex: none; width: 14px; opacity: 0; }
.seletor-opcao-marca svg { width: 14px; height: 14px; }
.seletor-opcao[aria-selected="true"] .seletor-opcao-marca { opacity: 1; }

.seletor-opcao-logo {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  overflow: hidden;
  background: transparent;
}
.seletor-opcao-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }

.seletor-opcao-rotulo {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Nada de `overflow: visible` aqui para a lista do seletor não ser cortada:
   `.dialogo-card` precisa do `overflow-y: auto` que ele já tem, senão um
   formulário alto passa do fim da tela e o botão de salvar fica inalcançável.
   Quem resolve o corte é `posicionar()`, em seletor.js, que mede o contêiner
   que rola, vira a lista para cima quando não cabe e limita a altura dela. */

/* A lista sobe quando não cabe para baixo. Ver `posicionar()` em seletor.js. */
.seletor-lista--acima {
  top: auto;
  bottom: calc(100% + .3rem);
}
