/* ─────────────────────────────────────────────────────────────────────────
   linear.css — Degen Deal Parser shared dark theme
   Extraction strategy: Option B (static CSS file)
   Covers: dashboard.html (db-* classes) + deals/review family (lx-* classes)
   ───────────────────────────────────────────────────────────────────────── */

/* ══ Design tokens ════════════════════════════════════════════════════════ */
:root {
    /* Canonical palette */
    --lx-bg:    #08090a;
    --lx-s1:    #111214;
    --lx-s2:    #17181c;
    --lx-br:    rgba(255,255,255,.07);
    --lx-br2:   rgba(255,255,255,.13);
    --lx-text:  #e4e4e7;
    --lx-muted: #8b8f98;
    --lx-dim:   #52566d;
    --lx-red:   #ef4444;
    --lx-adim:  rgba(239,68,68,.15);
    --lx-live:  #22c55e;
    --lx-ldim:  rgba(34,197,94,.14);

    /* Accent palette — used by Linear theme improvement cards/pills/amounts */
    --cx-orange: #ff6a1c;
    --cx-gold:   #e0b851;
    --cx-green:  #93d6a7;

    /* Dashboard backward-compat aliases */
    --db-s1:    #111214;
    --db-s2:    #17181c;
    --db-br:    rgba(255,255,255,.07);
    --db-br2:   rgba(255,255,255,.13);
    --db-text:  #e4e4e7;
    --db-muted: #8b8f98;
    --db-dim:   #52566d;
    --db-red:   #ef4444;
    --db-adim:  rgba(239,68,68,.15);
    --db-live:  #22c55e;
    --db-ldim:  rgba(34,197,94,.14);
}

/* ══ Base reset ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }

html, body, input, button, select, textarea, table {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv02','cv03','cv04','cv11';
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
    font-feature-settings: 'cv02','cv03','cv04','cv11';
    -webkit-font-smoothing: antialiased;
    background: #08090a !important;
    color: var(--lx-text) !important;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ══ Dashboard classes (db-*) ─ kept verbatim so dashboard.html needs no ══
   ══ HTML changes ══════════════════════════════════════════════════════════ */

.page {
    max-width: 1380px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 32px 88px !important;
    position: relative;
    z-index: 1;
}

/* ══ Linear shell: sidebar + main content ═══════════════════════════════
   Sidebar is position:fixed so pages don't need layout wrappers — they keep
   their existing .page / .lx-page containers. Body gets left padding on
   desktop to make room for the sidebar. Mobile keeps bottom nav only. */

:root {
    --linear-sidebar-w: 232px;
    --linear-sidebar-w-mini: 64px;
}

.linear-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--linear-sidebar-w);
    background: #0b0c0e;
    border-right: 1px solid var(--lx-br);
    display: flex;
    flex-direction: column;
    padding: 14px 10px 10px;
    z-index: 150;
    overflow-y: auto;
    overscroll-behavior: contain;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--lx-text);
}

.linear-sidebar-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 14px;
    border-bottom: 1px solid var(--lx-br);
    margin-bottom: 10px;
}
.linear-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    color: var(--lx-text);
    text-decoration: none;
}
.linear-sidebar-logo {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--lx-br);
    background: var(--lx-s1);
}
.linear-sidebar-brand-text {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.linear-sidebar-collapse {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--lx-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.linear-sidebar-collapse:hover {
    background: var(--lx-s1);
    color: var(--lx-text);
    border-color: var(--lx-br);
}

.linear-sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}
.linear-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.linear-sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--lx-dim);
    padding: 6px 8px 4px;
}

