/* ============================================================
   MAPA DE OPORTUNIDADES — Design System v4
   Midnight Ink + Fraunces + Inter
   Botocenter: Sage (#58A898) · Verde profundo (#00564A) · Verde-escuro (#00342B)
   ============================================================ */

/* ═══════════════════════════════════════
   prefers-reduced-motion — desativa todas as animações
═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg-base); color: var(--text-md); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; outline: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ── TOKENS — Botocenter (verde-escuro + teal sage, tema misto) ── */
:root {
  /* Fundos: base clara levemente esverdeada + superfícies brancas */
  --bg-base:    #F4F7F5;   /* off-white esverdeado — fundo do conteúdo */
  --bg-surface: #FFFFFF;   /* painéis / cards */
  --bg-raised:  #EDF2EF;   /* hover suave / chips */
  --bg-hover:   #E3EBE7;   /* hover mais marcado */
  --bg-card:    #FFFFFF;   /* cards flutuantes */

  /* Verde-escuro Botocenter (hero, topbar, CTA) */
  --ink-deep:   #001008;   /* verde quase preto */
  --ink-green:  #00342B;   /* verde profundo */
  --ink-green2: #00564A;   /* verde médio-escuro (hero) */
  --ink-panel:  #103A38;   /* superfície escura (seções dark) */

  /* Bordas: tinta esverdeada com baixa opacidade */
  --border:     rgba(0,52,43,0.10);
  --border-md:  rgba(0,52,43,0.16);
  --border-hi:  rgba(0,52,43,0.24);
  --border-dark:rgba(255,255,255,0.12); /* sobre fundos escuros */

  /* Teal/Sage Botocenter — acento primário (= âmbar antigo) */
  --amber:      #58A898;   /* sage do logo (mantém nome p/ compat.) */
  --amber-lt:   #7EC4B4;
  --amber-dk:   #3C8576;
  --amber-glow: rgba(88,168,152,0.16);

  /* Verde profundo — acento de dados (= teal antigo) */
  --teal:       #00564A;
  --teal-lt:    #2AA0AA;
  --teal-dk:    #00342B;
  --teal-glow:  rgba(0,86,74,0.10);

  /* Sage claro — categoria terciária (= violeta antigo) */
  --violet:     #5FA195;
  --violet-lt:  #8FBDB4;
  --violet-dk:  #3C8576;

  /* Verde — positivo */
  --green:      #1E9E6A;
  --green-lt:   #4FBF8E;

  /* Coral suave — alerta/saturado (contraste com o verde) */
  --rose:       #E0654E;

  /* Texto: tinta verde-escura sobre claro */
  --text-hi:    #04211B;   /* títulos / números */
  --text-md:    #4A5C56;   /* corpo / labels */
  --text-lo:    #8AA39B;   /* legendas / sutil */

  /* Texto sobre fundos escuros */
  --text-on-dark-hi: #F2F5F2;
  --text-on-dark-md: #A9C4BC;
  --text-on-dark-lo: #6E8B82;

  /* Fontes */
  --font-display: 'Fraunces', Georgia, serif;
  --font-ui:      'Inter', system-ui, sans-serif;

  /* Sombras (cards sobre base clara, tom esverdeado) */
  --shadow-sm:  0 1px 2px rgba(0,33,27,0.05), 0 1px 3px rgba(0,33,27,0.07);
  --shadow-md:  0 2px 8px rgba(0,33,27,0.07), 0 8px 24px rgba(0,33,27,0.06);
  --shadow-lg:  0 4px 16px rgba(0,33,27,0.10), 0 16px 48px rgba(0,33,27,0.10);
  --shadow-map: 0 12px 40px rgba(0,86,74,0.14), 0 4px 12px rgba(0,33,27,0.07);

  /* Espaços */
  --top-h:      64px;
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══════════════════════════════════════
   TOPBAR
═══════════════════════════════════════ */
.topbar {
  position: fixed; inset: 0 0 auto 0;
  height: var(--top-h);
  background: linear-gradient(100deg, var(--ink-deep) 0%, var(--ink-green2) 100%);
  border-bottom: 1px solid rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  z-index: 300;
  box-shadow: 0 2px 16px rgba(0,16,8,0.25);
}

.tb-brand { display: flex; align-items: center; gap: 14px; }

.tb-logo {
  height: 30px; width: auto;
  display: flex; align-items: center;
  flex-shrink: 0;
}
.tb-logo img { height: 30px; width: auto; display: block; }

.tb-title { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-on-dark-hi); }
.tb-sub   { font-size: 10px; color: var(--text-on-dark-md); letter-spacing: 0.02em; margin-top: 2px; }

.tb-nav { display: flex; gap: 4px; }

.tb-btn {
  font-size: 13px; font-weight: 500; color: var(--text-on-dark-md);
  padding: 8px 18px; border-radius: 999px;
  transition: all 160ms var(--ease-out);
  letter-spacing: 0.01em;
}
.tb-btn:hover  { background: rgba(255,255,255,0.08); color: var(--text-on-dark-hi); }
.tb-btn.active { background: var(--amber); color: var(--ink-deep); font-weight: 600; }

/* ═══════════════════════════════════════
   LAYOUT GERAL
═══════════════════════════════════════ */
#app {
  padding-top: var(--top-h);
  min-height: 100vh;
}

.screen { display: none; }
.screen.active { display: block; }

/* ═══════════════════════════════════════
   SCREEN: BRASIL (visão geral)
═══════════════════════════════════════ */
.brasil-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 20px;
  height: calc(100vh - var(--top-h));
  overflow: hidden;
  padding: 20px;
  background: var(--bg-base);
}

/* Painel Esquerdo — card flutuante */
.panel-left {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.pl-header {
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pl-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--text-lo); text-transform: uppercase; margin-bottom: 14px;
}

/* Proc Cards */
.proc-list { display: flex; flex-direction: column; gap: 8px; }

