/* ═══════════════════════════════════════════════════════════
   WarnX Docs — docs.css
   Dark, professional, Stripe/Vercel-inspired documentation
═══════════════════════════════════════════════════════════ */

/* ── Fonts & Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Colors */
    --bg:           #0a0b0d;
    --bg-card:      #111318;
    --bg-hover:     #16191f;
    --bg-elevated:  #1a1d24;
    --border:       #1f2330;
    --border-light: #252a38;

    --text:         #e4e8f0;
    --text-muted:   #7a8399;
    --text-subtle:  #4a5268;

    --accent:       #f97316;
    --accent-dim:   rgba(249, 115, 22, 0.12);
    --accent-glow:  rgba(249, 115, 22, 0.25);

    --blue:         #3b82f6;
    --green:        #22c55e;
    --yellow:       #eab308;
    --red:          #ef4444;
    --purple:       #a855f7;

    /* Sizes */
    --sidebar-w:    260px;
    --toc-w:        220px;
    --topbar-h:     56px;
    --content-max:  780px;

    /* Typography */
    --font-sans:    'Vazirmatn', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

    /* Radii */
    --radius-sm:    4px;
    --radius:       8px;
    --radius-lg:    12px;
}

html { scroll-behavior: smooth; font-size: 15px; }

body {
    font-family: var(--font-sans);
    background:  var(--bg);
    color:       var(--text);
    line-height: 1.7;
    direction:   rtl;
    -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }

/* ── Selection ── */
::selection { background: var(--accent-dim); color: var(--accent); }

/* ═══════════════════════════════
   TOPBAR
═══════════════════════════════ */
.topbar {
    position: fixed;
    top: 0; right: 0; left: 0;
    height: var(--topbar-h);
    background: rgba(10, 11, 13, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    padding: 0 24px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.3px;
    transition: opacity 0.15s;
}
.brand-logo:hover { opacity: 0.8; }

.brand-name { color: var(--text); }

.brand-divider {
    color: var(--text-subtle);
    font-size: 18px;
    font-weight: 300;
}

.brand-section {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* Search trigger */
.topbar-search { flex: 1; display: flex; justify-content: center; }

.search-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 14px;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    max-width: 380px;
    transition: border-color 0.15s, background 0.15s;
    direction: rtl;
}
.search-trigger:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
    color: var(--text);
}
.search-trigger span { flex: 1; text-align: right; }
.search-trigger kbd {
    font-family: var(--font-sans);
    font-size: 11px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    color: var(--text-subtle);
}

/* Topbar links */
.topbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.topbar-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}
.topbar-link:hover { color: var(--text); background: var(--bg-hover); }

.topbar-cta {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius);
    transition: opacity 0.15s, transform 0.15s;
    white-space: nowrap;
}
.topbar-cta:hover { opacity: 0.9; transform: translateY(-1px); }

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-right: auto;
}
.mobile-menu-btn span {
    display: block;
    width: 20px; height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: all 0.2s;
}

/* ═══════════════════════════════
   LAYOUT SHELL
═══════════════════════════════ */
.docs-shell {
    display: flex;
    margin-top: var(--topbar-h);
    min-height: calc(100vh - var(--topbar-h));
}

/* ═══════════════════════════════
   SIDEBAR
═══════════════════════════════ */
.docs-sidebar {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--topbar-h));
    border-left: 1px solid var(--border);
    overflow-y: auto;
    z-index: 50;
    background: var(--bg);
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px 0 24px;
}

.sidebar-header { padding: 0 20px 12px; }

.sidebar-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.sidebar-nav { flex: 1; overflow-y: auto; }

.nav-group { margin-bottom: 6px; }

.nav-group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subtle);
    padding: 12px 20px 4px;
}

.nav-list { list-style: none; }

.nav-item {
    display: block;
    font-size: 13.5px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 20px;
    border-radius: 0;
    transition: color 0.12s, background 0.12s;
    border-right: 2px solid transparent;
    margin: 1px 0;
}
.nav-item:hover {
    color: var(--text);
    background: var(--bg-hover);
}
.nav-item.active {
    color: var(--accent);
    border-right-color: var(--accent);
    background: var(--accent-dim);
    font-weight: 500;
}