.linear-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    color: var(--lx-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.2;
    transition: background 120ms ease, color 120ms ease;
    outline: none;
}
.linear-sidebar-item:hover {
    background: var(--lx-s1);
    color: var(--lx-text);
}
.linear-sidebar-item.is-active {
    background: var(--lx-s2);
    color: var(--lx-text);
    font-weight: 600;
}
.linear-sidebar-item:focus-visible {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.45);
}
.linear-sidebar-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: currentColor;
}
.linear-sidebar-icon svg { width: 18px; height: 18px; }
.linear-sidebar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.linear-sidebar-foot {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--lx-br);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.linear-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    color: var(--lx-text);
    min-width: 0;
}
.linear-sidebar-avatar {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: linear-gradient(135deg, #3b3f49, #1c1e22);
    color: var(--lx-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.linear-sidebar-user-text { min-width: 0; }
.linear-sidebar-user-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.linear-sidebar-user-role {
    font-size: 10px;
    color: var(--lx-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Body offset on desktop so page content doesn't sit under the sidebar.
   Use !important to win over safe-area.css @supports padding-left rules. */
@media (min-width: 1024px) {
    body:has(.linear-sidebar) { padding-left: var(--linear-sidebar-w) !important; }
}
@media (min-width: 768px) and (max-width: 1023.98px) {
    body:has(.linear-sidebar) { padding-left: var(--linear-sidebar-w-mini) !important; }
    .linear-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--linear-sidebar-w-mini);
        padding: 14px 8px 10px;
    }
    .linear-sidebar-brand-text,
    .linear-sidebar-section-label,
    .linear-sidebar-label,
    .linear-sidebar-user-text,
    .linear-sidebar-collapse { display: none; }
    .linear-sidebar-head { justify-content: center; padding: 4px 0 12px; }
    .linear-sidebar-item { justify-content: center; padding: 8px 6px; }
    .linear-sidebar-user { justify-content: center; padding: 6px; }
}
/* ── Mobile drawer defaults (hidden until JS opens them) ── */
.linear-mobile-topbar  { display: none; }
.linear-drawer-backdrop { display: none; }
.linear-drawer-close   { display: none; }

@media (max-width: 767.98px) {
    /* Ensure body never gets desktop sidebar padding on mobile */
    body:has(.linear-sidebar) { padding-left: 0 !important; }

    /* Sidebar becomes a slide-in drawer */
    .linear-sidebar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 80vw;
        max-width: 280px;
        padding-top: max(14px, env(safe-area-inset-top, 14px));
        transform: translateX(-100%) !important;
        transition: transform 220ms ease;
        z-index: 200;
    }
    body.linear-drawer-open .linear-sidebar { transform: translateX(0) !important; }
    body.linear-drawer-open { overflow: hidden; }

    /* Dimmed backdrop */
    .linear-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 199;
        opacity: 0;
        pointer-events: none;
        transition: opacity 220ms ease;
    }
    body.linear-drawer-open .linear-drawer-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    /* Close button — visible only inside the drawer on mobile */
    .linear-drawer-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 6px;
        border: 1px solid transparent;
        background: transparent;
        color: var(--lx-muted);
        cursor: pointer;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }
    .linear-drawer-close:hover {
        background: var(--lx-s1);
        color: var(--lx-text);
        border-color: var(--lx-br);
    }

    /* Hide desktop-only collapse toggle inside the drawer */
    .linear-sidebar-collapse { display: none; }

    /* Sticky mobile top bar — break out of .page's 20px top padding and 32px horizontal padding */
    .linear-mobile-topbar {
        display: flex;
        align-items: center;
        position: sticky;
        top: 0;
        z-index: 100;
        gap: 10px;
        /* pull back into viewport flush with top, spanning full width */
        margin: -20px -32px 12px;
        width: calc(100% + 64px);
        padding: max(12px, env(safe-area-inset-top, 0px) + 8px) 12px 10px;
        background: #0b0c0e;
        border-bottom: 1px solid var(--lx-br);
        -webkit-tap-highlight-color: transparent;
        box-sizing: border-box;
    }

    /* Hamburger button — !important overrides unscoped inline button{} rules on some pages */
    .linear-hamburger {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 8px !important;
        border: 1px solid transparent !important;
        background: transparent !important;
        color: var(--lx-text) !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
        -webkit-tap-highlight-color: transparent;
        padding: 0 !important;
    }
    .linear-hamburger svg {
        width: 24px !important;
        height: 24px !important;
        display: block !important;
    }
    .linear-hamburger:hover, .linear-hamburger:focus-visible {
        background: var(--lx-s1) !important;
        border-color: var(--lx-br) !important;
        outline: none;
    }

    /* Brand link inside mobile topbar */
    .linear-mobile-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        color: var(--lx-text);
        text-decoration: none;
        min-width: 0;
    }
    .linear-mobile-brand .linear-sidebar-brand-text { font-size: 14px; font-weight: 700; }
}

/* Collapsed state (user toggle on desktop) */
@media (min-width: 1024px) {
    html.linear-sidebar-collapsed body:has(.linear-sidebar) { padding-left: var(--linear-sidebar-w-mini) !important; }
    html.linear-sidebar-collapsed .linear-sidebar {
        width: var(--linear-sidebar-w-mini);
        padding: 14px 8px 10px;
    }
    html.linear-sidebar-collapsed .linear-sidebar-brand-text,
    html.linear-sidebar-collapsed .linear-sidebar-section-label,
    html.linear-sidebar-collapsed .linear-sidebar-label,
    html.linear-sidebar-collapsed .linear-sidebar-user-text { display: none; }
    html.linear-sidebar-collapsed .linear-sidebar-head { justify-content: center; padding: 4px 0 12px; }
    html.linear-sidebar-collapsed .linear-sidebar-item,
    html.linear-sidebar-collapsed .linear-sidebar-user { justify-content: center; padding: 8px 6px; }
}

.linear-main {
    display: block;
    width: 100%;
}

.db-hero {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0 24px;
}

.db-card {
    background: var(--db-s1) !important;
    border: 1px solid var(--db-br) !important;
    border-radius: 10px !important;
    padding: 18px 20px !important;
    transition: border-color 150ms ease-out;
    box-shadow: 0 1px 2px rgba(0,0,0,.3) !important;
    position: relative;
    overflow: hidden;
}
.db-card:hover { border-color: var(--db-br2) !important; }
.db-card::before,
.db-card::after { display: none !important; }

.db-ch {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 8px;
}
.db-ch h3 {
    margin: 0 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: .06em !important;
    color: var(--db-muted) !important;
    font-family: "Inter", -apple-system, sans-serif !important;
    line-height: 1.2 !important;
}
.db-ch-meta {
    font-size: 11px;
    color: var(--db-dim) !important;
    white-space: nowrap;
}

.db-big {
    font-size: 34px;
    font-weight: 700;
    color: var(--db-text) !important;
    letter-spacing: -.025em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.db-bk { margin-top: 14px; }
.db-bk-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 6px 0;
    border-top: 1px solid var(--db-br);
}
.db-bk-row:first-child { border-top: none; padding-top: 0; }
.db-bk-lbl { color: var(--db-muted) !important; }
.db-bk-val { color: var(--db-text) !important; font-variant-numeric: tabular-nums; font-weight: 500; }
.db-bk-cnt { color: var(--db-dim) !important; font-size: 11px; margin-left: 5px; }

