/* Portal de desenvolvedores do Clientree. Referência de organização: Stripe Docs e docs.jetimob.com (menu agrupado à
   esquerda, texto no meio, código à direita). Mesmos tokens de cor da central de ajuda; sem fonte externa. */
:root {
  --bg: #ffffff; --bg-2: #f6f8fa; --panel: #ffffff; --text: #17212b; --muted: #5b6875; --line: #e2e7ec;
  --accent: #0f766e; --accent-2: #e6f4f2; --accent-text: #ffffff; --code-bg: #0f1a21; --code-text: #e4eaee; --code-muted: #9fb0bc;
  --get: #0f766e; --post: #1d4ed8; --patch: #9a3412; --delete: #b91c1c; --ok: #15803d; --warn: #b45309;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1418; --bg-2: #131b21; --panel: #151d23; --text: #e4eaee; --muted: #9aa8b3; --line: #26323a;
    --accent: #2bb3a3; --accent-2: #173431; --accent-text: #06201d; --code-bg: #0a1014; --code-text: #e4eaee; --code-muted: #8d9ba6;
    --get: #2bb3a3; --post: #7aa2ff; --patch: #fb923c; --delete: #f87171; --ok: #4ade80; --warn: #fbbf24; }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body { margin: 0; font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); overflow-wrap: break-word; }
a { color: var(--accent); }
code { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.01em; }
h2 { font-size: 21px; line-height: 1.3; margin: 34px 0 10px; }
h3 { font-size: 15px; margin: 22px 0 8px; }
p { margin: 0 0 12px; }
ul, ol { padding-left: 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { font-size: 17px; color: var(--muted); max-width: 720px; }
.crumb { font-size: 13px; font-weight: 600; color: var(--accent); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--bg-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.06); }
a:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.selo { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--warn); border: 1px solid currentColor; border-radius: 99px; padding: 1px 8px; vertical-align: middle; margin-left: 6px; }

/* topo */
.topo { position: sticky; top: 0; z-index: 10; background: var(--panel); border-bottom: 1px solid var(--line); }
.topo .in { max-width: 1320px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 20px; }
.marca { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); margin-right: auto; }
.marca .logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-weight: 800; }
.marca .sub { color: var(--muted); font-size: 14px; border-left: 1px solid var(--line); padding-left: 8px; }
.topnav { display: flex; gap: 4px; }
.topnav a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 7px; font-weight: 600; font-size: 14px; }
.topnav a:hover, .topnav a.on { color: var(--text); background: var(--bg-2); }

