/* ============================================================
   CASA DE LÍDIA — main.css
   Plus Jakarta Sans · Design Tokens · Desktop + Mobile
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ── TOKENS ── */
:root {
  /* Colors: as do site casadelidia.com.br (casadelidia-website/src/styles.css) */
  --purpura:        #4A1F5C;  /* púrpura profundo: texto, títulos e destaques */
  --purpura-escuro: #330F3D;  /* texto sobre o magenta e o dourado */
  --magenta:        #E57CD8;  /* botões principais */
  --dourado:        #E8A33D;  /* selos de oferta */
  --lilas:          #F5EBF3;  /* fundos de seleção (muted do site) */

  --primary:        var(--purpura);
  --primary-hover:  #3a1648;
  --primary-light:  var(--lilas);
  --primary-dark:   var(--purpura);
  --accent:         var(--magenta);
  --accent-hover:   #dc6ecf;
  --gradient:       linear-gradient(135deg, var(--purpura), var(--purpura));

  --bg:             #FBF6EF;  /* creme do site */
  --bg-darker:      #f3eadf;
  --bg-card:        #ffffff;
  --bg-hover:       #f8f1ea;

  --text-primary:   var(--purpura);
  --text-secondary: #6B5472;  /* muted-foreground do site */
  --text-tertiary:  #8d7a94;
  --text-muted:     #b3a4b8;

  --border-light:   #ece0e9;
  --border-medium:  #E5D5E3;  /* border do site */
  --border-dark:    #cdb8c9;

  --success:  #2ecc71;
  --error:    #e74c3c;
  --warning:  #f39c12;
  --info:     #3498db;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radius */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   20px;  /* cards arredondados como os do site */
  --radius-xl:   28px;
  --radius-full: 9999px;

  /* Shadows */
  /* Sombras arroxeadas e suaves, como no site (shadow-soft / shadow-lift) */
  --shadow-xs:   0 1px 2px rgba(68,13,79,.05);
  --shadow-sm:   0 2px 6px -2px rgba(68,13,79,.12);
  --shadow-md:   0 14px 34px -20px rgba(68,13,79,.38);
  --shadow-lg:   0 28px 70px -30px rgba(68,13,79,.45);
  --shadow-card: 0 1px 2px rgba(68,13,79,.04), 0 14px 36px -24px rgba(68,13,79,.35);

  /* Transitions */
  --fast:   0.15s ease;
  --normal: 0.2s ease;
  --slow:   0.3s ease;

  /* Sidebar */
  --sidebar-w: 240px;

  /* Fontes do site casadelidia.com.br */
  --font-display: 'Fraunces', Georgia, serif;
  --font-sans:    'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
input, textarea, select { font-family: inherit; }
/* O atributo hidden sempre esconde, mesmo em .btn e outros com display próprio */
[hidden] { display: none !important; }

/* Rodapé do menu lateral: Termos · Privacidade (abrem na janela, components/legal_dialog.html) */
.sidebar-legal { display: flex; justify-content: center; gap: 6px; margin-top: var(--space-2); font-size: .72rem; color: var(--text-muted); }
.sidebar-legal a { color: var(--text-tertiary); text-decoration: none; }
.sidebar-legal a:hover { color: var(--purpura); text-decoration: underline; }

/* ── BARRA DO EDITOR (static/js/barra_editor.js) ──
   Computador: a barra completa (.ed-pc). Celular: a enxuta (.ed-cel) + o menu ao selecionar (.ed-bolha). */
.ed-grupo { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-width: 0; }
.ed-btn {
  flex-shrink: 0; height: 34px; min-width: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent;
  color: var(--purpura); display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font: 600 .85rem var(--font-sans); cursor: pointer; transition: background var(--fast);
}
.ed-btn:hover { background: var(--lilas); }
.ed-btn:focus-visible { outline: 2px solid var(--magenta); outline-offset: 1px; }
.ed-btn[aria-pressed="true"] { background: var(--lilas); box-shadow: inset 0 0 0 1.5px var(--purpura); }
.ed-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.ed-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ed-btn .ed-seta { width: 12px; height: 12px; opacity: .7; }
.ed-texto { min-width: 118px; justify-content: space-between; box-shadow: inset 0 0 0 1px var(--border-medium); }
.ed-num { min-width: 58px; justify-content: space-between; box-shadow: inset 0 0 0 1px var(--border-medium); font-variant-numeric: tabular-nums; }
.ed-cor { flex-direction: column; gap: 1px; padding-top: 3px; }
.ed-cor svg { width: 16px; height: 16px; }
.ed-letra { font: 700 1rem/1 Georgia, serif; }
.ed-faixa { width: 18px; height: 4px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.ed-sep { flex-shrink: 0; width: 1px; height: 22px; background: var(--border-medium); margin: 0 5px; }
.ed-aa { font: 700 .95rem/1 Georgia, serif; }
.ed-menu {
  position: fixed; z-index: 1200; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 6px; min-width: 190px; max-height: calc(100vh - 16px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.ed-menu-item {
  border: 0; background: transparent; color: var(--text-primary); text-align: left; padding: 8px 10px; border-radius: 8px;
  cursor: pointer; font: 500 .9rem var(--font-sans); display: flex; align-items: center; gap: 10px;
}
.ed-menu-item:hover { background: var(--lilas); }
.ed-menu-item[aria-checked="true"] { background: var(--lilas); color: var(--purpura); font-weight: 700; }
.ed-menu-item svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ed-menu-rotulo { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-tertiary); padding: 6px 10px 2px; font-weight: 600; }
.ed-paleta { display: grid; grid-template-columns: repeat(6, 28px); gap: 6px; padding: 6px 8px 8px; }
.ed-paleta button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--bg-card); box-shadow: 0 0 0 1px var(--border-medium); cursor: pointer; }
.ed-paleta button[aria-checked="true"] { box-shadow: 0 0 0 2px var(--purpura); }
.ed-link { display: flex; flex-direction: column; gap: 8px; padding: 6px; width: 270px; max-width: calc(100vw - 40px); }
.ed-link input { font: 400 .9rem var(--font-sans); padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-medium); }
.ed-link-acoes { display: flex; gap: 6px; justify-content: flex-end; }
.ed-bolha {
  position: fixed; z-index: 1100; display: flex; align-items: center; gap: 2px; padding: 4px;
  background: var(--purpura-escuro); border-radius: 12px; box-shadow: 0 12px 28px -12px rgba(0,0,0,.5);
}
.ed-bolha .ed-btn { color: #fff; height: 36px; min-width: 34px; }
.ed-bolha .ed-btn:hover, .ed-bolha .ed-btn[aria-pressed="true"] { background: rgba(255,255,255,.16); box-shadow: none; }
.ed-bolha .ed-num { box-shadow: none; min-width: 48px; }
.ed-bolha .ed-sep { background: rgba(255,255,255,.22); }
/* Computador: mais justa, para caber numa linha a partir de ~1300 px */
.ed-pc { gap: 1px; }
.ed-pc .ed-btn { min-width: 32px; padding: 0 6px; }
.ed-pc .ed-sep { margin: 0 3px; }
.ed-pc .ed-texto { min-width: 108px; }
.ed-pc .ed-num { min-width: 54px; }
@media (max-width: 768px) { .ed-pc { display: none; } }
@media (min-width: 769px) { .ed-cel, .ed-bolha { display: none; } }
/* Texto diferente no computador e no celular (ex.: "Painel de dados" / "Dados") */
@media (max-width: 768px) { .so-pc { display: none; } }
@media (min-width: 769px) { .so-cel { display: none; } }

/* ── MENU EXPORTAR (página do roteiro e Meus Roteiros) ── */
.rt-menu { position: relative; }
.rt-menu > summary { list-style: none; cursor: pointer; }
.rt-menu > summary::-webkit-details-marker { display: none; }
.rt-menu-lista {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 210px;
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 4px;
}
.rt-menu-lista a, .rt-menu-lista button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
  background: none; border: none; font: inherit; font-size: .857rem; color: var(--text-primary); text-decoration: none; cursor: pointer; text-align: left;
}
.rt-menu-lista a:hover, .rt-menu-lista button:hover { background: var(--bg-hover); }
.rt-menu-lista svg { color: var(--text-tertiary); flex-shrink: 0; }

