:root {
    --bg-base: #020308;
    --bg-surface: #070914;
    --bg-panel: rgba(18, 20, 35, 0.45);
    --bg-panel-hover: rgba(26, 30, 50, 0.7);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;

    --accent: #ff2a5f;
    --accent-hover: #ff4d79;
    --accent-glow: rgba(255, 42, 95, 0.6);
    --accent-secondary: #ff8e3c;

    --gradient-primary: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    --gradient-border: linear-gradient(135deg, rgba(255, 42, 95, 0.5), rgba(255, 142, 60, 0.2), transparent 70%);

    --danger: #ef4444;
    --success: #10b981;
    --neutral: #3b82f6;
    --warning: #f59e0b;

    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);
    --border-highlight: rgba(255, 255, 255, 0.3);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --glass-blur: blur(24px);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(255, 42, 95, 0.06), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(255, 142, 60, 0.04), transparent 40%);
}

p {
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.glow-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 42, 95, 0.4);
}

#app {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Auth Area */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    height: 100vh;
    background: radial-gradient(ellipse at 20% 50%, rgba(255, 42, 95, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 142, 60, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(20, 20, 35, 1) 0%, var(--bg-base) 100%);
}

/* Animated ambient glow orbs */
.auth-container::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 42, 95, 0.12), transparent 70%);
    top: -10%;
    left: -5%;
    z-index: 0;
    pointer-events: none;
    animation: orbFloat1 12s ease-in-out infinite alternate;
    filter: blur(60px);
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 142, 60, 0.1), transparent 70%);
    bottom: -10%;
    right: -5%;
    z-index: 0;
    pointer-events: none;
    animation: orbFloat2 14s ease-in-out infinite alternate;
    filter: blur(60px);
}

@keyframes orbFloat1 {
    0% {
        transform: translate(0, 0) scale(0.9);
        opacity: 0.5;
    }

    50% {
        transform: translate(60px, 40px) scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-30px, 80px) scale(1);
        opacity: 0.6;
    }
}

@keyframes orbFloat2 {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }

    50% {
        transform: translate(-50px, -30px) scale(1.15);
        opacity: 0.7;
    }

    100% {
        transform: translate(40px, -60px) scale(0.9);
        opacity: 0.5;
    }
}

.auth-panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-top: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 3.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.brand-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand-header h1 {
    font-size: 2.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 10px rgba(255, 42, 95, 0.2));
}

.brand-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    background-color: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
    width: 100%;
    padding: 1.1rem;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    transition: all 0.5s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
    color: #fff;
}

.btn:hover::after {
    left: 150%;
}

.btn:active {
    transform: translateY(0);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* App Shell Layout */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

/* Ambient Background for Main App */
.app-layout::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200vw;
    height: 200vh;
    background-image:
        radial-gradient(circle at 80% 10%, rgba(255, 42, 95, 0.05), transparent 30%),
        radial-gradient(circle at 20% 80%, rgba(255, 142, 60, 0.03), transparent 30%);
    z-index: -1;
    pointer-events: none;
    animation: rotateSlowly 30s linear infinite;
}

@keyframes rotateSlowly {
    100% {
        transform: rotate(360deg);
    }
}

.sidebar {
    width: 240px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    flex-shrink: 0;
    z-index: 10;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 11, 20, 0.85);
    transition: width 0.25s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 68px;
}

.sidebar.collapsed .sidebar-brand {
    padding: 0 0.5rem 1.5rem;
}

.sidebar.collapsed .sidebar-logo {
    max-height: 40px !important;
}

.sidebar.collapsed .nav-label {
    display: none;
}

.sidebar.collapsed .nav-item {
    padding: 0.85rem;
    justify-content: center;
    border-left-width: 2px;
}

.sidebar.collapsed .nav-icon {
    margin-right: 0;
}

.sidebar-brand {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1rem;
}

.sidebar-brand h2 {
    color: var(--accent);
    font-size: 1.75rem;
    font-weight: 900;
    margin-bottom: 0.25rem;
}

/* Nav Icons */
.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: 0.75rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-item.active .nav-icon {
    stroke: var(--accent);
}

.nav-label {
    line-height: 1.3;
}

.nav-item {
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent;
    gap: 0;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--bg-panel-hover);
    color: var(--text-primary);
    border-left-color: var(--accent);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: transparent;
}

/* Topbar */
.topbar {
    height: 64px;
    background: rgba(10, 11, 20, 0.85);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0;
    z-index: 10;
    gap: 1.5rem;
}

/* Topbar Search */
.topbar-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.topbar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.topbar-search-input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.topbar-search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

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

/* Topbar Icon Buttons */
.topbar-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.topbar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border);
    color: var(--text-primary);
}

#logoutBtn:hover {
    color: var(--danger) !important;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 42, 95, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
}

/* Empty State Component */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 400px;
    line-height: 1.5;
}

/* General Layout Components */
.card {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: relative;
    box-shadow: var(--glass-shadow);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    padding: 1px;
    background: var(--gradient-border);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-6px) scale(1.02);
    background: var(--bg-panel-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 42, 95, 0.15);
}

.card:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(255, 42, 95, 0.8), rgba(255, 142, 60, 0.4), transparent 50%);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* View Specific: Search */
.search-container {
    max-width: 900px;
    margin: 0 auto;
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-bar input {
    flex: 1;
    padding: 1.25rem 1.75rem;
    font-size: 1.125rem;
    background: rgba(15, 17, 30, 0.6);
    border: 1px solid var(--border-light);
    border-radius: 30px;
    color: var(--text-primary);
    font-family: var(--font-body);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) inset;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-glow), 0 8px 32px rgba(0, 0, 0, 0.3) inset;
    background: rgba(22, 25, 43, 0.8);
}

.badge {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.badge:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--accent);
}

