/* ═══════════════════════════════════════════════════════
   Pauta — Design System v2
   Dark Editorial Studio. Syne + Plus Jakarta Sans + JetBrains Mono.
   Tokens: paleta escura quente, violeta refinado, tipografia com caráter.
   ═══════════════════════════════════════════════════════ */

:root {
  /* ── Backgrounds ── */
  --bg-sidebar:  #07080F;
  --bg-app:      #0B0D16;
  --bg-surface:  #10131E;
  --bg-muted:    #171A27;
  --bg-elevated: #1E2236;

  /* ── Borders ── */
  --border:      rgba(255,255,255,0.07);
  --border-dark: rgba(255,255,255,0.13);

  /* ── Text ── */
  --text-primary:        #EAE6DC;
  --text-secondary:      #747898;
  --text-muted:          #3E4460;
  --text-sidebar:        #4B5070;
  --text-sidebar-active: #EAE6DC;

  /* ── Primary — violeta refinado ── */
  --primary-50:   rgba(139, 121, 244, 0.13);
  --primary-100:  rgba(139, 121, 244, 0.22);
  --primary-500:  #9A88F4;
  --primary-600:  #7C6AE8;
  --primary-700:  #6A5BD4;
  --primary-text: #FFFFFF;

  /* ── Semantic ── */
  --success:    #43C4A1;
  --success-bg: rgba(67, 196, 161, 0.12);
  --warning:    #E8A44C;
  --warning-bg: rgba(232, 164, 76, 0.12);
  --danger:     #E85D6B;
  --danger-bg:  rgba(232, 93, 107, 0.12);
  --ai-accent:  #B070F2;

  /* ── Layout ── */
  --sidebar-width:     224px;
  --sidebar-collapsed: 60px;
  --content-max:       860px;
  --radius-sm:  5px;
  --radius-md:  8px;
  --radius-lg:  14px;

  /* ── Motion ── */
  --t-fast: 140ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 210ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-med:  var(--t-base);

  /* ── Aliases legados (páginas antigas) ── */
  --bg:      var(--bg-app);
  --bg2:     var(--bg-surface);
  --bg3:     var(--bg-muted);
  --bg4:     var(--bg-elevated);
  --border2: var(--border-dark);
  --text:    var(--text-primary);
  --text2:   var(--text-secondary);
  --text3:   var(--text-muted);
  --accent:  var(--primary-600);
  --accent2: var(--primary-700);
  --primary: var(--primary-600);
  --green:   var(--success);
  --amber:   var(--warning);
  --blue:    var(--primary-500);
  --purple:  var(--ai-accent);

  --sidebar-w: var(--sidebar-width);
  --topbar-h:  58px;
  --radius:    var(--radius-md);

  --font-sans:    'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Syne', var(--font-sans);
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

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

html, body {
  height: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary-500); text-decoration: none; }
a:hover { color: var(--primary-600); }

/* Foco visível */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Scrollbar elegante */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08); border-radius: 6px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15); background-clip: content-box;
}

/* ── Utilitárias ──────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fade-in  { animation: fadeIn var(--t-base) both; }

@keyframes fadeIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { from { opacity: 1; }   to { opacity: 0; } }

.hidden  { display: none !important; }
.flex    { display: flex; }
.flex-1  { flex: 1; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.gap-16  { gap: 16px; }
.mb-8    { margin-bottom: 8px; }
.mb-12   { margin-bottom: 12px; }
.mb-16   { margin-bottom: 16px; }
.mb-24   { margin-bottom: 24px; }
.mt-8    { margin-top: 8px; }
.mt-12   { margin-top: 12px; }
.mt-16   { margin-top: 16px; }
.text-muted  { color: var(--text-secondary); }
.text-small  { font-size: 12px; }
.mono        { font-family: var(--font-mono); }
.bold        { font-weight: 600; }
.text-green  { color: var(--success); }
.text-amber  { color: var(--warning); }
.text-accent { color: var(--primary-500); }
.text-blue   { color: var(--primary-500); }
.right       { text-align: right; }
.wrap        { white-space: pre-wrap; }
.center      { text-align: center; }

/* ── Layout / shell ───────────────────────────────────── */
.app-shell, #app { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar, #sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform var(--t-slow);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 18px;
  text-decoration: none;
}
.brand-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(124, 106, 232, 0.45);
  flex-shrink: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.brand-icon svg { width: 16px; height: 16px; display: block; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.025em;
  color: var(--text-sidebar-active);
}

.sidebar-nav { padding: 6px 8px; flex: 1; overflow-y: auto; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text-secondary); }
.nav-item.active {
  background: rgba(124, 106, 232, 0.12);
  color: var(--primary-500);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 7px; bottom: 7px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary-500);
}
.nav-item .nav-icon {
  font-size: 16px; width: 18px; min-width: 18px;
  display: inline-flex; justify-content: center;
}
.nav-item .nav-icon svg { width: 17px; height: 17px; display: block; opacity: 0.75; }
.nav-item.active .nav-icon svg { opacity: 1; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.nav-divider { height: 1px; background: var(--border); margin: 8px 4px; }

.sidebar-job-ctx {
  margin: 6px 10px;
  padding: 11px 13px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.ctx-label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); margin-bottom: 5px;
  font-family: var(--font-display); font-weight: 700;
}
.ctx-title {
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  line-height: 1.35; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctx-status { font-size: 11px; font-family: var(--font-mono); color: var(--primary-500); }

/* Créditos (rodapé sidebar) */
.sidebar-credits {
  margin: 6px 10px 4px;
  padding: 11px 13px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.sidebar-credits:empty { display: none; }
.sidebar-credits.credits-low {
  border-color: rgba(232, 164, 76, 0.35);
  background: rgba(232, 164, 76, 0.06);
}
.credits-label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); margin-bottom: 5px;
  font-family: var(--font-display); font-weight: 700;
}
.credits-value {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  font-family: var(--font-display);
}
.sidebar-credits.credits-low .credits-value { color: var(--warning); }
.credits-sub { font-size: 11px; color: var(--text-sidebar); margin-top: 2px; }