/* Aviso no canto ("Roteiro copiado", "Salvo") */
.save-banner { position: fixed; bottom: 20px; right: 20px; background: var(--success); color: #fff; padding: 10px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 1100; display: none; font-size: .857rem; font-weight: 500; }
.save-banner.visible { display: block; }
.save-banner.error { background: var(--error, #e74c3c); }
@media (max-width: 768px) {
  .save-banner { left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom)); text-align: center; }  /* acima do menu de baixo */
}

/* ── TYPOGRAPHY ── */
/* Como no site: títulos em Fraunces 600, texto em Plus Jakarta Sans */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 1.875rem;  line-height: 1.2; }   /* text-3xl do site */
h2 { font-size: 1.5rem;    line-height: 1.25; }
h3 { font-size: 1.25rem;   line-height: 1.3; }   /* text-xl: título de card no site */
h4 { font-size: 1.0625rem; line-height: 1.35; }
/* Títulos de card e números em destaque que não são <h>: mesma fonte */
.roteiro-card-title, .rt-linha-titulo, .plan-price, .stat-value, .pl-preco {
  font-family: var(--font-display); letter-spacing: -0.015em;
}
/* O roteiro (folha, prévias, editor e link público) mantém a fonte e os tamanhos do modelo */
:is(.folha, .pv-folha, .previa, .pr-doc, .ProseMirror, .tpl-doc-editor) :is(h1, h2, h3, h4) {
  font-family: inherit; letter-spacing: normal;
}
:is(.folha, .pv-folha, .previa, .pr-doc, .ProseMirror, .tpl-doc-editor) h1 { font-size: 1.714rem; font-weight: 700; line-height: 1.25; }
:is(.folha, .pv-folha, .previa, .pr-doc, .ProseMirror, .tpl-doc-editor) h2 { font-size: 1.429rem; font-weight: 700; line-height: 1.3; }
:is(.folha, .pv-folha, .previa, .pr-doc, .ProseMirror, .tpl-doc-editor) h3 { font-size: 1.143rem; line-height: 1.35; }
:is(.folha, .pv-folha, .previa, .pr-doc, .ProseMirror, .tpl-doc-editor) h4 { font-size: 1rem; line-height: inherit; }
/* "Eyebrow" do site: rótulo pequeno em maiúsculas acima de títulos */
.eyebrow { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--text-tertiary); }
p  { color: var(--text-secondary); }
small { font-size: .857rem; }

