@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

/* Tooltip — adicione data-tip="explicação" a qualquer botão/link para ativar.
   Por padrão aparece ABAIXO do elemento (evita cortar em botões perto do topo da tela,
   como barras de ação de painel). Use data-tip-up num elemento perto do rodapé da tela
   se precisar que a dica abra para cima em vez de para baixo. */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #1b1b1f;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 7px 11px;
  border-radius: 6px;
  white-space: normal;
  width: max-content;
  max-width: 240px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 200;
  box-shadow: 0 8px 20px rgba(27,27,31,0.25);
  transition: opacity 0.15s ease 0.15s, transform 0.15s ease 0.15s, visibility 0.15s ease 0.15s;
}
[data-tip]::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  border: 5px solid transparent;
  border-bottom-color: #1b1b1f;
  margin-top: -1px;
  opacity: 0;
  visibility: hidden;
  z-index: 200;
  pointer-events: none;
  transition: opacity 0.15s ease 0.15s, transform 0.15s ease 0.15s, visibility 0.15s ease 0.15s;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after,
[data-tip]:hover::before, [data-tip]:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
[data-tip-right]::after, [data-tip-right]::before { left: auto; right: 0; }
[data-tip-right]::after { transform: translateY(-4px); }
[data-tip-right]:hover::after, [data-tip-right]:focus-visible::after { transform: translateY(0); }
[data-tip-right]::before { right: 10px; transform: translateY(-4px); }
[data-tip-right]:hover::before, [data-tip-right]:focus-visible::before { transform: translateY(0); }

/* Variante para elementos perto do rodapé da tela (ex.: botão "Sair" no fim do menu lateral) */
[data-tip-up]::after { top: auto; bottom: calc(100% + 9px); transform: translateX(-50%) translateY(4px); }
[data-tip-up]:hover::after, [data-tip-up]:focus-visible::after { transform: translateX(-50%) translateY(0); }
[data-tip-up]::before { top: auto; bottom: 100%; border-bottom-color: transparent; border-top-color: #1b1b1f; margin-top: 0; margin-bottom: -1px; transform: translateX(-50%) translateY(4px); }
[data-tip-up]:hover::before, [data-tip-up]:focus-visible::before { transform: translateX(-50%) translateY(0); }
[data-tip-up][data-tip-right]::after { transform: translateY(4px); }
[data-tip-up][data-tip-right]:hover::after { transform: translateY(0); }
[data-tip-up][data-tip-right]::before { transform: translateY(4px); }
[data-tip-up][data-tip-right]:hover::before { transform: translateY(0); }

:root {
  --ink: #1b1b1f;
  --ink-soft: #33333a;
  --cream: #faf6ef;
  --cream-dark: #f0e9db;
  --paper: #fffdf9;
  --gold: #a8823c;
  --gold-dark: #8a6a2c;
  --burgundy: #6b2737;
  --line: #e4dcc8;
  --success: #3a6b4a;
  --danger: #a83c3c;
  --shadow: 0 10px 30px rgba(27, 27, 31, 0.08);
  --radius: 6px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}
p { margin: 0 0 1em; }
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 12px;
  display: inline-block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-family: var(--sans);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--burgundy); }
