/* Painel CDI Lançamento — Brand Kit HighEnd (Night) + identidade CDI
   Tokens HSL sem hsl() — uso: hsl(var(--token)). Alias legado abaixo. */

:root {
  /* —— Brand Kit (constantes) —— */
  --major: 30 31% 78%;
  --major-deep: 222 47% 11%;
  --eletrum: 99 80% 46%;
  --gold: 45 100% 53%;
  --copper: 13 97% 64%;
  --osmium: 200 80% 46%;
  --purple: 287 81% 58%;
  --radius: 0.375rem;

  --night-1: 233 17% 20%;
  --night-2: 233 18% 17%;
  --night-3: 233 24% 13%;
  --night-4: 236 27% 10%;
  --night-5: 228 33% 6%;

  --alvorecer-1: 211 97% 15%;
  --alvorecer-2: 211 56% 43%;
  --clara-champagne: 30 40% 85%;
  --clara-brass: 38 42% 59%;

  /* —— Semântica Night —— */
  --background: var(--night-5);
  --foreground: 210 20% 98%;
  --card: var(--night-4);
  --primary: var(--major);
  --primary-foreground: var(--night-3);
  --secondary: var(--night-3);
  --muted: var(--night-3);
  --muted-foreground: 220 12% 62%;
  --border: 233 17% 20%;
  --border-subtle: 233 20% 17%;
  --cta: 211 56% 52%;
  --cta-foreground: 0 0% 100%;
  --segment-active: var(--night-1);
  --elevated: var(--night-3);

  --success: 160 64% 43%;
  --warning: 38 92% 50%;
  --destructive: 0 84% 60%;
  --info: 217 91% 60%;

  --channel-meta: 211 100% 49%;
  --channel-google: 4 83% 56%;
  --channel-organic: 99 80% 46%;
  --channel-youtube: 0 100% 50%;
  --channel-instagram: 330 75% 55%;
  --channel-total: var(--major);
  --channel-untracked: 220 10% 45%;

  --chart-1: var(--info);
  --chart-2: var(--major);
  --chart-3: var(--success);
  --chart-4: var(--destructive);
  --chart-5: var(--purple);
  --chart-grid: var(--night-1);
  --chart-axis: var(--muted-foreground);

  --heatmap-0: 30 20% 12%;
  --heatmap-1: 30 28% 22%;
  --heatmap-2: 30 32% 38%;
  --heatmap-3: 30 34% 55%;
  --heatmap-4: 30 40% 72%;

  --type-font-sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --type-font-display: "Funnel Display", "Plus Jakarta Sans", system-ui, sans-serif;
  --type-font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* —— Aliases legado do painel —— */
  --bg: hsl(var(--background));
  --surface: hsl(var(--night-5));
  --surface-2: hsl(var(--night-4));
  --card-grad: hsl(var(--card));
  --line: hsl(var(--border) / 0.9);
  --line-soft: hsl(var(--border-subtle));
  --line-strong: hsl(var(--major) / 0.28);
  --ink: hsl(var(--foreground));
  --ink-2: hsl(var(--major));
  --ink-3: hsl(var(--muted-foreground));
  --accent: hsl(var(--gold));
  --accent-soft: hsl(var(--gold) / 0.12);
  --lavender: hsl(var(--clara-brass));
  --c1: hsl(var(--chart-2));
  --c2: hsl(var(--chart-1));
  --c3: hsl(var(--copper));
  --c4: hsl(var(--chart-5));
  --c5: hsl(var(--chart-3));
  --o1: hsl(var(--gold));
  --o2: hsl(45 90% 48%);
  --o3: hsl(var(--clara-brass));
  --o4: hsl(38 42% 42%);
  --grid: hsl(var(--chart-grid) / 0.55);
  --de-emphasis: hsl(var(--muted-foreground) / 0.55);
  --shadow: 0 1px 2px hsl(228 33% 2% / 0.35);
  --sidebar-w: 248px;
  --fd: var(--type-font-display);
  --fb: var(--type-font-sans);
  --fm: var(--type-font-mono);
  --fs: var(--type-font-sans);
}

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

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--fb);
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255, 195, 15, 0.25); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(241, 228, 212, 0.12);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(241, 228, 212, 0.2); }

.layout { display: flex; min-height: 100vh; }

/* ---------------- sidebar ---------------- */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #0b0d16 0%, #08090f 60%, #07080d 100%);
}

.brand { display: flex; align-items: flex-start; gap: 14px; padding: 0 8px; }
.brand-mark { flex: none; display: block; margin-top: 2px; filter: drop-shadow(0 3px 10px rgba(255, 195, 15, 0.18)); }

.brand-text .cdi {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.5px;
  color: var(--ink);
}
.brand-text .cdi-underline {
  width: 40px; height: 4px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(255, 195, 15, 0.35));
  margin: 6px 0 7px;
}
.brand-text .l1 { color: var(--lavender); font-weight: 600; font-size: 12.5px; line-height: 1.35; }
.brand-text .l2 { color: var(--accent); font-weight: 600; font-size: 12.5px; line-height: 1.35; }

.nav-caption {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 14px;
  margin-bottom: 6px;
}

.modo-block { display: grid; gap: 6px; }
.modo-list { display: flex; flex-direction: column; gap: 3px; }
.modo-btn {
  appearance: none; border: 0; cursor: default;
  width: 100%; text-align: left;
  font: 600 13px/1.2 var(--fb);
  color: var(--ink-3);
  padding: 9px 14px;
  border-radius: 10px;
  background: transparent;
}
.modo-btn.active {
  color: var(--accent);
  background: rgba(255, 195, 15, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 195, 15, 0.22);
}
.modo-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.side-user {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.side-avatar {
  width: 32px; height: 32px; border-radius: 999px;
  display: grid; place-items: center;
  font: 700 11px/1 var(--fm);
  color: #0a0c14;
  background: linear-gradient(135deg, #ffc30f, #c7a666);
}
.side-user-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.side-user-db { font-size: 11px; color: var(--ink-3); }

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

.nav-btn {
  appearance: none; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  text-align: left;
  font-family: var(--fb); font-size: 13.5px; font-weight: 600;
  color: var(--ink-3);
  padding: 10px 14px;
  border-radius: 10px;
  position: relative;
  transition: color 0.18s, background 0.18s;
}
.nav-btn .nav-ico { flex: none; display: inline-flex; opacity: 0.75; transition: opacity 0.18s; }
.nav-btn .nav-ico svg { display: block; }
.nav-btn:hover { color: var(--ink-2); background: rgba(241, 228, 212, 0.045); }
.nav-btn:hover .nav-ico { opacity: 1; }
.nav-btn.active {
  color: var(--accent);
  background: linear-gradient(90deg, rgba(255, 195, 15, 0.13), rgba(255, 195, 15, 0.04));
  box-shadow: inset 0 0 0 1px rgba(255, 195, 15, 0.16);
}
.nav-btn.active::before {
  content: "";
  position: absolute;
  left: -18px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-btn.active .nav-ico { opacity: 1; }
.nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.side-meta {
  margin-top: auto;
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 16px 8px 0;
  border-top: 1px solid var(--line-soft);
}

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid rgba(255, 195, 15, 0.32);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--fm);
  font-size: 11px;
  padding: 4px 11px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  box-shadow: 0 0 18px rgba(255, 195, 15, 0.07);
}

.side-meta .period { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.side-meta .updated { color: var(--ink-3); font-size: 11.5px; line-height: 1.5; }
.side-meta .updated code { font-family: var(--fm); font-size: 10.5px; color: var(--ink-3); }

/* ---------------- main ---------------- */
.main {
  flex: 1;
  min-width: 0;
  padding: 0 0 56px;
  background:
    radial-gradient(900px 340px at 50% -180px, rgba(255, 195, 15, 0.045), transparent 70%);
}

.he-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px;
  padding: 14px 28px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 20, 0.94);
  backdrop-filter: blur(12px);
}
.he-ctl {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}
.he-ctl-lab {
  color: rgba(140, 147, 166, 0.95);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-left: 2px;
}
.he-ctl-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(241, 228, 212, 0.1);
  background: rgba(16, 19, 30, 0.95);
  color: var(--ink);
  font: 600 13px/1 var(--fb);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.he-ctl-trigger:hover {
  border-color: rgba(241, 228, 212, 0.18);
  background: rgba(20, 24, 36, 0.98);
}
.he-ctl-trigger[aria-expanded="true"] {
  border-color: rgba(255, 195, 15, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 195, 15, 0.08);
}
.he-ctl-caret {
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.7;
}
.he-ctl-trigger[aria-expanded="true"] .he-ctl-caret {
  transform: rotate(-135deg) translateY(-1px);
}

.he-funnel-trigger {
  border-color: rgba(39, 180, 133, 0.45);
  background: rgba(39, 180, 133, 0.12);
  color: #7dffc5;
  box-shadow: inset 0 0 0 1px rgba(39, 180, 133, 0.08);
}
.he-funnel-trigger:hover,
.he-funnel-trigger[aria-expanded="true"] {
  border-color: rgba(39, 180, 133, 0.7);
  background: rgba(39, 180, 133, 0.18);
  box-shadow: 0 0 0 1px rgba(39, 180, 133, 0.12);
}
.he-funnel-tag {
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #9affd4;
}
.he-funnel-kind {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(154, 255, 212, 0.72);
  padding-left: 2px;
}

.he-period-ico {
  display: inline-flex;
  width: 15px;
  height: 15px;
  color: rgba(241, 228, 212, 0.72);
}
.he-period-ico svg { width: 15px; height: 15px; display: block; }
.he-period-text { font-variant-numeric: tabular-nums; }

.he-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  min-width: 248px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(241, 228, 212, 0.1);
  background: #0d1018;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.he-funnel-menu { min-width: 220px; }
.he-tax-menu { min-width: 180px; padding: 8px; }
.he-period-menu { min-width: 268px; }
.he-period-menu.is-custom-open {
  min-width: 392px;
  width: max-content;
  max-width: min(420px, calc(100vw - 24px));
  box-sizing: border-box;
}
.he-menu-item,
.he-funnel-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 600 13px/1.2 var(--fb);
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.he-menu-item:hover,
.he-funnel-item:hover { background: rgba(255, 255, 255, 0.04); }
.he-menu-item.is-active,
.he-funnel-item.is-active {
  background: rgba(255, 195, 15, 0.1);
  color: var(--accent);
}
.he-funnel-item.is-active {
  background: rgba(39, 180, 133, 0.14);
  color: #9affd4;
}

