/* Central de Ajuda do Sis — site estático (HTML/CSS/JS puro, sem framework).
   Documentação para o USUÁRIO do sistema: o que cada tela faz, o que preencher em cada campo,
   exemplos e dúvidas comuns. Tema claro/escuro próprio (a página roda dentro do app e fora dele). */

:root {
  --bg: #F7F8FB;
  --bg-soft: #EEF1F7;
  --surface: #FFFFFF;
  --surface-2: #F4F6FA;
  --border: #E2E7F0;
  --border-strong: #CBD3E1;
  --text: #16202E;
  --text-2: #5A6779;
  --text-3: #8A94A6;

  --brand: #3B5FE0;
  --brand-soft: #EAEFFE;
  --brand-strong: #2A47B8;
  --on-brand: #FFFFFF;

  --ok: #14795A;
  --ok-soft: #E1F5EC;
  --warn: #96620A;
  --warn-soft: #FCF1DE;
  --danger: #B3372F;
  --danger-soft: #FCE9E7;
  --info: #1C6A97;
  --info-soft: #E4F2FA;

  /* Elevação Material 3: a hierarquia vem primeiro da SUPERFÍCIE (containers), e a sombra só
     acompanha. Por isso as sombras aqui são discretas — sombra forte para separar dois blocos é o
     hábito do Material 1, e empilhada em tela cheia de cards vira sujeira. */
  --shadow-sm: 0 1px 2px rgba(18, 32, 56, .06), 0 1px 3px rgba(18, 32, 56, .04);
  --shadow-md: 0 2px 6px rgba(18, 32, 56, .08), 0 1px 2px rgba(18, 32, 56, .04);
  --shadow-lg: 0 8px 24px rgba(18, 32, 56, .12), 0 2px 6px rgba(18, 32, 56, .06);

  /* ── Superfícies M3 ────────────────────────────────────────────────────────────────────────
     Os "surface containers" são os degraus de elevação por COR. Do mais baixo (fundo da página)
     ao mais alto (o que flutua): lowest → low → (surface) → high → highest. */
  --surface-lowest: #FFFFFF;
  --surface-low: #F3F5FA;
  --surface-high: #EBEFF7;
  --surface-highest: #E3E9F3;

  /* ── Papéis M3 ─────────────────────────────────────────────────────────────────────────────
     Nomes de PAPEL, não de cor: quem escreve componente pergunta "que papel isto cumpre?", e a
     troca de tema mexe no token, nunca no componente. */
  --primary: var(--brand);
  --on-primary: var(--on-brand);
  --primary-container: var(--brand-soft);
  --on-primary-container: var(--brand-strong);
  --outline: var(--border-strong);
  --outline-variant: var(--border);

  /* Camada de estado M3 (hover/focus/pressed): opacidade sobre a cor do papel, nunca uma cor
     "um pouco mais escura" escolhida a olho — é o que mantém o gesto coerente nos dois temas. */
  --state-hover: .08;
  --state-focus: .10;
  --state-press: .12;

  /* Forma M3: cantos mais generosos que os do Material 1. */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Movimento M3 "emphasized": sai rápido, chega devagar. */
  --easing: cubic-bezier(.2, 0, 0, 1);
  --dur: 200ms;
}