/* início (Desenvolvedores) */
.inicio main .in { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 72px 0 56px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.hero h1 { font-size: 42px; max-width: 720px; }
.hero .olho { color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.acoes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.faixa { padding: 52px 0; }
.faixa.clara { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.faixa h2 { margin-top: 0; }
.cartoes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cartoes.quatro { grid-template-columns: repeat(2, 1fr); }
details.campos-ev { border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; background: var(--panel); }
details.campos-ev > summary { cursor: pointer; padding: 12px 14px; min-height: 44px; box-sizing: border-box; }
details.campos-ev > .tab { margin: 0; border-top: 1px solid var(--line); }
details.campos-ev[open] > summary { font-weight: 600; }
.cartao { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; color: var(--text); text-decoration: none; background: var(--panel); }
.cartao:hover { border-color: var(--accent); }
.cartao h3 { margin: 0 0 6px; font-size: 18px; }
.cartao p { color: var(--muted); }
.cartao ul { margin: 0 0 14px; color: var(--text); font-size: 14px; }
.cartao .mais { margin-top: auto; color: var(--accent); font-weight: 600; font-size: 14px; }
.passos { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: p; }
.passos li { counter-increment: p; display: flex; flex-direction: column; gap: 4px; padding-top: 44px; position: relative; }
.passos li::before { content: counter(p); position: absolute; top: 0; left: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; }
.passos span { color: var(--muted); }

/* documentação */
.docs { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.lado { border-right: 1px solid var(--line); }
.menu { position: sticky; top: 57px; max-height: calc(100vh - 57px); overflow: auto; padding: 24px 16px 40px 24px; display: flex; flex-direction: column; }
.menu-mob { display: none; }
.nav-g { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 6px; }
.nav-g:first-child { margin-top: 0; }
.lado nav a { color: var(--text); text-decoration: none; padding: 6px 10px; border-radius: 7px; font-size: 14px; }
.lado nav a:hover { background: var(--bg-2); }
.lado nav a.on { background: var(--accent-2); color: var(--accent); font-weight: 600; }
.conteudo { padding: 36px 48px 80px; max-width: 860px; min-width: 0; }
.conteudo.larga { max-width: none; }
.code { border-radius: var(--radius); overflow: hidden; background: var(--code-bg); margin: 12px 0 18px; border: 1px solid var(--line); }
.code-h { font: 600 12px/1 system-ui, sans-serif; color: var(--code-muted); padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.08); text-transform: uppercase; letter-spacing: .04em; }
.code pre { margin: 0; padding: 14px; overflow: auto; }
.code code { background: none; border: 0; padding: 0; color: var(--code-text); white-space: pre; overflow-wrap: normal; font-size: 13px; }
.tab { width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: 14px; }
.tab th { white-space: nowrap; text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tab td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tab .num { text-align: right; white-space: nowrap; }
.tab td:first-child { overflow-wrap: normal; }
.tab tr.clica:hover td { background: var(--bg-2); }
.tab.campos td:first-child { width: 34%; }
.vals { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.obr { font-size: 11px; font-weight: 700; color: var(--warn); margin-left: 4px; }
.rota { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.rota code { font-size: 14px; }
.rota i { color: var(--accent); font-style: normal; }
.m { display: inline-block; min-width: 54px; text-align: center; font: 700 11px/1 ui-monospace, monospace; padding: 5px 6px; border-radius: 5px; color: #fff; }
.m-get { background: var(--get); } .m-post { background: var(--post); } .m-patch { background: var(--patch); } .m-delete { background: var(--delete); }
@media (prefers-color-scheme: dark) { .m { color: #0a1014; } }
.ref-topo { max-width: 820px; }
.indice { display: grid; gap: 6px; margin: 16px 0; }
.indice a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); padding: 6px 8px; border-radius: 7px; }
.indice a:hover { background: var(--bg-2); }
.indice code { background: none; border: 0; }
.indice .small { color: var(--muted); }
.op { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding: 32px 0; border-top: 1px solid var(--line); }
.op h2 { margin-top: 0; }
.op h2 a { color: var(--text); text-decoration: none; }
.op-cod { position: sticky; top: 76px; align-self: start; min-width: 0; }
.op-cod .code:first-child { margin-top: 0; }
.resps { list-style: none; padding: 0; margin: 0; }
.resps li { padding: 4px 0; }
.st { display: inline-block; font: 700 12px/1 ui-monospace, monospace; padding: 4px 6px; border-radius: 5px; border: 1px solid currentColor; margin-right: 6px; }
.st.s2 { color: var(--ok); } .st.s4 { color: var(--warn); } .st.s5 { color: var(--delete); }
.rodape { border-top: 1px solid var(--line); background: var(--bg-2); }
.rodape .in { max-width: 1320px; margin: 0 auto; padding: 18px 24px; display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.rodape span { margin-right: auto; }

@media (max-width: 1100px) {
  .tab code { overflow-wrap: anywhere; }
  .tab-eventos th:nth-child(3), .tab-eventos td:nth-child(3) { display: none; }
  .op { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .op-cod { position: static; }
}
@media (max-width: 820px) {
  .topo .in { padding: 8px 16px; gap: 10px; }
  .btn { min-height: 44px; }
  .topnav { display: none; }
  .marca .sub { display: none; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .lado { border-right: 0; border-bottom: 1px solid var(--line); }
  .menu { display: none; }
  .menu-mob { display: block; padding: 0 16px; }
  .menu-mob summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; cursor: pointer; list-style: none; }
  .menu-mob summary::-webkit-details-marker { display: none; }
  .menu-mob summary::after { content: '+'; font-size: 20px; color: var(--muted); }
  .menu-mob[open] summary::after { content: '\2212'; }
  .indice a { flex-wrap: wrap; }
  .indice a { padding-left: 0; }
  .indice .small { flex-basis: 100%; }
  .menu-mob nav { display: flex; flex-direction: column; padding-bottom: 12px; }
  .menu-mob nav a { min-height: 44px; display: flex; align-items: center; }
  .conteudo { padding: 24px 16px 60px; }
  h1 { font-size: 26px; }
  .hero { padding: 44px 0 36px; }
  .hero h1 { font-size: 32px; }
  .inicio main .in { padding: 0 16px; }
  .cartoes, .passos { grid-template-columns: minmax(0, 1fr); }
  .acoes .btn { flex: 1; min-height: 44px; }
  .tab.campos td:first-child { width: 40%; }
  .rodape .in { padding: 16px; flex-direction: column; align-items: flex-start; gap: 0; }
  .rodape a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* botão Copiar dos blocos de código (copiar.js; sem JavaScript o botão fica escondido) */
.code-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.copiar { font: 600 11px/1 system-ui, sans-serif; color: var(--code-muted); background: transparent; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; padding: 5px 9px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.copiar:hover, .copiar:focus-visible { color: var(--code-text); border-color: rgba(255,255,255,.4); }
@media (max-width: 820px) { .copiar { min-height: 44px; padding: 0 14px; } }
/* celular: tabela vira cartões (nome técnico na 1ª linha, descrição embaixo) */
@media (max-width: 600px) {
  .tab thead { display: none; }
  .tab, .tab tbody, .tab tr, .tab td { display: block; width: auto !important; }
  .tab tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tab td { border: 0; padding: 2px 0; text-align: left !important; }
  .tab code { overflow-wrap: normal; word-break: keep-all; }
  .tab-eventos td:nth-child(3) { display: none; }
}
