/* ==========================================================================
   Dagyan Intelligence — Native Multi-Device Stylesheet (Desktop / Tablet / Mobile)
   ========================================================================== */

:root, [data-theme="dark"] {
    --bg-main: #090a0f;
    --bg-card: #11131a;
    --bg-nested: #171a24;
    --bg-nav: rgba(9, 10, 15, 0.92);
    --border-base: #222634;
    --border-accent: #32384d;
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #6b7280;
    --brand-blue: #2563eb;
    --brand-blue-hover: #1d4ed8;
    --brand-blue-soft: rgba(37, 99, 235, 0.14);
    --status-crit: #ef4444;
    --status-high: #f59e0b;
    --status-mod: #10b981;
    --status-term: #6b7280;
    --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-nested: #f1f5f9;
    --bg-nav: rgba(255, 255, 255, 0.94);
    --border-base: #e2e8f0;
    --border-accent: #cbd5e1;
    --text-primary: #0f172a;
    --text-muted: #475569;
    --text-dark: #64748b;
    --brand-blue: #1d4ed8;
    --brand-blue-hover: #1e40af;
    --brand-blue-soft: rgba(29, 78, 216, 0.08);
    --status-crit: #dc2626;
    --status-high: #d97706;
    --status-mod: #059669;
    --status-term: #475569;
    --shadow-card: 0 2px 12px rgba(15, 23, 42, 0.06);
}

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

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body { display: flex; flex-direction: column; overflow-x: hidden; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* ==========================================================================
   Top Navigation & Native Controls
   ========================================================================== */
.site-nav {
    border-bottom: 1px solid var(--border-base);
    background-color: var(--bg-nav);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 64px;
}

.nav-wrapper { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.brand-anchor { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-primary); flex-shrink: 0; }
.brand-text { font-weight: 800; letter-spacing: -0.02em; font-size: 15px; }

.nav-links-center { display: flex; align-items: center; gap: 20px; }
.nav-utilities { display: flex; align-items: center; gap: 10px; }

.nav-link {
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    padding: 6px 4px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link.active { border-bottom-color: var(--brand-blue); }

/* Explicitly override default browser button backgrounds */
.btn-util {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--bg-nested) !important;
    border: 1px solid var(--border-accent) !important;
    color: var(--text-primary) !important;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-util:hover { border-color: var(--brand-blue) !important; color: var(--brand-blue) !important; }

.btn-portal {
    appearance: none;
    -webkit-appearance: none;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-accent);
    background-color: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.btn-portal:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.btn-portal.active { background-color: var(--brand-blue); border-color: var(--brand-blue); color: #ffffff; }

.btn-api {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--bg-nested);
    border: 1px solid var(--border-accent);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.btn-api:hover { border-color: var(--brand-blue); color: var(--brand-blue); }

/* Override legacy width: 100% rule from old dagyan.css */
.btn-action {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    padding: 12px 26px;
    border-radius: 6px;
    cursor: pointer;
    background-color: var(--brand-blue);
    color: #ffffff !important;
    border: 1px solid transparent;
    width: auto !important;
    margin-top: 0 !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn-action:hover { background-color: var(--brand-blue-hover); transform: translateY(-1px); }
.btn-action.w-full { width: 100% !important; }

/* ==========================================================================
   Hero & Section Layout
   ========================================================================== */
.main-content { flex-grow: 1; padding-top: 56px; padding-bottom: 64px; }

.section-hero {
    max-width: 820px;
    margin: 0 auto 56px auto;
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.section-hero h1 {
    font-size: clamp(30px, 4.2vw, 46px);
    font-weight: 800;
    margin: 0 0 16px 0;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    text-align: center !important;
}
.section-hero p {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 720px;
    margin: 0 auto 16px auto;
    text-align: center !important;
}

.hero-cta-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

.section-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-blue);
    background: var(--brand-blue-soft);
    border: 1px solid rgba(37, 99, 235, 0.2);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 14px;
}

/* ==========================================================================
   Responsive Multi-Device Grids
   ========================================================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.risk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 24px; }

.card, .snapshot-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-base);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.snapshot-card { cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; }
.snapshot-card:hover { border-color: var(--brand-blue); transform: translateY(-2px); }

.card h3, .snapshot-card h3 { font-size: 17px; font-weight: 700; margin: 0 0 10px 0; color: var(--text-primary); }
.card p, .snapshot-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin: 0; }

.risk-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-base);
    border-top-width: 3px;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-card);
}
.risk-critical { border-top-color: var(--status-crit); }
.risk-high     { border-top-color: var(--status-high); }
.risk-moderate { border-top-color: var(--brand-blue); }
.risk-terminal { border-top-color: var(--status-term); }

.risk-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; display: block; }
.risk-critical .risk-label { color: var(--status-crit); }
.risk-high .risk-label     { color: var(--status-high); }
.risk-moderate .risk-label { color: var(--brand-blue); }
.risk-terminal .risk-label { color: var(--status-term); }
.risk-card h4 { font-size: 15px; font-weight: 700; margin: 0 0 8px 0; color: var(--text-primary); }
.risk-card p { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin: 0; }

/* ==========================================================================
   Dashboard & Workspace Layout
   ========================================================================== */
.portal-layout { display: flex; min-height: calc(100vh - 64px); width: 100%; background-color: var(--bg-main); }
.portal-sidebar {
    width: 240px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-base);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    transition: width 0.2s ease;
}
.sidebar-header { padding: 18px 20px; border-bottom: 1px solid var(--border-base); display: flex; justify-content: space-between; align-items: center; }
.sidebar-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 6px; flex-grow: 1; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s ease;
}
.sidebar-link:hover { background-color: var(--bg-nested); color: var(--text-primary); }
.sidebar-link.active { background-color: var(--brand-blue-soft); color: var(--brand-blue); }

.portal-canvas { flex-grow: 1; padding: 32px; overflow-y: auto; background-color: var(--bg-main); }
.portal-panel { display: none; }
.portal-panel.active { display: block; }

/* Date Chips */
.date-chip-container { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 20px; -webkit-overflow-scrolling: touch; }
.date-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-base);
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    min-width: max-content;
    transition: all 0.15s ease;
}
.date-chip:hover { border-color: var(--brand-blue); }
.date-chip.active { background: var(--brand-blue-soft); border-color: var(--brand-blue); }
.date-chip.sandbox-locked { opacity: 0.65; border-style: dashed; }
.date-chip .chip-lbl { font-size: 10px; font-weight: 700; color: var(--text-muted); display: block; margin-bottom: 2px; text-transform: uppercase; }
.date-chip.active .chip-lbl { color: var(--brand-blue); }
.date-chip .chip-val { font-size: 14px; font-weight: 700; color: var(--text-primary); }