[data-theme="dark"] {
  --bg: #0F131A;
  --bg-soft: #151B24;
  --surface: #182029;
  --surface-2: #1F2833;
  --border: #2C3745;
  --border-strong: #3D4A5C;
  --text: #EAEFF6;
  --text-2: #A3AFC0;
  --text-3: #7A8698;

  --brand: #7EA0FF;
  --brand-soft: #1B2540;
  --brand-strong: #A0BAFF;
  --on-brand: #0C1220;

  --ok: #5FD3A0;
  --ok-soft: #103024;
  --warn: #E7BB55;
  --warn-soft: #33280C;
  --danger: #F08B84;
  --danger-soft: #341715;
  --info: #6FC0EC;
  --info-soft: #102B38;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .34);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .44);

  /* No escuro os degraus de superfície sobem CLAREANDO — é assim que o M3 expressa elevação sem
     depender de sombra, que quase não se vê sobre fundo escuro. */
  --surface-lowest: #0B0F15;
  --surface-low: #161D26;
  --surface-high: #202A36;
  --surface-highest: #27323F;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F131A;
    --bg-soft: #151B24;
    --surface: #182029;
    --surface-2: #1F2833;
    --border: #2C3745;
    --border-strong: #3D4A5C;
    --text: #EAEFF6;
    --text-2: #A3AFC0;
    --text-3: #7A8698;

    --brand: #7EA0FF;
    --brand-soft: #1B2540;
    --brand-strong: #A0BAFF;
    --on-brand: #0C1220;

    --ok: #5FD3A0;
    --ok-soft: #103024;
    --warn: #E7BB55;
    --warn-soft: #33280C;
    --danger: #F08B84;
    --danger-soft: #341715;
    --info: #6FC0EC;
    --info-soft: #102B38;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .34);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .44);

    /* No escuro os degraus de superfície sobem CLAREANDO — é assim que o M3 expressa elevação sem
       depender de sombra, que quase não se vê sobre fundo escuro. */
    --surface-lowest: #0B0F15;
    --surface-low: #161D26;
    --surface-high: #202A36;
    --surface-highest: #27323F;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.doc-app { display: flex; flex-direction: column; min-height: 100%; }

/* ══════════════════════════ Barra superior ══════════════════════════ */
.doc-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--surface-lowest) 86%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--outline-variant);
}

/* É <button> no índice e <a> na página de guia (autocontida, 2026-08-15) — daí o
   `text-decoration: none`, que o <a> traz por padrão e o <button> não. */
.doc-topbar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.doc-topbar__logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: var(--on-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.doc-topbar__brand strong { display: block; font-size: 15px; letter-spacing: -.01em; }

.doc-topbar__subtitle { display: block; font-size: 11.5px; color: var(--text-3); }

.doc-topbar__spacer { flex: 1 1 auto; }

.doc-topbar__search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface-high);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 10px 18px;
  width: min(440px, 40vw);
  transition: background var(--dur) var(--easing), border-color var(--dur) var(--easing),
              box-shadow var(--dur) var(--easing);
}

.doc-topbar__search:hover { background: var(--surface-highest); }

/* Foco M3: anel de 2px na cor do papel — não "borda azul + sombra colorida", que soma dois sinais
   para o mesmo estado e engorda o campo em 1px, empurrando o layout. */
.doc-topbar__search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 45%, transparent);
}

.doc-topbar__search input {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

.doc-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 17px;
  flex-shrink: 0;
  transition: background var(--dur) var(--easing);
}

/* 44px é o alvo de toque mínimo do M3 — o botão parece do mesmo tamanho, mas passa a ser
   acertável no celular, que é onde a Central mais é lida. */
.doc-icon-btn:hover { background: color-mix(in srgb, currentColor var(--state-hover), transparent); }
.doc-icon-btn:active { background: color-mix(in srgb, currentColor var(--state-press), transparent); }

/* ══════════════════════════ Home ══════════════════════════ */
.doc-main { flex: 1 1 auto; }

.doc-home { max-width: 1180px; margin: 0 auto; padding: 0 28px 72px; }

.doc-hero {
  text-align: center;
  padding: 60px 20px 44px;
}

.doc-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-radius: var(--r-pill);
  padding: 6px 15px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 18px;
}

.doc-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4.6vw, 48px);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 700;
}

.doc-hero p {
  margin: 0 auto;
  max-width: 620px;
  font-size: 17px;
  color: var(--text-2);
}

.doc-hero__search {
  margin: 30px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-pill);
  padding: 16px 26px;
  max-width: 660px;
  box-shadow: var(--shadow-md);
  transition: border-color var(--dur) var(--easing), box-shadow var(--dur) var(--easing);
}

.doc-hero__search:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), 0 0 0 2px color-mix(in srgb, var(--primary) 45%, transparent);
}

.doc-hero__search span { font-size: 19px; opacity: .55; }

.doc-hero__search input {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

/* ── Chips de categoria ── */
.doc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-bottom: 34px;
}

.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--outline-variant);
  background: transparent;
  color: var(--text-2);
  border-radius: 10px;
  padding: 8px 15px;
  min-height: 36px;
  font-size: 13.5px;
  font-weight: 550;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--dur) var(--easing), color var(--dur) var(--easing),
              border-color var(--dur) var(--easing);
}