/* ── LAYOUT SHELL ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.sidebar-logo-img { display: block; height: 44px; width: auto; max-width: 100%; }


.sidebar-nav {
  flex: 1;
  padding: var(--space-3) 0;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;  /* "eyebrow" do site */
  color: var(--text-tertiary);
  padding: var(--space-3) var(--space-4) var(--space-1);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  color: var(--text-secondary);
  font-size: .929rem;
  font-weight: 500;
  border-radius: 0;
  transition: background var(--fast), color var(--fast);
  position: relative;
}
/* "!" no item do menu: falta fazer algo ali (ex.: nenhuma célula cadastrada) */
.menu-alerta {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 18px; height: 18px; margin-left: auto; border-radius: 50%;
  background: var(--dourado); color: var(--purpura-escuro); font-size: .72rem; font-weight: 800; line-height: 1;
}
.sidebar-link svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: color var(--fast);
}
.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.sidebar-link:hover svg { color: var(--text-secondary); }
.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}
.sidebar-link.active svg { color: var(--primary); }
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--magenta);
  border-radius: 0 3px 3px 0;
}

/* "+ Novo roteiro": a ação principal, acima do menu (botão magenta do site) */
.sidebar-cta {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  margin: var(--space-4) var(--space-4) var(--space-1);
  padding: 11px var(--space-4); border-radius: var(--radius-full);
  background: var(--magenta); color: var(--purpura-escuro);
  font-weight: 700; font-size: .929rem; text-decoration: none;
  box-shadow: var(--shadow-md); transition: transform var(--fast), filter var(--fast);
}
.sidebar-cta:hover { transform: translateY(-1px); filter: brightness(1.04); }
.sidebar-cta.ativo { box-shadow: 0 0 0 3px var(--lilas), var(--shadow-md); }
.sidebar-cta svg { width: 18px; height: 18px; }

.sidebar-footer {
  border-top: 1px solid var(--border-light);
  padding: var(--space-3) var(--space-4);
  flex-shrink: 0;
}
/* O menu rola sozinho: o rodapé (usuário e uso) nunca corta os itens */
.sidebar { overflow: hidden; }
.sidebar-nav { overflow-y: auto; min-height: 0; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .929rem;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: .786rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1.143rem; }

