/* ============================================================
   DESIGN SYSTEM — Instagram Dashboard
   Identidade: Sónia Pio (Manual de Marca v1.2)
   Fundo claro, um único bloco escuro (o cabeçalho), papel com fio de ouro.
   ============================================================ */

:root {
  /* Paleta da marca */
  --fundo: #FAF6F7;
  --papel: #FFFFFF;
  --linha: #EFE3E9;
  --vivo: #A81E5B;
  --vinho: #6A1B4D;
  --escuro: #481234;
  --noite: #26091B;
  --ouro: #D6A02F;
  --ouroc: #F0CE86;
  --texto: #26091B;
  --suave: #7A6A72;

  /* Estados dos dados (só para subir, descer e atenção) */
  --sobe: #2E6B4E;
  --desce: #A3343A;
  --atencao: #9A6B12;

  --grad-escuro: linear-gradient(150deg, var(--noite) 0%, var(--escuro) 55%, #5E1943 100%);
  --grao: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.15 0 0 0 0 0.04 0 0 0 0 0.1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grao-claro: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.9 0 0 0 0 0.8 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* Tipografia */
  --serif: 'TeX Gyre Termes', 'TeXGyreTermes', 'Tinos', Times, serif;
  --sans: 'Lato', system-ui, sans-serif;

  /* Raios: um para blocos, cápsula para botões */
  --raio: 14px;
  --capsula: 999px;

  --sombra: 0 10px 30px -12px rgba(38, 9, 27, .18);
  --sombra-alta: 0 18px 40px -16px rgba(38, 9, 27, .28);
  --curva: cubic-bezier(.2, .7, .3, 1);

  /* Nomes antigos usados dentro do JavaScript, apontados para a nova paleta */
  --positive: var(--sobe);
  --negative: var(--desce);
  --text-primary: var(--texto);
  --text-secondary: var(--suave);
  --text-muted: var(--suave);
  --accent: var(--vinho);
  --font-ui: var(--sans);
  --font-display: var(--serif);
}

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

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  background-color: var(--fundo);
  background-image: var(--grao);
  color: var(--texto);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.bg-orb { display: none; }

:focus-visible { outline: 2px solid var(--ouro); outline-offset: 2px; }

/* ============================================================
   CABEÇALHO — o único bloco escuro da página
   ============================================================ */

.header {
  position: relative;
  overflow: hidden;
  background: var(--grao-claro), var(--grad-escuro);
  color: var(--papel);
  padding: 24px 40px 0;
}

/* brilho radial a nascer do canto de cima */
.header::before {
  content: '';
  position: absolute;
  top: -260px;
  right: -180px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 160, 47, .22) 0%, rgba(214, 160, 47, 0) 65%);
  pointer-events: none;
}

/* marca de água no canto */
.header::after {
  content: 'SP';
  position: absolute;
  right: 32px;
  bottom: -46px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 200px;
  line-height: 1;
  color: var(--papel);
  opacity: .05;
  pointer-events: none;
}

.header-top, .header-kpis { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 24px;
}

.header-user { display: flex; align-items: center; gap: 16px; }
.header-name { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ouroc); }

/* Seletor de conta */
.account-switcher { position: relative; z-index: 5; }

.account-switcher-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--ouro);
  border-radius: var(--capsula);
  padding: 6px 14px 6px 6px;
  color: var(--papel);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .4s var(--curva);
}
.account-switcher-btn:hover { transform: translateY(-1px); }
.switcher-arrow { font-size: 10px; color: var(--ouroc); }

.acc-thumb-sm, .acc-thumb {
  border-radius: 50%;
  background: var(--ouroc);
  color: var(--noite);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 400;
  overflow: hidden;
  flex-shrink: 0;
}
.acc-thumb-sm { width: 28px; height: 28px; font-size: 13px; }
.acc-thumb { width: 28px; height: 28px; font-size: 13px; }
.acc-thumb-sm img, .acc-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.account-switcher-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--papel);
  color: var(--texto);
  border-top: 2px solid var(--ouro);
  border-radius: var(--raio);
  box-shadow: var(--sombra-alta);
  overflow: hidden;
}
.account-switcher-dropdown.open { display: block; }