.he-period-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.he-period-opt {
  appearance: none;
  border: 1px solid rgba(241, 228, 212, 0.1);
  background: rgba(16, 19, 30, 0.95);
  color: var(--ink);
  font: 600 12.5px/1 var(--fb);
  padding: 14px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.he-period-opt:hover {
  border-color: rgba(255, 195, 15, 0.35);
  background: rgba(255, 195, 15, 0.08);
}
.he-period-opt.is-active {
  border-color: rgba(255, 195, 15, 0.5);
  background: rgba(255, 195, 15, 0.14);
  color: var(--accent);
}
.he-period-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas:
    "from sep to"
    "apply apply apply";
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(241, 228, 212, 0.08);
  width: 100%;
  box-sizing: border-box;
}
/* display do custom não pode vencer o atributo hidden */
.he-period-custom[hidden] {
  display: none !important;
}
.he-period-custom .he-date:first-of-type { grid-area: from; }
.he-date-sep { grid-area: sep; }
.he-period-custom .he-date:last-of-type { grid-area: to; }
.he-period-apply { grid-area: apply; width: 100%; }
.he-date {
  appearance: none;
  border: 1px solid rgba(241, 228, 212, 0.1);
  background: rgba(6, 6, 10, 0.55);
  color: var(--ink);
  font: 600 12px/1.2 var(--fb);
  padding: 8px 10px;
  border-radius: 10px;
  color-scheme: dark;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.he-date:focus {
  outline: none;
  border-color: rgba(255, 195, 15, 0.45);
}
.he-date-sep { color: var(--ink-3); font-size: 12px; }
.he-period-apply {
  appearance: none;
  border: 1px solid rgba(255, 195, 15, 0.4);
  background: rgba(255, 195, 15, 0.14);
  color: var(--accent);
  font: 700 11.5px/1 var(--fb);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  box-sizing: border-box;
}

.he-tag-new {
  margin-top: 6px;
  appearance: none;
  border: 1px solid rgba(241, 228, 212, 0.1);
  background: rgba(6, 6, 10, 0.55);
  color: var(--ink);
  font: 600 12.5px/1.2 var(--fb);
  padding: 8px 10px;
  border-radius: 10px;
  min-width: 140px;
}
.he-tag-btn {
  margin-top: 6px;
  border: 1px solid rgba(255, 195, 15, 0.45);
  background: rgba(255, 195, 15, 0.14);
  color: var(--accent);
  font: 700 11.5px/1 var(--fb);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.he-topbar-spacer { flex: 1; min-width: 8px; }

#app { padding: 22px 28px 0; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.28s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tab-panel.active { animation: none; }
}

.page-head { margin-bottom: 22px; }
.page-head h2 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0.2px;
  color: var(--ink);
  line-height: 1.15;
}
.page-head .ph-sub {
  font-family: var(--fs);
  font-style: italic;
  font-size: 15.5px;
  color: var(--ink-2);
  margin-top: 3px;
}
.page-head .ph-sub em { color: var(--accent); font-style: inherit; }

.block-head {
  margin: 28px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.block-head:first-of-type { margin-top: 18px; }
.block-head h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.2px;
}
.block-head p {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.45;
  max-width: 72ch;
}

/* ---------------- perfis do lançamento — Lead × Comprador × Campeão ----------------
   disposição espelhada do PBI validado: três colunas em um cartão único,
   valores na cor do perfil (azul lead · dourado comprador · verde campeão) */
