/* Apareci.ai · Converte v2 — Design System */

:root {
  --yellow: #DBC605;
  --yellow-soft: #FFF9D1;
  --yellow-line: rgba(219, 198, 5, 0.35);
  --black: #0A0A0A;
  --ink: #141414;
  --ink-2: #2A2A2A;
  --g600: #4B4B4B;
  --g500: #6B6B6B;
  --g400: #9A9A9A;
  --g300: #C8C8C8;
  --g200: #E6E6E6;
  --g150: #EDEDED;
  --g100: #F4F4F3;
  --g50: #FAFAF9;
  --white: #FFFFFF;
  --red: #E5484D;
  --red-soft: #FEECEC;
  --green: #2FA84F;
  --green-soft: #E8F6EC;
  --amber: #F5A623;
  --amber-soft: #FFF3DE;
  --blue: #2563EB;
  --blue-soft: #E7EEFE;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: #F7F7F5;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; }

a { color: inherit; text-decoration: none; }

/* ============ LAYOUT SHELL ============ */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

/* ---- Topbar (dentro do main) ---- */
.topbar {
  height: 48px;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.topbar .logo .dot { color: var(--yellow); border-bottom: 2px solid var(--yellow); padding-bottom: 1px; }
.topbar .brand-picker {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #E5E5E5;
  cursor: pointer;
}
.topbar .brand-picker .brand-name { font-weight: 600; color: var(--white); }
.topbar .brand-picker .brand-sep { color: #555; }
.topbar .brand-picker .brand-url { color: #A3A3A3; }
.topbar .brand-picker .chev { color: #808080; font-size: 10px; margin-left: 2px; }
.topbar .top-spacer { flex: 1; }
.topbar .top-icons { display: flex; gap: 14px; align-items: center; color: #A3A3A3; }
.topbar .top-icons svg { width: 18px; height: 18px; cursor: pointer; }
.topbar .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--yellow);
  color: var(--black);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  cursor: pointer;
}

/* ---- Mobile nav controls (hidden on desktop) ---- */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 0;
}
.menu-toggle svg { width: 20px; height: 20px; }

.sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  margin: 0 0 10px auto;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: var(--g100);
  color: var(--g600);
  font-size: 13px;
  cursor: pointer;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.45);
  z-index: 39;
}
.sidebar-backdrop.visible { display: block; }

/* ---- Sidebar ---- */
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--g200);
  padding: 20px 12px 40px;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .sb-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--g400);
  letter-spacing: 0.08em;
  padding: 12px 12px 6px;
}
.sidebar .sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin: 1px 0;
  transition: background 0.12s;
}
.sidebar .sb-item:hover { background: var(--g100); }
.sidebar .sb-item.active { background: var(--black); color: var(--white); }
.sidebar .sb-item.active svg { color: var(--yellow); }
.sidebar .sb-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--g500); }
.sidebar .sb-item .tag {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  background: var(--yellow);
  color: var(--black);
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.sidebar .sb-item.active .tag { background: var(--yellow); color: var(--black); }

/* ---- Main ---- */
.main { min-width: 0; }
.content {
  padding: 28px 40px 60px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.crumb {
  color: var(--g500);
  font-size: 12px;
  margin-bottom: 12px;
}
.crumb .sep { margin: 0 6px; color: var(--g300); }
.crumb .cur { color: var(--ink); font-weight: 500; }

.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.page-title .yell-under { border-bottom: 3px solid var(--yellow); padding-bottom: 1px; }
.page-sub {
  color: var(--g500);
  font-size: 14px;
  margin: 0 0 22px;
  max-width: 720px;
}

/* ---- Tabs (padrão apareci: linha amarela na ativa) ---- */
.tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--g200);
  margin: 4px 0 22px;
}
.tabs .tab {
  padding: 8px 0 10px;
  color: var(--g500);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}
.tabs .tab:hover { color: var(--ink); }
.tabs .tab.active { color: var(--ink); border-bottom-color: var(--yellow); font-weight: 600; }

