/* ======================================================================
   guide.css - Clean docs-style guide page.
   Same visual language as commands.css, daily.css, market.css and
   leaderboard.css. Hairline separators, no heavy cards, eyebrow + title
   pattern, FAQ accordion. Uses .gd-* namespace so StatsPage's legacy
   .guide-* styles in styles.css stay untouched.
   ====================================================================== */

.gd-page {
    --gd-max: 1120px;
    --gd-read: 64ch;
    --gd-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --gd-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --gd-pos: #22c55e;
    --gd-neg: #ef4444;

    font-family: var(--gd-font);
    color: var(--text);
    line-height: 1.6;
    margin: 0 calc(50% - 50vw);
    width: 100vw;
    overflow-x: clip;
    padding: 0 0 64px;
}

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

.gd-page a { color: inherit; text-decoration: none; }

.gd-shell {
    max-width: var(--gd-max);
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 720px) {
    .gd-shell { padding: 0 20px; }
}

/* ======================================================================
   Header (compact docs-style)
   ====================================================================== */

.gd-header {
    padding: clamp(40px, 5vw, 56px) 0 clamp(24px, 3vw, 32px);
    border-bottom: 1px solid var(--border);
    max-width: 720px;
}

.gd-eyebrow {
    display: inline-block;
    font-family: var(--gd-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 14px;
    line-height: 1;
}

.gd-header h1 {
    font-family: var(--gd-font);
    font-weight: 700;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0 0 14px;
    text-wrap: balance;
}

.gd-lead {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    max-width: 38em;
}

/* ======================================================================
   Table of contents (compact pill list)
   ====================================================================== */

.gd-toc {
    padding: 24px 0 16px;
    max-width: var(--gd-read);
}

.gd-toc-label {
    margin: 0 0 10px;
    font-family: var(--gd-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.gd-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gd-toc li { margin: 0; }

.gd-toc a {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    transition: color 0.15s ease-out, border-color 0.15s ease-out, background 0.15s ease-out;
}

.gd-toc a:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--text) 25%, var(--border));
    background: color-mix(in srgb, var(--text) 3%, transparent);
}

/* ======================================================================
   Pill hint just below TOC
   ====================================================================== */