.db-attn { list-style: none; margin: 0; padding: 0; }
.db-attn-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid var(--db-br);
    font-size: 13px;
    color: var(--db-text) !important;
    text-decoration: none;
    min-height: 36px;
}
.db-attn-row:first-child { border-top: none; padding-top: 0; }
.db-attn-lbl { color: var(--db-text) !important; font-weight: 500; font-size: 13px; }
.db-badge {
    color: var(--db-dim) !important;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    background: var(--db-s2) !important;
    border: 1px solid var(--db-br) !important;
    border-radius: 5px;
    padding: 2px 8px;
    white-space: nowrap;
    font-weight: 600;
}
.db-badge-warn {
    color: #fca5a5 !important;
    border-color: rgba(239,68,68,.28) !important;
    background: var(--db-adim) !important;
}

.db-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--db-live) !important;
    background: var(--db-ldim);
    border: 1px solid rgba(34,197,94,.22);
    border-radius: 5px;
    padding: 3px 8px;
}
.db-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--db-live);
    flex-shrink: 0;
    animation: db-pulse 2s ease-in-out infinite;
}
@keyframes db-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}
.db-off-pill { font-size: 11px; color: var(--db-dim) !important; }

.db-sdl { margin: 0; padding: 0; }
.db-sdl div {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 6px 0;
    border-top: 1px solid var(--db-br);
}
.db-sdl div:first-child { border-top: none; padding-top: 0; }
.db-sdl dt { color: var(--db-muted) !important; }
.db-sdl dd { color: var(--db-text) !important; font-weight: 500; margin: 0; font-variant-numeric: tabular-nums; }
.db-stream-ttl { font-size: 15px; font-weight: 600; color: var(--db-text) !important; margin: 0 0 12px; }
.db-offline-msg { color: var(--db-dim) !important; font-size: 13px; margin: 0; }

.db-alert {
    background: rgba(239,68,68,.09) !important;
    border: 1px solid rgba(239,68,68,.22) !important;
    border-radius: 10px;
    padding: 11px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    font-weight: 500;
    color: #fca5a5 !important;
    margin-bottom: 14px;
}
.db-alert a { color: #fca5a5 !important; text-decoration: underline; white-space: nowrap; }

.db-more { margin-top: 8px; }
.db-more-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.db-more-lbl {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--db-dim) !important;
    margin: 0;
}
.db-more-line { flex: 1; height: 1px; background: var(--db-br); }
.db-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

details.db-panel {
    background: var(--db-s1) !important;
    border: 1px solid var(--db-br) !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.3) !important;
    overflow: hidden;
}
details.db-panel::before,
details.db-panel::after { display: none !important; }
details.db-panel > summary {
    cursor: pointer;
    padding: 13px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--db-text) !important;
    list-style: none;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: border-color 150ms;
    font-family: "Inter", -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}
details.db-panel > summary::-webkit-details-marker { display: none; }
details.db-panel > summary::after {
    content: "›";
    color: var(--db-dim);
    font-size: 16px;
    line-height: 1;
    display: inline-block;
    transition: transform 150ms ease-out;
    transform: rotate(90deg);
    flex-shrink: 0;
}
details.db-panel[open] > summary { border-bottom-color: var(--db-br); }
details.db-panel[open] > summary::after { transform: rotate(-90deg); }
.db-pbody { padding: 16px 18px 18px; }

.db-wsg {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.db-wsc {
    background: var(--db-s2) !important;
    border: 1px solid var(--db-br) !important;
    border-radius: 8px;
    padding: 13px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-decoration: none;
    transition: border-color 150ms;
    min-height: 48px;
}
.db-wsc:hover { border-color: var(--db-br2) !important; }
.db-wsk {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--db-dim) !important;
}
.db-wst { font-size: 13px; font-weight: 600; color: var(--db-text) !important; margin: 0; }
.db-wsm { font-size: 12px; color: var(--db-muted) !important; margin: 0; }

.db-list { display: grid; gap: 6px; }
.db-li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--db-s2) !important;
    border: 1px solid var(--db-br) !important;
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 150ms;
    min-height: 48px;
}
.db-li:hover { border-color: var(--db-br2) !important; }
.db-li-l { min-width: 0; }
.db-li-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--db-text) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.db-li-sub { font-size: 11px; color: var(--db-muted) !important; margin-top: 2px; }
.db-li-r { text-align: right; flex-shrink: 0; }
.db-li-amt { font-size: 13px; font-weight: 600; color: var(--db-text) !important; font-variant-numeric: tabular-nums; }
.db-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,.07) !important;
    color: var(--db-muted) !important;
    display: inline-block;
    margin-top: 3px;
    font-weight: 500;
}
.db-empty { font-size: 13px; color: var(--db-dim) !important; padding: 6px 0; }

.db-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.db-pill {
    font-size: 11px;
    font-weight: 500;
    background: rgba(255,255,255,.06) !important;
    border: 1px solid var(--db-br) !important;
    border-radius: 5px;
    padding: 3px 8px;
    color: var(--db-muted) !important;
}

.db-ch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--db-br);
    font-size: 13px;
}
.db-ch-row:first-child { border-top: none; padding-top: 0; }
.db-ch-nm { font-weight: 500; color: var(--db-text) !important; }
.db-ch-cnt { font-size: 11px; color: var(--db-dim) !important; margin-top: 1px; }
.db-ch-net { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--db-text) !important; }
.db-ch-io { font-size: 11px; color: var(--db-dim) !important; }

