/* ==========================================================================
   PRODADOS — Pesquisa & Insight Hub
   Sistema visual: editorial técnico. Navy da marca, réguas finas, metadados
   em mono, dados como protagonistas.
   ========================================================================== */

:root {
  color-scheme: light;
  --paper: #f3f1ea;
  --surface: #fbfaf7;
  --surface-2: #efece3;
  --ink: #0d1726;
  --ink-2: #46505e;
  --muted: #6f7785;
  --rule: #d9d4c7;
  --grid: #e5e1d6;
  --axis: #bfb9aa;
  --navy: #1c375e;
  --navy-deep: #0e1e36;
  --accent: #e0552a;
  --focus: #2a78d6;

  /* séries (paleta validada — ver README) */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --neg: #e34948;
  --s1-wash: rgba(42, 120, 214, .10);
  --s2-wash: rgba(235, 104, 52, .10);

  /* sequencial (azul) */
  --q1: #cde2fb; --q2: #9ec5f4; --q3: #6da7ec; --q4: #3987e5; --q5: #256abf; --q6: #184f95; --q7: #0d366b;
  /* divergente */
  --d-neg2: #c43d3d; --d-neg1: #f0a39a; --d-mid: #e6e3db; --d-pos1: #9ec5f4; --d-pos2: #256abf;

  --ref: #908b7f;
  --track: #e2ded3;
  --good: #0ca30c;
  --critical: #d03b3b;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0a1320;
    --surface: #101b2b;
    --surface-2: #15233a;
    --ink: #eef1f5;
    --ink-2: #b5becb;
    --muted: #8a95a6;
    --rule: #22324a;
    --grid: #1b2a3f;
    --axis: #33465f;
    --navy: #1c375e;
    --accent: #f06a3c;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --neg: #e66767;
    --s1-wash: rgba(57, 135, 229, .14);
    --s2-wash: rgba(217, 89, 38, .14);
    --q1: #15263d; --q2: #183a63; --q3: #1c5cab; --q4: #2a78d6; --q5: #5598e7; --q6: #86b6ef; --q7: #cde2fb;
    --d-neg2: #e66767; --d-neg1: #7a3434; --d-mid: #2a3446; --d-pos1: #1c4f8c; --d-pos2: #5598e7;
    --ref: #6f7f96; --track: #22324a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0a1320;
  --surface: #101b2b;
  --surface-2: #15233a;
  --ink: #eef1f5;
  --ink-2: #b5becb;
  --muted: #8a95a6;
  --rule: #22324a;
  --grid: #1b2a3f;
  --axis: #33465f;
  --navy: #1c375e;
  --accent: #f06a3c;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --neg: #e66767;
  --s1-wash: rgba(57, 135, 229, .14);
  --s2-wash: rgba(217, 89, 38, .14);
  --q1: #15263d; --q2: #183a63; --q3: #1c5cab; --q4: #2a78d6; --q5: #5598e7; --q6: #86b6ef; --q7: #cde2fb;
  --d-neg2: #e66767; --d-neg1: #7a3434; --d-mid: #2a3446; --d-pos1: #1c4f8c; --d-pos2: #5598e7;
  --ref: #6f7f96; --track: #22324a;
}