.proc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  cursor: pointer;
  transition: all 200ms var(--ease-out);
  position: relative;
  overflow: hidden;
}
.proc-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: transparent;
  transition: background 200ms;
}
.proc-card:hover { background: var(--bg-raised); border-color: var(--border-md); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.proc-card.active {
  background: var(--amber-glow);
  border-color: rgba(88,168,152,0.45);
  box-shadow: var(--shadow-sm);
}
.proc-card.active::before { background: var(--amber); }

.pc-name { font-size: 13px; font-weight: 700; color: var(--text-hi); line-height: 1.2; }
.pc-sub  { font-size: 10px; color: var(--text-lo); margin-top: 2px; letter-spacing: 0.04em; text-transform: uppercase; }
.pc-score-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 7px;
}
.pc-score {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  color: var(--teal);
  line-height: 1;
}
.pc-score.high  { color: var(--amber-dk); }
.pc-score.mid   { color: var(--amber); }
.pc-score.low   { color: var(--text-md); }
.pc-vol { font-size: 10px; color: var(--text-lo); }
.pc-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  padding: 2px 6px; border-radius: 3px; text-transform: uppercase;
}
.badge-s { background: rgba(196,181,253,0.12); color: var(--violet-lt); }
.badge-a { background: var(--teal-glow); color: var(--teal); }
.badge-b { background: rgba(88,168,152,0.12);  color: var(--amber-lt); }
.badge-c { background: rgba(16,185,129,0.10);  color: var(--green-lt); }

/* Seletor temporal */
.time-section {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.time-tabs {
  display: flex; gap: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 3px;
}
.tt-btn {
  flex: 1; font-size: 12px; font-weight: 600;
  color: var(--text-md); padding: 5px 0; border-radius: 5px;
  transition: all 150ms;
}
.tt-btn.active { background: var(--amber); color: #000; font-weight: 700; }
.tt-btn:hover:not(.active) { background: var(--bg-hover); color: var(--text-hi); }

/* Termos de busca */
.terms-section {
  flex: 1; overflow-y: auto;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.terms-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--text-lo); text-transform: uppercase;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.terms-label i { color: var(--amber); font-size: 9px; }

.term-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.term-item:last-child { border-bottom: none; }

.term-kw {
  font-size: 12px; color: var(--text-md);
  flex: 1;
}
.term-kw strong { color: var(--text-hi); font-weight: 600; }

.term-vol {
  font-size: 11px; font-weight: 700;
  font-family: var(--font-display);
  color: var(--teal);
  margin-left: 8px;
  white-space: nowrap;
}

.term-bar {
  width: 50px; height: 3px;
  background: var(--bg-hover);
  border-radius: 2px;
  margin-left: 8px;
  overflow: hidden;
}
.term-bar-fill {
  height: 100%; border-radius: 2px;
  background: var(--teal);
  transition: width 600ms var(--ease-out);
}

/* Painel Central — Mapa (a estrela: canvas de papel flutuante) */
.panel-center {
  display: flex; flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.map-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.map-crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-lo);
  font-family: var(--font-display);
}
.crumb-item {
  color: var(--text-md); cursor: pointer;
  padding: 2px 4px; border-radius: 4px;
  transition: color 150ms;
}
.crumb-item:hover { color: var(--amber-dk); }
.crumb-item.current { color: var(--text-hi); font-weight: 600; cursor: default; }
.crumb-sep { color: var(--text-lo); }

.map-period-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--amber-dk);
  background: var(--amber-glow);
  border: 1px solid rgba(88,168,152,0.28);
  border-radius: 999px;
  padding: 5px 14px;
}

.map-area {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(0,86,74,0.05), transparent 70%),
    var(--bg-surface);
}

#brazilMap {
  width: 100%; height: 100%;
  max-width: 680px;
  filter: drop-shadow(0 12px 32px rgba(0,86,74,0.12));
}

/* Paths do mapa (D3) */
.state-path {
  stroke: #F4F7F5;
  stroke-width: 1;
  transition: fill 300ms ease, filter 200ms ease;
  cursor: pointer;
}
.state-path:hover {
  filter: brightness(1.06) drop-shadow(0 4px 10px rgba(0,86,74,0.35));
  stroke: #00564A;
  stroke-width: 1.4;
}
.state-path.selected {
  stroke: #00564A;
  stroke-width: 2;
  filter: brightness(1.04) drop-shadow(0 6px 14px rgba(0,86,74,0.4));
}

.map-label-g text {
  pointer-events: none;
  font-family: 'Inter', sans-serif;
}

/* Painel Direito — card flutuante */
.panel-right {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.pr-header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pr-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-lo); text-transform: uppercase; }
.pr-subtitle { font-size: 16px; font-weight: 700; color: var(--text-hi); margin-top: 3px; font-family: var(--font-display); }

.pr-score-row {
  display: flex; align-items: baseline; gap: 8px; margin-top: 8px;
}
/* hero score em âmbar (combina com o mapa) */
.pr-score-big {
  font-family: var(--font-display);
  font-size: 4rem; font-weight: 900; line-height: 1;
  color: var(--amber-dk);
  transition: color 300ms;
}
.pr-score-info { display: flex; flex-direction: column; gap: 2px; }
.pr-score-label { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-lo); text-transform: uppercase; }
.pr-score-tier  { font-size: 12px; font-weight: 600; color: var(--amber-dk); }

.pr-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 12px 0; margin-top: 4px;
}
.pr-stat {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
}
.pr-stat-val { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text-hi); }
.pr-stat-lbl { font-size: 9px; color: var(--text-lo); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }

/* Lista de ranking */
.rank-list { flex: 1; overflow-y: auto; padding: 0 0 8px; min-height: 0; }

.rank-section-hdr {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--text-lo); text-transform: uppercase;
  padding: 12px 20px 6px;
  flex-shrink: 0;
}

.rank-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 130ms;
  border-left: 3px solid transparent;
}
.rank-row:hover { background: var(--bg-raised); border-left-color: var(--amber); }
.rank-row.active { background: var(--bg-hover); border-left-color: var(--amber); }