.target-card {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.target-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.target-card:hover h3 {
    color: var(--accent);
}

.tier-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.tier-badge.commander {
    border-color: #8b5cf6;
    color: #a78bfa;
}

.tier-badge.masterpiece {
    border-color: #f59e0b;
    color: #fbbf24;
}

.tier-badge.leader {
    border-color: #ef4444;
    color: #f87171;
}

.tier-badge.voyager {
    border-color: #3b82f6;
    color: #60a5fa;
}

.tier-badge.deluxe {
    border-color: #10b981;
    color: #34d399;
}

/* FORMS & SUBMISSIONS */
.form-section {
    margin-bottom: 2.5rem;
}

.section-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
    font-weight: 800;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    outline: none;
    border: 1px solid var(--border-light);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 15px var(--accent-glow);
    transition: transform 0.1s;
    border: 3px solid var(--bg-panel);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.segmented-control {
    display: flex;
    background: rgba(10, 11, 20, 0.5);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.segmented-control label {
    flex: 1;
    text-align: center;
    position: relative;
    cursor: pointer;
}

.segmented-control input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.segmented-control span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 0.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
    border-right: 1px solid var(--border);
    white-space: nowrap;
}

.segmented-control label:last-child span {
    border-right: none;
}

.segmented-control input[type="radio"]:checked+span {
    background: var(--bg-panel-hover);
    color: var(--text-primary);
    box-shadow: inset 0 -3px 0 var(--accent);
}

.risk-bullish input[type="radio"]:checked+span {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    box-shadow: inset 0 -3px 0 var(--success);
}

.risk-bearish input[type="radio"]:checked+span {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    box-shadow: inset 0 -3px 0 var(--danger);
}

.risk-info-icon {
    font-size: 0.7rem;
    opacity: 0.5;
    vertical-align: super;
    margin-left: 1px;
    cursor: help;
}

.risk-info-toggle {
    display: inline-block;
    font-size: 0.95rem;
    color: var(--accent);
    opacity: 0.7;
    cursor: pointer;
    margin-left: 0.25rem;
    vertical-align: middle;
    transition: opacity 0.2s;
}

.risk-info-toggle:hover {
    opacity: 1;
}

.risk-info-panel {
    display: none;
    background: rgba(10, 11, 20, 0.95);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.risk-info-panel div {
    margin-bottom: 0.15rem;
}

.risk-info-panel div:last-child {
    margin-bottom: 0;
}

/* Show via JS hover class or tap-pin */
.risk-info-panel.visible,
.risk-info-panel.pinned {
    display: block;
}

.ri-label {
    font-weight: 700;
    margin-right: 0.35rem;
}

.ri-bull {
    color: var(--success);
}

.ri-neut {
    color: var(--text-muted);
}

.ri-bear {
    color: var(--danger);
}

.priceTypeToggle {
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.priceTypeToggle.active {
    border-color: var(--accent);
    background: rgba(255, 15, 57, 0.15);
    color: var(--accent);
}

.priceTypeToggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- Dashboard: Search, Pagination, Deep-links --- */
/* --- Intel History Styles --- */
.intel-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.intel-stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    text-align: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.intel-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-heading);
    margin-bottom: 0.25rem;
}

.intel-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.intel-search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.intel-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.intel-search-input {
    width: 100%;
    padding: 0.7rem 2.5rem 0.7rem 2.25rem;
    background: rgba(15, 17, 30, 0.6);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.2s;
}

.intel-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

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

.intel-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.intel-search-clear:hover {
    color: var(--accent);
    background: rgba(255, 42, 95, 0.1);
}

.intel-table-wrap {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.intel-action-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    margin-left: 0.25rem;
}

.intel-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    color: var(--text-primary);
}

.intel-action-btn.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.intel-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 0;
}

.intel-page-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.intel-page-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.intel-page-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Leaderboard Styles --- */
.lb-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.lb-main {
    flex: 1;
    min-width: 0;
}

.lb-podium {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.lb-podium-card {
    background: var(--bg-panel);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.25rem;
    text-align: center;
    flex: 1;
    max-width: 200px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform 0.2s;
}

.lb-podium-card.first {
    padding: 2rem 1.25rem;
    transform: translateY(-8px);
}

.lb-podium-card:hover {
    transform: translateY(-4px);
}

.lb-podium-card.first:hover {
    transform: translateY(-12px);
}

.lb-podium-medal {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.lb-podium-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
    color: #fff;
    margin: 0 auto 0.75rem;
    border: 3px solid var(--border-light);
}

.lb-podium-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-podium-count {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.lb-remaining {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.lb-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.2s;
}

.lb-row:last-child {
    border-bottom: none;
}

.lb-row:hover {
    background: var(--bg-panel-hover);
}

.lb-row.is-me {
    background: rgba(255, 42, 95, 0.05);
    border-left: 3px solid var(--accent);
}

.lb-row-rank {
    width: 28px;
    text-align: center;
    font-weight: 800;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.lb-row-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    flex-shrink: 0;
}

.lb-row-info {
    flex: 1;
    min-width: 0;
}

.lb-row-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.lb-row-count {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-right: 0.5rem;
}

/* Your Stats Sidebar */
.lb-your-stats {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.lb-stat-item {
    margin-bottom: 1.25rem;
}

.lb-stat-item:last-child {
    margin-bottom: 0;
}

.lb-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.lb-stat-val {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.lb-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.lb-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.dash-target-link {
    cursor: pointer;
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--border-light);
    text-underline-offset: 4px;
    transition: color 0.2s;
}

.dash-target-link:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

.dash-action-btn {
    background: transparent;
    margin-right: 0.35rem;
    cursor: pointer;
    font-size: 0.8rem;
}

.dash-action-btn.accent {
    border-color: var(--accent);
    color: var(--accent);
}

.dash-action-btn.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.dash-action-btn:hover {
    opacity: 0.8;
}

.dash-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 0;
}

.dash-page-btn {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    font-family: var(--font-heading);
}

.dash-page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.dash-page-info {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 42, 95, 0.1);
    box-shadow: 0 0 15px rgba(255, 42, 95, 0.2);
}

textarea {
    width: 100%;
    background: rgba(15, 17, 30, 0.6);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 1.25rem;
    font-family: var(--font-body);
    font-size: 1rem;
    resize: vertical;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow), 0 8px 32px rgba(0, 0, 0, 0.3) inset;
    background: rgba(22, 25, 43, 0.8);
}