.sidebar-user-info { overflow: hidden; flex: 1; }
.sidebar-user-name {
  font-weight: 600; font-size: .857rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-email {
  font-size: .75rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.plan-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: .714rem; font-weight: 600;
  margin-bottom: var(--space-2);
}

.sidebar-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  width: 100%; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: .786rem; font-weight: 600;
  border: none; transition: background var(--fast), color var(--fast);
}
.sidebar-btn-primary {
  background: var(--magenta);
  color: var(--purpura-escuro);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-2);
}
.sidebar-btn-primary:hover { opacity: .9; }
.sidebar-btn-ghost {
  background: transparent;
  color: var(--text-tertiary);
  border: 1px solid var(--border-light);
}
.sidebar-btn-ghost:hover { background: var(--bg-hover); color: var(--text-secondary); }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.page-wrap {
  flex: 1;
  padding: var(--space-8);
  max-width: 1200px;
  width: 100%;
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.page-header-left {}
.page-title {
  font-size: 1.875rem;  /* títulos de seção do site (text-3xl) */
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.page-subtitle { font-size: 1rem; line-height: 1.6; color: var(--text-secondary); }
.page-header-actions { display: flex; gap: var(--space-2); align-items: center; flex-shrink: 0; }

/* Título da seção primeiro; o voltar é uma setinha na mesma linha, antes dele */
.titulo-linha { display: flex; align-items: center; gap: var(--space-2); }
.titulo-linha .page-title { margin-bottom: 0; }
.voltar-btn {
  width: 34px; height: 34px; border-radius: var(--radius-full); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-secondary);
  text-decoration: none; transition: background var(--fast), color var(--fast);
}
.voltar-btn:hover { background: var(--primary-light); color: var(--primary-dark); }
.voltar-btn svg { width: 18px; height: 18px; }
.titulo-linha + .page-subtitle { margin-top: 4px; }

/* ── HERO HEADER ── */
.hero-header {
  background: var(--gradient);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  color: #fff;
  margin-bottom: var(--space-6);
  position: relative;
  overflow: hidden;
}
.hero-header::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}
.hero-header::after {
  content: '';
  position: absolute;
  bottom: -60px; left: 60px;
  width: 150px; height: 150px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.hero-header h1, .hero-header h2 { color: #fff; }
.hero-header p { color: rgba(255,255,255,.85); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);  /* botões em pílula, como no site */
  font-size: .857rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--fast);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-sm { padding: 6px 12px; font-size: .786rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }

.btn-primary {
  background: var(--magenta);
  color: var(--purpura-escuro);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--bg-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-danger:hover { opacity: .9; }
.btn-full { width: 100%; justify-content: center; }

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-pad { padding: var(--space-5); }
.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 1.125rem; }
.card-body { padding: var(--space-5); }
.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

/* ── FORMS ── */
.form-group { margin-bottom: var(--space-4); }
.form-label {
  display: block;
  font-size: .857rem; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.form-hint { font-size: .786rem; color: var(--text-tertiary); margin-top: var(--space-1); }
.form-error { font-size: .786rem; color: var(--error); margin-top: var(--space-1); }

.input, .textarea, .select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: .929rem;
  color: var(--text-primary);
  transition: border-color var(--fast), box-shadow var(--fast);
  outline: none;
  appearance: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(229,124,216,.15);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { resize: vertical; min-height: 100px; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b6660'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
}
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }

/* ── FLASH MESSAGES ── */
.flash-list { margin-bottom: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.flash {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: .857rem; font-weight: 500;
  border: 1px solid transparent;
}
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.flash-error   { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.flash-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.flash-close {
  margin-left: auto; background: none; border: none;
  color: inherit; opacity: .6; cursor: pointer; padding: 2px;
}
.flash-close:hover { opacity: 1; }

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: var(--radius-full);
  font-size: .714rem; font-weight: 600;
}
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: #f0fdf4; color: #15803d; }
.badge-error   { background: #fef2f2; color: #dc2626; }
.badge-warning { background: #fffbeb; color: #b45309; }
.badge-gray    { background: var(--bg-darker); color: var(--text-secondary); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .857rem;
}
.table th {
  text-align: left;
  padding: var(--space-2) var(--space-4);
  font-weight: 600; font-size: .786rem;
  color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border-light);
}
.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-hover); }

/* ── TABS ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-light); margin-bottom: var(--space-5); }
.tab {
  padding: var(--space-3) var(--space-4);
  font-size: .857rem; font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer; background: none; border-top: none; border-left: none; border-right: none;
  transition: color var(--fast), border-color var(--fast);
  white-space: nowrap;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: var(--space-12) var(--space-8);
  color: var(--text-muted);
}
.empty-state-icon {
  width: 56px; height: 56px;
  background: var(--bg-darker); border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-4);
}
.empty-state-icon svg { width: 26px; height: 26px; color: var(--text-muted); }
.empty-state h3 { font-size: 1.25rem; color: var(--text-primary); margin-bottom: var(--space-2); }
.empty-state p  { font-size: .857rem; margin-bottom: var(--space-5); max-width: 320px; margin-inline: auto; }

/* ── SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-darker) 25%, var(--bg-hover) 50%, var(--bg-darker) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text  { height: 14px; margin-bottom: 8px; border-radius: var(--radius-sm); }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-card  { height: 80px; border-radius: var(--radius-lg); margin-bottom: 12px; }

/* ── ROTEIRO CARD ── */
.roteiro-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--normal), border-color var(--normal), transform var(--normal);
  cursor: pointer;
  display: flex; flex-direction: column; gap: var(--space-3);
  position: relative;
}
.roteiro-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}
.roteiro-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
}
.roteiro-card-title { font-weight: 600; font-size: 1.125rem; line-height: 1.3; color: var(--text-primary); }
.roteiro-card-meta  { font-size: .786rem; color: var(--text-muted); display: flex; gap: var(--space-3); flex-wrap: wrap; }
.roteiro-card-preview { font-size: .857rem; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.roteiro-card-footer { display: flex; align-items: center; justify-content: space-between; }
.roteiro-card-actions {
  display: flex; gap: var(--space-1);
  opacity: 0; transition: opacity var(--fast);
}
.roteiro-card:hover .roteiro-card-actions { opacity: 1; }
.roteiro-card-action-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  border: none; background: none;
  color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--fast), color var(--fast);
}
.roteiro-card-action-btn:hover { background: var(--bg-darker); color: var(--text-primary); }