.acc-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer; transition: background .2s; }
.acc-item:hover, .acc-item.active { background: var(--fundo); }
.acc-initial { font-size: 13px; }
.acc-label { font-size: 14px; flex: 1; }
.acc-check { font-size: 13px; color: var(--vinho); font-weight: 700; }
.acc-divider { height: 1px; background: var(--linha); }
.acc-add-btn {
  display: block; width: 100%; padding: 12px 16px; text-align: left;
  background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: 14px; color: var(--vinho);
  text-decoration: underline; text-decoration-color: var(--ouro); text-underline-offset: 4px;
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.header-timestamp { font-size: 12px; color: var(--ouroc); white-space: nowrap; }

.period-badge {
  font-size: 12px;
  color: var(--ouroc);
  border: 1px solid rgba(240, 206, 134, .4);
  border-radius: var(--capsula);
  padding: 4px 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Filtro de período */
.date-filter {
  display: flex;
  gap: 2px;
  border: 1px solid rgba(240, 206, 134, .35);
  border-radius: var(--capsula);
  padding: 3px;
}

.date-filter-btn {
  padding: 5px 14px;
  border-radius: var(--capsula);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  color: var(--ouroc);
  background: transparent;
  transition: background .3s var(--curva), color .3s var(--curva);
}
.date-filter-btn.active { background: var(--papel); color: var(--noite); }
.date-filter-btn:hover:not(.active) { color: var(--papel); }

.custom-range-picker { display: none; align-items: center; gap: 8px; }
.custom-range-picker.visible { display: flex; }

.date-input {
  padding: 5px 12px;
  border-radius: var(--capsula);
  border: 1px solid rgba(240, 206, 134, .4);
  background: transparent;
  color: var(--papel);
  font-family: var(--sans);
  font-size: 12px;
  outline: none;
  color-scheme: dark;
}
.date-input:focus { border-color: var(--ouro); }
.date-separator { color: var(--ouroc); font-size: 12px; }

/* KPIs principais no bloco escuro */
.header-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(214, 160, 47, .35);
}

.header-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 24px 32px 0;
}
.header-kpi + .header-kpi { padding-left: 24px; border-left: 1px solid rgba(214, 160, 47, .2); }
.header-kpi-divider { display: none; }

.header-kpi-value {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  font-weight: 400;
  line-height: 1;
  color: var(--papel);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.header-kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ouro);
  text-transform: uppercase;
  letter-spacing: .16em;
  white-space: nowrap;
}

.header-kpi-trend { font-size: 11px; font-weight: 700; }
.header-kpi-trend.up { color: var(--ouroc); }
.header-kpi-trend.down { color: var(--ouroc); }

/* ============================================================
   BOTÕES
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--capsula);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .4s var(--curva), background-color .4s var(--curva), color .4s var(--curva);
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--vivo); color: var(--papel); }
.btn-primary:hover { background: var(--vinho); transform: translateY(-1px); }

/* secundários: texto com sublinhado ouro, não botão cheio */
.btn-ghost, .btn-danger {
  background: transparent;
  padding: 9px 10px;
  color: var(--vinho);
  text-decoration: underline;
  text-decoration-color: var(--ouro);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.btn-ghost:hover, .btn-danger:hover { color: var(--vivo); }
.header .btn-ghost, .header .btn-danger { color: var(--ouroc); }
.header .btn-ghost:hover, .header .btn-danger:hover { color: var(--papel); }

.btn-sm { padding: 5px 14px; font-size: 12px; }
.btn-lg { padding: 13px 30px; font-size: 15px; }

/* ============================================================
   CONTEÚDO
   ============================================================ */

.dashboard-content {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 40px 96px;
}

.section { margin-bottom: 64px; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.section-eyebrow, .chart-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ouro);
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--texto);
}

/* ============================================================
   MÉTRICAS — uma grelha com divisórias, não um cartão por número
   ============================================================ */

.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--linha);
  border-top: 2px solid var(--ouro);
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: var(--sombra);
}

.metric-card {
  background: var(--papel);
  border-top: 2px solid var(--ouro);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.cards-row > .metric-card {
  border-top: none;
  border-radius: 0;
  box-shadow: none;
  padding: 24px 24px 22px;
  transition: background-color .4s var(--curva);
}
.cards-row > .metric-card:hover { background: var(--fundo); }

.metric-icon { display: none; }

.metric-value {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  color: var(--texto);
  font-variant-numeric: tabular-nums;
  order: 1;
}
.metric-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--suave);
  order: 0;
}
.metric-trend { order: 2; }

.metric-value.positive { color: var(--sobe); }
.metric-value.negative { color: var(--desce); }
.metric-value.accent { color: var(--vinho); }

.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.metric-trend.up { color: var(--sobe); }
.metric-trend.down { color: var(--desce); }
.metric-trend.neutral { color: var(--suave); font-weight: 400; }

