/* Central de Rastreamento · Agência Rei */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e2e6ec;
  --text: #121826;
  --text-2: #4a5568;
  --text-3: #6b7588;
  --accent: #b7791f;
  --accent-strong: #975a16;
  --accent-soft: #fdf3e1;
  --navy: #14213d;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --warn: #b45309;
  --warn-bg: #fff7e6;
  --tip: #0f766e;
  --tip-bg: #e9f8f5;
  --doc: #1d4ed8;
  --doc-bg: #eef3ff;
  --ok: #15803d;

  --b-meta: #1877f2;
  --b-gads: #188038;
  --b-gads-2: #f9ab00;
  --b-ga4: #e37400;
  --b-gpt: #10a37f;
  --b-gtm: #1a3a6b;

  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 60px;
  --sidebar-w: 264px;
  --content-w: 880px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #121a2e;
  --surface-2: #18223a;
  --border: #25304a;
  --text: #e8ecf4;
  --text-2: #b4bed0;
  --text-3: #8592aa;
  --accent: #f0b54a;
  --accent-strong: #f6c86e;
  --accent-soft: #2a2414;
  --code-bg: #070b16;
  --warn: #f5b454;
  --warn-bg: #2a2010;
  --tip: #4fd1c5;
  --tip-bg: #0f2a28;
  --doc: #8fb0ff;
  --doc-bg: #141f3d;
  --ok: #4ade80;
  --b-gtm: #6f9be0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6;
  background: var(--bg); color: var(--text);
}
a { color: var(--accent-strong); text-underline-offset: 2px; }
code, kbd, pre { font-family: var(--mono); }
:not(pre) > code {
  font-size: .86em; background: var(--surface-2); border: 1px solid var(--border);
  padding: .08em .38em; border-radius: 5px; white-space: nowrap;
}
kbd {
  font-size: .75em; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; padding: 0 .4em; background: var(--surface); color: var(--text-3);
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
ul, ol { margin: 0 0 .8em; padding-left: 1.25em; }
li + li { margin-top: .25em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 50;
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; background: var(--navy); color: #f0b54a;
}
[data-theme="dark"] .brand-mark { background: #1d2b4f; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text small { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.brand-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-spacer { flex: 1; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; min-width: 260px;
  padding: 7px 10px 7px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); font-size: 14px;
}
.search-trigger:hover { border-color: var(--text-3); }
.search-trigger span { flex: 1; text-align: left; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; flex: none;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
}
.icon-btn:hover { background: var(--surface-2); }
.menu-btn { display: none; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .moon { display: none; }
[data-theme="dark"] .theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .moon { display: block; }

/* ---------- Layout ---------- */
.layout { padding-top: var(--header-h); }
.sidebar {
  position: fixed; top: var(--header-h); bottom: 0; left: 0; width: var(--sidebar-w);
  overflow-y: auto; padding: 22px 14px 28px; border-right: 1px solid var(--border); background: var(--surface);
  z-index: 40;
}
.nav-group + .nav-group { margin-top: 22px; }
.nav-label {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-3); padding: 0 10px 8px; display: flex; justify-content: space-between;
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list li + li { margin-top: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; font-size: 14.5px; position: relative;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-num {
  width: 22px; height: 22px; flex: none; border-radius: 6px; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border);
}
.nav-link.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.nav-link.active .nav-num { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .nav-link.active .nav-num { color: #1a1305; }
.sidebar-foot { margin-top: 26px; padding: 12px 10px 0; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }

.main { margin-left: var(--sidebar-w); padding: 32px 32px 40px; }
.content { max-width: var(--content-w); margin: 0 auto; }

.scrim { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 18px; padding: 40px 40px 34px; margin-bottom: 20px;
  background: radial-gradient(120% 140% at 100% 0%, #24365f 0%, var(--navy) 55%, #0c1428 100%);
  color: #eef2fa;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  border: 40px solid rgba(240, 181, 74, .10);
}
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #f0b54a; margin-bottom: 10px; }
.hero h1 { font-size: clamp(28px, 4.2vw, 42px); font-weight: 800; margin-bottom: 10px; }
.hero p.lead { font-size: 17.5px; color: #c4cee2; max-width: 560px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; padding: 0; list-style: none; }
.chips li { margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500;
  padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #e3e9f5;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 1; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px;
  font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid transparent;
}
.btn-primary { background: #f0b54a; color: #1a1305; }
.btn-primary:hover { background: #f6c86e; }
.btn-ghost { background: transparent; color: #eef2fa; border-color: rgba(255, 255, 255, .28); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); }
.btn-solid { background: var(--accent); color: #fff; }
[data-theme="dark"] .btn-solid { color: #1a1305; }
.btn-solid:hover { background: var(--accent-strong); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---------- Timeline (agenda) ---------- */
.agenda { margin-bottom: 56px; }
.agenda-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 0 0 12px 2px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 6%; right: 6%; top: 25px; height: 2px; background: var(--border); z-index: 0;
}
.timeline li { margin: 0; position: relative; z-index: 1; }
.tl-node {
  display: flex; flex-direction: column; align-items: flex-start; height: 100%; text-decoration: none; color: var(--text);
  padding: 0; border-radius: var(--radius);
}
.tl-dot {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; margin: 0 0 10px 6px;
  font-weight: 800; font-size: 15px; background: var(--surface); border: 2px solid var(--border); color: var(--text-2);
  transition: border-color .15s, background .15s, color .15s;
}
.tl-node:hover .tl-dot { border-color: var(--accent); color: var(--accent-strong); }
.tl-card {
  flex: 1; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 13px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.tl-node:hover .tl-card { border-color: var(--accent); transform: translateY(-2px); }
.tl-time { font-size: 12px; font-weight: 700; color: var(--accent-strong); font-family: var(--mono); }
.tl-name { font-weight: 700; font-size: 14.5px; margin: 2px 0 4px; line-height: 1.3; }
.tl-focus { font-size: 13px; color: var(--text-3); line-height: 1.45; }

/* ---------- Sections ---------- */
.zone-divider {
  display: flex; align-items: center; gap: 14px; margin: 64px 0 8px; color: var(--text-3);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
}
.zone-divider::before, .zone-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.section { padding-top: 48px; }
.section + .section { margin-top: 8px; border-top: 1px solid var(--border); }
.section-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.section-num {
  flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--navy); color: #f0b54a; font-weight: 800; font-size: 16px;
}
[data-theme="dark"] .section-num { background: #1d2b4f; }
.section-titles { flex: 1; min-width: 0; }
.section-titles h2 { font-size: clamp(22px, 2.8vw, 28px); font-weight: 800; }
.section-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.time-badge {
  font-size: 12px; font-weight: 700; font-family: var(--mono); padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.anchor-btn {
  flex: none; margin-top: 4px; height: 32px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-3); font-size: 12.5px;
}
.anchor-btn:hover { color: var(--text); border-color: var(--text-3); }
.section-intro { color: var(--text-2); font-size: 16.5px; margin-bottom: 20px; }
.sub-h { font-size: 17px; font-weight: 700; margin: 30px 0 12px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; line-height: 1;
  padding: 4px 8px; border-radius: 6px; color: #fff; white-space: nowrap; letter-spacing: .01em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .85); }
.b-meta { background: var(--b-meta); }
.b-gads { background: linear-gradient(90deg, var(--b-gads) 0%, var(--b-gads) 60%, #2f9e52 100%); }
.b-gads::before { background: var(--b-gads-2); }
.b-ga4 { background: var(--b-ga4); }
.b-gpt { background: var(--b-gpt); }
.b-gtm { background: var(--b-gtm); }
.badge.b-verify { background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.badge.b-verify::before { background: var(--warn); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card-icon {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 12px;
  background: var(--accent-soft); color: var(--accent-strong);
}
.card h3 { font-size: 16.5px; font-weight: 700; margin-bottom: 6px; }
.card .summary { color: var(--text-2); font-size: 14.5px; margin-bottom: 10px; }
.card .badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.card details { margin-top: auto; border-top: 1px dashed var(--border); padding-top: 8px; }
.card summary {
  list-style: none; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent-strong);
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 0;
}
.card summary::-webkit-details-marker { display: none; }
.card summary::after { content: "▾"; font-size: 11px; transition: transform .15s; }
.card details[open] summary::after { transform: rotate(180deg); }
.card details[open] summary .more { display: none; }
.card summary .less { display: none; }
.card details[open] summary .less { display: inline; }
.card .detail { font-size: 14.5px; color: var(--text-2); padding-top: 6px; }
.card .detail ul { padding-left: 1.1em; }
.card-feature { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }

/* ---------- Callouts ---------- */
.callout {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); margin: 16px 0;
  border: 1px solid; font-size: 15px;
}
.callout > .c-ico { flex: none; font-size: 18px; line-height: 1.4; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout strong.c-title { display: block; margin-bottom: 2px; }
.callout.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.callout.warn strong.c-title { color: var(--warn); }
.callout.tip { background: var(--tip-bg); border-color: color-mix(in srgb, var(--tip) 35%, transparent); }
.callout.tip strong.c-title { color: var(--tip); }
.callout.doc { background: var(--doc-bg); border-color: color-mix(in srgb, var(--doc) 30%, transparent); }
.callout.doc strong.c-title { color: var(--doc); }

/* ---------- Mini diagram (constantes) ---------- */
.const-diagram {
  margin-top: 18px; padding: 18px; border-radius: var(--radius); border: 1px dashed var(--border); background: var(--surface);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px;
}
.const-col { display: flex; flex-direction: column; gap: 8px; }
.const-col-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.const-box {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface-2); font-size: 13.5px;
}
.const-box code { background: transparent; border: 0; padding: 0; font-size: 12.5px; color: var(--text-2); }
.const-arrow { display: flex; flex-direction: column; align-items: center; color: var(--text-3); font-size: 12px; font-weight: 600; text-align: center; }
.const-arrow svg { width: 56px; height: 20px; }

/* ---------- Tabs ---------- */
.tabs { margin-top: 6px; }
.tablist {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
}
.tablist::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 10px 14px; font-size: 14.5px; font-weight: 600; color: var(--text-3); white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabpanel { padding: 18px 2px 4px; }
.tabpanel[hidden] { display: none; }
.tab-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- Table ---------- */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
table.cmp { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.cmp th, .cmp td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cmp thead th { background: var(--surface-2); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.cmp thead th .badge { text-transform: none; letter-spacing: 0; }
.cmp tbody tr:last-child td { border-bottom: 0; }
.cmp tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.cmp td:first-child { font-weight: 600; color: var(--text-2); }
.cell-copy { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cell-copy .extra { color: var(--text-3); font-size: 12.5px; }
.table-foot { padding: 12px 14px; border-top: 1px solid var(--border); background: var(--warn-bg); font-size: 14px; display: flex; gap: 8px; }

/* ---------- Copy chips/buttons ---------- */
.copy-chip {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13px;
  padding: 3px 6px 3px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.copy-chip:hover { border-color: var(--accent); }
.copy-chip .icon { width: 13px; height: 13px; color: var(--text-3); }
.copy-chip.copied { border-color: var(--ok); color: var(--ok); }
.copy-chip.copied .icon { color: var(--ok); }

.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  padding: 5px 10px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: #cbd5e1;
}
.copy-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.copy-btn.copied { color: #4ade80; border-color: rgba(74, 222, 128, .45); }
.copy-btn .icon { width: 14px; height: 14px; }

/* ---------- Stepper ---------- */
.stepper { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.stepper.v > li { position: relative; padding: 0 0 22px 52px; margin: 0; }
.stepper.v > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: var(--surface); border: 2px solid var(--accent); color: var(--accent-strong);
}
.stepper.v > li::after {
  content: ""; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 2px; background: var(--border);
}
.stepper.v > li:last-child { padding-bottom: 0; }
.stepper.v > li:last-child::after { display: none; }
.step-title { font-weight: 700; font-size: 16px; margin: 5px 0 4px; }
.step-body { color: var(--text-2); font-size: 15px; }
.step-body p:last-child { margin-bottom: 0; }

.stepper.h { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stepper.h > li {
  margin: 0; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 14px; box-shadow: var(--shadow);
}
.stepper.h > li::before {
  counter-increment: step; content: "Etapa " counter(step);
  display: inline-block; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-strong); margin-bottom: 6px;
}
.stepper.h > li:not(:last-child)::after {
  content: "→"; position: absolute; right: -12px; top: 50%; transform: translate(50%, -50%);
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px;
  background: var(--accent); color: #fff; z-index: 1;
}
[data-theme="dark"] .stepper.h > li:not(:last-child)::after { color: #1a1305; }

.with-aside { display: grid; grid-template-columns: 1fr 260px; gap: 22px; align-items: start; }
.aside-box {
  position: sticky; top: calc(var(--header-h) + 20px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.aside-box h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin-bottom: 10px; }
.field-list { list-style: none; margin: 0; padding: 0; }
.field-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; margin: 0; }
.field-list li:last-child { border-bottom: 0; }
.req { font-size: 11px; font-weight: 700; color: var(--warn); text-transform: uppercase; letter-spacing: .05em; }
.opt { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Code blocks ---------- */
.code-block { border-radius: var(--radius); overflow: hidden; background: var(--code-bg); border: 1px solid #1e293b; margin: 12px 0; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px 8px 14px; background: #111a2e; border-bottom: 1px solid #1e293b;
}
.code-title { font-size: 13px; font-weight: 600; color: #cbd5e1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.code-title .lang { font-family: var(--mono); font-size: 11px; color: #64748b; text-transform: uppercase; }
pre {
  margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.65; color: var(--code-text); tab-size: 2;
}
pre .c { color: #64748b; font-style: italic; }
pre .s { color: #a5d6a7; }
pre .k { color: #f0b54a; }
pre .n { color: #93c5fd; }
pre.prompt { white-space: pre-wrap; font-family: var(--font); font-size: 14px; line-height: 1.6; }

.snippet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.snippet-grid .code-block { margin: 0; display: flex; flex-direction: column; }
.snippet-grid pre { flex: 1; }
.snippet-grid .wide { grid-column: 1 / -1; }

/* ---------- Flow diagram (CAPI) ---------- */
.flow {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.flow svg { width: 100%; height: auto; display: block; }
.flow .f-box { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.5; }
.flow .f-box-accent { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.flow .f-text { fill: var(--text); font: 600 14px var(--font); }
.flow .f-sub { fill: var(--text-3); font: 500 11.5px var(--font); }
.flow .f-line { stroke: var(--text-3); stroke-width: 2; fill: none; }
.flow .f-line-a { stroke: var(--b-meta); }
.flow .f-line-b { stroke: var(--b-gpt); }
.flow .f-label { font: 600 12px var(--mono); }
.flow .f-label-a { fill: var(--b-meta); }
.flow .f-label-b { fill: var(--b-gpt); }
.flow-caption { font-size: 13.5px; color: var(--text-3); text-align: center; margin-top: 10px; }
.flow .flow-mobile { display: none; }

/* ---------- Accordion (docs) ---------- */
.acc { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.acc + .acc-group-title { margin-top: 22px; }
.acc-item { border-bottom: 1px solid var(--border); }
.acc-item:last-child { border-bottom: 0; }
.acc-item > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; align-items: center;
}
.acc-item > summary::-webkit-details-marker { display: none; }
.acc-item > summary:hover { background: var(--surface-2); }
.acc-t { font-weight: 700; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.acc-t .idx { font-family: var(--mono); font-size: 12px; color: var(--text-3); font-weight: 600; }
.acc-s { grid-column: 1; font-size: 14px; color: var(--text-3); }
.acc-chev { grid-row: 1 / span 2; grid-column: 2; color: var(--text-3); transition: transform .15s; }
.acc-item[open] > summary .acc-chev { transform: rotate(180deg); }
.acc-body { padding: 4px 16px 16px; font-size: 15px; color: var(--text-2); }
.acc-body h5 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 14px 0 6px; }
.acc-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  padding: 5px 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); text-decoration: none;
}
.link-btn:hover { border-color: var(--accent); color: var(--text); }
.link-btn .icon { width: 14px; height: 14px; }
.link-btn.copied { border-color: var(--ok); color: var(--ok); }
.acc-group-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 0 0 10px 2px; display: flex; align-items: center; gap: 8px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.mini-col { border: 1px solid var(--border); border-radius: 9px; padding: 12px; background: var(--surface-2); font-size: 14px; }
.mini-col h6 { margin: 0 0 6px; font-size: 14px; font-family: var(--mono); color: var(--text); }
.mini-col ul { margin: 0; }

.param-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

.pyramid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.pyr { border-radius: 10px; padding: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; }
.pyr h6 { margin: 0 0 4px; font-size: 14px; }
.pyr .lvl { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--b-ga4); }
.pyr ul { margin: 6px 0 0; padding-left: 1.05em; }

.rule-list { list-style: none; padding: 0; margin: 8px 0; }
.rule-list li { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 5px 0; }
.rule-list .ok { color: var(--ok); font-weight: 800; flex: none; }
.rule-list .no { color: #dc2626; font-weight: 800; flex: none; }

/* ---------- Swimlanes ---------- */
.lanes { display: flex; flex-direction: column; gap: 10px; }
.lane {
  display: grid; grid-template-columns: 150px 1fr 44px 1fr; align-items: stretch; gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.lane-name {
  display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 14px;
  border-right: 1px solid var(--border); background: var(--surface-2);
}
.lane-name strong { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.lane-step { padding: 14px 16px; }
.lane-step .ls-n {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 800; margin-right: 6px;
  background: var(--navy); color: #f0b54a;
}
[data-theme="dark"] .lane-step .ls-n { background: #1d2b4f; }
.lane-step .ls-t { font-weight: 700; font-size: 15px; }
.lane-step .ls-d { font-size: 13.5px; color: var(--text-3); margin-top: 4px; }
.lane-step.base { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.lane-arrow { display: grid; place-items: center; color: var(--accent); }
.lane-arrow svg { width: 28px; height: 28px; }
.lane[data-p="meta"] { border-left: 4px solid var(--b-meta); }
.lane[data-p="gads"] { border-left: 4px solid var(--b-gads); }
.lane[data-p="ga4"] { border-left: 4px solid var(--b-ga4); }
.lane[data-p="gpt"] { border-left: 4px solid var(--b-gpt); }

.path {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 12px;
  font-size: 13.5px; font-weight: 600;
}
.path span { background: var(--surface-2); border: 1px solid var(--border); padding: 3px 9px; border-radius: 6px; }
.path i { font-style: normal; color: var(--text-3); }

/* ---------- Checklist ---------- */
.checklist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.checklist li { margin: 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; cursor: pointer; font-size: 15px; }
.checklist label:hover { background: var(--surface-2); }
.checklist input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox {
  flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--text-3); margin-top: 2px;
  display: grid; place-items: center; transition: background .12s, border-color .12s;
}
.checkbox svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 3.5; fill: none; opacity: 0; }
.checklist input:checked + .checkbox { background: var(--ok); border-color: var(--ok); }
.checklist input:checked + .checkbox svg { opacity: 1; }
.checklist input:checked ~ .ck-text { color: var(--text-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-3) 60%, transparent); }
.checklist input:focus-visible + .checkbox { outline: 2px solid var(--accent); outline-offset: 2px; }
.ck-text small { display: block; color: var(--text-3); font-size: 13px; margin-top: 2px; text-decoration: none; }
.check-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.progress { flex: 1; height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .2s; }
.progress-label { font-size: 13px; font-weight: 700; color: var(--text-3); font-family: var(--mono); white-space: nowrap; }

/* ---------- Glossary ---------- */
.glossary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; margin: 0; }
.glossary div { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.glossary dt { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.glossary dd { margin: 2px 0 0; font-size: 14px; color: var(--text-2); }

/* ---------- Footer ---------- */
.footer {
  margin-left: var(--sidebar-w); padding: 22px 32px 30px; border-top: 1px solid var(--border);
  color: var(--text-3); font-size: 13.5px;
}
.footer-in { max-width: var(--content-w); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 45; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- Search modal ---------- */
.search-modal { position: fixed; inset: 0; z-index: 100; display: none; }
.search-modal.open { display: block; }
.search-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 24, .5); backdrop-filter: blur(2px); }
.search-panel {
  position: relative; max-width: 620px; margin: 10vh auto 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.search-input-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.search-input-row input {
  flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--text);
}
.search-results { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto; }
.search-results li { margin: 0; }
.search-results a {
  display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--text);
}
.search-results a .sr-sec { font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.search-results a .sr-title { font-weight: 600; font-size: 15px; }
.search-results a .sr-snip { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results a mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-results li.sel a, .search-results a:hover { background: var(--surface-2); }
.search-empty { padding: 22px; text-align: center; color: var(--text-3); font-size: 14px; }
.search-hint { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 120;
  background: var(--navy); color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* flash target */
.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .with-aside { grid-template-columns: 1fr; }
  .aside-box { position: static; }
}
@media (max-width: 1023px) {
  .menu-btn { display: grid; }
  .sidebar {
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); width: 290px;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(8, 12, 24, .45); z-index: 39; }
  .main, .footer { margin-left: 0; }
  .main { padding: 24px 20px 36px; }
  .search-trigger { min-width: 0; }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .timeline { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; gap: 10px; }
  .timeline::before { display: none; }
  .timeline li { flex: 0 0 72%; max-width: 260px; scroll-snap-align: start; }
  .tl-dot { width: 38px; height: 38px; font-size: 13px; }
  .stepper.h { grid-template-columns: 1fr; }
  .stepper.h > li:not(:last-child)::after { right: 50%; top: auto; bottom: -12px; transform: translate(50%, 50%) rotate(90deg); }
  .lane { grid-template-columns: 1fr; }
  .lane-name { flex-direction: row; align-items: center; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px 14px; }
  .lane-arrow { padding: 2px 0; }
  .lane-arrow svg { transform: rotate(90deg); width: 22px; height: 22px; }
  .snippet-grid { grid-template-columns: 1fr; }
  .const-diagram { grid-template-columns: 1fr; }
  .const-arrow svg { transform: rotate(90deg); }
  .flow .flow-desktop { display: none; }
  .flow .flow-mobile { display: block; }
}
@media (max-width: 767px) {
  body { font-size: 15.5px; }
  .header { padding: 0 12px; gap: 10px; }
  .brand-text small { display: none; }
  .search-trigger { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 9px; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .hero { padding: 26px 20px 22px; border-radius: 14px; }
  .hero p.lead { font-size: 16px; }
  .chips { margin: 14px 0 18px; }
  .section { padding-top: 36px; }
  .section-head { gap: 10px; }
  .section-num { width: 34px; height: 34px; font-size: 14px; }
  .anchor-btn .lbl { display: none; }
  .grid-2, .two-col, .pyramid, .glossary { grid-template-columns: 1fr; }
  /* Table -> cards */
  table.cmp thead { display: none; }
  table.cmp, .cmp tbody, .cmp tr, .cmp td { display: block; width: 100%; }
  .cmp tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  .cmp tbody tr:last-child { border-bottom: 0; }
  .cmp td { border: 0; padding: 5px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .cmp td:first-child { font-size: 15px; color: var(--text); }
  .cmp td[data-label]::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
  .cmp td .cell-copy { justify-content: flex-end; }
  .search-panel { margin: 0; border-radius: 0 0 14px 14px; }
  .footer { padding: 20px; }
}

/* ---------- Guardas de overflow ---------- */
.main, .content, .section, .grid > *, .with-aside > *, .snippet-grid > *, .stepper > li, .tabpanel, .lane > *, .const-col { min-width: 0; }
.main { overflow-x: clip; }
.copy-chip { max-width: 100%; overflow-wrap: anywhere; white-space: normal; text-align: left; }
@media (max-width: 900px) {
  .const-arrow { flex-direction: row; gap: 8px; justify-content: center; }
  .const-arrow svg { width: 20px; height: 32px; transform: none; }
}
@media (max-width: 900px) { .const-arrow .arr-h { transform: rotate(90deg); width: 32px; height: 20px; } }
