:root {
  --bg: #F5EDE6;
  --bg-header: #E8D5C4;
  --text: #5C4033;
  --text-light: #8A7565;
  --accent: #C4956A;
  --accent-hover: #B07E55;
  --white: #FFFFFF;
  --border: rgba(92, 64, 51, 0.12);
  --shadow: rgba(92, 64, 51, 0.08);
  --overlay: rgba(92, 64, 51, 0.35);

  --font-title: 'Playfair Display', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;

  --sidebar-w: min(88vw, 340px);
  --header-h: 56px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.75 var(--font-body);
  padding-bottom: env(safe-area-inset-bottom, 0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* ===== Iframe preview mode ===== */
body.in-iframe header,
body.in-iframe #overlay,
body.in-iframe #sidebar { display: none !important; }
body.in-iframe #banner-area { margin-top: 0; }
body.in-iframe #banner-area .banner-img { max-height: 180px; object-fit: cover; }

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  cursor: pointer;
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 24px;
  gap: 14px;
}

.header-title {
  flex: 1;
  text-align: center;
  font: 400 1.15rem/1 var(--font-title);
  color: var(--text);
  letter-spacing: 0.15em;
}

.header-logo img {
  height: 20px;
  width: auto;
  filter: sepia(1) saturate(3) brightness(0.38) hue-rotate(346deg);
}

/* Menu toggle (hamburger) */
#menu-toggle {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  margin-left: -8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hamburger-lines {
  display: flex;
  flex-direction: column;
}

.hamburger-lines span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  margin: 2.5px 0;
  transition: transform 0.28s ease, opacity 0.2s ease;
}

.menu-label {
  display: none;
  font: 400 0.85rem/1 var(--font-title);
  color: var(--text);
  letter-spacing: 0.12em;
  font-style: normal;
}

body.menu-open .hamburger-lines span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
body.menu-open .hamburger-lines span:nth-child(2) {
  opacity: 0;
}
body.menu-open .hamburger-lines span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ===== Overlay ===== */
#overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  z-index: 45;
}

body.menu-open #overlay {
  opacity: 1;
  visibility: visible;
}

/* ===== Sidebar ===== */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg);
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

body.menu-open #sidebar {
  transform: translateX(0);
}

.sidebar-header {
  padding: 16px 24px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font: 700 1.1rem/1 var(--font-title);
  color: var(--text);
  letter-spacing: 0.1em;
}

.sidebar-close {
  background: none;
  border: 0;
  cursor: pointer;
  font: 400 0.9rem/1 var(--font-body);
  color: var(--text);
  text-decoration: underline;
  padding: 4px 0;
}

#sidebar-menu {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

/* Series item in sidebar */
/* Level 1 — Author */
.menu-author { border-bottom: 1px solid var(--border); }
.menu-author-title {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: 0; cursor: pointer; text-align: left;
  padding: 14px 24px; font: 700 0.95rem/1.4 var(--font-body); color: var(--text); gap: 8px;
}
.menu-author-title .chevron,
.menu-series-title .chevron {
  font-style: normal; color: var(--accent); font-size: 1rem;
  transition: transform 0.26s ease; flex-shrink: 0;
}
.menu-author.open .menu-author-title .chevron,
.menu-series.open .menu-series-title .chevron { transform: rotate(90deg); }
.menu-author-series { max-height: 0; overflow: hidden; transition: max-height 0.34s ease; }
.menu-author.open .menu-author-series { max-height: 2000px; }

/* Level 2 — Series */
.menu-series {}
.menu-series-title {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: 0; cursor: pointer; text-align: left;
  padding: 10px 24px 10px 24px; font: 400 0.88rem/1.4 var(--font-body); color: var(--text); gap: 8px;
}

/* Level 3 — Chapters */
.menu-chapters { max-height: 0; overflow: hidden; transition: max-height 0.34s ease; }
.menu-series.open .menu-chapters { max-height: 800px; }
.menu-chapters ol { list-style: none; padding: 0 0 6px; }