/* Recomendações */
.rec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 24px; }
.rec-grid .metric-card { padding: 32px; align-self: start; }
.rec-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; margin-bottom: 16px; order: 0; }
.rec-title.continuar { color: var(--sobe); }
.rec-title.melhorar { color: var(--atencao); }
.rec-title.parar { color: var(--desce); }
.rec-list { list-style: none; color: var(--texto); order: 1; }
.rec-list li { position: relative; padding-left: 20px; margin-bottom: 14px; font-size: 14px; line-height: 1.65; }
.rec-list li::before { content: ''; position: absolute; left: 0; top: .72em; width: 10px; height: 1px; background: var(--ouro); }
.rec-list strong { color: var(--vinho); font-weight: 700; }

/* ============================================================
   GRÁFICOS
   ============================================================ */

.charts-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; }

.chart-card, .glass-card, .heatmap-wrap {
  background: var(--papel);
  border-top: 2px solid var(--ouro);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 32px;
}

.chart-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--texto);
  margin-bottom: 24px;
}

.chart-container { position: relative; height: 240px; }

.evolution-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.evolution-hint { font-size: 13px; color: var(--suave); text-align: center; margin-top: 16px; }

/* ============================================================
   MAPA DE HORÁRIOS
   ============================================================ */

.heatmap-wrap { overflow-x: auto; }

.heatmap-header, .heatmap-row {
  display: grid;
  grid-template-columns: 40px repeat(18, 1fr);
  gap: 3px;
  margin-bottom: 3px;
}

.heatmap-header-cell { font-size: 10px; color: var(--suave); text-align: center; padding: 4px 0; font-variant-numeric: tabular-nums; }

.heatmap-day-label { font-size: 11px; font-weight: 700; color: var(--suave); display: flex; align-items: center; padding-right: 6px; }

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--texto);
  min-width: 28px;
  min-height: 28px;
  background: color-mix(in srgb, var(--vinho) calc(var(--intensity, 0%) * .9), var(--linha));
  font-variant-numeric: tabular-nums;
  transition: transform .3s var(--curva);
}
.heatmap-cell.forte { color: var(--papel); }
.heatmap-cell.empty { background: var(--fundo); }
.heatmap-cell.best { outline: 2px solid var(--ouro); outline-offset: 1px; }
.heatmap-cell:hover:not(.empty) { transform: scale(1.15); position: relative; z-index: 1; }

.heatmap-best { font-size: 14px; color: var(--suave); margin-top: 16px; text-align: center; }
.heatmap-best strong { color: var(--vinho); }

.heatmap-legend {
  font-size: 11px;
  color: var(--suave);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.heatmap-legend-low, .heatmap-legend-high { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.heatmap-legend-low { background: var(--linha); }
.heatmap-legend-high { background: var(--vinho); }

/* ============================================================
   MELHORES PUBLICAÇÕES
   ============================================================ */

.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.post-card {
  background: var(--papel);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform .5s var(--curva), box-shadow .5s var(--curva);
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--sombra-alta); }

.post-thumb-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: var(--linha);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--suave);
  position: relative;
  overflow: hidden;
}
.post-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }

.post-type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--noite);
  color: var(--ouroc);
  font-family: var(--sans);
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--capsula);
  text-transform: uppercase;
  letter-spacing: .14em;
}

.post-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--ouro); }
.post-stat { display: flex; flex-direction: column; align-items: center; padding: 14px 4px; gap: 2px; }
.post-stat + .post-stat { border-left: 1px solid var(--linha); }
.post-stat-value { font-family: var(--serif); font-size: 20px; color: var(--texto); font-variant-numeric: tabular-nums; }
.post-stat-label { font-size: 10px; color: var(--suave); text-transform: uppercase; letter-spacing: .12em; }

/* ============================================================
   AUDIÊNCIA
   ============================================================ */

.audience-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }

.glass-card .section-title { font-size: 22px !important; }

.gender-bar-container { display: flex; flex-direction: column; gap: 24px; }
.gender-row { display: flex; flex-direction: column; gap: 8px; }
.gender-header { display: flex; justify-content: space-between; align-items: baseline; }
.gender-label { font-size: 13px; color: var(--suave); }
.gender-value { font-family: var(--serif); font-size: 26px; font-variant-numeric: tabular-nums; }
.gender-value.female { color: var(--vinho); }
.gender-value.male { color: var(--noite); }

.progress-bar { height: 6px; border-radius: 3px; background: var(--linha); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 3px; transition: width .6s var(--curva); }
.progress-bar-fill.female { background: var(--vinho); }
.progress-bar-fill.male { background: var(--ouro); }