/* KPI & Ledger Cards */
.kpi-card { background: var(--bg-card); border: 1px solid var(--border-base); border-radius: 8px; padding: 18px; box-shadow: var(--shadow-card); }
.kpi-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; margin-bottom: 6px; }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--text-primary); }

.badge { display: inline-block; padding: 3px 8px; font-size: 11px; font-weight: 700; border-radius: 4px; text-transform: uppercase; }
.badge.CRITICAL { background-color: rgba(239, 68, 68, 0.12); color: var(--status-crit); }
.badge.HIGH     { background-color: rgba(245, 158, 11, 0.12); color: var(--status-high); }
.badge.MODERATE { background-color: rgba(16, 185, 129, 0.12); color: var(--status-mod); }
.badge.TERMINAL { background-color: rgba(107, 114, 128, 0.15); color: var(--status-term); }

.ledger-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.ledger-card-item {
    background: var(--bg-card);
    border: 1px solid var(--border-base);
    border-left-width: 3px;
    border-radius: 8px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-card);
}
.ledger-card-item.CRITICAL { border-left-color: var(--status-crit); }
.ledger-card-item.HIGH     { border-left-color: var(--status-high); }
.ledger-card-item.MODERATE { border-left-color: var(--status-mod); }
.ledger-card-item.TERMINAL { border-left-color: var(--status-term); }

.ledger-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ledger-card-entity { font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.35; }
.ledger-card-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 12px; color: var(--text-muted); }
.ledger-card-details strong { color: var(--text-primary); font-weight: 600; }
.ledger-card-footer { border-top: 1px solid var(--border-base); padding-top: 12px; margin-top: auto; }

/* Inputs & Tables */
.input-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: 6px; }
.input-field, select.matrix-select {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-accent);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    padding: 10px 12px;
    outline: none;
}
.input-field:focus, select.matrix-select:focus { border-color: var(--brand-blue); }
select.matrix-select { width: auto; cursor: pointer; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.data-table th { background: var(--bg-nested); border-bottom: 1px solid var(--border-base); padding: 12px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-base); color: var(--text-primary); }