/* Filter chip do M3: canto de 10px (não pill — pill ali é "assist chip", que dispara ação em vez
   de filtrar), sem sombra, e o selecionado vira CONTAINER da cor do papel em vez de bloco sólido:
   com 16 categorias lado a lado, 16 pílulas sólidas competem entre si e nenhuma se destaca. */
.doc-chip:hover {
  background: color-mix(in srgb, var(--primary) var(--state-hover), transparent);
  color: var(--text);
}

.doc-chip.is-active {
  background: var(--primary-container);
  border-color: transparent;
  color: var(--on-primary-container);
  font-weight: 650;
}

.doc-chip__count {
  background: color-mix(in srgb, currentColor 14%, transparent);
  border-radius: var(--r-pill);
  padding: 1px 8px;
  font-size: 11.5px;
  font-weight: 700;
}

.doc-results-label {
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
  margin-bottom: 22px;
}

/* O container de resultados é NEUTRO: quem faz grade é o .doc-grid de dentro. Ele já foi .doc-grid, e
   isso quebrou a hierarquia — os títulos de seção viravam CÉLULAS da mesma grade de 3 colunas, um em cada
   coluna, com os cards espremidos no meio. Só a captura pega isso. */
.doc-results { display: block; }

/* ── Hierarquia da grade: principais em destaque, apoio recolhido ──
   Decisão do dono, 2026-08-13. Só aparece na vista SEM filtro (ver app.js) — quem buscou já disse o que
   procura, e ali toda a lista é resultado. */
.doc-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: .02em;
  text-transform: uppercase;
  margin: 4px 0 16px;
}

.doc-section-title + .doc-grid { margin-bottom: 34px; }

.doc-more {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.doc-more__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  user-select: none;
}

.doc-more__summary::-webkit-details-marker { display: none; }

.doc-more__summary::after {
  content: "›";
  margin-left: auto;
  font-size: 20px;
  line-height: 1;
  color: var(--text-3);
  transform: rotate(90deg);
  transition: transform .18s ease;
}

.doc-more[open] > .doc-more__summary::after { transform: rotate(270deg); }

.doc-more__summary:hover { background: var(--surface-2); }

.doc-more__label { font-size: 14.5px; }

.doc-more__count {
  min-width: 22px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.doc-more > .doc-grid {
  padding: 4px 16px 18px;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ── Grade de cards ── */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

/* <a> desde 2026-08-15: o card é um LINK para a página do guia. Antes era <button> com um handler de
   JS — invisível para crawler, sem "abrir em nova aba" e sem endereço para compartilhar. */
.doc-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.doc-card__cover {
  position: relative;
  height: 158px;
  background: var(--surface-2) center top/cover no-repeat;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: var(--text-3);
}

.doc-card__cat {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-2);
}

.doc-card__body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}

.doc-card__title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.01em;
  line-height: 1.35;
}

.doc-card__summary {
  font-size: 13.5px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1 1 auto;
}

.doc-card__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 650;
  padding-top: 2px;
}

.doc-card:hover .doc-card__foot { gap: 10px; }

.doc-card__foot span { transition: gap .18s; }

.doc-empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}

.doc-empty-msg__icon { font-size: 42px; display: block; margin-bottom: 10px; }

/* ══════════════════════════ Artigo ══════════════════════════ */
.doc-article-wrap { max-width: 1180px; margin: 0 auto; padding: 26px 28px 80px; }

.doc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-3);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

/* `a` e não só `button` desde 2026-08-15: na página autocontida o breadcrumb é feito de LINKS de
   verdade — é o que o crawler segue e o que faz o botão "voltar" do navegador funcionar. */
.doc-breadcrumb button,
.doc-breadcrumb a {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}

.doc-breadcrumb button:hover,
.doc-breadcrumb a:hover { text-decoration: underline; }

.doc-article__head {
  background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 40%, var(--surface)));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 30px 32px;
  margin-bottom: 30px;
}

