/*
  Fonte Havelock: e uma fonte paga (XO Type Co), nao esta no Google Fonts.
  Se voce tiver a licenca, coloque os arquivos .woff2 em /public/fonts/
  e descomente o @font-face abaixo. Ate la, o "font-family: Havelock..."
  cai automaticamente no fallback (Montserrat em caixa alta).
*/
/*
@font-face {
  font-family: 'Havelock Titling';
  src: url('/fonts/HavelockTitling-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
*/

:root {
  --preto: #000000;
  --cinza-texto: #4a4a4a;
  --cinza-borda: #e2e2e2;
  --bg: #ffffff;
  --bg-painel: #fafafa;

  --g1: #FF9E1C;
  --g2: #FF6600;
  --g3: #EF7D00;
  --g4: #FF1700;
  --g5: #FF0A00;
  --g6: #AF008E;
  --gradiente: linear-gradient(135deg, var(--g1) 0%, var(--g2) 22%, var(--g3) 42%, var(--g4) 64%, var(--g5) 80%, var(--g6) 100%);

  --font-display: 'Havelock Titling', 'Montserrat', sans-serif;
  --font-logo: 'Fredoka', 'Montserrat', sans-serif;
  --font-corpo: 'Montserrat', sans-serif;

  --header-h: 64px;
  --footer-h: 96px;
}

* { box-sizing: border-box; }
html, body {
  min-height: 100%;
  margin: 0;
  /*overflow: hidden;  /* rolagem de pagina */
}
body {
  padding-top: var(--header-h) !important;
  font-family: var(--font-corpo);
  background: white;
  background-attachment: fixed;
  color: var(--preto);
}

/* ---------- Header fixo ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
}
.site-header-logo {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #ffffff;
}
.site-header-auth {
  display: flex;
  gap: 10px;
}
.auth-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #ffffff;
  font-family: var(--font-corpo);
  font-weight: 300;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
}
.auth-btn:hover, .auth-btn.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.auth-dropdown {
  position: fixed;
  top: var(--header-h);
  right: 24px;
  width: 230px;
  background: #ffffff;
  color: var(--preto);
  border-radius: 0 0 10px 10px;
  padding: 16px;
  box-shadow: 0 14px 28px rgba(0,0,0,0.25);
  display: none;
  z-index: 49;
}
.auth-dropdown.open { display: block; }
.auth-dropdown-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--preto);
}
.auth-dropdown input {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--cinza-borda);
  border-radius: 5px;
  font-size: 12px;
  font-family: var(--font-corpo);
}
.auth-dropdown-submit {
  width: 100%;
  padding: 9px;
  border: none;
  border-radius: 5px;
  background: var(--preto);
  color: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-corpo);
}
.auth-dropdown-status {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--cinza-texto);
}

/* ---------- Area de conteudo entre header e footer ---------- */
.page-main {
  position: relative;

  /* não é mais fixed */
  top: auto;
  bottom: auto;
  left: auto;
  right: auto;

  width: 100%;
  
  /* não cria uma rolagem interna */
  overflow: visible;

  display: flex;
  flex-direction: column;

  /* espaço inicial para o header */
  padding-top: 0;
   padding-bottom: var(--footer-h); 
}
/*---------------------------------------------*/


.hero-boxes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 720px));
  gap: 44px;
  justify-content: center;
  width: 100%;
  max-width: 1484px;
  margin: 0 auto;
}

.story-box {
  background: #ffffff;
  padding: 26px 28px;
  width: 100%;
  min-height: 640px;
  box-sizing: border-box;
  border-top: 4px solid transparent;
  border-image: var(--gradiente) 1;
  cursor: pointer;
}

.story-box.expanded {
  width: 100%;
  min-height: 240px;
  max-height: 55vh;
  overflow-y: auto;
  transform: none !important;
  z-index: 5;
}

.story-box-title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 59px;
  color: var(--preto);
  margin: 0 0 12px;
  line-height: 1.25;
}

.story-box-start {
  font-size: 44px;
  font-weight: 500;
  color: var(--preto);
  margin: 0 0 6px;
  line-height: 1.6;
}