.db-rev { padding: 8px 0; border-top: 1px solid var(--db-br); }
.db-rev:first-child { border-top: none; padding-top: 0; }
.db-rev-nm { font-size: 13px; font-weight: 500; color: var(--db-text) !important; }
.db-rev-meta { font-size: 11px; color: var(--db-muted) !important; margin-top: 2px; }
.db-rev-msg { font-size: 11px; color: var(--db-dim) !important; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.db-srch { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.db-srch input {
    flex: 1;
    min-width: 110px;
    padding: 9px 12px;
    background: var(--db-s2) !important;
    border: 1px solid var(--db-br) !important;
    border-radius: 8px;
    font-size: 13px;
    color: var(--db-text) !important;
    min-height: 44px;
    font-family: "Inter", -apple-system, sans-serif;
}
.db-srch input:focus { border-color: var(--db-br2) !important; outline: none; }
.db-srch-btn {
    padding: 9px 16px;
    min-height: 44px;
    min-width: 48px;
    background: var(--db-s2) !important;
    border: 1px solid var(--db-br) !important;
    border-radius: 8px !important;
    font-size: 13px;
    font-weight: 600;
    color: var(--db-text) !important;
    cursor: pointer;
    font-family: "Inter", -apple-system, sans-serif;
}
.db-srch-btn:hover { border-color: var(--db-br2) !important; }

.db-sublbl {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--db-dim) !important;
    margin: 0 0 8px;
}

/* ══ Shared Linear classes (lx-*) ════════════════════════════════════════ */

/* ── Page wrapper ─────────────────────────────────────────────────────── */
.lx-page {
    max-width: 1380px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 32px 88px;
    position: relative;
    z-index: 1;
}

/* ── Cards ────────────────────────────────────────────────────────────── */
.lx-card {
    background: var(--lx-s1);
    border: 1px solid var(--lx-br);
    border-radius: 12px;
    padding: 20px;
    transition: border-color 150ms ease-out;
    box-shadow: 0 1px 2px rgba(0,0,0,.3);
    margin-bottom: 16px;
}

/* ── Page header ──────────────────────────────────────────────────────── */
.lx-page-head {
    padding: 20px 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--lx-br);
}
.lx-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--lx-dim);
    margin: 0 0 8px;
}
.lx-h1 {
    margin: 0 0 6px;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--lx-text);
    line-height: 1.1;
}
.lx-subtitle {
    font-size: 13px;
    color: var(--lx-muted);
    margin: 0;
    line-height: 1.5;
}
.lx-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.lx-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding-top: 4px;
}

/* ── Section heading ──────────────────────────────────────────────────── */
.lx-sh {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}
.lx-sh-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--lx-text);
    letter-spacing: -.01em;
}
.lx-sh-meta { font-size: 12px; color: var(--lx-dim); }

/* ── Metrics grids ────────────────────────────────────────────────────── */
.lx-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.lx-metrics-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.lx-metric {
    background: var(--lx-s1);
    border: 1px solid var(--lx-br);
    border-radius: 10px;
    padding: 14px 16px;
}
.lx-metric-lbl {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--lx-muted);
    margin-bottom: 8px;
}
.lx-metric-val {
    font-size: 26px;
    font-weight: 700;
    color: var(--lx-text);
    letter-spacing: -.025em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* ── Filter form ──────────────────────────────────────────────────────── */
.lx-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}
.lx-filters-6 {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}

/* ── Form elements ────────────────────────────────────────────────────── */
.lx-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--lx-muted);
}
.lx-input,
.lx-select,
.lx-textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--lx-s2);
    border: 1px solid var(--lx-br);
    border-radius: 8px;
    font-size: 13px;
    color: var(--lx-text);
    font-family: "Inter", -apple-system, sans-serif;
    min-height: 38px;
    appearance: none;
    -webkit-appearance: none;
}
.lx-input:focus,
.lx-select:focus,
.lx-textarea:focus { border-color: var(--lx-br2); outline: none; }
.lx-textarea { min-height: 80px; resize: vertical; }
.lx-select option { background: var(--lx-s2); color: var(--lx-text); }
.lx-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--lx-muted);
    min-height: 38px;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.lx-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    min-height: 36px;
    min-width: 44px;
    background: var(--lx-s2);
    border: 1px solid var(--lx-br);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--lx-text);
    cursor: pointer;
    font-family: "Inter", -apple-system, sans-serif;
    text-decoration: none;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 150ms ease-out;
}
.lx-btn:hover { border-color: var(--lx-br2); }
.lx-btn-primary {
    background: var(--lx-red);
    border-color: var(--lx-red);
    color: #fff;
}
.lx-btn-primary:hover { background: #dc2626; border-color: #dc2626; }
.lx-btn-ok {
    background: rgba(34,197,94,.15);
    border-color: rgba(34,197,94,.3);
    color: #4ade80;
}
.lx-btn-ok:hover { border-color: rgba(34,197,94,.5); }

/* ── Pills / badges ───────────────────────────────────────────────────── */
.lx-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--lx-muted);
    background: rgba(255,255,255,.06);
    border: 1px solid var(--lx-br);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.lx-pill-danger {
    color: #fca5a5;
    background: rgba(239,68,68,.12);
    border-color: rgba(239,68,68,.28);
}
.lx-pill-warn {
    color: #fcd34d;
    background: rgba(245,158,11,.12);
    border-color: rgba(245,158,11,.28);
}
.lx-pill-ok {
    color: #86efac;
    background: rgba(34,197,94,.12);
    border-color: rgba(34,197,94,.28);
}