.sidebar-footer {
    padding: 16px 20px 0;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.sidebar-footer-link:hover { color: var(--text); }

/* ═══════════════════════════════
   MAIN CONTENT
═══════════════════════════════ */
.docs-main {
    margin-right: var(--sidebar-w);
    margin-left: var(--toc-w);
    flex: 1;
    min-width: 0;
}

.docs-content {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 48px 40px 80px;
}

/* ═══════════════════════════════
   TABLE OF CONTENTS (RIGHT RAIL)
═══════════════════════════════ */
.docs-toc {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: var(--toc-w);
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    padding: 32px 0;
    border-right: 1px solid var(--border);
}

.toc-inner { padding: 0 20px; }

.toc-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-bottom: 12px;
}

.toc-nav { display: flex; flex-direction: column; gap: 2px; }

.toc-link {
    display: block;
    font-size: 12.5px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border-right: 2px solid transparent;
    transition: color 0.12s, border-color 0.12s;
    line-height: 1.5;
}
.toc-link:hover { color: var(--text); }
.toc-link.active {
    color: var(--accent);
    border-right-color: var(--accent);
}
.toc-link.toc-h3 { padding-right: 20px; font-size: 12px; }

/* ═══════════════════════════════
   DOC HEADER
═══════════════════════════════ */
.doc-header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.doc-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.doc-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(249,115,22,0.3);
    padding: 2px 10px;
    border-radius: 99px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.doc-version, .doc-updated, .doc-reading {
    font-size: 12px;
    color: var(--text-subtle);
}
.doc-version { font-family: var(--font-mono); }

.doc-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.doc-lead {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 24px;
    max-width: 640px;
}

/* ═══════════════════════════════
   SECTIONS
═══════════════════════════════ */
.doc-section {
    margin-bottom: 56px;
    scroll-margin-top: calc(var(--topbar-h) + 24px);
}

.doc-section h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: calc(var(--topbar-h) + 24px);
}

.doc-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 12px;
    scroll-margin-top: calc(var(--topbar-h) + 24px);
}

.doc-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 16px 0 8px;
}

.doc-section p {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 14px;
}

.doc-section ol, .doc-section ul:not(.nav-list) {
    padding-right: 22px;
    margin-bottom: 14px;
}
.doc-section li {
    font-size: 14.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.7;
}

code:not(.endpoint-url) {
    font-family: var(--font-mono);
    font-size: 12.5px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    color: #e2a97e;
}

.doc-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}
.doc-link:hover { border-bottom-color: var(--accent); }

/* ═══════════════════════════════
   CALLOUTS
═══════════════════════════════ */
.doc-callout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: 13.5px;
    line-height: 1.65;
    margin: 20px 0;
}
.doc-callout svg { flex-shrink: 0; margin-top: 2px; }
.doc-callout strong { display: block; margin-bottom: 2px; }

.callout-info {
    background: rgba(59, 130, 246, 0.07);
    border-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}