.sidebar-footer { margin-top: auto; }
.sidebar-auth {
  margin: 4px 10px 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.sidebar-auth.hidden { display: none; }
.auth-email-label {
  font-size: 11px; color: var(--text-muted); margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#btn-logout {
  width: 100%; padding: 8px 10px; font-size: 12px; cursor: pointer;
  background: rgba(255,255,255,0.03); color: var(--text-sidebar);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: var(--font-sans); transition: all var(--t-fast);
}
#btn-logout:hover { color: var(--text-secondary); border-color: var(--border-dark); background: rgba(255,255,255,0.06); }

/* Hambúrguer (mobile) */
#sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 1500;
  animation: fadeIn var(--t-base);
}
#hamburger {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 1600;
  width: 40px; height: 40px; align-items: center; justify-content: center;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); cursor: pointer; color: var(--text-secondary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
#hamburger svg { width: 20px; height: 20px; }

/* ── Main ─────────────────────────────────────────────── */
.main-content, #main {
  flex: 1; min-width: 0; display: flex;
  flex-direction: column; overflow: hidden;
  background: var(--bg-app);
}

#topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: rgba(11, 13, 22, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
#topbar-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}
#topbar-actions { display: flex; gap: 8px; align-items: center; }

#page-content { flex: 1; min-width: 0; overflow-y: auto; transition: opacity 100ms ease-out; }
#page-content.page-leaving { opacity: 0; }

/* Coluna editorial centralizada */
.content-area {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 36px 28px;
  width: 100%;
}
.page-h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}
.page-sub { font-size: 14px; color: var(--text-secondary); margin-top: 7px; line-height: 1.55; }
.page-head { margin-bottom: 28px; }

/* Padding para páginas antigas */
#page-content > .card,
#page-content > .section-header,
#page-content > .cost-bar,
#page-content > .plans-page,
#page-content > .table-wrap { margin-left: 28px; margin-right: 28px; }
#page-content > :first-child { margin-top: 28px; }

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.card:hover {
  border-color: var(--border-dark);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4), 0 0 48px rgba(124,106,232,0.04);
}
.card-title {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 16px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  transition: border-color var(--t-fast), transform var(--t-base), box-shadow var(--t-base);
}
.stat-box:hover {
  border-color: var(--border-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}
.stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-family: var(--font-display);
}
.stat-value.accent { color: var(--primary-500); }
.stat-value.green  { color: var(--success); }
.stat-value.amber  { color: var(--warning); }
.stat-value.blue   { color: var(--primary-500); }

/* ── Botões ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-md);
  font-size: 13.5px; font-family: var(--font-sans); font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--t-fast); white-space: nowrap;
  line-height: 1; min-height: 38px; letter-spacing: -0.01em;
}
.btn-primary {
  background: var(--primary-600);
  color: #fff;
  border-color: var(--primary-600);
  box-shadow: 0 2px 10px rgba(124, 106, 232, 0.4), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover {
  background: var(--primary-500);
  border-color: var(--primary-500);
  box-shadow: 0 4px 18px rgba(124, 106, 232, 0.55), inset 0 1px 0 rgba(255,255,255,0.12);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(124,106,232,0.4); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-dark);
}
.btn-secondary:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.22); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 2px 10px rgba(67,196,161,0.35); }
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-danger  { background: var(--danger);  color: #fff; box-shadow: 0 2px 10px rgba(232,93,107,0.35); }
.btn-danger:hover  { filter: brightness(1.1); transform: translateY(-1px); }
.btn-sm     { padding: 6px 12px; font-size: 12.5px; min-height: 30px; }
.btn-lg     { padding: 13px 26px; font-size: 15px; min-height: 48px; }
.btn-block  { width: 100%; }
.btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.link-btn {
  background: none; border: none; cursor: pointer;
  color: var(--primary-500); font-size: 14px; font-weight: 500;
  padding: 4px 0; font-family: var(--font-sans);
}
.link-btn:hover { color: var(--primary-600); text-decoration: underline; }

/* ── Formulários ──────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 11.5px; font-weight: 700;
  color: var(--text-secondary); margin-bottom: 7px;
  text-transform: uppercase; letter-spacing: 0.04em;
  font-family: var(--font-display);
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans); font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  outline: none;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary-600);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-50);
}
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.65; }
.form-select   { cursor: pointer; }

/* ── Tabelas ──────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; padding: 11px 16px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
}
td {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-secondary); vertical-align: top;
}
tr:hover td { background: rgba(255,255,255,0.02); }
tr:last-child td { border-bottom: none; }

/* ── Badges ───────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 9.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.05em;
  font-family: var(--font-display);
}
.badge-idea       { background: var(--primary-50);                     color: var(--primary-500); }
.badge-research   { background: rgba(176, 112, 242, 0.14);              color: var(--ai-accent); }
.badge-outline    { background: var(--warning-bg);                     color: var(--warning); }
.badge-script     { background: var(--warning-bg);                     color: var(--warning); }
.badge-review     { background: var(--danger-bg);                      color: var(--danger); }
.badge-approved   { background: var(--success-bg);                     color: var(--success); }
.badge-tts_preview{ background: var(--success-bg);                     color: var(--success); }
.badge-tts_final  { background: var(--success-bg);                     color: var(--success); }
.badge-packaged   { background: var(--success-bg);                     color: var(--success); }
.badge-pending    { background: rgba(255,255,255,0.05);                 color: var(--text-secondary); }
.badge-rejected   { background: var(--danger-bg);                      color: var(--danger); }
.badge-green      { background: var(--success-bg);                     color: var(--success); }
.badge-red        { background: var(--danger-bg);                      color: var(--danger); }
.badge-amber      { background: var(--warning-bg);                     color: var(--warning); }
.badge-blue       { background: var(--primary-50);                     color: var(--primary-500); }

/* ── Score dots ───────────────────────────────────────── */
.score-bar { display: flex; align-items: center; gap: 8px; }
.score-track { flex: 1; height: 3px; background: var(--bg-elevated); border-radius: 2px; }
.score-fill  { height: 100%; border-radius: 2px; background: var(--primary-600); transition: width var(--t-slow); }
.score-num   { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); min-width: 28px; text-align: right; }