/* ── AUTH LAYOUT ── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: var(--space-5);
}
.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
  width: 100%; max-width: 420px;
}
.auth-logo {
  display: flex; align-items: center; gap: var(--space-3);
  justify-content: center; margin-bottom: var(--space-6);
}
.auth-logo-img { display: block; height: 56px; width: auto; max-width: 100%; }
.auth-title {
  text-align: center; font-size: 1.875rem; line-height: 1.2;
  margin-bottom: var(--space-2);
}
.auth-subtitle { text-align: center; font-size: .857rem; color: var(--text-secondary); margin-bottom: var(--space-6); }
.auth-divider {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--text-muted); font-size: .786rem; margin: var(--space-4) 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-light);
}
.auth-google-btn {
  display: flex; align-items: center; justify-content: center; gap: var(--space-3);
  width: 100%; padding: var(--space-3);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-size: .857rem; font-weight: 600;
  color: var(--text-primary);
  cursor: pointer; transition: background var(--fast);
  margin-bottom: var(--space-4);
}
.auth-google-btn:hover { background: var(--bg-hover); }
.auth-google-btn svg { width: 18px; height: 18px; }
.auth-footer { text-align: center; font-size: .786rem; color: var(--text-secondary); margin-top: var(--space-5); }
.auth-footer a { color: var(--primary-dark); font-weight: 600; }

/* ── PLANS / BILLING ── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-6);
}
.plan-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  position: relative;
  transition: box-shadow var(--normal), border-color var(--normal);
}
.plan-card:hover { box-shadow: var(--shadow-md); }
.plan-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}
.plan-popular-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--gradient); color: #fff;
  padding: 3px 14px; border-radius: var(--radius-full);
  font-size: .714rem; font-weight: 600; white-space: nowrap;
}
.plan-name  { font-size: 1rem; font-weight: 700; margin-bottom: var(--space-2); }
.plan-price { font-size: 2rem; font-weight: 700; color: var(--text-primary); }
.plan-price span { font-family: var(--font-sans); letter-spacing: 0; font-size: 1rem; color: var(--text-secondary); font-weight: 400; }
.plan-desc  { font-size: .857rem; color: var(--text-secondary); margin: var(--space-3) 0 var(--space-4); }
.plan-features { margin-bottom: var(--space-5); }
.plan-feature {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: .857rem; padding: var(--space-1) 0;
  color: var(--text-secondary);
}
.plan-feature svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }

/* ── STAR RATING ── */
.star-group { display: flex; gap: 4px; }
.star {
  background: none; border: none; cursor: pointer;
  padding: 2px; color: var(--border-dark);
  transition: color var(--fast), transform var(--fast);
}
.star svg { width: 22px; height: 22px; }
.star:hover, .star.active { color: var(--warning); }
.star:hover { transform: scale(1.1); }

/* ── LOADING SCREEN (novo roteiro) ── */
.loading-fullscreen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: var(--space-5);
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity var(--slow);
}
.loading-fullscreen.visible { opacity: 1; pointer-events: all; }
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-messages { text-align: center; }
.loading-message {
  font-size: .929rem; color: var(--text-secondary);
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--normal), transform var(--normal);
  position: absolute;
}
.loading-message.visible { opacity: 1; transform: none; position: relative; }
.loading-progress {
  width: 200px; height: 4px;
  background: var(--border-light); border-radius: var(--radius-full);
  overflow: hidden;
}
.loading-progress-bar {
  height: 100%; background: var(--magenta);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ── SECTION EDITOR (view.html) ── */
.section-block {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--fast);
}
.section-block:hover { border-color: var(--border-medium); }
.section-block-header {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}
.section-block-title { font-weight: 600; font-size: .857rem; flex: 1; }
.section-block-time  { font-size: .786rem; color: var(--text-muted); }
.section-block-body  { padding: var(--space-4); }
.section-block-text  { font-size: .857rem; color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; }

/* ── COMMENTS ── */
.comment-item {
  display: flex; gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-light);
}
.comment-item:last-child { border-bottom: none; }
.comment-body  { flex: 1; }
.comment-author { font-size: .786rem; font-weight: 600; color: var(--text-primary); }
.comment-time   { font-size: .714rem; color: var(--text-muted); }
.comment-text   { font-size: .857rem; color: var(--text-secondary); margin-top: 4px; }

/* ── UTILS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.text-center { text-align: center; }
.text-sm   { font-size: .857rem; }
.text-xs   { font-size: .786rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary-c { color: var(--primary); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border-light); margin: var(--space-5) 0; }

/* ── STAT CARD ── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
}
.stat-label { font-size: .786rem; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .04em; margin-bottom: var(--space-2); }
.stat-value { font-size: 1.714rem; font-weight: 700; color: var(--text-primary); }
.stat-change { font-size: .786rem; color: var(--text-secondary); margin-top: var(--space-1); }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--error); }

/* ── MEMBER ITEM ── */
.member-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--fast);
}
.member-item:hover { background: var(--bg-hover); }
.member-item:last-child { border-bottom: none; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: 500; font-size: .857rem; }
.member-role { font-size: .786rem; color: var(--text-muted); }
.member-actions { display: flex; gap: var(--space-1); }