.btn-gold { background: var(--gold); color: var(--paper); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-outline-light { background: transparent; border-color: rgba(255,255,255,0.5); color: #fff; }
.btn-revisado-ok { background: #e9f7ec; border-color: #bfe6c9; color: var(--success); }
.btn-revisado-ok:hover { background: var(--success); color: #fff; }
.btn-revisado-pendente { background: #fff3c4; border-color: #f0d98c; color: #8a6d00; }
.btn-revisado-pendente:hover { background: #8a6d00; color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,0.12); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
button.btn { font-family: var(--sans); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 246, 239, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(27,27,31,0.06);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
.site-header.scrolled {
  background: rgba(250, 246, 239, 0.96);
  box-shadow: 0 8px 24px rgba(27,27,31,0.06);
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: 1240px; margin: 0 auto; gap: 20px;
}
.logo {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 700;
  letter-spacing: 0.04em; white-space: nowrap; flex-shrink: 0;
  transition: opacity 0.2s ease;
}
.logo:hover { opacity: 0.72; }
.logo img { height: 44px; width: auto; display: block; }

.main-nav { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.main-nav > a {
  position: relative; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft);
  padding: 9px 14px; border-radius: 999px; white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
.main-nav > a:hover { color: var(--ink); background: rgba(27,27,31,0.05); }
.main-nav > a.active { color: var(--gold-dark); }

.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  display: flex; align-items: center; gap: 4px; font-family: var(--sans);
  font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); background: none; border: none;
  padding: 9px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-dropdown-trigger:hover { color: var(--ink); background: rgba(27,27,31,0.05); }
.nav-dropdown .chevron { font-size: 0.75rem; transition: transform 0.2s ease; transform: translateY(-1px); }
.nav-dropdown.open .chevron { transform: rotate(180deg) translateY(1px); }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-6px);
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(27,27,31,0.14); padding: 8px; min-width: 200px;
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  font-size: 0.88rem; font-weight: 500; color: var(--ink-soft); padding: 10px 12px;
  border-radius: 8px; white-space: nowrap; transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown-menu a:hover { background: var(--cream-dark); color: var(--ink); }

.nav-actions { display: flex; gap: 10px; align-items: center; margin-left: 6px; }

.nav-toggle {
  display: none; position: relative; width: 40px; height: 40px; background: none; border: none;
  cursor: pointer; flex-shrink: 0; border-radius: 8px;
}
.nav-toggle:hover { background: rgba(27,27,31,0.05); }
.nav-toggle span {
  position: absolute; left: 9px; width: 22px; height: 2px; background: var(--ink);
  border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 19px; }
.nav-toggle span:nth-child(3) { top: 24px; }
.nav-toggle.open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 1180px) {
  .main-nav {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 84vw);
    background: var(--paper); box-shadow: -20px 0 50px rgba(27,27,31,0.18);
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    padding: 88px 20px 32px; gap: 4px; overflow-y: auto;
    transform: translateX(100%); transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav > a { padding: 14px 16px; font-size: 1rem; border-radius: 10px; }
  .nav-dropdown-trigger { width: 100%; justify-content: space-between; padding: 14px 16px; font-size: 1rem; border-radius: 10px; }
  .nav-dropdown-menu {
    position: static; transform: none; box-shadow: none; border: none; background: var(--cream-dark);
    margin: 2px 0 6px; opacity: 1; visibility: visible; pointer-events: auto; display: none; min-width: 0;
  }
  .nav-dropdown.open .nav-dropdown-menu { display: flex; }
  .nav-actions { flex-direction: column; align-items: stretch; margin: 16px 0 0; gap: 10px; }
  .nav-actions .btn { width: 100%; }
  .nav-toggle { display: block; }
  body.nav-open { overflow: hidden; }
}

body.nav-open::after {
  content: ''; position: fixed; inset: 0; background: rgba(27,27,31,0.35);
  z-index: 90; animation: navBackdropIn 0.25s ease;
}
@keyframes navBackdropIn { from { opacity: 0; } to { opacity: 1; } }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--ink) 0%, #2b2530 60%, var(--burgundy) 130%);
  color: #fff; padding: 120px 0 100px; position: relative; overflow: hidden;
}
.hero .container { position: relative; z-index: 2; max-width: 780px; }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: 24px; }
.hero p.lead { font-size: 1.15rem; color: rgba(255,255,255,0.82); max-width: 640px; }
.hero .actions { display: flex; gap: 16px; margin-top: 36px; flex-wrap: wrap; }

section { padding: 90px 0; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.grid {
  display: grid; gap: 28px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 12px; }
.card-icon {
  width: 48px; height: 48px; border-radius: 50%; background: var(--cream-dark);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  color: var(--gold-dark); font-size: 1.3rem;
}

.author-card { text-align: center; }
.author-avatar-link { display: inline-block; transition: transform 0.2s ease; }
.author-avatar-link:hover { transform: scale(1.05); }
.author-avatar {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 18px; display: block; border: 3px solid var(--cream-dark);
  box-shadow: var(--shadow);
}
.author-avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: #fff; font-family: var(--serif); font-size: 1.8rem; font-weight: 700;
}

.pillars { display: flex; flex-wrap: wrap; gap: 14px; }
.pillar-tag {
  border: 1px solid var(--gold); color: var(--gold-dark); border-radius: 999px;
  padding: 8px 18px; font-size: 0.85rem; font-weight: 600;
}

.dark-section { background: var(--ink); color: #fff; }
.dark-section h2, .dark-section h3 { color: #fff; }
.dark-section .section-head p { color: rgba(255,255,255,0.75); }

.journey-steps { display: flex; flex-direction: column; gap: 0; }
.journey-step { display: flex; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.journey-step:last-child { border-bottom: none; }
.journey-num { font-family: var(--serif); font-size: 1.8rem; color: var(--gold); min-width: 56px; }

.plan-card {
  background: var(--ink); color: #fff; border-radius: 10px; padding: 48px;
  text-align: center; max-width: 640px; margin: 0 auto; box-shadow: var(--shadow);
}
.plan-price { font-family: var(--serif); font-size: 3rem; margin: 12px 0; color: var(--gold); }
.plan-note { font-size: 0.85rem; color: rgba(255,255,255,0.65); }

.phase-block { margin-bottom: 40px; }
.phase-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.phase-title .eyebrow { margin: 0; }
.phase-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.phase-list li { padding-left: 24px; position: relative; font-size: 0.95rem; color: var(--ink-soft); }
.phase-list li::before { content: '—'; position: absolute; left: 0; color: var(--gold); }
@media (max-width: 700px) { .phase-list { grid-template-columns: 1fr; } }

.empty-state {
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 60px 24px;
  text-align: center; color: var(--ink-soft); background: var(--paper);
}

.faq-item { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq-item summary { cursor: pointer; font-weight: 600; font-family: var(--serif); font-size: 1.1rem; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; color: var(--gold); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin-top: 12px; color: var(--ink-soft); }

.site-footer { background: var(--ink); color: rgba(255,255,255,0.7); padding: 60px 0 30px; }
.site-footer .logo-footer { background: #fff; display: inline-flex; padding: 8px 14px; border-radius: 10px; }
.site-footer .logo-footer img { height: 56px; }
.site-footer h4 { color: #fff; font-size: 1rem; }
.site-footer a { color: rgba(255,255,255,0.65); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 24px; font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* Forms */
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); }
.form-row { margin-bottom: 20px; }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .form-row.two { grid-template-columns: 1fr; } }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--sans); font-size: 0.95rem; background: #fff; color: var(--ink);
}
textarea { resize: vertical; min-height: 100px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(168,130,60,0.15); }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input { width: auto; margin-top: 4px; }
.checkbox-row label { font-weight: 400; margin: 0; }
.field-hint { font-size: 0.8rem; color: #8a8a90; margin-top: 4px; }
.password-field { position: relative; }
.password-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 0.8rem; color: var(--gold-dark); font-weight: 600; }
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--cream); padding: 40px 20px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box .logo { display: block; text-align: center; margin-bottom: 28px; }
.auth-box .logo img { height: 96px; margin: 0 auto; }
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.9rem; }
.alert-error { background: #fbeaea; color: var(--danger); border: 1px solid #f0c8c8; }
.alert-success { background: #eaf3ec; color: var(--success); border: 1px solid #c8e0cd; }
.alert-info { background: #f0ece0; color: var(--gold-dark); border: 1px solid var(--line); }

/* Dashboard layout */
.dash {
  display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; background: var(--cream);
}
.dash-sidebar {
  background: var(--ink); color: #fff; padding: 28px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.dash-sidebar .logo {
  color: #fff; margin-bottom: 32px; display: inline-flex; background: #fff;
  padding: 8px 14px; border-radius: 10px;
}
.dash-sidebar .logo img { height: 48px; }
.dash-nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius); font-size: 0.9rem; color: rgba(255,255,255,0.75); }
.dash-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.dash-nav a.active { background: var(--gold); color: #fff; }
.dash-nav .group-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.4); margin: 18px 0 6px; padding: 0 14px; }

.sidebar-logout-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 14px; margin-top: 4px;
  background: rgba(168,60,60,0.16); border: 1px solid rgba(168,60,60,0.5);
  color: #f3b4b4; font-weight: 700; font-size: 0.88rem; border-radius: var(--radius);
  cursor: pointer; text-align: center; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.sidebar-logout-btn:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.dash-main { padding: 36px 40px; max-width: 1200px; }
.dash-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.dash-topbar h1 { margin: 0; font-size: 1.7rem; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--serif); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
@media (max-width: 1000px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stat-card .num { font-family: var(--serif); font-size: 2rem; margin: 6px 0; }
.stat-card .label { font-size: 0.82rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-bottom: 28px; }
.panel h2, .panel h3 { margin-bottom: 18px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #8a8a90; }
tr:hover td { background: rgba(168,130,60,0.04); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--cream-dark); color: var(--ink-soft); }
.badge-gold { background: #f3e6cb; color: var(--gold-dark); }
.badge-green { background: #dcefe0; color: var(--success); }
.badge-red { background: #fbdede; color: var(--danger); }
.badge-blue { background: #dfe7f5; color: #2f4f8c; }
.badge-yellow { background: #fff3c4; color: #8a6d00; }
.hidden { display: none !important; }
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.progress-bar { height: 8px; background: var(--cream-dark); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--gold); }

.book-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 900px) { .book-list { grid-template-columns: 1fr; } }
.book-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--paper); }
.book-card h3 { margin-bottom: 6px; }

.chapter-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.chapter-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.chapter-row .meta { font-size: 0.8rem; color: #8a8a90; }

.editor-shell { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 1100px) { .editor-shell { grid-template-columns: 1fr; } }
.editor-toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.editor-toolbar button { border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 6px 10px; cursor: pointer; font-size: 0.85rem; }
.editor-toolbar button:hover { background: var(--cream-dark); }
#editorArea .tiptap { width: 100%; min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; font-family: var(--serif); font-size: 1.05rem; line-height: 1.8; background: #fff; }
.editor-status { font-size: 0.8rem; color: #8a8a90; margin-top: 8px; }

.chat-box { display: flex; flex-direction: column; height: 480px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; }
.chat-msg.user { align-self: flex-end; background: var(--ink); color: #fff; }
.chat-msg.assistant { align-self: flex-start; background: var(--cream-dark); }
.listen-btn {
  margin-top: 6px; border: 1px solid var(--gold); background: transparent; color: var(--gold-dark);
  border-radius: 999px; padding: 4px 12px; font-size: 0.76rem; font-weight: 600; cursor: pointer;
}
.listen-btn:hover { background: var(--gold); color: #fff; }
.listen-btn:disabled { opacity: 0.6; cursor: default; }
.chat-input { display: flex; border-top: 1px solid var(--line); padding: 10px; gap: 8px; }
.chat-input textarea { min-height: 42px; }

.voice-indicator {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fbeaea;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--danger);
  font-weight: 600;
}
.voice-indicator-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--danger);
  animation: voicePulse 1s ease-in-out infinite;
  flex-shrink: 0;
}
.voice-indicator-bars {
  display: flex; align-items: center; gap: 3px; height: 28px; margin-left: auto;
}
.voice-indicator-bars span {
  display: block; width: 4px; height: 5px; border-radius: 2px;
  background: var(--danger); transition: height 0.09s ease;
}
@keyframes voicePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.idea-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; background: var(--paper); }
.suggestion-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; background: var(--paper); }
.suggestion-item .actions { display: flex; gap: 8px; margin-top: 10px; }

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 16px; padding: 14px 0; border-left: 2px solid var(--line); padding-left: 20px; margin-left: 10px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: -7px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.timeline-item.done::before { background: var(--success); }
.timeline-item.active::before { background: #e6b800; }

.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; overflow-x: auto; }
.kanban-col { background: var(--cream-dark); border-radius: var(--radius); padding: 14px; min-width: 220px; }
.kanban-col h4 { font-size: 0.82rem; text-transform: uppercase; margin-bottom: 12px; }
.kanban-card { background: #fff; border-radius: 4px; padding: 12px; margin-bottom: 10px; font-size: 0.85rem; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }

@media (max-width: 980px) {
  .dash { grid-template-columns: 1fr; }
  .dash-sidebar { position: relative; height: auto; }
  .dash-main { padding: 24px; }
}

/* Rich chapter editor: visible formatting and a stable editable document. */
.editor-toolbar button[aria-pressed="true"] { background: var(--cream-dark); border-color: var(--gold, #a58443); box-shadow: inset 0 0 0 1px currentColor; }
.editor-shell > div { min-width: 0; }
#editorArea .tiptap { overflow-wrap: anywhere; white-space: pre-wrap; max-height: 70vh; overflow-y: auto; }
#editorArea .tiptap:focus { outline: 2px solid var(--gold, #a58443); outline-offset: 2px; }
#editorArea .tiptap p { margin: 0 0 0.8em; }
#editorArea .tiptap strong { font-weight: 700; }
#editorArea .tiptap em { font-style: italic; }
#editorArea .tiptap h2 { font-size: 1.4em; margin: 1em 0 0.5em; }
#editorArea .tiptap blockquote { border-left: 3px solid var(--gold, #a58443); margin: 1em 0; padding-left: 1em; color: #666; }
#editorArea .tiptap ul, #editorArea .tiptap ol { padding-left: 1.5em; }
#editorArea .tiptap ul { list-style: disc; }
#editorArea .tiptap ol { list-style: decimal; }
#editorArea .tiptap li p { margin: 0; }
#editorArea .tiptap > :last-child { margin-bottom: 0; }

/* Writing ribbon */
.editor-ribbon { display: flex; flex-direction: column; gap: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); overflow: hidden; }
.ribbon-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 14px; background: #f0e9db; }
.ribbon-heading strong { font-family: var(--serif); font-size: 1rem; }
.ribbon-heading span { color: #726751; font-size: .75rem; flex: 1; }
.ribbon-group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 9px 12px; border-top: 1px solid var(--line); }
.ribbon-label { flex: 0 0 80px; color: #756b5b; font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.editor-ribbon button { min-height: 32px; padding: 5px 9px; font-size: .75rem; }
.editor-ribbon button:disabled { opacity: .4; cursor: default; }
.editor-ribbon label { display: flex; gap: 5px; align-items: center; margin: 0; font-size: .72rem; color: #5d5548; }
.editor-ribbon select { width: auto; max-width: 165px; min-height: 32px; padding: 4px 7px; font-size: .75rem; margin: 0; }
.editor-ribbon input[type="color"] { padding: 2px; width: 30px; height: 30px; cursor: pointer; }
.editor-ribbon button:focus-visible, .editor-search button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.editor-search { background: #f0e9db; padding: 14px; border-radius: 8px; margin-bottom: 12px; }
.editor-search[hidden] { display: none; }
.editor-search label { font-size: .8rem; }
.editor-search input { margin: 5px 0 10px; }
.search-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.search-actions button { border: 1px solid var(--line); background: white; border-radius: 4px; padding: 6px 10px; cursor: pointer; }
#findStatus { display: block; margin-top: 8px; font-size: .8rem; }
#editorArea .tiptap mark { background: #fff09a; border-radius: 2px; }
#editorArea .tiptap h1 { font-size: 1.7em; margin: 1em 0 .5em; }
#editorArea .tiptap h3 { font-size: 1.2em; margin: 1em 0 .5em; }
#editorArea .tiptap hr { border: 0; border-top: 1px solid #b7ac98; margin: 1.5em 0; }
#editorArea .tiptap ul ul { list-style: circle; }
.editor-focus-mode { grid-template-columns: 1fr; }
.editor-focus-mode > .dash-sidebar, .editor-focus-mode .editor-shell > div:nth-child(2) { display: none; }
.editor-focus-mode > .dash-main { width: 100%; max-width: 1100px; margin: auto; }
.editor-focus-mode .editor-shell { grid-template-columns: 1fr; }
@media (max-width: 600px) {
  .ribbon-label { flex-basis: 100%; }
  .ribbon-heading span { display: none; }
  .ribbon-heading button { margin-left: auto; }
  .editor-ribbon select { max-width: 140px; }
  #editorArea .tiptap { padding: 18px; }
}

.editor-save-notice { position: fixed; z-index: 1000; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 32px)); padding: 16px 22px; border-radius: 10px; border: 1px solid #b8d7c4; background: #edf8f0; color: #205c37; font-size: .95rem; font-weight: 600; box-shadow: 0 8px 28px #0002; }
.editor-save-notice[hidden] { display: none; }
.editor-save-notice.is-error { background: #fff0ef; border-color: #edb9b4; color: #8a2923; }

.section-create-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: start; margin: 16px 0; }
.section-create-form label { flex: 1 1 170px; font-size: .8rem; }
.section-create-form input, .section-create-form select, .section-organize select { width: 100%; margin-top: 6px; }
.section-create-form > button { align-self: center; }
.section-organize { max-width: 240px; }
.section-organize summary { cursor: pointer; list-style: none; }
.section-organize form { padding: 12px; border: 1px solid var(--line); border-radius: 6px; margin-top: 8px; background: var(--cream); }
.section-organize label { display: block; font-size: .8rem; margin-bottom: 10px; }
#conteudo-livro .chapter-row { flex-wrap: wrap; gap: 12px; }
#conteudo-livro .chapter-row > div { min-width: 160px; }
.section-create-form input[type="number"] { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font: inherit; background: #fff; min-width: 0; }

.section-type-help { display: block; margin-top: 8px; font-weight: 400; line-height: 1.5; color: #68636a; }
.review-progress { display:flex; align-items:center; gap:16px; margin-bottom:18px; padding:20px; border:1px solid #dfc692; border-radius:10px; background:#fff8e8; color:#674b17; }
.review-progress[hidden] { display:none; }
.review-progress p { margin:5px 0; font-size:.9rem; }
.review-progress small { display:block; margin-top:8px; font-variant-numeric:tabular-nums; }
.review-progress-spinner { width:30px; height:30px; flex:0 0 30px; border:3px solid #e9d8b2; border-top-color:#9b752c; border-radius:50%; animation:review-progress-spin .85s linear infinite; }
.review-progress.is-error { background:#fff0ef; color:#8a2923; border-color:#edb9b4; }
.review-progress.is-error .review-progress-spinner { display:none; }
@keyframes review-progress-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .review-progress-spinner { animation:none; } }
