 :root {
        --bg: #0f172a;
        --bg-soft: #1e293b;
        --card: #ffffff;
        --ink: #1e293b;
        --ink-soft: #475569;
        --brand: #7c3aed;
        --brand-soft: #ede9fe;
        --accent: #0ea5e9;
        --ok: #16a34a;
        --warn: #ea580c;
        --code-bg: #0f172a;
        --code-ink: #e2e8f0;
        --border: #e2e8f0;
        --radius: 14px;
    }

    * { box-sizing: border-box; }

    body {
        margin: 0;
        font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
        color: var(--ink);
        background: #f1f5f9;
        line-height: 1.65;
    }

    .wrap {
        max-width: 860px;
        margin: 0 auto;
        padding: 0 20px 80px;
    }

    header.hero {
        color: #fff;
        background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
        padding: 56px 0 36px;
        text-align: center;
    }

    header.hero .wrap {
        padding-bottom: 0;
    }

    header.hero .badge {
        display: inline-block;
        background: rgba(255, 255, 255, 0.12);
        border: 1px solid rgba(255, 255, 255, 0.25);
        color: #e9d5ff;
        padding: 6px 14px;
        border-radius: 999px;
        font-size: 0.8rem;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        margin-bottom: 18px;
    }

    header.hero h1 {
        font-size: 2.1rem;
        margin: 0 0 12px;
        line-height: 1.25;
    }

    header.hero p {
        max-width: 620px;
        margin: 0 auto;
        color: #cbd5e1;
        font-size: 1.05rem;
    }

    .card {
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 28px 30px;
        margin: 22px 0;
        box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.45);
    }

    main.wrap .card:first-child {
        margin-top: 24px;
    }

    h2 {
        font-size: 1.5rem;
        margin: 6px 0 14px;
        color: var(--ink);
    }

    h2 .num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 10px;
        background: var(--brand-soft);
        color: var(--brand);
        font-size: 1rem;
        margin-right: 10px;
        vertical-align: middle;
    }

    h3 {
        font-size: 1.1rem;
        margin: 22px 0 8px;
        color: var(--brand);
    }

    p { margin: 10px 0; color: var(--ink-soft); }
    p strong { color: var(--ink); }

    /* blocos de código */
    pre {
        background: var(--code-bg);
        color: var(--code-ink);
        padding: 20px;
        border-radius: 12px;
        overflow-x: auto;
        font-size: 0.9rem;
        line-height: 1.6;
        margin: 14px 0;
    }
    pre code {
        font-family: "Cascadia Code", "Fira Code", Consolas, "Courier New", monospace;
    }
    code.inline {
        background: #f1f5f9;
        border: 1px solid var(--border);
        padding: 1px 6px;
        border-radius: 6px;
        font-family: "Cascadia Code", Consolas, monospace;
        font-size: 0.9em;
        color: var(--brand);
    }

    /* caixa de destaque */
    .tip, .warn-box, .flow {
        border-left: 4px solid var(--accent);
        background: #f0f9ff;
        border-radius: 0 10px 10px 0;
        padding: 14px 18px;
        margin: 16px 0;
    }
    .tip strong { color: var(--accent); }
    .warn-box {
        border-left-color: var(--warn);
        background: #fff7ed;
    }
    .warn-box strong { color: var(--warn); }

    /* fluxo entrada/processo/saida */
    .pipeline {
        display: grid;
        grid-template-columns: 1fr auto 1fr auto 1fr;
        align-items: center;
        gap: 10px;
        margin: 18px 0;
        text-align: center;
    }
    .pipeline .step {
        background: var(--brand-soft);
        border: 1px solid #3a325d;
        border-radius: 12px;
        padding: 14px 10px;
    }
    .pipeline .step b { display: block; color: var(--brand); font-size: 1rem; }
    .pipeline .step span { font-size: 0.85rem; color: var(--ink-soft); }
    .pipeline .arrow { font-size: 1.6rem; color: var(--brand); }
    @media (max-width: 640px) {
        .pipeline { grid-template-columns: 1fr; }
        .pipeline .arrow { transform: rotate(90deg); }
    }

    /* tabela de gatilhos */
    table {
        width: 100%;
        border-collapse: collapse;
        margin: 16px 0;
        font-size: 0.95rem;
    }
    th, td {
        text-align: left;
        padding: 10px 12px;
        border-bottom: 1px solid var(--border);
    }
    th { background: #f8fafc; color: var(--ink); }
    td code { color: var(--brand); font-weight: 600; }

    /* lista numerada da receita */
    ol.recipe { counter-reset: step; list-style: none; padding: 0; }
    ol.recipe li {
        position: relative;
        padding: 10px 10px 10px 52px;
        margin: 8px 0;
        background: #f8fafc;
        border: 1px solid var(--border);
        border-radius: 10px;
    }
    ol.recipe li::before {
        counter-increment: step;
        content: counter(step);
        position: absolute;
        left: 12px; top: 50%;
        transform: translateY(-50%);
        width: 28px; height: 28px;
        background: var(--brand);
        color: #fff;
        border-radius: 8px;
        display: flex; align-items: center; justify-content: center;
        font-weight: 700;
        font-size: 0.9rem;
    }

    footer {
        text-align: center;
        color: #94a3b8;
        font-size: 0.85rem;
        margin-top: 40px;
        line-height: 1.8;
    }
    footer a {
        color: var(--brand);
        font-weight: 600;
        text-decoration: none;
    }
    footer a:hover { text-decoration: underline; }

    .toc {
        background: rgba(255,255,255,0.10);
        border: 1px solid rgba(255,255,255,0.22);
        border-radius: 12px;
        padding: 16px 20px;
        margin: 24px auto 0;
        max-width: 620px;
        text-align: left;
    }
    .toc span { color: #e9d5ff; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; }
    .toc a { color: #f8fafc; text-decoration: none; display: inline-block; margin: 4px 14px 4px 0; font-size: 0.92rem; }
    .toc a:hover { text-decoration: underline; color: #e9d5ff; }