/* ════════════════════════════════════════════════════════
   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:#b5704a;
  --argila:   #8c5a3c;
  --mogno:    #4a2e1a;
  --cinza:    #5c534c;
  --branco:   #faf8f4;
  --sombra:   rgba(74,46,26,.10);

  --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);
  --text-muted:   var(--cinza);
  --border:       var(--areia);

  /* Tokens exclusivos do painel */
  --sucesso: #3f7d58;
  --alerta:  #a8522f;
  --raio:    10px;
  --raio-sm: 7px;
  --sidebar: 286px;
}

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

body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--f-body);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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: .68rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--terracota);
}

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

/* ════════════════════════════
   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); }

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

.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: 300;
  line-height: 1.2;
}
.login-card h1 em { font-style: italic; color: var(--terracota); }

.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; }

/* ════════════════════════════
   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;
  border-radius: 50%;
  flex: none;
}
.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); }
.marca-papel {
  font-size: .62rem;
  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: .62rem;
  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);
  font-weight: 500;
}
.nav-item[aria-current="page"] svg { opacity: 1; }

.nav-item:disabled {
  opacity: .4;
  cursor: default;
}
.nav-item:disabled:hover { background: none; }

.nav-em-breve {
  margin-left: auto;
  padding-left: .5rem;
  font-size: .58rem;
  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: 300;
  line-height: 1.15;
}
.cabecalho h2 em { font-style: italic; color: var(--terracota); }
.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);
  opacity: .55;
  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: 400;
  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: .6rem;
  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-rascunho  { color: var(--alerta);  border-color: currentColor; }
.selo-destaque  { color: var(--terracota); border-color: currentColor; }

/* ── Estados ── */
.vazio, .carregando {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--raio);
}
.vazio h3 {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 300;
  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: .68rem;
  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 select,
.campo textarea {
  width: 100%;
  font-family: var(--f-body);
  font-size: .95rem;
  font-weight: 300;
  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);
}

.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); background: var(--bg-alt); }
.editor-botao[aria-pressed="true"] { color: var(--terracota); 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: 300;
  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); 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); }
.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: .68rem;
  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;
  background: var(--bg-alt);
  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); }

.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: .64rem;
  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: 300;
}
.previa-titulo em { font-style: italic; color: var(--terracota); }

.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); }
.previa-larguras button[aria-pressed="true"] {
  color: var(--terracota);
  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); }
.recorte-proporcoes button[aria-pressed="true"] {
  color: var(--terracota);
  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) {
  .painel { grid-template-columns: minmax(0, 1fr); }
  .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: .56rem; 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: .66rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terracota);
  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);
  opacity: .45;
}
.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);
  background: var(--bg-section);
}
.capa-vazia svg { width: 26px; height: 26px; }
.capa-vazia span { font-size: .85rem; }
.capa-vazia small { font-size: .72rem; opacity: .75; }

.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;
}

/* 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;
}