/* TABLES & STATS */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.stat-box {
    background: rgba(15, 17, 30, 0.45);
    border: 1px solid var(--border-light);
    border-top: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 42, 95, 0.1);
}

.stat-value {
    font-size: 2.5rem;
    font-family: var(--font-heading);
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    line-height: 1;
    filter: drop-shadow(0 2px 10px rgba(255, 42, 95, 0.2));
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* --- CYBERNETIC DATA BORDER ANIMATIONS --- */
@keyframes rotateDataPulse {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeMount {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-mount {
    animation: fadeMount 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-stagger {
    opacity: 0;
    animation: fadeMount 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Base Matrix Setup */
.card,
.stat-box,
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.card>*,
.stat-box>*,
.btn>* {
    position: relative;
    z-index: 2;
    /* Lifts contents above the pseudo-element chassis */
}

/* The Data Emitter (Spinning Laser Background) */
.card::before,
.stat-box::before,
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: conic-gradient(from 0deg, transparent 60%, var(--accent) 80%, var(--accent-secondary) 100%);
    animation: rotateDataPulse 3s linear infinite;
    z-index: -2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* The Core Chassis (Inner mask that reveals the border) */
.card::after,
.stat-box::after,
.btn::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--bg-panel);
    border-radius: calc(var(--radius-md) - 1px);
    z-index: -1;
    transition: background 0.3s ease;
}

.stat-box::after {
    background: var(--bg-surface);
}

.btn::after {
    background: var(--accent);
    inset: 2px;
    border-radius: calc(var(--radius-sm) - 2px);
}

/* Hover Triggers */
.card:hover::before,
.stat-box:hover::before,
.btn:hover::before {
    opacity: 1;
}

.card:hover,
.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Button invert for border highlight */
.btn:hover::after {
    background: var(--bg-panel);
}

.btn:hover {
    color: var(--accent);
    box-shadow: 0 0 15px rgba(255, 15, 57, 0.3);
}

/* --- SKELETON LOADING STATES --- */
.skeleton {
    background: var(--bg-panel);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%);
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.skeleton-card {
    height: 160px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-line.medium {
    width: 70%;
}

.skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.skeleton-stat {
    height: 120px;
    border-radius: var(--radius-md);
}

.skeleton-row {
    height: 56px;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
}

.skeleton-room {
    height: 76px;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

/* --- LIGHT THEME --- */
[data-theme="light"] {
    --bg-base: #f0f2f5;
    --bg-surface: #ffffff;
    --bg-panel: rgba(255, 255, 255, 0.75);
    --bg-panel-hover: rgba(240, 242, 248, 0.9);
    --text-primary: #1a1a2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #e11d48;
    --accent-hover: #be123c;
    --accent-glow: rgba(225, 29, 72, 0.25);
    --accent-secondary: #ea580c;
    --gradient-primary: linear-gradient(135deg, #e11d48, #ea580c);
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.12);
    --border-highlight: rgba(0, 0, 0, 0.18);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --danger: #dc2626;
    --success: #059669;
    --neutral: #2563eb;
}

[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .auth-container {
    background: radial-gradient(circle at 50% 50%, rgba(240, 242, 250, 1) 0%, var(--bg-base) 100%);
}

[data-theme="light"] .search-bar input {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) inset;
}

[data-theme="light"] .search-bar input:focus {
    background: #fff;
}

[data-theme="light"] .input-group input {
    background-color: #f8fafc;
}

[data-theme="light"] textarea {
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] textarea:focus {
    background: #fff;
}

[data-theme="light"] input[type="range"] {
    background: #e2e8f0;
}

[data-theme="light"] .stat-box::after {
    background: #ffffff;
}

[data-theme="light"] .card::after,
[data-theme="light"] .btn::after {
    background: #ffffff;
}

[data-theme="light"] .btn::after {
    background: var(--accent);
}

[data-theme="light"] .btn:hover::after {
    background: #ffffff;
}

[data-theme="light"] .segmented-control {
    background: rgba(248, 250, 252, 0.8);
}

[data-theme="light"] .risk-info-panel {
    background: rgba(248, 250, 252, 0.95);
}

[data-theme="light"] .dash-search-input {
    background: rgba(248, 250, 252, 0.9);
}

[data-theme="light"] .app-layout::before {
    background-image:
        radial-gradient(circle at 80% 10%, rgba(225, 29, 72, 0.04), transparent 30%),
        radial-gradient(circle at 20% 80%, rgba(234, 88, 12, 0.03), transparent 30%);
}

/* --- USER LINK --- */
.user-link {
    cursor: pointer;
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--border-light);
    text-underline-offset: 3px;
    transition: color 0.2s, text-decoration-color 0.2s;
}

.user-link:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

/* --- NOTIFICATION DROPDOWN --- */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    z-index: 200;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.notif-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.notif-item:hover {
    background: var(--bg-panel-hover);
}

.notif-item.unread {
    border-left: 3px solid var(--accent);
}

.notif-item .notif-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-item .notif-text {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.4;
}

.notif-item .notif-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* --- MARKET PULSE --- */
.pulse-headline-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.pulse-headline-item:hover {
    background: var(--bg-panel-hover);
}

/* Notification toggle switches */
.notif-toggle {
    -webkit-appearance: none;
    appearance: none;
    width: 40px;
    height: 22px;
    background: var(--border-light, #1e293b);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background 0.25s ease;
    outline: none;
    border: none;
    flex-shrink: 0;
}

.notif-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted, #475569);
    border-radius: 50%;
    transition: transform 0.25s ease, background 0.25s ease;
}

.notif-toggle:checked {
    background: var(--accent, #ff2a5f);
}

.notif-toggle:checked::after {
    transform: translateX(18px);
    background: #fff;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* --- BREAKOUT ROOMS --- */

/* Room List */
.room-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.75rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.room-card:hover {
    background: var(--bg-panel-hover);
    border-color: var(--accent);
    transform: translateX(4px);
}

.room-card.has-unread {
    border-left: 3px solid var(--accent);
}

.room-card .room-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.room-card .room-info {
    flex: 1;
    min-width: 0;
}

.room-card .room-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-card .room-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-card .room-meta {
    text-align: right;
    flex-shrink: 0;
}

.room-card .room-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.room-card .room-unread {
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    display: inline-block;
}

/* Room Filter Tabs */
.room-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.room-tab {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.room-tab.active,
.room-tab:hover {
    background: rgba(255, 42, 95, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* Chat View */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px - 6rem);
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0;
    flex-shrink: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.chat-input-bar .btn {
    width: auto;
    flex-shrink: 0;
}

.chat-input-bar textarea {
    flex: 1;
    min-width: 0;
}

/* Message Bubbles */
.msg-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    max-width: 80%;
}

.msg-row.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    color: var(--text-primary);
}

.msg-bubble {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    max-width: 100%;
}

.msg-row.own .msg-bubble {
    background: rgba(255, 42, 95, 0.12);
    border-color: rgba(255, 42, 95, 0.3);
}

.msg-author {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.2rem;
}

.msg-content {
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.msg-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    object-fit: contain;
}

.msg-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.msg-reactions {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}

.msg-react-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    transition: all 0.2s;
}

.msg-react-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.msg-react-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 42, 95, 0.1);
}

/* Typing Indicator */
.typing-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.25rem 0;
    min-height: 1.25rem;
}

/* User Search / Member Pills */
.member-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 0.3rem 0.6rem 0.3rem 0.4rem;
    font-size: 0.85rem;
    margin: 0.25rem;
    color: var(--text-primary);
}

.member-pill .remove-member {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 0.2rem;
}

.member-pill .remove-member:hover {
    color: var(--danger);
}

.user-search-results {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
}

.user-search-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    transition: background 0.2s;
}