.doc-article__head h1 {
  margin: 10px 0 10px;
  font-size: clamp(25px, 3.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -.022em;
  font-weight: 800;
}

/* A capa DENTRO do guia: a mesma imagem do card, agora em tamanho de leitura.
   16:9 fixo porque toda captura do acervo é 1600x900 — sem a proporção travada, uma
   imagem fora do padrão empurraria o texto para baixo da dobra. `object-fit: cover`
   recorta em vez de deformar. */
.doc-article__cover {
  margin: 22px 0 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  cursor: zoom-in;
}

.doc-article__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.doc-article__cover[hidden] {
  display: none;
}

.doc-article__lead {
  margin: 0;
  font-size: 16.5px;
  color: var(--text-2);
  max-width: 780px;
}

.doc-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }

.doc-tag {
  font-size: 12px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--r-pill);
  padding: 4px 11px;
  font-weight: 550;
}

.doc-article__layout {
  display: grid;
  grid-template-columns: 1fr 232px;
  gap: 44px;
  align-items: start;
}

/* ── Sumário lateral ── */
.doc-toc {
  position: sticky;
  top: 88px;
  border-left: 2px solid var(--border);
  padding-left: 16px;
}

.doc-toc__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: 10px;
}

.doc-toc a {
  display: block;
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  padding: 5px 0;
  border-left: 2px solid transparent;
  margin-left: -18px;
  padding-left: 16px;
  transition: color .15s, border-color .15s;
}

.doc-toc a:hover { color: var(--brand); }

.doc-toc a.is-current {
  color: var(--on-primary-container);
  font-weight: 650;
  border-left-color: var(--primary);
  background: var(--primary-container);
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
}

/* ══════════════════════════ Conteúdo do artigo ══════════════════════════ */
.doc-content { min-width: 0; font-size: 15.5px; }

.doc-content > h2 {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.018em;
  margin: 46px 0 16px;
  padding-top: 8px;
  scroll-margin-top: 88px;
}

.doc-content > h2:first-child { margin-top: 0; }

.doc-content h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 30px 0 12px;
  letter-spacing: -.01em;
}

.doc-content p { margin: 0 0 15px; }

.doc-content ul, .doc-content ol { margin: 0 0 16px; padding-left: 24px; }

.doc-content li { margin-bottom: 7px; }

.doc-content strong { font-weight: 680; }

.doc-content code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.5px 6px;
  font-size: 13.5px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.doc-content a { color: var(--brand); }

/* ── Cartões "quando usar" ── */
.doc-usecases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}

.doc-usecase {
  display: flex;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 17px;
  box-shadow: var(--shadow-sm);
}

.doc-usecase__icon {
  font-size: 22px;
  line-height: 1.2;
  flex-shrink: 0;
}

.doc-usecase strong { display: block; margin-bottom: 3px; font-size: 14.5px; }

.doc-usecase span { font-size: 13.5px; color: var(--text-2); }

/* ── Passo a passo ── */
.doc-steps {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  counter-reset: doc-step;
}

.doc-steps > li {
  counter-increment: doc-step;
  position: relative;
  padding: 0 0 22px 50px;
  margin: 0;
}

.doc-steps > li::before {
  content: counter(doc-step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--on-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.doc-steps > li::after {
  content: "";
  position: absolute;
  left: 15.5px;
  top: 36px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.doc-steps > li:last-child { padding-bottom: 0; }

.doc-steps > li:last-child::after { display: none; }

/* Só o <strong> FILHO DIRETO do passo é o título dele. Sem o `>`, qualquer negrito no meio do
   parágrafo do passo virava bloco e quebrava a linha — o guia de compras foi escrito desviando disso
   com itálico até a causa aparecer. */
.doc-steps > li > strong { display: block; font-size: 15.5px; margin-bottom: 3px; }

.doc-steps p { margin: 0; color: var(--text-2); font-size: 14.5px; }

/* ── Campos ── */
.doc-fields { display: flex; flex-direction: column; gap: 12px; margin: 0 0 24px; }

.doc-field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s;
}

.doc-field:hover { border-color: var(--border-strong); }

.doc-field__head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}

.doc-field__name { font-weight: 700; font-size: 15px; }

.doc-field__flag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: var(--r-pill);
  padding: 2.5px 9px;
}