.score-dots { display: inline-flex; align-items: center; gap: 9px; }
.score-dots .dots { display: inline-flex; gap: 4px; }
.score-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bg-elevated); border: 1px solid var(--border-dark);
}
.score-dots .dot.on {
  background: var(--primary-500); border-color: var(--primary-500);
  box-shadow: 0 0 7px rgba(154, 136, 244, 0.55);
}
.score-dots .val {
  font-weight: 700; font-size: 14px; color: var(--text-primary);
  font-family: var(--font-display);
}

.score-wrap { position: relative; display: inline-block; }
.score-tooltip {
  display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--bg-elevated); border: 1px solid var(--border-dark);
  border-radius: var(--radius-md); padding: 12px 14px; min-width: 220px;
  z-index: 100; box-shadow: 0 16px 40px rgba(0,0,0,0.6);
}
.score-wrap:hover .score-tooltip { display: block; }
.tt-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); padding: 4px 0; border-bottom: 1px solid var(--border); }
.tt-row:last-of-type { border-bottom: none; }
.tt-val { font-family: var(--font-mono); color: var(--primary-500); font-weight: 600; }
.tt-rationale { font-size: 10px; color: var(--text-muted); margin-top: 8px; line-height: 1.55; border-top: 1px solid var(--border); padding-top: 6px; }

/* ── Editores / pesquisa / outline ───────────────────── */
.script-editor {
  width: 100%; min-height: 500px; padding: 22px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: var(--font-mono); font-size: 13px; line-height: 1.85;
  resize: vertical; outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.script-editor:focus { border-color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-50); }

.checklist-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer;
  transition: all var(--t-fast);
}
.checklist-item:hover { border-color: var(--border-dark); background: rgba(255,255,255,0.02); }
.checklist-item.checked { border-color: rgba(67,196,161,0.4); background: var(--success-bg); }
.checklist-item input[type=checkbox] { accent-color: var(--success); width: 16px; height: 16px; cursor: pointer; }
.checklist-label { font-size: 14px; }

.audio-player {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.audio-player audio { flex: 1; height: 32px; }
.audio-meta { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

.version-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--bg-surface); font-size: 12.5px; cursor: pointer;
  margin-right: 6px; margin-bottom: 8px; color: var(--text-secondary);
  transition: all var(--t-fast); font-family: var(--font-sans);
}
.version-tab.selected { border-color: rgba(124,106,232,0.5); color: var(--primary-500); background: var(--primary-50); }
.version-tab:hover { border-color: var(--border-dark); color: var(--text-primary); }

.research-section { margin-bottom: 24px; }
.research-section h3 {
  font-size: 10.5px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  font-family: var(--font-display);
}
.research-section p, .research-section pre {
  font-size: 13.5px; line-height: 1.8; color: var(--text-primary);
  background: var(--bg-muted); border-left: 3px solid var(--border-dark);
  padding: 14px 18px; border-radius: 0 var(--radius-md) var(--radius-md) 0;
  white-space: pre-wrap;
}
.fragile-flag { border-left-color: rgba(232, 164, 76, 0.6) !important; }
.risk-flag    { border-left-color: rgba(232, 93, 107, 0.6) !important; }