.gd-tip {
    max-width: var(--gd-read);
    padding: 14px 16px;
    margin: 0 0 8px;
    border-left: 2px solid color-mix(in srgb, var(--accent) 60%, var(--border));
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.gd-tip strong { color: var(--text); font-weight: 600; }

.gd-tip .cmd-mention {
    font-family: var(--gd-mono);
}

/* ======================================================================
   Section block (eyebrow + title + body, hairline separator)
   ====================================================================== */

.gd-section {
    padding: 40px 0 0;
    scroll-margin-top: 24px;
}

.gd-section + .gd-section { padding-top: 36px; }

.gd-section-eyebrow {
    margin: 0;
    font-family: var(--gd-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.gd-section-title {
    font-family: var(--gd-font);
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--text);
    margin: 6px 0 0;
    text-wrap: balance;
}

.gd-section-sub {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 14px 0 0;
    max-width: var(--gd-read);
}

.gd-section-sub a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.gd-section-sub a:hover { color: var(--accent-hover); }

.gd-section-sub strong { color: var(--text); font-weight: 600; }

.gd-section-sub .cmd-mention { font-family: var(--gd-mono); }

.gd-subhead {
    margin: 28px 0 12px;
    font-family: var(--gd-font);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
}

/* ======================================================================
   Prose paragraph (inside sections)
   ====================================================================== */

.gd-prose {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 14px 0 0;
    max-width: var(--gd-read);
}

.gd-prose strong { color: var(--text); font-weight: 600; }

.gd-prose a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.gd-prose a:hover { color: var(--accent-hover); }

.gd-prose .cmd-mention { font-family: var(--gd-mono); }

/* ======================================================================
   Numbered steps (hairline rows)
   ====================================================================== */

.gd-steps {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    counter-reset: gd-step;
    border-top: 1px solid var(--border);
    max-width: 720px;
}

.gd-steps li {
    counter-increment: gd-step;
    position: relative;
    padding: 16px 4px 16px 46px;
    border-bottom: 1px solid var(--border);
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.gd-steps li::before {
    content: counter(gd-step, decimal-leading-zero);
    position: absolute;
    left: 4px;
    top: 18px;
    font-family: var(--gd-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.06em;
    line-height: 1.4;
}

.gd-steps li strong {
    color: var(--text);
    font-weight: 600;
}

.gd-steps li .cmd-mention { font-family: var(--gd-mono); }

.gd-steps li a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.gd-steps li a:hover { color: var(--accent-hover); }

/* ======================================================================
   Plain checklist (hairline rows, no numbering)
   ====================================================================== */

.gd-checklist {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    border-top: 1px solid var(--border);
    max-width: 720px;
}

.gd-checklist li {
    padding: 14px 4px;
    border-bottom: 1px solid var(--border);
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.gd-checklist li strong {
    color: var(--text);
    font-weight: 600;
}

.gd-checklist li .cmd-mention { font-family: var(--gd-mono); }

.gd-checklist li a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.gd-checklist li a:hover { color: var(--accent-hover); }

/* ======================================================================
   Two-column split (Ganhar / Gastar) - hairline columns
   ====================================================================== */

.gd-split {
    margin: 18px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    max-width: 880px;
}

.gd-split-col-title {
    margin: 0 0 4px;
    font-family: var(--gd-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.gd-split-col-title.positive { color: var(--gd-pos); }
.gd-split-col-title.negative { color: var(--gd-neg); }

.gd-split-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gd-split-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.gd-split-list li:last-child { border-bottom: 0; }

.gd-split-list li strong {
    color: var(--text);
    font-weight: 600;
}

.gd-split-list li .cmd-mention { font-family: var(--gd-mono); }

@media (max-width: 720px) {
    .gd-split { grid-template-columns: 1fr; gap: 12px; }
}

/* ======================================================================
   Command list (override .guide-cmd-row from cmdRow helper)
   ====================================================================== */

.gd-page .gd-cmd-list {
    margin: 18px 0 0;
    border-top: 1px solid var(--border);
    max-width: 720px;
}

.gd-page .gd-cmd-list .guide-cmd-row {
    display: grid;
    grid-template-columns: minmax(140px, max-content) 1fr;
    gap: 18px;
    align-items: baseline;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
    background: transparent;
    margin: 0;
}

.gd-page .gd-cmd-list .guide-cmd-row .cmd-mention {
    font-family: var(--gd-mono);
    align-self: start;
    margin: 0;
}

.gd-page .gd-cmd-list .guide-cmd-desc {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0;
}

@media (max-width: 540px) {
    .gd-page .gd-cmd-list .guide-cmd-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* ======================================================================
   Tier table (hairline grid)
   ====================================================================== */

.gd-tier-table {
    margin: 18px 0 0;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    max-width: 720px;
    font-size: 14px;
}

.gd-tier-row {
    display: contents;
}

.gd-tier-row > span {
    padding: 11px 14px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.gd-tier-row > span:first-child {
    color: var(--text);
    font-weight: 600;
}

.gd-tier-row.gd-tier-head > span {
    font-family: var(--gd-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--text) 3%, transparent);
}

.gd-fineprint {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    max-width: var(--gd-read);
    line-height: 1.6;
}

/* ======================================================================
   Stats grid (4 stat definition rows, dl-style)
   ====================================================================== */

.gd-stats-grid {
    margin: 18px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    max-width: 880px;
}

.gd-stat {
    padding: 16px 18px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gd-stat-name {
    font-family: var(--gd-font);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.005em;
}

.gd-stat-desc {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

@media (max-width: 720px) {
    .gd-stats-grid { grid-template-columns: 1fr; }
}

/* ======================================================================
   FAQ accordion (mirrors leaderboard/market FAQ)
   Used for guide details (sócios/empregos, empréstimos/falência etc.)
   ====================================================================== */

.gd-faq-list {
    max-width: 720px;
    margin: 18px 0 0;
    display: flex;
    flex-direction: column;
}

.gd-faq-item { border-top: 1px solid var(--border); }
.gd-faq-item:last-of-type { border-bottom: 1px solid var(--border); }

.gd-faq-q {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.005em;
    line-height: 1.4;
    transition: color 0.15s ease-out;
}

.gd-faq-q::-webkit-details-marker { display: none; }
.gd-faq-q:hover { color: var(--accent); }
.gd-faq-q:hover .gd-faq-icon { color: var(--accent); }

.gd-faq-q-text { text-wrap: balance; }

.gd-faq-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease-out, color 0.15s ease-out;
}

.gd-faq-item[open] .gd-faq-icon {
    transform: rotate(45deg);
    color: var(--accent);
}

.gd-faq-a {
    padding: 0 4px 18px;
    display: grid;
    gap: 10px;
}

.gd-faq-a p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0;
    max-width: 62ch;
}

.gd-faq-a strong { color: var(--text); font-weight: 600; }

.gd-faq-a .cmd-mention { font-family: var(--gd-mono); }

.gd-faq-a a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.gd-faq-a a:hover { color: var(--accent-hover); }

/* ======================================================================
   Premium plans (hairline rows with icon + content)
   ====================================================================== */

.gd-plans {
    margin: 18px 0 0;
    border-top: 1px solid var(--border);
    max-width: 720px;
}

.gd-plan {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 18px;
    align-items: center;
    padding: 18px 4px;
    border-bottom: 1px solid var(--border);
}

.gd-plan-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    align-self: center;
}

.gd-plan-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.gd-plan-name {
    font-family: var(--gd-font);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.005em;
    margin: 0;
}

.gd-plan-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

@media (max-width: 540px) {
    .gd-plan {
        grid-template-columns: 40px 1fr;
        gap: 14px;
    }
    .gd-plan-icon { width: 36px; height: 36px; }
}

/* ======================================================================
   Outro callout
   ====================================================================== */

.gd-outro {
    margin-top: 48px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    max-width: 720px;
}

.gd-outro p {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0;
    max-width: 62ch;
}

.gd-outro a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.gd-outro a:hover { color: var(--accent-hover); }

/* ======================================================================
   Virtual notice override (so it inherits the docs gap rhythm)
   ====================================================================== */

.gd-page .virtual-notice { margin: 18px 0 0; max-width: 720px; }