.city-list { display: flex; flex-direction: column; gap: 16px; }
.city-item { display: flex; flex-direction: column; gap: 6px; }
.city-row { display: flex; align-items: baseline; gap: 10px; }
.city-rank { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ouro); width: 16px; flex-shrink: 0; }
.city-name { font-size: 14px; color: var(--texto); flex: 1; }
.city-pct { font-size: 14px; font-weight: 700; color: var(--vinho); font-variant-numeric: tabular-nums; }
.city-bar { width: 100%; height: 3px; background: var(--linha); border-radius: 2px; overflow: hidden; }
.city-bar-fill { height: 100%; background: var(--vinho); border-radius: 2px; transition: width .6s var(--curva); }

.age-display { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; height: 100%; gap: 12px; min-height: 100px; }
.age-value { font-family: var(--serif); font-size: 56px; font-weight: 400; color: var(--vinho); line-height: 1; font-variant-numeric: tabular-nums; }
.age-label { font-size: 13px; color: var(--suave); line-height: 1.5; }

/* ============================================================
   CARREGAMENTO, AVISOS E MENSAGENS
   ============================================================ */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50dvh;
  padding: 96px 24px;
  gap: 16px;
  color: var(--suave);
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  text-align: center;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 2px solid var(--linha);
  border-top-color: var(--ouro);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.token-warning {
  display: none;
  background: var(--papel);
  color: var(--texto);
  border-bottom: 1px solid var(--linha);
  border-left: 3px solid var(--ouro);
  padding: 12px 40px;
  font-size: 14px;
}
.token-warning.visible { display: block; }

.status { display: none; padding: 12px 16px; border-radius: var(--raio); font-size: 14px; margin-top: 12px; background: var(--fundo); border-left: 3px solid; }
.status.visible { display: block; }
.status.success { color: var(--sobe); border-color: var(--sobe); }
.status.error { color: var(--desce); border-color: var(--desce); }
.status.warning { color: var(--atencao); border-color: var(--ouro); }

/* ============================================================
   MOVIMENTO
   ============================================================ */

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.metric-value.animate-in { animation: fadeSlideUp .5s var(--curva) forwards; }
.dashboard-content .section { animation: fadeSlideUp .6s var(--curva) both; }
.header-kpis { animation: fadeSlideUp .6s var(--curva) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   ASSISTENTE DE LIGAÇÃO (index.html)
   ============================================================ */

.wizard-container { max-width: 640px; margin: 0 auto; padding: 64px 16px 96px; min-height: 100dvh; }

.wizard-header { margin-bottom: 40px; }
.wizard-header::before {
  content: 'Painel de Instagram';
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ouro);
  margin-bottom: 12px;
}

.wizard-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--texto);
  margin-bottom: 12px;
}
.wizard-title em { font-style: italic; color: var(--vivo); }
.wizard-subtitle { font-size: 16px; color: var(--suave); max-width: 46ch; }

/* Guia para quem ainda não tem app no Meta */
.guia { margin-top: 40px; }
.guia summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  font-size: 14px;
  color: var(--vinho);
  text-decoration: underline;
  text-decoration-color: var(--ouro);
  text-underline-offset: 5px;
}
.guia summary::-webkit-details-marker { display: none; }
.guia summary:hover { color: var(--vivo); }
.guia[open] summary { margin-bottom: 24px; }
.guia-conteudo { display: grid; gap: 24px; animation: fadeSlideUp .5s var(--curva) both; }
.guia-passo { display: grid; grid-template-columns: 40px 1fr; gap: 16px; }
.guia-numero {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--ouro);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--vinho);
}
.guia-titulo { font-family: var(--serif); font-size: 20px; color: var(--texto); margin: 2px 0 8px; }
.guia .wizard-instructions { margin-bottom: 0; }

.wizard-progress { display: flex; align-items: center; margin-bottom: 24px; }

.wizard-step-indicator {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 15px;
  flex-shrink: 0;
  transition: background-color .4s var(--curva), color .4s var(--curva);
}
.wizard-step-indicator.active { background: var(--vinho); color: var(--papel); }
.wizard-step-indicator.completed { background: var(--ouro); color: var(--noite); }
.wizard-step-indicator.pending { background: var(--papel); color: var(--suave); box-shadow: inset 0 0 0 1px var(--linha); }

.wizard-step-line { flex: 1; height: 1px; background: var(--ouro); opacity: .5; }

.wizard-step { display: none; }
.wizard-step.active {
  display: block;
  background: var(--papel);
  border-top: 2px solid var(--ouro);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 40px;
  animation: fadeSlideUp .5s var(--curva) both;
}