/* ── Toasts ───────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--bg-elevated); border: 1px solid var(--border-dark);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius-lg); padding: 14px 18px;
  font-size: 13.5px; min-width: 260px; max-width: 380px;
  color: var(--text-primary);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 4px 12px rgba(0,0,0,0.4);
  animation: toastIn 280ms cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}
.toast.leaving { animation: toastOut 200ms ease-in forwards; }
.toast .toast-icon { font-size: 15px; line-height: 1.4; flex-shrink: 0; }
.toast.success { border-left-color: var(--success); }
.toast.success .toast-icon { color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.error   { border-left-color: var(--danger); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.ai      { border-left-color: var(--ai-accent); }
.toast.ai      .toast-icon { color: var(--ai-accent); }
.toast.info    { border-left-color: var(--primary-500); }
.toast.info    .toast-icon { color: var(--primary-500); }

@keyframes toastIn  { from { opacity: 0; transform: translateX(24px) scale(0.97); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); }  to { opacity: 0; transform: translateX(24px); } }

/* ── Loading overlay ──────────────────────────────────── */
#loading-overlay {
  position: fixed; inset: 0;
  background: rgba(7, 8, 14, 0.75); backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 9000; gap: 20px;
}
#loading-overlay.hidden { display: none; }
.loading-spinner {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary-500);
  box-shadow: -22px 0 0 var(--bg-elevated), 22px 0 0 var(--bg-elevated);
  animation: loadingPulse 1.1s ease-in-out infinite;
}
@keyframes loadingPulse {
  0%, 100% { transform: scale(0.8); box-shadow: -22px 0 0 var(--bg-elevated), 22px 0 0 var(--bg-elevated); }
  50%       { transform: scale(1);   box-shadow: -22px 0 0 var(--primary-500), 22px 0 0 var(--primary-500); }
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg { font-size: 14px; color: var(--text-secondary); font-family: var(--font-display); }

/* ── Modal genérico ───────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.72);
  z-index: 2000; animation: fadeIn var(--t-base);
  backdrop-filter: blur(3px);
}
.modal-box {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 2001; width: min(460px, calc(100vw - 32px)); max-height: 84vh; overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 80px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.05);
}
.modal-body { font-size: 14px; color: var(--text-secondary); line-height: 1.65; }

/* ── Section header / empty / pills / collapse / cost ─── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 12px; }
.section-header h2 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.025em; color: var(--text-primary);
}
.section-actions { display: flex; gap: 8px; }

.empty-state { text-align: center; padding: 64px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 34px; margin-bottom: 14px; opacity: 0.35; }
.empty-state p { font-size: 14px; margin-bottom: 18px; color: var(--text-secondary); }

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pill {
  padding: 4px 11px; border-radius: 20px; font-size: 11px;
  background: var(--bg-muted); border: 1px solid var(--border); color: var(--text-secondary);
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em;
}

.collapse-header {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  user-select: none; font-family: var(--font-display);
}
.collapse-header:hover { color: var(--text-primary); }
.collapse-body { padding-top: 14px; }

.cost-bar {
  display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 16px;
  background: var(--bg-muted); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 18px; font-size: 12px;
}
.cost-item { color: var(--text-secondary); }
.cost-item span { color: var(--warning); font-family: var(--font-mono); font-weight: 600; }

.flag-verify { color: var(--warning);  font-family: var(--font-mono); font-size: 10px; background: var(--warning-bg); padding: 1px 6px; border-radius: 3px; }
.flag-review { color: var(--primary-500); font-family: var(--font-mono); font-size: 10px; background: var(--primary-50); padding: 1px 6px; border-radius: 3px; }

/* ── Planos / pagamentos ──────────────────────────────── */
.plans-page { max-width: 1100px; width: 100%; margin: 0 auto; padding: 36px 28px; }
.plans-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.plans-toolbar h2 {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700; margin-bottom: 5px;
  letter-spacing: -0.025em;
}
.plans-section { margin-bottom: 32px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 16px; }
.pricing-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
  min-height: 260px; display: flex; flex-direction: column; gap: 16px;
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
}
.pricing-card:hover { border-color: var(--border-dark); box-shadow: 0 8px 32px rgba(0,0,0,0.45); transform: translateY(-2px); }
.pricing-card.compact { min-height: 200px; }
.pricing-card.current-card { border-color: rgba(124,106,232,0.45); background: rgba(124,106,232,0.06); }
.pricing-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pricing-card h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.pricing-price { font-family: var(--font-mono); font-size: 18px; color: var(--text-primary); white-space: nowrap; }
.plan-badges { min-height: 22px; display: flex; gap: 6px; flex-wrap: wrap; }
.pricing-list { list-style: none; color: var(--text-secondary); display: grid; gap: 9px; }
.pricing-list li::before { content: "→"; color: var(--primary-500); margin-right: 8px; font-size: 12px; }
.pricing-actions { margin-top: auto; display: flex; }
.pricing-actions .btn { width: 100%; }
.payment-status {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 11px 14px; margin-bottom: 18px;
  color: var(--text-primary); background: var(--bg-muted); font-size: 13.5px;
}
.payment-status.info    { border-color: rgba(154,136,244,0.4);  color: var(--primary-500); background: var(--primary-50); }
.payment-status.warn    { border-color: rgba(232,164,76,0.4);   color: var(--warning);     background: var(--warning-bg); }
.payment-status.error   { border-color: rgba(232,93,107,0.4);   color: var(--danger);      background: var(--danger-bg); }
.payment-status.success { border-color: rgba(67,196,161,0.4);   color: var(--success);     background: var(--success-bg); }
.pix-box { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface); padding: 20px; margin-top: 10px; }
.pix-qr { width: min(220px, 100%); aspect-ratio: 1; display: block; background: #fff; border-radius: var(--radius-md); padding: 8px; border: 1px solid var(--border); }
.pricing-card.free-plan    { opacity: 0.8; }
.pricing-card.paid-plan    { border-color: var(--border-dark); }
.pricing-card.plan-starter { border-color: rgba(124,106,232,0.45); box-shadow: 0 0 0 1px rgba(124,106,232,0.15), 0 8px 32px rgba(124,106,232,0.1); }
.plan-usage        { font-size: 18px; line-height: 1.3; font-weight: 700; color: var(--text-primary); font-family: var(--font-display); }
.plan-limitation   { font-size: 12px; color: var(--text-secondary); background: var(--bg-muted); border-radius: var(--radius-sm); padding: 8px 10px; }
.credit-section    { opacity: 0.92; }
.credit-package-card { min-height: 170px; }

/* ── Landing pública ──────────────────────────────────── */
#public-landing { position: fixed; inset: 0; z-index: 9000; overflow-y: auto; background: var(--bg-app); color: var(--text-primary); }
.landing-page { min-height: 100%; background: var(--bg-app); }
.landing-hero {
  min-height: 76vh; padding: 32px 36px 64px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124,106,232,0.12), transparent),
    var(--bg-app);
  border-bottom: 1px solid var(--border);
}
.landing-nav { max-width: 1120px; margin: 0 auto 56px; display: flex; justify-content: space-between; align-items: center; }
.landing-hero-grid {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.7fr);
  gap: 64px; align-items: center;
}
.landing-kicker {
  font-family: var(--font-display);
  color: var(--primary-500); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px;
}
.landing-copy h1 {
  font-family: var(--font-display);
  font-size: 72px; line-height: 0.93; font-weight: 800;
  margin-bottom: 24px; color: var(--text-primary);
  letter-spacing: -0.04em;
}
.landing-lead { font-size: 18px; line-height: 1.6; color: var(--text-secondary); max-width: 520px; margin-bottom: 32px; }
.landing-actions { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.landing-note { color: var(--text-muted); font-size: 12.5px; }
.landing-preview {
  background: var(--bg-surface); border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: 0 32px 72px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.04);
  display: grid; gap: 12px;
}
.preview-title {
  font-family: var(--font-display);
  font-size: 10px; font-weight: 700; color: var(--primary-500);
  text-transform: uppercase; letter-spacing: 0.09em;
}
.preview-row {
  display: grid; grid-template-columns: 30px 1fr; gap: 4px 12px; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-muted); transition: all var(--t-fast);
}
.preview-row span {
  grid-row: 1 / span 2; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); color: var(--text-muted);
  font-weight: 800; font-family: var(--font-display); font-size: 12px;
}
.preview-row.active { border-color: rgba(124,106,232,0.4); background: var(--primary-50); }
.preview-row.active span { background: var(--primary-600); color: #fff; box-shadow: 0 2px 10px rgba(124,106,232,0.5); }
.preview-row b  { color: var(--text-primary); font-size: 13.5px; font-weight: 600; }
.preview-row em { color: var(--text-secondary); font-style: normal; font-size: 11.5px; }
.landing-flow, .landing-plans { max-width: 1120px; margin: 0 auto; padding: 56px 36px; }
.landing-flow h2 {
  font-family: var(--font-display);
  font-size: 30px; line-height: 1.2; max-width: 580px; margin-bottom: 28px;
  letter-spacing: -0.025em; font-weight: 700;
}
.landing-flow-grid, .landing-plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.landing-flow-grid article, .landing-plan {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-base);
}
.landing-flow-grid article:hover, .landing-plan:hover {
  border-color: var(--border-dark);
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  transform: translateY(-2px);
}
.landing-flow-grid b, .landing-plan h3 {
  display: block; font-size: 15px; margin-bottom: 9px; color: var(--text-primary);
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em;
}
.landing-flow-grid span, .landing-plan p { color: var(--text-secondary); font-size: 13.5px; line-height: 1.65; }
.landing-plan strong {
  display: block; font-size: 18px; line-height: 1.3; margin-bottom: 9px;
  color: var(--text-primary); font-family: var(--font-display); font-weight: 700;
  letter-spacing: -0.02em;
}
.landing-plan.featured { border-color: rgba(124,106,232,0.4); box-shadow: 0 0 0 1px rgba(124,106,232,0.15), 0 10px 36px rgba(124,106,232,0.1); }
.landing-plan.muted { background: var(--bg-muted); opacity: 0.84; }