.doc-field__flag--obrigatorio { background: var(--danger-soft); color: var(--danger); }
.doc-field__flag--opcional { background: var(--surface-2); color: var(--text-3); }
.doc-field__flag--automatico { background: var(--info-soft); color: var(--info); }
.doc-field__flag--calculado { background: var(--brand-soft); color: var(--brand-strong); }

.doc-field p { margin: 0 0 8px; font-size: 14.5px; color: var(--text-2); }

.doc-field p:last-child { margin-bottom: 0; }

.doc-field__example {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  padding: 7px 13px;
  font-size: 13.5px;
}

.doc-field__example b {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
}

/* ── Avisos ── */
.doc-callout {
  display: flex;
  gap: 13px;
  border-radius: var(--r-md);
  padding: 15px 18px;
  margin: 0 0 22px;
  font-size: 14.5px;
  border: 1px solid transparent;
}

.doc-callout__icon { font-size: 19px; line-height: 1.4; flex-shrink: 0; }

.doc-callout > div { min-width: 0; }

.doc-callout p { margin: 0 0 8px; }
.doc-callout p:last-child { margin-bottom: 0; }

.doc-callout--info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 26%, transparent); }
.doc-callout--ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 26%, transparent); }
.doc-callout--warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.doc-callout--danger, .doc-callout--off { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.doc-callout--dica { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 26%, transparent); }

/* ── Tabelas (uso pontual) ── */
/* Tecla de atalho. Usa os MESMOS tokens do tema (que já tem variante escura logo abaixo no arquivo),
   para a tecla não ficar clara numa página escura — o <kbd> cru do navegador é monoespaçado e sem cor. */
.doc-content kbd {
  display: inline-block;
  padding: 2px 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
}

.doc-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 22px;
  font-size: 14.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  display: block;
  overflow-x: auto;
}

.doc-content th, .doc-content td {
  padding: 11px 15px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.doc-content th {
  background: var(--surface-2);
  font-weight: 680;
  font-size: 13px;
  white-space: nowrap;
}

.doc-content tr:last-child td { border-bottom: 0; }

/* ── Perguntas frequentes ── */
.doc-faq {
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  overflow: hidden;
  transition: background var(--dur) var(--easing);
}

.doc-faq[open] { background: var(--surface-lowest); }

.doc-faq summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 650;
  font-size: 15px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 11px;
}

.doc-faq summary::-webkit-details-marker { display: none; }

.doc-faq summary::before {
  content: "›";
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  transition: transform var(--dur) var(--easing);
}

/* O sinal GIRA em vez de trocar de glifo (＋ → －): a rotação é contínua e diz "isto abriu",
   enquanto a troca de caractere pisca e ainda muda a largura do texto ao lado. */
.doc-faq[open] summary::before { transform: rotate(90deg); }

.doc-faq summary:hover { background: color-mix(in srgb, var(--primary) var(--state-hover), transparent); }

.doc-faq__body { padding: 0 18px 16px 47px; font-size: 14.5px; color: var(--text-2); }

.doc-faq__body p { margin: 0 0 10px; }
.doc-faq__body p:last-child { margin-bottom: 0; }

/* ── Print no meio do texto (o que ilustra a seção que acabou de ser explicada) ── */
figure.doc-shot {
  margin: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  cursor: zoom-in;
  transition: box-shadow .18s, border-color .18s;
}

figure.doc-shot:hover { box-shadow: var(--shadow-lg); border-color: var(--border-strong); }

/* Altura natural, sem recorte: num print de tela o rodapé costuma ser justamente o que a seção
   está explicando (o total, o botão de confirmar). Cortar esconderia o assunto. */
figure.doc-shot img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface-2);
}

/* Variante para print cuja metade de baixo é área vazia — ou traz a legenda que o teste de captura
   desenhou por cima da tela. Mostra só a faixa de cima, onde está o conteúdo. */
figure.doc-shot--topo img {
  aspect-ratio: 26 / 10;
  object-fit: cover;
  object-position: top center;
}

figure.doc-shot figcaption {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

figure.doc-shot figcaption::before {
  content: "🔍";
  font-size: 12px;
  opacity: .7;
  flex-shrink: 0;
}

/* ── Galeria ── */
.doc-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin: 0 0 24px;
}