.user-search-item:hover {
    background: var(--bg-panel-hover);
}

/* New Room Modal */
.room-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.room-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
}

/* Light Theme Overrides for Rooms */
[data-theme="light"] .msg-row.own .msg-bubble {
    background: rgba(225, 29, 72, 0.08);
    border-color: rgba(225, 29, 72, 0.2);
}

[data-theme="light"] .room-card:hover {
    background: rgba(240, 242, 248, 0.95);
}

[data-theme="light"] .room-modal {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .skeleton {
    background: #e2e8f0;
}

[data-theme="light"] .skeleton::after {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
}

/* ===== MOBILE RESPONSIVENESS ===== */

/* --- Hamburger Button (hidden by default, shown via media queries) --- */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.75rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    flex-shrink: 0;
}

.hamburger-btn:hover {
    background: var(--bg-panel-hover);
}

/* --- Sidebar Overlay (for mobile slide-out) --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 49;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

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

/* ======================== COMMUNITY METRICS & PROVISIONAL ======================== */

/* Provisional badge — amber pill shown on scores with < 3 submissions */
.provisional-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    margin-left: 0.4rem;
    vertical-align: middle;
    white-space: nowrap;
}

/* Locked/grayed state for per-metric breakdown when < 3 submissions */
.metrics-locked {
    opacity: 0.35;
    pointer-events: none;
    filter: blur(1px);
    user-select: none;
    -webkit-user-select: none;
}

/* Metric progress bar track */
.metric-bar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    height: 10px;
    flex: 1;
    overflow: hidden;
}

/* Metric progress bar fill */
.metric-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 2px;
}

/* Metric bar row layout */
.metric-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
}

.metric-bar-row .metric-label {
    min-width: 130px;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.metric-bar-row .metric-value {
    min-width: 50px;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Price delta styling */
.price-delta-positive {
    color: var(--danger);
    font-weight: 600;
}

.price-delta-negative {
    color: var(--success);
    font-weight: 600;
}

/* Lock message box */
.lock-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 10px;
    font-size: 0.85rem;
    color: #f59e0b;
    margin-bottom: 1rem;
}

/* ======================== FIGURE LINKS ======================== */
.figure-link {
    display: inline;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.figure-link.found {
    color: var(--accent);
    background: rgba(255, 42, 95, 0.1);
    border: 1px solid rgba(255, 42, 95, 0.3);
}

.figure-link.found:hover {
    background: rgba(255, 42, 95, 0.2);
}

.figure-link.not-found {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--border-light);
}

.figure-link.not-found:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ======================== FIGURE AUTOCOMPLETE ======================== */
.figure-autocomplete {
    position: fixed;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: none;
}

.figure-ac-item {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-light);
}

.figure-ac-item:last-child {
    border-bottom: none;
}

.figure-ac-item:hover,
.figure-ac-item.active {
    background: rgba(255, 42, 95, 0.1);
    color: var(--accent);
}

.figure-ac-name {
    font-weight: 600;
}