.rr-num {
  font-size: 10px; font-weight: 700; color: var(--text-lo);
  width: 18px; flex-shrink: 0; text-align: right;
}
.rr-info { flex: 1; min-width: 0; }
.rr-name {
  font-size: 12.5px; font-weight: 600; color: var(--text-hi);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rr-sub { font-size: 10px; color: var(--text-lo); margin-top: 1px; white-space: nowrap; }
.rr-score-col { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.rr-bar { width: 4px; height: 28px; border-radius: 999px; background: var(--amber); opacity: 0.85; }
.rr-score {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  color: var(--amber-dk); width: 30px; text-align: right; line-height: 1;
}

.pr-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px;
  flex-shrink: 0;
}
.btn-back {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--text-md);
  padding: 9px 12px; border: 1px solid var(--border-md); border-radius: 999px;
  transition: all 150ms;
}
.btn-back:hover { background: var(--bg-raised); color: var(--text-hi); }

.btn-explore {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--amber); padding: 9px 12px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(88,168,152,0.35);
  transition: all 150ms;
}
.btn-explore:hover { background: var(--amber-lt); }

/* ═══════════════════════════════════════
   SCREEN INTERNOS (Região / Estado / Cidade)
   Item 1: Layout 2 colunas com sidebar sticky
═══════════════════════════════════════ */
#screen-estado,
#screen-cidade {
  display: none;
}
#screen-estado.active,
#screen-cidade.active {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: calc(100vh - var(--top-h));
  overflow: hidden;
}

/* Sidebar sticky nas telas internas */
.inner-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: sticky;
  top: 0;
  height: calc(100vh - var(--top-h));
}

/* Conteúdo scrollável à direita */
.inner-scroll {
  overflow-y: auto;
  height: calc(100vh - var(--top-h));
}

.inner-screen {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 28px 80px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-lo);
  margin-bottom: 22px;
}
.bc-item { cursor: pointer; color: var(--text-md); padding: 2px 0; transition: color 150ms; }
.bc-item:hover { color: var(--amber); }
.bc-item.current { color: var(--text-hi); font-weight: 600; cursor: default; }
.bc-sep { color: var(--text-lo); }

/* Hero Header */
.inner-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.ih-eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--amber); text-transform: uppercase;
  margin-bottom: 8px;
}
.ih-eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
  animation: pulse 2s infinite;
}

.ih-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 700; line-height: 1.2;
  color: var(--text-hi);
  letter-spacing: -0.02em;
}
.ih-title em { font-style: italic; color: var(--amber); }

.ih-desc { font-size: 13px; color: var(--text-md); line-height: 1.65; margin-top: 10px; max-width: 560px; }

.ih-score-block {
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-md);
  border-radius: 14px;
  padding: 18px 24px;
  min-width: 140px;
}
.ih-score-num {
  font-family: var(--font-display);
  font-size: 4.5rem; font-weight: 900; line-height: 1;
  color: var(--teal);
  transition: color 300ms;
}
.ih-score-lbl { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-lo); text-transform: uppercase; margin-top: 4px; }
.ih-score-tier { font-size: 12px; font-weight: 600; color: var(--teal); margin-top: 2px; }

/* KPIs — Item 5: 3 colunas fixas, height 100px */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
  height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.kpi-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(0,86,74,0.03));
  pointer-events: none;
}
.kpi-card.highlight { border-color: rgba(88,168,152,0.30); background: rgba(88,168,152,0.06); }

.kpi-icon { font-size: 14px; color: var(--amber); margin-bottom: 8px; }
.kpi-val  { font-family: var(--font-display); font-size: 1.65rem; font-weight: 800; color: var(--text-hi); line-height: 1; }
.kpi-lbl  { font-size: 10px; color: var(--text-lo); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-sub  { font-size: 11px; color: var(--text-md); margin-top: 3px; }

/* Seção genérica */
.section { margin-bottom: 32px; }
.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 600; color: var(--text-hi);
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.section-title i { color: var(--amber); font-size: 0.85rem; }

/* Tabela de dados */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.09em;
  color: var(--text-lo); text-transform: uppercase;
  padding: 8px 14px; text-align: left;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 11px 14px; font-size: 12.5px; color: var(--text-md);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-raised); }
.data-table .td-name   { font-weight: 600; color: var(--text-hi); }
.data-table .td-score  { font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.data-table .td-trend  { font-weight: 600; }
.data-table .td-trend.up   { color: var(--green); }
.data-table .td-trend.down { color: var(--rose); }

/* Score bar inline */
.score-bar-wrap { display: flex; align-items: center; gap: 8px; }
.score-bar {
  flex: 1; height: 4px; background: var(--bg-hover);
  border-radius: 2px; overflow: hidden; min-width: 60px;
}
.score-bar-fill { height: 100%; border-radius: 2px; transition: width 600ms var(--ease-out); }

/* Cards de cidades — Item 6: 3 colunas fixas */
.city-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.city-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 200ms var(--ease-out);
  position: relative;
  overflow: hidden;
}
.city-card:hover {
  border-color: var(--border-md);
  background: var(--bg-raised);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.city-card.top-1 {
  border-color: rgba(88,168,152,0.32);
  background: rgba(88,168,152,0.06);
}
.city-rank {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-lo); text-transform: uppercase;
  margin-bottom: 6px;
}
.city-name { font-size: 15px; font-weight: 700; color: var(--text-hi); margin-bottom: 2px; }
.city-uf-tag {
  display: inline-block; font-size: 9px; font-weight: 700;
  color: var(--text-lo); background: var(--bg-hover);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 1px 5px; margin-bottom: 10px;
}
.city-score-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.city-score {
  font-family: var(--font-display); font-size: 2.2rem; font-weight: 900; line-height: 1;
  color: var(--teal);
}
.city-score-sub { font-size: 10px; color: var(--text-lo); }

.city-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.city-stat { display: flex; flex-direction: column; gap: 1px; }
.city-stat-val { font-size: 12px; font-weight: 700; color: var(--text-hi); }
.city-stat-lbl { font-size: 9px; color: var(--text-lo); text-transform: uppercase; letter-spacing: 0.04em; }

