/* ShieldSign PKI: estilo da documentação. Sem fontes nem scripts externos. Tema claro/escuro pelo sistema, com chave manual (data-theme). */
:root {
  --bg: #ffffff; --bg-soft: #f7f4ed; --fg: #2b2518; --muted: #6f6656; --line: #e4dccb;
  --brand: #59492f; --brand-dark: #3f3321; --yellow: #faa61a; --yellow-dark: #d98a0a; --link: #8a5a00;
  --code-bg: #f6f2ea; --code-fg: #2b2518; --shadow: 0 1px 2px rgba(43, 37, 24, .08), 0 4px 16px rgba(43, 37, 24, .06);
  --note: #1f6feb; --tip: #1b7f4c; --warn: #b7791f; --danger: #b3261e; --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --top-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16120b; --bg-soft: #1e1810; --fg: #ece4d3; --muted: #aa9f89; --line: #352f20; --brand: #3f3321; --brand-dark: #2e2517;
    --link: #f5b942; --code-bg: #221c11; --code-fg: #ece4d3; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    --note: #6aa5ff; --tip: #4cc38a; --warn: #f0b34a; --danger: #ff7b72; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16120b; --bg-soft: #1e1810; --fg: #ece4d3; --muted: #aa9f89; --line: #352f20; --brand: #3f3321; --brand-dark: #2e2517;
  --link: #f5b942; --code-bg: #221c11; --code-fg: #ece4d3; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  --note: #6aa5ff; --tip: #4cc38a; --warn: #f0b34a; --danger: #ff7b72; color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); color: #2b1d00; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---- barra superior ---- */
.top { position: sticky; top: 0; z-index: 50; height: var(--top-h); display: flex; align-items: center; gap: 18px; padding: 0 22px; background: var(--brand-dark); color: #fff; border-bottom: 3px solid var(--yellow); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.brand .tag { font-weight: 500; font-size: 13px; color: #e9dfc9; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; padding: 1px 10px; }
.top .grow { flex: 1; }
.search { position: relative; display: none; width: min(380px, 38vw); }
.js .search { display: block; }
.search input { width: 100%; height: 38px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #fff; padding: 0 44px 0 14px; font: inherit; font-size: 14.5px; }
.search input::placeholder { color: #d9ccb0; }
.search input:focus { background: #fff; color: #2b2518; outline-color: var(--yellow); }
.search kbd { position: absolute; right: 10px; top: 8px; font: 12px var(--mono); color: #d9ccb0; border: 1px solid rgba(255, 255, 255, .3); border-radius: 4px; padding: 0 6px; pointer-events: none; }
.results { position: absolute; top: 44px; left: 0; right: 0; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 70vh; overflow: auto; display: none; }
.results.open { display: block; }
.results a { display: block; padding: 10px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a.sel { background: var(--bg-soft); }
.results .rt { font-weight: 650; }
.results .rs { font-size: 13px; color: var(--muted); }
.results mark { background: rgba(250, 166, 26, .35); color: inherit; border-radius: 2px; }
.results .none { padding: 14px; color: var(--muted); }
.toplinks { display: flex; align-items: center; gap: 16px; font-size: 14.5px; }
.toplinks a { color: #f1e8d4; text-decoration: none; }
.toplinks a:hover { color: #fff; text-decoration: underline; }
.ver { font: 600 12px var(--mono); background: var(--yellow); color: #2b1d00; border-radius: 6px; padding: 2px 8px; }
.iconbtn { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .28); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 16px; display: none; }
.js .iconbtn { display: inline-block; }
.menubtn { display: none; cursor: pointer; font-size: 22px; line-height: 1; padding: 6px 8px; }
#navtoggle { position: absolute; opacity: 0; pointer-events: none; }

/* ---- estrutura ---- */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 230px; max-width: 1480px; margin: 0 auto; }
.side { position: sticky; top: var(--top-h); align-self: start; height: calc(100vh - var(--top-h)); overflow: auto; padding: 22px 8px 40px 22px; border-right: 1px solid var(--line); font-size: 15px; }
.side h4 { margin: 20px 0 6px; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.side h4:first-child { margin-top: 0; }
.side a { display: block; padding: 5px 12px; margin: 1px 0; border-radius: 6px; color: var(--fg); text-decoration: none; border-left: 3px solid transparent; }
.side a:hover { background: var(--bg-soft); }
.side a.on { background: var(--bg-soft); border-left-color: var(--yellow); font-weight: 650; color: var(--brand); }
:root[data-theme="dark"] .side a.on { color: var(--yellow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side a.on { color: var(--yellow); } }
main { padding: 34px 44px 90px; min-width: 0; }
article { max-width: 820px; }
.toc { position: sticky; top: var(--top-h); align-self: start; max-height: calc(100vh - var(--top-h)); overflow: auto; padding: 34px 18px 40px 6px; font-size: 13.5px; }
.toc h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.toc a { display: block; padding: 3px 0 3px 12px; color: var(--muted); text-decoration: none; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--fg); border-left-color: var(--yellow); }
.toc a.l3 { padding-left: 26px; font-size: 13px; }
.toc a.act { color: var(--fg); border-left-color: var(--yellow); font-weight: 600; }

/* ---- texto ---- */
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 14px; letter-spacing: -.01em; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 22px; }
h2 { font-size: 25px; margin: 44px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); letter-spacing: -.005em; }
h3 { font-size: 19px; margin: 30px 0 8px; }
h4 { font-size: 16px; margin: 22px 0 6px; }
h2:first-of-type { margin-top: 28px; }
.headerlink { margin-left: 8px; opacity: 0; text-decoration: none; color: var(--muted); font-weight: 400; }
h1:hover .headerlink, h2:hover .headerlink, h3:hover .headerlink, h4:hover .headerlink { opacity: 1; }
p, li { max-width: 74ch; }
li { margin: 4px 0; }
code { font: .88em var(--mono); background: var(--code-bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; word-break: break-word; }
pre { margin: 14px 0; }
pre code { padding: 0; border: 0; background: none; word-break: normal; }
.highlight { position: relative; margin: 14px 0; background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--line); border-radius: var(--radius); }
.highlight pre { margin: 0; padding: 16px 18px; overflow: auto; font: 13.5px/1.55 var(--mono); }
.copy { position: absolute; top: 8px; right: 8px; font: 600 12px var(--font); border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 6px; padding: 3px 9px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.highlight:hover .copy, .copy:focus { opacity: 1; }
.copy.ok { color: var(--tip); border-color: var(--tip); opacity: 1; }
table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14.5px; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
th { background: var(--bg-soft); font-weight: 650; }
tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-soft) 45%, transparent); }
td code, th code { white-space: nowrap; }
td p { margin: 0 0 6px; }
blockquote { margin: 16px 0; padding: 4px 16px; border-left: 4px solid var(--yellow); background: var(--bg-soft); color: var(--muted); border-radius: 0 8px 8px 0; }

/* ---- avisos ---- */
.admonition { margin: 18px 0; padding: 12px 18px 10px; border: 1px solid var(--line); border-left: 5px solid var(--note); border-radius: 8px; background: var(--bg-soft); }
.admonition > :last-child { margin-bottom: 0; }
.admonition-title { margin: 0 0 6px; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--note); }
.admonition.tip { border-left-color: var(--tip); } .admonition.tip .admonition-title { color: var(--tip); }
.admonition.warning { border-left-color: var(--warn); } .admonition.warning .admonition-title { color: var(--warn); }
.admonition.danger { border-left-color: var(--danger); } .admonition.danger .admonition-title { color: var(--danger); }

/* ---- abas de código (só CSS) ---- */
.tabs { margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.tabs .tabbar { display: flex; flex-wrap: wrap; gap: 2px; background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 6px 8px 0; }
.tabs .tabbar label { padding: 7px 14px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); border-radius: 8px 8px 0 0; border: 1px solid transparent; border-bottom: 0; }
.tabs .tabbar label:hover { color: var(--fg); }
.tabs .panel { display: none; padding: 4px 16px; }
.tabs .panel > .highlight:first-child { margin-top: 12px; }
.tabs > input:nth-of-type(1):checked ~ .panels > .panel:nth-child(1), .tabs > input:nth-of-type(2):checked ~ .panels > .panel:nth-child(2),
.tabs > input:nth-of-type(3):checked ~ .panels > .panel:nth-child(3), .tabs > input:nth-of-type(4):checked ~ .panels > .panel:nth-child(4),
.tabs > input:nth-of-type(5):checked ~ .panels > .panel:nth-child(5), .tabs > input:nth-of-type(6):checked ~ .panels > .panel:nth-child(6) { display: block; }
.tabs > input:nth-of-type(1):checked ~ .tabbar label:nth-child(1), .tabs > input:nth-of-type(2):checked ~ .tabbar label:nth-child(2),
.tabs > input:nth-of-type(3):checked ~ .tabbar label:nth-child(3), .tabs > input:nth-of-type(4):checked ~ .tabbar label:nth-child(4),
.tabs > input:nth-of-type(5):checked ~ .tabbar label:nth-child(5), .tabs > input:nth-of-type(6):checked ~ .tabbar label:nth-child(6) {
  color: var(--fg); background: var(--bg); border-color: var(--line); margin-bottom: -1px; box-shadow: inset 0 3px 0 var(--yellow);
}
.tabs > input:focus-visible ~ .tabbar label { outline: 0; }

/* ---- landing ---- */
.hero { padding: 26px 0 8px; }
.hero h1 { font-size: 42px; }
.hero .lead { font-size: 21px; max-width: 60ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 8px; }
.btn { display: inline-block; padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: 650; border: 1px solid var(--line); color: var(--fg); background: var(--bg); }
.btn:hover { border-color: var(--yellow); }
.btn.primary { background: var(--yellow); border-color: var(--yellow-dark); color: #2b1d00; }
.btn.primary:hover { background: var(--yellow-dark); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin: 22px 0; }
.card { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: var(--yellow); box-shadow: var(--shadow); transform: translateY(-1px); }
.card b { display: block; font-size: 17px; margin-bottom: 4px; color: var(--fg); }
.card span { color: var(--muted); font-size: 14.5px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding: 12px 16px 12px 58px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); max-width: none; }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 11px; width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); color: #2b1d00; font-weight: 800; display: grid; place-items: center; }

/* ---- referência da API ---- */
.op { border: 1px solid var(--line); border-radius: var(--radius); margin: 22px 0; padding: 4px 20px 14px; background: var(--bg); scroll-margin-top: 80px; }
.op h3 { margin: 16px 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.m { display: inline-block; min-width: 64px; text-align: center; font: 700 12px var(--mono); color: #fff; border-radius: 6px; padding: 4px 8px; }
.m.get { background: #1b7f4c; } .m.post { background: #59492f; } .m.put { background: #a66a00; } .m.delete { background: #b3261e; } .m.patch { background: #6b3fa0; }
.path { font: 600 15px var(--mono); word-break: break-all; }
.op .sum { font-weight: 650; margin: 0 0 8px; }
.op h4 { font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 20px 0 4px; }
.req { color: var(--danger); font-weight: 700; }
.opindex { columns: 2 340px; column-gap: 28px; margin: 16px 0 24px; padding: 0; list-style: none; }
.opindex li { margin: 3px 0; break-inside: avoid; max-width: none; }
.opindex a { text-decoration: none; display: flex; gap: 8px; align-items: baseline; }
.opindex .m { min-width: 54px; font-size: 11px; padding: 2px 6px; }
.opindex .pp { font: 13px var(--mono); word-break: break-all; color: var(--fg); }
.muted { color: var(--muted); }
.status { font: 700 13px var(--mono); }
.status.ok { color: var(--tip); } .status.err { color: var(--danger); }

/* ---- rodapé ---- */
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 56px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.pager a { display: block; padding: 12px 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--fg); min-width: 200px; max-width: 48%; }
.pager a:hover { border-color: var(--yellow); }
.pager small { display: block; color: var(--muted); }
.pager .next { margin-left: auto; text-align: right; }
.foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.foot a { color: var(--muted); }

/* ---- telas pequenas ---- */
@media (max-width: 1180px) { .layout { grid-template-columns: 250px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 860px) {
  .layout { display: block; }
  .menubtn { display: inline-block; }
  .side { position: fixed; left: 0; top: var(--top-h); bottom: 0; width: min(310px, 86vw); height: auto; background: var(--bg); transform: translateX(-102%); transition: transform .2s; z-index: 40; box-shadow: var(--shadow); }
  #navtoggle:checked ~ .layout .side { transform: none; }
  main { padding: 24px 18px 70px; }
  .search { width: auto; flex: 1; }
  .toplinks a { display: none; }
  .brand .tag { display: none; }
  h1 { font-size: 28px; } .hero h1 { font-size: 32px; }
}
@media print {
  .top, .side, .toc, .pager, .copy, .menubtn { display: none !important; }
  .layout { display: block; } main { padding: 0; } article { max-width: none; }
  .highlight { break-inside: avoid; } a { color: inherit; }
}
