:root {
    --bg: #06080e;
    --bg-sidebar: #080c14;
    --bg-code: #0b0f18;
    --bg-code-hdr: #101620;
    --bg-card: #0e1219;
    --bg-elevated: #131a23;
    --border: rgba(255, 255, 255, 0.07);
    --border-soft: rgba(255, 255, 255, 0.04);
    --text: #dde5f0;
    --text-soft: #6a7e99;
    --text-muted: #364557;
    --primary: #25d366;
    --primary-dim: rgba(37, 211, 102, 0.09);
    --primary-border: rgba(37, 211, 102, 0.22);
    --accent: #4188f0;
    --accent-dim: rgba(65, 136, 240, 0.09);
    --accent-border: rgba(65, 136, 240, 0.22);
    --amber: #e8993a;
    --amber-dim: rgba(232, 153, 58, 0.09);
    --amber-border: rgba(232, 153, 58, 0.22);
    --sidebar-width: 272px;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --font-head: 'Figtree', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    height: 100dvh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.sidebar-top {
    flex-shrink: 0;
    padding: 1.75rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg-sidebar);
}

.sidebar-nav-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem 2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.sidebar-nav-wrap::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    margin-bottom: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.sidebar-logo:hover {
    background: rgba(255, 255, 255, 0.03);
}

.logo-badge {
    width: 34px;
    height: 34px;
    background: var(--primary-dim);
    border: 1px solid var(--primary-border);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.05rem;
    flex-shrink: 0;
    transition: background 0.15s;
}

.sidebar-logo:hover .logo-badge {
    background: rgba(37, 211, 102, 0.14);
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-name {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.logo-tag {
    font-family: var(--font-mono);
    font-size: 0.67rem;
    color: var(--text-muted);
    line-height: 1;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nav-group-title {
    font-family: var(--font-head);
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.3rem;
    margin-top: 1.75rem;
    padding: 0 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.475rem 0.75rem;
    text-decoration: none;
    color: var(--text-soft);
    font-size: 0.815rem;
    font-weight: 400;
    border-radius: var(--radius-sm);
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: all 0.14s ease;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
    color: var(--text);
    background: var(--primary-dim);
    border-left-color: var(--primary);
    font-weight: 500;
}

.nav-link i {
    width: 14px;
    text-align: center;
    font-size: 0.775rem;
    color: var(--text-muted);
    transition: color 0.14s;
    flex-shrink: 0;
}

.nav-link:hover i {
    color: var(--text-soft);
}

.nav-link.active i {
    color: var(--primary);
}

/* ===== Main ===== */
.main-content {
    flex: 1;
    min-width: 0;
    position: relative;
}

.bg-glow {
    position: fixed;
    top: -180px;
    right: -120px;
    width: 640px;
    height: 640px;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.042) 0%, transparent 68%);
    pointer-events: none;
    z-index: 0;
}

header.top-bar {
    background: rgba(6, 8, 14, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-soft);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
    flex-shrink: 0;
}

.hamburger:hover {
    color: var(--text);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 190;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
}

.top-bar-title {
    font-family: var(--font-mono);
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.9rem;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.14s;
    flex-shrink: 0;
    white-space: nowrap;
}

.back-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.13);
}

.content-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
    animation: fadeUp 0.45s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    margin-bottom: 5rem;
    scroll-margin-top: 110px;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 1.5rem;
    font-weight: 700;
    color: var(--text);
}

h1 {
    font-family: var(--font-head);
    font-size: 2.4rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.intro-lead {
    color: var(--text-soft);
    font-size: 1rem;
    margin: 0 0 3.5rem;
    max-width: 100%;
    line-height: 1.75;
}

h2 {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 4rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.015em;
}

h2 i {
    color: var(--primary);
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.88;
}

h3 {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 2.5rem;
    letter-spacing: -0.008em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

h4 {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2rem;
    margin-bottom: 0.875rem;
}

.section-intro {
    font-size: 0.9rem;
    margin-bottom: 2rem;
    max-width: 100%;
    color: var(--text-soft);
}

.api-method-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.api-method-header h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.api-method-header p {
    margin: 0;
    font-size: 0.85rem;
}

p {
    margin: 1.25rem 0;
    color: var(--text-soft);
}

code {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.86em;
    color: #b5c8e2;
    border: 1px solid rgba(255, 255, 255, 0.09);
}

/* ===== Code Window ===== */
.code-wrapper {
    margin: 1.75rem 0;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
}

.code-header {
    background: var(--bg-code-hdr);
    padding: 0.7rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.code-dots span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: block;
}

.dot-red {
    background: #ff5f57;
}

.dot-yellow {
    background: #ffbd2e;
}

.dot-green {
    background: #28c840;
}

.code-title {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.69rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-btn {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: var(--text-muted);
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    font-size: 0.69rem;
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.14s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.15);
}

.copy-btn.copied {
    background: var(--primary-dim);
    border-color: var(--primary-border);
    color: var(--primary);
}

pre {
    padding: 1.4rem 1.5rem;
    overflow-x: auto;
    margin: 0;
}

pre code {
    border: none;
    background: none;
    padding: 0;
    color: #c4d4e8;
    line-height: 1.75;
    font-size: 0.845rem;
}

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.75rem 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

th,
td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

td {
    color: var(--text-soft);
    font-size: 0.9rem;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background 0.12s;
}

tbody tr:hover td {
    background: rgba(255, 255, 255, 0.018);
    color: var(--text);
}

ul,
ol {
    margin: 1.25rem 0 1.25rem 1.5rem;
    color: var(--text-soft);
}

li {
    margin-bottom: 0.6rem;
    padding-left: 0.35rem;
}

/* ===== Method Tag ===== */
.method-tag {
    display: inline-block;
    padding: 0.18rem 0.52rem;
    border-radius: 5px;
    font-size: 0.67rem;
    font-weight: 700;
    margin-right: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
}

.method-post {
    background: rgba(59, 130, 246, 0.12);
    color: #7ab8fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.method-get {
    background: rgba(37, 211, 102, 0.10);
    color: #25d366;
    border: 1px solid rgba(37, 211, 102, 0.22);
}

.method-delete {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.22);
}

/* ===== Hints / Callouts ===== */
.hint {
    padding: 1.1rem 1.25rem;
    background: var(--primary-dim);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius);
    margin: 1.75rem 0;
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.7;
}