.personas {
  margin: 4px 0 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.persona {
  --tone-text: var(--accent);
  --tone-soft: rgba(255, 195, 15, 0.09);
  --tone-line: rgba(255, 195, 15, 0.22);
  min-width: 0;
  padding: 16px 18px 12px;
}
.persona + .persona { border-left: 1px solid var(--line-soft); }

.persona.tone-lead  { --tone-text: #7db4f0; --tone-soft: rgba(62, 138, 224, 0.12);  --tone-line: rgba(62, 138, 224, 0.3); }
.persona.tone-buyer { --tone-text: #ffc30f; --tone-soft: rgba(255, 195, 15, 0.09);  --tone-line: rgba(255, 195, 15, 0.24); }
.persona.tone-champ { --tone-text: #45c08a; --tone-soft: rgba(15, 157, 88, 0.13);   --tone-line: rgba(15, 157, 88, 0.32); }

.p-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}
.p-ico {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--tone-text);
  background: var(--tone-soft);
  border: 1px solid var(--tone-line);
}
.p-ico svg { display: block; }
.p-titles { min-width: 0; display: grid; gap: 1px; }
.p-titles h4 {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  color: var(--tone-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-hint { font-size: 10.5px; color: var(--ink-3); line-height: 1.3; }

.p-rows { display: block; }

.p-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  transition: background 0.15s;
}
.p-row + .p-row { border-top: 1px solid var(--line-soft); }
.p-row:hover { background: rgba(241, 228, 212, 0.025); }
@media (prefers-reduced-motion: reduce) {
  .p-row { transition: none; }
}

.p-row-ico {
  flex: none;
  color: var(--tone-text);
  opacity: 0.8;
  display: inline-flex;
}
.p-row-text {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-row-label { color: var(--ink-3); font-weight: 600; }
.p-row-ans { color: var(--ink); font-weight: 600; }

.p-row-val {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--fm);
  font-variant-numeric: tabular-nums;
}
.p-row-val b {
  color: var(--tone-text);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.p-row-val span {
  color: var(--tone-text);
  opacity: 0.85;
  font-size: 11px;
}

@media (max-width: 1120px) {
  .personas { grid-template-columns: 1fr; }
  .persona + .persona { border-left: none; border-top: 1px solid var(--line-soft); }
}

/* ---------------- KPI tiles ---------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border-subtle));
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  display: grid;
  gap: 3px;
  align-content: start;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}
.kpi:hover { border-color: hsl(var(--border)); }

.kpi .k-label {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.kpi .k-value {
  font-family: var(--fd);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi .k-sub { color: var(--ink-3); font-size: 11.5px; }
.kpi .k-sub b { color: var(--ink-2); font-weight: 600; }
.kpi .k-spark { margin-top: 7px; }

.kpi.hero {
  grid-column: span 2;
  background: hsl(var(--card));
  border-color: hsl(var(--gold) / 0.35);
}
.kpi.hero .k-value {
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 600;
  color: hsl(var(--gold));
}
.kpi.hero .k-label { color: var(--ink-2); }
@media (max-width: 640px) { .kpi.hero { grid-column: 1 / -1; } }

/* ---------------- cards / grid ---------------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); align-items: start; }

.card,
.glass-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border-subtle));
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  grid-column: span 12;
  min-width: 0;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}
.card:hover,
.glass-card-hover:hover { border-color: hsl(var(--border)); }
.card.half { grid-column: span 6; }
.card.third { grid-column: span 4; }
.card.twothird { grid-column: span 8; }
@media (max-width: 1000px) {
  .card.half, .card.third, .card.twothird { grid-column: span 12; }
}

/* ---------------- mini-rank (Top Criativos compacto — Visão Geral) ---------------- */
.mini-rank { display: flex; flex-direction: column; }
.mr-list { display: grid; gap: 9px; margin-top: 4px; }

/* menu suspenso de critério */
.mr-pick {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.mr-pick select {
  appearance: none;
  cursor: pointer;
  background: rgba(241, 228, 212, 0.04);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 28px 5px 12px;
  font-family: var(--fb);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23ffc30f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.16s, background-color 0.16s;
}
.mr-pick select:hover { border-color: rgba(255, 195, 15, 0.4); background-color: var(--accent-soft); }
.mr-pick select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mr-pick select option { background: var(--surface-2); color: var(--ink); }
.mr-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(241, 228, 212, 0.02);
  transition: border-color 0.18s, background 0.18s;
}
.mr-item:hover { border-color: var(--line); background: rgba(241, 228, 212, 0.035); }
.mr-rank {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 13px;
  color: var(--ink-3);
  background: rgba(241, 228, 212, 0.05);
  border: 1px solid var(--line-soft);
}
.mr-item.rank-1 { border-color: rgba(255, 195, 15, 0.3); background: rgba(255, 195, 15, 0.04); }
.mr-item.rank-1 .mr-rank { background: radial-gradient(120% 120% at 30% 20%, #ffe08a, #f0a800); color: #3a2c00; border-color: transparent; }
.mr-item.rank-2 .mr-rank { background: linear-gradient(150deg, #d8dbe2, #9aa0ac); color: #24272e; border-color: transparent; }
.mr-item.rank-3 .mr-rank { background: linear-gradient(150deg, #e0a071, #b06a34); color: #2a1806; border-color: transparent; }
.mr-body { min-width: 0; display: grid; gap: 4px; }
.mr-line { display: flex; align-items: baseline; gap: 8px; }
.mr-name {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.mr-item.rank-1 .mr-name { color: var(--accent); }
.mr-val {
  flex: none;
  font-family: var(--fm);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.mr-meta {
  font-size: 10.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mr-track { height: 4px; border-radius: 4px; background: rgba(241, 228, 212, 0.06); overflow: hidden; }
.mr-track i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 195, 15, 0.35), var(--accent));
}

.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.card-head h3 {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: 0.2px;
  color: var(--ink);
}
.card-head .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }

.view-toggle {
  appearance: none; cursor: pointer; flex: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-family: var(--fb); font-size: 11.5px; font-weight: 600;
  border-radius: 999px;
  padding: 4px 12px;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.view-toggle:hover { color: var(--accent); border-color: rgba(255, 195, 15, 0.4); background: var(--accent-soft); }
.view-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 2px 0 10px;
  font-size: 12px; color: var(--ink-2);
}
.legend .item {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(241, 228, 212, 0.04);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 3px 11px;
}
.legend .key-line { width: 15px; height: 0; border-top: 2.5px solid; border-radius: 2px; }
.legend .key-rect { width: 10px; height: 10px; border-radius: 3px; }

.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; }
.chart-wrap svg:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---- funil (silhueta) : trapézios + legenda alinhada banda a banda ---- */
.ch-funnel {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.ch-funnel svg { flex: none; width: auto; }
.ch-funnel.is-narrow { flex-direction: column; gap: 12px; }
.ch-funnel.is-narrow svg { width: 100%; }
.ch-funnel-leg { flex: 1; min-width: 0; }
.ch-fl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.ch-fl-row:last-child { border-bottom: none; }
.ch-fl-dot { flex: none; width: 9px; height: 9px; border-radius: 3px; }
.ch-fl-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ch-fl-txt b {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-fl-note { font-size: 10.5px; color: var(--ink-3); }
.ch-fl-num { flex: none; display: grid; gap: 1px; justify-items: end; }
.ch-fl-num b {
  font-family: var(--fm);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ch-fl-conv {
  font-family: var(--fm);
  font-size: 10.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ---- donut : anel + KPI central + legenda com valores ---- */
.ch-donut {
  display: flex;
  align-items: center;
  gap: 24px;
}
.ch-donut.is-narrow { flex-direction: column; gap: 16px; }
.ch-donut-ring { position: relative; flex: none; }
.ch-donut-ring svg { display: block; width: 100%; height: auto; }
.ch-donut-mid {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  pointer-events: none;
  text-align: center;
  padding: 0 14%;
}
.ch-donut-mid b {
  font-family: var(--fm);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.ch-donut-mid span {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.25;
}
.ch-donut-leg { flex: 1; min-width: 0; display: grid; gap: 2px; align-self: center; }
.ch-donut.is-narrow .ch-donut-leg { width: 100%; }
.ch-dl-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.ch-dl-row:last-child { border-bottom: none; }
.ch-dl-dot { flex: none; width: 9px; height: 9px; border-radius: 999px; }
.ch-dl-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-dl-val {
  font-family: var(--fm);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ch-dl-pct {
  font-family: var(--fm);
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 46px;
  text-align: right;
}

.table-wrap { display: none; overflow-x: auto; }
.card.show-table .chart-wrap, .card.show-table .legend { display: none; }
.card.show-table .table-wrap { display: block; }

table.data {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
table.data th {
  text-align: left; color: var(--ink-3); font-weight: 700;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 7px 10px; border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2); white-space: nowrap;
}
table.data td.num, table.data th.num {
  text-align: right;
  font-family: var(--fm);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
table.data tbody tr { transition: background 0.15s; }
table.data tbody tr:hover { background: rgba(241, 228, 212, 0.03); }
table.data tr:last-child td { border-bottom: none; }
table.data td:first-child { color: var(--ink); }
table.data tr.is-total td {
  color: var(--ink);
  font-weight: 700;
  border-top: 1px solid var(--line);
  background: rgba(241, 228, 212, 0.04);
}

/* ---------------- captação — KPIs por canal ---------------- */
.src-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.src-kpi {
  --tone-dot: var(--lavender);
  --tone-bar: var(--lavender);
  --tone-glow: transparent;
  position: relative;
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
  overflow: hidden;
}
.src-kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(200px 100px at 22% -24%, var(--tone-glow), transparent 72%);
  pointer-events: none;
}
.src-kpi:hover { border-color: var(--line-strong); }
.src-kpi > * { position: relative; }

.src-kpi.tone-meta   { --tone-dot: linear-gradient(135deg, #9c97ff, #3e8ae0); --tone-bar: #6eb6ff; --tone-glow: rgba(62, 138, 224, 0.15); }
.src-kpi.tone-google { --tone-dot: conic-gradient(from 40deg, #ea4335, #fbbc05, #34a853, #4285f4, #ea4335); --tone-bar: #45c08a; --tone-glow: rgba(66, 133, 244, 0.13); }
.src-kpi.tone-org    { --tone-dot: #45c08a; --tone-bar: #45c08a; --tone-glow: rgba(15, 157, 88, 0.13); }
.src-kpi.tone-blank  { --tone-dot: rgba(241, 228, 212, 0.4); --tone-bar: rgba(241, 228, 212, 0.4); --tone-glow: rgba(241, 228, 212, 0.05); }
.src-kpi.tone-api    { --tone-dot: linear-gradient(135deg, #ffc30f, #e4552f); --tone-bar: #e4885f; --tone-glow: rgba(228, 85, 47, 0.12); }
.src-kpi.tone-total  { --tone-dot: linear-gradient(135deg, #ffd65c, #ffc30f); --tone-bar: var(--accent); --tone-glow: rgba(255, 195, 15, 0.15); }

.src-kpi.is-hero {
  border-color: hsl(var(--gold) / 0.34);
  box-shadow: var(--shadow);
}

.sk-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.sk-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tone-dot);
  box-shadow: 0 0 10px var(--tone-glow);
}
.sk-name {
  font-family: var(--fd);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sk-share {
  margin-left: auto;
  flex: none;
  font-family: var(--fm);
  font-size: 9.5px;
  color: var(--ink-3);
  border: 1px solid var(--line-soft);
  background: rgba(241, 228, 212, 0.03);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.src-kpi.is-hero .sk-share { color: var(--accent); border-color: rgba(255, 195, 15, 0.28); background: var(--accent-soft); }

.sk-leads {
  font-family: var(--fb);
  font-weight: 800;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.3px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.src-kpi.is-hero .sk-leads {
  font-size: 28px;
  color: var(--accent);
  text-shadow: 0 0 22px rgba(255, 195, 15, 0.22);
}
.sk-leads-lab {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sk-spark { margin: 7px 0 1px; }

.sk-bar {
  height: 4px;
  border-radius: 4px;
  background: rgba(241, 228, 212, 0.07);
  overflow: hidden;
  margin: 8px 0 2px;
}
.sk-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--tone-bar);
  background: linear-gradient(90deg, var(--tone-bar), color-mix(in srgb, var(--tone-bar) 55%, transparent));
}

.sk-foot {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.sk-m { display: grid; gap: 1px; min-width: 0; }
.sk-m span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sk-m b {
  font-family: var(--fm);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.src-kpi.is-hero .sk-m b { color: var(--ink); }
.sk-m b.is-empty { color: var(--ink-3); font-weight: 600; }

@media (max-width: 1200px) {
  .src-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .src-kpis { grid-template-columns: 1fr 1fr; }
}

/* ---------------- captação — WhatsApp ---------------- */
.wa-panel { display: flex; flex-direction: column; gap: 12px; }
.wa-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wa-ico {
  width: 18px; height: 18px;
  border-radius: 5px;
  background: #25d366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
  position: relative;
  flex: none;
}
.wa-ico::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1.5px solid #06140c;
  border-top-color: transparent;
  border-left-color: transparent;
  transform: rotate(-40deg);
}
.wa-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.wa-kpi {
  background: rgba(241, 228, 212, 0.03);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}
.wa-kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, #9c97ff, #e4558a);
}
.wa-kpi-lab {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
  padding-left: 6px;
}
.wa-kpi-val {
  display: block;
  font-family: var(--fm);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  padding-left: 6px;
  font-variant-numeric: tabular-nums;
}
.wa-chart-wrap { margin-top: 2px; }
.wa-chart-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

/* ---------------- funil UTM (pesquisa / captação) ---------------- */
.utm-funnel { display: grid; gap: 16px; }
.capt-utm .utm-filters { margin-bottom: 2px; }
.utm-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 4px 0 2px;
}
.utm-filter {
  display: grid;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.utm-filter select {
  appearance: none;
  width: 100%;
  min-width: 0;
  background: var(--cream, #f1e4d4);
  color: #14151c;
  border: 1px solid rgba(241, 228, 212, 0.35);
  border-radius: 10px;
  padding: 10px 36px 10px 12px;
  font-family: var(--fb);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2314151c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.utm-filter select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
@media (max-width: 860px) {
  .utm-filters { grid-template-columns: 1fr; }
}

/* ---------------- tráfego — funil por plataforma + panorama ---------------- */
.traffic-block { margin: 4px 0 8px; }
.traffic-block + .traffic-block {
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}

.tf-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tf-titles h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.2px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.tf-titles p { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; max-width: 68ch; }

.tf-badge {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex: none;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.08);
}
.tf-badge.tone-meta { background: linear-gradient(135deg, #9c97ff, #3e8ae0); }
.tf-badge.tone-google { background: conic-gradient(from 40deg, #ea4335, #fbbc05, #34a853, #4285f4, #ea4335); }
.tf-badge.tone-tiktok { background: linear-gradient(135deg, #69c9d0, #ee1d52); }

.tf-filters { grid-template-columns: repeat(3, minmax(150px, 190px)); gap: 10px; padding: 0; }
.tf-filters select { padding-top: 8px; padding-bottom: 8px; font-size: 12.5px; }

.traffic-layout {
  display: grid;
  grid-template-columns: minmax(330px, 400px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
/* .card base usa span 12 (grid de 12 colunas); aqui o grid é de 2 colunas */
.traffic-layout > .card { grid-column: auto; }
.tf-tables > .card { grid-column: auto; }
.traffic-block.is-empty .traffic-layout { opacity: 0.72; }

.tf-tables { display: grid; gap: 16px; min-width: 0; }
.card.tf-card { padding-bottom: 10px; }
.card.tf-card .table-wrap { display: block; }
.tf-note { color: var(--ink-3); font-size: 11px; line-height: 1.55; padding: 0 8px; }

/* funil em escada */
.tf-funnel-card { position: sticky; top: 16px; }
.tf-funnel { display: grid; gap: 7px; padding-top: 8px; }
.tf-frow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
  align-items: stretch;
}
.tf-stage {
  background:
    linear-gradient(155deg, rgba(62, 138, 224, 0.15), rgba(16, 19, 30, 0.55) 58%),
    var(--surface-2);
  border: 1px solid rgba(62, 138, 224, 0.26);
  border-radius: 12px;
  padding: 9px 14px 8px;
  min-width: 0;
  transition: border-color 0.2s;
}
.tf-stage:hover { border-color: rgba(62, 138, 224, 0.5); }
.tf-stage .tf-val {
  font-family: var(--fm);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-stage .tf-lab {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 1px;
  line-height: 1.35;
}
.tf-stage.is-hero {
  border-color: rgba(255, 195, 15, 0.42);
  background:
    radial-gradient(230px 70px at 18% 0%, rgba(255, 195, 15, 0.16), transparent 70%),
    var(--surface-2);
  box-shadow: 0 0 26px rgba(255, 195, 15, 0.06);
}
.tf-stage.is-hero .tf-val { color: var(--accent); text-shadow: 0 0 18px rgba(255, 195, 15, 0.25); }
.tf-stage.is-null { border-style: dashed; opacity: 0.75; }
.tf-stage.is-null .tf-val { color: var(--ink-3); }

.tf-cost {
  display: grid;
  align-content: center;
  justify-items: end;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(241, 228, 212, 0.02);
}
.tf-cost b {
  font-family: var(--fm);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.tf-cost span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tf-cost.is-null { opacity: 0.55; border-style: dashed; }
.tf-cost:empty { border: none; background: none; }

.tf-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 1px 0; }
.tf-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: rgba(241, 228, 212, 0.03);
  border-radius: 999px;
  padding: 2.5px 10px;
}
.tf-chip-lab {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tf-chip b {
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.tf-chip.is-null { opacity: 0.55; }

.tf-funnel-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 9px 4px 0;
  border-top: 1px solid var(--line-soft);
}
.tf-funnel-foot b { font-family: var(--fm); font-size: 14px; color: var(--accent); font-variant-numeric: tabular-nums; }

/* tabelas do panorama */
.tf-table { min-width: 1080px; }
.tf-table td.tf-name-cell { max-width: 340px; }
.tf-name { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.tf-name-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-toggle {
  appearance: none;
  cursor: pointer;
  flex: none;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--ink-2);
  font: 600 12px/1 var(--fm);
  padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tf-toggle:hover {
  color: var(--accent);
  border-color: rgba(255, 195, 15, 0.45);
  background: var(--accent-soft);
}
.tf-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tf-toggle-ph { flex: none; width: 18px; }
.tf-table tr.lvl-0 .tf-name-txt { font-weight: 700; color: var(--ink); }
.tf-table tr.lvl-1 td.tf-name-cell { padding-left: 28px; }
.tf-table tr.lvl-1 .tf-name-txt { color: var(--ink-2); font-weight: 600; }
.tf-table tr.lvl-2 td.tf-name-cell { padding-left: 50px; }
.tf-table tr.lvl-2 .tf-name-txt { color: var(--ink-3); }
.tf-table tr.lvl-2 td { background: rgba(0, 0, 0, 0.14); }
.tf-table tr.tf-hidden { display: none; }
.tf-empty td { color: var(--ink-3); text-align: center; padding: 24px 10px; }

@media (max-width: 1280px) {
  .traffic-layout { grid-template-columns: 1fr; }
  .tf-funnel-card { position: static; }
}

/* Termômetro — layout do print Highend (funil | fat/inv + vendas/ROAS) */
.he-glow-card { /* flat — sem glow neon */ }
.th-ref-row {
  grid-template-columns: minmax(300px, 0.92fr) minmax(320px, 1.08fr);
  align-items: stretch;
}
.th-ref-row > .he-funnel-card { min-height: 100%; }
.th-roas-card { grid-column: span 12; }

.th-rails {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}
.th-rail {
  --tone: #3e8ae0;
  --tone-ink: #7db4f0;
  --tone-soft: rgba(62, 138, 224, 0.12);
  --tone-glow: rgba(62, 138, 224, 0.16);
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  background:
    radial-gradient(360px 140px at 0% 0%, var(--tone-glow), transparent 70%),
    var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.th-rail.tone-quente {
  --tone: #e4552f;
  --tone-ink: #ff9a53;
  --tone-soft: rgba(228, 85, 47, 0.13);
  --tone-glow: rgba(228, 85, 47, 0.16);
}
.th-rail::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--tone-ink), var(--tone));
}
.th-rail-badge {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding-right: 18px;
  border-right: 1px solid var(--line-soft);
  min-width: 118px;
}
.th-ico {
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 0 12px var(--tone-glow));
}
.th-rail-name {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 15px;
  color: var(--tone-ink);
  letter-spacing: 0.2px;
  margin-top: 4px;
}
.th-rail-hint { font-size: 10.5px; color: var(--ink-3); text-align: center; }
.th-rail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
}
.th-rail-m { display: grid; gap: 1px; min-width: 0; }
.th-rail-lab {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.th-rail-m b {
  font-family: var(--fm);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.th-rail-m.is-lead b { color: var(--tone-ink); }
@media (max-width: 1120px) {
  .th-rails { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .th-rail { grid-template-columns: 1fr; }
  .th-rail-badge {
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
    padding: 0 0 12px;
  }
}

.th-untagged {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.5;
  padding: 2px 4px 14px;
}
.th-untagged b { color: var(--ink-2); font-family: var(--fm); font-weight: 700; }

/* painel por plataforma: dois funis espelhados */
.th-platform { margin-bottom: 16px; }
.th-plat-head { margin-bottom: 10px; }
.th-plat-head h3 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}
.th-plat-head p { color: var(--ink-3); font-size: 12px; margin-top: 2px; }

.th-duo {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0;
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.th-platform.is-empty .th-duo { opacity: 0.6; }
.th-spine { background: var(--line-soft); }

.th-col {
  --tone: #3e8ae0;
  --tone-ink: #7db4f0;
  --tone-soft: rgba(62, 138, 224, 0.1);
  --tone-line: rgba(62, 138, 224, 0.26);
  display: grid;
  gap: 7px;
  padding: 0 16px;
  min-width: 0;
}
.th-col.tone-quente {
  --tone: #e4552f;
  --tone-ink: #ff9a53;
  --tone-soft: rgba(228, 85, 47, 0.1);
  --tone-line: rgba(228, 85, 47, 0.26);
}

.th-col-head {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 4px 12px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}
.th-hm { display: grid; gap: 1px; }
.th-col.tone-quente .th-col-head { text-align: right; direction: rtl; }
.th-col.tone-quente .th-hm { direction: ltr; text-align: right; }
.th-hm b {
  font-family: var(--fm);
  font-size: 15px;
  font-weight: 700;
  color: var(--tone-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.th-hm span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* o funil: barras que afunilam, ancoradas na espinha central */
.th-funnel { display: grid; gap: 3px; }

.th-fstep { display: flex; }
.th-col.tone-frio .th-fstep { justify-content: flex-end; }
.th-col.tone-quente .th-fstep { justify-content: flex-start; }

.th-bar {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 172px;
  max-width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--tone-line);
  border-radius: 10px;
  background:
    linear-gradient(90deg, transparent, var(--tone-soft)),
    var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(241, 228, 212, 0.05);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.th-col.tone-quente .th-bar {
  flex-direction: row-reverse;
  background:
    linear-gradient(270deg, transparent, var(--tone-soft)),
    var(--surface-2);
}
.th-bar:hover { border-color: var(--tone-ink); }
.th-col.tone-frio .th-bar:hover { transform: translateX(-3px); }
.th-col.tone-quente .th-bar:hover { transform: translateX(3px); }

.th-bar b {
  font-family: var(--fm);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.th-bar span {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.th-fstep.is-cost .th-bar { border-style: dashed; opacity: 0.92; }
.th-fstep.is-cost .th-bar b { color: var(--tone-ink); font-size: 13.5px; }

/* trilho de taxa entre duas etapas — chip na borda externa, fio até a espinha */
.th-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 0;
}
.th-col.tone-quente .th-link { flex-direction: row-reverse; }
.th-link-line {
  flex: 1;
  height: 1px;
  min-width: 0;
  /* mais forte junto à espinha, onde as barras se ancoram */
  background: linear-gradient(90deg, transparent, var(--tone-line));
}
.th-col.tone-quente .th-link-line {
  background: linear-gradient(270deg, transparent, var(--tone-line));
}
.th-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  border: 1px solid var(--line-soft);
  background: rgba(241, 228, 212, 0.03);
  border-radius: 999px;
  padding: 2px 10px;
}
.th-link-chip span {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.th-link-chip b {
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 700;
  color: var(--tone-ink);
  font-variant-numeric: tabular-nums;
}
.th-link.is-null { opacity: 0.5; }
.th-link.is-null .th-link-chip b { color: var(--ink-3); }

@media (max-width: 920px) {
  .th-duo { grid-template-columns: 1fr; }
  .th-spine { height: 1px; margin: 14px 0; }
  .th-col { padding: 0; }
  /* empilhado não há espelho: tudo alinhado à esquerda */
  .th-col.tone-frio .th-fstep,
  .th-col.tone-quente .th-fstep { justify-content: flex-start; }
  .th-col.tone-quente .th-bar { flex-direction: row; }
  .th-col.tone-quente .th-link { flex-direction: row; }
  .th-col.tone-quente .th-link-line {
    background: linear-gradient(90deg, transparent, var(--tone-line));
  }
  .th-col.tone-quente .th-bar:hover { transform: translateX(-3px); }
}

/* ---------------- vendas — Top Criativos (leaderboard) ---------------- */
.sc-wrap { margin: 2px 0 8px; }
.sc-sortbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.sc-sort-cap {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 2px;
}
.sc-sort {
  appearance: none;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-family: var(--fb);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 5px 14px;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.sc-sort:hover { color: var(--ink-2); border-color: var(--line-strong); }
.sc-sort.active {
  color: var(--accent);
  border-color: rgba(255, 195, 15, 0.4);
  background: var(--accent-soft);
}
.sc-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.sc-list { display: grid; gap: 10px; }

.sc-item {
  display: grid;
  grid-template-columns: 48px minmax(180px, 1.15fr) minmax(0, 2fr);
  align-items: center;
  gap: 18px;
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 20px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s;
}
.sc-item:hover { border-color: var(--line-strong); }

/* rank badge */
.sc-rank {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(241, 228, 212, 0.04);
  border: 1px solid var(--line);
}
.sc-rank-n {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 19px;
  color: var(--ink-3);
  line-height: 1;
}
.sc-item.is-top .sc-rank { border-color: transparent; }
.sc-item.rank-1 {
  border-color: rgba(255, 195, 15, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 214, 92, 0.12), 0 18px 46px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 195, 15, 0.05);
}
.sc-item.rank-1 .sc-rank {
  background: radial-gradient(120% 120% at 30% 20%, #ffe08a, #f0a800);
  box-shadow: 0 6px 18px rgba(255, 195, 15, 0.28);
}
.sc-item.rank-1 .sc-rank-n { color: #3a2c00; }
.sc-item.rank-2 .sc-rank { background: linear-gradient(150deg, #d8dbe2, #9aa0ac); }
.sc-item.rank-2 .sc-rank-n { color: #24272e; }
.sc-item.rank-3 .sc-rank { background: linear-gradient(150deg, #e0a071, #b06a34); }
.sc-item.rank-3 .sc-rank-n { color: #2a1806; }

/* identidade do criativo */
.sc-body { min-width: 0; display: grid; gap: 9px; }
.sc-id { min-width: 0; }
.sc-name {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--ink);
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-item.rank-1 .sc-name { color: var(--accent); }
.sc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.sc-chip {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
  border: 1px solid var(--line-soft);
  background: rgba(241, 228, 212, 0.03);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-chip.is-camp { color: var(--ink-2); border-color: var(--line); }

.sc-track {
  height: 5px;
  border-radius: 5px;
  background: rgba(241, 228, 212, 0.06);
  overflow: hidden;
}
.sc-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 195, 15, 0.35), var(--accent));
  transition: width 0.4s ease;
}
.sc-item.rank-1 .sc-track i { box-shadow: 0 0 12px rgba(255, 195, 15, 0.3); }
@media (prefers-reduced-motion: reduce) { .sc-track i { transition: none; } }

/* métricas */
.sc-mets {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.sc-met { display: grid; gap: 2px; min-width: 0; }
.sc-met-lab {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.sc-met b {
  font-family: var(--fm);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-met.key b { color: var(--ink); }
.sc-met b.is-hot { color: var(--accent); }

@media (max-width: 1200px) {
  .sc-item { grid-template-columns: 44px 1fr; grid-auto-rows: auto; }
  .sc-mets { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
}
@media (max-width: 620px) {
  .sc-mets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------- visão geral — cards por canal (origem) ---------------- */
.oc-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.oc-card {
  --tone: var(--lavender);
  --tone-glow: transparent;
  position: relative;
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 15px 14px;
  min-width: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.oc-card::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--tone);
}
.oc-card.tone-meta   { --tone: linear-gradient(180deg, #9c97ff, #3e8ae0); --tone-glow: rgba(62, 138, 224, 0.14); }
.oc-card.tone-google { --tone: linear-gradient(180deg, #ea4335, #fbbc05, #34a853, #4285f4); --tone-glow: rgba(66, 133, 244, 0.12); }
.oc-card.tone-org    { --tone: #45c08a; --tone-glow: rgba(15, 157, 88, 0.12); }
.oc-card.tone-blank  { --tone: rgba(241, 228, 212, 0.4); --tone-glow: rgba(241, 228, 212, 0.05); }
.oc-card.tone-total  { --tone: linear-gradient(180deg, #ffd65c, #ffc30f); --tone-glow: rgba(255, 195, 15, 0.16); }
.oc-card.is-total {
  border-color: rgba(255, 195, 15, 0.3);
  background:
    radial-gradient(220px 120px at 20% -10%, rgba(255, 195, 15, 0.06), transparent 70%),
    var(--card-grad);
}
.oc-name {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.01em;
  padding-left: 8px;
  margin-bottom: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oc-card.is-total .oc-name { color: var(--accent); }
.oc-metrics { display: grid; gap: 6px; }
.oc-m {
  display: grid;
  gap: 0;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(241, 228, 212, 0.022);
  border: 1px solid var(--line-soft);
}
.oc-m b {
  font-family: var(--fm);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.oc-m span {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 1px;
}
.oc-m.is-fat b { color: var(--accent); }
.oc-m.is-null b { color: var(--ink-3); font-weight: 600; }

.oc-cards.ln-canais {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 4px 0 8px;
  padding: 0 4px 8px;
  gap: 12px;
}
/* Canais — faixa superior colorida (Highend), métricas em linha */
.oc-cards.ln-canais .oc-card {
  border-radius: 12px;
  padding: 0 0 12px;
  box-shadow: none;
  background: var(--surface-2, var(--card-grad));
}
.oc-cards.ln-canais .oc-card::before {
  left: 0; right: 0; top: 0; bottom: auto;
  width: 100%;
  height: 3px;
  border-radius: 12px 12px 0 0;
  background: var(--tone);
}
.oc-cards.ln-canais .oc-card.tone-total {
  --tone: #6b7280;
  border-color: var(--line);
  background: var(--surface-2, var(--card-grad));
}
.oc-cards.ln-canais .oc-card.tone-meta { --tone: #3b82f6; }
.oc-cards.ln-canais .oc-card.tone-google { --tone: #ea4335; }
.oc-cards.ln-canais .oc-card.tone-org { --tone: #22a06b; }
.oc-cards.ln-canais .oc-card.is-total {
  border-color: var(--line);
  background: var(--surface-2, var(--card-grad));
  box-shadow: none;
}
.oc-cards.ln-canais .oc-card.is-total .oc-name { color: var(--ink); }
.oc-cards.ln-canais .oc-name {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 10px;
  margin: 0;
  font-size: 13.5px;
  font-weight: 650;
}
.oc-cards.ln-canais .oc-logo {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-2);
  flex: none;
}
.oc-cards.ln-canais .oc-logo svg { width: 14px; height: 14px; }
.oc-cards.ln-canais .oc-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 0 12px;
}
.oc-cards.ln-canais .oc-card.tone-org .oc-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.oc-cards.ln-canais .oc-m {
  padding: 8px 6px;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: left;
}
.oc-cards.ln-canais .oc-m b {
  font-size: 13px;
  font-weight: 700;
  display: block;
}
.oc-cards.ln-canais .oc-m span {
  font-size: 10.5px;
  color: var(--ink-3);
}
@media (max-width: 1200px) {
  .oc-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .oc-cards.ln-canais { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .oc-cards,
  .oc-cards.ln-canais { grid-template-columns: 1fr 1fr; }
  .oc-cards.ln-canais .oc-metrics { grid-template-columns: 1fr 1fr; }
}

/* ---------------- vendas — cards por canal ---------------- */
.vc-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 6px;
}
.vc-card {
  --tone-dot: var(--lavender);
  --tone-glow: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px 12px;
  min-width: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.vc-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(180px 90px at 20% -20%, var(--tone-glow), transparent 72%);
  pointer-events: none;
}
.vc-card > * { position: relative; }
.vc-card.tone-meta   { --tone-dot: linear-gradient(135deg, #9c97ff, #3e8ae0); --tone-glow: rgba(62, 138, 224, 0.14); }
.vc-card.tone-google { --tone-dot: conic-gradient(from 40deg, #ea4335, #fbbc05, #34a853, #4285f4, #ea4335); --tone-glow: rgba(66, 133, 244, 0.12); }
.vc-card.tone-org    { --tone-dot: #45c08a; --tone-glow: rgba(15, 157, 88, 0.12); }
.vc-card.tone-blank  { --tone-dot: rgba(241, 228, 212, 0.4); --tone-glow: rgba(241, 228, 212, 0.05); }
.vc-card.tone-api    { --tone-dot: linear-gradient(135deg, #ffc30f, #e4552f); --tone-glow: rgba(228, 85, 47, 0.11); }
.vc-card.tone-total  { --tone-dot: linear-gradient(135deg, #ffd65c, #ffc30f); --tone-glow: rgba(255, 195, 15, 0.15); }
.vc-card.is-total { border-color: rgba(255, 195, 15, 0.3); }

.vc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.vc-dot {
  flex: none; width: 9px; height: 9px; border-radius: 50%;
  background: var(--tone-dot); box-shadow: 0 0 10px var(--tone-glow);
}
.vc-name {
  font-family: var(--fd); font-weight: 700; font-size: 13.5px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.vc-sum {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  padding-bottom: 11px;
  margin-bottom: 9px;
  border-bottom: 1px solid var(--line-soft);
}
.vc-sum-b { display: grid; gap: 1px; min-width: 0; }
.vc-sum-b:last-child { text-align: right; }
.vc-sum-b b {
  font-family: var(--fm); font-size: 17px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vc-card.is-total .vc-sum-b b { color: var(--accent); }
.vc-sum-b span {
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}

.vc-rows { display: grid; gap: 2px; }
.vc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.vc-row + .vc-row { border-top: 1px solid var(--line-soft); }
.vc-row-lab {
  font-size: 10px; font-weight: 600; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vc-row.is-null .vc-row-lab { color: var(--ink-3); }
.vc-row-vals {
  display: grid;
  grid-template-columns: 26px 54px 34px;
  gap: 5px;
  align-items: baseline;
  text-align: right;
  font-family: var(--fm);
  font-variant-numeric: tabular-nums;
}
.vc-v-sales { font-size: 11.5px; font-weight: 700; color: var(--ink); }
.vc-v-fat { font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-v-conv { font-size: 10px; color: var(--accent); font-weight: 700; }
.vc-row.is-null .vc-v-sales, .vc-row.is-null .vc-v-fat, .vc-row.is-null .vc-v-conv { color: var(--ink-3); font-weight: 600; }

@media (max-width: 1280px) { .vc-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .vc-cards { grid-template-columns: 1fr 1fr; } }

/* ---------------- vendas — resumo de quartil (1/3) ---------------- */
.vq-summary { display: flex; flex-direction: column; }
.vq-list { display: grid; gap: 12px; margin-top: 6px; }
.vq-item { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
.vq-badge {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  font-family: var(--fd); font-weight: 800; font-size: 14px; color: #0a0c14;
}
.vq-info { min-width: 0; display: grid; gap: 4px; }
.vq-line { display: flex; align-items: baseline; gap: 8px; }
.vq-line b { font-family: var(--fm); font-size: 18px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.vq-pct { font-family: var(--fm); font-size: 12px; color: var(--ink-3); }
.vq-sub { font-size: 10.5px; color: var(--ink-3); }
.vq-track { height: 4px; border-radius: 4px; background: rgba(241, 228, 212, 0.06); overflow: hidden; }
.vq-track i { display: block; height: 100%; border-radius: inherit; }

/* análise por UTMs (vendas) — reusa .tf-table / filtros */
.ua-host { grid-column: span 12; display: grid; gap: 14px; }
.ua-host .tf-table { min-width: 940px; }

/* ---------------- tooltip ---------------- */
#tooltip {
  position: fixed; z-index: 99; pointer-events: none;
  background: rgba(16, 19, 30, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(241, 228, 212, 0.16);
  border-radius: 12px;
  padding: 10px 13px;
  font-size: 12.5px;
  color: var(--ink-2);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.6);
  max-width: 300px;
  display: none;
}
#tooltip .tt-title {
  color: var(--ink-3); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 6px;
}
#tooltip .tt-row { display: flex; align-items: center; gap: 8px; padding: 1.5px 0; }
#tooltip .tt-key { width: 14px; height: 0; border-top: 2.5px solid; border-radius: 2px; flex: none; }
#tooltip .tt-val { font-weight: 700; color: var(--ink); font-family: var(--fm); font-size: 12.5px; }
#tooltip .tt-name { color: var(--ink-3); }

/* ---------------- misc ---------------- */
.section-note {
  color: var(--ink-3); font-size: 12px;
  padding: 4px 2px 16px;
}
.section-note code { font-family: var(--fm); font-size: 11px; }

footer {
  margin-top: 48px; padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 12.5px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
footer .fs { font-family: var(--fs); font-style: italic; color: var(--ink-2); }
footer .fs em { color: var(--accent); font-style: inherit; }

.empty-state {
  color: var(--ink-3); font-size: 13px; text-align: center;
  padding: 34px 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* —— Boot: orientação quando a API/banco não conecta —— */
.boot-connect {
  max-width: 720px;
  margin: 28px auto;
  padding: 28px 28px 24px;
  text-align: left;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--warning) / 0.35);
  border-radius: 8px;
  box-shadow: 0 0 0 1px hsl(var(--night-3));
}
.boot-connect-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--type-font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--warning));
  margin-bottom: 10px;
}
.boot-connect-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(var(--warning));
  box-shadow: 0 0 0 3px hsl(var(--warning) / 0.22);
}
.boot-connect h2 {
  font-family: var(--type-font-display);
  font-size: 22px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin: 0 0 8px;
  line-height: 1.25;
}
.boot-connect-lead {
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 22px;
}
.boot-connect-lead code {
  font-family: var(--type-font-mono);
  font-size: 12px;
  color: hsl(var(--gold));
  background: hsl(var(--night-3));
  padding: 1px 6px;
  border-radius: 4px;
}
.boot-connect-section {
  margin-bottom: 20px;
}
.boot-connect-section:last-of-type { margin-bottom: 14px; }
.boot-connect-section h3 {
  font-family: var(--type-font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: hsl(var(--major));
  margin: 0 0 10px;
}
.boot-connect-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: boot-step;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.boot-connect-steps li {
  counter-increment: boot-step;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  font-size: 13.5px;
  line-height: 1.45;
  color: hsl(var(--foreground));
}
.boot-connect-steps li::before {
  content: counter(boot-step);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--type-font-mono);
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--night-5));
  background: hsl(var(--gold));
}
.boot-connect-steps code,
.boot-connect-vars code {
  font-family: var(--type-font-mono);
  font-size: 12px;
  color: hsl(var(--gold));
  background: hsl(var(--night-3));
  padding: 1px 6px;
  border-radius: 4px;
}
.boot-connect-cmd {
  display: block;
  margin-top: 6px;
  padding: 10px 12px;
  font-family: var(--type-font-mono);
  font-size: 12.5px;
  color: hsl(var(--clara-champagne));
  background: hsl(var(--night-5));
  border: 1px solid hsl(var(--border));
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-all;
}
.boot-connect-vars {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.boot-connect-vars th,
.boot-connect-vars td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid hsl(var(--border-subtle));
  vertical-align: top;
}
.boot-connect-vars th {
  font-family: var(--type-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--night-3));
}
.boot-connect-vars td:first-child {
  white-space: nowrap;
  width: 38%;
}
.boot-connect-vars .req {
  color: hsl(var(--warning));
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 6px;
}
.boot-connect-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
  margin: 0 0 16px;
  padding: 12px 14px;
  background: hsl(var(--night-3));
  border-left: 3px solid hsl(var(--gold));
  border-radius: 0 6px 6px 0;
}
.boot-connect-err {
  font-family: var(--type-font-mono);
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
  padding: 10px 12px;
  background: hsl(var(--night-5));
  border: 1px dashed hsl(var(--border));
  border-radius: 6px;
  word-break: break-word;
}
.boot-connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.boot-connect-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--type-font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 6px;
  background: hsl(var(--gold));
  color: hsl(var(--night-5));
}
.boot-connect-btn:hover { filter: brightness(1.06); }
.boot-connect-btn-ghost {
  background: transparent;
  color: hsl(var(--major));
  border: 1px solid hsl(var(--border));
}
.boot-connect-btn-ghost:hover {
  border-color: hsl(var(--major) / 0.5);
  background: hsl(var(--night-3));
}
@media (max-width: 640px) {
  .boot-connect { margin: 16px 8px; padding: 20px 16px; }
  .boot-connect-vars td:first-child { white-space: normal; }
}

/* ---------------- Funil de Tráfego Highend (padrão perpétuo) ---------------- */
.he-row {
  grid-column: span 12;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: stretch;
}
.he-funnel-card,
.he-half,
.he-row > .card {
  min-width: 0;
  grid-column: auto;
}
.he-funnel-wide {
  max-width: 720px;
  width: 100%;
  justify-self: start;
}
.he-captacao-funnel {
  grid-template-columns: minmax(320px, 720px) 1fr;
}

/* ========== Fluxo de Captação (Highend) ========== */
.cp-hero {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.cp-hero-card {
  background: var(--surface-2, var(--card-grad));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px 14px;
  display: grid;
  gap: 4px;
}
.cp-hero-lab {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
}
.cp-hero-val {
  font-family: var(--fb);
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cp-hero-delta {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-3);
}
.cp-hero-delta.is-up { color: #2ec4a0; }
.cp-hero-delta.is-down { color: #ef5b5b; }

.cp-plat {
  grid-column: span 12;
  background: var(--surface-2, var(--card-grad));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 0 14px;
  overflow: hidden;
  --cp-accent: #3C83F6;
}
.cp-plat.tone-meta { --cp-accent: #3C83F6; }
.cp-plat.tone-google { --cp-accent: #EA4335; }
.cp-plat.tone-org { --cp-accent: #22A06B; }
.cp-plat.tone-other { --cp-accent: #8B7EC8; }

.cp-plat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(60, 131, 246, 0.1);
  border-top: 3px solid var(--cp-accent);
}
.cp-plat.tone-google .cp-plat-head { background: rgba(234, 67, 53, 0.1); }
.cp-plat.tone-org .cp-plat-head { background: rgba(34, 160, 107, 0.1); }
.cp-plat.tone-other .cp-plat-head { background: rgba(139, 126, 200, 0.12); }
.cp-plat-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--cp-accent);
  flex: none;
}
.cp-plat-logo svg { width: 16px; height: 16px; }
.cp-plat-name {
  font-family: var(--fd);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.cp-plat-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 14px 6px;
}
.cp-pk {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.cp-pk-lab {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.cp-pk-val {
  font-family: var(--fb);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.cp-plat-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 14px 4px;
}
.cp-plat-charts .cp-chart-card,
.cp-plat .cp-table-card {
  grid-column: auto;
  margin: 0;
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
  border-radius: 12px;
}
.cp-plat .cp-table-card {
  margin: 10px 14px 0;
}
.cp-plat-charts .card-head h3 {
  font-size: 13.5px;
}

.cp-canais-card { grid-column: span 12; }
.cp-canal-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}
.cp-canal-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex: none;
}
.cp-canal-ico svg { width: 13px; height: 13px; }
.cp-canal-ico.tone-meta { color: #3C83F6; background: rgba(60, 131, 246, 0.14); }
.cp-canal-ico.tone-google { color: #EA4335; background: rgba(234, 67, 53, 0.14); }
.cp-canal-ico.tone-organico { color: #22A06B; background: rgba(34, 160, 107, 0.14); }

.cp-daily-table thead th,
.cp-canais-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
}

@media (max-width: 1100px) {
  .cp-plat-charts { grid-template-columns: 1fr; }
  .cp-hero { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cp-plat-kpis { grid-template-columns: 1fr 1fr; }
}
.he-evo { align-items: stretch; }
.ln-section-title {
  grid-column: span 12;
  margin: 4px 0 -4px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ln-section-title h3 {
  margin: 0;
  font-family: var(--fd);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.ln-period-chip {
  font-family: var(--type-font-mono, "JetBrains Mono", monospace);
  font-size: 11.5px;
  font-weight: 600;
  color: hsl(var(--gold));
  background: hsl(var(--night-3));
  border: 1px solid hsl(var(--gold) / 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  letter-spacing: 0.02em;
}

.kpis.he-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.kpis.he-kpis.ln-kpis {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.kpis.he-kpis.ln-kpis-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.he-kpi {
  position: relative;
  min-width: 0;
  padding: 14px 15px 13px;
  border-radius: var(--radius);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border-subtle));
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-content: stretch;
}
.he-kpi:hover { border-color: hsl(var(--border)); }
.he-kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.he-kpi .k-label { margin: 0; }
.he-kpi .k-value {
  font-family: var(--fd);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.he-kpi .k-sub {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.he-ico-wallet,
.he-ico-cash,
.he-ico-pig,
.he-ico-target,
.he-ico-tag,
.he-ico-chart,
.he-ico-cart,
.he-ico-bump,
.he-ico-users,
.he-ico-percent,
.he-ico-arrow { color: hsl(var(--gold)); }
.he-kpi-ico {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  background: hsl(var(--gold) / 0.12);
  border: 1px solid hsl(var(--gold) / 0.18);
  flex: none;
  display: grid;
  place-items: center;
  color: hsl(var(--gold));
}
.he-kpi-ico svg { width: 14px; height: 14px; }
.k-delta {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
.k-delta.is-good { color: #2ec4a0; }
.k-delta.is-bad { color: #ef5b5b; }
.k-delta.is-flat { color: var(--ink-3); }
.seg-control {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius);
  background: hsl(var(--night-5));
  border: 1px solid hsl(var(--border-subtle));
  margin-left: auto;
}
.seg-btn {
  appearance: none; border: 0; cursor: pointer;
  font: 600 12px/1 var(--fb);
  color: var(--ink-3);
  padding: 7px 12px;
  border-radius: calc(var(--radius) - 1px);
  background: transparent;
  transition: background 0.15s, color 0.15s;
}
.seg-btn:hover { color: hsl(var(--major)); }
.seg-btn.active {
  background: hsl(var(--segment-active));
  color: hsl(var(--gold));
}

.panorama-grid thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2);
}
.panorama-grid tfoot td {
  position: sticky; bottom: 0; z-index: 2;
  background: var(--surface-2);
  font-weight: 600;
}
.table-wrap.scroll-rows {
  display: block;
  overflow: auto;
  max-height: calc(2.35rem + (var(--scroll-rows, 10) * 2.15rem) + 2.35rem);
  max-width: 100%;
}
.table-wrap.wide-scroll {
  overflow-x: auto;
  max-width: 100%;
  display: block;
}
.card.show-table .table-wrap.scroll-rows,
.card.show-table .table-wrap.wide-scroll { display: block; }

.ln-canais { margin-top: 8px; }
.ln-funnel-extra {
  flex-direction: column;
  align-items: stretch;
}
.ln-funnel-list {
  display: grid;
  gap: 6px;
  width: 100%;
}
.ln-funnel-li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-3);
}
.ln-funnel-li strong {
  color: var(--ink);
  font-family: var(--fm);
  font-variant-numeric: tabular-nums;
}
.ln-groups-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 2px 10px;
  flex: 1;
  min-height: 0;
}
.ln-group-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.ln-gk {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.ln-gk .k-label {
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.ln-gk .k-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ln-groups-empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px 16px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.45;
}
.ln-groups-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  flex: 1;
}
.ln-groups-legend {
  justify-content: flex-end;
  padding: 0 4px;
}
.ln-groups-chart-host {
  min-height: 280px;
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 8px 6px 4px;
}
.ln-groups-chart-host.ln-groups-empty {
  border-style: dashed;
}
@media (max-width: 900px) {
  .ln-group-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .ln-group-kpis { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
  .he-row { grid-template-columns: 1fr; }
  .he-captacao-funnel { grid-template-columns: 1fr; }
  .he-funnel-wide { max-width: none; }
  .kpis.he-kpis,
  .kpis.he-kpis.ln-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .kpis.he-kpis,
  .kpis.he-kpis.ln-kpis { grid-template-columns: 1fr 1fr; }
}
.he-funnel-aside {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 400;
}
.he-funnel-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.he-funnel-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0;
  padding: 2px 2px 8px;
}
.he-funnel-card.he-funnel-split > .he-funnel-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 168px);
  gap: 14px 16px;
  align-items: stretch;
}
.he-funnel-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}
.he-funnel-main.he-funnel-viz {
  position: relative;
  min-width: 0;
  flex: 1;
  min-height: 280px;
}
.he-funnel-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  margin: 0 auto;
  overflow: visible;
}
.he-funnel-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.he-funnel-label {
  --f-ink: #1795D3;
  position: absolute;
  left: 10%;
  right: 10%;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}
.he-funnel-bridge {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  background: rgba(8, 10, 16, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.he-funnel-bridge strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
}
.he-funnel-bridge em {
  font-style: normal;
  opacity: 0.65;
  font-size: 9.5px;
}
.he-funnel-bridge-arr {
  color: var(--ink-3);
  font-size: 9px;
  line-height: 1;
  opacity: 0.55;
}
.he-funnel-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.he-funnel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--f-ink);
  opacity: 0.95;
  flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--f-ink) 18%, transparent);
}
.he-funnel-mid { min-width: 0; }
.he-funnel-lab {
  font-size: 12px;
  color: var(--ink);
  font-weight: 550;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
.he-funnel-cost-inline {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.he-funnel-val {
  font-family: var(--fm);
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
/* legado — oculto se sobrar no DOM */
.he-funnel-ghost,
.he-funnel-steps,
.he-funnel-slab,
.he-funnel-face,
.he-funnel-bevel,
.he-funnel-depth { display: none !important; }
.he-funnel-conv {
  align-self: flex-start;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  margin-left: 2px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 10.5px;
  color: var(--ink-3);
}
.he-funnel-conv strong {
  color: #59D317;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  font-family: var(--fm);
}
.he-funnel-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 4px 0 2px 2px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
.he-funnel-side-lab {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.he-funnel-side-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  justify-content: center;
}
.he-funnel-side-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  font-size: 12px;
  color: var(--ink-3);
}
.he-funnel-side-row:last-child { border-bottom: none; }
.he-funnel-side-row strong {
  color: var(--ink);
  font-family: var(--fm);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 12.5px;
}
.he-funnel-side-row.is-total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  border-bottom: none;
  color: var(--ink);
  font-weight: 550;
}
.he-funnel-side-row.is-total strong {
  font-size: 14px;
  font-weight: 700;
}
.he-funnel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 4px 2px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.he-funnel-ob {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--ink-3);
}
.he-funnel-ob b {
  color: var(--ink);
  font-weight: 600;
}
.he-funnel-ob em {
  font-style: normal;
  color: var(--ink-3);
  font-size: 11px;
}
.he-funnel-tot {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.he-funnel-tot span {
  color: var(--ink-3);
  font-size: 12px;
}
.he-funnel-tot strong {
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-family: var(--fm);
}
.ln-groups {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
@media (max-width: 900px) {
  .he-funnel-card.he-funnel-split > .he-funnel-body {
    grid-template-columns: 1fr;
  }
  .he-funnel-side {
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 12px;
  }
  .he-funnel-side-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
  }
  .he-funnel-side-row.is-total {
    grid-column: 1 / -1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .he-funnel-steps { transform: none; }
}
@media (max-width: 1100px) {
  .he-row { grid-template-columns: 1fr; }
}

/* -------- Top Performers = Visão Geral (Highend) -------- */
.tf-tabs {
  grid-column: span 12;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  width: fit-content;
}
.tf-tab {
  appearance: none; border: 0; cursor: pointer;
  font: 600 12.5px/1 var(--fb);
  color: var(--ink-3);
  padding: 8px 14px;
  border-radius: 6px;
  background: transparent;
}
.tf-tab:hover { color: var(--ink); }
.tf-tab.active {
  background: rgba(255, 195, 15, 0.12);
  color: var(--ink);
}
.tf-col-btn {
  appearance: none; border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: 600 12px/1 var(--fb);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: default;
  white-space: nowrap;
}
.tf-tip {
  grid-column: span 12;
  font-size: 12.5px;
  color: #6eb6ff;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(62, 138, 224, 0.35);
  background: rgba(62, 138, 224, 0.12);
}
.tf-utm-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tf-search {
  appearance: none;
  width: 180px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 500 12.5px/1.2 var(--fb);
}
.tf-search::placeholder { color: var(--ink-3); }

.tp-sort {
  grid-column: span 12;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.tp-sort-lab {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  width: 100%;
}
.tp-sort-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.tp-sort-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  font: 600 12px/1.2 var(--fb);
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.tp-sort-btn:hover { color: var(--ink); }
.tp-sort-btn.active {
  background: rgba(255, 195, 15, 0.16);
  border-color: rgba(255, 195, 15, 0.45);
  color: var(--accent);
}
.tp-host { grid-column: span 12; display: grid; gap: 14px; }
.tp-card { grid-column: span 12; }
.tp-table { font-size: 12px; }
.tp-table th {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.tp-table td { white-space: nowrap; }
.tp-table tbody tr.is-top td {
  background: rgba(89, 211, 23, 0.06);
}
.tp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(89, 211, 23, 0.18);
  border: 1px solid rgba(89, 211, 23, 0.4);
  color: #59D317;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tp-card .card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tp-table tfoot td {
  background: var(--surface-2);
  font-weight: 600;
  border-top: 1px solid var(--line);
}
.tp-preview {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 600 11px/1 var(--fb);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tp-preview-ico {
  color: var(--accent);
  font-size: 10px;
}
.tp-preview:hover {
  border-color: rgba(255, 195, 15, 0.45);
  color: var(--accent);
}

/* -------- Análise de Tráfego e UTMs (Highend Lançamentos) -------- */
.ua-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 16px;
}
.ua-page-head .tf-tabs {
  margin-left: auto;
  align-self: center;
}
.ua-hero {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ua-hero-card {
  background: var(--surface-2, var(--card-grad));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.ua-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.ua-hero-lab {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
}
.ua-hero-val {
  font-family: var(--fb);
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ua-hero-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 195, 15, 0.1);
  border: 1px solid rgba(255, 195, 15, 0.16);
  color: var(--accent);
  flex: none;
}
.ua-hero-ico svg { width: 14px; height: 14px; }
.ua-card { grid-column: span 12; }
.ua-card .card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ua-export {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font: 600 12px/1 var(--fb);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.ua-export:hover {
  border-color: rgba(255, 195, 15, 0.4);
  color: var(--accent);
}
.ua-table { font-size: 12px; }
.ua-table th {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.ua-table td { white-space: nowrap; }
.ua-table tfoot td {
  background: var(--surface-2);
  font-weight: 600;
  border-top: 1px solid var(--line);
}
.ua-fonte-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}
.ua-fonte-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex: none;
}
.ua-fonte-ico svg { width: 13px; height: 13px; }
.ua-fonte-ico.tone-meta { color: #3C83F6; background: rgba(60, 131, 246, 0.14); }
.ua-fonte-ico.tone-google { color: #EA4335; background: rgba(234, 67, 53, 0.14); }
.ua-fonte-ico.tone-organico { color: #22A06B; background: rgba(34, 160, 107, 0.14); }
@media (max-width: 900px) {
  .ua-hero { grid-template-columns: 1fr; }
  .ua-page-head .tf-tabs { margin-left: 0; width: 100%; }
}

.table-wrap.wide-scroll {
  overflow-x: auto;
  max-width: 100%;
  display: block;
}

/* ---------------- telas estreitas ---------------- */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    gap: 14px;
    padding: 16px 14px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-caption { display: none; }
  .nav-btn { width: auto; padding: 8px 12px; }
  .nav-btn.active::before { display: none; }
  .side-meta { margin-top: 0; border-top: none; padding-top: 0; }
  .main { padding: 18px 14px 44px; }
  .page-head h2 { font-size: 24px; }
}

/* ============================================================
   Performance por Temperatura — réplica print Highend (Frio × Quente)
   ============================================================ */
.ph-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.th-caption {
  grid-column: span 12;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 2px 2px -4px;
}
.th-temp-row {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.th-temp {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(16, 19, 30, 0.35);
  padding: 14px;
  min-width: 0;
}
.th-temp.th-frio { border-color: rgba(60, 131, 246, 0.22); }
.th-temp.th-quente { border-color: rgba(240, 86, 63, 0.26); }
.th-temp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.th-temp-ico { display: grid; place-items: center; color: var(--ink-2); }
.th-temp-name {
  font-family: var(--fd);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}
.th-temp-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid;
}
.th-frio .th-temp-badge {
  color: #7EB6FF;
  border-color: rgba(60, 131, 246, 0.55);
  background: rgba(60, 131, 246, 0.13);
}
.th-quente .th-temp-badge {
  color: #FF8E76;
  border-color: rgba(240, 86, 63, 0.55);
  background: rgba(240, 86, 63, 0.15);
}
.th-kpis {
  display: grid;
  gap: 10px;
}
.th-kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 10px; }
.th-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.th-kpis .kpi {
  min-width: 0;
  padding: 12px 13px 11px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.th-kpis .he-kpi-ico {
  width: 26px;
  height: 26px;
  background: rgba(241, 228, 212, 0.05);
  border-color: var(--line);
  color: var(--ink-2);
}
.th-kpis-2 .k-value { font-size: 19px; }
.th-kpis-3 .k-value { font-size: 15.5px; }
.th-cpl-card {
  grid-column: span 12;
  display: flex;
  flex-direction: column;
}
.th-cpl-card .card-head { order: 0; }
.th-cpl-card .chart-wrap { order: 1; }
.th-cpl-card .legend {
  order: 2;
  justify-content: center;
  padding: 10px 0 0;
  gap: 18px;
}
.th-cpl-card .legend .item {
  background: none;
  border: 0;
  padding: 0;
  font-weight: 600;
}
.th-cpl-card .legend .key-line {
  position: relative;
  width: 18px;
}
.th-cpl-card .legend .key-line::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -4px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1.6px solid currentColor;
}
.th-sec {
  grid-column: span 12;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(10, 12, 20, 0.5);
  overflow: hidden;
}
.th-sec.th-tone-meta { border-color: rgba(60, 131, 246, 0.35); }
.th-sec.th-tone-google { border-color: rgba(234, 67, 53, 0.35); }
.th-sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.th-tone-meta .th-sec-head {
  background: rgba(60, 131, 246, 0.08);
  border-bottom-color: rgba(60, 131, 246, 0.25);
}
.th-tone-google .th-sec-head {
  background: rgba(234, 67, 53, 0.07);
  border-bottom-color: rgba(234, 67, 53, 0.22);
}
.th-sec-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
}
.th-tone-meta .th-sec-logo { background: #2f6fe0; color: #fff; }
.th-tone-google .th-sec-logo {
  background: rgba(234, 67, 53, 0.16);
  border: 1px solid rgba(234, 67, 53, 0.4);
}
.th-sec-logo svg { width: 16px; height: 16px; }
.th-sec-name {
  font-family: var(--fd);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.th-sec-body {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.th-sec-body .th-temp-row,
.th-sec-body .th-cpl-card { grid-column: auto; }
@media (max-width: 1100px) {
  .th-temp-row { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .th-kpis-2, .th-kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   Pesquisa da Audiência — réplica print Highend
   ============================================================ */
.ln-section-title .sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-3);
}
.pq-perfil-row-wrap {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.pq-perfil {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card-grad);
  padding: 16px 18px;
  min-width: 0;
}
.pq-perfil-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.pq-dot {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 999px;
  background: #3C83F6;
}
.pq-perfil-buyer .pq-dot { background: #FFC30F; }
.pq-perfil-title {
  font-family: var(--fd);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}
.pq-perfil-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.pq-perfil-list { display: grid; }
.pq-perfil-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.pq-perfil-row:last-child { border-bottom: none; }
.pq-perfil-q { flex: 1; min-width: 0; }
.pq-q-text {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.pq-q-ans {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pq-q-pct {
  flex: none;
  font-family: var(--fm);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.kpis.he-kpis.ln-kpis.pq-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pq-q-grid {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.pq-q-card { grid-column: auto; }
.pq-bars { display: grid; gap: 7px; margin-top: 10px; }
.pq-bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.42fr) 1fr 40px;
  align-items: center;
  gap: 10px;
}
.pq-bar-lab {
  font-size: 11px;
  color: var(--ink-3);
  text-align: right;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pq-bar-track {
  height: 16px;
  border-radius: 5px;
  background: rgba(241, 228, 212, 0.045);
  overflow: hidden;
}
.pq-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(241, 228, 212, 0.55), var(--ink-2));
}
.pq-bar-val {
  font-family: var(--fm);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.pq-empty {
  padding: 22px 6px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
}
.pq-utm-card { grid-column: span 12; }
.pq-utm-card .table-wrap { display: block; }
.pq-search {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
}
.pq-search svg { width: 13px; height: 13px; flex: none; }
.pq-search input {
  appearance: none;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font: 500 11.5px/1 var(--fb);
  width: 130px;
}
.pq-search input::placeholder { color: var(--ink-3); }
.pq-utm-table thead th {
  font-size: 10px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.pq-utm-table tbody td:first-child {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pq-src-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(241, 228, 212, 0.04);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
}
.pq-src-chip.tone-meta { border-color: rgba(60, 131, 246, 0.4); }
.pq-src-chip.tone-google { border-color: rgba(234, 67, 53, 0.4); }
.pq-src-chip.tone-ig { border-color: rgba(197, 61, 235, 0.4); }
.pq-src-chip.tone-yt { border-color: rgba(240, 86, 63, 0.4); }
.pq-src-chip.tone-org { border-color: rgba(34, 160, 107, 0.4); }
.pq-src-ico {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(241, 228, 212, 0.06);
  flex: none;
}
.pq-src-ico svg { width: 12px; height: 12px; }
.pq-utm-foot {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-3);
}
.pq-utm-card .table-wrap.scroll-rows thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
}
/* tfoot fixo: o Total continua visível com a lista rolando */
.pq-utm-card .table-wrap.scroll-rows tfoot td {
  position: sticky;
  bottom: 0;
  background: var(--surface-2);
}
@media (max-width: 1100px) {
  .pq-perfil-row-wrap,
  .pq-q-grid { grid-template-columns: 1fr; }
  .kpis.he-kpis.ln-kpis.pq-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- Creative preview drawer (Top Performers / Tráfego) ---- */
body.is-drawer-open { overflow: hidden; }
.cdi-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
}
.cdi-drawer[hidden] { display: none !important; }
.cdi-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.cdi-drawer-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100vw);
  height: 100%;
  overflow: auto;
  background: #0b0e16;
  border-left: 1px solid rgba(241, 228, 212, 0.1);
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.45);
  padding: 18px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: cdiDrawerIn 0.22s ease both;
}
@keyframes cdiDrawerIn {
  from { transform: translateX(18px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cdi-drawer-panel { animation: none; }
}
.cdi-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.cdi-drawer-title {
  margin: 0;
  font-family: var(--fb);
  font-size: 18px;
  font-weight: 750;
  color: var(--ink);
  word-break: break-word;
}
.cdi-drawer-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-3);
}
.cdi-drawer-close {
  appearance: none;
  border: 1px solid rgba(241, 228, 212, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-2);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.cdi-drawer-close:hover {
  color: var(--ink);
  border-color: rgba(255, 195, 15, 0.35);
}
.cdi-drawer-media {
  border: 1px solid rgba(241, 228, 212, 0.1);
  border-radius: 14px;
  background: #10131e;
  overflow: hidden;
  min-height: 220px;
}
.cdi-drawer-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0c14;
  min-height: 260px;
  padding: 10px;
}
.cdi-drawer-frame.is-iframe {
  display: block;
  padding: 0;
  min-height: 420px;
  background: #fff;
}
.cdi-drawer-frame img {
  max-width: 100%;
  max-height: 420px;
  border-radius: 8px;
  display: block;
}
.cdi-drawer-iframe {
  width: 100%;
  height: 420px;
  border: 0;
  display: block;
  background: #fff;
}
.cdi-drawer-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}
.cdi-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: space-between;
}
.cdi-drawer-link {
  color: #7db7ff;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}
.cdi-drawer-link:hover { text-decoration: underline; }
.cdi-drawer-refresh {
  appearance: none;
  border: 1px solid rgba(241, 228, 212, 0.12);
  background: transparent;
  color: var(--ink-2);
  font: 600 12px/1 var(--fb);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.cdi-drawer-refresh:hover {
  color: var(--accent);
  border-color: rgba(255, 195, 15, 0.35);
}
.cdi-drawer-metrics h4 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.cdi-drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cdi-drawer-metric {
  border: 1px solid rgba(241, 228, 212, 0.08);
  background: rgba(16, 19, 30, 0.9);
  border-radius: 12px;
  padding: 12px 12px 10px;
}
.cdi-drawer-metric-lab {
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.cdi-drawer-metric-val {
  font-family: var(--fb);
  font-size: 16px;
  font-weight: 750;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.tp-card .table-wrap.scroll-rows,
.ua-card .table-wrap.scroll-rows {
  display: block;
}
.tp-card .table-wrap.scroll-rows thead th,
.ua-card .table-wrap.scroll-rows thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
}
.tp-card .table-wrap.scroll-rows tfoot td,
.ua-card .table-wrap.scroll-rows tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--surface-2);
}