/* Termos no inner screen */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.term-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
.term-card-kw { flex: 1; font-size: 12.5px; color: var(--text-md); }
.term-card-kw strong { color: var(--text-hi); font-weight: 600; display: block; }
.term-card-kw span   { font-size: 10px; color: var(--text-lo); margin-top: 1px; display: block; }
.term-card-vol {
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  color: var(--teal); white-space: nowrap;
}

/* Score tier badges */
.tier-badge {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  width: 26px; height: 26px; border-radius: 6px;
}
.tier-S { background: rgba(196,181,253,0.15); color: var(--violet-lt); border: 1px solid rgba(196,181,253,0.3); }
.tier-A { background: rgba(103,232,249,0.12); color: var(--teal-lt);   border: 1px solid rgba(103,232,249,0.3); }
.tier-B { background: rgba(88,168,152,0.14);  color: var(--amber-lt);  border: 1px solid rgba(88,168,152,0.32); }
.tier-C { background: rgba(16,185,129,0.10);  color: var(--green-lt);  border: 1px solid rgba(16,185,129,0.25); }
.tier-D { background: rgba(244,63,94,0.10);   color: #fda4af;          border: 1px solid rgba(244,63,94,0.25); }

/* ═══════════════════════════════════════
   SCREEN: METODOLOGIA
═══════════════════════════════════════ */
.metod-wrap {
  max-width: 900px; margin: 0 auto; padding: 48px 28px 80px;
}

.metod-hero { text-align: center; margin-bottom: 48px; }
.metod-pill {
  display: inline-block; font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--amber); background: var(--amber-glow);
  border: 1px solid rgba(88,168,152,0.22);
  border-radius: 4px; padding: 4px 12px; margin-bottom: 14px;
}
.metod-title {
  font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700; color: var(--text-hi); letter-spacing: -0.02em; margin-bottom: 14px;
}
.metod-intro { font-size: 15px; color: var(--text-md); line-height: 1.72; max-width: 600px; margin: 0 auto; }

.metod-section { margin-bottom: 44px; }
.metod-section-hdr {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 600;
  color: var(--text-hi); margin-bottom: 20px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.metod-section-hdr i { color: var(--amber); font-size: 1rem; }

.steps-list { display: flex; flex-direction: column; gap: 12px; }
.step-item {
  display: flex; gap: 16px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
}
.step-num {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 900;
  color: var(--amber); opacity: 0.5; line-height: 1;
  flex-shrink: 0; width: 36px;
}
.step-content strong { display: block; font-size: 13.5px; font-weight: 700; color: var(--text-hi); margin-bottom: 5px; }
.step-content p { font-size: 12.5px; color: var(--text-md); line-height: 1.65; }

.caveat-box {
  display: flex; gap: 12px;
  background: rgba(88,168,152,0.06);
  border: 1px solid rgba(88,168,152,0.20);
  border-radius: 8px; padding: 14px 16px;
}
.caveat-box i { color: var(--amber); flex-shrink: 0; margin-top: 2px; }
.caveat-box p { font-size: 12px; color: var(--text-md); line-height: 1.65; }

.dims-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.dim-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.dim-pct { font-family: var(--font-display); font-size: 2.2rem; font-weight: 900; line-height: 1; }
.dim-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.dim-card h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--text-hi); }
.dim-card p  { font-size: 12px; color: var(--text-md); line-height: 1.6; flex: 1; }
.dim-sources { display: flex; gap: 5px; flex-wrap: wrap; }
.dim-sources span {
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text-lo); background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: 3px; padding: 2px 7px;
}

.tier-table { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tier-row {
  display: grid; grid-template-columns: 44px 76px 1fr 1fr;
  gap: 12px; align-items: center;
  padding: 10px 18px; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-md);
}
.tier-row:last-child { border-bottom: none; }
.tier-hdr { font-size: 9px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-lo); background: var(--bg-base); }
.tscore { font-family: var(--font-display); font-size: 13px; font-weight: 700; }

.sources-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px 22px; margin-bottom: 14px; }
.src-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-md); }
.src-item i { font-size: 9px; color: var(--text-lo); }
.src-note { font-size: 11px; color: var(--text-lo); font-style: italic; }

/* ═══════════════════════════════════════
   TOOLTIP MAPA
═══════════════════════════════════════ */
.map-tooltip {
  position: fixed; z-index: 9999; pointer-events: none;
  background: var(--bg-raised);
  border: 1px solid var(--border-md);
  border-radius: 10px; padding: 12px 14px;
  min-width: 200px; max-width: 260px;
  opacity: 0; transform: translateY(4px) scale(0.97);
  transition: opacity 120ms, transform 120ms;
  box-shadow: var(--shadow-lg);
}
.map-tooltip.show { opacity: 1; transform: translateY(0) scale(1); }
.tt-name { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text-hi); margin-bottom: 7px; }
.tt-row  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tt-lbl  { font-size: 10px; color: var(--text-lo); text-transform: uppercase; letter-spacing: 0.04em; }
.tt-val  { font-size: 12.5px; font-weight: 700; font-family: var(--font-display); color: var(--teal); }
.tt-hint { font-size: 9.5px; color: var(--text-lo); border-top: 1px solid var(--border); padding-top: 6px; margin-top: 6px; }

/* ═══════════════════════════════════════
   LEGENDA DO MAPA — redesenhada (Item 8)
═══════════════════════════════════════ */
.map-legend {
  position: absolute; bottom: 44px; left: 20px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 13px 16px;
  min-width: 220px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.legend-title {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--text-lo); text-transform: uppercase; margin-bottom: 9px;
}
.legend-gradient-wrap { margin-bottom: 5px; }
.legend-gradient-bar {
  height: 8px; border-radius: 999px; margin-bottom: 5px;
  background: linear-gradient(to right,
    #DDE8E4 0%,
    #C2D8D1 18%,
    #8FBDB4 38%,
    #58A898 56%,
    #3C8576 74%,
    #00564A 88%,
    #00342B 100%
  );
}
.legend-gradient-labels {
  display: flex; justify-content: space-between;
  font-size: 8.5px; color: var(--text-lo); line-height: 1.2;
}
.legend-gradient-labels span:first-child  { text-align: left; max-width: 60px; }
.legend-gradient-labels span:nth-child(2) { text-align: center; }
.legend-gradient-labels span:last-child   { text-align: right; max-width: 60px; }
.legend-scale-labels {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text-lo);
  margin-top: 3px;
}

