/* Acheron World — documentação. Tema escuro: dourado, azul frio, fundo quase preto.
   Tudo local: nenhuma fonte ou script externo. */

:root {
  --gold: #c8a84b;
  --gold-hi: #f0d98a;
  --gold-dim: #8a7333;
  --blue: #5b8fd6;
  --blue-deep: #16233a;
  --blue-dim: #35507d;

  --bg: #07080c;
  --bg-2: #0a0c12;
  --panel: #10131b;
  --panel-2: #151925;
  --line: #1f2433;
  --line-hi: #2c3346;

  --text: #ccd3e0;
  --text-hi: #eef2f8;
  --muted: #8892a6;
  --dim: #5b6479;

  --ok: #6fae6a;
  --dmg: #c96a5a;

  --h-top: 58px;
  --w-side: 274px;
  --w-toc: 236px;
  --rad: 10px;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--h-top) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 78% -12%, rgba(91, 143, 214, .10), transparent 62%),
    radial-gradient(900px 460px at 6% 0%, rgba(200, 168, 75, .07), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.68 var(--sans);
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px;
}

.skip {
  position: fixed; left: -999px; top: 8px; z-index: 200;
  background: var(--gold); color: #10131b; padding: 8px 14px; border-radius: 6px; font-weight: 700;
}
.skip:focus { left: 12px; }

/* ── topo ─────────────────────────────────────────────────────────────────── */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: calc(var(--h-top) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 18px 0;
  display: flex; align-items: center; gap: 14px;
  background: rgba(8, 10, 15, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 168, 75, .55), transparent);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); flex: none; }
.brand:hover { text-decoration: none; }
.logo { width: 26px; height: 26px; filter: drop-shadow(0 0 6px rgba(200, 168, 75, .35)); }
.bt { display: flex; flex-direction: column; line-height: 1.15; }
.bt b { color: var(--text-hi); font-size: 14px; letter-spacing: .04em; }
.bt i { color: var(--gold-dim); font-size: 10.5px; font-style: normal; letter-spacing: .18em; text-transform: uppercase; }