.story-box-rest {
  font-size: 32px;
  font-weight: 400;
  color: var(--cinza-texto);
  margin: 0;
  line-height: 1.6;
}

.story-box-full {
  display: none;
  font-size: 13px;
  font-weight: 400;
  color: var(--preto);
  line-height: 1.75;
  white-space: pre-wrap;
}

.story-box-hint {
  margin-top: 12px;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b8b8b8;
  font-weight: 600;
}

/* TELA PEQUENA: 1 POR LINHA */
@media (max-width: 768px) {
  .hero-title {
   
    font-size: 33px !important;

    left: 0px;
   
    
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    text-align: center;
  }

  h2 {
    font-size: 13px;
  }

  .hero-boxes {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 0 20px;
    box-sizing: border-box;
    width: 100%;
  }

  .story-box {
    width: 100%;
    min-height: 20px;
    box-sizing: border-box;

    /* Evita que o conteúdo ultrapasse a caixa */
    overflow: hidden;
  }

  /* Mantém os tamanhos das fontes */
.story-box-title {
  font-size: 20px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  text-align: center;
}

  .story-box-start {
    font-size: 10px;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    text-align: center;
  }

  .story-box-rest {
    font-size: 6px;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .story-box-hint {
    font-size: 3px;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
}
/* ---------- Elementos comuns ---------- */
.brand-bar {
  height: 4px;
  width: 64px;
  background: var(--cinza-texto);
  border-radius: 2px;
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 60px;
  text-align: center;
  margin: 0 0 4px;
  background: var(--gradiente);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}


h1 { 
  font-family: var(--font-display); 
  font-weight: 700; 
  text-transform: uppercase; 
  letter-spacing: 0.03em; 
  font-size: 20px; 
  margin: 0 0 4px; 
  color: black; 
}
.subtitle {
  font-size: 13px;
  color: var(--cinza-texto);
  margin: 0 0 24px;
  font-weight: 400;
}
.panel {
  background: var(--bg-painel);
  border: 1px solid var(--cinza-borda);
  border-radius: 10px;
  padding: 20px;

}
label {
  display: block;
  font-family: var(--font-corpo);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--preto);
  margin: 18px 0 6px;
}
label:first-of-type { margin-top: 0; }
input[type=text], select, textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--cinza-borda);
  border-radius: 6px;
  color: var(--preto);
  font-family: var(--font-corpo);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
}
input[type=text]:focus, select:focus, textarea:focus {
  border-color: var(--g2);
  box-shadow: 0 0 0 3px rgba(255,102,0,0.12);
}
textarea { resize: vertical; min-height: 64px; }
.char-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.char-row input { flex: 1; }
.btn-add {
  width: 100%;
  margin-top: 4px;
  padding: 9px 12px;
  background: transparent;
  border: 1px dashed #b8b8b8;
  border-radius: 6px;
  color: var(--cinza-texto);
  font-family: var(--font-corpo);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
}
.btn-add:hover { border-color: var(--g2); color: var(--g2); }
.char-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.char-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--cinza-borda);
  border-left: 3px solid var(--g2);
  border-radius: 6px;
  padding: 8px 10px;
}
.char-chip .name { font-weight: 600; font-size: 13px; color: var(--preto); }
.char-chip .role { font-size: 12px; color: var(--cinza-texto); flex: 1; }
.char-chip button {
  background: none;
  border: none;
  color: var(--cinza-texto);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
}
.char-chip button:hover { color: var(--g5); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.generate-btn {
  width: 100%;
  margin-top: 24px;
  padding: 13px;
  background: var(--gradiente);
  border: none;
  border-radius: 30px;
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 14px;
  cursor: pointer;
}
.generate-btn:hover { filter: brightness(1.05); }
.generate-btn:disabled { background: #c9c9c9; cursor: default; filter: none; }

.error-box {
  display: none;
  margin-top: 14px;
  background: #fff2ee;
  border: 1px solid var(--g4);
  color: var(--g5);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 500;
}


.app {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 28px;

  width: 100%;
  height: 10000x;

  padding: 24px 20px;
  box-sizing: border-box;

  overflow: hidden;
}

.left {
  min-height: 0;
  overflow: hidden;
}

.right {
  min-height: 0;
  overflow-y: auto;
}


@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;   /* uma coluna só */
    grid-template-rows: auto auto;
    height: auto;                  /* já que agora empilha, altura fixa não faz sentido */
    padding: 16px 12px;
    gap: 20px;
    overflow: visible;
    font-size: 1.15rem;            /* aumenta o texto geral */
  }

  .left {
    order: 1;                      /* fica em cima */
    overflow: visible;
  }

  .right {
    order: 2;                      /* fica embaixo */
    overflow-y: visible;
  }


  .manuscript-title { font-size: 24px; }
  .manuscript-text  { font-size: 16px; }
  .manuscript-meta  { font-size: 13px; }
  .manuscript-page  { padding: 28px 24px;}
}