.figure-ac-brand {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ======================== AUTH LANDING — Two-Column Layout ======================== */
.auth-landing {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 2.5rem;
    width: 100%;
    max-width: 1200px;
    min-height: 0;
    z-index: 2;
    position: relative;
}

.auth-landing .auth-panel {
    flex: 1;
    max-width: none;
    align-self: flex-start;
}

/* Showcase Column */
.auth-showcase {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.auth-showcase::-webkit-scrollbar {
    width: 4px;
}

.auth-showcase::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 2px;
}

.showcase-section {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-top: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
}

.showcase-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* Stats Grid */
.showcase-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.stat-card {
    background: rgba(10, 11, 20, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(255, 42, 95, 0.15);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Leaderboard Rows */
.lb-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.lb-row:last-child {
    border-bottom: none;
}

.lb-row:hover {
    background: rgba(255, 42, 95, 0.04);
}

.lb-rank {
    font-size: 1.1rem;
    width: 2rem;
    text-align: center;
    flex-shrink: 0;
}

.lb-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-count {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

.lb-count-label {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.lb-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    min-width: 0;
    white-space: nowrap;
}

/* Headlines Rows */
.hl-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.55rem 0.25rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.hl-row:last-child {
    border-bottom: none;
}

.hl-row:hover {
    background: rgba(255, 42, 95, 0.04);
}

.hl-grade {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 0.95rem;
    width: 2.5rem;
    text-align: center;
    flex-shrink: 0;
}

.hl-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
    line-height: 1.4;
    min-width: 0;
}

.hl-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
    margin-top: 2px;
}

.showcase-loading {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 1rem 0;
}

/* Top Rated Toys Rows */
.tr-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.tr-row:last-child {
    border-bottom: none;
}

.tr-row:hover {
    background: rgba(255, 42, 95, 0.05);
}

.tr-rank {
    font-size: 1.3rem;
    width: 2rem;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}

.tr-rank-num {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-secondary);
}

.tr-info {
    flex: 1;
    min-width: 0;
}

.tr-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.tr-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tr-brand {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.tr-score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.tr-grade {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.35rem;
    line-height: 1.1;
}

.tr-subs {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Feature Highlights Grid */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.feature-card {
    background: rgba(10, 11, 20, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
    cursor: default;
}

.feature-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(255, 42, 95, 0.15), inset 0 0 20px rgba(255, 42, 95, 0.03);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.feature-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.feature-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Stagger animation for showcase sections */
.animate-stagger {
    opacity: 0;
    transform: translateY(12px);
    animation: staggerIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ======================== MOBILE (max-width: 767px) ======================== */
@media (max-width: 767px) {

    /* Auth landing: stack vertically, login first */
    .auth-landing {
        flex-direction: column-reverse;
        gap: 1.5rem;
        max-width: 100%;
    }

    .auth-landing .auth-panel {
        max-width: 100%;
    }

    .auth-showcase {
        max-height: none;
        overflow-y: visible;
    }

    .feature-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .feature-card {
        padding: 0.75rem;
    }

    .feature-icon {
        font-size: 1.4rem;
    }

    .auth-container {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    /* Sidebar: slide-out from left */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 50;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .sidebar.open {
        left: 0;
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.5);
    }

    /* Show hamburger */
    .hamburger-btn {
        display: flex !important;
    }

    /* Topbar adjustments */
    .topbar {
        height: 60px;
        padding: 0 1rem !important;
    }

    .topbar .user-profile {
        font-size: 0.85rem;
    }

    /* Main content: full width */
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Content area padding */
    .content-area {
        padding: 1.5rem 1rem !important;
    }

    /* All grids collapse to single column */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
    }

    /* Inline grid overrides (admin stats, docs TOC, etc) */
    [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    [style*="grid-template-columns: repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    [style*="grid-template-columns:repeat(3"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .pop-count-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Mobile button touch improvements */
    .btn {
        -webkit-tap-highlight-color: rgba(255, 42, 95, 0.3);
        touch-action: manipulation;
    }

    /* Touch targets: min 44px */
    .nav-item {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }

    .room-card {
        min-height: 44px;
    }

    .room-tab {
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }

    /* Form inputs: 16px prevents iOS zoom */
    .input-group input,
    textarea,
    select,
    .search-bar input {
        font-size: 16px !important;
    }

    /* Auth panel: tighter margins */
    .auth-panel {
        padding: 2rem 1.5rem;
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }

    .brand-header h1 {
        font-size: 1.8rem;
    }

    /* Room modal: full-width */
    .room-modal {
        margin: 1rem;
        padding: 1.5rem;
        max-width: calc(100vw - 2rem);
    }

    /* Chat container: account for smaller topbar */
    .chat-container {
        height: calc(100vh - 60px - 4rem);
    }

    .chat-input-area {
        padding: 0.75rem;
    }

    /* Notification dropdown: full-width */
    .notif-dropdown {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 60px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* Stat boxes: 2-col on mobile instead of 4 */
    .stat-box {
        min-width: 0;
    }

    /* Search filter buttons: wrap */
    .segmented-control {
        flex-wrap: wrap;
    }

    /* User avatar: slightly smaller */
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    /* Fix grid-column spanning for responsive */
    [style*="grid-column: span 2"],
    [style*="grid-column:span 2"] {
        grid-column: 1 / -1 !important;
    }

    /* Sidebar brand logo smaller on mobile */
    .sidebar-brand img {
        max-height: 80px !important;
    }

    /* Leaderboard/dashboard tables: horizontal scroll */
    .card:has(table) {
        overflow-x: auto;
    }

    table {
        min-width: 500px;
    }
}

/* ======================== TABLET (768px - 1023px) ======================== */
@media (min-width: 768px) and (max-width: 1023px) {

    /* Sidebar: same slide-out pattern */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 50;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .sidebar.open {
        left: 0;
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.5);
    }

    /* Show hamburger */
    .hamburger-btn {
        display: flex !important;
    }

    /* Topbar adjustments */
    .topbar {
        height: 70px;
        padding: 0 1.5rem !important;
    }

    /* Main content: full width */
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Content area padding */
    .content-area {
        padding: 2rem 1.5rem !important;
    }

    /* Grid adjustments: 3/4 col → 2 col, 2 col stays */
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Inline 4-col grids → 2-col */
    [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Touch targets */
    .nav-item {
        min-height: 44px;
    }

    .room-card {
        min-height: 44px;
    }

    /* Chat container */
    .chat-container {
        height: calc(100vh - 70px - 4rem);
    }

    /* Room modal */
    .room-modal {
        max-width: 450px;
    }

    /* Fix grid-column spanning for responsive */
    [style*="grid-column: span 2"],
    [style*="grid-column:span 2"] {
        grid-column: 1 / -1 !important;
    }
}

/* ==================== Market Pulse Tabs & Extras ==================== */

.market-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.market-tab:hover {
    color: var(--text-primary);
}

.market-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Change indicators */
.change-up {
    color: var(--success);
    font-weight: 700;
}

.change-down {
    color: var(--danger);
    font-weight: 700;
}

.change-flat {
    color: var(--text-muted);
    font-weight: 700;
}

/* Small toggle buttons (daily/weekly) */
.btn-sm {
    padding: 0.35rem 0.85rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: var(--bg-panel-hover);
    color: var(--text-primary);
}

.btn-sm.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Brand index card hover */
.brand-index-card {
    transition: transform 0.2s, border-color 0.2s;
}

.brand-index-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-highlight);
}

/* Compare table */
.compare-table td {
    padding: 0.85rem 1rem;
}

.compare-table tr:nth-child(odd) {
    background: var(--bg-panel);
}

/* Sort header hover */
.sort-header:hover {
    color: var(--accent);
}

/* Form input styling for compare search */
.form-input {
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Primary button */
.btn-primary {
    padding: 0.65rem 2rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.lb-admin-btn {
    background: none;
    border: 1px solid var(--danger, #ef4444);
    color: var(--danger, #ef4444);
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    margin-left: auto;
}

.lb-admin-btn:hover {
    opacity: 1;
}

/* Admin panel action buttons — flex-wrap for narrow screens */
.admin-action-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-end;
}

.admin-action-btns button {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.admin-action-btns button:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {
    .market-tab {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* ===== Figure Leaderboard (.flb-*) ===== */

.flb-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.flb-mode-tabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.flb-mode-tab {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1.1rem;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.flb-mode-tab:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--bg-panel-hover);
}

.flb-mode-tab.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow);
}

.flb-brand-filter select {
    background: var(--bg-panel);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font-body);
}

.flb-brand-filter select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Table */
.flb-table {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 1.5rem;
}

.flb-table-header {
    display: grid;
    grid-template-columns: 50px 2fr 1fr 70px 70px 50px 90px 80px 50px;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.flb-row {
    display: grid;
    grid-template-columns: 50px 2fr 1fr 70px 70px 50px 90px 80px 50px;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    align-items: center;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.85rem;
}

.flb-row:last-child {
    border-bottom: none;
}

.flb-row:hover {
    background: var(--bg-panel-hover);
}

.flb-col-rank {
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

.flb-col-name {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.flb-fig-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flb-fig-class {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.flb-col-brand {
    min-width: 0;
}

.flb-col-grade {
    text-align: center;
    font-size: 0.95rem;
}

.flb-col-reviews {
    text-align: center;
    color: var(--text-secondary);
}

.flb-col-price {
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
}

.flb-col-msrp {
    text-align: center;
}

.flb-col-trend {
    text-align: center;
}

.flb-col-pop {
    text-align: center;
    color: #10b981;
    font-weight: 700;
}

/* Trend arrows */
.flb-trend-up {
    color: var(--success);
    font-size: 0.8rem;
}

.flb-trend-down {
    color: var(--danger);
    font-size: 0.8rem;
}

.flb-trend-flat {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* MSRP diff */
.flb-msrp-positive {
    color: var(--success);
    font-weight: 600;
    font-size: 0.8rem;
}

.flb-msrp-negative {
    color: var(--danger);
    font-weight: 600;
    font-size: 0.8rem;
}

/* Pinned badge */
.flb-pinned-badge {
    font-size: 0.75rem;
}

/* Pagination */
.flb-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.flb-page-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-body);
}

.flb-page-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.flb-page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: default;
}

.flb-page-ellipsis {
    color: var(--text-muted);
    padding: 0 0.25rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .flb-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .flb-mode-tabs {
        justify-content: center;
    }

    .flb-table-header {
        display: none;
    }

    .flb-row {
        grid-template-columns: 35px 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.25rem 0.5rem;
        padding: 0.75rem;
    }

    .flb-col-rank {
        grid-row: 1 / 3;
        align-self: center;
    }

    .flb-col-name {
        grid-column: 2;
        grid-row: 1;
    }

    .flb-col-grade {
        grid-column: 3;
        grid-row: 1;
        text-align: right;
    }

    .flb-col-brand {
        grid-column: 2;
        grid-row: 2;
    }

    .flb-col-reviews,
    .flb-col-pop,
    .flb-col-price,
    .flb-col-msrp,
    .flb-col-trend {
        display: none;
    }

    .pop-count-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ========================================
   LIVE SCORECARD — YouTube Presentation Tool
   ======================================== */

.sc-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

/* Header — Image + Info + Hero Stats (sticky for YouTube streaming) */
.sc-header {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    margin-bottom: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sc-figure-col {
    display: flex;
    align-items: flex-start;
}

.sc-image-wrapper {
    width: 240px;
    height: 240px;
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border-light);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: border-color 0.3s;
    background: rgba(10, 11, 20, 0.6);
}

.sc-image-wrapper:hover {
    border-color: var(--accent);
}

.sc-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.sc-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.sc-info-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sc-search-wrap {
    position: relative;
}

.sc-figure-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-family: var(--font-heading);
    font-weight: 700;
    outline: none;
    transition: border-color 0.2s;
}

.sc-figure-input:focus {
    border-color: var(--accent);
}

.sc-figure-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.sc-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
}

.sc-search-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
}

.sc-search-item:hover {
    background: var(--bg-panel-hover);
}

.sc-search-name {
    font-weight: 600;
    color: var(--text-primary);
}

.sc-search-brand {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sc-figure-meta {
    display: none;
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Hero Stats — DTS, Approval, Overall */
.sc-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: auto;
}

.sc-hero-box {
    background: rgba(10, 11, 20, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sc-hero-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.sc-hero-dts::before {
    background: #ff2a5f;
}

.sc-hero-approval::before {
    background: #10b981;
}

.sc-hero-overall::before {
    background: linear-gradient(90deg, #ff2a5f, #10b981);
}

.sc-hero-value {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 900;
    color: #f59e0b;
    transition: color 0.4s ease;
    line-height: 1.1;
}

.sc-hero-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-top: 0.25rem;
}

.sc-hero-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* Star Rating */
.sc-star-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sc-star-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 0.5rem;
}

.sc-star {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.75rem;
    color: var(--border-light);
    transition: all 0.15s;
    padding: 0.15rem;
    line-height: 1;
}

.sc-star:hover {
    transform: scale(1.2);
}

.sc-star.active {
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.sc-star-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-left: 0.5rem;
}

/* Slider Sections — scrollable area beneath sticky header */
.sc-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: 1.5rem;
}

/* Always-visible scrollbar for the scorecard scroll container */
.sc-scroll-wrap {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 42, 95, 0.4) rgba(255, 255, 255, 0.05);
}

.sc-scroll-wrap::-webkit-scrollbar {
    width: 8px;
}

.sc-scroll-wrap::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.sc-scroll-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 42, 95, 0.4);
    border-radius: 4px;
}

.sc-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 42, 95, 0.6);
}

.sc-section {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.sc-section-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
}

.sc-section-scale {
    font-weight: 400;
    font-size: 0.75rem;
    opacity: 0.6;
    text-transform: none;
    letter-spacing: normal;
}

/* Slider Rows */
.sc-slider-row {
    display: grid;
    grid-template-columns: 140px 1fr 70px;
    grid-template-rows: auto auto;
    gap: 0 0.75rem;
    align-items: center;
    margin-bottom: 0.85rem;
    padding: 0.35rem 0;
}

.sc-slider-label {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.sc-slider-track-wrap {
    grid-column: 2;
    grid-row: 1;
}

.sc-slider-val {
    grid-column: 3;
    grid-row: 1;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-primary);
    text-align: right;
}

.sc-slider-emoji {
    grid-column: 2 / 4;
    grid-row: 2;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.15rem;
    min-height: 1.1em;
}

/* Custom range slider with fill */
.sc-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    outline: none;
    border: none;
    background: linear-gradient(to right,
            var(--fill-color, var(--accent)) 0%,
            var(--fill-color, var(--accent)) var(--fill-pct, 50%),
            rgba(255, 255, 255, 0.06) var(--fill-pct, 50%),
            rgba(255, 255, 255, 0.06) 100%);
    transition: background 0.1s;
}

.sc-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4), 0 0 6px var(--fill-color, var(--accent-glow));
    border: 3px solid var(--fill-color, var(--accent));
    transition: transform 0.1s;
}

.sc-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.sc-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4), 0 0 6px var(--fill-color, var(--accent-glow));
    border: 3px solid var(--fill-color, var(--accent));
}