.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; flex-direction: column; gap: 4px; }
.burger span { display: block; width: 20px; height: 2px; background: var(--gold); border-radius: 2px; transition: .18s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.search { position: relative; flex: 1 1 120px; min-width: 0; max-width: 520px; margin-left: auto; }
.search input {
  width: 100%; height: 36px; padding: 0 44px 0 34px;
  background: var(--panel); color: var(--text-hi);
  border: 1px solid var(--line-hi); border-radius: 18px;
  font: 13.5px var(--sans);
}
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: var(--gold-dim); background: var(--panel-2); }
.s-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 15px; pointer-events: none; }
.search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: var(--panel-2); border: 1px solid var(--line-hi); border-radius: 5px;
  padding: 1px 6px; font: 11px var(--mono); color: var(--dim);
}
.sres {
  position: absolute; top: 44px; left: 0; right: 0; z-index: 70;
  background: var(--panel); border: 1px solid var(--line-hi); border-radius: var(--rad);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .6);
  max-height: min(66vh, 520px); overflow: auto; padding: 6px;
}
.sres .sr { display: block; padding: 8px 10px; border-radius: 7px; color: var(--text); }
.sres .sr:hover, .sres .sr.on { background: var(--blue-deep); text-decoration: none; }
.sres .sr b { display: block; color: var(--text-hi); font-size: 13.5px; }
.sres mark { background: rgba(200, 168, 75, .2); color: var(--gold-hi); border-radius: 2px; padding: 0 1px; }
.sres .sr span { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.sres .sr i { color: var(--gold-dim); font-style: normal; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; }
.sres .shead { padding: 8px 10px 4px; color: var(--dim); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }
.sres .snone { padding: 14px 10px; color: var(--muted); font-size: 13px; }

.tlinks { display: flex; gap: 8px; flex: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 15px; border-radius: 17px;
  font: 600 13px var(--sans); letter-spacing: .02em; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn.gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #15120a; }
.btn.gold:hover { filter: brightness(1.1); color: #15120a; }
.btn.ghost { border: 1px solid var(--line-hi); color: var(--text); }
.btn.ghost:hover { border-color: var(--gold-dim); color: var(--gold-hi); }
.btn.big { height: 42px; padding: 0 22px; font-size: 14.5px; border-radius: 21px; }

/* ── estrutura ────────────────────────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--w-side) minmax(0, 1fr) auto;
  gap: 0;
  padding-top: calc(var(--h-top) + env(safe-area-inset-top, 0px));
  align-items: start;
}
@media (max-width: 1180px) { .shell { grid-template-columns: var(--w-side) minmax(0, 1fr); } .toc { display: none; } }

.side {
  position: sticky; top: calc(var(--h-top) + env(safe-area-inset-top, 0px));
  height: calc(100vh - var(--h-top));
  overflow-y: auto; overscroll-behavior: contain;
  border-right: 1px solid var(--line);
  padding: 20px 10px 40px 18px;
  background: linear-gradient(180deg, rgba(10, 12, 18, .6), transparent 220px);
}
.side::-webkit-scrollbar, .sres::-webkit-scrollbar, .tbl-wrap::-webkit-scrollbar { width: 9px; height: 9px; }
.side::-webkit-scrollbar-thumb, .sres::-webkit-scrollbar-thumb, .tbl-wrap::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 5px; }
.side::-webkit-scrollbar-track, .tbl-wrap::-webkit-scrollbar-track { background: transparent; }

.navhome {
  display: block; padding: 7px 10px; margin-bottom: 10px; border-radius: 7px;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
}
.navhome:hover, .navhome.cur { background: var(--panel); color: var(--gold-hi); text-decoration: none; }

.navsec { margin-bottom: 4px; }
.navsec > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 7px;
  color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
}
.navsec > summary::-webkit-details-marker { display: none; }
.navsec > summary::before {
  content: '▸'; font-size: 9px; color: var(--gold-dim); transition: transform .15s;
}
.navsec[open] > summary::before { transform: rotate(90deg); }
.navsec > summary:hover { background: var(--panel); }
.navsec .cnt { margin-left: auto; font-style: normal; font-size: 10px; color: var(--dim); letter-spacing: 0; }
.navsec ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 10px; border-left: 1px solid var(--line); }
.navsec li a {
  display: block; padding: 5px 10px; border-radius: 6px; margin-left: -1px;
  color: var(--muted); font-size: 13.2px; line-height: 1.4;
}
.navsec li a:hover { color: var(--text-hi); background: var(--panel); text-decoration: none; }
.navsec li a.cur {
  color: var(--gold-hi); background: linear-gradient(90deg, rgba(200, 168, 75, .13), transparent);
  box-shadow: inset 2px 0 0 var(--gold); font-weight: 600;
}

main { min-width: 0; padding: 26px clamp(18px, 3.4vw, 46px) 60px; }
.doc { max-width: 1120px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.crumbs i { color: var(--dim); font-style: normal; }
.crumbs b { color: var(--gold); font-weight: 600; }

.doc h1 {
  margin: 0 0 6px; font-size: clamp(27px, 4vw, 38px); line-height: 1.16; letter-spacing: -.01em;
  color: var(--text-hi); font-weight: 700;
}
.doc h1::after {
  content: ''; display: block; width: 58px; height: 2px; margin-top: 14px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.lede { color: var(--muted); font-size: 16px; margin: 14px 0 26px; max-width: 72ch; }

.doc h2 {
  margin: 44px 0 12px; font-size: 22px; color: var(--gold-hi); font-weight: 650; letter-spacing: -.005em;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.doc h3 { margin: 30px 0 10px; font-size: 17px; color: var(--text-hi); font-weight: 650; }
.doc h4 { margin: 22px 0 8px; font-size: 15px; color: var(--gold); font-weight: 650; }
.doc h2 .anchor, .doc h3 .anchor, .doc h4 .anchor {
  margin-left: 8px; color: var(--line-hi); font-weight: 400; opacity: 0; transition: .15s; font-size: .8em;
}
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc h4:hover .anchor { opacity: 1; color: var(--gold-dim); }
.doc h2 .anchor:hover, .doc h3 .anchor:hover { text-decoration: none; color: var(--gold); }

.doc p { margin: 0 0 14px; max-width: 78ch; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 22px; max-width: 78ch; }
.doc li { margin: 5px 0; }
.doc li::marker { color: var(--gold-dim); }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
.doc strong { color: var(--text-hi); font-weight: 650; }
.doc blockquote {
  margin: 18px 0; padding: 2px 16px; border-left: 3px solid var(--gold-dim);
  background: rgba(200, 168, 75, .05); color: var(--muted); border-radius: 0 6px 6px 0;
}
.doc blockquote p:last-child { margin-bottom: 0; }

code {
  font: 12.6px/1.5 var(--mono);
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 4px; color: var(--gold-hi);
  word-break: break-word;
}
code.f { background: transparent; border: 0; padding: 0; color: var(--gold-hi); }
.md-table code.f { white-space: nowrap; }
.codeblock {
  position: relative; margin: 0 0 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); overflow: hidden;
}
.codeblock::before {
  content: attr(data-lang); position: absolute; top: 6px; right: 10px;
  font: 10px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .1em;
}
.codeblock pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.codeblock code { background: none; border: 0; padding: 0; color: var(--text); font-size: 12.8px; }

/* ── tabelas ──────────────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--rad); background: var(--panel); }
.md-table { width: 100%; border-collapse: collapse; font-size: 13.2px; }
.md-table th, .md-table td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.md-table thead th {
  background: var(--panel-2); color: var(--gold);
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  white-space: nowrap; border-bottom: 1px solid var(--line-hi);
}
/* tabelas de dados: corpo rolável com cabeçalho preso no topo da própria caixa */
.dt .tbl-wrap { max-height: 76vh; overflow: auto; }
.dt .md-table thead th { position: sticky; top: 0; z-index: 2; }
.md-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .012); }
.md-table tbody tr:hover { background: rgba(91, 143, 214, .09); }
.md-table tbody tr:last-child td { border-bottom: 0; }
.md-table td { color: var(--text); }

.dt-table thead th { padding: 0; }
.sortbtn {
  width: 100%; display: flex; align-items: center; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 9px 12px;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left;
}
.sortbtn:hover { color: var(--gold-hi); background: rgba(200, 168, 75, .07); }
.sarrow::after { content: '⇅'; font-size: 10px; color: var(--line-hi); }
th[data-dir="asc"] .sarrow::after { content: '▲'; color: var(--gold); font-size: 8px; }
th[data-dir="desc"] .sarrow::after { content: '▼'; color: var(--gold); font-size: 8px; }

.dt { margin: 0 0 22px; }
.dt-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.dt-filter { position: relative; flex: 1 1 240px; max-width: 340px; }
.dt-filter input {
  width: 100%; height: 32px; padding: 0 10px 0 30px;
  background: var(--panel); color: var(--text-hi);
  border: 1px solid var(--line-hi); border-radius: 16px; font: 13px var(--sans);
}
.dt-filter input:focus { border-color: var(--gold-dim); }
.dt-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 14px; }
.dt-count { font-size: 12px; color: var(--muted); }
.dt-empty { color: var(--muted); font-size: 13px; padding: 10px 2px; }