/* ── FEEDBACK FORM (público) ── */
.feedback-shell {
  min-height: 100vh; background: var(--bg);
  display: flex; flex-direction: column;
}
.feedback-header {
  background: var(--gradient);
  padding: var(--space-6);
  color: #fff;
}
.feedback-header h1 { font-size: 1.286rem; color: #fff; }
.feedback-header p  { color: rgba(255,255,255,.85); font-size: .857rem; }
.feedback-body {
  flex: 1; padding: var(--space-6);
  max-width: 560px; margin: 0 auto; width: 100%;
}

/* ============================================================
   MOBILE STYLES (≤ 768px)
   ============================================================ */

@media (max-width: 768px) {

  /* Hide desktop sidebar */
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding-bottom: 80px; }
  .page-wrap { padding: var(--space-4); padding-bottom: var(--space-12); }

  /* Larger text */
  html { font-size: 17px; }
  input, textarea, select, .input, .textarea, .select { font-size: 16px !important; }

  .page-title { font-size: 1.65rem; }  /* 28 px no celular */
  .auth-title { font-size: 1.65rem; }

  /* ── BOTTOM NAV ── */
  .bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -4px 16px rgba(45,42,38,.06);
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(64px + env(safe-area-inset-bottom));
    align-items: stretch;
  }

  .bottom-nav-item {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    padding: var(--space-2) 0;
    background: none; border: none; cursor: pointer;
    color: var(--text-muted);
    font-size: .643rem; font-weight: 500;
    transition: color var(--fast);
    position: relative;
    text-decoration: none;
  }
  .bottom-nav-item svg  { width: 22px; height: 22px; }
  .bottom-nav-item.active { color: var(--primary); }
  .bottom-nav-item.active svg { color: var(--primary); }

  /* FAB central */
  .bottom-nav-fab {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative; background: none; border: none; cursor: pointer;
    padding: 0; text-decoration: none;
  }
  .bottom-nav-fab-circle {
    width: 52px; height: 52px;
    background: var(--magenta);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-lg), 0 0 0 4px var(--bg-card);
    margin-top: -16px;
    transition: transform var(--fast), box-shadow var(--fast);
  }
  .bottom-nav-fab-circle svg { width: 24px; height: 24px; color: var(--purpura-escuro); }
  .bottom-nav-fab:active .bottom-nav-fab-circle { transform: scale(.95); }
  .bottom-nav-fab-label {
    font-size: .643rem; font-weight: 600;
    color: var(--primary); margin-top: 2px;
  }

  /* ── BOTTOM SHEET ── */
  .bottom-sheet-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(45,42,38,.5);
    backdrop-filter: blur(2px);
    z-index: 300;
    animation: fadeIn var(--normal);
  }
  .bottom-sheet-backdrop.open { display: block; }

  .bottom-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-lg);
    z-index: 301;
    transform: translateY(100%);
    transition: transform var(--slow) cubic-bezier(.32,.72,0,1);
    max-height: 85vh;
    display: flex; flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
    touch-action: none;
  }
  .bottom-sheet.open { transform: translateY(0); }

  .bottom-sheet-handle {
    width: 36px; height: 4px;
    background: var(--border-medium);
    border-radius: var(--radius-full);
    margin: var(--space-3) auto var(--space-2);
    flex-shrink: 0;
    cursor: grab;
  }

  .bottom-sheet-header {
    padding: 0 var(--space-5) var(--space-3);
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
  }
  .bottom-sheet-title { font-size: 1.125rem; }
  .bottom-sheet-close {
    width: 32px; height: 32px; background: var(--bg-darker);
    border: none; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; cursor: pointer; color: var(--text-secondary);
  }
  .bottom-sheet-body {
    overflow-y: auto; flex: 1;
    padding: var(--space-4) var(--space-5);
    overscroll-behavior: contain;
  }

  /* ── ACTION SHEET ── */
  .action-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 400;
    padding: 0 var(--space-3) calc(var(--space-3) + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform var(--slow) cubic-bezier(.32,.72,0,1);
  }
  .action-sheet.open { transform: translateY(0); }
  .action-sheet-group {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--space-2);
    box-shadow: var(--shadow-lg);
  }
  .action-sheet-item {
    display: flex; align-items: center; justify-content: center;
    width: 100%; padding: 16px;
    background: none; border: none; border-bottom: 1px solid var(--border-light);
    font-size: 1rem; font-weight: 500; color: var(--text-primary);
    cursor: pointer; transition: background var(--fast);
  }
  .action-sheet-item:last-child { border-bottom: none; }
  .action-sheet-item:hover   { background: var(--bg-hover); }
  .action-sheet-item.danger  { color: var(--error); }
  .action-sheet-cancel {
    display: flex; align-items: center; justify-content: center;
    width: 100%; padding: 16px;
    background: var(--bg-card);
    border: none; border-radius: var(--radius-xl);
    font-size: 1rem; font-weight: 700; color: var(--text-primary);
    cursor: pointer; box-shadow: var(--shadow-md);
  }

  /* ── SEGMENTED CONTROL (tabs) ── */
  .tabs {
    display: none;
  }
  .segmented-control {
    display: flex !important;
    background: var(--bg-darker);
    border-radius: var(--radius-lg);
    padding: 3px;
    margin-bottom: var(--space-4);
    border-bottom: none;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .segmented-control::-webkit-scrollbar { display: none; }
  .segmented-control .tab {
    flex: 1; border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    font-size: .857rem; font-weight: 500;
    color: var(--text-secondary); border: none;
    transition: all var(--fast); white-space: nowrap; min-width: fit-content;
  }
  .segmented-control .tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-xs);
  }

  /* ── PULL TO REFRESH ── */
  .pull-refresh-indicator {
    position: fixed; top: 0; left: 50%; transform: translateX(-50%) translateY(-60px);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: var(--space-2) var(--space-4);
    display: flex; align-items: center; gap: var(--space-2);
    font-size: .786rem; color: var(--text-secondary);
    z-index: 500; box-shadow: var(--shadow-md);
    transition: transform var(--normal);
  }
  .pull-refresh-indicator.visible { transform: translateX(-50%) translateY(var(--space-3)); }

  /* ── SWIPE ACTIONS ── */
  .swipe-item { position: relative; overflow: hidden; }
  .swipe-item-content { transition: transform var(--normal); will-change: transform; }
  .swipe-actions-reveal {
    position: absolute; right: 0; top: 0; bottom: 0;
    display: flex; align-items: stretch;
    transform: translateX(100%);
  }
  .swipe-action-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 72px; gap: 3px;
    border: none; cursor: pointer; font-size: .714rem; font-weight: 600;
    transition: background var(--fast);
  }
  .swipe-action-btn svg { width: 20px; height: 20px; }
  .swipe-action-btn.edit   { background: var(--info); color: #fff; }
  .swipe-action-btn.delete { background: var(--error); color: #fff; }

  /* ── MOBILE CARDS (list items) ── */
  .roteiro-card {
    border-radius: var(--radius-lg);
    padding: var(--space-4);
  }
  .roteiro-card-actions { opacity: 1; }

  /* ── HERO HEADER MOBILE ── */
  .hero-header {
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-4);
    padding: var(--space-6) var(--space-4);
  }

  /* ── STICKY CTA ── */
  .sticky-cta {
    position: fixed; bottom: 64px; left: 0; right: 0;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    z-index: 150;
    box-shadow: 0 -2px 8px rgba(45,42,38,.06);
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  }

  /* ── FORMS ── */
  .input-row { grid-template-columns: 1fr; }
  /* Título e botões na mesma linha; o subtítulo vai embaixo, na largura toda da tela */
  .page-header {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3); row-gap: 6px;
    align-items: center; margin-bottom: var(--space-5);
  }
  .page-header-left { display: contents; }
  .page-header-left > .page-title, .page-header-left > .titulo-linha { grid-column: 1; grid-row: 1; min-width: 0; margin-bottom: 0; }
  .page-header-actions { grid-column: 2; grid-row: 1; width: auto; }
  .page-header-left > .page-subtitle { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
  .page-header-actions .btn { padding: 8px 14px; }

  /* ── PLANS MOBILE ── */
  .plans-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }

  /* ── MOBILE TOP BAR ── */
  .mobile-topbar {
    display: flex !important;
    align-items: center; justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    position: sticky; top: 0; z-index: 100;
  }
  .mobile-topbar-title { font-weight: 700; font-size: .929rem; color: var(--text-primary); }
  .mobile-topbar-logo {
    display: flex; align-items: center; gap: var(--space-2);
  }
  .mobile-topbar-logo-img { display: block; height: 38px; width: auto; }
  .mobile-topbar-actions { display: flex; gap: var(--space-2); }

  /* Barra fina de uso mensal — abaixo do topbar */
  .mobile-usage-bar {
    display: block !important;
    position: sticky; top: 56px; z-index: 99;
  }
  .icon-btn {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    border: none; background: var(--bg-darker);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); cursor: pointer;
    transition: background var(--fast);
  }
  .icon-btn:hover { background: var(--border-light); }
  .icon-btn svg { width: 18px; height: 18px; }

  /* ── STAR RATING MOBILE ── */
  .star svg { width: 36px; height: 36px; }
  .star-group { gap: 8px; justify-content: center; }

  /* ── FEEDBACK PUBLIC ── */
  .feedback-header {
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  }
  .feedback-body { padding: var(--space-4); }

  /* ── PLANS SNAP ── */
  .plans-snap-wrap {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; gap: var(--space-4); padding: var(--space-2);
    margin: 0 calc(-1 * var(--space-4));
    padding-inline: var(--space-4);
  }
  .plans-snap-wrap::-webkit-scrollbar { display: none; }
  .plans-snap-wrap .plan-card { min-width: 280px; scroll-snap-align: start; flex-shrink: 0; }

  /* ── MORE DRAWER (sidebar items) ── */
  .more-drawer {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 302;
    transform: translateY(100%);
    transition: transform var(--slow) cubic-bezier(.32,.72,0,1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .more-drawer.open { transform: translateY(0); }
  .more-drawer-label {
    padding: var(--space-3) var(--space-5) var(--space-1);
    font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
    color: var(--text-tertiary);
  }
  .more-drawer-item {
    display: flex; align-items: center; gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-light);
    background: none; border-left: none; border-right: none; border-top: none;
    width: 100%; font-size: .929rem; font-weight: 500; color: var(--text-primary);
    cursor: pointer; text-decoration: none; transition: background var(--fast);
  }
  .more-drawer-item:hover { background: var(--bg-hover); }
  .more-drawer-item svg { width: 20px; height: 20px; color: var(--text-tertiary); }
  .more-drawer-item.danger { color: var(--error); }
  .more-drawer-item.danger svg { color: var(--error); }

  /* Member items as cards */
  .member-item { border-radius: var(--radius-md); background: var(--bg-card); border: 1px solid var(--border-light); margin-bottom: var(--space-2); }
  .table { display: none; }
  .mobile-card-list { display: block !important; }
}