.menu-chapter-link {
  display: block; padding: 6px 24px 6px 24px; font-size: 0.85rem;
  color: var(--text-light); flex: 1; min-width: 0;
  transition: color 0.2s;
  text-wrap: balance;
}

.menu-chapter-link:hover,
.menu-chapter-link.active {
  color: var(--text);
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.sidebar-footer-btn {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  display: flex;
  align-items: center;
}

.sidebar-footer-btn:hover {
  color: var(--accent);
}
.sidebar-login-label {
  font: 400 0.9rem/1 var(--font-body);
  color: var(--text-light);
  text-decoration: underline;
  margin-left: 6px;
}
.sidebar-footer-btn:hover .sidebar-login-label { color: var(--accent); }

.sidebar-footer-link {
  font: 400 0.82rem/1 var(--font-body);
  color: var(--text-light);
  text-decoration: underline;
  cursor: pointer;
}

.sidebar-footer-link:hover {
  color: var(--accent);
}

/* ===== Banner ===== */
#banner-area {
  width: 100%;
}

#banner-area .banner-img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== Main content ===== */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 16px 80px;
  min-height: 50vh;
}

.loading {
  text-align: center;
  padding: 60px 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ===== Home: section title ===== */
.home-section-title {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font: 400 0.85rem/1 var(--font-title);
  color: var(--text-light);
  margin: 32px 0 20px;
}

/* ===== Home: welcome text ===== */
.home-welcome {
  max-width: 640px;
  margin: 20px auto;
  text-align: center;
  padding: 0 16px;
}
@media (min-width: 768px) {
  .home-welcome { margin-top: 4px; }
  .home-block-top { margin-bottom: 8px; }
  .home-block-bottom { margin-bottom: 8px; }
}

.home-block-top {
  margin-bottom: 16px;
}

.home-block-top p {
  font: 700 1.2rem/1.6 var(--font-body);
  color: var(--text);
  margin: 0;
}

.home-block-bottom {
  margin-bottom: 16px;
}

.home-block-bottom p {
  font: 400 1.02rem/1.75 var(--font-body);
  color: var(--text);
  margin: 0;
}

.home-open-menu {
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.home-vendas-wrap {
  margin-top: 20px;
}
@media (max-width: 767px) {
  .home-vendas-wrap { margin-top: 32px; }
}
.btn-vendas {
  display: inline-block;
  padding: 12px 32px;
  background: #5C4033;
  color: #fff;
  border: none;
  border-radius: 6px;
  font: 600 0.95rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-vendas:hover { background: #4A3228; }

.menu-vendas-link {
  display: block;
  padding: 14px 16px;
  font: 700 1.1rem/1.3 var(--font-body);
  color: var(--text);
  text-decoration: none;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
}
.menu-vendas-link:hover { background: #dbc8b8; }

#content.home-clickable { cursor: pointer; min-height: 60vh; }

/* ===== Chapter: banner title as text ===== */
.chapter-banner-title {
  font: 400 1.1rem/1.4 var(--font-title);
  color: var(--text-light);
  margin-bottom: 28px;
  text-align: center;
}

/* ===== Home: series list ===== */
.series-section {
  margin-bottom: 16px;
}

.series-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 14px 16px;
  background: var(--bg-header);
  border-radius: 6px;
  gap: 12px;
}

.series-title {
  flex: 1;
  font: 700 1.05rem/1.4 var(--font-body);
  color: var(--text);
}

.series-toggle {
  font-style: normal;
  color: var(--text-light);
  font-size: 1.1rem;
  transition: transform 0.26s ease;
  flex-shrink: 0;
}

.series-section.open .series-toggle {
  transform: rotate(90deg);
}

.series-chapters {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.34s ease;
}

.series-section.open .series-chapters {
  max-height: 600px;
}

.series-chapters ol {
  list-style: none;
  padding: 12px 0 4px;
}

.chapter-item a {
  display: block;
  padding: 10px 0 10px 16px;
  font-size: 1rem;
  color: var(--text);
  border-left: 2px solid var(--border);
  transition: border-color 0.2s, color 0.2s;
  line-height: 1.45;
}

.chapter-item a:hover {
  border-left-color: var(--accent);
  color: var(--accent);
}

/* ===== Reading view ===== */
.reading-breadcrumb {
  font: 400 0.82rem/1.4 var(--font-body);
  color: var(--text-light);
  margin-bottom: 20px;
}

.reading-breadcrumb .bc-link {
  color: #B6A188;
  cursor: pointer;
}

.reading-breadcrumb .bc-link:hover {
  text-decoration: underline;
}

.reading-breadcrumb .bc-current {
  color: var(--text-light);
}

article h2 {
  font: 400 1.75rem/1.3 var(--font-title);
  color: var(--text);
  margin-bottom: 6px;
}

.chapter-article h2 { text-align: center; margin-bottom: 28px; }
.chapter-article .meta { text-align: center; }

article .meta {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

article p {
  margin-bottom: 20px;
}

article p.quote {
  font-style: italic;
  color: var(--text);
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  margin: 24px 0;
}

/* ===== Chapter banner (inside chapter) ===== */
.chapter-banner {
  position: relative;
  margin-bottom: 28px;
  border-radius: 6px;
  overflow: hidden;
}

.chapter-banner .banner-img {
  width: 100%;
  height: auto;
  display: block;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.1) 60%);
  display: flex;
  align-items: flex-end;
  padding: 24px 20px;
}

.banner-text {
  font: 400 1.5rem/1.3 var(--font-title);
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

@media (min-width: 600px) {
  .banner-text { font-size: 1.8rem; }
}

/* Chapter date */
.chapter-date {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 400;
  margin-top: 0;
}

/* Link continuar lendo (editor) */
.field-link-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 0;
}
.field-link-label {
  font: 400 0.82rem/1 var(--font-body);
  color: var(--text-light);
}

/* Continue reading anchor */
.continue-reading-label {
  font: 600 1.05rem/1.4 var(--font-title);
  color: var(--text);
  margin: 32px 0 8px;
}
.continue-reading-label.blink {
  animation: continueBlink 2s ease-in-out 3;
}
@keyframes continueBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Contact invite */
.contact-invite {
  margin: 20px 0 0;
  padding: 16px 20px;
  background: var(--bg-header);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--text);
  font-style: italic;
}

/* ===== Author card (bottom of chapter) ===== */
.author-card {
  margin-top: 20px;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.author-card-photo {
  margin-bottom: -40px;
  z-index: 2;
}

.author-photo-lg {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
  box-shadow: 0 2px 12px var(--shadow);
}

.author-photo-lg-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg-header);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 2.4rem;
  font-family: var(--font-title);
  border: 4px solid var(--bg);
  box-shadow: 0 2px 12px var(--shadow);
}

.author-card-stripe {
  background: #3E2B1F;
  color: #F5EDE6;
  width: 100%;
  border-radius: 8px;
  padding: 56px 20px 24px;
}

.author-card-name {
  display: block;
  font: 700 1.15rem/1.3 var(--font-body);
  color: #F5EDE6;
  margin-bottom: 8px;
}

.author-card-about {
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(245,237,230,0.85);
}

.about-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.about-clamp.expanded {
  -webkit-line-clamp: unset;
  display: block;
}

.about-toggle {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.85rem;
  margin-top: 4px;
  padding: 0;
}

.author-card-links {
  margin-top: 16px;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.author-card-links.links-center {
  justify-content: center;
}

.author-card-links.links-three {
  justify-content: space-evenly;
}

.author-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #F5EDE6 !important;
  font-size: 0.95rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.author-link:hover {
  opacity: 0.8;
}

.author-link svg {
  flex-shrink: 0;
}

/* Legacy author footer (profile preview) */
.author-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.author-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-header);
}