.hint strong {
    color: var(--primary);
}

.hint p {
    margin: 0.4rem 0 0;
    color: inherit;
    font-size: inherit;
}

.hint-warning {
    background: var(--amber-dim);
    border-color: var(--amber-border);
}

.hint-warning strong {
    color: var(--amber);
}

.hint-info {
    background: var(--accent-dim);
    border-color: var(--accent-border);
}

.hint-info strong {
    color: var(--accent);
}

/* ===== Facebook Steps ===== */
.fb-step {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin-bottom: 1.75rem;
}

.fb-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-dim);
    border: 1px solid var(--primary-border);
    color: var(--primary);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.fb-step-body {
    flex: 1;
}

.fb-step-body strong {
    color: var(--text);
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.92rem;
}

.fb-step-body p {
    margin: 0.3rem 0 0;
    font-size: 0.86rem;
}

.fb-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #6baef5;
    font-family: var(--font-mono);
    font-size: 0.77rem;
    word-break: break-all;
    text-decoration: none;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    transition: background 0.14s;
}

.fb-link:hover {
    background: rgba(65, 136, 240, 0.15);
}

/* ===== Price Cards ===== */
.price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.price-card {
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.price-card.marketing {
    background: rgba(139, 92, 246, 0.07);
    border-color: rgba(139, 92, 246, 0.22);
}

.price-card.utility {
    background: var(--primary-dim);
    border-color: var(--primary-border);
}

.price-card-label {
    font-family: var(--font-head);
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.price-card.marketing .price-card-label {
    color: #a78bfa;
}

.price-card.utility .price-card-label {
    color: var(--primary);
}

.price-value {
    font-family: var(--font-head);
    font-size: 2.25rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.price-desc {
    font-size: 0.78rem;
    color: var(--text-soft);
}

/* ===== Window Cards ===== */
.window-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.window-card {
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.window-card.w24 {
    background: var(--accent-dim);
    border-color: var(--accent-border);
}

.window-card.w72 {
    background: var(--amber-dim);
    border-color: var(--amber-border);
}

.window-card-title {
    font-family: var(--font-head);
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    letter-spacing: -0.03em;
}

.window-card.w24 .window-card-title {
    color: #6baef5;
}

.window-card.w72 .window-card-title {
    color: var(--amber);
}

.window-card-sub {
    font-family: var(--font-head);
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.875rem;
}

.window-card.w24 .window-card-sub {
    color: #93c5fd;
}

.window-card.w72 .window-card-sub {
    color: #fcd34d;
}

.window-card p {
    margin: 0;
    font-size: 0.85rem;
}

/* ===== Search ===== */
.search-container {
    position: relative;
    margin-top: 0.5rem;
}

.search-container input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.48rem 0.75rem 0.48rem 2.15rem;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.8rem;
    outline: none;
    transition: all 0.15s;
}

.search-container input::placeholder {
    color: var(--text-muted);
}

.search-container input:focus {
    border-color: var(--primary-border);
    background: rgba(37, 211, 102, 0.04);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.06);
}

.search-container .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.75rem;
    pointer-events: none;
    transition: color 0.15s;
}

.search-container input:focus+.search-icon {
    color: var(--primary);
}

#searchClear {
    position: absolute;
    right: 2.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px;
    display: none;
    /* Managed by JS */
    transition: color 0.15s;
}

#searchClear:hover {
    color: var(--text-soft);
}

.search-kbd {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 1px 6px;
    pointer-events: none;
}

.search-container input:focus~.search-kbd {
    display: none;
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.72rem;
    pointer-events: none;
}

.sidebar-search .search-clear {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    display: none;
    line-height: 1;
    transition: color 0.13s;
}

.sidebar-search .search-clear:hover {
    color: var(--text);
}

.sidebar-search input:not(:placeholder-shown)~.search-clear {
    display: block;
}

.nav-link.search-hidden {
    display: none;
}

.nav-group-title.search-hidden {
    display: none;
}

.search-no-results {
    display: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
    padding: 1rem 0;
}

.nav-link mark {
    background: rgba(37, 211, 102, 0.25);
    color: var(--primary);
    border-radius: 2px;
    padding: 0 1px;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100dvh;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 200;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
    }

    .content-body {
        padding: 2rem 1.5rem;
    }

    header.top-bar {
        padding: 0.75rem 1.25rem;
    }

    h1 {
        font-size: 1.85rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    h3 {
        font-size: 1rem;
        flex-wrap: wrap;
    }

    .price-grid,
    .window-grid {
        grid-template-columns: 1fr;
    }

    .code-wrapper {
        border-radius: 10px;
    }

    pre {
        padding: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    pre code {
        font-size: 0.78rem;
    }

    .code-title {
        display: none;
    }

    .copy-btn {
        font-size: 0.68rem;
        padding: 0.18rem 0.5rem;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .back-link span {
        display: none;
    }

    .fb-link {
        font-size: 0.72rem;
    }

    .price-value {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .content-body {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 1.55rem;
    }

    .method-tag {
        font-size: 0.62rem;
    }

    .fb-step {
        gap: 0.85rem;
    }

    .fb-step-num {
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
    }
}