/* Desktop hides mobile-only elements */
@media (min-width: 769px) {
  .bottom-nav { display: none; }
  .mobile-topbar { display: none; }
  .segmented-control { display: none; }
  .more-drawer, .bottom-sheet, .action-sheet { display: none; }
  .mobile-card-list { display: none; }
  .sticky-cta { display: none; }
}

/* ── ANIMATIONS ── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.animate-in { animation: slideUp var(--normal) both; }

/* ── FOCUS ── */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-dark); }

/* ── ONBOARDING ── */
.onboarding-steps {
  display: flex; flex-direction: column; gap: var(--space-4); margin: var(--space-6) 0;
}
.onboarding-step {
  display: flex; gap: var(--space-4); padding: var(--space-4);
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}
.onboarding-step-num {
  width: 32px; height: 32px; background: var(--primary-light);
  color: var(--primary-dark); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .857rem; flex-shrink: 0;
}
.onboarding-step-num.done { background: var(--success); color: #fff; }

/* ── SUBSCRIPTION REQUIRED ── */
.subscription-required-card { text-align: center; max-width: 480px; margin: 60px auto; }
.subscription-required-card .icon { width: 64px; height: 64px; background: var(--primary-light); border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-4); }
.subscription-required-card .icon svg { width: 32px; height: 32px; color: var(--primary); }