.iname { color: var(--text-hi); font-weight: 600; display: block; }
.iid { display: block; font-style: normal; font-size: 10.5px; color: var(--dim); font-family: var(--mono); }
.dim { color: var(--dim); }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 10px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  background: var(--panel-2); border: 1px solid var(--line-hi); color: var(--muted);
  white-space: nowrap;
}
.tag.ok { color: var(--ok); border-color: rgba(111, 174, 106, .4); }
.tag.dmg { color: var(--dmg); border-color: rgba(201, 106, 90, .4); }
.tag.sup { color: var(--blue); border-color: var(--blue-dim); }
.tag.sock { color: #b083d6; border-color: #5d3f79; }
.tag.anc { color: var(--gold); border-color: var(--gold-dim); }
.tag.ev { color: var(--gold-hi); border-color: var(--gold-dim); background: rgba(200, 168, 75, .08); }
.tag.it { color: var(--text); font-weight: 400; margin: 1px 0; }
.tag.map { color: var(--blue); }
.tag.map:hover { color: var(--gold-hi); text-decoration: none; border-color: var(--gold-dim); }
.clsl { display: inline-flex; flex-wrap: wrap; gap: 0 6px; font-family: var(--mono); font-size: 10.5px; font-weight: 600; }
.clsl i { font-style: normal; }
.tag.g1 { color: var(--ok); } .tag.g2 { color: var(--blue); } .tag.g3 { color: var(--gold); }
.c-DW { color: #8fa7e0; } .c-DK { color: #d08a7a; } .c-FE { color: #7fc9a0; }
.c-MG { color: #c79ad8; } .c-DL { color: var(--gold); } .c-SU { color: #d88fb8; } .c-RF { color: #d3a06a; }

details.inl { display: inline; }
details.inl summary {
  display: inline-block; cursor: pointer; list-style: none;
  font-size: 10.5px; color: var(--blue); border: 1px dashed var(--blue-dim); border-radius: 10px; padding: 0 7px;
}
details.inl summary::-webkit-details-marker { display: none; }
details.inl > div { margin-top: 6px; }

/* ── blocos de destaque ───────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0 0 24px; }
.stats.wide { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 34px; }
.stat {
  background: linear-gradient(160deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--rad); padding: 12px 14px;
}
.stat b { display: block; color: var(--gold-hi); font-size: 21px; line-height: 1.2; font-weight: 700; }
.stat span { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }

.callout {
  display: flex; gap: 12px; margin: 0 0 20px; padding: 12px 15px;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--blue);
  border-radius: 0 var(--rad) var(--rad) 0; font-size: 13.6px;
}
.callout b { flex: none; color: var(--blue); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; padding-top: 3px; }
.callout div { min-width: 0; }
.callout.warn { border-left-color: var(--dmg); } .callout.warn b { color: var(--dmg); }
.callout.src { border-left-color: var(--gold-dim); } .callout.src b { color: var(--gold); }
.srcref { font-size: 12px; color: var(--dim); margin-top: 26px; padding-top: 12px; border-top: 1px dashed var(--line); }
.srcref code { font-size: 11.4px; color: var(--muted); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 52px; }
.pg {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 15px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad);
}
.pg:hover { border-color: var(--gold-dim); text-decoration: none; }
.pg span { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.pg b { color: var(--text-hi); font-size: 14px; font-weight: 600; }
.pg.next { text-align: right; }

/* ── sumário lateral ──────────────────────────────────────────────────────── */
.toc {
  position: sticky; top: calc(var(--h-top) + 26px + env(safe-area-inset-top, 0px));
  max-height: calc(100vh - var(--h-top) - 50px); overflow-y: auto;
  width: var(--w-toc); padding: 0 18px 30px 6px; font-size: 12.8px;
}
.toc-t { color: var(--gold); font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase; margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 10px; color: var(--muted); line-height: 1.4; border-left: 2px solid transparent; margin-left: -1px; }
.toc li.l3 a { padding-left: 22px; font-size: 12.2px; }
.toc li a:hover { color: var(--text-hi); text-decoration: none; }
.toc li a.on { color: var(--gold-hi); border-left-color: var(--gold); }

/* ── início ───────────────────────────────────────────────────────────────── */
.is-home main { padding-top: 34px; }
.is-home .doc { max-width: 1060px; }
.is-home .doc h1 { display: none; }
.hero { margin-bottom: 34px; }
.hero .kick { color: var(--gold); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; margin: 0 0 8px; }
.hero h2 {
  margin: 0 0 12px; border: 0; padding: 0;
  font-size: clamp(28px, 5vw, 46px); line-height: 1.1; letter-spacing: -.02em;
  color: var(--text-hi); font-weight: 700;
}
.hero p { color: var(--muted); font-size: 16px; max-width: 64ch; }
.hbtns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

.hgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 14px; }
.hcard {
  background: linear-gradient(165deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--rad); padding: 16px 18px 14px;
  transition: border-color .16s;
}
.hcard:hover { border-color: var(--line-hi); }
.hcard h2 {
  margin: 0 0 10px; padding: 0 0 8px; font-size: 12px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--gold); border-bottom: 1px solid var(--line);
}
.hcard ul { list-style: none; margin: 0; padding: 0; }
.hcard li { margin: 0 0 8px; }
.hcard li a { color: var(--text-hi); font-size: 14px; font-weight: 600; }
.hcard li span { display: block; color: var(--muted); font-size: 12.2px; line-height: 1.45; }
.hcard .more { margin: 6px 0 0; font-size: 12px; color: var(--dim); }

/* ── rodapé ───────────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); background: var(--bg-2); padding: 30px clamp(18px, 4vw, 48px) calc(34px + env(safe-area-inset-bottom, 0px)); }
.fin { display: flex; flex-wrap: wrap; gap: 18px 34px; align-items: center; justify-content: space-between; max-width: 1240px; margin: 0 auto; }
.fbrand { display: flex; align-items: center; gap: 10px; color: var(--gold); }
.fbrand b { color: var(--text-hi); font-size: 14px; }
.fbrand span { color: var(--dim); font-size: 12px; font-family: var(--mono); }
.flinks { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13.4px; }
.fnote { max-width: 1240px; margin: 18px auto 0; color: var(--dim); font-size: 11.8px; }

.totop {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line-hi); color: var(--gold);
  font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  transform: translateY(8px);
}
.totop.on { opacity: 1; pointer-events: auto; transform: none; }
.totop:hover { border-color: var(--gold); background: var(--panel-2); }

.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(4, 5, 8, .68); backdrop-filter: blur(2px); }

/* ── celular ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --h-top: 54px; }
  .burger { display: flex; }
  .bt i { display: none; }
  .tlinks .ghost { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; top: calc(var(--h-top) + env(safe-area-inset-top, 0px)); left: 0; z-index: 58;
    width: min(84vw, 320px); height: calc(100vh - var(--h-top));
    background: var(--bg-2); transform: translateX(-102%); transition: transform .2s ease;
    box-shadow: 14px 0 40px rgba(0, 0, 0, .55);
  }
  .side.open { transform: none; }
  main { padding: 20px 16px 44px; }
  .doc h2 { margin-top: 34px; font-size: 20px; }
  .dt .tbl-wrap { max-height: none; overflow: auto hidden; }
  .dt .md-table thead th { position: static; }
  .md-table th, .md-table td { padding: 7px 10px; font-size: 12.6px; }
  .pager { grid-template-columns: 1fr; }
  .search { max-width: none; }
  .search kbd { display: none; }
  .fin { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .brand .bt { display: none; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
  .stat b { font-size: 18px; }
  .hero h2 { font-size: 27px; }
  .doc h1 { font-size: 25px; }
}

@media print {
  .top, .side, .toc, .totop, .pager, .foot, .dt-bar { display: none !important; }
  body { background: #fff; color: #000; }
  .shell { display: block; padding: 0; }
}

/* ── seletor de idioma no topo ─────────────────────────────────────────── */
.langs { display: flex; align-items: center; gap: 2px; flex: none; }
.langs a {
  padding: 4px 7px; border: 1px solid transparent; border-radius: 6px;
  color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em;
  transition: color .15s, border-color .15s, background .15s;
}
.langs a:hover { color: var(--gold-hi); text-decoration: none; }
.langs a.cur { color: var(--gold-hi); border-color: rgba(200, 168, 75, .4); background: rgba(200, 168, 75, .08); }

@media (max-width: 560px) { .langs a { padding: 4px 5px; font-size: 10.5px; } }