/* Bloco escuro fixo (hero, rodapé): sempre navy, independente do tema */
.on-navy {
  color-scheme: dark;
  --surface: #13284a;
  --surface-2: #183259;
  --ink: #f2f5f9;
  --ink-2: #b9c5d6;
  --muted: #8fa0b8;
  --rule: rgba(255, 255, 255, .12);
  --grid: rgba(255, 255, 255, .08);
  --axis: rgba(255, 255, 255, .22);
  --s1: #5598e7; --s2: #f07a48; --neg: #ef7b7b;
  --s1-wash: rgba(85, 152, 231, .16);
  --ref: #7d8fa8; --track: rgba(255, 255, 255, .10);
  background: var(--navy-deep);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--navy-deep);
  color: #b9c5d6;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .02em;
}
.topbar .wrap { display: flex; gap: 24px; align-items: center; justify-content: space-between; height: 34px; }
.topbar a { text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar .tb-left { display: flex; gap: 20px; }
.topbar .status { display: inline-flex; align-items: center; gap: 8px; }
.topbar a, .topbar .status { white-space: nowrap; }
.topbar .status > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.topbar .tb-left, .topbar .status { min-width: 0; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #0ca30c; box-shadow: 0 0 0 0 rgba(12, 163, 12, .6); animation: pulse 2s infinite; }
.dot-live.off { background: #8fa0b8; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(12,163,12,.55); } 70% { box-shadow: 0 0 0 7px rgba(12,163,12,0); } 100% { box-shadow: 0 0 0 0 rgba(12,163,12,0); } }
@media (max-width: 720px) { .topbar .tb-email, .topbar .tb-phone2 { display: none; } }
@media (max-width: 420px) { .topbar .wrap { gap: 12px; font-size: 11px; } }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { display: block; height: 52px; width: auto; border-radius: 6px; }
@media (max-width: 420px) { .brand-logo { height: 44px; } }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { text-decoration: none; font-size: 14.5px; font-weight: 500; padding: 8px 12px; border-radius: var(--radius); color: var(--ink-2); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav-links .btn { margin-left: 8px; }
.theme-toggle { width: 36px; height: 36px; border: 1px solid var(--rule); background: transparent; border-radius: var(--radius); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.theme-toggle:hover { color: var(--ink); border-color: var(--axis); }
.theme-toggle svg { width: 16px; height: 16px; }
.menu-btn { display: none; }
@media (max-width: 960px) {
  .menu-btn { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--rule); background: transparent; border-radius: var(--radius); cursor: pointer; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 4px; border-bottom: 1px solid var(--grid); border-radius: 0; }
  .nav-links .btn { margin: 12px 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font);
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; line-height: 1;
  padding: 14px 20px; border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn-ghost:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.nav-links .btn-primary { color: #fff; padding: 11px 16px; font-size: 14px; }
.nav-links .btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); color: #fff; }
.btn .arr { font-family: var(--mono); font-weight: 400; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 7vw, 96px) 0 0; }
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eyebrow i { font-style: normal; color: var(--accent); }
.hero h1 {
  font-size: clamp(34px, 4.3vw, 58px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -.025em;
  font-variation-settings: "wdth" 108;
  margin: 22px 0 22px;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: #7fb2f0; }
.hero .lead { font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); max-width: 34em; margin: 0 0 32px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 56px; border-top: 1px solid var(--rule); }
.hero-stats div { padding: 20px 16px 24px 0; }
.hero-stats div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.hero-stats b { display: block; font-size: clamp(30px, 3.4vw, 44px); font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.hero-stats span { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }

/* Painel ao vivo */
.live {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 14px;
}
.live-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.live-head .status { display: inline-flex; align-items: center; gap: 8px; }
.live-foot { padding: 10px 18px; font-family: var(--mono); font-size: 11px; color: var(--muted); border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.live-foot a { color: var(--ink-2); }
@media (max-width: 960px) { .hero .wrap { grid-template-columns: 1fr; } }

/* Ticker */
.ticker { margin-top: clamp(48px, 6vw, 80px); border-top: 1px solid var(--rule); background: rgba(0,0,0,.18); overflow: hidden; font-family: var(--mono); font-size: 12.5px; }
.ticker-track { display: flex; width: max-content; animation: tick 60s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 10px; padding: 12px 28px; border-right: 1px solid var(--rule); white-space: nowrap; color: var(--ink-2); }
.ticker-item b { color: var(--ink); font-weight: 500; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } .ticker { overflow-x: auto; } }

/* ---------- Seções ---------- */
.section { padding: clamp(72px, 9vw, 128px) 0; border-bottom: 1px solid var(--rule); }
.sec-head { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; margin-bottom: clamp(40px, 5vw, 64px); }
.sec-index { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 12px; border-top: 2px solid var(--ink); align-self: start; }
.sec-index b { color: var(--accent); font-weight: 500; margin-right: 10px; }
.sec-title { font-size: clamp(30px, 3.8vw, 52px); line-height: 1.05; font-weight: 800; letter-spacing: -.022em; font-variation-settings: "wdth" 106; margin: 0; text-wrap: balance; max-width: 18em; }
.sec-sub { font-size: 18px; color: var(--ink-2); max-width: 40em; margin: 20px 0 0; }
@media (max-width: 860px) { .sec-head { grid-template-columns: 1fr; gap: 20px; } .sec-index { justify-self: start; padding-right: 24px; } }

/* Sobre */
.about-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.about-grid .lede { grid-column: 2 / 4; font-size: clamp(20px, 2vw, 26px); line-height: 1.45; font-weight: 400; margin: 0 0 24px; max-width: 36em; }
.about-grid .lede strong { font-weight: 700; }
.mv { border-top: 1px solid var(--rule); padding-top: 20px; }
.mv h3 { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.mv p { margin: 0; font-size: 17px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } .about-grid .lede { grid-column: auto; } .about-grid .spacer { display: none; } }

/* Valores: tabela numerada */
.values { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.values li { padding: 28px 28px 32px 0; border-bottom: 1px solid var(--rule); }
.values li:not(:nth-child(3n+1)) { padding-left: 28px; border-left: 1px solid var(--rule); }
.values .n { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.values h3 { font-size: 21px; margin: 10px 0 8px; font-weight: 700; letter-spacing: -.01em; }
.values p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
@media (max-width: 860px) {
  .values { grid-template-columns: 1fr 1fr; }
  .values li, .values li:not(:nth-child(3n+1)) { padding: 24px 20px 24px 0; border-left: 0; }
  .values li:nth-child(2n) { padding-left: 20px; border-left: 1px solid var(--rule); }
}
@media (max-width: 560px) { .values { grid-template-columns: 1fr; } .values li:nth-child(2n) { padding-left: 0; border-left: 0; } }

/* Serviços */
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); background: var(--surface); border-radius: 6px; }
.service { padding: clamp(28px, 3.5vw, 48px); }
.service + .service { border-left: 1px solid var(--rule); }
.service .code { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.service h3 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 800; letter-spacing: -.02em; margin: 14px 0 12px; font-variation-settings: "wdth" 104; }
.service p { color: var(--ink-2); margin: 0 0 24px; }
.service ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.service li { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--grid); font-weight: 500; }
.service li::after { content: "→"; font-family: var(--mono); color: var(--muted); }
@media (max-width: 760px) { .services { grid-template-columns: 1fr; } .service + .service { border-left: 0; border-top: 1px solid var(--rule); } }

/* Por que pesquisa */
.why { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.why-claim { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.35; font-weight: 400; margin: 0; }
.why-claim b { font-weight: 800; }
.why-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.why-list li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.why-list .n { font-family: var(--mono); color: var(--accent); font-size: 13px; padding-top: 3px; }
.why-list h3 { margin: 0 0 4px; font-size: 18px; }
.why-list p { margin: 0; color: var(--ink-2); }
.why-pro { margin-top: 36px; background: var(--navy); color: #f2f5f9; border-radius: 6px; padding: 28px; }
.why-pro h4 { margin: 0 0 16px; font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #b9c5d6; }
.why-pro ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.why-pro li { display: flex; gap: 10px; align-items: baseline; font-weight: 500; }
.why-pro li::before { content: "✓"; font-family: var(--mono); color: #7fb2f0; }
@media (max-width: 860px) { .why { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .why-pro ul { grid-template-columns: 1fr; } }

/* ---------- Hub de dados ---------- */
.hub-section { background: var(--paper); }
.filter-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 0; margin-bottom: 24px;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.filter-row .label { letter-spacing: .08em; text-transform: uppercase; }
.filter-row .grow { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-family: var(--mono); font-size: 12px; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button:hover:not([aria-pressed="true"]) { background: var(--surface-2); color: var(--ink); }

.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
@media (max-width: 1024px) { .span-8, .span-7, .span-5, .span-4 { grid-column: span 12; } .span-6 { grid-column: span 6; } }
@media (max-width: 760px) { .span-6 { grid-column: span 12; } }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; display: flex; flex-direction: column; min-width: 0; }
.card-head { padding: 20px 22px 0; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.card-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card-title { font-size: 19px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.01em; line-height: 1.25; }
.card-sub { font-size: 14px; color: var(--ink-2); margin: 0; }
.card-hero { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.card-hero b { font-size: clamp(34px, 3.4vw, 48px); font-weight: 700; letter-spacing: -.025em; line-height: 1; }
.card-hero span { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.card-body { padding: 8px 14px 4px; flex: 1; position: relative; min-height: 120px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 22px 14px; border-top: 1px solid var(--grid); font-family: var(--mono); font-size: 11px; color: var(--muted); }
.card-foot .actions { display: flex; gap: 6px; }
.chip { border: 1px solid var(--rule); background: transparent; border-radius: 3px; padding: 4px 8px; font-family: var(--mono); font-size: 11px; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.chip:hover { color: var(--ink); border-color: var(--axis); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); padding: 12px 22px 0; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.legend i.line { height: 2px; width: 16px; border-radius: 1px; }
.legend i.dot { border-radius: 50%; width: 9px; height: 9px; }

.chart { width: 100%; position: relative; }
.chart svg { overflow: visible; }
.state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: center; padding: 16px; }
.state .cursor::after { content: "▍"; animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.state.err { color: var(--ink-2); }
.is-stale { opacity: .55; transition: opacity .2s; }

/* SVG chart chrome */
.ax text { font-family: var(--mono); font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.ax .domain { stroke: var(--axis); }
.ax line { stroke: var(--axis); }
.grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.grid .domain { display: none; }
.zero { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.lbl { font-family: var(--font); font-size: 12px; fill: var(--ink); font-weight: 600; }
.lbl-2 { font-family: var(--mono); font-size: 11px; fill: var(--ink-2); }
.lbl, .lbl-2 { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.cross { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; }
.ring { stroke: var(--surface); stroke-width: 2; }

/* Tooltip */
.tip {
  position: fixed; z-index: 100; pointer-events: none;
  background: var(--ink); color: var(--paper);
  border-radius: 4px; padding: 9px 11px;
  font-size: 13px; line-height: 1.35;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
  max-width: 260px;
}
.tip.on { opacity: 1; transform: none; }
.tip .t-h { font-family: var(--mono); font-size: 11px; opacity: .7; margin-bottom: 4px; letter-spacing: .03em; }
.tip .t-r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip .t-r span { display: inline-flex; align-items: center; gap: 6px; }
.tip .t-r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.tip .t-r b { font-variant-numeric: tabular-nums; }

/* Tabela (visão acessível) */
.tbl-wrap { max-height: 320px; overflow: auto; margin: 8px 8px 0; border: 1px solid var(--grid); border-radius: 4px; }
.tbl-wrap[hidden] { display: none; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 7px 12px; text-align: right; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { position: sticky; top: 0; background: var(--surface-2); font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }

/* Mapa */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; }
.map-wrap .rank { max-height: 520px; overflow: auto; padding-right: 6px; }
.uf path { stroke: var(--surface); stroke-width: 1; cursor: pointer; transition: opacity .15s; }
.uf path.dim { opacity: .35; }
.uf path.hi { stroke: var(--ink); stroke-width: 1.5; }
.rank-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 76px; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 3px; font-size: 13px; cursor: default; }
.rank-row:hover, .rank-row.hi { background: var(--surface-2); }
.rank-row .uf-sg { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.rank-row .bar { height: 8px; background: var(--s1); border-radius: 0 2px 2px 0; }
.rank-row .bar.neg { background: var(--neg); border-radius: 2px 0 0 2px; margin-left: auto; }
.rank-row .v { text-align: right; font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.scale-legend { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 0 8px 8px; flex-wrap: wrap; }
.scale-legend .sw { display: flex; }
.scale-legend .sw i { width: 28px; height: 10px; display: block; }
.scale-legend .sw i + i { margin-left: 2px; }
@media (max-width: 860px) { .map-wrap { grid-template-columns: 1fr; } .map-wrap .rank { max-height: 300px; } }

/* ---------- Blog ---------- */
.blog-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); }
.post-feature { display: block; text-decoration: none !important; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; width: 100%; }
.post-feature .cover { aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--rule); }
.post-feature .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post-feature:hover .cover img { transform: scale(1.025); }
.post-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: .04em; display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0 8px; text-transform: uppercase; }
.post-meta .tag { color: var(--accent); }
.post-feature h3 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.12; letter-spacing: -.02em; font-weight: 800; margin: 0 0 10px; font-variation-settings: "wdth" 104; text-wrap: balance; }
.post-feature p { color: var(--ink-2); margin: 0; font-size: 16.5px; }
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.post-row { text-decoration: none; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; color: inherit; }
.post-row .thumb { width: 96px; height: 64px; border-radius: 3px; overflow: hidden; background: var(--surface-2); }
.post-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-row h4 { margin: 0 0 6px; font-size: 16.5px; line-height: 1.3; font-weight: 700; }
.post-row:hover h4 { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-row .post-meta { margin: 0; font-size: 11px; }
.cover-gen { width: 100%; height: 100%; display: grid; place-items: center; background: var(--navy); }
.cover-gen img { width: 62%; height: auto; }
.blog-foot { margin-top: 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .blog-grid { grid-template-columns: 1fr; } }

/* Leitor do post */
dialog.reader { width: min(780px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink); }
dialog.reader::backdrop { background: rgba(8, 15, 27, .62); backdrop-filter: blur(3px); }
.reader-bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: 12px; color: var(--muted); z-index: 2; }
.reader-bar .x { width: 34px; height: 34px; border: 1px solid var(--rule); background: transparent; border-radius: var(--radius); cursor: pointer; font-size: 18px; line-height: 1; }
.reader-body { padding: clamp(20px, 4vw, 44px); }
.reader-body h2.r-title { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.1; letter-spacing: -.02em; font-weight: 800; margin: 0 0 12px; font-variation-settings: "wdth" 104; }
.reader-content { font-size: 17.5px; line-height: 1.7; }
.reader-content img { height: auto; border-radius: 4px; margin: 20px auto; }
.reader-content h1, .reader-content h2, .reader-content h3 { line-height: 1.25; margin: 1.4em 0 .5em; font-size: 1.3em; }
.reader-content a { color: var(--s1); }
.reader-content .separator { text-align: center !important; }
.reader-content .separator a { margin: 0 !important; float: none !important; display: block; }
.reader-content iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 4px; }

/* ---------- Contato ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: clamp(22px, 3vw, 36px); }
.form h3 { grid-column: 1 / -1; margin: 0 0 4px; font-size: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.field label em { color: var(--accent); font-style: normal; }
.field input, .field select, .field textarea {
  border: 1px solid var(--rule); background: var(--paper); border-radius: var(--radius);
  padding: 12px 14px; font-size: 15.5px; min-height: 46px; width: 100%;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.form .btn { grid-column: 1 / -1; justify-content: center; padding: 16px; }
.form-msg { grid-column: 1 / -1; font-family: var(--mono); font-size: 13px; margin: 0; }
.contact-info { border-top: 2px solid var(--ink); }
.ci-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.ci-row dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.ci-row dd { margin: 0; font-weight: 500; font-size: 17px; }
.ci-row dd a { text-decoration: none; }
.ci-row dd a:hover { text-decoration: underline; }
.wa { display: inline-flex; align-items: center; gap: 10px; margin-top: 24px; background: #128c4a; color: #fff; text-decoration: none; padding: 14px 18px; border-radius: var(--radius); font-weight: 600; }
.wa:hover { background: #0f7a40; }
.wa svg { width: 20px; height: 20px; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } .ci-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Footer ---------- */
.footer { padding: 56px 0 32px; }
.footer .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer h4 { font-family: var(--mono); font-weight: 500; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer a { text-decoration: none; color: var(--ink-2); }
.footer a:hover { color: var(--ink); }
.footer .logo-img { width: 200px; height: auto; margin: 0 0 16px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.10); }
.footer .tagline { color: var(--ink-2); max-width: 26em; }
.footer-bottom { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 20px; margin-top: 16px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
@media (max-width: 860px) { .footer .wrap { grid-template-columns: 1fr 1fr; } .footer .f-brand { grid-column: 1 / -1; } }

/* ---------- Página Hub ---------- */
.page-hero { padding: clamp(48px, 6vw, 88px) 0 clamp(40px, 5vw, 64px); }
.page-hero h1 { font-size: clamp(38px, 5.6vw, 76px); line-height: 1; letter-spacing: -.03em; font-weight: 800; margin: 18px 0 18px; font-variation-settings: "wdth" 110; }
.page-hero p { font-size: 19px; color: var(--ink-2); max-width: 38em; margin: 0; }
.censo-band { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: end; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--rule); }
.censo-band h2 { font-size: 28px; margin: 0 0 10px; }
.censo-band p { font-size: 16px; }
.censo-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.censo-figs div { padding: 0 16px; border-left: 1px solid var(--rule); }
.censo-figs b { display: block; font-size: clamp(24px, 2.6vw, 34px); font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }
.censo-figs span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 860px) { .censo-band { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .censo-figs div { padding: 0 10px; } .censo-figs div:first-child { padding-left: 0; border-left: 0; } .censo-figs b { font-size: 21px; } }
.mun-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; }
@media (max-width: 1024px) { .mun-grid { grid-template-columns: minmax(0, 1fr); } }

.search { position: relative; max-width: 520px; flex: 1; min-width: 240px; }
.search input { width: 100%; border: 1px solid var(--rule); background: var(--surface); border-radius: var(--radius); padding: 12px 14px 12px 40px; font-size: 16px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search ul { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 320px; overflow: auto; }
.search li { padding: 9px 10px; border-radius: 3px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.search li span { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.search li[aria-selected="true"], .search li:hover { background: var(--surface-2); }

.cat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); overflow: hidden; }
.cat-grid a { padding: 22px 20px; text-decoration: none; display: flex; flex-direction: column; gap: 8px; min-height: 170px; }
.cat-grid a + a { border-left: 1px solid var(--rule); }
.cat-grid a:hover { background: var(--surface-2); }
.cat-grid .code { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.cat-grid h4 { margin: 0; font-size: 18px; }
.cat-grid p { margin: 0; color: var(--ink-2); font-size: 14px; flex: 1; }
.cat-grid .go { font-family: var(--mono); font-size: 12px; color: var(--accent); }
@media (max-width: 1000px) { .cat-grid { grid-template-columns: 1fr 1fr; } .cat-grid a + a { border-left: 0; } .cat-grid a { border-bottom: 1px solid var(--rule); } .cat-grid a:nth-child(2n) { border-left: 1px solid var(--rule); } }
@media (max-width: 560px) { .cat-grid { grid-template-columns: 1fr; } .cat-grid a:nth-child(2n) { border-left: 0; } .cat-grid a { min-height: 0; } }

.res-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.res { border: 1px solid var(--rule); border-radius: 6px; padding: 24px; display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--surface); }
.res h4 { margin: 0 0 4px; font-size: 18px; }
.res p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.res .btn { padding: 11px 14px; font-size: 14px; }
@media (max-width: 760px) { .res-row { grid-template-columns: 1fr; } }

/* Reveal ao rolar */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } }

@media print { .nav, .topbar, .ticker, .card-foot .actions, .theme-toggle { display: none !important; } }

/* ==========================================================================
   Censo 2022 — blocos de dados
   ========================================================================== */

/* Painel comparativo do hero (Brasil × UF) */
.cmp-cols, .cmp-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px 104px; gap: 12px; align-items: center; padding: 0 18px; }
.cmp-cols { padding-top: 10px; padding-bottom: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule); }
.cmp-cols span:not(:first-child), .cmp-row .cv { text-align: right; }
.cmp-cols .focus { color: var(--ink); }
.cmp-row { padding-top: 11px; padding-bottom: 11px; border-bottom: 1px solid var(--rule); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row .cl { font-weight: 600; font-size: 14px; line-height: 1.25; }
.cmp-row .cl small { display: block; font-weight: 400; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.cmp-row .cv { font-size: 16px; color: var(--ink-2); }
.cmp-row .cv.focus { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.meter { height: 4px; background: var(--track); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 2px; }
@media (max-width: 460px) { .cmp-cols, .cmp-row { grid-template-columns: minmax(0, 1fr) 76px 84px; gap: 8px; padding-left: 14px; padding-right: 14px; } .cmp-row .cv.focus { font-size: 16px; } .cmp-row .cv { font-size: 14px; } }

/* Categorias do Hub (home) */
.cat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); overflow: hidden; margin-bottom: 40px; }
.cat-tiles a { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 22px; min-height: 128px; text-decoration: none; }
.cat-tiles a + a { border-left: 1px solid var(--rule); }
.cat-tiles a:hover { background: var(--surface-2); }
.cat-tiles .k { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; display: block; margin-bottom: 8px; }
.cat-tiles b { font-size: 22px; letter-spacing: -.01em; }
.cat-tiles .n { font-family: var(--mono); font-size: 34px; font-weight: 500; color: var(--accent); line-height: 1; }
@media (max-width: 860px) { .cat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cat-tiles a { padding: 18px; min-height: 108px; } .cat-tiles b { font-size: 19px; } .cat-tiles .n { font-size: 28px; } .cat-tiles a:nth-child(3) { border-left: 0; } .cat-tiles a:nth-child(n+3) { border-top: 1px solid var(--rule); } }

.recent-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.recent-head h3 { margin: 0; font-size: 26px; letter-spacing: -.015em; }
.recent-head .actions { display: flex; gap: 8px; }
.recent-head .btn { padding: 10px 14px; font-size: 14px; }
.recent-src { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin: 0 0 18px; }

/* Seletor de UF */
.uf-select { appearance: none; border: 1px solid var(--rule); background-color: var(--surface); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236f7785' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; border-radius: var(--radius); padding: 9px 34px 9px 12px; font-family: var(--font); font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; min-width: 200px; }
.key { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font); font-size: 13px; color: var(--ink-2); letter-spacing: 0; text-transform: none; }
.key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Seleção no mapa */
.uf path.sel { stroke: var(--ink); stroke-width: 2.5px; }
.rank-row.sel { box-shadow: inset 2px 0 0 var(--ink); background: var(--surface-2); }

/* Barras 100% pareadas */
.sr-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px 32px; padding: 8px 8px 14px; }
.sr-group { min-width: 0; }
.sr-title { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.sr-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 10px; margin-bottom: 6px; }
.sr-name { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-bar { display: flex; gap: 2px; height: 24px; }
.sr-seg { min-width: 2px; display: flex; align-items: center; padding: 0 7px; font: 600 12px var(--font); white-space: nowrap; overflow: hidden; }
.sr-seg:first-child { border-radius: 4px 0 0 4px; }
.sr-seg:last-child { border-radius: 0 4px 4px 0; }
.sr-seg:only-child { border-radius: 4px; }
.sr-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.sr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sr-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Indicadores (UF em destaque, Brasil como referência) */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
.stats > div { padding: 18px 16px 18px 0; min-width: 0; }
.stats > div + div { padding-left: 18px; border-left: 1px solid var(--rule); }
.stats > div:nth-child(4n+1) { padding-left: 0; border-left: 0; }
.stats > div:nth-child(n+5) { border-top: 1px solid var(--rule); }
.stats .sl { font-size: 13px; color: var(--ink-2); display: block; margin-bottom: 6px; }
.stats b { display: block; font-size: clamp(24px, 2.4vw, 32px); font-weight: 700; letter-spacing: -.02em; line-height: 1.05; }
.stats .sr { font-family: var(--mono); font-size: 11.5px; color: var(--muted); display: block; margin-top: 6px; }
.stats.in-card { margin: 16px 22px 0; }
@media (max-width: 860px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* Seções temáticas do Hub */
.theme { padding: clamp(56px, 7vw, 96px) 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 130px; }
.theme-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.theme-head .n { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.theme-head h2 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.05; letter-spacing: -.022em; font-weight: 800; margin: 8px 0 6px; font-variation-settings: "wdth" 106; }
.theme-head p { margin: 0; color: var(--ink-2); font-size: 17px; }
.sticky-filter { position: sticky; top: 68px; z-index: 30; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); }
.sticky-filter .filter-row { margin-bottom: 0; }

/* Cruzamento de dados */
.cz-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.cz-presets .chip { font-size: 12px; padding: 6px 10px; }
.cz-grid { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.cz-panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 20px; display: grid; gap: 18px; position: sticky; top: 140px; }
.cz-field { display: grid; gap: 7px; min-width: 0; }
.cz-field > span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cz-field small { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.cz-field .uf-select { width: 100%; min-width: 0; font-size: 14px; }
.cz-field .search { max-width: none; min-width: 0; }
.cz-field .search input { font-size: 15px; padding-top: 10px; padding-bottom: 10px; }
.cz-inline { display: flex; gap: 6px; align-items: center; }
.cz-inline .search { flex: 1; }
.cz-filters { display: grid; gap: 10px; }
.cz-filters .cz-field > span { text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 13px; color: var(--ink-2); }
.seg-wrap { display: flex; flex-wrap: wrap; }
.seg-wrap button { flex: 1 1 auto; border-bottom: 1px solid var(--rule); }
.seg-wrap button + button { border-left: 1px solid var(--rule); }
@media (max-width: 960px) { .cz-grid { grid-template-columns: 1fr; } .cz-panel { position: static; } }

/* ==========================================================================
   Seção de Clientes & Marcas
   ========================================================================== */
.clients-section {
  padding: clamp(64px, 8vw, 110px) 0;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-2);
}

.clients-ticker-wrap {
  position: relative;
  overflow: hidden;
  margin: 32px 0 40px;
  padding: 18px 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.clients-ticker {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: clientsTickerScroll 65s linear infinite;
  align-items: center;
}

.clients-ticker:hover,
.clients-ticker:active {
  animation-play-state: paused;
}

@keyframes clientsTickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  min-width: 135px;
  padding: 8px 18px;
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  flex-shrink: 0;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.ticker-item-logo:hover {
  transform: translateY(-2px);
  border-color: var(--focus);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.ticker-item-logo img {
  max-height: 42px;
  max-width: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Filtro e busca */
.clients-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.clients-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clients-tab {
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .18s ease;
}

.clients-tab:hover {
  border-color: var(--navy);
  color: var(--ink);
}

.clients-tab.active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}

.clients-tab .badge {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
}

.clients-tab.active .badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.clients-search {
  position: relative;
  min-width: 240px;
  max-width: 320px;
  flex: 1 1 auto;
}

.clients-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.clients-search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  font-family: var(--font);
  font-size: 13.5px;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .18s ease;
}

.clients-search input:focus {
  border-color: var(--focus);
}

/* Grid de clientes */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.client-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.client-card:hover {
  transform: translateY(-3px);
  border-color: var(--focus);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.client-logo-box {
  width: 100%;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(0,0,0,0.05);
}

.client-logo-box img {
  max-height: 50px;
  max-width: 130px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.client-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.client-cat {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.clients-count-notice {
  margin-top: 20px;
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ==========================================================================
   Responsividade Mobile - Seção Clientes & Marcas
   ========================================================================== */
@media (max-width: 768px) {
  .clients-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .clients-search {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }
  .clients-tabs {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .clients-tabs::-webkit-scrollbar {
    display: none;
  }
  .clients-tab {
    flex-shrink: 0;
    font-size: 13px;
    padding: 6px 13px;
  }
  .clients-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  .ticker-item-logo {
    height: 54px;
    min-width: 120px;
    padding: 6px 14px;
  }
  .ticker-item-logo img {
    max-height: 38px;
    max-width: 105px;
  }
}

@media (max-width: 480px) {
  .clients-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .client-card {
    padding: 10px 6px 8px;
  }
  .client-logo-box {
    height: 60px;
    padding: 6px;
    margin-bottom: 8px;
  }
  .client-logo-box img {
    max-height: 40px;
    max-width: 95px;
  }
  .client-name {
    font-size: 11.5px;
  }
  .client-cat {
    font-size: 9px;
  }
  .clients-count-notice {
    font-size: 11px;
    text-align: center;
  }
  .ticker-item-logo {
    height: 50px;
    min-width: 110px;
    padding: 5px 12px;
  }
  .ticker-item-logo img {
    max-height: 34px;
    max-width: 95px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .clients-ticker {
    animation: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
}