.author-photo-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-header);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 1.4rem;
  font-family: var(--font-title);
}

.author-info {
  flex: 1;
}

.author-info strong {
  display: block;
  font-weight: 700;
  font-size: 1rem;
}

.author-info .about-preview {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* Navigation between chapters */
.chapter-nav {
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  background: var(--bg-header);
  border: none;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
  max-width: 50%;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.nav-btn:hover {
  background: #dbc8b8;
}

.nav-btn-right {
  text-align: right;
  align-items: flex-end;
}

.nav-label {
  font: 600 0.7rem/1 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 4px;
}

.nav-title {
  font: 400 0.88rem/1.3 var(--font-body);
  color: var(--text);
}

/* Testimonials */
.testimonials-carousel {
  margin-top: 32px;
  position: relative;
  min-height: 120px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.testimonial-card {
  display: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px 18px;
  text-align: center;
  background: var(--bg-header);
  animation: fadeIn 0.5s ease;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.testimonial-card.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.testimonial-author {
  font: 700 0.95rem/1.3 var(--font-body);
  color: var(--text);
  margin-bottom: 1px;
}
.testimonial-location {
  font: 400 0.82rem/1.3 var(--font-body);
  color: var(--text-light);
  margin-bottom: 6px;
}
.testimonial-message {
  font: italic 400 0.88rem/1.5 var(--font-body);
  color: var(--text);
}
.testimonial-btn-wrap {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 32px;
}
.btn-testimonial {
  display: inline-block;
  padding: 10px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font: 600 0.88rem/1 var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-testimonial:hover { background: #b07e56; }
.testimonial-modal {
  max-width: 400px;
  width: 90vw;
}
.testimonial-modal h3 {
  font: 700 1.1rem/1.3 var(--font-heading);
  margin-bottom: 16px;
  text-align: center;
}
.dep-success {
  text-align: center;
  padding: 32px 16px;
}
.dep-success p {
  font: 400 1rem/1.6 var(--font-body);
  color: var(--text);
}
.testimonial-modal select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

/* Admin depoimentos */
.dep-admin-list {
  margin-top: 16px;
}
.dep-admin-row {
  border-bottom: 1px solid var(--border);
}
.dep-admin-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  cursor: pointer;
  user-select: none;
}
.dep-admin-summary:hover { background: #faf6f3; }
.dep-admin-date {
  font: 400 0.82rem/1 var(--font-body);
  color: var(--text-light);
  flex-shrink: 0;
  min-width: 60px;
}
.dep-admin-name {
  font: 600 0.9rem/1.3 var(--font-body);
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.dep-admin-location {
  display: none;
  font: 400 0.82rem/1.3 var(--font-body);
  color: var(--text-light);
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .dep-admin-location { display: inline; }
}
.dep-chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
}
.dep-open .dep-chevron { transform: rotate(180deg); }
.dep-admin-detail {
  padding: 0 4px 16px 4px;
}
.dep-detail-fields p {
  font: 400 0.88rem/1.6 var(--font-body);
  color: var(--text);
  margin: 0;
}
.dep-detail-fields p strong {
  font-weight: 600;
}
.dep-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.dep-action-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 4px;
  font: 600 0.78rem/1 var(--font-body);
  cursor: pointer;
  background: var(--bg-header);
  color: var(--text);
  transition: background 0.2s;
}
.dep-action-btn:hover { background: #dbc8b8; }
.dep-action-pub { background: var(--accent); color: #fff; }
.dep-action-pub:hover { background: #b07e56; }
.dep-action-del { background: #dc3545; color: #fff; }
.dep-action-del:hover { background: #c82333; }
.empty-msg {
  text-align: center;
  padding: 40px 0;
  font: 400 0.95rem/1.5 var(--font-body);
  color: var(--text-light);
}
.config-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-top: 16px;
}

/* ===== Desktop ===== */
@media (min-width: 1024px) {
  :root {
    --header-h: 68px;
  }

  .header-inner {
    position: relative;
  }

  .header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    letter-spacing: 0.18em;
  }

  .header-logo {
    margin-left: auto;
  }

  .header-logo img {
    height: 32px;
  }

  .hamburger-lines span {
    width: 24px;
    height: 2px;
  }

  .menu-label {
    display: block;
    font-size: 1rem;
    letter-spacing: 0.14em;
  }

  main {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px 60px;
  }

  header {
    position: sticky;
    top: 0;
  }
}

/* ===== Mobile ===== */
@media (max-width: 1023px) {
  header {
    position: sticky;
    top: 0;
  }

  main {
    padding: 24px 16px 60px;
  }

  article h2 {
    font-size: 1.45rem;
  }
}

/* Flash animation for sidebar menu items */
.menu-chapter-link.flash {
  animation: menuFlash 2s ease-in-out;
}

@keyframes menuFlash {
  0%   { background: transparent; }
  15%  { background: var(--bg-header); }
  30%  { background: transparent; }
  45%  { background: var(--bg-header); }
  60%  { background: transparent; }
  75%  { background: var(--bg-header); }
  100% { background: transparent; }
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  position: relative;
  box-shadow: 0 8px 32px var(--shadow);
}

.modal-card h2 {
  font: 400 1.4rem/1 var(--font-title);
  color: var(--text);
  margin-bottom: 20px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: 0;
  font-size: 1.6rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}

.modal-hint {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.confirm-date {
  font-size: 1.3rem;
  color: var(--text);
  display: block;
  margin-top: 8px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.modal-actions .btn-secondary {
  flex: 1;
}

.modal-actions .btn-primary {
  flex: 1;
}

.date-mask-input {
  letter-spacing: 0.05em;
}

.date-mask-input::placeholder {
  color: var(--text-light);
  font: 400 1rem/1.5 var(--font-body);
  letter-spacing: 0.05em;
}

.field-hint-red {
  font-size: 0.82rem;
  font-weight: 400;
  color: #c0392b;
}

/* ===== Form fields ===== */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="number"],
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  font: 400 1rem/1.5 var(--font-body);
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px white inset !important;
  -webkit-text-fill-color: var(--text) !important;
  background-color: white !important;
}

.field-row {
  display: flex;
  align-items: center;
  position: relative;
}

.field-row input,
.field-row textarea {
  flex: 1;
  width: 100%;
}

.field-prefix {
  position: absolute;
  left: 12px;
  color: #999;
  font-size: 0.95rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}

.field-row input {
  padding-left: 30px;
}

.field-row .field-prefix-wide ~ input {
  padding-left: 44px;
}

.field-row-check {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row-check .field-row {
  width: 100%;
}

.field-row-check > input[type="email"] {
  width: 100%;
}

.check-divulgar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-light);
  cursor: pointer;
}

.check-divulgar input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.field-error {
  color: #C0392B;
  font-size: 0.85rem;
  margin-bottom: 12px;
  min-height: 1.2em;
}

.field-warn {
  color: #C0392B;
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}

.char-count {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-left: 8px;
}

.char-count.over {
  color: #C0392B;
  font-weight: 700;
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--white);
  border: 0;
  border-radius: 4px;
  font: 400 0.95rem/1 var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  font: 400 0.95rem/1 var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: var(--bg-header);
}

.created-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
  position: relative;
}

.created-user-name {
  font: 400 1.1rem/1.4 var(--font-body);
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px dashed var(--border);
}

.btn-copy {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  display: flex;
  align-items: center;
}

.btn-copy:hover {
  color: var(--accent);
}

.copied-msg {
  font: 400 0.8rem/1 var(--font-body);
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}

.copied-msg.show {
  opacity: 1;
}

.created-user-phone {
  margin-top: 12px;
}

.created-phone-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font: 400 1rem/1.4 var(--font-body);
  cursor: pointer;
}

.created-phone-link:hover {
  color: var(--accent);
}

.created-phone-number {
  border-bottom: 1px dashed var(--border);
}

.whatsapp-icon {
  display: inline-flex;
  align-items: center;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font: 400 0.9rem/1 var(--font-body);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--white);
}

.btn-copy {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1.1rem;
  padding: 8px 10px;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.btn-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ===== Badge ===== */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 400;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-header);
  color: var(--text-light);
  vertical-align: middle;
}

.badge-master { background: var(--accent); color: var(--white); }
.badge-new { background: #F39C12; color: var(--white); }
.badge-author { background: var(--accent); color: var(--white); }

/* ===== Toast ===== */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 0.9rem;
  z-index: 200;
  transition: transform 0.3s ease, opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}

#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== Toggle group ===== */
.toggle-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  width: fit-content;
}

.toggle-btn {
  padding: 8px 20px;
  background: var(--white);
  border: 0;
  cursor: pointer;
  font: 400 0.9rem/1 var(--font-body);
  color: var(--text-light);
  transition: background 0.2s, color 0.2s;
}

.toggle-btn + .toggle-btn {
  border-left: 1px solid var(--border);
}

.toggle-btn.active {
  background: var(--accent);
  color: var(--white);
}

/* ===== Author space ===== */
.author-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.author-header h2 {
  font: 400 1.5rem/1 var(--font-title);
  margin: 0;
}

.author-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.author-series-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
}