/* ── Dashboard de ativação ────────────────────────────── */
.dashboard-empty {
  max-width: 980px; margin: 0 auto; padding: 64px 28px;
  display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  gap: 56px; align-items: center;
}
.dashboard-empty-copy h1 {
  font-family: var(--font-display);
  font-size: 36px; line-height: 1.15; margin-bottom: 14px;
  letter-spacing: -0.03em; font-weight: 700;
}
.dashboard-empty-copy p:not(.landing-kicker) { color: var(--text-secondary); font-size: 16px; max-width: 520px; margin-bottom: 24px; line-height: 1.65; }
.activation-steps {
  display: grid; gap: 2px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.activation-step {
  display: grid; grid-template-columns: 32px 1fr; gap: 4px 14px; padding: 14px 16px;
  background: var(--bg-surface); transition: background var(--t-fast);
}
.activation-step span {
  grid-row: 1 / span 2; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); color: var(--text-muted);
  font-weight: 800; font-family: var(--font-display); font-size: 13px;
}
.activation-step.done { background: rgba(124,106,232,0.06); }
.activation-step.done span { background: var(--primary-600); color: #fff; box-shadow: 0 3px 10px rgba(124,106,232,0.45); }
.activation-step b  { color: var(--text-primary); font-size: 14px; font-weight: 600; }
.activation-step em { color: var(--text-secondary); font-style: normal; font-size: 12px; }

/* ══════════════════════════════════════════════════════
   COMPONENTES NOVOS
   ══════════════════════════════════════════════════════ */

/* ── Pipeline tracker ─────────────────────────────────── */
.pipeline-tracker {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0;
  background: rgba(7, 8, 15, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px; overflow-x: auto; height: 44px;
}
.pipeline-tracker.hidden { display: none; }
.pl-step {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px;
  color: var(--text-muted); white-space: nowrap; border: 0;
  background: transparent; font-family: var(--font-sans); padding: 0;
  min-height: 32px; cursor: pointer; transition: color var(--t-fast); font-weight: 500;
}
.pl-step:hover:not(:disabled) { color: var(--text-secondary); }
.pl-step .pl-dot {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; background: var(--bg-elevated); color: var(--text-muted);
  border: 1px solid var(--border-dark); font-weight: 800;
  font-family: var(--font-display);
}
.pl-step.done { color: var(--success); }
.pl-step.done .pl-dot { background: var(--success-bg); color: var(--success); border-color: rgba(67,196,161,0.4); }
.pl-step.current { color: var(--primary-500); font-weight: 600; }
.pl-step.current .pl-dot {
  background: var(--primary-600); color: #fff; border-color: var(--primary-600);
  box-shadow: 0 0 0 0 rgba(124, 106, 232, 0.5);
  animation: pulsePl 2s ease-in-out infinite;
}
.pl-step.current .pl-dot::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pl-step:disabled { cursor: default; opacity: 0.38; }
.pl-line { flex: 0 0 24px; height: 1px; background: var(--border); margin: 0 8px; }
.pl-line.done { background: rgba(67, 196, 161, 0.45); }

@keyframes pulsePl { 0%,100% { box-shadow: 0 0 0 0 rgba(124,106,232,0); } 50% { box-shadow: 0 0 0 4px rgba(124,106,232,0.25); } }
@keyframes pulse   { 0%,100% { box-shadow: 0 0 0 0 rgba(154,136,244,0.5); } 50% { box-shadow: 0 0 0 5px rgba(154,136,244,0); } }

/* ── Onboarding ───────────────────────────────────────── */
#onboarding-root { position: fixed; inset: 0; z-index: 1000; background: var(--bg-app); overflow-y: auto; }
.ob-wrap { max-width: 640px; margin: 0 auto; padding: 60px 28px 88px; }
.ob-wrap.narrow { max-width: 560px; }
.ob-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 48px; }
.ob-h1 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700; line-height: 1.2;
  color: var(--text-primary); margin-bottom: 10px; letter-spacing: -0.03em;
}
.ob-help { font-size: 14.5px; color: var(--text-secondary); margin-bottom: 32px; line-height: 1.65; }
.ob-foot { font-size: 13px; color: var(--text-muted); margin-top: 22px; }