/* Rodapé do mapa */
.map-footer-note {
  position: absolute; bottom: 14px; left: 20px;
  font-size: 9px; color: var(--text-lo);
  display: flex; align-items: center; gap: 5px;
  pointer-events: none;
}
.map-footer-note i { font-size: 8px; color: var(--amber); }

/* ═══════════════════════════════════════
   ANIMAÇÕES
═══════════════════════════════════════ */
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--amber); }
  50%       { opacity: 0.4; box-shadow: 0 0 2px var(--amber); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.anim-fade-up { animation: fadeUp 360ms var(--ease-out) both; }
.d-0  { animation-delay: 0ms; }
.d-1  { animation-delay: 60ms; }
.d-2  { animation-delay: 120ms; }
.d-3  { animation-delay: 180ms; }
.d-4  { animation-delay: 240ms; }
.d-5  { animation-delay: 300ms; }
.d-6  { animation-delay: 360ms; }
.d-7  { animation-delay: 420ms; }

/* ═══════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 2px; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 1100px) {
  .brasil-layout { grid-template-columns: 240px 1fr 270px; }
}
@media (max-width: 900px) {
  .brasil-layout { grid-template-columns: 220px 1fr; }
  .panel-right   { display: none; }
}
@media (max-width: 640px) {
  .brasil-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .panel-left { display: none; }
  .inner-hero { grid-template-columns: 1fr; }
  .tier-row { grid-template-columns: 36px 60px 1fr; }
  .tier-row > :last-child { display: none; }
  .sources-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════
   BADGE "↑ EM ALTA" — Item 8: verde-água #00d4b4, 10px, padding 2×6px
═══════════════════════════════════════ */
.badge-em-alta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
  color: #0c4a35;
  background: rgba(30,158,106,0.16);
  border-radius: 4px; padding: 2px 6px;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(0,212,180,0.35);
  animation: pulse-badge 2.5s ease-in-out infinite;
}
.badge-em-alta.badge-xs { font-size: 9px; padding: 1px 5px; }
@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 8px rgba(0,212,180,0.35); }
  50%       { box-shadow: 0 0 14px rgba(0,212,180,0.6); }
}

/* Linha do proc-card com badge */
.pc-name-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 2px;
}
.pc-right { display: flex; align-items: center; gap: 5px; }

/* Linha do term-item com badge e sparkline */
.term-item-left {
  display: flex; flex-direction: column; gap: 3px;
  flex: 1; min-width: 0;
}
.term-item-right {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}

/* Linha kw com badge */
.term-kw-row {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}

/* term-card right */
.term-card-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

/* ═══════════════════════════════════════
   SPARKLINES — Item 9: 32×80px, stroke 2px, área gradiente, dot final
═══════════════════════════════════════ */
.sparkline {
  display: block; flex-shrink: 0;
  overflow: visible;
  width: 80px; height: 32px;
}

/* ═══════════════════════════════════════
   SCORE MODAL (Item 16)
═══════════════════════════════════════ */
.score-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,29,41,0.45);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms;
}
.score-modal-overlay.show {
  opacity: 1; pointer-events: all;
}
.score-modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-hi);
  border-radius: 16px;
  padding: 28px 28px 24px;
  max-width: 480px; width: 92vw;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform 250ms var(--ease-spring);
}
.score-modal-overlay.show .score-modal-box {
  transform: translateY(0) scale(1);
}
.score-modal-header {
  display: flex; align-items: flex-start; gap: 16px;
  margin-bottom: 24px;
}
.score-modal-header > div:first-child { flex: 1; }
.score-modal-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-lo); margin-bottom: 4px;
}
.score-modal-title {
  font-family: var(--font-display); font-size: 1.05rem;
  font-weight: 700; color: var(--text-hi);
}
.score-modal-big {
  font-family: var(--font-display); font-size: 3.5rem; font-weight: 900;
  line-height: 1; color: var(--teal);
}
.score-modal-close {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-md);
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all 150ms; cursor: pointer;
}
.score-modal-close:hover { background: var(--bg-hover); color: var(--text-hi); }

.score-modal-dims { display: flex; flex-direction: column; gap: 14px; }
.sdim-row {}
.sdim-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px;
}
.sdim-head i { font-size: 12px; width: 16px; text-align: center; flex-shrink: 0; }
.sdim-lbl { font-size: 12px; font-weight: 600; color: var(--text-md); flex: 1; }
.sdim-frac {
  font-family: var(--font-display); font-size: 18px; font-weight: 800;
  line-height: 1;
}
.sdim-max { font-size: 11px; font-weight: 400; color: var(--text-lo); }
.sdim-bar-track {
  height: 5px; border-radius: 3px; background: var(--bg-hover); overflow: hidden;
}
.sdim-bar-fill { height: 100%; border-radius: 3px; transition: width 600ms var(--ease-out); }

.score-modal-note {
  margin-top: 20px; font-size: 11px; color: var(--text-lo);
  display: flex; align-items: center; gap: 6px;
  border-top: 1px solid var(--border); padding-top: 14px;
}

/* Botão drill score no painel direito */
.score-drill-btn {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-lo); font-size: 11px;
  padding: 4px 7px; cursor: pointer; transition: all 150ms;
  margin-left: 8px; align-self: center;
}
.score-drill-btn:hover { background: var(--bg-hover); color: var(--teal); border-color: var(--teal); }

/* Score number clicável nos internos */
.score-clickable {
  cursor: pointer; transition: opacity 150ms;
}
.score-clickable:hover { opacity: 0.8; text-decoration: underline dotted; }