.sc-range::-moz-range-track {
    height: 10px;
    border-radius: 5px;
    background: transparent;
    border: none;
}

/* Footer */
.sc-footer {
    text-align: center;
    margin-top: 2rem;
}

.sc-reset-btn {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.85rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-heading);
}

.sc-reset-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Scorecard Mobile Responsive */
@media (max-width: 767px) {
    .sc-header {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.25rem;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .sc-image-wrapper {
        width: 100%;
        max-width: 280px;
        height: 200px;
        margin: 0 auto;
    }

    .sc-hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .sc-hero-value {
        font-size: 1.5rem;
    }

    .sc-slider-row {
        grid-template-columns: 1fr 60px;
        grid-template-rows: auto auto auto;
    }

    .sc-slider-label {
        grid-column: 1 / 3;
        grid-row: 1;
        margin-bottom: 0.3rem;
    }

    .sc-slider-track-wrap {
        grid-column: 1;
        grid-row: 2;
    }

    .sc-slider-val {
        grid-column: 2;
        grid-row: 2;
    }

    .sc-slider-emoji {
        grid-column: 1 / 3;
        grid-row: 3;
    }

    .sc-star {
        font-size: 1.4rem;
    }
}

/* ========================================
   TRADE ADVISOR — Decision Engine Tool
   ======================================== */

.ta-container {
    max-width: 1100px;
    margin: 0 auto;
}

.ta-intro {
    margin-bottom: 2rem;
}

.ta-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.ta-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Two-column layout */
.ta-sides {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.ta-side {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.ta-side-label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.ta-side-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: none;
    letter-spacing: normal;
}

/* Search input */
.ta-search-input {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.ta-search-input:focus {
    border-color: var(--accent);
}

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

/* Search dropdown */
.ta-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}

.ta-ac-item {
    padding: 0.65rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
}

.ta-ac-item:hover,
.ta-ac-item.active {
    background: var(--bg-panel-hover);
}

.ta-ac-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.ta-ac-brand {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Figure cards */
.ta-card-list {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 60px;
}

.ta-empty-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
    padding: 1.5rem 0;
}

.ta-figure-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 11, 20, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    transition: border-color 0.2s;
}

.ta-figure-card:hover {
    border-color: var(--border-light);
}

.ta-card-info {
    flex: 1;
    min-width: 0;
}

.ta-card-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ta-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.ta-card-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    transition: color 0.15s;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.ta-card-remove:hover {
    color: var(--danger);
}

/* Side summary */
.ta-side-summary {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ta-side-count {
    font-weight: 700;
}

.ta-side-msrp {
    color: var(--text-muted);
}

/* Action buttons */
.ta-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.ta-analyze-btn {
    font-size: 1.05rem;
    padding: 0.85rem 2.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ta-analyze-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ta-swap-btn,
.ta-clear-btn {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Loading state */
.ta-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 0;
    color: var(--text-secondary);
    font-size: 1rem;
}

.ta-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ta-spin 0.8s linear infinite;
}

@keyframes ta-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error state */
.ta-error {
    text-align: center;
    padding: 2rem;
    color: var(--danger);
    font-size: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
}

/* Sweetener Tip */
.ta-sweetener-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(255, 142, 60, 0.1);
    border: 1px solid rgba(255, 142, 60, 0.3);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.ta-sweetener-icon {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.ta-sweetener-msg {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.ta-sweetener-msg strong {
    color: #ff8e3c;
}

/* ── Verdict Banner ── */
.ta-verdict-banner {
    background: var(--bg-panel);
    border: 2px solid var(--verdict-color, var(--accent));
    border-radius: var(--radius-md);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.ta-verdict-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--verdict-color, var(--accent));
}

.ta-verdict-emoji {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.ta-verdict-text {
    flex: 1;
}

.ta-verdict-label {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--verdict-color, var(--accent));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.ta-verdict-explain {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.ta-verdict-confidence {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}

.ta-confidence-badge {
    font-weight: 800;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

/* ── Warnings ── */
.ta-warnings {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ta-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    color: #f59e0b;
}

/* ── Breakdown ── */
.ta-breakdown {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    margin-bottom: 1.5rem;
}

.ta-breakdown-side {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.ta-breakdown-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
}

.ta-vs {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ta-breakdown-header {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.ta-breakdown-stats {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.ta-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ta-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ta-stat-value {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ta-breakdown-figures {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ta-result-figure {
    background: rgba(10, 11, 20, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
}

.ta-rf-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.ta-rf-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.ta-rf-confidence {
    margin-left: auto;
}

.ta-rf-warning {
    font-size: 0.72rem;
    color: var(--danger);
    margin-top: 0.3rem;
}

.ta-rf-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.3rem;
}

/* ── Delta Summary ── */
.ta-delta-summary {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.ta-delta-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.ta-delta-row:last-child {
    border-bottom: none;
}

.ta-delta-blended {
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

.ta-delta-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.ta-delta-value {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
}

.ta-delta-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

/* ── Trade Advisor Responsive ── */
@media (max-width: 767px) {
    .ta-sides {
        grid-template-columns: 1fr;
    }

    .ta-breakdown {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .ta-breakdown-divider {
        padding: 0.5rem 0;
    }

    .ta-verdict-banner {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        padding: 1.25rem;
    }

    .ta-verdict-confidence {
        text-align: center;
    }

    .ta-actions {
        flex-wrap: wrap;
    }

    .ta-delta-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.35rem;
    }

    .ta-delta-note {
        grid-column: 1 / 3;
        text-align: left;
    }

    .ta-rf-stats {
        gap: 0.3rem 0.5rem;
    }
}

/* ── Admin System Logs ─────────────────────────────── */
.admin-log-filters {
    flex-wrap: wrap;
}

@media (max-width: 767px) {

    .admin-log-filters select,
    .admin-log-filters input {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* ========================================
   AMBIENT ORBS & PREMIUM EFFECTS
   ======================================== */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
    animation: float 20s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(255, 42, 95, 0.15);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: rgba(59, 130, 246, 0.1);
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(50px, 30px) scale(1.1);
    }

    100% {
        transform: translate(-30px, 60px) scale(0.9);
    }
}

/* ========================================
   MOBILE BOTTOM NAVIGATION
   ======================================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: rgba(7, 9, 20, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-items-mobile {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

.nav-item-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    flex: 1;
    height: 100%;
    transition: color 0.2s ease;
    cursor: pointer;
}

.nav-item-mobile.active {
    color: var(--accent);
}

.nav-icon-mobile {
    width: 24px;
    height: 24px;
}

.nav-label-mobile {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }

    .hamburger-btn {
        display: none !important;
    }

    .bottom-nav {
        display: block;
    }

    .content-area {
        padding: 1.5rem;
        padding-bottom: 90px !important;
    }
}

/* ── Gamification Badges & Progress ── */
.badge-recruit {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #cbd5e1;
    border: 1px solid #475569;
}

.badge-operative {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.4));
    color: #93c5fd;
    border: 1px solid #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.badge-master {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(202, 138, 4, 0.4));
    color: #fde047;
    border: 1px solid #eab308;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.3);
}

.badge-legend {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(147, 51, 234, 0.5));
    color: #e9d5ff;
    border: 1px solid #a855f7;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.level-progress-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.level-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Ticker Tape ── */
.ticker-wrap {
    width: 100%;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    height: 32px;
    overflow: hidden;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 99;
    display: flex;
    align-items: center;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
}

.ticker-content {
    white-space: nowrap;
    padding-left: 100%;
    display: inline-block;
    animation: ticker 40s linear infinite;
    font-family: monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ticker-content span.ticker-item {
    margin-right: 3rem;
}

.ticker-content span.ticker-negative {
    color: var(--danger);
}

.ticker-content span.ticker-neutral {
    color: var(--text-secondary);
}

.ticker-content span.ticker-accent {
    color: var(--warning);
}

@keyframes ticker {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

@media (max-width: 768px) {
    .ticker-wrap {
        bottom: 72px;
        height: 28px;
    }
}