.callout-info svg { color: #3b82f6; }

.callout-warning {
    background: rgba(234, 179, 8, 0.07);
    border-color: rgba(234, 179, 8, 0.25);
    color: #fcd34d;
}
.callout-warning svg { color: #eab308; }

.callout-tip {
    background: rgba(34, 197, 94, 0.07);
    border-color: rgba(34, 197, 94, 0.2);
    color: #86efac;
}
.callout-tip svg { color: #22c55e; }

/* ═══════════════════════════════
   FLOW DIAGRAM
═══════════════════════════════ */
.flow-diagram {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    margin: 20px 0;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    text-align: center;
}
.flow-icon { font-size: 22px; }
.flow-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    max-width: 80px;
    line-height: 1.3;
    text-align: center;
}
.flow-step--highlight .flow-label { color: var(--accent); font-weight: 600; }

.flow-arrow { color: var(--text-subtle); font-size: 16px; flex-shrink: 0; }

/* ═══════════════════════════════
   STEP LISTS
═══════════════════════════════ */
.steps-list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }

.step-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.step-num {
    width: 26px; height: 26px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: var(--accent);
    flex-shrink: 0;
}
.step-body strong { display: block; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.step-body p { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ═══════════════════════════════
   GUARANTEES GRID
═══════════════════════════════ */
.guarantees-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.guarantee-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color 0.15s;
}
.guarantee-card:hover { border-color: var(--border-light); }
.guarantee-icon { font-size: 20px; display: block; margin-bottom: 6px; }
.guarantee-card strong { display: block; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.guarantee-card p { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* ═══════════════════════════════
   CODE BLOCKS
═══════════════════════════════ */
.code-block {
    background: #0d0f14;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 16px 0;
    direction: ltr;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.code-lang, .code-filename {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-subtle);
    letter-spacing: 0.05em;
}
.code-filename { color: var(--text-muted); }

.copy-btn {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 2px 10px;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s;
    direction: rtl;
}
.copy-btn:hover { color: var(--text); border-color: var(--text-subtle); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

.code-block pre {
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    color: #b8c4d4;
    direction: ltr;
    text-align: left;
}

.code-block pre code { background: none; border: none; padding: 0; font-size: inherit; color: inherit; }

/* Syntax highlights */
.code-block .key   { color: #79b8ff; }
.code-block .str   { color: #9ecbff; }
.code-block .num   { color: #f8c555; }
.code-block .bool  { color: #f97583; }
.code-block .comment { color: #4a5268; font-style: italic; }

/* ═══════════════════════════════
   CODE GROUPS (tabbed)
═══════════════════════════════ */
.code-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 16px 0;
}

.code-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 4px;
    direction: rtl;
    overflow-x: auto;
    gap: 2px;
}

.code-tab {
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 14px 8px;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s;
    white-space: nowrap;
    flex-shrink: 0;
}
.code-tab:hover { color: var(--text); }
.code-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.code-panel { display: none; }
.code-panel.active { display: block; }

.code-group .code-block {
    border: none;
    border-radius: 0;
    margin: 0;
}

/* ═══════════════════════════════
   TABLES
═══════════════════════════════ */
.table-wrap { overflow-x: auto; margin: 16px 0; }

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.doc-table th {
    text-align: right;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}
.doc-table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    vertical-align: top;
    line-height: 1.55;
}
.doc-table tr:hover td { background: var(--bg-hover); }

/* ═══════════════════════════════
   FIELDS TABLE
═══════════════════════════════ */
.fields-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 16px 0;
}

.field-row {
    display: grid;
    grid-template-columns: 160px 70px 90px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    direction: rtl;
}
.field-row:last-child { border-bottom: none; }
.field-row:hover { background: var(--bg-hover); }

.field-name { font-family: var(--font-mono); font-size: 12.5px; color: #79b8ff; }
.field-type { font-family: var(--font-mono); font-size: 11px; color: var(--text-subtle); }
.field-desc { color: var(--text-muted); }

.field-req {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    text-align: center;
    letter-spacing: 0.03em;
}
.req-yes  { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.req-rec  { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.req-opt  { background: var(--bg-elevated);    color: var(--text-subtle); border: 1px solid var(--border); }

/* ═══════════════════════════════
   ENDPOINT BADGE
═══════════════════════════════ */
.endpoint-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 16px 0;
    direction: ltr;
}

.method-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}
.method-post { background: rgba(249,115,22,0.15); color: var(--accent); border: 1px solid rgba(249,115,22,0.3); }
.method-get  { background: rgba(34,197,94,0.12);  color: #4ade80;       border: 1px solid rgba(34,197,94,0.25); }

.endpoint-url {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    background: none;
    border: none;
    padding: 0;
}

/* ═══════════════════════════════
   SETUP STEPS
═══════════════════════════════ */
.setup-steps {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 16px 0;
}
.setup-path {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-subtle);
    background: var(--bg-elevated);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    margin: 8px 0 12px;
    direction: ltr;
    text-align: left;
}
.vars-list { display: flex; flex-direction: column; gap: 6px; }
.var-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.var-item code { background: none; border: none; padding: 0; color: #79b8ff; font-size: 13px; }
.var-item span { color: var(--text-muted); }

/* ═══════════════════════════════
   NUMBERED STEPS
═══════════════════════════════ */
.numbered-steps {
    list-style: decimal;
    padding-right: 24px;
    color: var(--text-muted);
    font-size: 14.5px;
}
.numbered-steps li { padding: 4px 0; line-height: 1.65; }
.numbered-steps li strong { color: var(--text); }

/* ═══════════════════════════════
   BADGE TABLES (risk/action)
═══════════════════════════════ */
.badge-table { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.badge-row { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: var(--text-muted); }

.risk-badge, .action-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 99px;
    flex-shrink: 0;
    letter-spacing: 0.05em;
    min-width: 90px;
    text-align: center;
}
.risk-high   { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.risk-medium { background: rgba(234,179,8,0.12);  color: #fbbf24; border: 1px solid rgba(234,179,8,0.25); }
.risk-low    { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }

.action-pentest { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.action-suggest { background: rgba(234,179,8,0.12);  color: #fbbf24; border: 1px solid rgba(234,179,8,0.25); }
.action-none    { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }

/* ═══════════════════════════════
   HTTP CODE BADGES
═══════════════════════════════ */
.http-code {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
}
.http-2xx  { background: rgba(34,197,94,0.12);  color: #4ade80; }
.http-4xx  { background: rgba(239,68,68,0.12);  color: #f87171; }
.http-5xx  { background: rgba(168,85,247,0.12); color: #c084fc; }
.http-info { background: rgba(59,130,246,0.12); color: #60a5fa; }

/* ═══════════════════════════════
   FAQ
═══════════════════════════════ */
.faq-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.15s;
}
.faq-item:hover { border-color: var(--border-light); }
.faq-item[open] { border-color: var(--border-light); }

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    font-size: 18px;
    color: var(--text-subtle);
    transition: transform 0.2s;
    font-weight: 300;
}
.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item p {
    padding: 0 16px 14px;
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* ═══════════════════════════════
   DOC FOOTER
═══════════════════════════════ */
.doc-footer {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.doc-footer-nav {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 16px;
}
.doc-footer-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    transition: opacity 0.15s, transform 0.15s;
}
.doc-footer-cta:hover { opacity: 0.9; transform: translateY(-1px); }
.doc-footer-note { font-size: 13px; color: var(--text-subtle); }

/* ═══════════════════════════════
   SEARCH MODAL
═══════════════════════════════ */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}
.search-modal.open { display: flex; }

.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.search-box {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 560px;
    max-width: calc(100vw - 32px);
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    overflow: hidden;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    direction: rtl;
}
.search-input-wrap svg { color: var(--text-subtle); flex-shrink: 0; }
#searchInput {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text);
    direction: rtl;
}
#searchInput::placeholder { color: var(--text-subtle); }
.search-esc {
    font-size: 11px;
    font-family: var(--font-sans);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    color: var(--text-subtle);
    cursor: pointer;
    flex-shrink: 0;
}

.search-results { max-height: 380px; overflow-y: auto; padding: 8px; }

.search-hint {
    font-size: 13px;
    color: var(--text-subtle);
    text-align: center;
    padding: 24px;
    margin: 0;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: background 0.1s;
    cursor: pointer;
}
.search-result-item:hover { background: var(--bg-hover); }
.search-result-label { font-size: 14px; font-weight: 500; }
.search-result-group { font-size: 12px; color: var(--text-subtle); }

/* ═══════════════════════════════
   RESPONSIVE
═══════════════════════════════ */
@media (max-width: 1200px) {
    .docs-toc { display: none; }
    .docs-main { margin-left: 0; }
}

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

    .docs-sidebar {
        transform: translateX(100%);
        transition: transform 0.25s ease;
        width: 280px;
        box-shadow: -8px 0 32px rgba(0,0,0,0.4);
        z-index: 80;
    }
    .docs-sidebar.open { transform: translateX(0); }

    .docs-main { margin-right: 0; }
    .docs-content { padding: 32px 20px 60px; }

    .mobile-menu-btn { display: flex; }
    .topbar-links { display: none; }
    .topbar-search { display: none; }
    .doc-title { font-size: 1.5rem; }
    .guarantees-grid { grid-template-columns: 1fr; }
    .flow-diagram { flex-wrap: wrap; justify-content: center; }
    .field-row { grid-template-columns: 1fr 1fr; }
    .field-desc { grid-column: 1 / -1; }
}

/* ═══════════════════════════════
   ANIMATIONS
═══════════════════════════════ */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.doc-header, .doc-section {
    animation: fadeSlideIn 0.35s ease both;
}
.doc-section:nth-child(2) { animation-delay: 0.05s; }
.doc-section:nth-child(3) { animation-delay: 0.08s; }