.manuscript-wrap {
  background: var(--bg-painel);
  border: 1px solid var(--cinza-borda);
  border-radius: 10px;
  padding: 22px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
.manuscript-page {
  background: #ffffff;
  color: var(--preto);
  border: 1px solid var(--cinza-borda);
  border-top: 4px solid transparent;
  border-image: var(--gradiente) 1;
  border-radius: 4px;
  padding: 40px 44px;
  flex: 1;
  position: relative;
}
.manuscript-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #9a9a9a;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 14px;
  padding: 40px;
}
.manuscript-title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 21px;
  margin: 0 0 4px;
  color: var(--preto);
}
.manuscript-meta {
  font-size: 12px;
  color: var(--cinza-texto);
  margin: 0 0 22px;
  font-family: var(--font-corpo);
  font-weight: 500;
}
.manuscript-text {
  font-family: var(--font-corpo);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.85;
  color: var(--preto);
  white-space: pre-wrap;
}
.manuscript-text p { margin: 0 0 16px; opacity: 0; animation: reveal 0.5s ease forwards; }
@keyframes reveal { to { opacity: 1; } }

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.actions button {
  flex: 1;
  padding: 11px;
  border-radius: 6px;
  font-family: var(--font-corpo);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--preto);
  background: transparent;
  color: var(--preto);
}
.actions button:hover { background: var(--preto); color: #ffffff; }
.actions .hint {
  font-size: 12px;
  color: var(--cinza-texto);
  align-self: center;
  flex: none;
}
.loading { color: var(--cinza-texto); font-family: var(--font-corpo); font-size: 13px; }

.modal-fundo {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 999;
   /* escurece o conteúdo atrás */
  background: rgba(0, 0, 0, 0.6);

  /* deixa o que está atrás borrado */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* impede interação com a página atrás */
  overflow: hidden;
}
.modal-caixa {
  background: #fff; border-radius: 10px; padding: 32px; max-width: 380px; text-align: center;
}
.modal-caixa h2 { font-family: var(--font-display); margin: 0 0 8px; }
.modal-caixa button { display: block; width: 100%; margin-top: 12px; padding: 12px; border-radius: 6px; cursor: pointer; font-weight: 600; }
#modal-assinar { background: var(--g2); color: #fff; border: none; }
#modal-fechar { background: transparent; border: 1px solid #ccc; }

.modal-caixa p {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cinza-texto);
}
.modal-caixa button { display: block; width: 100%; margin-top: 12px; padding: 12px; border-radius: 6px; cursor: pointer; font-weight: 600; font-family: var(--font-corpo); font-size: 13px; }
.modal-caixa button:first-of-type { margin-top: 0; }

.btn-primario { background: var(--g2); color: #fff; border: none; }
.btn-primario:hover { filter: brightness(1.05); }
.btn-secundario { background: transparent; border: 1px solid #ccc; color: var(--preto); }
.btn-secundario:hover { border-color: var(--preto); }
.btn-terciario { background: transparent; border: none; color: var(--cinza-texto); text-decoration: underline; font-weight: 500 !important; }

.modal-caixa input[type=email],
.modal-caixa input[type=password],
.modal-caixa input[type=text],
.modal-caixa input[type=number] {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--cinza-borda);
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-corpo);
  color: var(--preto);
  outline: none;
}
.modal-caixa input[type=email]:focus,
.modal-caixa input[type=password]:focus,
.modal-caixa input[type=text]:focus,
.modal-caixa input[type=number]:focus {
  border-color: var(--g2);
  box-shadow: 0 0 0 3px rgba(255,102,0,0.12);
}
.modal-erro {
  color: var(--g5) !important;
  font-size: 12px !important;
  margin: -2px 0 12px !important;
  text-align: left;
}