/* Pagination */
.pagination-container { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; background: var(--bg-card); padding: 14px 20px; border-radius: 8px; border: 1px solid var(--border-base); flex-wrap: wrap; gap: 12px; }
.pagination-info { font-size: 12px; color: var(--text-muted); }
.pagination-controls { display: flex; gap: 8px; align-items: center; }
.btn-page { background: var(--bg-nested); border: 1px solid var(--border-accent); color: var(--text-primary); padding: 8px 16px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-page:disabled { opacity: 0.4; cursor: not-allowed; }

/* Modals */
.modal-layer { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); z-index: 10000; display: none; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-layer.active { display: flex !important; }
.modal-surface { background: var(--bg-card); border: 1px solid var(--border-accent); border-radius: 10px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 32px; position: relative; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); }
.modal-close { position: absolute; top: 16px; right: 20px; background: none; border: none; color: var(--text-muted); font-size: 26px; cursor: pointer; }

.form-group { margin-bottom: 16px; text-align: left; }
.form-group-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.link-inline { font-size: 12px; color: var(--brand-blue); text-decoration: none; }
.sso-divider { display: flex; align-items: center; text-align: center; color: var(--text-muted); font-size: 11px; text-transform: uppercase; margin: 18px 0; }
.sso-divider::before, .sso-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border-base); }
.sso-divider:not(:empty)::before { margin-right: 12px; }
.sso-divider:not(:empty)::after { margin-left: 12px; }
.sso-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.btn-sso { background-color: var(--bg-nested); border: 1px solid var(--border-accent); border-radius: 6px; padding: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn-sso:hover { border-color: var(--brand-blue); }
.sso-svg { width: 18px; height: 18px; }
.error-alert { color: var(--status-crit); font-size: 12px; margin-top: 12px; background: rgba(239, 68, 68, 0.1); padding: 10px; border-radius: 6px; }

.view-section { display: none !important; }
.view-section.active { display: block !important; }

.site-footer { margin-top: auto; padding: 24px 0; background: var(--bg-card); border-top: 1px solid var(--border-base); }
.footer-wrapper { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-meta { font-size: 12px; color: var(--text-muted); }
.footer-legal { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-legal a { font-size: 12px; color: var(--text-muted); text-decoration: none; }
.footer-legal a:hover { color: var(--text-primary); }

/* Mobile Bottom Navigation Dock (Hidden on Desktop & Tablet) */
.native-mobile-dock { display: none; }

/* ==========================================================================
   DYNAMIC DEVICE ADAPTATION 1: TABLET VIEW (768px – 1024px or [data-device="tablet"])
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .container { padding: 0 20px; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .risk-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .portal-layout { flex-direction: column; }
    .portal-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-base);
        flex-direction: row;
        align-items: center;
        padding: 8px 16px;
    }
    .sidebar-header { border-bottom: none; padding: 0 16px 0 0; }
    .sidebar-nav { flex-direction: row; overflow-x: auto; padding: 0; gap: 8px; }
    .sidebar-footer-wrap { display: none; }
    .portal-canvas { padding: 24px 20px; }
    .btn-util, .btn-portal, .btn-action { min-height: 40px; }
}

/* ==========================================================================
   DYNAMIC DEVICE ADAPTATION 2: MOBILE NATIVE VIEW (< 768px or [data-device="mobile"])
   ========================================================================== */
@media (max-width: 767px) {
    body { padding-bottom: 74px; }
    .container { padding: 0 16px; }
    .site-nav { height: 56px; }
    .nav-links-center { display: none !important; }
    .brand-text { font-size: 14px; }
    .btn-util { padding: 6px 10px; font-size: 11px; }
    .btn-portal { padding: 6px 12px; font-size: 12px; }

    .main-content { padding-top: 28px; padding-bottom: 40px; }
    .section-hero { margin-bottom: 36px; }
    .section-hero h1 { font-size: 28px; }
    .section-hero p { font-size: 14px; }
    .hero-cta-group { flex-direction: column; width: 100%; }
    .hero-cta-group .btn-action,
    .hero-cta-group .btn-portal { width: 100% !important; justify-content: center; padding: 14px; }

    .grid-2, .grid-3, .risk-grid, .ledger-cards-grid { grid-template-columns: 1fr !important; gap: 14px; }

    .portal-layout { flex-direction: column; min-height: auto; }
    .portal-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-base);
    }
    .sidebar-header { display: none; }
    .sidebar-nav { flex-direction: row; overflow-x: auto; padding: 10px 12px; gap: 6px; }
    .sidebar-link { white-space: nowrap; padding: 8px 12px; font-size: 12px; }
    .sidebar-footer-wrap { display: none; }
    .portal-canvas { padding: 16px 14px; }

    .modal-layer { align-items: flex-end; padding: 0; }
    .modal-surface { border-radius: 16px 16px 0 0; max-height: 88vh; padding: 24px 18px; }

    .native-mobile-dock {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        padding-bottom: env(safe-area-inset-bottom);
        background-color: var(--bg-nav);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border-base);
        z-index: 9500;
    }
    .mobile-dock-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        flex: 1;
        height: 100%;
    }
    .mobile-dock-item svg { width: 20px; height: 20px; }
    .mobile-dock-item.active { color: var(--brand-blue); }
}