/* ── Topbar ───────────────────────────────────────────────────────────── */
.lx-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--lx-br);
}
.lx-topbar-l,
.lx-topbar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Sticky strip (focus review nav) ─────────────────────────────────── */
.lx-strip {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(8,9,10,.9);
    border-bottom: 1px solid var(--lx-br);
    padding: 10px 0;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.lx-strip-l,
.lx-strip-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lx-strip-title { font-size: 13px; font-weight: 600; color: var(--lx-text); margin: 0; }
.lx-strip-sub { font-size: 12px; color: var(--lx-muted); margin: 0; }

/* ── Flash banners ────────────────────────────────────────────────────── */
.lx-banner {
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    border: 1px solid;
}
.lx-banner-ok {
    background: rgba(34,197,94,.1);
    border-color: rgba(34,197,94,.28);
    color: #86efac;
}
.lx-banner-err {
    background: rgba(239,68,68,.1);
    border-color: rgba(239,68,68,.28);
    color: #fca5a5;
}

/* ── Message / context boxes ──────────────────────────────────────────── */
.lx-msg-box {
    background: var(--lx-s2);
    border: 1px solid var(--lx-br);
    border-radius: 8px;
    padding: 14px;
    white-space: pre-wrap;
    line-height: 1.55;
    font-size: 13px;
    color: var(--lx-text);
    margin-top: 12px;
}
.lx-group-box {
    background: var(--lx-s2);
    border: 1px solid var(--lx-br);
    border-radius: 8px;
    padding: 14px;
    margin-top: 12px;
}
.lx-group-head {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--lx-dim);
    margin: 0 0 8px;
}
.lx-group-item {
    padding: 8px 0;
    border-top: 1px solid var(--lx-br);
    font-size: 13px;
    color: var(--lx-text);
}
.lx-group-item:first-child { border-top: none; padding-top: 0; }
.lx-group-meta { font-size: 11px; color: var(--lx-muted); margin-bottom: 3px; }

/* ── Stat blocks ──────────────────────────────────────────────────────── */
.lx-stat {
    background: var(--lx-s2);
    border: 1px solid var(--lx-br);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
.lx-stat-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--lx-dim);
    margin-bottom: 4px;
}
.lx-stat-val { font-size: 14px; color: var(--lx-text); font-weight: 500; }

/* ── Thumbnail ────────────────────────────────────────────────────────── */
.lx-thumb {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--lx-br);
    background: var(--lx-s2);
    display: block;
}
.lx-thumb-ph {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px dashed rgba(255,255,255,.1);
    color: var(--lx-dim);
    font-size: 12px;
    background: var(--lx-s2);
}

/* ── Media block (images in detail views) ─────────────────────────────── */
.lx-media { display: grid; gap: 10px; margin-bottom: 12px; }
.lx-media img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--lx-br);
    display: block;
}

/* ── Deal list (deals.html) ───────────────────────────────────────────── */
.lx-deal-list { display: grid; gap: 10px; margin-bottom: 18px; }
.lx-deal-card {
    background: var(--lx-s1);
    border: 1px solid var(--lx-br);
    border-radius: 12px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 110px 1fr 200px;
    gap: 14px;
    align-items: start;
    text-decoration: none;
    transition: border-color 150ms ease-out;
}
.lx-deal-card:hover { border-color: var(--lx-br2); }
.lx-deal-channel { font-size: 14px; font-weight: 600; color: var(--lx-text); }
.lx-deal-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--lx-muted);
    margin-top: 4px;
}
.lx-deal-msg {
    font-size: 12px;
    color: var(--lx-muted);
    white-space: pre-wrap;
    line-height: 1.5;
    margin-top: 8px;
    max-height: 72px;
    overflow: hidden;
}
.lx-fin-grid { display: grid; gap: 6px; }
.lx-fin-row {
    background: var(--lx-s2);
    border: 1px solid var(--lx-br);
    border-radius: 7px;
    padding: 8px 10px;
}
.lx-fin-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--lx-dim);
    margin-bottom: 3px;
}
.lx-fin-val {
    font-size: 13px;
    color: var(--lx-text);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ── Scope strip ──────────────────────────────────────────────────────── */
.lx-scope-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--lx-br);
    font-size: 12px;
    color: var(--lx-muted);
}

/* ── Review list (review_queue.html) ──────────────────────────────────── */
.lx-review-list { display: grid; gap: 12px; margin-bottom: 18px; }
.lx-review-card {
    background: var(--lx-s1);
    border: 1px solid var(--lx-br);
    border-radius: 12px;
    padding: 18px;
    display: grid;
    grid-template-columns: 160px 1fr 360px;
    gap: 16px;
    align-items: start;
    transition: border-color 150ms ease-out;
}
.lx-review-card:hover { border-color: var(--lx-br2); }

.rq-mobile-filter-panel { display: none; }
.rq-status-legend,
.rq-card-head,
.rq-card-meta,
.rq-state-grid,
.rq-focus-state-grid,
.rq-attachment-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.rq-status-legend { margin-top: 12px; }
.rq-card-head {
    justify-content: space-between;
    margin-bottom: 8px;
}
.rq-card-meta {
    color: var(--lx-muted);
    font-size: 12px;
    margin-bottom: 10px;
}
.rq-state-grid,
.rq-focus-state-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 0;
}
.rq-state-cell {
    background: var(--lx-s2);
    border: 1px solid var(--lx-br);
    border-radius: 8px;
    padding: 8px 10px;
    min-width: 0;
}
.rq-state-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--lx-dim);
    margin-bottom: 3px;
}
.rq-state-val {
    color: var(--lx-text);
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.rq-card-context { min-width: 0; }
.rq-card-primary-action { width: 100%; justify-content: center; }
.rq-secondary-tools { margin-top: 10px; }
.rq-secondary-tools summary {
    cursor: pointer;
    color: var(--lx-muted);
    font-size: 12px;
    font-weight: 600;
    list-style: none;
}
.rq-secondary-tools summary::-webkit-details-marker { display: none; }
.rq-secondary-tools-body {
    border-top: 1px solid var(--lx-br);
    margin-top: 10px;
    padding-top: 10px;
}
.rq-focus-form .lx-action-row { align-items: stretch; }
.rq-focus-form .lx-action-row .lx-btn { justify-content: center; }
.rq-attachment-row {
    margin: 8px 0 12px;
    color: var(--lx-muted);
    font-size: 12px;
}

/* ── Form panel (inside review cards) ────────────────────────────────── */
.lx-form-panel {
    background: var(--lx-s2);
    border: 1px solid var(--lx-br);
    border-radius: 10px;
    padding: 16px;
}
.lx-form-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--lx-text);
    margin: 0 0 12px;
}