/* mantidos por compatibilidade, caso algum outro trecho ainda referencie estes ids */
#modal-assinar { background: var(--g2); color: #fff; border: none; }
#modal-fechar { background: transparent; border: 1px solid #ccc; }

/* ---------- Footer fixo ---------- */
.site-footer {
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(135deg, #AF008E 0%, #FF0A00 38%, #FF1700 66%, #FF9E1C 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 40;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  -webkit-backface-visibility: hidden;
}
.site-footer-text {
  color: #ffffff;
  font-size: 11px;
  font-weight: 400;
  max-width: 340px;
  line-height: 1.5;
  opacity: 0.9;
  margin: 0;
}
.site-footer-btn {
  background: #ffffff;
  color: var(--preto);
  border: none;
  border-radius: 30px;
  padding: 12px 26px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.site-footer-btn:hover { filter: brightness(0.97); }

/* home: texto esquerda, botão direita (ordem natural) */
.footer-home { flex-direction: row; }
/* gerador: botão esquerda, texto direita (inverte) */
.footer-gerador { flex-direction: row-reverse; }



@media (max-width: 768px) {
  .site-footer {
    justify-content: center;
    gap: 20px;
    padding: 0 16px;
  }

  .site-footer-text {
    max-width: 90px;
    font-size: 8px;
  }
  .site-footer-text-center{
    max-width: 90px;
    font-size: 8px;
  }
}



/* ---------- Dropdown de conta (usuário logado) ---------- */
.conta-saldo {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--preto);
  margin: 0 0 14px;
}
#btnSair {
  background: transparent;
  color: var(--preto);
  border: 1px solid var(--cinza-borda);
  margin-top: 8px;
}

#contoTitulo {
  font-family: 'Fredoka', sans-serif;
  font-size: 80px;
  font-weight: 700;
  
  
}

#contoTexto {
  font-family: 'Montserrat', sans-serif;
  font-size: 40px;
  line-height: 1.8;
  width: 100%;
  max-width: 1000px;
  
}


.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
}
.modal-box {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  width: 90%;
  max-width: 380px;
  position: relative;
  text-align: center;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #888;
}
.modal-subtitle {
  color: #666;
  margin-bottom: 14px;
}
.pix-opcoes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pix-opcao {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e2e2e2;
  background: #fafafa;
  cursor: pointer;
  font-size: 15px;
}
.pix-opcao:hover {
  border-color: #FF0A00;
}
#areaPix img {
  margin: 10px 0;
}
#areaPix textarea {
  border-radius: 8px;
  border: 1px solid #e2e2e2;
  padding: 8px;
  font-size: 12px;
  resize: none;
  height: 70px;
}
#statusPix {
  font-size: 14px;
  color: #666;
  margin-top: 8px;
}
.conto-leitura {
  width: 100%;
  height: 100vh;
  box-sizing: border-box;
  padding: 20px;

  display: flex;
  justify-content: center;
  align-items: center;

  overflow: hidden;
}

.conto-card {
  width: 100%;
  
  max-height: calc(100vh - 20px);

  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;

  padding: 20px;
}

.manuscript-conto {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

@media (max-width: 768px) {
 #contoTitulo {
  font-family: 'Fredoka', sans-serif;
  font-size: 40px;
  font-weight: 700;
  
  
}

#contoTexto {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  line-height: 1.8;
  width: 1000px;
  
}
}