/* ── ERROR PAGES ── */
.error-page { text-align: center; max-width: 480px; margin: 80px auto; }
.error-code { font-size: 6rem; font-weight: 700; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; line-height: 1; margin-bottom: var(--space-4); }

/* ── LGPD ── */
.data-section { margin-bottom: var(--space-6); padding-bottom: var(--space-6); border-bottom: 1px solid var(--border-light); }
.data-section:last-child { border-bottom: none; }
.data-section h3 { margin-bottom: var(--space-3); font-size: 1rem; }

/* ── CELULAS / MEMBROS GRID ── */
.celula-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: var(--space-5);
  box-shadow: var(--shadow-card); transition: box-shadow var(--normal);
}
.celula-card:hover { box-shadow: var(--shadow-md); }
.celula-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-3); }
.celula-name { font-weight: 600; }
.celula-meta { font-size: .786rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 2px; }
.celula-leader { font-size: .857rem; color: var(--text-secondary); }
.celula-stats { display: flex; gap: var(--space-4); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border-light); }
.celula-stat { flex: 1; text-align: center; }
.celula-stat-val { font-size: 1.143rem; font-weight: 700; color: var(--primary-dark); }
.celula-stat-lbl { font-size: .714rem; color: var(--text-muted); }

/* ── FEEDBACK LIST ITEM ── */
.feedback-item {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); box-shadow: var(--shadow-xs);
  transition: box-shadow var(--fast);
}
.feedback-item:hover { box-shadow: var(--shadow-sm); }
.feedback-item-left { flex: 1; min-width: 0; }
.feedback-item-title { font-weight: 600; font-size: .929rem; }
.feedback-item-meta  { font-size: .786rem; color: var(--text-muted); margin-top: 2px; }
.feedback-item-right { display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0; }

/* ── COPY LINK INPUT ── */
.copy-link-wrap {
  display: flex; gap: var(--space-2);
  background: var(--bg-darker); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: var(--space-2) var(--space-3);
  align-items: center;
}
.copy-link-url { flex: 1; font-size: .786rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: none; outline: none; }
.copy-link-btn { flex-shrink: 0; }
