:root {
    --bg: #0d0d0d;
    --surface: #151515;
    --line: #262626;
    --text: #f2f2f2;
    --body: #bdbdbd;
    --muted: #8a8a8a;
    --accent: #ff2d9b;
    --accent-soft: rgba(255, 45, 155, 0.12);
    --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 24px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--body);
    font-family: 'Quicksand', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 17px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ff5cb2; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--header-h);
    background: rgba(13, 13, 13, 0.86);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.site-header__inner {
    max-width: 1120px;
    height: 100%;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand img {
    width: 36px;
    height: 36px;
    padding: 3px;
    border-radius: 50%;
    background: #fff;
}
.langs { display: flex; gap: 4px; }
.lang {
    display: inline-block;
    min-width: 38px;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}
.lang:hover { color: var(--text); background: var(--surface); }
.lang.is-current { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

/* Page */
.page { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.hero {
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 0 32px;
}
.hero h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(32px, 6vw, 48px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.updated {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}
.updated::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--accent);
    vertical-align: 1px;
}

.layout { display: block; }

/* TOC */
.toc {
    max-width: 760px;
    margin: 0 auto 40px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}
.toc summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 18px;
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg) translateY(-3px);
    transition: transform .2s ease;
}
.toc[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.toc__label { display: none; }
.toc nav { padding: 0 18px 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
    display: flex;
    gap: 10px;
    padding: 7px 0;
    color: var(--body);
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none;
}
.toc a::before {
    content: counter(toc, decimal-leading-zero);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    padding-top: 2px;
    font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--accent); }
.toc a.is-active::before { color: var(--accent); }

/* Document */
.doc { max-width: 760px; margin: 0 auto; counter-reset: sec; }

.doc .summary {
    margin: 0 0 48px;
    padding: 22px 24px;
    border-radius: 14px;
    background: var(--accent-soft);
    border: 1px solid rgba(255, 45, 155, 0.28);
}
.doc .summary h2 { margin: 0 0 8px; font-size: 18px; }
.doc .summary h2::before { content: none; }
.doc .summary ul { margin: 0; }
.doc .summary p:last-child, .doc .summary ul:last-child { margin-bottom: 0; }

.doc section[id] {
    counter-increment: sec;
    padding: 0 0 36px;
    margin: 0 0 36px;
    border-bottom: 1px solid var(--line);
}
.doc section[id]:last-of-type { border-bottom: 0; }

.doc h2 {
    margin: 0 0 16px;
    color: var(--text);
    font-size: 24px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.doc section[id] > h2::before {
    content: counter(sec) ".";
    color: var(--accent);
    margin-right: 10px;
    font-variant-numeric: tabular-nums;
}
.doc h3 {
    margin: 28px 0 8px;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}
.doc p { margin: 0 0 16px; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 22px; }
.doc li { margin: 0 0 8px; padding-left: 4px; }
.doc li::marker { color: var(--accent); }
.doc strong { color: var(--text); font-weight: 700; }
.doc a[href^="https://wa.me"] { white-space: nowrap; }

.doc .note {
    margin: 0 0 16px;
    padding: 14px 18px;
    border-left: 3px solid var(--accent);
    background: var(--surface);
    border-radius: 0 10px 10px 0;
    color: var(--body);
}

.ph {
    padding: 1px 6px;
    border-radius: 6px;
    background: #2a2410;
    color: #ffd666;
    font-weight: 700;
    white-space: nowrap;
}

.table-wrap {
    margin: 0 0 20px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.doc th, .doc td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc th { color: var(--text); font-weight: 700; background: var(--surface); }
.doc tr:last-child td { border-bottom: 0; }
.doc td:first-child { color: var(--text); font-weight: 600; }

.doc-end {
    margin: 8px 0 72px;
    padding: 24px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 15px;
}
.doc-end p { margin: 0 0 12px; }
.doc-end__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin: 0 !important; font-weight: 600; }
.doc-end__links a { text-decoration: none; }

.site-footer {
    border-top: 1px solid var(--line);
    padding: 24px 16px 32px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
.site-footer a { color: var(--body); text-decoration: none; }

/* Desktop: sumário fixo ao lado do texto */
@media (min-width: 1024px) {
    .hero { max-width: none; margin: 0; padding: 72px 0 48px calc(240px + 64px); }
    .layout {
        display: grid;
        grid-template-columns: 240px minmax(0, 760px);
        gap: 64px;
        align-items: start;
    }
    .toc-wrap { position: sticky; top: calc(var(--header-h) + 32px); max-height: calc(100vh - var(--header-h) - 64px); overflow-y: auto; }
    .toc { margin: 0; border: 0; background: none; }
    .toc summary { display: none; }
    .toc__label {
        display: block;
        margin: 0 0 10px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }
    .toc nav { padding: 0; border-left: 1px solid var(--line); }
    .toc a { padding: 6px 0 6px 16px; margin-left: -1px; border-left: 2px solid transparent; font-size: 14px; }
    .toc a.is-active { border-left-color: var(--accent); }
    .doc { margin: 0; }
}

@media (max-width: 480px) {
    body { font-size: 16px; }
    .hero { padding: 40px 0 24px; }
    .doc h2 { font-size: 21px; }
    .doc .summary { padding: 18px; }
    .doc-end { padding: 18px; }
    .brand span { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