/* ── Edit grid ────────────────────────────────────────────────────────── */
.lx-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.lx-field-wide { grid-column: 1 / -1; }

/* ── Action row ───────────────────────────────────────────────────────── */
.lx-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* ── 2-col layout ─────────────────────────────────────────────────────── */
.lx-layout-2 {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}
.lx-sticky-col { position: sticky; top: 64px; }

/* ── History list ─────────────────────────────────────────────────────── */
.lx-history-item {
    padding: 12px 0;
    border-top: 1px solid var(--lx-br);
    font-size: 13px;
    color: var(--lx-text);
}
.lx-history-item:first-child { border-top: none; padding-top: 0; }
.lx-history-meta { font-size: 12px; color: var(--lx-muted); margin-top: 3px; }
.lx-history-msg { font-size: 12px; color: var(--lx-dim); margin-top: 5px; white-space: pre-wrap; }

/* ── Pagination row ───────────────────────────────────────────────────── */
.lx-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.lx-pag-info { font-size: 12px; color: var(--lx-dim); }

/* ── Tech details (deal_detail.html collapsible) ──────────────────────── */
details.lx-details {
    background: var(--lx-s1);
    border: 1px solid var(--lx-br);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}
details.lx-details > summary {
    cursor: pointer;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--lx-text);
    list-style: none;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: border-color 150ms;
    min-height: 48px;
    font-family: "Inter", -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}
details.lx-details > summary::-webkit-details-marker { display: none; }
details.lx-details > summary::after {
    content: "›";
    color: var(--lx-dim);
    font-size: 16px;
    display: inline-block;
    transition: transform 150ms ease-out;
    transform: rotate(90deg);
    flex-shrink: 0;
}
details.lx-details[open] > summary { border-bottom-color: var(--lx-br); }
details.lx-details[open] > summary::after { transform: rotate(-90deg); }
.lx-details-body { padding: 18px; }

/* ── Detail grid (parse fields) ───────────────────────────────────────── */
.lx-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.lx-detail-card {
    background: var(--lx-s2);
    border: 1px solid var(--lx-br);
    border-radius: 8px;
    padding: 10px 12px;
}
.lx-detail-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--lx-dim);
    margin-bottom: 4px;
}
.lx-detail-val { font-size: 13px; color: var(--lx-text); font-weight: 500; }

/* ── Inline note text ─────────────────────────────────────────────────── */
.lx-note { font-size: 12px; color: var(--lx-muted); line-height: 1.5; margin: 0; }

/* ── Divider ──────────────────────────────────────────────────────────── */
.lx-divider {
    height: 1px;
    background: var(--lx-br);
    border: none;
    margin: 16px 0;
}

/* ── Message label ────────────────────────────────────────────────────── */
.lx-msg-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--lx-dim);
    margin: 12px 0 5px;
}

/* ════════════════ Shared component primitives (audit commit B) ══════════
   These un-prefixed rules let existing template markup inherit the Linear
   dark theme without per-page re-declaration. Templates can still override
   via higher specificity if needed, but the default should win.            */