/* ---- Hero preto ---- */
.hero {
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 34px;
  position: relative;
  overflow: hidden;
}
.hero .eyebrow {
  font-size: 10px;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero h2 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 700px;
}
.hero h2 .money {
  color: var(--yellow);
  border-bottom: 3px solid var(--yellow);
  padding-bottom: 2px;
}
.hero .hero-sub {
  color: #C8C8C8;
  font-size: 14px;
  max-width: 640px;
  line-height: 1.55;
}
.hero .hero-meta {
  display: flex;
  gap: 24px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.hero .hero-meta .item {
  font-size: 11px;
  color: #7A7A7A;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hero .hero-meta .item strong {
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  display: block;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 3px;
}
.hero .hero-meta .item strong .delta { font-size: 11px; margin-left: 4px; }
.hero .delta-up { color: var(--green); }
.hero .delta-down { color: #FF7A85; }

/* ---- Section heading (numbered) ---- */
.section-h {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 36px 0 14px;
}
.section-h .num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--black);
  font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.section-h h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.section-h .h-sub {
  color: var(--g500);
  font-size: 13px;
  margin-left: 4px;
}

/* ---- Leak Cards ---- */
.leak-grid {
  display: grid;
  gap: 14px;
}
.leak {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 18px;
  align-items: start;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.leak:hover { border-color: var(--g300); box-shadow: var(--shadow); }
.leak .rank {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--black);
  color: var(--yellow);
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.leak .body h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.leak .body .desc {
  color: var(--g500);
  font-size: 13px;
  margin: 0 0 12px;
  line-height: 1.5;
}
.leak .signals {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--g200);
  background: var(--white);
  color: var(--g600);
}
.chip.funnel { background: var(--red-soft); color: #8B1A1F; border-color: transparent; }
.chip.speed  { background: var(--amber-soft); color: #8A5210; border-color: transparent; }
.chip.rec    { background: var(--blue-soft); color: #1E3F8B; border-color: transparent; }
.chip.heat   { background: #F3E8FF; color: #6B21A8; border-color: transparent; }
.chip.survey { background: #DCFCE7; color: #14532D; border-color: transparent; }
.chip.ok     { background: var(--green-soft); color: #14532D; border-color: transparent; }

.leak .action {
  text-align: right;
}
.leak .gain {
  font-weight: 700;
  color: var(--green);
  font-size: 16px;
  margin: 0 0 8px;
  white-space: nowrap;
}
.leak .gain .lbl { display: block; font-size: 10px; font-weight: 600; color: var(--g500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.leak .btn { white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--g200);
  background: var(--white);
  color: var(--ink);
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--g100); border-color: var(--g300); }
.btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--black); }
.btn.primary:hover { background: #C9B505; border-color: #C9B505; }
.btn.dark { background: var(--black); border-color: var(--black); color: var(--white); }
.btn.dark:hover { background: #1a1a1a; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--g600); }
.btn.ghost:hover { color: var(--ink); background: var(--g100); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn svg { width: 14px; height: 14px; }

/* Timeline */
.timeline {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 6px 0;
}
.tl-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--g150);
  align-items: center;
}
.tl-item:last-child { border-bottom: none; }
.tl-when {
  color: var(--g500);
  font-size: 12px;
  font-weight: 500;
}
.tl-what {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}
.tl-what .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}
.tl-what .badge.done { background: var(--green-soft); color: #14532D; }
.tl-what .badge.new  { background: var(--amber-soft); color: #8A5210; }
.tl-what .badge.warn { background: var(--red-soft); color: #8B1A1F; }
.tl-impact {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.tl-impact.up { color: var(--green); }
.tl-impact.down { color: var(--red); }
.tl-impact.info { color: var(--g500); }

/* KPI row */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0 4px;
}
.kpi {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.kpi .lbl {
  font-size: 11px;
  color: var(--g500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.kpi .val {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.kpi .delta {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}
.kpi .delta.up { color: var(--green); }
.kpi .delta.down { color: var(--red); }
.kpi .delta.flat { color: var(--g500); }

/* ============ FUNNEL ============ */
.funnel {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 24px;
}
.funnel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.funnel-head h4 { margin: 0; font-size: 16px; font-weight: 700; }
.funnel-head .sub { color: var(--g500); font-size: 12px; }

.step-list { margin-top: 18px; }
.step {
  display: grid;
  grid-template-columns: 200px 1fr 240px 130px;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
}
.step-label-col {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.35;
}
.step-label-col .step-num {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--g500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.step-label-col .step-help {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--g500);
  margin-top: 2px;
}
.step-bar-wrap {
  position: relative;
}
.step-bar {
  height: 40px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  position: relative;
  transition: width 0.6s ease;
  min-width: 140px;
  white-space: nowrap;
  overflow: visible;
}
.step-bar .count { display: inline-block; }
.step-bar.warn { background: linear-gradient(90deg, #F5A623 0%, #E5484D 100%); }
.step-bar.crit { background: linear-gradient(90deg, #E5484D 0%, #9F1116 100%); }
.step-bar.ok { background: linear-gradient(90deg, #14532D 0%, #2FA84F 100%); }

.step-signals { display: flex; flex-direction: column; gap: 4px; }
.step-signals .lbl { font-size: 10px; color: var(--g500); text-transform: uppercase; font-weight: 600; letter-spacing: 0.06em; }
.step-signals .chips { display: flex; flex-wrap: wrap; gap: 4px; }

.step-value { text-align: right; }
.step-value .drop {
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 3px;
}
.step-value .drop.small { color: var(--g500); font-weight: 500; font-size: 12px; }
.step-value .gain {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

.drop-connector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 218px;
  padding: 4px 0;
  color: var(--g500);
  font-size: 12px;
}
.drop-connector .line { flex: 1; height: 1px; background: var(--g200); }

/* ============ SEGMENT / GROUPS ============ */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.group-card {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.group-card:hover { border-color: var(--g300); box-shadow: var(--shadow); }
.group-card .g-head { display: flex; justify-content: space-between; align-items: baseline; }
.group-card .g-count {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.group-card .g-count-lbl { font-size: 11px; color: var(--g500); font-weight: 500; }
.group-card .g-name {
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
}
.group-card .g-detail { font-size: 12px; color: var(--g500); line-height: 1.5; }
.group-card .g-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--g150); font-size: 12px; }
.group-card .g-footer .link { color: var(--ink); font-weight: 600; }

/* ============ TESTS / EXPERIMENTS ============ */
.exp-grid { display: grid; gap: 14px; }
.exp {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr 260px 140px;
  gap: 20px;
  align-items: center;
}
.exp .status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 8px;
}
.exp .status.running { background: var(--blue-soft); color: #1E3F8B; }
.exp .status.won { background: var(--green-soft); color: #14532D; }
.exp .status.draft { background: var(--g100); color: var(--g600); }
.exp .status .dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.exp h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.exp .exp-desc { color: var(--g500); font-size: 12px; line-height: 1.5; }
.exp .exp-metric { font-size: 13px; }
.exp .exp-metric .row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--g150); }
.exp .exp-metric .row:last-child { border-bottom: none; }
.exp .exp-metric .row .lbl { color: var(--g500); font-size: 12px; }
.exp .exp-metric .row .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.exp .exp-cta { text-align: right; }
.exp .exp-cta .gain-note {
  font-size: 11px;
  color: var(--g500);
  margin-bottom: 6px;
}
.exp .exp-cta .gain-note strong { color: var(--green); font-weight: 700; }

/* ============ SETTINGS ============ */
.set-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.set-card {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.set-card h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.set-card h4 svg { width: 16px; height: 16px; color: var(--yellow); }
.set-card .set-sub { color: var(--g500); font-size: 12px; margin: 0 0 14px; line-height: 1.5; }
.set-card .set-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--g150);
  font-size: 13px;
}
.set-card .set-row:last-child { border-bottom: none; }
.set-card .set-row .lbl { color: var(--g600); }
.set-card .set-row .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.set-card .status-ok { color: var(--green); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.set-card .status-warn { color: var(--amber); font-weight: 600; }

.usage-bar {
  height: 8px;
  background: var(--g150);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.usage-bar .fill { height: 100%; background: var(--yellow); }
.usage-bar .fill.warn { background: var(--amber); }

/* Code block for install */
.code {
  background: #0F0F0F;
  color: #E5E5E5;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  position: relative;
}
.code .k { color: #F0A6FF; }
.code .s { color: #A6EFAA; }
.code .c { color: #6B6B6B; font-style: italic; }
.code .copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(255,255,255,0.06);
  color: #E5E5E5;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}
.code .copy-btn:hover { background: rgba(255,255,255,0.12); }

/* Insight card (yellow soft) */
.insight {
  background: var(--yellow-soft);
  border: 1px solid rgba(219, 198, 5, 0.4);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 18px 0;
}
.insight svg { width: 20px; height: 20px; color: #8A5210; flex-shrink: 0; margin-top: 1px; }
.insight h5 { margin: 0 0 3px; font-size: 13px; font-weight: 700; color: var(--ink); }
.insight p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.55; }

/* Two-col layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Heatmap surrogate */
.heatmap {
  position: relative;
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
  border-radius: var(--radius-sm);
  height: 260px;
  overflow: hidden;
  border: 1px solid var(--g200);
}
.heatmap .hot {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  mix-blend-mode: screen;
}
.heatmap-fig {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.heatmap-fig h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.heatmap-fig .caption { color: var(--g500); font-size: 12px; margin: 0 0 14px; }
.heat-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: var(--g500); }
.heat-grad { flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #1e40af 0%, #06b6d4 25%, #22c55e 50%, #eab308 75%, #ef4444 100%); }

/* Recording group list */
.rec-list {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  overflow: hidden;
}
.rec-row {
  display: grid;
  grid-template-columns: 1fr 140px 140px 100px;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--g150);
  align-items: center;
  font-size: 13px;
  cursor: pointer;
}
.rec-row:last-child { border-bottom: none; }
.rec-row:hover { background: var(--g50); }
.rec-row.head {
  background: var(--g50);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--g500);
  letter-spacing: 0.06em;
  cursor: default;
}
.rec-row .g-title { font-weight: 600; color: var(--ink); }
.rec-row .g-subtitle { color: var(--g500); font-size: 12px; margin-top: 2px; }

/* Small helpers */
.muted { color: var(--g500); }
.right { text-align: right; }
.mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--g200); margin: 24px 0; }

/* Generic page footer action row (e.g. "baixar PDF" / "marcar como revisada") */
.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.page-footer-actions { display: flex; gap: 8px; }

/* ============ FILTER ROW ============ */
.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-lbl { font-size: 10px; font-weight: 700; color: var(--g500); text-transform: uppercase; letter-spacing: 0.06em; }
.filter-spacer { flex: 1; }
.select-like {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--g200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  min-width: 180px;
  justify-content: space-between;
}
.select-like.wide { min-width: 260px; }
.select-like .chev { color: var(--g500); font-size: 10px; }

.chips-inline { display: flex; gap: 4px; background: var(--g100); padding: 3px; border-radius: 6px; }
.chip-toggle {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  color: var(--g500);
  cursor: pointer;
}
.chip-toggle.active { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }

/* ============ PATTERN GROUPS ============ */
.pattern-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.pattern-tag.crit { background: var(--red-soft); color: #8B1A1F; }
.pattern-tag.warn { background: var(--amber-soft); color: #7A4A0F; }
.pattern-tag.ok { background: var(--green-soft); color: #185C2E; }

.group-card .risk { color: var(--red); font-weight: 600; font-size: 12px; }
.group-card .risk.ok { color: var(--green); }

/* ============ HEATMAP PANEL ============ */
.heatmap-panel {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 20px 22px 22px;
}
.heatmap-controls {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--g150);
  margin-bottom: 18px;
}

.heatmap-canvas {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 22px;
  align-items: flex-start;
}

.hm-page-frame {
  position: relative;
  background: linear-gradient(180deg, #FAFAF9 0%, #F4F4F3 100%);
  border: 1px solid var(--g200);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  min-height: 380px;
}
.hm-header {
  height: 12%;
  background: var(--white);
  border-bottom: 1px solid var(--g150);
  display: flex;
  align-items: center;
  padding: 0 4%;
  gap: 4%;
}
.hm-logo { font-weight: 700; font-size: 11px; color: var(--ink); }
.hm-nav { display: flex; gap: 14px; font-size: 10px; color: var(--g500); }
.hm-hero {
  height: 40%;
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4%;
  padding: 4% 4%;
  align-items: center;
  border-bottom: 1px solid var(--g150);
}
.hm-hero-text { display: flex; flex-direction: column; gap: 6px; }
.hm-title { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.hm-sub { font-size: 10px; color: var(--g500); }
.hm-cta { display: inline-block; padding: 6px 12px; background: var(--black); color: var(--white); font-size: 11px; border-radius: 4px; font-weight: 600; margin-top: 6px; width: fit-content; }
.hm-hero-img { background: var(--g150); border-radius: 4px; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--g400); font-size: 10px; }
.hm-section { padding: 3% 4%; height: 35%; }
.hm-h2 { font-size: 12px; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.hm-blocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; height: 60%; }
.hm-blocks span { background: var(--g150); border-radius: 4px; display: block; }
.hm-footer {
  position: absolute; bottom: 0; left: 0; right: 0; height: 8%;
  background: var(--g100);
  border-top: 1px solid var(--g150);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--g400);
}

.hm-spot {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(159,17,22,0.75) 0%, rgba(229,72,77,0.45) 45%, rgba(229,72,77,0) 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translate(-8px, -8px);
}
.hm-spot.medium { background: radial-gradient(circle, rgba(245,166,35,0.7) 0%, rgba(245,166,35,0.4) 45%, rgba(245,166,35,0) 80%); }
.hm-spot.cool { background: radial-gradient(circle, rgba(32,128,141,0.55) 0%, rgba(32,128,141,0.28) 45%, rgba(32,128,141,0) 80%); }
.hm-spot .hm-num {
  background: rgba(10,10,10,0.85);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}

.hm-legend { padding: 4px 0 0; }
.hm-legend-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--g500); letter-spacing: 0.06em; margin-bottom: 8px; }
.hm-scale { display: flex; height: 8px; border-radius: 4px; overflow: hidden; }
.hm-scale span { flex: 1; }
.hm-scale-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--g500); margin-top: 4px; }

.hm-summary { display: flex; flex-direction: column; gap: 8px; }
.hm-summary-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--ink); line-height: 1.45; }
.hm-summary-row .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }


/* ============ SUGGESTED TESTS ============ */
.suggest-list { display: flex; flex-direction: column; gap: 12px; }
.suggest {
  background: var(--white);
  border: 1px solid var(--g200);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1fr 320px 160px;
  gap: 22px;
  align-items: center;
}
.suggest .s-source { display: flex; flex-wrap: wrap; gap: 5px; grid-column: 1 / -1; margin-bottom: -4px; }
.suggest .s-hypo .s-lbl,
.suggest .s-forecast .s-lbl {
  font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--g500); letter-spacing: 0.06em; margin-bottom: 4px;
}
.suggest h4 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; }
.s-forecast-row { display: flex; flex-direction: column; gap: 6px; }
.s-metric { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.s-metric .s-num { font-weight: 700; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.s-metric .s-num.money { color: var(--green); }
.s-metric.big .s-num { font-size: 18px; }
.s-metric .s-lbl-inline { font-size: 11px; color: var(--g500); }
.suggest .s-action { display: flex; flex-direction: column; gap: 6px; }

/* ============ EXPERIMENTS ============ */
.exp {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr 220px 150px;
  gap: 22px;
  align-items: start;
}
.exp-body h4 { margin: 8px 0 4px; font-size: 15px; font-weight: 700; line-height: 1.35; }
.exp-body .desc { color: var(--g500); font-size: 12px; margin: 0 0 12px; }
.exp-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
}
.status-tag.running { background: var(--green-soft); color: #185C2E; }
.status-tag.paused { background: var(--g150); color: var(--g500); }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.exp-variants { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.exp-variants.muted { opacity: 0.7; }
.variant {
  background: var(--g100);
  border: 1px solid var(--g150);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.variant.winning { background: #F4FBEF; border-color: rgba(47,168,79,0.35); }
.variant .var-lbl { font-size: 11px; font-weight: 600; color: var(--g500); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.variant .var-num { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.variant.winning .var-num { color: var(--green); }
.variant .var-detail { font-size: 11px; color: var(--g500); margin-top: 2px; }
.var-badge { background: var(--green); color: var(--white); font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.06em; }

.exp-forecast { padding-top: 20px; }
.exp-forecast .s-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--g500); letter-spacing: 0.06em; margin-bottom: 4px; }
.exp-forecast .s-num.money.big { display: block; font-size: 22px; font-weight: 700; color: var(--green); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.exp-forecast .s-num.money.big.muted { color: var(--g400); }
.conf-bar { height: 5px; background: var(--g150); border-radius: 3px; overflow: hidden; }
.conf-fill { height: 100%; background: linear-gradient(90deg, var(--amber) 0%, var(--green) 100%); border-radius: 3px; }
.conf-fill.low { background: var(--g300); }
.conf-lbl { font-size: 11px; color: var(--g500); margin-top: 4px; }
.conf-lbl.good { color: var(--green); font-weight: 600; }

.exp-action { display: flex; flex-direction: column; gap: 6px; padding-top: 20px; }

/* ============ SURVEYS ============ */
.survey-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.survey {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.survey.new {
  background: var(--yellow-soft);
  border: 1.5px dashed var(--yellow);
  align-items: flex-start;
  justify-content: center;
}
.survey .s-top { display: flex; justify-content: space-between; align-items: center; }
.survey-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.survey h4 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; }
.s-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
}
.s-status.live { background: var(--green-soft); color: #185C2E; }
.s-status.draft { background: var(--g150); color: var(--g500); }
.s-meta { font-size: 12px; color: var(--g500); line-height: 1.5; }
.s-progress-row { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 4px; }
.s-progress-lbl { color: var(--ink); font-weight: 600; }
.s-progress-target { color: var(--g500); }
.progress-bar { height: 5px; background: var(--g150); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--yellow); border-radius: 3px; }
.s-insight-preview {
  background: var(--g50);
  border-left: 3px solid var(--yellow);
  padding: 10px 12px;
  border-radius: 4px;
}
.s-insight-preview .s-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--g500); letter-spacing: 0.06em; margin-bottom: 4px; }
.s-insight-preview .s-quote { font-size: 13px; color: var(--ink); line-height: 1.45; }
.btn.big { padding: 10px 18px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--g500); border: none; padding: 6px 10px; }
.btn.ghost:hover { color: var(--ink); text-decoration: underline; }

/* ============ SETTINGS ============ */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: flex-start;
}

.settings-nav {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 8px;
  position: sticky;
  top: 68px;
}
.settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  margin: 2px 0;
}
.settings-item:hover { background: var(--g100); }
.settings-item.active { background: var(--black); color: var(--white); }
.settings-item.active svg { color: var(--yellow); }
.settings-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--g500); }
.settings-item > span:not(.pill) { flex: 1; }
.settings-item .pill {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  background: var(--g150); color: var(--g500);
}
.settings-item .pill.ok { background: var(--green); color: var(--white); }
.settings-item .pill.warn { background: var(--amber); color: var(--black); }
.settings-item.active .pill.ok { background: var(--yellow); color: var(--black); }
.settings-item.active .pill.warn { background: var(--yellow); color: var(--black); }

.settings-content { display: flex; flex-direction: column; gap: 32px; }
.settings-block {
  background: var(--white);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 24px 28px;
}
.settings-block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.settings-block-head h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.settings-block-head p { margin: 0; color: var(--g500); font-size: 13px; max-width: 560px; }
.settings-status { display: flex; gap: 10px; align-items: center; padding: 8px 14px; background: var(--green-soft); border-radius: var(--radius-sm); }
.settings-status .dot { width: 8px; height: 8px; border-radius: 50%; }
.settings-status .dot.green { background: var(--green); box-shadow: 0 0 0 4px rgba(47,168,79,0.15); }
.stat-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--g500); letter-spacing: 0.06em; }
.stat-val { font-size: 13px; font-weight: 600; color: var(--ink); }
.stat-val.big { font-size: 22px; font-weight: 700; }
.stat-val .stat-of { font-size: 12px; font-weight: 500; color: var(--g400); }

.settings-card {
  background: var(--g50);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.settings-card.small { padding: 16px 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.settings-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.settings-card-title { font-weight: 700; font-size: 14px; }
.settings-card-sub { color: var(--g500); font-size: 12px; margin-top: 2px; }
.settings-card-footer { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.install-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); }
.install-check svg { width: 14px; height: 14px; color: var(--green); flex-shrink: 0; }
.install-check strong { color: var(--ink); font-weight: 700; }

.code-block {
  background: #0F0F0F;
  color: #E5E5E5;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  margin: 0;
}
.code-block .tag-c { color: #F5A623; }
.code-block .attr-c { color: #A3D9E8; }
.code-block .str-c { color: #A6E3A1; }

.settings-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

/* ---- Usage ---- */
.usage-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.usage-card {
  background: var(--g50);
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.usage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.usage-pct { font-size: 24px; font-weight: 700; color: var(--amber); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.usage-pct.ok { color: var(--green); }
.progress-bar.tall { height: 8px; }
.usage-foot { font-size: 11px; color: var(--g500); margin-top: 8px; }

.plan-badge { background: var(--black); color: var(--yellow); font-size: 11px; font-weight: 700; padding: 6px 12px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

.upsell-card {
  margin-top: 16px;
  background: var(--yellow-soft);
  border: 1px dashed var(--yellow);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.upsell-head { font-size: 15px; font-weight: 700; color: var(--ink); }
.upsell-sub { color: var(--g500); font-size: 12px; margin-top: 2px; }

/* ---- Preferences ---- */
.pref-list { display: flex; flex-direction: column; gap: 0; }
.pref-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--g150);
}
.pref-row:last-child { border-bottom: 0; }
.pref-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.pref-sub { color: var(--g500); font-size: 12px; max-width: 460px; }
.pref-value { flex-shrink: 0; }
.pref-actions { display: flex; gap: 6px; }

.settings-input {
  border: 1px solid var(--g200);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink);
  background: var(--white);
  font-family: inherit;
  min-width: 240px;
}
.settings-input.small { min-width: 100px; text-align: right; font-variant-numeric: tabular-nums; }

/* switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--g300); border-radius: 999px; cursor: pointer; transition: 0.15s; }
.slider::before { content:""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: var(--white); border-radius: 50%; transition: 0.15s; box-shadow: var(--shadow-sm); }
.switch input:checked + .slider { background: var(--black); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* team */
.team-table {
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  overflow: hidden;
}
.team-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--g150);
  font-size: 13px;
}
.team-row:last-child { border-bottom: 0; }
.team-row.head { background: var(--g100); color: var(--g500); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 16px; }
.team-p { display: flex; align-items: center; gap: 10px; }
.tp-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--g200); color: var(--g500);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.tp-avatar.yellow { background: var(--yellow); color: var(--black); }
.tp-avatar.pending { background: var(--amber-soft); color: var(--amber); }
.tp-name { font-weight: 600; color: var(--ink); }
.tp-mail { color: var(--g500); font-size: 11px; }
.role-pill { display: inline-block; padding: 3px 8px; border-radius: 3px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.role-pill.owner { background: var(--black); color: var(--yellow); }
.role-pill.admin { background: var(--blue-soft); color: var(--blue); }
.role-pill.viewer { background: var(--g150); color: var(--g500); }
.team-actions { display: flex; gap: 12px; justify-content: flex-end; font-size: 12px; }
.team-actions a { color: var(--ink); font-weight: 600; }
.team-actions a:hover { text-decoration: underline; }
.team-actions a.danger { color: var(--red); }
.team-actions .muted { color: var(--g400); font-style: italic; font-size: 11px; }

.btn.danger { background: var(--white); border-color: rgba(229,72,77,0.4); color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }

/* Demo disclaimer */
.demo-disclaimer {
  padding: 24px 32px;
  text-align: center;
  color: var(--g500);
  font-size: 12px;
  line-height: 1.6;
  border-top: 1px solid var(--g200);
  margin-top: 48px;
  background: var(--white);
}

/* Demo badge no topo */
.demo-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--yellow, #DBC605);
  color: var(--black, #0A0A0A);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-right: 16px;
}

/* ============ RESPONSIVE ============ */
/* Placed at the end of the file on purpose: several component rules above
   (settings, team, surveys, experiments…) are declared after the old
   breakpoint block used to live, so a media query needs to come last in the
   source to reliably win the cascade at equal specificity. */

/* ---- ≤1100px : small laptops / tablets landscape ---- */
@media (max-width: 1100px) {
  .content { padding: 24px 24px 50px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .groups-grid, .survey-grid { grid-template-columns: repeat(2, 1fr); }
  .exp { grid-template-columns: 1fr; gap: 12px; }
  .exp .exp-cta { text-align: left; }
  .suggest { grid-template-columns: 1fr; gap: 12px; }
  .set-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 200px 1fr; }
  .heatmap-canvas { grid-template-columns: 1fr; }
}

/* ---- ≤900px : sidebar becomes an off-canvas drawer ---- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .menu-toggle { display: flex; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    max-width: 82vw;
    height: 100vh;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  }
  .sidebar-close { display: flex; }
}

/* ---- ≤780px : phones / small tablets ---- */
@media (max-width: 780px) {
  .content { padding: 20px 16px 44px; }
  .page-title { font-size: 22px; }
  .page-sub { font-size: 13px; }

  .hero { padding: 24px 20px; }
  .hero h2 { font-size: 23px; }
  .hero-meta { gap: 16px 24px; }

  .kpis { grid-template-columns: 1fr 1fr; }
  .groups-grid, .survey-grid, .settings-grid-2, .usage-grid,
  .two-col, .settings-layout, .heatmap-canvas, .exp-variants {
    grid-template-columns: 1fr;
  }

  .leak { grid-template-columns: 1fr; gap: 10px; }
  .leak .action { text-align: left; }

  .step { grid-template-columns: 1fr; gap: 8px; padding: 14px 0; }
  .step-value, .step-signals { text-align: left; }
  .drop-connector { margin-left: 0; }

  .exp-action, .exp-forecast { padding-top: 8px; }

  .suggest .s-action { align-items: flex-start; }

  .tl-item { grid-template-columns: 1fr; gap: 6px; }
  .tl-impact { text-align: left; }

  .team-table, .rec-list { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .team-row, .rec-row { min-width: 560px; }

  .filter-row, .heatmap-controls { flex-wrap: wrap; }
  .select-like, .select-like.wide { min-width: 0; flex: 1 1 160px; }

  .upsell-card { flex-direction: column; align-items: flex-start; }

  .settings-nav { position: static; }

  .settings-block-head, .settings-card-head, .usage-head { flex-wrap: wrap; }
  .pref-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pref-value { width: 100%; }
  .settings-input { width: 100%; min-width: 0; }
  .settings-input.small { width: auto; min-width: 100px; }

  .page-footer { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-footer-actions { width: 100%; }
  .page-footer-actions .btn { flex: 1; justify-content: center; }

  .topbar { padding: 0 14px; gap: 10px; }
  .topbar .brand-picker .brand-url { display: none; }
  .demo-badge { font-size: 10px; padding: 5px 9px; margin-right: 0; }
}

/* ---- ≤600px : large phones ---- */
@media (max-width: 600px) {
  .kpis { grid-template-columns: 1fr; }
  .hero h2 { font-size: 21px; }
  .hero .eyebrow { font-size: 9px; }
  .section-h { gap: 10px; margin: 28px 0 12px; }
  .section-h h3 { font-size: 16px; }
  .section-h .h-sub { display: block; margin-left: 38px; margin-top: 2px; }
}

/* ---- ≤420px : small phones ---- */
@media (max-width: 420px) {
  .topbar .brand-picker { display: none; }
  .page-title { font-size: 19px; }
  .hero { padding: 20px 16px; }
  .hero h2 { font-size: 19px; }
  .hero-meta { gap: 14px 20px; }
  .content { padding: 16px 12px 36px; }
}