.doc-gallery figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
}

.doc-gallery figure:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.doc-gallery img {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: cover;
  object-position: top left;
  background: var(--surface-2);
}

.doc-gallery figcaption {
  font-size: 12.5px;
  color: var(--text-2);
  padding: 9px 12px;
  border-top: 1px solid var(--border);
}

/* ── Navegação entre telas ── */
.doc-next {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 46px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.doc-next__card {
  flex: 1 1 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 15px 17px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  text-decoration: none; /* <a> desde 2026-08-15 — o próximo guia é link, não botão de JS */
  box-shadow: var(--shadow-sm);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}

.doc-footer a { color: var(--brand); font-weight: 600; text-decoration: none; }
.doc-footer a:hover { text-decoration: underline; }

.doc-next__card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}

.doc-next__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.doc-next__title { font-weight: 650; font-size: 14.5px; }

/* ══════════════════════════ Lightbox ══════════════════════════ */
.doc-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, .9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 100;
  padding: 34px;
}

.doc-lightbox[hidden] { display: none; }

.doc-lightbox img {
  max-width: 94vw;
  max-height: 82vh;
  border-radius: var(--r-md);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}

.doc-lightbox__caption { color: #FFF; font-size: 14px; }

.doc-lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  border: 0;
  background: rgba(255, 255, 255, .14);
  color: #FFF;
  font-size: 17px;
  cursor: pointer;
}

.doc-lightbox__close:hover { background: rgba(255, 255, 255, .26); }

/* ══════════════════════════ Rodapé ══════════════════════════ */
.doc-footer {
  padding: 18px 28px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ══════════════════════════ Responsivo ══════════════════════════ */
@media (max-width: 1000px) {
  .doc-article__layout { grid-template-columns: 1fr; gap: 0; }
  .doc-toc { display: none; }
}

@media (max-width: 700px) {
  .doc-topbar { padding: 10px 16px; gap: 10px; }
  .doc-topbar__search { display: none; }
  .doc-home, .doc-article-wrap { padding-left: 16px; padding-right: 16px; }
  .doc-hero { padding: 36px 4px 30px; }
  .doc-article__head { padding: 22px 20px; }
  .doc-grid { grid-template-columns: 1fr; }
  .doc-faq__body { padding-left: 18px; }
}


/* ══════════════════════════ Foco visível (M3) ══════════════════════════
   Um anel só, na cor do papel, em tudo que se aciona — teclado é o caminho de quem lê
   documentação com as mãos no teclado, e o outline do navegador some sobre superfície escura.
   ⚠️ `:focus-visible`, não `:focus`: com `:focus` o anel aparece no CLIQUE do mouse também, e o
   usuário lê isso como "travou selecionado". */
.doc-chip:focus-visible,
.doc-icon-btn:focus-visible,
.doc-card:focus-visible,
.doc-next__card:focus-visible,
.doc-breadcrumb a:focus-visible,
.doc-topbar__brand:focus-visible,
.doc-more__summary:focus-visible,
.doc-faq summary:focus-visible,
.doc-toc a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Quem pediu para o sistema reduzir animação não recebe transição nenhuma — a Central tem
   movimento em card, chip e sumário, e é justamente esse tipo de micro-animação que incomoda. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ══════════════════════════ Resultado de busca ══════════════════════════ */

/* O trecho que casou: aparece só quando o guia entrou no resultado por uma PERGUNTA do FAQ ou por
   um assunto interno — ou seja, quando nenhuma palavra buscada estaria visível no card. */
.doc-card__match {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  background: var(--surface-high);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.45;
}

.doc-card__match-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* O termo buscado, onde quer que apareça. `color: inherit` porque o <mark> do navegador vem com
   fundo amarelo e texto preto — ilegível no tema escuro. */
mark {
  background: color-mix(in srgb, var(--primary) 26%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 650;
}

/* Dica do atalho, dentro da busca do hero. Some no toque, onde não há teclado. */
.doc-hero__search kbd {
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-3);
  background: var(--surface-high);
  border: 1px solid var(--outline-variant);
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
}

@media (hover: none) {
  .doc-hero__search kbd { display: none; }
}