/* ═══════════════════════════════════════
   COMPARAR PROCEDIMENTOS (Item 14)
═══════════════════════════════════════ */
.compare-overlay {
  position: fixed; inset: 0;
  background: rgba(26,29,41,0.4);
  backdrop-filter: blur(4px);
  z-index: 1800;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms;
}
.compare-overlay.show { opacity: 1; pointer-events: all; }
.compare-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-hi);
  border-radius: 16px; padding: 24px;
  max-width: 520px; width: 92vw;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 250ms var(--ease-spring);
}
.compare-overlay.show .compare-box { transform: translateY(0); }
.compare-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.compare-title {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  color: var(--text-hi); display: flex; align-items: center; gap: 8px;
}
.compare-title i { color: var(--amber); }
.compare-close {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-md);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; transition: all 150ms;
}
.compare-close:hover { background: var(--bg-hover); color: var(--text-hi); }
.compare-selectors {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 10px;
}
.cmp-sel-col { flex: 1; }
.cmp-sel-lbl { font-size: 9px; font-weight: 700; color: var(--text-lo); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 4px; }
.cmp-sel-val { font-size: 14px; font-weight: 700; color: var(--text-hi); }
.cmp-vs { color: var(--amber); font-size: 14px; }
.cmp-select {
  background: var(--bg-hover); border: 1px solid var(--border-md);
  border-radius: 6px; color: var(--text-hi); font-size: 13px;
  padding: 6px 10px; font-family: var(--font-ui); width: 100%;
  cursor: pointer;
}
.cmp-select:focus { outline: 2px solid var(--amber); }
.cmp-table { width: 100%; border-collapse: collapse; }
.cmp-table th {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-lo);
  padding: 8px 12px; text-align: left;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
}
.cmp-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.cmp-table tr:last-child td { border-bottom: none; }
.cmp-lbl { font-size: 12px; color: var(--text-md); }
.cmp-val { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text-hi); }
.compare-note { font-size: 10px; color: var(--text-lo); margin-top: 14px; text-align: center; }

/* ═══════════════════════════════════════
   BOTÃO EXPORTAR (Item 13)
═══════════════════════════════════════ */
.section-export { text-align: right; }
.btn-export {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-hi); background: var(--bg-raised);
  border: 1px solid var(--border-md);
  border-radius: 8px; padding: 9px 18px;
  cursor: pointer; transition: all 160ms;
}
.btn-export:hover {
  background: var(--bg-hover); border-color: var(--teal); color: var(--teal);
}
.btn-export i { color: var(--teal); }

/* ═══════════════════════════════════════
   BOTÕES TOOLTIP BIOESTIMULADORES (Item 5)
═══════════════════════════════════════ */
.bio-q-btn, .bio-score-tip, .score-tip-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-lo); font-size: 12px;
  padding: 2px; transition: color 150ms;
  line-height: 1;
}
.bio-q-btn:hover, .bio-score-tip:hover, .score-tip-btn:hover { color: var(--amber); }

/* Tooltip body text */
.tt-body {
  font-size: 11px; color: var(--text-md); line-height: 1.55;
  margin-top: 5px;
}

/* Nota ranking */
.rank-note {
  font-size: 10px; color: var(--text-lo); line-height: 1.5;
  padding: 8px 10px; margin-bottom: 6px;
  background: rgba(0,86,74,0.05);
  border: 1px solid rgba(0,86,74,0.12);
  border-radius: 7px;
  display: flex; gap: 7px; align-items: flex-start;
}
.rank-note i { color: var(--teal); margin-top: 1px; flex-shrink: 0; font-size: 9px; }

/* Header do ranking com sub */
.rank-hdr-sub {
  display: block; font-size: 8px; font-weight: 500;
  color: var(--text-lo); margin-top: 2px; font-style: italic;
  letter-spacing: 0.02em; text-transform: none;
}

/* rank-section-hdr — definido na seção do panel-right */

/* City card rank row */
.city-rank-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}