/* ==========================================================================
   Multi-Document Hub Layout (General Risk / UI Guide / REST API / Python SDK)
   ========================================================================== */
.docs-hub-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 32px;
    align-items: start;
}

.docs-sidebar {
    position: sticky;
    top: 88px;
    background: var(--bg-card);
    border: 1px solid var(--border-base);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-card);
}

.docs-sidebar-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 6px 10px;
}

.docs-tab-btn {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    text-align: left;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
    width: 100%;
}

.docs-tab-btn:hover {
    background: var(--bg-nested);
    color: var(--text-primary);
}

.docs-tab-btn.active {
    background: var(--brand-blue-soft);
    border-color: rgba(37, 99, 235, 0.28);
    color: var(--brand-blue);
    font-weight: 700;
}

.docs-doc-panel {
    display: none;
    flex-direction: column;
    gap: 24px;
}

.docs-doc-panel.active {
    display: flex;
}

.method-badge {
    display: inline-block;
    font-family: monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.method-badge.get {
    background: rgba(16, 185, 129, 0.14);
    color: var(--status-mod);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.method-badge.post {
    background: rgba(37, 99, 235, 0.14);
    color: var(--brand-blue);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.code-snippet-box {
    background: var(--bg-nested);
    border: 1px solid var(--border-base);
    border-radius: 6px;
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-primary);
    overflow-x: auto;
    position: relative;
    margin: 0;
}

.step-number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand-blue-soft);
    color: var(--brand-blue);
    font-size: 12px;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .docs-hub-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .docs-sidebar {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        padding: 8px;
        gap: 8px;
    }
    .docs-sidebar-label {
        display: none;
    }
    .docs-tab-btn {
        width: auto;
        white-space: nowrap;
        padding: 8px 14px;
    }
}

/* ==========================================================================
   Clean Thin Scrollbar for 10-Day Vault Bar (Fixes White Scrollbar)
   ========================================================================== */
.date-chip-container {
    scrollbar-width: thin;
    scrollbar-color: var(--border-accent) transparent;
}
.date-chip-container::-webkit-scrollbar {
    height: 5px;
}
.date-chip-container::-webkit-scrollbar-track {
    background: transparent;
}
.date-chip-container::-webkit-scrollbar-thumb {
    background-color: var(--border-accent);
    border-radius: 4px;
}

/* ==========================================================================
   Locked Visual UI Preview Frames (Inside Documentation Tab 2)
   ========================================================================== */
.doc-step-split {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 24px;
    align-items: center;
}
@media (max-width: 900px) {
    .doc-step-split {
        grid-template-columns: 1fr;
    }
}

.doc-ui-preview-frame {
    background: var(--bg-main);
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12), var(--shadow-card);
    position: relative;
}

.doc-ui-preview-header {
    background: var(--bg-nested);
    border-bottom: 1px solid var(--border-base);
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--brand-blue);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.doc-ui-preview-body {
    padding: 14px;
    font-size: 11px;
}

.mini-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.mini-box {
    background: var(--bg-card);
    border: 1px solid var(--border-base);
    border-radius: 5px;
    padding: 8px;
}

/* ==========================================================================
   Interactive Visual Platform Tour (Spotlight & Floating Stepper)
   ========================================================================== */
.tour-highlight-active {
    position: relative !important;
    z-index: 9805 !important;
    box-shadow: 0 0 0 3px var(--brand-blue), 0 0 0 8px rgba(37, 99, 235, 0.25), 0 12px 32px rgba(0, 0, 0, 0.5) !important;
    border-radius: 8px !important;
    transition: box-shadow 0.25s ease !important;
}

#platform-tour-card {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 390px;
    max-width: calc(100vw - 32px);
    background: var(--bg-card);
    border: 2px solid var(--brand-blue);
    border-radius: 10px;
    padding: 22px;
    z-index: 9900;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65);
    display: none;
}

#platform-tour-card.active {
    display: block;
    animation: tourSlideUp 0.22s ease-out;
}

@keyframes tourSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.btn-tour-trigger {
    background: var(--brand-blue-soft) !important;
    border: 1px solid rgba(37, 99, 235, 0.4) !important;
    color: var(--brand-blue) !important;
}
.btn-tour-trigger:hover {
    background: var(--brand-blue) !important;
    color: #ffffff !important;
}