.asc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.asc-header h3 {
  font: 700 1.1rem/1.3 var(--font-body);
  color: var(--text);
  flex: 1;
}

.asc-chapters {
  margin-bottom: 12px;
}

.asc-chapter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.asc-chapter:last-child { border: 0; }

.asc-chapter a {
  color: var(--text);
  font-size: 0.95rem;
}

.asc-chapter a:hover { color: var(--accent); }

.asc-status {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 3px;
}

.asc-status.pub { background: #27AE60; color: #fff; }
.asc-status.sched { background: #2980B9; color: #fff; }
.asc-status.draft { background: var(--bg-header); color: var(--text-light); }

.asc-empty {
  font-size: 0.9rem;
  color: var(--text-light);
  padding: 8px 0;
}

/* ===== Editor ===== */
.editor-breadcrumb {
  font: 400 0.82rem/1.4 var(--font-body);
  color: var(--text-light);
  margin-bottom: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.editor-breadcrumb .bc-link { color: #B6A188; cursor: pointer; }
.editor-breadcrumb .bc-link:hover { text-decoration: underline; }
.editor-breadcrumb .bc-current { color: var(--text-light); }
.editor-breadcrumb a { color: #B6A188; }
.editor-breadcrumb a:hover { text-decoration: underline; }

.editor-form {
  max-width: 640px;
}

/* Publish date button + calendar */
.pub-date-row {
  position: relative;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pub-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font: 400 0.88rem/1 var(--font-body);
  color: var(--text);
  transition: border-color 0.2s;
}

.btn-pub-date:hover:not(:disabled) { border-color: var(--accent); }
.btn-pub-date:disabled { opacity: 0.6; cursor: default; }

.sat-calendar {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  margin-top: 6px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px var(--shadow);
  min-width: 280px;
}

.sat-cal-months { display: flex; flex-direction: column; gap: 4px; }
.sat-cal-title { font: 700 0.85rem/1.4 var(--font-body); color: var(--text); margin-bottom: 4px; }
.sat-cal-year { font: 700 0.82rem/1.4 var(--font-body); color: var(--text-light); margin-top: 4px; }
.sat-cal-row { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 2px 0; }
.sat-sep { color: var(--text-light); font-size: 0.8rem; }

.sat-day {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  font: 400 0.82rem/1 var(--font-body);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.sat-day:hover:not(:disabled) {
  background: var(--bg-header);
  border-color: var(--accent);
}

.sat-taken {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

.sat-free { font-weight: 600; }

.sat-tooltip {
  position: absolute;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--white);
  font: 400 0.72rem/1.4 var(--font-body);
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 60;
  pointer-events: none;
  box-shadow: 0 2px 8px var(--shadow);
}

.sat-tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid var(--text);
}

.sat-selected {
  background: var(--accent) !important;
  color: var(--white) !important;
  border-color: var(--accent) !important;
}

.editor-action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  max-width: 100%;
  box-sizing: border-box;
}
.editor-action-bar .asc-status { margin-right: auto; }
.editor-bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; max-width: 100%; }
.editor-bar-actions .btn-subtle,
.editor-bar-actions .btn-primary {
  min-width: 0;
  padding: 10px 14px;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
}
.editor-bar-actions .btn-subtle {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.editor-bar-actions .btn-subtle:hover {
  background: var(--accent-hover);
  color: var(--white);
  border-color: var(--accent-hover);
}
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.field-label-left { display: flex; align-items: baseline; gap: 6px; }
.field-desc { font-weight: 400; font-size: 0.85rem; color: var(--text-light); }
.field-label-right { display: flex; align-items: center; gap: 6px; }
.field-label-row .btn-icon { color: var(--text-light); opacity: 0.6; }
.field-label-row .btn-icon:hover { opacity: 1; }
.btn-subtle {
  background: none; border: 1px solid var(--border); color: var(--text-light);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 0.85rem;
}
.btn-subtle:hover { border-color: var(--accent); color: var(--text); }
.editor-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  align-items: center;
}

.btn-publish {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1rem;
}

.btn-whatsapp {
  font-size: 0.85rem;
}

/* ===== Preview ===== */
.preview-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 0;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.preview-card-iframe {
  max-width: 900px;
  height: 90vh;
}

.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #F1C40F;
  flex-shrink: 0;
}

.preview-tag {
  font: 700 0.8rem/1 var(--font-body);
  text-transform: uppercase;
  color: #7D6608;
}

.preview-exit {
  background: none;
  border: 0;
  cursor: pointer;
  color: #7D6608;
  font: 400 0.9rem/1 var(--font-body);
}

.preview-iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--bg);
}