.ob-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ob-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 20px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer; transition: all var(--t-base); text-align: left;
}
.ob-card:hover {
  border-color: rgba(124,106,232,0.4);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45), 0 0 36px rgba(124,106,232,0.08);
  transform: translateY(-2px);
}
.ob-card .ob-ico {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--primary-50); color: var(--primary-500);
  display: flex; align-items: center; justify-content: center;
}
.ob-card .ob-ico svg { width: 22px; height: 22px; }
.ob-card .ob-label { font-size: 14px; font-weight: 700; color: var(--text-primary); font-family: var(--font-display); }

.ob-ref-field { margin-bottom: 10px; }
.ob-ref-input { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ob-ref-input .form-input { flex: 1; }
.ob-ref-title { font-size: 13px; color: var(--success); margin: -2px 0 12px; display: flex; gap: 6px; align-items: center; }
.ob-actions { margin-top: 32px; display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.ob-actions .link-btn { align-self: center; }

#ob-analyze {
  position: fixed; inset: 0; z-index: 1100; background: var(--bg-app);
  display: flex; align-items: center; justify-content: center;
}
.ob-analyze-box { width: min(420px, 90vw); }
.ob-step { display: flex; align-items: center; gap: 14px; font-size: 15px; color: var(--text-muted); padding: 12px 0; opacity: 0.35; transition: opacity var(--t-base); }
.ob-step.active { opacity: 1; color: var(--text-primary); }
.ob-step.done   { opacity: 1; color: var(--text-secondary); }
.ob-step .ob-step-ico { width: 22px; height: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.ob-step.done .ob-step-ico { color: var(--success); }
.ob-step .mini-spin { width: 16px; height: 16px; border: 2px solid var(--border-dark); border-top-color: var(--primary-500); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* Perguntas de perfil */
.q-block { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 16px; background: var(--bg-surface); }
.q-title { font-size: 16px; font-weight: 700; margin-bottom: 5px; font-family: var(--font-display); letter-spacing: -0.02em; }
.q-intro { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.q-opt { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: all var(--t-fast); }
.q-opt:hover { border-color: var(--border-dark); background: rgba(255,255,255,0.02); }
.q-opt.sel { border-color: rgba(124,106,232,0.5); background: var(--primary-50); }
.q-opt-label  { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; font-family: var(--font-display); }
.q-opt-excerpt{ font-size: 13px; font-style: italic; color: var(--text-secondary); line-height: 1.6; }
.q-opt-source { font-size: 12px; color: var(--text-muted); text-align: right; margin-top: 6px; }
.q-rec { font-size: 13px; color: var(--primary-500); background: var(--primary-50); border-radius: var(--radius-sm); padding: 8px 12px; margin-top: 4px; }

.profile-summary { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 8px; }
.profile-summary .ps-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--bg-surface); }
.profile-summary .ps-k { font-size: 13px; color: var(--text-secondary); }
.profile-summary .ps-v { font-size: 14px; font-weight: 600; color: var(--text-primary); text-align: right; font-family: var(--font-display); }

/* ── Ideas (cards) ────────────────────────────────────── */
.ideas-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 10px; }
.idea-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  display: flex; flex-direction: column; gap: 12px;
}
.idea-card:hover {
  border-color: rgba(124,106,232,0.28);
  box-shadow: 0 10px 36px rgba(0,0,0,0.45), 0 0 0 1px rgba(124,106,232,0.1);
  transform: translateY(-2px);
}
.idea-card .ic-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700; color: var(--text-primary);
  line-height: 1.3; letter-spacing: -0.025em;
}
.idea-card .ic-angle { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }
.idea-card .ic-why   { font-size: 13px; color: var(--text-secondary); line-height: 1.65; }
.idea-card .ic-why b { color: var(--text-primary); font-weight: 600; }
.idea-card .ic-cta { align-self: flex-start; }
.idea-card:hover .ic-cta.btn-secondary {
  background: var(--primary-600); color: #fff;
  border-color: var(--primary-600);
  box-shadow: 0 2px 10px rgba(124,106,232,0.45);
}