.wizard-step-title { font-family: var(--serif); font-size: 26px; font-weight: 400; color: var(--texto); margin-bottom: 8px; }
.wizard-step-desc { font-size: 15px; color: var(--suave); margin-bottom: 24px; }

.wizard-instructions {
  background: var(--fundo);
  border-radius: var(--raio);
  padding: 20px 24px;
  font-size: 14px;
  color: var(--texto);
  margin-bottom: 16px;
  line-height: 1.8;
}
.wizard-instructions ol, .wizard-instructions ul { padding-left: 20px; }
.wizard-instructions strong { color: var(--vinho); }
.wizard-instructions code { background: var(--papel); padding: 1px 6px; border-radius: 4px; color: var(--vinho); }

.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 24px; }
.wizard-nav > :only-child { margin-left: auto; }
@media (max-width: 480px) { .wizard-nav .btn-lg { width: 100%; } }

.input-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.input-label { font-size: 13px; font-weight: 700; color: var(--texto); }

.input-field {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--texto);
  background: var(--papel);
  outline: none;
  transition: border-color .3s var(--curva);
}
.input-field:focus { border-color: var(--ouro); }
.input-hint { font-size: 12px; color: var(--suave); }

/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (max-width: 1100px) {
  .charts-grid { grid-template-columns: 1fr; }
  .audience-grid { grid-template-columns: 1fr 1fr; }
  .rec-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .header { padding: 16px 16px 0; }
  .header::after { font-size: 140px; right: 12px; }
  .dashboard-content { padding: 40px 16px 64px; }
  .header-top { flex-direction: column; align-items: flex-start; }
  .header-kpis { grid-template-columns: repeat(2, 1fr); }
  .header-kpi { padding: 16px 16px 24px 0; }
  .header-kpi + .header-kpi { padding-left: 16px; }
  .header-kpi:nth-child(odd) { padding-left: 0; border-left: none; }
  .header-kpi:nth-child(n+3) { border-top: 1px solid rgba(214, 160, 47, .2); }
  .cards-row { grid-template-columns: repeat(2, 1fr); }
  .posts-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .audience-grid, .evolution-grid { grid-template-columns: 1fr; }
  .chart-card, .glass-card, .heatmap-wrap { padding: 24px; }
  .custom-range-picker { flex-wrap: wrap; }
  .custom-range-picker.visible { width: 100%; }
  .date-input { flex: 1; min-width: 110px; }
  .heatmap-cell { min-width: 22px; min-height: 22px; font-size: 7px; }
  .heatmap-day-label { font-size: 10px; }
  .wizard-step.active { padding: 24px; }
  .metric-value { font-size: 26px; }
}

/* ============================================================
   CAPA E IMPRESSÃO EM PDF
   ============================================================ */

.pdf-cover { display: none; }

@media print {
  @page { margin: 16mm 12mm; }
  @page :first { margin-top: 0; }

  .bg-orb, .token-warning { display: none !important; }
  .header-actions, .date-filter, .custom-range-picker { display: none !important; }
  #evolutionSection { display: none !important; }

  body { background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .pdf-cover {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    min-height: 100vh;
    page-break-after: always;
    background: var(--grad-escuro) !important;
    margin: -16mm -12mm 0;
    padding: 80px 64px;
  }
  .pdf-cover-emoji { display: none; }
  .pdf-cover-title { font-family: var(--serif); font-size: 44px; font-weight: 400; color: var(--papel) !important; margin-bottom: 8px; }
  .pdf-cover-account { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--ouroc) !important; margin-bottom: 32px; }
  .pdf-cover-period { font-size: 14px; color: var(--ouroc) !important; border: 1px solid var(--ouro); border-radius: 999px; padding: 8px 24px; display: inline-block; }
  .pdf-cover-date { font-size: 12px; color: var(--ouroc) !important; margin-top: 40px; }
  .pdf-cover-brand { font-size: 11px; color: var(--ouro) !important; margin-top: 8px; letter-spacing: .16em; text-transform: uppercase; }

  .header { background: var(--grad-escuro) !important; }
  .dashboard-content { padding: 24px 0 !important; }
  .section { page-break-inside: avoid; margin-bottom: 32px !important; animation: none !important; }
  .cards-row { box-shadow: none !important; }
  .metric-card, .chart-card, .glass-card, .post-card, .heatmap-wrap { box-shadow: none !important; border: 1px solid var(--linha); }
  .charts-grid, .evolution-grid { grid-template-columns: 1fr 1fr !important; }
  .audience-grid { grid-template-columns: 1fr 1fr 1fr !important; }
}