.preview-page {
  padding: 24px 20px 40px;
  background: var(--bg);
}

/* Field hint */
.field-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 6px;
  font-style: italic;
}

.field-hint strong {
  font-weight: 700;
  color: var(--text);
  font-style: normal;
}

/* ===== Profile preview ===== */
.profile-form .field {
  margin-bottom: 16px;
}

.profile-form .field label {
  display: block;
  margin-bottom: 4px;
}

.profile-photo-section {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-photo-frame {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-header);
}

.profile-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-empty {
  color: var(--text-light);
}

.profile-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.profile-top-actions .btn-outline,
.profile-top-actions .btn-primary {
  font-size: 0.82rem;
  padding: 6px 14px;
}

.profile-bottom-actions {
  display: flex;
  gap: 10px;
  margin: 24px 0;
}

.profile-bottom-actions .btn-primary,
.profile-bottom-actions .btn-outline {
  flex: 1;
  text-align: center;
}

.modal-card-crop {
  max-width: 480px;
  width: 90vw;
}

.crop-area {
  width: 100%;
  max-height: 340px;
  min-height: 200px;
  background: #f0ece7;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.crop-area img {
  display: block;
  max-width: 100%;
}

.crop-placeholder {
  color: var(--text-light);
  font-size: 0.9rem;
}