/* Fundamentação factual */
.idea-factual-badge {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 8px 12px; background: var(--bg-muted);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 12px; color: var(--text-secondary); line-height: 1.45;
}
.idea-factual-badge .badge-icon { flex-shrink: 0; margin-top: 1px; }
.idea-verify-badge {
  padding: 8px 12px; border-radius: var(--radius-md); font-size: 12px;
  color: var(--warning); line-height: 1.45;
  background: var(--warning-bg); border: 1px solid rgba(232,164,76,0.3);
}
.idea-card:hover .ic-cta.btn-secondary { background: var(--primary-600); color: var(--primary-text); border-color: var(--primary-600); }

/* Skeletons */
.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-elevated) 37%, var(--bg-muted) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-card { padding: 22px 26px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-surface); margin-bottom: 14px; }
.sk-line  { height: 14px; margin-bottom: 11px; }

/* Estado de loading AI */
.ai-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 72px 20px; gap: 22px; text-align: center; }
.ai-loading .ai-dots { display: inline-flex; gap: 7px; }
.ai-loading .ai-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-500); animation: bounce 1.2s infinite ease-in-out; }
.ai-loading .ai-dots i:nth-child(2) { animation-delay: 0.15s; }
.ai-loading .ai-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%,80%,100% { transform: scale(0.6); opacity: 0.38; } 40% { transform: scale(1); opacity: 1; } }
.ai-loading .ai-msg { font-size: 15px; color: var(--text-secondary); font-family: var(--font-display); letter-spacing: -0.01em; }

/* ── Coach marks ──────────────────────────────────────── */
#coach-overlay { position: fixed; inset: 0; z-index: 3000; }
#coach-overlay .coach-hole { position: absolute; border-radius: var(--radius-md); box-shadow: 0 0 0 9999px rgba(0,0,0,0.68); transition: all var(--t-slow); pointer-events: none; }
.coach-balloon {
  position: absolute; z-index: 3001; width: min(300px, 86vw);
  background: var(--bg-elevated); border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg); padding: 20px 22px;
  box-shadow: 0 20px 56px rgba(0,0,0,0.75);
}
.coach-balloon h4 { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin-bottom: 7px; color: var(--text-primary); letter-spacing: -0.015em; }
.coach-balloon p  { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.coach-balloon .coach-foot  { display: flex; align-items: center; justify-content: space-between; }
.coach-balloon .coach-count { font-size: 12px; color: var(--text-muted); }

/* ── Auth ─────────────────────────────────────────────── */
#auth-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124,106,232,0.09), transparent),
    var(--bg-app);
  font-family: var(--font-sans); padding: 24px;
}
.auth-card {
  background: var(--bg-surface); border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg); padding: 44px 40px;
  width: 400px; max-width: 100%; color: var(--text-primary);
  box-shadow: 0 32px 80px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.04);
}
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700; margin-bottom: 28px;
  color: var(--text-primary); letter-spacing: -0.025em;
}
.auth-card h1 {
  font-family: var(--font-display);
  margin: 0 0 20px; font-weight: 700; font-size: 24px;
  line-height: 1.2; letter-spacing: -0.025em;
}
.auth-detail { margin-top: 18px; font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.65; }
.auth-switch { margin-top: 20px; font-size: 13px; color: var(--text-secondary); text-align: center; }
.auth-switch a { color: var(--primary-500); text-decoration: none; font-weight: 600; margin-left: 6px; }
.auth-switch a:hover { color: var(--primary-600); text-decoration: underline; }
.auth-msg { padding: 11px 14px; border-radius: var(--radius-md); font-size: 13px; margin-bottom: 16px; }
.auth-msg.error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(232,93,107,0.3); }
.auth-msg.success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(67,196,161,0.3); }