/* ═══════════════════════════════════════
   CSS DE IMPRESSÃO / EXPORT (Item 13)
═══════════════════════════════════════ */
@media print {
  body { background: #fff !important; color: #111 !important; font-size: 12px; }
  .topbar, .panel-left, #compareBtn, .btn-export,
  .section-export, .score-modal-overlay, .compare-overlay,
  .map-tooltip, .breadcrumb .bc-item:not(.current) { display: none !important; }
  .screen { display: block !important; }
  #screen-brasil, #screen-estado.active ~ *  { display: none !important; }
  .inner-screen {
    padding: 20px 0 40px !important;
    max-width: 100% !important;
  }
  .kpi-card, .city-card, .term-card {
    border: 1px solid #ddd !important;
    background: #fafafa !important;
    break-inside: avoid;
  }
  .data-table th, .data-table td {
    border: 1px solid #ddd !important;
    color: #333 !important;
  }
  .ih-title { font-size: 1.4rem !important; color: #111 !important; }
  .ih-score-num { color: #0369A1 !important; }
  .kpi-val, .city-score, .td-score { color: #0369A1 !important; }
  .section-title { color: #111 !important; border-color: #ddd !important; }
  @page { margin: 15mm; }
}

/* ═══════════════════════════════════════
   ITEM 4: Time-tabs inline (acima dos proc cards)
═══════════════════════════════════════ */
.pl-time-inline {
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════
   ITEM 1: Inner sidebar (estado/cidade)
═══════════════════════════════════════ */
.inner-sidebar .pl-header {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.inner-sidebar .terms-section {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════
   ITEM 2: Botão "← Voltar" contextual
═══════════════════════════════════════ */
.btn-back-context {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 500; color: var(--text-md);
  border: 1px solid var(--border-md);
  border-radius: 7px; padding: 5px 12px;
  cursor: pointer; transition: all 150ms;
  margin-bottom: 18px;
  background: none;
}
.btn-back-context:hover {
  background: var(--bg-raised); color: var(--text-hi);
  border-color: var(--teal);
}
.btn-back-context i { font-size: 10px; }

/* ═══════════════════════════════════════
   ITEM 3: Fade do conteúdo ao trocar procedimento
═══════════════════════════════════════ */
.inner-scroll {
  transition: opacity 200ms ease;
}
.inner-scroll.fading {
  opacity: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════
   ITEM 7: Divisor painel nacional / ranking
═══════════════════════════════════════ */
.rank-divider {
  height: 1px;
  background: var(--border);
  margin: 0 20px 4px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   ITEM 10: Score dentro da barra
═══════════════════════════════════════ */
.score-bar-wrap-v2 {
  position: relative;
  display: flex;
  align-items: center;
}
.score-bar-v2 {
  flex: 1; height: 20px;
  background: var(--bg-hover);
  border-radius: 4px; overflow: hidden;
  min-width: 80px;
}
.score-bar-fill-v2 {
  height: 100%; border-radius: 4px;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 6px;
  transition: width 600ms var(--ease-out);
  min-width: 32px;
}
.score-bar-num {
  font-size: 11px; font-weight: 700; color: var(--text-hi);
  font-family: var(--font-display); white-space: nowrap;
  line-height: 1;
}

/* ═══════════════════════════════════════
   ITEM 11: Gráfico de área Chart.js
═══════════════════════════════════════ */
.area-chart-section {
  margin-bottom: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 10px;
}
.area-chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.area-chart-title {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--text-lo); text-transform: uppercase;
}
.area-chart-container {
  height: 120px; position: relative;
}

/* ═══════════════════════════════════════
   ITEM 13: Barra proporção regional em cidade
═══════════════════════════════════════ */
.regional-bar-wrap {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.regional-bar-label {
  font-size: 11px; color: var(--text-md); flex-shrink: 0; min-width: 120px;
}
.regional-bar-track {
  flex: 1; height: 8px; background: var(--bg-hover);
  border-radius: 4px; overflow: hidden;
}
.regional-bar-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--teal), var(--teal-lt));
  transition: width 600ms var(--ease-out);
}
.regional-bar-pct {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  color: var(--teal); flex-shrink: 0; min-width: 38px; text-align: right;
}

/* ═══════════════════════════════════════
   ITEM 14: Donut SVG no score block
═══════════════════════════════════════ */
.ih-score-block {
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-md);
  border-radius: 14px;
  padding: 18px 24px;
  min-width: 160px;
  position: relative;
}
.score-donut-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px; height: 90px;
  margin: 0 auto;
}
.score-donut-svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.score-donut-num {
  font-family: var(--font-display);
  font-size: 2.2rem; font-weight: 900; line-height: 1;
  position: relative; z-index: 1;
  cursor: pointer;
  transition: color 300ms;
}
.score-donut-num:hover { opacity: 0.8; }

/* ═══════════════════════════════════════
   B2B: Seção Público Endereçável (TAM/SAM/SOM)
═══════════════════════════════════════ */
.b2b-section {
  margin-bottom: 32px;
}
.b2b-section-title {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 600; color: var(--text-hi);
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.b2b-section-title i { color: var(--amber); font-size: 0.85rem; }

/* Funil TAM/SAM/SOM */
.funnel-wrap {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  position: relative;
}
.funnel-wrap::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, rgba(88,168,152,0.18), rgba(0,86,74,0.18), rgba(30,158,106,0.18));
  transform: translateX(-50%);
  z-index: 0;
}
.funnel-row {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex; align-items: center; gap: 16px;
  position: relative; z-index: 1;
  transition: border-color 200ms;
}
.funnel-row:hover { border-color: var(--border-md); }
.funnel-row.tam { width: 100%; border-left: 3px solid var(--amber); }
.funnel-row.sam { width: 85%; border-left: 3px solid var(--teal); }
.funnel-row.som { width: 70%; border-left: 3px solid var(--green); }
.funnel-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.funnel-icon.tam { background: rgba(88,168,152,0.14); color: var(--amber); }
.funnel-icon.sam { background: rgba(0,86,74,0.10); color: var(--teal); }
.funnel-icon.som { background: rgba(16,185,129,0.10); color: var(--green); }
.funnel-body { flex: 1; }
.funnel-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-lo); margin-bottom: 2px;
}
.funnel-num {
  font-family: var(--font-display); font-size: 1.8rem; font-weight: 900;
  line-height: 1; margin-bottom: 2px;
}
.funnel-num.tam { color: var(--amber); }
.funnel-num.sam { color: var(--teal); }
.funnel-num.som { color: var(--green); }
.funnel-lbl { font-size: 11.5px; color: var(--text-md); line-height: 1.4; }
.funnel-note {
  font-size: 10px; color: var(--text-lo); margin-top: 10px;
  padding: 8px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 7px;
  line-height: 1.5;
  text-align: center;
}
.funnel-note i { color: var(--amber); margin-right: 4px; }

/* C3: nota SAM limitado ao TAM */
.funnel-cap-note {
  margin-top: 5px; font-size: 10px;
  color: var(--amber); padding: 4px 8px;
  background: rgba(88,168,152,0.08);
  border-left: 2px solid var(--amber);
  border-radius: 4px; line-height: 1.4;
}
.funnel-cap-note i { margin-right: 4px; }

/* Validações runtime — badge amarelo */
.inconsistency-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(234,179,8,0.12);
  border: 1px solid rgba(234,179,8,0.4);
  color: #EAB308;
  font-size: 10px; font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  margin: 10px 0;
  cursor: help;
}

/* ═══════════════════════════════════════
   B2B: Projeção de Faturamento (3 cenários)
═══════════════════════════════════════ */
.scenario-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.scenario-card {
  border-radius: 12px; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
}
.scenario-card.conservador {
  background: var(--bg-raised);
  border: 1px solid var(--border-md);
}
.scenario-card.moderado {
  background: var(--teal-glow);
  border: 1px solid rgba(14,124,134,0.22);
}
.scenario-card.otimista {
  background: rgba(30,158,106,0.08);
  border: 1px solid rgba(30,158,106,0.22);
}
.scenario-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase;
}
.scenario-card.conservador .scenario-tag { color: var(--text-lo); }
.scenario-card.moderado   .scenario-tag { color: var(--teal-lt); }
.scenario-card.otimista   .scenario-tag { color: var(--green-lt); }