.crop-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.btn-upload-photo {
  cursor: pointer;
}


/* ===== Users list ===== */
.users-list {
  max-width: 640px;
}

.user-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.user-row-left {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-row-name {
  white-space: nowrap;
}

.user-row-tags {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.user-row-author-name {
  color: var(--text-light);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}

.user-row-right {
  flex-shrink: 0;
  margin-left: 8px;
}

.btn-icon {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  display: inline-flex;
  align-items: center;
}

.btn-icon:hover { color: var(--accent); }

.btn-full { width: 100%; }

.btn-send-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

@media (min-width: 640px) {
  .user-row-author-name { display: inline; }
}

/* ===== Menu extras ===== */
.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.menu-author-link {
  display: block;
  padding: 14px 24px;
  font: 400 0.95rem/1.4 var(--font-body);
  color: var(--accent);
  transition: color 0.2s;
}

.menu-author-link:hover {
  color: var(--accent-hover);
}

.menu-author-link.flash,
.menu-chapter-link.flash {
  animation: flash-highlight 2s ease;
}

@keyframes flash-highlight {
  0%, 100% { background: transparent; }
  15%, 85% { background: rgba(196, 149, 106, 0.2); }
}

/* ===== Config Dashboard ===== */
.config-center { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: 16px; }
.config-center h2 { margin-bottom: 24px; }
.config-buttons { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 320px; }
.config-btn { text-align: center; padding: 16px 24px; font-size: 1.1rem; border-radius: 10px; text-decoration: none; }

/* ===== User Actions Modal ===== */
.user-actions-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.btn-outline { background: transparent; border: 1.5px solid var(--marrom); color: var(--marrom); padding: 12px 20px; border-radius: 8px; font-size: 0.95rem; cursor: pointer; transition: background 0.2s; }
.btn-outline:hover { background: var(--bege-medio); }

/* ===== Master Series ===== */
.master-author-group { margin-bottom: 32px; }
.master-author-name { font-family: 'Playfair Display', serif; font-size: 1.15rem; color: var(--marrom); margin-bottom: 12px; border-bottom: 1px solid var(--bege-medio); padding-bottom: 8px; }
.asc-header h4 { font-family: 'Playfair Display', serif; font-size: 1rem; color: var(--marrom); margin-bottom: 8px; }
.asc-chapters { padding-left: 8px; }
.asc-chapter { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.asc-chapter a { color: var(--marrom); text-decoration: none; font-size: 0.9rem; }
.asc-chapter a:hover { text-decoration: underline; }
.asc-status { font-size: 0.78rem; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.asc-status.pub { background: #d4edda; color: #155724; }
.asc-status.sched { background: #d6eaf8; color: #1a5276; }
.asc-status.draft { background: #F39C12; color: #fff; }
.asc-empty { color: #999; font-size: 0.85rem; font-style: italic; }
.author-series-card .btn-add-chapter { margin-top: 12px; font-size: 0.85rem; padding: 8px 16px; }

/* Chapter row layout */
.asc-chapter { display: flex; align-items: center; justify-content: space-between; }
.asc-chapter-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Header actions */
.asc-header-actions { display: flex; align-items: center; gap: 4px; }

/* Author subtitle */
.author-subtitle { font-family: var(--font-body); font-size: 1rem; color: var(--text-light); margin: -16px 0 24px; }

/* Deleted items */
.card-deleted, .chapter-deleted { opacity: 0.6; }
.asc-status.del { background: #dc3545; color: #fff; }
.btn-del-permanent svg { stroke: #dc3545; }

/* ===== Menu chapter status tags ===== */
.menu-chapters li { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 0; }
.menu-tag {
  font-size: 0.55rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 1px 3px; border-radius: 2px; flex-shrink: 0; white-space: nowrap;
  margin-left: auto; cursor: default; line-height: 1.3;
}
.menu-tag.pub { background: #d4edda; color: #155724; }
.menu-tag.sched { background: #d6eaf8; color: #1a5276; }
.menu-tag.draft { background: #F39C12; color: #fff; }
.menu-tag.del { background: #dc3545; color: #fff; }

/* ===== Date preview hint ===== */
.field-hint-date { display: block; font-size: 0.82rem; color: var(--accent); min-height: 1.2em; margin-bottom: 4px; }
.field-hint-light { font-weight: 400; color: var(--text-light); font-size: 0.82rem; }

/* ===== Min font 12px global ===== */
body { font-size: max(1rem, 12px); }
.sidebar-footer-link, .badge, .asc-status, small { font-size: max(0.75rem, 12px); }

/* ===== Unsubscribe page ===== */
.unsub-page {
  text-align: center;
  padding: 60px 16px 80px;
}
.unsub-page h1 {
  font: 400 1.6rem/1.4 var(--font-title);
  color: var(--text);
  margin: 0 0 32px;
}
.unsub-page .unsub-sub {
  font: 400 1.05rem/1.6 var(--font-body);
  color: var(--text-light);
  margin: 0 0 40px;
}
.unsub-page .unsub-thanks {
  font: 700 1.2rem/1 var(--font-title);
  color: var(--accent);
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