@keyframes flashSuccess {
  0%   { border-color: rgba(67,196,161,0.65); box-shadow: 0 0 0 2px rgba(67,196,161,0.2); }
  100% { border-color: var(--border); box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
}
.flash-success { animation: flashSuccess 500ms ease-out; }

/* ── Responsivo ───────────────────────────────────────── */
@media (max-width: 768px) {
  #hamburger { display: flex; }
  #sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1550;
    transform: translateX(-100%);
  }
  #sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,0.85); }
  #sidebar.open ~ #sidebar-overlay,
  #app.nav-open #sidebar-overlay { display: block; }
  #topbar { padding-left: 72px; }
  .content-area { padding: 24px 18px; }
  .plans-page { padding: 24px 18px; max-width: none; }
  .pricing-grid { min-width: 0; }
  .pricing-card { min-width: 0; }
  .pricing-card-head { flex-direction: column; align-items: flex-start; }
  .pricing-price { white-space: normal; }
  #page-content > .card,
  #page-content > .section-header,
  #page-content > .cost-bar,
  #page-content > .plans-page,
  #page-content > .table-wrap { margin-left: 0; margin-right: 0; }
  .ob-card-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; }
  .plans-page { overflow-x: hidden; }
  .plans-toolbar p { max-width: 32ch; }
  .payment-status, .pricing-card { max-width: calc(100vw - 32px); }
  .plans-toolbar { flex-direction: column; width: 100%; min-width: 0; }
  .plans-toolbar > div { width: 100%; min-width: 0; }
  .plans-toolbar p, .payment-status { overflow-wrap: anywhere; }
  .landing-hero { padding: 24px 20px 48px; }
  .landing-nav { margin-bottom: 40px; }
  .landing-hero-grid, .dashboard-empty { grid-template-columns: 1fr; gap: 32px; }
  .landing-copy h1 { font-size: 52px; }
  .landing-lead { font-size: 16px; }
  .landing-flow, .landing-plans { padding: 40px 20px; }
  .landing-flow-grid, .landing-plan-grid { grid-template-columns: 1fr; }
  .landing-preview { min-width: 0; }
  .dashboard-empty { padding: 40px 18px; }
  .idea-brief { grid-template-columns: 1fr; }
  .idea-brief-main { padding: 20px; }
}
@media (max-width: 420px) {
  .ob-card-grid { grid-template-columns: 1fr 1fr; }
  .ob-wrap { padding: 40px 18px 72px; }
}

/* ── Banner de retenção ───────────────────────────────── */
.retention-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--primary-50);
  border: 1px solid rgba(124, 106, 232, 0.25);
  border-radius: var(--radius-lg); padding: 14px 18px;
  margin-bottom: 18px; font-size: 13.5px;
}
.retention-icon { color: var(--primary-500); font-size: 14px; flex-shrink: 0; }
.retention-text { flex: 1; color: var(--text-primary); min-width: 180px; }
.retention-text strong { color: var(--primary-500); }
.retention-banner .btn { flex-shrink: 0; }

/* ── Painel de pesquisa manual ────────────────────────── */
.manual-research-panel {
  background: var(--bg-surface);
  border: 1.5px solid rgba(232, 164, 76, 0.35);
  border-radius: var(--radius-lg);
  padding: 22px; margin-bottom: 22px;
  animation: fadeIn var(--t-base) ease;
}
.mrp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mrp-title  { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--text-primary); font-family: var(--font-display); }
.mrp-icon   { font-size: 18px; }
.mrp-desc   { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.6; }
.mrp-drop-zone {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 2px dashed var(--border-dark); border-radius: var(--radius-md);
  padding: 24px 16px; cursor: pointer; text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast);
  background: var(--bg-muted);
}
.mrp-drop-zone:hover, .mrp-drop-zone.drag-over { border-color: var(--primary-600); background: var(--primary-50); }
.mrp-drop-zone.has-file { border-style: solid; border-color: rgba(67,196,161,0.5); }
.mrp-drop-icon { font-size: 24px; opacity: 0.4; }
.mrp-drop-text { font-size: 13px; color: var(--text-secondary); }
.mrp-file-name { font-size: 12px; color: var(--text-muted); text-align: center; }
.mrp-file-name.success { color: var(--success); font-weight: 600; }
.mrp-file-name.error   { color: var(--danger); }
.mrp-file-name.hidden  { display: none; }
.mrp-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0; color: var(--text-muted); font-size: 12px;
}
.mrp-divider::before, .mrp-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.mrp-textarea { resize: vertical; min-height: 120px; font-size: 13px; line-height: 1.65; }
.mrp-char-count { font-size: 11px; color: var(--text-muted); text-align: right; margin-top: 4px; font-family: var(--font-mono); }
.mrp-char-count.over-limit { color: var(--danger); font-weight: 600; }

/* ── Idea brief ───────────────────────────────────────── */
.idea-brief {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px; align-items: stretch; max-width: 860px;
}
.idea-brief-main, .idea-brief-aside {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.idea-brief-main { padding: 26px; }
.idea-topic-input {
  min-height: 54px; font-size: 17px; font-weight: 700;
  font-family: var(--font-display); letter-spacing: -0.02em;
}
.idea-brief-actions { display: flex; justify-content: flex-start; margin-top: 20px; }
.idea-brief-aside {
  padding: 22px; background: var(--bg-muted);
  display: flex; flex-direction: column; gap: 12px;
}
.idea-brief-aside strong {
  color: var(--text-primary); font-size: 18px; line-height: 1.25;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em;
}
.idea-brief-aside p { color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.brief-chip {
  width: fit-content; border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 10px; color: var(--text-muted); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-display);
}