/* Subtítulo e faixa do cenário (novos elementos v7) */
.scenario-header {
  display: flex; flex-direction: column; gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.scenario-sub {
  font-size: 10.5px; color: var(--text-mid); font-style: italic; line-height: 1.35;
}
.scenario-faixa {
  font-size: 9px; color: var(--text-lo); letter-spacing: 0.04em;
}
/* tag ≤ SOM inline */
.scenario-cap-tag {
  font-size: 8px; font-weight: 700; letter-spacing: 0.06em;
  background: rgba(249,115,22,0.18); color: #F97316;
  border-radius: 4px; padding: 1px 5px; vertical-align: middle;
}
/* Badge laranja: mercado pequeno / teto limitado ao SOM */
.scenario-som-cap-badge {
  display: flex; align-items: flex-start; gap: 7px;
  background: rgba(249,115,22,0.09);
  border: 1px solid rgba(249,115,22,0.3);
  color: #F97316;
  font-size: 10px; font-weight: 500; line-height: 1.45;
  padding: 7px 12px; border-radius: 8px;
  margin-bottom: 10px;
}
.scenario-som-cap-badge i { flex-shrink: 0; margin-top: 2px; }
/* Nota de benchmark abaixo dos cenários */
.scenario-benchmark-note {
  font-size: 9.5px; color: var(--text-lo); line-height: 1.55;
  margin-top: 8px; padding: 7px 10px;
  background: var(--bg-raised);
  border-left: 2px solid var(--border-md);
  border-radius: 0 6px 6px 0;
}
/* Mantém .scenario-pct para retrocompatibilidade */
.scenario-pct {
  font-size: 10px; color: var(--text-lo); margin-top: 1px;
}
.scenario-stat {
  display: flex; flex-direction: column; gap: 2px;
}
.scenario-stat-lbl {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-lo);
}
.scenario-stat-val {
  font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--text-hi);
}
.scenario-annual {
  background: var(--bg-raised);
  border-radius: 8px; padding: 10px;
  text-align: center;
  margin-top: 4px;
}
.scenario-annual-lbl {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-lo); margin-bottom: 4px;
}
.scenario-annual-val {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 900; line-height: 1;
}
.scenario-card.conservador .scenario-annual-val { color: var(--text-hi); }
.scenario-card.moderado   .scenario-annual-val { color: var(--teal); }
.scenario-card.otimista   .scenario-annual-val { color: var(--green); }
.scenario-disclaimer {
  font-size: 10px; color: var(--text-lo);
  padding: 8px 12px;
  background: rgba(244,63,94,0.05);
  border: 1px solid rgba(244,63,94,0.12);
  border-radius: 7px;
  line-height: 1.5;
  display: flex; align-items: flex-start; gap: 6px;
  margin-bottom: 0;
}
.scenario-disclaimer i { color: var(--rose); flex-shrink: 0; margin-top: 1px; font-size: 9px; }

/* ═══════════════════════════════════════
   B2B: Gauge SVG Saturação de Mercado
═══════════════════════════════════════ */
.saturation-block {
  display: flex; align-items: center; gap: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 24px;
}
.gauge-wrap {
  flex-shrink: 0; width: 160px; height: 90px;
  position: relative;
}
.gauge-svg { width: 160px; height: 90px; overflow: visible; }
.gauge-needle { transition: transform 800ms var(--ease-out); }
.gauge-center-num {
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 900;
  color: var(--text-hi); text-align: center; line-height: 1;
  white-space: nowrap;
}
.gauge-center-sub {
  display: block; font-size: 8px; color: var(--text-lo); font-family: var(--font-ui);
  font-weight: 400;
}
.saturation-info { flex: 1; }
.saturation-label {
  font-size: 1rem; font-weight: 700; color: var(--text-hi);
  margin-bottom: 4px;
}
.saturation-sublabel {
  font-size: 12px; color: var(--text-md); line-height: 1.5;
  margin-bottom: 10px;
}
.saturation-scale {
  display: flex; gap: 6px;
}
.sat-scale-item {
  flex: 1; padding: 6px 8px; border-radius: 6px;
  font-size: 9px; font-weight: 700; text-align: center;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.sat-scale-item.active {
  border: 1px solid currentColor;
  opacity: 1;
}
.sat-scale-item:not(.active) { opacity: 0.35; }
.sat-scale-item.subatend  { background: rgba(16,185,129,0.12); color: var(--green); }
.sat-scale-item.crescimento { background: rgba(88,168,152,0.12); color: var(--amber-dk); }
.sat-scale-item.competitivo { background: rgba(88,168,152,0.12); color: var(--amber); }
.sat-scale-item.saturado  { background: rgba(244,63,94,0.10); color: var(--rose); }

/* ═══════════════════════════════════════
   B2B: Contexto para Expansão (cidade)
═══════════════════════════════════════ */
.expansion-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.expansion-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.expansion-card-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; margin-bottom: 8px;
}
.expansion-card-num {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 900;
  line-height: 1; margin-bottom: 3px;
}
.expansion-card-lbl { font-size: 11px; color: var(--text-md); line-height: 1.4; }
.expansion-card-bench {
  font-size: 10px; color: var(--text-lo);
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid var(--border);
}
.expansion-arrow-up   { color: var(--green); }
.expansion-arrow-down { color: var(--rose); }

/* Praças vizinhas */
.nearby-list {
  display: flex; flex-direction: column; gap: 6px; margin-top: 8px;
}
.nearby-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
  font-size: 12px;
}
.nearby-name { flex: 1; font-weight: 600; color: var(--text-hi); }
.nearby-score { font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.nearby-sat { font-size: 10px; color: var(--text-lo); }

/* ═══════════════════════════════════════
   RESPONSIVE para telas internas com sidebar
═══════════════════════════════════════ */
@media (max-width: 1024px) {
  #screen-estado.active,
  #screen-cidade.active {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .inner-sidebar {
    display: none;
  }
  .inner-scroll {
    height: auto;
    overflow: visible;
  }
}