/*----MODAIS COMENTARIO E CURTIDA -----*/
.btn-curtida.curtido {
  color: #e63950;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.ativo {
  display: flex;
}
.modal-box {
  background: #1f1f1f;
  padding: 24px;
  border-radius: 12px;
  min-width: 280px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  color: #fff;
  cursor: pointer;
}
.modal-titulo {
  margin: 0 0 16px;
  color: #fff;
}
.modal-opcoes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-opcao {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.modal-lista-comentarios {
  max-height: 320px;
  overflow-y: auto;
}
.modal-voltar {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  margin-bottom: 12px;
  font-size: 14px;
}
.comentario-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.comentario-autor {
  font-weight: 600;
  color: #fff;
  font-size: 14px;
}
.comentario-texto {
  color: #ddd;
  font-size: 14px;
  margin-top: 4px;
}
.comentario-vazio {
  color: #999;
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}

.modal-escrever {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-textarea {
  min-height: 120px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  resize: vertical;
  font-family: inherit;
  font-size: 15px;
}

/* ---------- Barra de rolagem (conto e lista de comentários) ---------- */
.conto-card,
.modal-lista-comentarios {
  scrollbar-width: thin;
  scrollbar-color: var(--g2) transparent;
}

.conto-card::-webkit-scrollbar,
.modal-lista-comentarios::-webkit-scrollbar {
  width: 3px;
}

.conto-card::-webkit-scrollbar-track,
.modal-lista-comentarios::-webkit-scrollbar-track {
  background: transparent;
}

.conto-card::-webkit-scrollbar-thumb,
.modal-lista-comentarios::-webkit-scrollbar-thumb {
  background: var(--g2);
  border-radius: 6px;
}

.conto-card::-webkit-scrollbar-thumb:hover {
  background: var(--g4);
}

/* ---------- Botoes de curtida e comentario (conto.html): fixos abaixo do header ---------- */
.btn-curtida,
.btn-comentario {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 45;                  /* acima do conteudo, abaixo do cabecalho (50) */
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  color: var(--preto);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-curtida    { left: 12px; }
.btn-comentario { left: 66px; }   /* ao lado da curtida */

.btn-curtida.curtido { color: #e63950; }

/* espaco no topo do conto para os botoes nao cobrirem o titulo ao abrir a pagina */
.conto-card { padding-top: 56px; }
@media (max-width: 600px) {
  :root { --header-h: 72px; }

  .site-header {
    height: var(--header-h);
    padding: 0 12px;
  }

  .site-header-logo {
    font-size: 16px;
    line-height: 1.15;
  }
}


/* ---------- Layout em blocos: cabecalho / conteudo rolavel / rodape ---------- */
html { height: 100%; }

body {
  position: relative;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 0 !important;      /* o cabecalho agora ocupa espaco proprio */
}

.site-header {
  position: relative;
  flex: 0 0 var(--header-h);
}

.page-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0;
}

.site-footer {
  position: relative;
  flex: 0 0 60px;
  transform: none;
  will-change: auto;
}

/* o que antes era "fixed" passa a se posicionar dentro do body */
.auth-dropdown,
.modal-fundo,
.modal-overlay,
.btn-curtida,
.btn-comentario { position: absolute; }

/* pagina do conto: a altura agora vem do .page-main, nao da tela */
.conto-leitura { height: 100%; }
.conto-card { max-height: 100%; }

/* gerador: altura invalida no original */
.app { height: auto; }
#btnPerfil { display: none; }

html, body { overflow-x: hidden; max-width: 100%; }

.conto-leitura,
.conto-card,
.manuscript-conto,
#contoTexto { max-width: 100%; }
/* faixa propria para curtida/comentario, abaixo do cabecalho e fora da area que rola */
.conto-acoes {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;   /* centraliza os dois botoes */
  gap: 16px; 
  padding: 2px 6px;
  background: #ffffff;
}

.btn-curtida,
.btn-comentario {
  position: static;   /* deixa de flutuar */
}

.conto-card { padding-top: 20px; }   /* era 56px, nao precisa mais */
@media (max-width: 768px) {
  .site-footer {
    gap: 8px;
    padding: 0 10px;
  }

  .site-footer-btn {
    padding: 10px 14px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .site-footer-text,
  .site-footer-text-center {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 80px;
    font-size: 8px;
    overflow-wrap: anywhere;   /* o email longo quebra em vez de empurrar os botoes */
  }
}