/* Global pill — tokenized chip used on most operator pages */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--lx-s2);
    color: var(--lx-muted);
    border: 1px solid var(--lx-br);
}
.pill.warn   { background: rgba(234,179,8,.14);  color: #fbbf24; border-color: rgba(234,179,8,.28); }
.pill.ok     { background: rgba(34,197,94,.14);  color: #4ade80; border-color: rgba(34,197,94,.28); }
.pill.info   { background: rgba(96,165,250,.14); color: #60a5fa; border-color: rgba(96,165,250,.28); }
.pill.danger { background: rgba(239,68,68,.14);  color: #fca5a5; border-color: rgba(239,68,68,.28); }

/* Global eyebrow — small-caps label above headings */
.eyebrow {
    color: var(--lx-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Global primary-button — flat Linear red (no warm sunset gradient) */
.primary-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--lx-red);
    color: #fff;
    border: 1px solid var(--lx-red);
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.primary-button:hover { background: #dc2626; border-color: #dc2626; }
.primary-button:focus-visible { outline: 2px solid rgba(239,68,68,.45); outline-offset: 2px; }

/* Global danger-button */
.danger-button {
    background: rgba(239,68,68,.12);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,.28);
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
}

/* Global focus ring — red, not indigo; keyboard users can actually see it */
:where(button, a.linear-sidebar-item, a.mbn-item, input, select, textarea):focus-visible {
    outline: 2px solid rgba(239,68,68,.45);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Global table shell — centralizes ops-table chrome (messages_table et al.) */
.lx-table-shell {
    background: var(--lx-s1);
    border: 1px solid var(--lx-br);
    border-radius: 12px;
    overflow: auto;
}
.lx-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.lx-table thead th {
    background: var(--lx-s2);
    color: var(--lx-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 10px 12px;
    border-bottom: 1px solid var(--lx-br);
    text-align: left;
}
.lx-table tbody td {
    padding: 10px 12px;
    color: var(--lx-text);
    border-bottom: 1px solid var(--lx-br);
}
.lx-table tbody tr:hover { background: var(--lx-s2); }
.lx-row-dirty  { background: rgba(234,179,8,.08); }
.lx-row-focus  { background: rgba(239,68,68,.10); }
.lx-row-parsed { background: rgba(34,197,94,.06); }

/* Reduced-motion guard — respects OS accessibility setting */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ════════════════ Responsive ════════════════════════════════════════════ */
@media (max-width: 1099px) {
    .db-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lx-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lx-metrics-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lx-review-card { grid-template-columns: 140px 1fr; }
    .lx-review-card .lx-form-panel { grid-column: 1 / -1; }
    .lx-deal-card { grid-template-columns: 96px 1fr; }
    .lx-deal-card .lx-fin-grid {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .page { padding: 14px 14px 88px !important; }
    .lx-page { padding: 14px 14px 88px; }
    .db-hero { grid-template-columns: 1fr; gap: 8px; margin: 12px 0 16px; }
    .db-big { font-size: 28px; }
    .db-grid2 { grid-template-columns: 1fr; }
    .db-wsg { grid-template-columns: 1fr 1fr; }
    .lx-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lx-metrics-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lx-filters { grid-template-columns: 1fr 1fr; }
    .lx-filters-6 { grid-template-columns: 1fr 1fr; }
    .lx-deal-card { grid-template-columns: 1fr; }
    .lx-deal-card .lx-fin-grid { grid-template-columns: repeat(2, 1fr); }
    .lx-review-card { grid-template-columns: 1fr; }
    .lx-layout-2 { grid-template-columns: 1fr; }
    .lx-edit-grid { grid-template-columns: 1fr; }
    .lx-detail-grid { grid-template-columns: 1fr; }
    .lx-strip { position: static; }
    .lx-sticky-col { position: static; }
    .lx-metric-val { font-size: 20px; }
    .lx-h1 { font-size: 22px; }
    .rq-desktop-filter-form,
    .rq-desktop-tools,
    .rq-desktop-metrics {
        display: none !important;
    }
    .rq-mobile-filter-panel {
        display: block;
        margin-bottom: 12px;
    }
    .rq-mobile-filter-panel summary {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        border: 1px solid var(--lx-br);
        border-radius: 8px;
        background: var(--lx-s2);
        color: var(--lx-text);
        font-size: 13px;
        font-weight: 700;
        list-style: none;
    }
    .rq-mobile-filter-panel summary::-webkit-details-marker { display: none; }
    .rq-mobile-filter-body {
        padding: 12px;
        border: 1px solid var(--lx-br);
        border-top: 0;
        border-radius: 0 0 8px 8px;
        background: var(--lx-s1);
    }
    .rq-status-legend {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
        scrollbar-width: none;
    }
    .rq-status-legend::-webkit-scrollbar { display: none; }
    .lx-review-list { gap: 14px; }
    .lx-review-card {
        padding: 0;
        gap: 0;
        overflow: hidden;
    }
    .rq-card-media {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 12px;
        border-bottom: 1px solid var(--lx-br);
    }
    .rq-card-media .lx-thumb,
    .rq-card-media .lx-thumb-ph {
        height: 112px;
    }
    .rq-card-context {
        padding: 12px;
    }
    .rq-card-context .lx-msg-box {
        margin-top: 8px;
        max-height: 150px;
        overflow: auto;
    }
    .rq-state-grid,
    .rq-focus-state-grid {
        grid-template-columns: 1fr 1fr;
    }
    .lx-review-card .lx-form-panel {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        padding: 12px;
    }
    .rq-card-actions .lx-btn,
    .rq-focus-form .lx-action-row .lx-btn {
        flex: 1 1 140px;
        min-height: 44px;
    }
    .rq-focus-form .lx-action-row {
        position: sticky;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        z-index: 8;
        padding: 10px;
        margin: 14px -12px -12px;
        background: rgba(17,18,20,.96);
        border-top: 1px solid var(--lx-br);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    .rq-focus-header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .db-wsg { grid-template-columns: 1fr; }
    .lx-metrics { grid-template-columns: 1fr; }
    .lx-metrics-4 { grid-template-columns: 1fr; }
    .lx-deal-card .lx-fin-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Linear Theme Improvements — dashboard hierarchy, deals scannable table,
   Eye FAB. See docs/design/linear-theme-improvements/BRIEF.md
   ════════════════════════════════════════════════════════════════════════ */

/* A — Dashboard accent modifiers */
.db-card--accent-top { border-top-width: 2px !important; border-top-style: solid !important; }
.db-card--accent-orange {
    border-top-color: var(--cx-orange) !important;
    background: rgba(255,106,28,.04) !important;
}
.db-card--accent-green {
    border-top-color: var(--cx-green) !important;
    background: rgba(147,214,167,.03) !important;
}
.db-card--accent-orange .db-ch h3 { color: var(--cx-orange) !important; }
.db-card--accent-green  .db-ch h3 { color: var(--cx-green)  !important; }

.db-num--lead {
    color: var(--cx-orange) !important;
    font-size: 44px;
    line-height: 1;
}
.db-num--pos { color: var(--cx-green) !important; }
.db-num--neg { color: var(--lx-red)  !important; }
.db-num--zero { color: var(--db-muted) !important; }
.db-num--warn { color: #fca5a5 !important; }

.db-inline-breakdown {
    margin-top: 10px;
    font-size: 12px;
    color: var(--db-muted);
    display: none;
}
.db-inline-breakdown b { color: var(--db-text); font-weight: 600; }

.db-metric-grid {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0 16px;
}
.db-metric {
    background: var(--db-s1);
    border: 1px solid var(--db-br);
    border-radius: 10px;
    padding: 12px 14px;
}
.db-metric--accent-top { border-top-width: 2px; border-top-style: solid; }
.db-metric--accent-green { border-top-color: var(--cx-green); }
.db-metric--accent-red   { border-top-color: var(--lx-red); }
.db-metric-lbl-sm {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--db-muted);
}
.db-metric-val-sm {
    font-size: 18px;
    font-weight: 700;
    color: var(--db-text);
    font-variant-numeric: tabular-nums;
    margin-top: 4px;
}

.db-recent-teaser { display: none; margin-top: 4px; }

@media (max-width: 600px) {
    .db-card--hero-mobile .db-bk { display: none; }
    .db-card--hero-mobile .db-inline-breakdown { display: block; }
    .db-hero-mobile-hide { display: none !important; }
    .db-metric-grid { display: grid; }
    .db-recent-teaser { display: block; }
    .db-num--lead { font-size: 32px; }
}

/* B — Deals: filter strip + summary pills + color-coded amounts */
.lx-kind-tabs {
    display: inline-flex;
    background: var(--lx-s2);
    border: 1px solid var(--lx-br);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}
.lx-kind-tab {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--lx-muted);
    border-radius: 6px;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}
.lx-kind-tab:hover { color: var(--lx-text); }
.lx-kind-tab.is-active {
    background: rgba(255,106,28,.12);
    color: var(--cx-orange);
    border: 1px solid rgba(255,106,28,.4);
    padding: 5px 11px;
}

.lx-filter-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.lx-filter-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.lx-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--lx-s2);
    border: 1px solid var(--lx-br);
    border-radius: 6px;
    font-size: 11px;
    color: var(--lx-muted);
    text-decoration: none;
}
.lx-filter-chip:hover { color: var(--lx-text); border-color: var(--lx-br2); }
.lx-filter-chip-x { color: var(--lx-dim); font-weight: 700; }
.lx-filter-more {
    background: var(--lx-s1);
    border: 1px solid var(--lx-br);
    border-radius: 8px;
}
.lx-filter-more summary {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--lx-muted);
    cursor: pointer;
    list-style: none;
}
.lx-filter-more summary::-webkit-details-marker { display: none; }
.lx-filter-more[open] summary { border-bottom: 1px solid var(--lx-br); }
.lx-filter-more .lx-filters {
    padding: 12px;
    margin: 0;
}

.lx-summary-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}
.lx-sum-pill {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 5px 12px;
    border-radius: 7px;
    border: 1px solid var(--lx-br);
    background: var(--lx-s1);
    min-width: 90px;
}
.lx-sum-pill-lbl {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lx-muted);
}
.lx-sum-pill-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--lx-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.lx-sum-pill--sales {
    background: rgba(255,106,28,.08);
    border-color: rgba(255,106,28,.3);
}
.lx-sum-pill--sales .lx-sum-pill-lbl,
.lx-sum-pill--sales .lx-sum-pill-val { color: var(--cx-orange); }
.lx-sum-pill--net {
    background: rgba(147,214,167,.08);
    border-color: rgba(147,214,167,.3);
}
.lx-sum-pill--net .lx-sum-pill-val { color: var(--cx-green); }

/* Deals: color-coded amounts */
.deals-amount {
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-weight: 600;
}
.deals-amount--sale    { color: var(--cx-orange); }
.deals-amount--buy     { color: var(--cx-gold);   }
.deals-amount--expense { color: var(--lx-red);    }
.deals-amount--unknown { color: var(--lx-dim);    }

/* Deals: BK status icon column */
.deals-bk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.deals-bk--ok      { color: var(--lx-live); }
.deals-bk--pending { color: #fbbf24; }
.deals-bk--none    { color: var(--lx-dim); }

/* C — Mobile nav Eye FAB + Live dot (Concept 3) */
@media (max-width: 767.98px) {
    .mobile-bottom-nav .mbn-item.mbn-item-center {
        align-self: flex-start;
    }
    .mbn-eye-fab {
        position: relative;
        width: 46px;
        height: 46px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--cx-orange), #c44a00);
        box-shadow: 0 4px 16px rgba(255,106,28,.5);
        border: 2px solid #0b0c0e;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-top: -18px;
        margin-bottom: 2px;
    }
    .mbn-eye-fab .mbn-icon {
        width: 22px;
        height: 22px;
        stroke: #fff;
        stroke-width: 2;
        fill: none;
    }
    .mbn-eye-live-dot {
        position: absolute;
        top: -2px;
        right: -2px;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: var(--lx-live);
        border: 2px solid #0b0c0e;
    }
    .mobile-bottom-nav .mbn-item.mbn-item-center .mbn-label {
        color: var(--cx-orange);
        font-weight: 700;
    }
    /* Override safe-area.css center icon sizing — the FAB manages its own size */
    .mobile-bottom-nav .mbn-item[data-center="true"] .mbn-icon {
        width: 22px;
        height: 22px;
    }
    .mobile-bottom-nav .mbn-item[data-center="true"].is-active .mbn-icon {
        filter: none;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   NUCLEAR: late-cascade override to guarantee the mobile sidebar is hidden
   off-canvas on phones, independent of any prior rule or collapsed state.
   Appears LAST in the file so it wins on specificity/order.
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    html body aside.linear-sidebar,
    html body #linear-sidebar,
    html.linear-sidebar-collapsed body aside.linear-sidebar,
    html.linear-sidebar-collapsed body #linear-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 80vw !important;
        max-width: 280px !important;
        transform: translateX(-100%) !important;
        transition: transform 220ms ease !important;
        z-index: 200 !important;
    }
    html body.linear-drawer-open aside.linear-sidebar,
    html body.linear-drawer-open #linear-sidebar {
        transform: translateX(0) !important;
    }
    /* Never let any cascade apply desktop/tablet body-left-padding on mobile. */
    html body,
    html body:has(.linear-sidebar),
    html.linear-sidebar-collapsed body,
    html.linear-sidebar-collapsed body:has(.linear-sidebar) {
        padding-left: 0 !important;
    }
}
