/* ===== THEME VARIABLES ===== */
:root {
    --bg-primary: #040405;
    --bg-secondary: #080808;
    --bg-card: rgba(255, 255, 255, 0.015);
    --bg-card-hover: rgba(255, 255, 255, 0.04);
    --bg-input: rgba(24, 24, 27, 0.7);
    --bg-sidebar: rgba(8, 8, 8, 0.97);
    --bg-header: rgba(0, 0, 0, 0.4);
    --bg-modal: #0a0a0a;
    --bg-elevated: rgba(255, 255, 255, 0.03);
    --text-primary: #f4f4f5;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.25);
    --text-accent: rgba(255, 255, 255, 0.8);
    --border-primary: rgba(255, 255, 255, 0.04);
    --border-secondary: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.1);
    --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.4);
    --gradient-bottom: linear-gradient(to top, #040405 0%, #040405 60%, transparent 100%);
    --bubble-user-bg: linear-gradient(135deg, #ffffff, #f4f4f5);
    --bubble-user-text: #000;
    --bubble-ai-bg: rgba(255, 255, 255, 0.02);
    --noise-opacity: 0.02;
    --scrollbar-thumb: rgba(255, 255, 255, 0.08);
    --mode: dark;
}

[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-input: rgba(255, 255, 255, 0.95);
    --bg-sidebar: rgba(250, 250, 252, 0.98);
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-modal: #ffffff;
    --bg-elevated: rgba(0, 0, 0, 0.03);
    --text-primary: #1d1d1f;
    --text-secondary: rgba(0, 0, 0, 0.65);
    --text-muted: rgba(0, 0, 0, 0.5);
    --text-accent: #1d1d1f;
    --border-primary: rgba(0, 0, 0, 0.06);
    --border-secondary: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
    --gradient-bottom: linear-gradient(to top, #f5f5f7 0%, #f5f5f7 50%, transparent 100%);
    --bubble-user-bg: linear-gradient(135deg, #1d1d1f, #2d2d2f);
    --bubble-user-text: #fff;
    --bubble-ai-bg: rgba(0, 0, 0, 0.025);
    --noise-opacity: 0.008;
    --scrollbar-thumb: rgba(0, 0, 0, 0.12);
    --mode: light;
}

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

/* Targeted transitions — NOT on *, which causes massive mobile jank */
body, main, header, #sidebar, .input-ring, .chat-bubble-ai, .chat-bubble-user,
.theme-toggle, #profile-dropdown, .pricing-card, .hero-card, .style-chip,
.ws-tab, .ws-action-btn, .ws-file-item, #workspace-panel, #ws-overlay,
.mode-dropdown-item, .plus-dropdown-item, #scroll-bottom-btn {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100dvh;
    width: 100vw;
    display: flex;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Ambient subtle glow */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 20%, rgba(220, 38, 38, 0.03) 0%, transparent 50%), radial-gradient(ellipse at 80% 80%, rgba(16, 185, 129, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: ambientShift 20s ease-in-out infinite alternate;
}

[data-theme="light"] body::before {
    background: radial-gradient(ellipse at 30% 30%, rgba(99, 102, 241, 0.025) 0%, transparent 50%), radial-gradient(ellipse at 70% 70%, rgba(16, 185, 129, 0.02) 0%, transparent 50%);
}

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

    100% {
        transform: translate(-2%, 2%) scale(1.02)
    }
}

.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 50;
    opacity: var(--noise-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.modal-blur {
    backdrop-filter: blur(30px) saturate(1.5);
    -webkit-backdrop-filter: blur(30px) saturate(1.5);
}

/* RED LOGO & PREMIUM 3D ANIMATIONS */
.logo-orb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(30, 30, 30, 0.9), #000);
    box-shadow:
        0 0 60px rgba(220, 38, 38, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.2),
        inset 0 0 50px rgba(220, 38, 38, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: visible;
    transform-style: preserve-3d;
    perspective: 1200px;
    z-index: 10;
}

.logo-orb-hero {
    width: 140px !important;
    height: 140px !important;
    animation: premiumFloat 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Core Holographic Ring */
.logo-orb-hero::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: rgba(220, 38, 38, 0.9);
    border-right-color: rgba(16, 185, 129, 0.6);
    border-bottom-color: rgba(99, 102, 241, 0.6);
    animation: quantumSpin 4s linear infinite;
    pointer-events: none;
    transform-style: preserve-3d;
    box-shadow:
        0 0 30px rgba(220, 38, 38, 0.5),
        inset 0 0 20px rgba(220, 38, 38, 0.3);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

/* Outer Orbital Ring */
.logo-orb-hero::after {
    content: '';
    position: absolute;
    top: -45%;
    left: -45%;
    width: 190%;
    height: 190%;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    border-left-color: rgba(251, 191, 36, 0.9);
    animation: quantumSpinReverse 8s linear infinite;
    pointer-events: none;
    transform-style: preserve-3d;
    z-index: -1;
    opacity: 0.8;
    box-shadow: inset 0 0 15px rgba(251, 191, 36, 0.2);
}

.logo-orb img {
    position: relative;
    z-index: 5;
    width: 85%;
    height: 85%;
    border-radius: 50%;
    object-fit: cover;
    mix-blend-mode: screen;
    animation: hologramPulse 3s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 20px rgba(220, 38, 38, 0.8)) drop-shadow(0 0 40px rgba(220, 38, 38, 0.4));
    transform-style: preserve-3d;
    border: 2px solid rgba(255, 255, 255, 0.05);
}

.logo-orb-sm {
    width: 34px !important;
    height: 34px !important;
    animation: none;
    transform: none;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.2);
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-orb-sm::before,
.logo-orb-sm::after {
    display: none !important;
}

.logo-orb-sm img {
    width: 90%;
    height: 90%;
    animation: none;
    transform: none;
    filter: drop-shadow(0 0 5px rgba(220, 38, 38, 0.5));
    border: none;
}

.logo-orb-xs {
    width: 24px !important;
    height: 24px !important;
    border: none;
    box-shadow: none;
    overflow: hidden !important;
}

.logo-orb-xs::before,
.logo-orb-xs::after {
    display: none !important;
}

.logo-orb-xs img {
    width: 100%;
    height: 100%;
    animation: none;
    transform: none;
    filter: none;
    border: none;
}

@keyframes premiumFloat {

    0%,
    100% {
        transform: translateY(0) rotateX(15deg) rotateY(-15deg);
        box-shadow: 0 30px 60px rgba(220, 38, 38, 0.25), inset 0 0 30px rgba(255, 255, 255, 0.15);
    }

    50% {
        transform: translateY(-15px) rotateX(-5deg) rotateY(10deg);
        box-shadow: 0 40px 80px rgba(220, 38, 38, 0.45), inset 0 0 40px rgba(255, 255, 255, 0.25);
    }
}

@keyframes quantumSpin {
    0% {
        transform: rotateX(65deg) rotateY(15deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(65deg) rotateY(15deg) rotateZ(360deg);
    }
}

@keyframes quantumSpinReverse {
    0% {
        transform: rotateX(75deg) rotateY(-20deg) rotateZ(360deg);
    }

    100% {
        transform: rotateX(75deg) rotateY(-20deg) rotateZ(0deg);
    }
}

@keyframes hologramPulse {
    0% {
        transform: scale(1) translateZ(20px);
        filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.6)) brightness(1);
    }

    100% {
        transform: scale(1.08) translateZ(50px);
        filter: drop-shadow(0 0 35px rgba(220, 38, 38, 1)) drop-shadow(0 0 60px rgba(220, 38, 38, 0.5)) brightness(1.3);
    }
}

/* Chat Bubbles */
.chat-bubble-ai {
    background: var(--bubble-ai-bg);
    border: 1px solid var(--border-secondary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: 24px;
    border-top-left-radius: 6px;
    backdrop-filter: blur(10px);
    color: var(--text-primary) !important;
}

/* FIX: Force AI bubble text color to never turn black in dark mode */
[data-theme="dark"] .chat-bubble-ai,
[data-theme="dark"] .chat-bubble-ai *:not(code):not(pre):not(.code-header):not(.code-header *) {
    color: var(--text-primary);
}

[data-theme="dark"] .chat-bubble-ai .prose,
[data-theme="dark"] .chat-bubble-ai .prose p,
[data-theme="dark"] .chat-bubble-ai .prose li,
[data-theme="dark"] .chat-bubble-ai .prose h1,
[data-theme="dark"] .chat-bubble-ai .prose h2,
[data-theme="dark"] .chat-bubble-ai .prose h3,
[data-theme="dark"] .chat-bubble-ai .prose h4,
[data-theme="dark"] .chat-bubble-ai .prose strong,
[data-theme="dark"] .chat-bubble-ai .prose em,
[data-theme="dark"] .chat-bubble-ai .prose span,
[data-theme="dark"] .chat-bubble-ai .prose blockquote {
    color: #f4f4f5 !important;
}

/* FIX: Light theme AI bubble text — comprehensive */
[data-theme="light"] .chat-bubble-ai .prose,
[data-theme="light"] .chat-bubble-ai .prose p,
[data-theme="light"] .chat-bubble-ai .prose li,
[data-theme="light"] .chat-bubble-ai .prose span,
[data-theme="light"] .chat-bubble-ai .prose strong,
[data-theme="light"] .chat-bubble-ai .prose h1,
[data-theme="light"] .chat-bubble-ai .prose h2,
[data-theme="light"] .chat-bubble-ai .prose h3,
[data-theme="light"] .chat-bubble-ai .prose h4,
[data-theme="light"] .chat-bubble-ai .prose h5,
[data-theme="light"] .chat-bubble-ai .prose h6,
[data-theme="light"] .chat-bubble-ai .prose blockquote,
[data-theme="light"] .chat-bubble-ai .prose td,
[data-theme="light"] .chat-bubble-ai .prose th,
[data-theme="light"] .chat-bubble-ai .prose em,
[data-theme="light"] .chat-bubble-ai .prose ol li::marker {
    color: #1d1d1f !important;
}
[data-theme="light"] .chat-bubble-ai .prose a {
    color: #2563eb !important;
}
[data-theme="light"] .chat-bubble-ai .prose.prose-invert {
    --tw-prose-body: #1d1d1f !important;
    --tw-prose-headings: #1d1d1f !important;
    --tw-prose-bold: #1d1d1f !important;
    --tw-prose-links: #2563eb !important;
    color: #1d1d1f !important;
}
[data-theme="light"] .chat-bubble-ai .prose pre {
    background: #f0f0f2 !important;
    border: 1px solid rgba(0,0,0,0.08);
}
[data-theme="light"] .chat-bubble-ai .prose code {
    color: #c7254e !important;
    background: rgba(0,0,0,0.04) !important;
}
[data-theme="light"] .chat-bubble-ai .prose pre code {
    color: #1d1d1f !important;
    background: transparent !important;
}

.chat-bubble-user {
    background: var(--bubble-user-bg);
    color: var(--bubble-user-text);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    border-top-right-radius: 6px;
}

[data-theme="light"] .chat-bubble-user .prose {
    color: #fff !important;
}

[data-theme="light"] .chat-bubble-user .prose pre {
    background: #1a1a1a !important;
    border-color: #333;
    color: #eee;
}

[data-theme="light"] .chat-bubble-user .prose code {
    color: #eee;
}

[data-theme="light"] .chat-bubble-ai {
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.prose pre {
    background: #09090b !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    margin-top: 0.75rem;
    overflow-x: auto;
}

.prose code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85em;
}

.prose p {
    line-height: 1.75;
}

.chat-bubble-user.prose,
.chat-bubble-user .prose,
.chat-bubble-user.prose.prose-invert,
.chat-bubble-user .prose.prose-invert {
    color: var(--bubble-user-text) !important;
}

.chat-bubble-user .prose pre,
.chat-bubble-user.prose pre {
    background: rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(0, 0, 0, 0.1);
    color: inherit;
}

.chat-bubble-user .prose code,
.chat-bubble-user.prose code {
    color: inherit;
    font-weight: 600;
}

/* Markdown Tables */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

.prose th {
    background: rgba(255, 255, 255, 0.04);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.prose td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

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

.prose tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.01);
}

.chat-bubble-user .prose table {
    border-color: rgba(0, 0, 0, 0.1);
}

.chat-bubble-user .prose th {
    background: rgba(0, 0, 0, 0.04);
    color: #000;
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.chat-bubble-user .prose td {
    color: #111;
    border-bottom-color: rgba(0, 0, 0, 0.04);
}

.chat-bubble-user .prose tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.02);
}

/* Input Ring */
.input-ring {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    background: var(--bg-input);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-secondary);
    border-radius: 28px;
}

.input-ring:focus-within {
    box-shadow: 0 0 0 1px var(--border-hover), 0 10px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--border-hover) !important;
}

[data-theme="light"] .input-ring {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .input-ring:focus-within {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12), 0 8px 32px rgba(0, 0, 0, 0.08);
    border-color: rgba(99, 102, 241, 0.25) !important;
}

.avatar-ai {
    background: #fff;
    color: #000;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar-ai:hover {
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
    transform: scale(1.06) rotate(1deg);
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #fff;
    color: #000;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 100;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.has-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.reveal-up {
    opacity: 0;
    transform: translateY(20px);
}

.chat-msg {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#sidebar-chat-list>div {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 12px;
}

#sidebar-chat-list>div:hover {
    transform: translateX(2px);
    background: rgba(255, 255, 255, 0.04);
}

button {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#hero-section {
    position: relative;
}

#hero-section::before {
    content: '';
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    pointer-events: none;
}

/* Hero gradient title shimmer */
.hero-title {
    background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 50%, #ffffff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleShimmer 8s ease-in-out infinite;
}

@keyframes titleShimmer {

    0%,
    100% {
        background-position: 0% 50%
    }

    50% {
        background-position: 100% 50%
    }
}

/* Animated Text Carousel */
.animated-text-container {
    animation: textScroll 10s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
}

@keyframes textScroll {

    0%,
    20% {
        transform: translateY(0);
    }

    25%,
    45% {
        transform: translateY(-32px);
    }

    50%,
    70% {
        transform: translateY(-64px);
    }

    75%,
    95% {
        transform: translateY(-96px);
    }

    100% {
        transform: translateY(-128px);
    }
}

@keyframes pulse-voice {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4)
    }

    70% {
        transform: scale(1.06);
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0)
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0)
    }
}

.voice-active {
    animation: pulse-voice 1.5s infinite;
}

@media(max-width:767px) {
    .msg-actions {
        opacity: 1 !important
    }

    .chat-item-actions {
        opacity: 1 !important
    }

    .chat-item-actions i {
        padding: 6px
    }

    /* Kill heavy 3D animations on mobile for buttery 60fps */
    .logo-orb-hero {
        animation: none !important;
        transform: none !important;
    }
    .logo-orb-hero::before {
        animation: quantumSpin 8s linear infinite !important; /* Slow down */
        border-width: 2px !important;
    }
    .logo-orb-hero::after {
        display: none !important; /* Kill outer ring on mobile */
    }
    .logo-orb img {
        animation: none !important;
        transform: none !important;
        filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.5)) !important;
    }
    
    /* Disable Vanta.js and noise on mobile */
    #vanta-bg { display: none !important; }
    .noise { display: none !important; }
    body::before { display: none !important; }
}

#confirm-modal {
    transition: opacity 0.25s;
}

#sidebar-overlay {
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#sidebar-overlay.sidebar-open {
    pointer-events: auto;
}

.word-counter {
    position: absolute;
    bottom: 52px;
    right: 20px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.2);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.response-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 4px;
    margin-left: 4px;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.msg-timestamp {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.12);
    font-weight: 400;
}

/* Typing indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.3
    }

    30% {
        transform: translateY(-8px);
        opacity: 1
    }
}

/* Keyboard shortcut badge */
.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 9px;
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════ */
/* 🎤 ULTRA-PREMIUM VOICE MODAL — BILLION-DOLLAR 3D DESIGN   */
/* ═══════════════════════════════════════════════════════════ */

/* === Background === */
.voice-modal-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 30%, #0c0622 0%, #030108 50%, #000000 100%);
    z-index: 0;
}
.voice-modal-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 25% 60%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 75% 40%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(6, 182, 212, 0.04) 0%, transparent 40%);
    animation: voiceBgShift 8s ease-in-out infinite alternate;
}
@keyframes voiceBgShift {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.1); }
}

/* === Floating Particles === */
.voice-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}
.voice-particles::before,
.voice-particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.5);
    box-shadow:
        20vw 15vh 0 rgba(99, 102, 241, 0.4),
        50vw 25vh 0 rgba(139, 92, 246, 0.3),
        80vw 10vh 0 rgba(6, 182, 212, 0.3),
        15vw 70vh 0 rgba(99, 102, 241, 0.2),
        70vw 80vh 0 rgba(139, 92, 246, 0.3),
        40vw 50vh 0 rgba(6, 182, 212, 0.2),
        90vw 60vh 0 rgba(99, 102, 241, 0.3),
        30vw 35vh 0 rgba(167, 139, 250, 0.25),
        60vw 90vh 0 rgba(6, 182, 212, 0.2),
        10vw 45vh 0 rgba(99, 102, 241, 0.15),
        85vw 30vh 0 rgba(139, 92, 246, 0.2),
        55vw 65vh 0 rgba(6, 182, 212, 0.25);
    animation: particleFloat 20s linear infinite;
}
.voice-particles::after {
    width: 3px;
    height: 3px;
    animation-delay: -10s;
    animation-duration: 25s;
    opacity: 0.6;
}
@keyframes particleFloat {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-100vh) rotate(360deg); }
}

/* === Main Content Container === */
.voice-main-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 420px;
    padding: 24px;
    cursor: pointer;
    min-height: 100dvh;
    user-select: none;
    -webkit-user-select: none;
}

/* === 3D Orb Container === */
.voice-orb-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transform-style: preserve-3d;
}

/* Outer Pulse Rings */
.voice-pulse-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(99, 102, 241, 0.15);
    animation: voicePulseExpand 3s ease-out infinite;
    pointer-events: none;
}
.voice-pulse-ring-1 {
    width: 100%;
    height: 100%;
    animation-delay: 0s;
}
.voice-pulse-ring-2 {
    width: 100%;
    height: 100%;
    animation-delay: 1s;
}
.voice-pulse-ring-3 {
    width: 100%;
    height: 100%;
    animation-delay: 2s;
}

@keyframes voicePulseExpand {
    0% {
        transform: scale(0.85);
        opacity: 0.6;
        border-color: rgba(99, 102, 241, 0.3);
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
        border-color: rgba(99, 102, 241, 0);
    }
}

/* === Main Orb Ring === */
.voice-orb-ring {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border: 2px solid rgba(99, 102, 241, 0.25);
    box-shadow: 
        0 0 30px rgba(99, 102, 241, 0.2),
        0 0 60px rgba(139, 92, 246, 0.1),
        inset 0 0 20px rgba(99, 102, 241, 0.1);
}

.voice-orb-ring::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    background: conic-gradient(from 0deg, rgba(99, 102, 241, 0.5), rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.3), rgba(99, 102, 241, 0.5)) border-box;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    animation: orbRingSpin 4s linear infinite;
}
@keyframes orbRingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Orb Inner === */
.voice-orb-inner {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 40% 35%, rgba(99, 102, 241, 0.2), rgba(15, 10, 40, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.voice-orb-inner::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 20%;
    width: 60%;
    height: 40%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* === Holographic Core === */
.voice-orb-core {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.6) 0%, rgba(139, 92, 246, 0.3) 50%, transparent 80%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: coreBreath 3s ease-in-out infinite;
    position: relative;
}
@keyframes coreBreath {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.15); filter: brightness(1.3); }
}

.voice-orb-nucleus {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, rgba(99, 102, 241, 0.8) 50%, transparent 100%);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.8), 0 0 40px rgba(139, 92, 246, 0.4);
    animation: nucleusPulse 2s ease-in-out infinite;
}
@keyframes nucleusPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.4); opacity: 1; }
}

/* === State Colors === */
.voice-orb-ring.state-listening {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.3), 0 0 80px rgba(139, 92, 246, 0.15), inset 0 0 30px rgba(99, 102, 241, 0.15);
}
.voice-orb-ring.state-speaking {
    border-color: rgba(52, 211, 153, 0.4);
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(16, 185, 129, 0.1));
    box-shadow: 0 0 40px rgba(52, 211, 153, 0.3), 0 0 80px rgba(16, 185, 129, 0.15), inset 0 0 30px rgba(52, 211, 153, 0.15);
}
.voice-orb-ring.state-speaking::before {
    background: conic-gradient(from 0deg, rgba(52, 211, 153, 0.5), rgba(16, 185, 129, 0.3), rgba(6, 182, 212, 0.3), rgba(52, 211, 153, 0.5)) border-box;
}
.voice-orb-ring.state-thinking {
    border-color: rgba(251, 191, 36, 0.3);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.06));
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.2), 0 0 60px rgba(245, 158, 11, 0.1);
    animation: thinkingPulse 1.5s ease-in-out infinite;
}
@keyframes thinkingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}
.voice-orb-ring.state-thinking::before {
    background: conic-gradient(from 0deg, rgba(251, 191, 36, 0.5), rgba(245, 158, 11, 0.3), rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.5)) border-box;
    animation: orbRingSpin 1.5s linear infinite;
}
.voice-orb-ring.state-error {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.06));
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.2);
}
.voice-orb-ring.state-error::before {
    background: conic-gradient(from 0deg, rgba(239, 68, 68, 0.5), rgba(220, 38, 38, 0.3), rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.5)) border-box;
}

/* Inner state colors */
.voice-orb-inner.state-listening { background: radial-gradient(circle at 40% 35%, rgba(99, 102, 241, 0.25), rgba(15, 10, 40, 0.95)); }
.voice-orb-inner.state-speaking { background: radial-gradient(circle at 40% 35%, rgba(52, 211, 153, 0.25), rgba(10, 40, 30, 0.95)); }
.voice-orb-inner.state-thinking { background: radial-gradient(circle at 40% 35%, rgba(251, 191, 36, 0.2), rgba(40, 30, 10, 0.95)); }
.voice-orb-inner.state-error { background: radial-gradient(circle at 40% 35%, rgba(239, 68, 68, 0.2), rgba(40, 10, 10, 0.95)); }

.voice-orb-inner.state-speaking .voice-orb-core {
    background: radial-gradient(circle, rgba(52, 211, 153, 0.6) 0%, rgba(16, 185, 129, 0.3) 50%, transparent 80%);
}
.voice-orb-inner.state-speaking .voice-orb-nucleus {
    background: radial-gradient(circle, #fff 0%, rgba(52, 211, 153, 0.8) 50%, transparent 100%);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.8), 0 0 40px rgba(16, 185, 129, 0.4);
}
.voice-orb-inner.state-thinking .voice-orb-core {
    background: radial-gradient(circle, rgba(251, 191, 36, 0.5) 0%, rgba(245, 158, 11, 0.3) 50%, transparent 80%);
    animation: coreBreath 1s ease-in-out infinite;
}
.voice-orb-inner.state-thinking .voice-orb-nucleus {
    background: radial-gradient(circle, #fff 0%, rgba(251, 191, 36, 0.8) 50%, transparent 100%);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.8), 0 0 40px rgba(245, 158, 11, 0.4);
}
.voice-orb-inner.state-error .voice-orb-core {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.5) 0%, rgba(220, 38, 38, 0.3) 50%, transparent 80%);
}
.voice-orb-inner.state-error .voice-orb-nucleus {
    background: radial-gradient(circle, #fff 0%, rgba(239, 68, 68, 0.8) 50%, transparent 100%);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.8), 0 0 40px rgba(220, 38, 38, 0.4);
}

/* Speaking state pulse rings change */
.state-speaking ~ .voice-pulse-ring { border-color: rgba(52, 211, 153, 0.15); }
.state-thinking ~ .voice-pulse-ring { border-color: rgba(251, 191, 36, 0.1); animation-duration: 1.5s; }

/* === Audio Wave Visualiser === */
.voice-wave-container {
    width: 100%;
    max-width: 320px;
    height: 60px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}
.voice-wave-canvas {
    width: 100%;
    height: 100%;
    display: block;
    transition: opacity 0.4s ease;
}

/* === Status Text === */
.voice-status-group {
    margin-bottom: 24px;
}
.voice-status-text {
    font-family: 'Inter', 'SF Pro Display', -apple-system, sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px 0;
    letter-spacing: -0.03em;
    line-height: 1.2;
    background: linear-gradient(135deg, #fff 0%, rgba(167, 139, 250, 0.9) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.voice-status-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    margin: 0 0 12px 0;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.voice-transcript-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    max-width: 340px;
    min-height: 44px;
    line-height: 1.6;
    padding: 0 16px;
}

/* === Action Buttons === */
.voice-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.voice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
}
.voice-btn:active {
    transform: scale(0.92) !important;
}

.voice-btn-interrupt {
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(251, 191, 36, 0.3) !important;
    color: #fbbf24;
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.15);
    animation: interruptGlow 1.5s ease-in-out infinite alternate;
}
.voice-btn-interrupt i {
    font-size: 14px;
}
@keyframes interruptGlow {
    0% { box-shadow: 0 0 15px rgba(251, 191, 36, 0.1); }
    100% { box-shadow: 0 0 30px rgba(251, 191, 36, 0.3); }
}
.voice-btn-interrupt:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.15));
    transform: scale(1.05);
}

.voice-btn-mic {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #fff;
    font-size: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.voice-btn-mic:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.08);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.1);
}

.voice-btn-end {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 24px rgba(239, 68, 68, 0.4), 0 0 0 4px rgba(239, 68, 68, 0.08);
    border: none !important;
}
.voice-btn-end:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.5), 0 0 0 6px rgba(239, 68, 68, 0.12);
}

/* === Hint Text === */
.voice-hint-text {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
    margin: 0;
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 767px) {
    .voice-orb-container {
        width: 160px;
        height: 160px;
    }
    .voice-orb-ring {
        width: 130px;
        height: 130px;
    }
    .voice-orb-inner {
        width: 105px;
        height: 105px;
    }
    .voice-orb-core {
        width: 55px;
        height: 55px;
    }
    .voice-orb-nucleus {
        width: 16px;
        height: 16px;
    }
    .voice-status-text {
        font-size: 22px;
    }
    .voice-wave-container {
        max-width: 260px;
        height: 48px;
    }
    .voice-main-content {
        padding: 16px;
    }
    .voice-btn-end, .voice-btn-mic {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    .voice-btn-interrupt {
        padding: 10px 20px;
        font-size: 12px;
    }
    .voice-transcript-text {
        font-size: 13px;
        padding: 0 12px;
    }
}

@media (max-width: 380px) {
    .voice-orb-container {
        width: 140px;
        height: 140px;
    }
    .voice-orb-ring {
        width: 110px;
        height: 110px;
    }
    .voice-orb-inner {
        width: 88px;
        height: 88px;
    }
    .voice-status-text {
        font-size: 20px;
    }
}

/* === Aurora Gradient Layers (depth effect) === */
.voice-aurora {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: screen;
}
.voice-aurora-1 {
    background: radial-gradient(ellipse 80% 50% at 20% 80%, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    animation: auroraFloat1 12s ease-in-out infinite alternate;
}
.voice-aurora-2 {
    background: radial-gradient(ellipse 60% 40% at 80% 20%, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
    animation: auroraFloat2 15s ease-in-out infinite alternate;
}
@keyframes auroraFloat1 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    50% { transform: translate(5%, -5%) scale(1.1); opacity: 0.5; }
    100% { transform: translate(-3%, 3%) scale(1.05); opacity: 0.35; }
}
@keyframes auroraFloat2 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.2; }
    50% { transform: translate(-5%, 5%) scale(1.15); opacity: 0.4; }
    100% { transform: translate(3%, -3%) scale(1.05); opacity: 0.25; }
}

/* === 3D Orbital Rings (Saturn effect) === */
.voice-orbital {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.08);
    pointer-events: none;
}
.voice-orbital-1 {
    width: 220px;
    height: 220px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(65deg) rotateZ(0deg);
    animation: orbitalSpin1 8s linear infinite;
    border-color: rgba(99, 102, 241, 0.12);
}
.voice-orbital-2 {
    width: 240px;
    height: 240px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(70deg) rotateZ(45deg);
    animation: orbitalSpin2 12s linear infinite reverse;
    border-color: rgba(6, 182, 212, 0.08);
}
@keyframes orbitalSpin1 {
    0% { transform: translate(-50%, -50%) rotateX(65deg) rotateZ(0deg); }
    100% { transform: translate(-50%, -50%) rotateX(65deg) rotateZ(360deg); }
}
@keyframes orbitalSpin2 {
    0% { transform: translate(-50%, -50%) rotateX(70deg) rotateZ(45deg); }
    100% { transform: translate(-50%, -50%) rotateX(70deg) rotateZ(405deg); }
}

/* === Karaoke Transcript Container === */
.voice-karaoke-container {
    width: 100%;
    max-width: 380px;
    min-height: 48px;
    margin-bottom: 24px;
    padding: 10px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.4s ease;
}
.voice-karaoke-container .voice-transcript-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    max-width: 100%;
    min-height: 28px;
    line-height: 1.6;
    padding: 0;
    transition: color 0.3s ease;
}

/* Speaking state karaoke highlight */
.state-speaking ~ .voice-karaoke-container,
.voice-karaoke-container.is-speaking {
    background: rgba(52, 211, 153, 0.04);
    border-color: rgba(52, 211, 153, 0.12);
}
.voice-karaoke-container.is-speaking .voice-transcript-text {
    color: rgba(255, 255, 255, 0.95);
}

/* Orbital state colors */
.state-speaking ~ .voice-orbital-1 { border-color: rgba(52, 211, 153, 0.15); }
.state-speaking ~ .voice-orbital-2 { border-color: rgba(16, 185, 129, 0.08); }
.state-thinking ~ .voice-orbital-1 { border-color: rgba(251, 191, 36, 0.12); animation-duration: 4s; }
.state-thinking ~ .voice-orbital-2 { border-color: rgba(245, 158, 11, 0.06); animation-duration: 6s; }

/* === Responsive orbital/aurora === */
@media (max-width: 767px) {
    .voice-orbital-1 { width: 180px; height: 180px; }
    .voice-orbital-2 { width: 200px; height: 200px; }
    .voice-karaoke-container { max-width: 300px; padding: 8px 16px; }
    .voice-karaoke-container .voice-transcript-text { font-size: 13px; }
}
@media (max-width: 380px) {
    .voice-orbital-1 { width: 160px; height: 160px; }
    .voice-orbital-2 { width: 175px; height: 175px; }
}

/* === OLD voice-bars kept for backward compatibility === */

@keyframes shimmer {
    0% {
        opacity: 0.3
    }

    50% {
        opacity: 1
    }

    100% {
        opacity: 0.3
    }
}

.loading-dot {
    animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: translateY(0)
    }

    40% {
        transform: translateY(-6px)
    }
}

/* Skeleton shimmer loading */
@keyframes skeletonShimmer {
    0% {
        background-position: -200% 0
    }

    100% {
        background-position: 200% 0
    }
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    margin-bottom: 8px;
}

/* Free usage banner */
.usage-banner {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.usage-banner:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.usage-dots {
    display: flex;
    gap: 4px;
}

.usage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.usage-dot.used {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

.usage-dot.warning {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.hero-card {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-primary) !important;
    backdrop-filter: blur(8px);
    border-radius: 20px;
}

.hero-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card), 0 0 0 1px var(--border-hover);
    background: var(--bg-card-hover) !important;
}

.hero-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    transition: left 0.5s ease;
}

.hero-card:hover::after {
    left: 100%;
}

[data-theme="light"] .hero-card {
    background: rgba(255, 255, 255, 0.7) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .hero-card:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.hero-card .card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.hero-card:hover .card-icon {
    transform: scale(1.15) rotate(-3deg);
}

.slash-tag {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.slash-tag:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .slash-tag {
    background: rgba(0, 0, 0, 0.04) !important;
    color: rgba(0, 0, 0, 0.5) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .slash-tag:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    color: rgba(0, 0, 0, 0.8) !important;
}

#toast-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
}

/* Sidebar glass */
#sidebar {
    background: var(--bg-sidebar);
    backdrop-filter: blur(24px);
    z-index: 150;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

[data-theme="light"] #sidebar {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

@keyframes sendPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25)
    }

    100% {
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0)
    }
}

#send-btn:hover {
    animation: sendPulse 1s infinite;
}

#chat-container {
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

/* Intel badges */
.intel-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 500;
    margin-bottom: 8px;
    margin-right: 4px;
}

.intel-badge i {
    color: rgba(250, 204, 21, 0.7);
    font-size: 9px;
}

/* ===== Search Steps Strip (Real-time search activity badges) ===== */
.search-steps-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(8px);
}

.search-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 500;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    letter-spacing: 0.01em;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid color-mix(in srgb, var(--badge-color, #60a5fa) 20%, transparent);
    color: var(--badge-color, #60a5fa);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.search-step-badge:hover {
    background: color-mix(in srgb, var(--badge-color, #60a5fa) 10%, transparent);
    transform: translateY(-1px);
}

.search-step-badge i {
    font-size: 9px;
    opacity: 0.8;
}

/* Sectrox loader shimmer background */
.sectrox-loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.04), transparent);
    animation: loaderShimmer 2.5s ease-in-out infinite;
}

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

/* Light theme search badges */
[data-theme="light"] .search-steps-strip {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .search-step-badge {
    background: rgba(0, 0, 0, 0.03);
    border-color: color-mix(in srgb, var(--badge-color, #3b82f6) 25%, transparent);
    color: color-mix(in srgb, var(--badge-color, #3b82f6) 80%, #000);
}

/* ===== MOBILE — BUTTERY SMOOTH 60fps ===== */
@media(max-width:767px) {
    body {
        padding: 0 !important;
        gap: 0 !important;
        overflow-x: hidden !important;
        position: relative;
        -webkit-overflow-scrolling: touch;
    }

    body::before {
        display: none;
    }

    main {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100%;
        border: none !important;
        border-radius: 0 !important;
    }

    /* Sidebar explicit mobile fixes */
    #sidebar {
        width: 80vw !important;
        max-width: 300px !important;
        position: fixed !important;
        left: 0;
        top: 0;
        transform: translateX(-100%) !important;
        border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
        background: rgba(5, 5, 5, 0.98) !important;
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        z-index: 160 !important;
        will-change: transform;
    }

    #sidebar.sidebar-open-mobile {
        transform: translateX(0) !important;
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
    }

    header {
        height: 52px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    }

    #header-chat-title {
        font-size: 13px !important;
        max-width: 100px !important;
        font-weight: 600 !important;
    }

    /* Mode dropdown compact */
    #current-mode-btn {
        min-width: 70px !important;
        height: 30px !important;
        padding: 0 8px !important;
        font-size: 10px !important;
    }

    #hero-section {
        padding: 0 16px !important;
    }

    .logo-orb-hero {
        width: 90px !important;
        height: 90px !important;
    }

    #hero-section h1 {
        font-size: 28px !important;
    }

    #hero-section p {
        font-size: 11px !important;
        margin-bottom: 14px !important;
    }

    #hero-section .grid {
        gap: 8px !important;
    }

    #hero-section .hero-card {
        padding: 12px !important;
    }

    #hero-section .hero-card .font-semibold {
        font-size: 11px !important;
    }

    #hero-section .slash-tag {
        font-size: 9px !important;
        padding: 4px 10px !important;
    }

    /* Chat area — proper bottom padding for input */
    #chat-container {
        padding: 10px 10px !important;
        padding-bottom: 140px !important;
        -webkit-overflow-scrolling: touch;
    }

    .chat-msg {
        gap: 8px !important;
    }

    .chat-bubble-ai,
    .chat-bubble-user {
        padding: 10px 14px !important;
        font-size: 14px !important;
        max-width: calc(100vw - 60px) !important;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Fix tables overflowing on mobile */
    .prose table {
        font-size: 11px !important;
    }
    .prose th, .prose td {
        padding: 6px 8px !important;
    }

    .chat-msg .w-8 {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
    }

    .logo-orb-sm {
        width: 28px !important;
        height: 28px !important;
    }

    .chat-bubble-user {
        background: linear-gradient(135deg, #2a2a2e, #1f1f23) !important;
        color: #fff !important;
    }

    [data-theme="light"] .chat-bubble-user {
        background: linear-gradient(135deg, #1d1d1f, #2d2d2f) !important;
        color: #fff !important;
    }

    [data-theme="light"] .chat-bubble-user .prose,
    [data-theme="light"] .chat-bubble-user.prose {
        color: #fff !important;
    }

    /* Ensure input text is visible on mobile — FORCED HIGH CONTRAST */
    #user-input {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
        caret-color: #ffffff !important;
    }

    [data-theme="light"] #user-input {
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
        caret-color: #000000 !important;
    }

    [data-theme="light"] .input-ring {
        background: rgba(255, 255, 255, 0.95) !important;
        border-color: rgba(0, 0, 0, 0.1) !important;
    }

    [data-theme="light"] .absolute.bottom-0 {
        background: rgba(245, 245, 247, 0.95) !important;
    }

    /* Enhanced mobile input area — fixed bottom, no overlap */
    .absolute.bottom-0 {
        padding: 8px 8px !important;
        padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
        background: rgba(4, 4, 5, 0.85) !important;
        backdrop-filter: blur(30px) !important;
        -webkit-backdrop-filter: blur(30px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    }

    .input-ring {
        border-radius: 22px !important;
        padding: 6px !important;
        background: rgba(255, 255, 255, 0.04) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    }

    #user-input {
        padding: 8px 12px !important;
        font-size: 15px !important;
        min-height: 36px !important;
    }

    /* Bigger touch targets for toolbar */
    .input-ring button[type="button"].w-8 {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px;
    }

    #send-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px;
    }

    /* Plus menu — full width on mobile */
    #plus-menu {
        left: 0 !important;
        right: 0 !important;
        width: calc(100vw - 24px) !important;
        max-width: 340px !important;
        max-height: 60vh !important;
        overflow-y: auto !important;
        border-radius: 20px !important;
    }

    /* Header buttons compact */
    header .theme-toggle {
        width: 30px !important;
        height: 30px !important;
    }

    #profile-img {
        width: 28px !important;
        height: 28px !important;
    }

    #profile-dropdown {
        width: 220px !important;
        right: -8px !important;
    }

    #sidebar {
        max-width: 280px !important;
    }

    #settings-content {
        width: 94% !important;
        padding: 16px !important;
        border-radius: 16px !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
    }

    #confirm-modal>div {
        width: 90% !important;
    }

    /* Video studio mobile */
    #video-studio > div {
        width: 94% !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
    }

    /* Image studio mobile */
    #img-studio > div {
        width: 94% !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
    }

    /* AI Models modal mobile */
    #ai-models-modal > div {
        width: 94% !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
    }

    /* Pricing modal mobile */
    #pricing-modal > div {
        width: 94% !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }

    /* Battle arena mobile */
    .battle-arena {
        max-width: 100% !important;
    }
    .battle-split {
        grid-template-columns: 1fr !important;
    }

    /* Mobile light mode fixes */
    [data-theme="light"] #sidebar {
        background: rgba(250, 250, 252, 0.98) !important;
        border-right-color: rgba(0, 0, 0, 0.06) !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06) !important;
    }

    [data-theme="light"] #sidebar.sidebar-open-mobile {
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.08) !important;
    }

    [data-theme="light"] header {
        background: rgba(255, 255, 255, 0.92) !important;
        border-bottom-color: rgba(0, 0, 0, 0.04) !important;
    }

    [data-theme="light"] .absolute.bottom-0 {
        background: rgba(245, 245, 247, 0.92) !important;
        border-top-color: rgba(0, 0, 0, 0.04) !important;
    }

    [data-theme="light"] .input-ring {
        background: #fff !important;
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06) !important;
    }

    [data-theme="light"] #sidebar-overlay {
        background: rgba(0, 0, 0, 0.15) !important;
        backdrop-filter: blur(4px) !important;
    }

    /* Login UI mobile */
    #login-ui > div {
        max-width: 90% !important;
        padding: 24px 20px !important;
        border-radius: 24px !important;
    }
    #login-ui .logo-orb-hero {
        width: 80px !important;
        height: 80px !important;
    }
    #login-ui h1 {
        font-size: 24px !important;
    }
}

/* ===== PLUS MENU — LIGHT MODE FIX (Critical) ===== */
[data-theme="light"] #plus-menu {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
    background-image: radial-gradient(circle at top right, rgba(99, 102, 241, 0.04), transparent 60%) !important;
}

[data-theme="light"] .plus-accordion-header {
    border-color: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .plus-accordion-header:hover {
    background: rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .plus-accordion-header span {
    color: rgba(0, 0, 0, 0.6) !important;
}

[data-theme="light"] .plus-accordion-header .fa-chevron-down {
    color: rgba(0, 0, 0, 0.3) !important;
}

[data-theme="light"] .plus-accordion-content > div {
    background: rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] .plus-dropdown-item {
    color: #1d1d1f !important;
}

[data-theme="light"] .plus-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .plus-dropdown-item span[style*="color:var(--text-primary)"],
[data-theme="light"] .plus-dropdown-item .text-white\/90 {
    color: #1d1d1f !important;
}

[data-theme="light"] .plus-dropdown-item .text-white\/40,
[data-theme="light"] .plus-dropdown-item span.text-\[9px\] {
    color: rgba(0, 0, 0, 0.45) !important;
}

[data-theme="light"] .plus-accordion-section {
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Light mode icon containers in plus menu - keep gradient visible */
[data-theme="light"] .plus-dropdown-item .w-7 {
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Plus button light mode */
[data-theme="light"] #plus-menu-btn {
    color: rgba(0, 0, 0, 0.4) !important;
}
[data-theme="light"] #plus-menu-btn:hover {
    color: rgba(0, 0, 0, 0.8) !important;
    background: rgba(0, 0, 0, 0.06) !important;
}

/* ===== HEADER BUTTONS — LIGHT MODE ===== */
[data-theme="light"] header button,
[data-theme="light"] header .theme-toggle {
    color: rgba(0, 0, 0, 0.5) !important;
}
[data-theme="light"] header button:hover,
[data-theme="light"] header .theme-toggle:hover {
    color: rgba(0, 0, 0, 0.9) !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] #current-mode-btn {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: #1d1d1f !important;
}

[data-theme="light"] #mode-dropdown {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .mode-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .mode-dropdown-item span {
    color: #1d1d1f !important;
}

/* Light mode profile dropdown */
[data-theme="light"] #profile-dropdown {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] #profile-dropdown .profile-item {
    color: #1d1d1f !important;
}

[data-theme="light"] #profile-dropdown .profile-item:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] #profile-name {
    color: #1d1d1f !important;
}

[data-theme="light"] #profile-email {
    color: rgba(0, 0, 0, 0.45) !important;
}

/* Light mode chatbox toolbar buttons */
[data-theme="light"] .flex.items-center.gap-0\.5 button {
    color: rgba(0, 0, 0, 0.35) !important;
}

[data-theme="light"] .flex.items-center.gap-0\.5 button:hover {
    color: rgba(0, 0, 0, 0.8) !important;
    background: rgba(0, 0, 0, 0.06) !important;
}

/* Light mode word counter */
[data-theme="light"] .word-counter {
    color: rgba(0, 0, 0, 0.3) !important;
}

/* Light mode send button */
[data-theme="light"] #send-btn {
    background: #1d1d1f !important;
    color: #fff !important;
}

/* Light mode sidebar items */
[data-theme="light"] #sidebar-chat-list > div:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] #sidebar-chat-list > div .text-white\/50 {
    color: rgba(0, 0, 0, 0.5) !important;
}

/* Light mode scroll bottom button */
[data-theme="light"] #scroll-bottom-btn {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: rgba(0, 0, 0, 0.6) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

/* Light mode response time and timestamps */
[data-theme="light"] .response-time {
    color: rgba(0, 0, 0, 0.3) !important;
}

[data-theme="light"] .msg-timestamp {
    color: rgba(0, 0, 0, 0.2) !important;
}

/* ===== HEADER RESPONSIVE — All Phones ===== */
@media (max-width: 480px) {
    header .flex.items-center.gap-2 {
        gap: 2px !important;
    }
    header .w-px {
        display: none !important;
    }
    header button.w-8:not(#send-btn) {
        width: 28px !important;
        height: 28px !important;
    }
    #current-mode-btn {
        min-width: 56px !important;
        padding: 0 6px !important;
        font-size: 9px !important;
    }
    #profile-img {
        width: 24px !important;
        height: 24px !important;
    }
}

@media(max-width:380px) {
    #hero-section h1 {
        font-size: 22px !important;
    }

    #hero-section .grid {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }
}

/* Drag & Drop */
.drag-over {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

#drop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

#drop-overlay.active {
    display: flex;
}

#drop-overlay .drop-ring {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

/* Image Studio Modal */
#img-studio {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
}

#img-studio.open {
    display: flex;
}

/* Pricing Modal */
#pricing-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
}

#pricing-modal.open {
    display: flex;
}

.pricing-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.pricing-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.style-chip {
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.03);
}

.style-chip.active,
.style-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Workspace Panel — ChatGPT/Claude style */
#ws-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 190;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#ws-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

#workspace-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    width: 520px;
    max-width: 100vw;
    z-index: 200;
    background: #0a0a0a;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

#workspace-panel.open {
    transform: translateX(0);
    box-shadow: -20px 0 80px rgba(0, 0, 0, 0.8);
}

@media(max-width:767px) {
    #workspace-panel {
        width: 100vw !important;
        max-width: 100vw !important;
    }
}

/* WS Tabs */
.ws-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0 16px;
    gap: 0;
}

.ws-tab {
    padding: 12px 18px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}

.ws-tab:hover {
    color: rgba(255, 255, 255, 0.6);
}

.ws-tab.active {
    color: #fff;
    border-bottom-color: #fff;
}

.ws-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ws-tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* WS Items */
.ws-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.ws-file-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.ws-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    width: 100%;
    text-align: left;
}

.ws-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
}

/* Code Editor */
#ws-code-editor {
    width: 100%;
    flex: 1;
    min-height: 180px;
    background: #050505;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: #e0e0e0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    padding: 16px;
    resize: none;
    outline: none;
    line-height: 1.7;
    tab-size: 4;
}

#ws-code-editor:focus {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

#ws-code-output {
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    background: #020202;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    color: #34d399;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 12px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* File badges */
.file-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
}

.file-badge.pdf {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.file-badge.zip {
    background: rgba(234, 179, 8, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.file-badge.img {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.file-badge.code {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

/* Multi-file strip */
#multi-file-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
}

.mf-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    flex-shrink: 0;
}

.mf-chip .mf-remove {
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s;
}

.mf-chip .mf-remove:hover {
    opacity: 1;
    color: #f87171;
}

/* Toast */
.toast-item {
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        transform: translateY(16px);
        opacity: 0
    }

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

/* AI Model Selector Chips - Premium Design */
.ai-model-chip {
    background: transparent;
    border: 1px solid transparent;
}

.ai-model-chip:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.ai-model-chip.active {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ai-model-chip.active span {
    color: #fff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.ai-model-chip.active div[class*="bg-gradient-to-br"] {
    box-shadow: 0 0 20px currentColor;
    transform: scale(1.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .ai-model-chip:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .ai-model-chip.active {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ai-model-chip.active span {
    color: #000 !important;
    text-shadow: none;
}

/* Theme Toggle & Header Buttons */
.theme-toggle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border-secondary);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: scale(1.05);
}

.theme-toggle i {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 11px;
}

.theme-toggle:active i {
    transform: rotate(180deg);
}

/* Scroll to bottom button */
#scroll-bottom-btn {
    position: absolute;
    bottom: 180px;
    right: 20px;
    z-index: 25;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    backdrop-filter: blur(12px);
}

#scroll-bottom-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: scale(1.1);
}

#scroll-bottom-btn.visible {
    display: flex;
    animation: toastIn 0.25s ease;
}

@media(max-width:767px) {
    #scroll-bottom-btn {
        bottom: 150px;
        right: 12px;
        width: 32px;
        height: 32px;
    }
}

/* Lock styling for premium features */
.premium-locked {
    position: relative;
    opacity: 0.8;
    cursor: not-allowed !important;
    padding-right: 24px !important;
}

.premium-locked::after {
    content: '\f023';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #fbbf24;
    font-size: 10px;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
    border: none;
    background: transparent;
    width: auto;
    height: auto;
    display: block;
}

.tab-locked {
    position: relative;
    opacity: 0.6;
    cursor: not-allowed !important;
}

.tab-locked i {
    color: #fbbf24 !important;
}

/* User Profile Dropdown */
#profile-wrapper {
    position: relative;
    cursor: pointer;
}

#profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

#profile-img:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

#profile-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    width: 240px;
    z-index: 200;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

#profile-dropdown.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.profile-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
}

.profile-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: white;
}

#user-plan-text {
    font-weight: 800;
    letter-spacing: 0.05em;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

#user-plan-text.premium {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: black;
}

/* ===== COMPREHENSIVE LIGHT MODE ===== */
/* Logo */
[data-theme="light"] .logo-orb {
    background: #fff;
    box-shadow: 0 2px 20px rgba(220, 38, 38, 0.08);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .logo-orb::after {
    background: #fff;
}

[data-theme="light"] .logo-orb img {
    mix-blend-mode: normal;
    filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.15));
}

/* Title & Premium Animated Text Light Mode Fixes */
[data-theme="light"] .hero-title {
    background: linear-gradient(135deg, #111 0%, #666 50%, #111 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .animated-text-container .from-emerald-400 {
    background: linear-gradient(to right, #059669, #10b981) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

[data-theme="light"] .animated-text-container .from-indigo-400 {
    background: linear-gradient(to right, #4338ca, #6366f1) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

[data-theme="light"] .animated-text-container .from-pink-400 {
    background: linear-gradient(to right, #be185d, #ec4899) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

[data-theme="light"] .animated-text-container .from-amber-400 {
    background: linear-gradient(to right, #b45309, #f59e0b) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

[data-theme="light"] #hero-greeting {
    color: rgba(0, 0, 0, 0.5) !important;
}

/* Chat bubbles */
[data-theme="light"] .chat-bubble-ai {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .chat-bubble-user {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .chat-bubble-user .prose,
[data-theme="light"] .chat-bubble-user.prose,
[data-theme="light"] .chat-bubble-user .prose.prose-invert,
[data-theme="light"] .chat-bubble-user.prose.prose-invert {
    color: #fff !important;
}

[data-theme="light"] .chat-bubble-user .prose pre,
[data-theme="light"] .chat-bubble-user.prose pre {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff !important;
}

[data-theme="light"] .chat-bubble-user .prose code,
[data-theme="light"] .chat-bubble-user.prose code {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .chat-bubble-user .prose a {
    color: #93c5fd !important;
}

[data-theme="light"] .chat-bubble-user .prose strong {
    color: #fff !important;
}

[data-theme="light"] .chat-bubble-user .prose table {
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .chat-bubble-user .prose th {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .chat-bubble-user .prose td {
    color: #eee;
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .prose {
    color: #1d1d1f;
}

[data-theme="light"] .prose pre {
    background: #f8f8f8 !important;
    border-color: rgba(0, 0, 0, 0.06);
    color: #333;
}

[data-theme="light"] .prose code {
    color: #1d1d1f;
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .prose th {
    background: rgba(0, 0, 0, 0.03);
    color: #1d1d1f;
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .prose td {
    color: #333;
    border-color: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .prose table {
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .code-header {
    background: #f0f0f0 !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
    color: rgba(0, 0, 0, 0.5) !important;
}

/* AI label above bubble */
[data-theme="light"] .chat-msg .tracking-\[0\.12em\] {
    color: rgba(0, 0, 0, 0.25) !important;
}

[data-theme="light"] .chat-msg .bg-white\/\[0\.06\] {
    background: rgba(0, 0, 0, 0.04) !important;
    color: rgba(0, 0, 0, 0.4) !important;
}

/* Message actions */
[data-theme="light"] .msg-actions button {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] .msg-actions button:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    color: #1d1d1f !important;
}

/* Response time */
[data-theme="light"] .response-time {
    color: rgba(0, 0, 0, 0.25) !important;
}

[data-theme="light"] .msg-timestamp {
    color: rgba(0, 0, 0, 0.2) !important;
}

/* Skeleton loading */
[data-theme="light"] .skeleton-line {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.04) 75%) !important;
    background-size: 200% 100%;
}

/* Stop button */
[data-theme="light"] #stop-btn-container button {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

/* Chat container gradient */
[data-theme="light"] #chat-container {
    background: var(--bg-primary);
}

/* Input */
[data-theme="light"] .input-ring {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .input-ring:focus-within {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12), 0 8px 32px rgba(0, 0, 0, 0.08);
    border-color: rgba(99, 102, 241, 0.25) !important;
}

[data-theme="light"] #user-input {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
    caret-color: #000000 !important;
}

[data-theme="light"] #user-input::placeholder {
    color: rgba(0, 0, 0, 0.4) !important;
    -webkit-text-fill-color: rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] #send-btn {
    background: #1d1d1f;
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] #send-btn:hover {
    background: #000;
}

/* Input toolbar icons */
[data-theme="light"] .input-ring button[type="button"] {
    color: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .input-ring button[type="button"]:hover {
    color: rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.04);
}

/* Sidebar */
[data-theme="light"] #sidebar {
    background: var(--bg-sidebar);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] #sidebar * {
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] #sidebar .text-white,
[data-theme="light"] #sidebar .text-white\/90 {
    color: #1d1d1f !important;
}

[data-theme="light"] #sidebar .text-white\/80,
[data-theme="light"] #sidebar .text-white\/70 {
    color: #333 !important;
}

[data-theme="light"] #sidebar .text-white\/50,
[data-theme="light"] #sidebar .text-white\/40 {
    color: rgba(0, 0, 0, 0.45) !important;
}

[data-theme="light"] #sidebar .text-white\/30,
[data-theme="light"] #sidebar .text-white\/25,
[data-theme="light"] #sidebar .text-white\/20 {
    color: rgba(0, 0, 0, 0.3) !important;
}

[data-theme="light"] #sidebar .bg-white\/\[0\.03\],
[data-theme="light"] #sidebar .bg-white\/\[0\.04\] {
    background: rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] #sidebar .bg-white\/\[0\.08\] {
    background: rgba(99, 102, 241, 0.06) !important;
}

[data-theme="light"] #sidebar .hover\:bg-white\/5:hover,
[data-theme="light"] #sidebar .hover\:bg-white\/\[0\.03\]:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] #sidebar-search {
    color: #1d1d1f;
}

[data-theme="light"] #sidebar-search::placeholder {
    color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] #sidebar .fa-search {
    color: rgba(0, 0, 0, 0.25) !important;
}

[data-theme="light"] #sidebar button.bg-white {
    background: #1d1d1f !important;
    color: #fff !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] #sidebar button.bg-white:hover {
    background: #000 !important;
}

[data-theme="light"] #sidebar-chat-list>div {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] #sidebar-chat-list>div:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .usage-banner {
    background: rgba(0, 0, 0, 0.02) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Header */
[data-theme="light"] header {
    background: var(--bg-header) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] #header-chat-title {
    color: #1d1d1f !important;
}

[data-theme="light"] #mode-status-text {
    color: rgba(0, 0, 0, 0.45) !important;
}

[data-theme="light"] .fa-bars {
    color: rgba(0, 0, 0, 0.45) !important;
}

/* Profile dropdown */
[data-theme="light"] #profile-dropdown {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] #profile-dropdown .border-b {
    border-color: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] #profile-dropdown .bg-white\/\[0\.02\] {
    background: rgba(0, 0, 0, 0.015) !important;
}

[data-theme="light"] #profile-name {
    color: #1d1d1f;
}

[data-theme="light"] #profile-email {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] #user-plan-text {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

[data-theme="light"] .profile-item {
    color: rgba(0, 0, 0, 0.65);
    border-color: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .profile-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: #1d1d1f;
}

[data-theme="light"] #profile-img {
    border-color: rgba(0, 0, 0, 0.1);
}

/* Modals */
[data-theme="light"] .settings-modal,
[data-theme="light"] #settings-content {
    background: #fff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] #settings-content * {
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] #settings-content .text-white\/90,
[data-theme="light"] #settings-content .text-white\/80 {
    color: #1d1d1f !important;
}

[data-theme="light"] #settings-content .text-white\/50,
[data-theme="light"] #settings-content .text-white\/40,
[data-theme="light"] #settings-content .text-white\/30 {
    color: rgba(0, 0, 0, 0.45) !important;
}

[data-theme="light"] #settings-content .bg-white\/\[0\.04\],
[data-theme="light"] #settings-content .bg-white\/\[0\.03\] {
    background: rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] #confirm-modal>div,
[data-theme="light"] #prompt-modal>div,
[data-theme="light"] #img-studio>div {
    background: #fff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] #confirm-modal .text-white\/80,
[data-theme="light"] #prompt-modal .text-white\/90,
[data-theme="light"] #img-studio .text-white\/90 {
    color: #1d1d1f !important;
}

[data-theme="light"] #confirm-modal .text-white\/40,
[data-theme="light"] #prompt-modal .text-white\/40,
[data-theme="light"] #img-studio .text-white\/40,
[data-theme="light"] #img-studio .text-white\/30 {
    color: rgba(0, 0, 0, 0.5) !important;
}

[data-theme="light"] #prompt-input,
[data-theme="light"] #studio-prompt {
    background: rgba(0, 0, 0, 0.03) !important;
    color: #1d1d1f !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] #img-studio .bg-white\/\[0\.02\],
[data-theme="light"] #img-studio .bg-white\/\[0\.04\] {
    background: rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] #img-studio select,
[data-theme="light"] #img-studio input {
    background: #f5f5f7 !important;
    color: #1d1d1f !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .style-chip {
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: rgba(0, 0, 0, 0.5) !important;
}

[data-theme="light"] .style-chip.active {
    background: #1d1d1f !important;
    color: #fff !important;
}

[data-theme="light"] .style-chip:hover:not(.active) {
    background: rgba(0, 0, 0, 0.04) !important;
    color: #1d1d1f !important;
}

[data-theme="light"] #voice-modal h3,
[data-theme="light"] #voice-modal p {
    color: #fff !important;
}

/* Voice modal keeps dark styling natively for focus */

/* Plus Menu & Toolbar Light Mode */
[data-theme="light"] .plus-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] #plus-menu {
    background: #fff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] #plus-menu .text-white\/25,
[data-theme="light"] #plus-menu .text-white\/30 {
    color: rgba(0, 0, 0, 0.35) !important;
}

[data-theme="light"] .flex.items-center.gap-0\.5>button {
    color: rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] .flex.items-center.gap-0\.5>button:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #1d1d1f !important;
}

[data-theme="light"] #plus-menu-container>button {
    color: rgba(0, 0, 0, 0.5) !important;
}

[data-theme="light"] #plus-menu-container>button:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #1d1d1f !important;
}

[data-theme="light"] #web-search-quick-btn.text-\[\#60a5fa\] {
    color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.1) !important;
}

/* Hero cards in light mode */
[data-theme="light"] .hero-card {
    background: #fff !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .hero-card:hover {
    background: #fff !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* Pricing Modal Light Mode - Sleek B&W */
[data-theme="light"] #pricing-modal>div {
    background: #fff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
    background-image: radial-gradient(circle at top, rgba(0, 0, 0, 0.03), transparent 60%) !important;
}

[data-theme="light"] #pricing-modal .from-white {
    --tw-gradient-from: #1d1d1f var(--tw-gradient-from-position) !important;
}

[data-theme="light"] #pricing-modal .to-white\/40 {
    --tw-gradient-to: rgba(29, 29, 31, 0.6) var(--tw-gradient-to-position) !important;
}

[data-theme="light"] #pricing-modal .text-white {
    color: #1d1d1f !important;
}

[data-theme="light"] #pricing-modal .text-white\/20,
[data-theme="light"] #pricing-modal .text-white\/30,
[data-theme="light"] #pricing-modal .text-white\/40,
[data-theme="light"] #pricing-modal .text-white\/50,
[data-theme="light"] #pricing-modal .text-white\/70 {
    color: rgba(0, 0, 0, 0.6) !important;
}

[data-theme="light"] #pricing-modal .bg-white\/\[0\.02\] {
    background: #f5f5f7 !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] #pricing-modal .bg-white\/\[0\.05\] {
    background: #fff !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08) !important;
    color: #1d1d1f !important;
}

[data-theme="light"] #pricing-modal .border-white\/\[0\.08\] {
    border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] #pricing-modal .hover\:bg-white\/\[0\.04\]:hover {
    background: #fff !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] #pricing-modal .hover\:border-white\/\[0\.2\]:hover {
    border-color: rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] #pricing-modal .group-hover\:bg-white\/10:hover {
    background: #1d1d1f !important;
    color: #fff !important;
}

[data-theme="light"] #pricing-modal .bg-white\/\[0\.03\] {
    background: rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] #pricing-modal .hover\:bg-white\/10:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    color: #1d1d1f !important;
}

[data-theme="light"] #pricing-modal .bg-white\/5 {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Misc */
[data-theme="light"] .toast-item {
    background: #1d1d1f;
    color: #fff;
}

[data-theme="light"] .skeleton-line {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.03) 25%, rgba(0, 0, 0, 0.06) 50%, rgba(0, 0, 0, 0.03) 75%);
}

[data-theme="light"] .response-time {
    color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .msg-timestamp {
    color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] #scroll-bottom-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] #scroll-bottom-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

[data-theme="light"] .kbd {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .word-counter {
    color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .text-white\/20.text-\[9px\] {
    color: rgba(0, 0, 0, 0.2) !important;
}

/* Input placeholder theme-aware */
[data-theme="light"] #user-input::placeholder {
    color: rgba(0, 0, 0, 0.4) !important;
    -webkit-text-fill-color: rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] #user-input::placeholder,
#user-input::placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.35) !important;
}

/* Dark mode input text forced white */
[data-theme="dark"] #user-input,
#user-input {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
}

/* Light mode toolbar icons inside input */
[data-theme="light"] .input-ring .text-white\/30 {
    color: rgba(0, 0, 0, 0.5) !important;
}

[data-theme="light"] .input-ring .hover\:text-white\/80:hover {
    color: rgba(0, 0, 0, 0.9) !important;
}

[data-theme="light"] .input-ring .hover\:bg-white\/5:hover {
    background: rgba(0, 0, 0, 0.06) !important;
}

/* Light mode header action buttons */
[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: rgba(0, 0, 0, 0.5) !important;
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    color: #1d1d1f !important;
}

[data-theme="light"] header button[style*="--bg-elevated"] {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] header button[style*="--bg-elevated"]:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    color: #1d1d1f !important;
}

/* Light mode selection */
[data-theme="light"] ::selection {
    background: rgba(99, 102, 241, 0.15);
    color: #1d1d1f;
}

/* ===== AI MODELS MODAL ===== */
#ai-models-modal {
    position: fixed;
    inset: 0;
    z-index: 350;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

#ai-models-modal.open {
    display: flex;
}

.model-grid-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.model-grid-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.model-grid-item.selected {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05), 0 8px 30px rgba(0, 0, 0, 0.3);
}

.model-grid-item.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.model-grid-item .model-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: transparent;
    transition: all 0.25s;
}

.model-grid-item.selected .model-check {
    background: #fff;
    border-color: #fff;
    color: #000;
}

.model-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.model-icon-wrap img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Active model selection pill (next to + button) */
#active-model-pill {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 6px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: pillSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 200px;
}

#active-model-pill.visible {
    display: inline-flex;
}

#active-model-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

#active-model-pill .pill-icon {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#active-model-pill .pill-icon img {
    width: 14px;
    height: 14px;
}

#active-model-pill .pill-name {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#active-model-pill .pill-close {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
    flex-shrink: 0;
}

#active-model-pill .pill-close:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

@keyframes pillSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px) scale(0.9)
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1)
    }
}

[data-theme="light"] #active-model-pill {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] #active-model-pill:hover {
    background: rgba(0, 0, 0, 0.07);
}

[data-theme="light"] #active-model-pill .pill-name {
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] #active-model-pill .pill-close {
    color: rgba(0, 0, 0, 0.3);
}

/* ===== BATTLE ARENA — Horizontal Tab System ===== */
.battle-arena {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    overflow: hidden;
}

.battle-arena-header {
    padding: 20px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.battle-arena-title {
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.battle-arena-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 4px;
}

.battle-stats-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 24px 0;
}

.battle-stat-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.battle-stat-pill.gold {
    background: rgba(255, 200, 0, 0.06);
    border-color: rgba(255, 200, 0, 0.15);
    color: rgba(255, 215, 0, 0.8);
}

/* Horizontal Tab Navigation */
.battle-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 16px 24px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.battle-tabs::-webkit-scrollbar {
    display: none;
}

.battle-tab {
    padding: 10px 18px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.25s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.battle-tab:hover {
    color: rgba(255, 255, 255, 0.7);
}

.battle-tab.active {
    color: #fff;
    border-bottom-color: #fff;
}

.battle-tab .tab-rank {
    font-size: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.4);
}

.battle-tab.active .tab-rank {
    background: #fff;
    color: #000;
}

.battle-tab .tab-badge {
    font-size: 7px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.battle-tab.active .tab-badge.best {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
}

/* Panels */
.battle-panels {
    position: relative;
    min-height: 120px;
}

.battle-panel {
    display: none;
    padding: 24px;
    animation: bpFadeIn 0.3s ease;
}

.battle-panel.active {
    display: block;
}

@keyframes bpFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px)
    }

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

.battle-panel-content {
    font-size: 13.5px;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.8);
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.battle-panel-content::-webkit-scrollbar {
    width: 3px;
}

.battle-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.battle-panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.battle-panel-footer {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.battle-metric-box {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.battle-metric-box .bmb-val {
    font-size: 18px;
    font-weight: 900;
    color: #fff;
}

.battle-metric-box .bmb-label {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 2px;
}

.battle-metric-box.best {
    border-color: rgba(255, 215, 0, 0.2);
    background: rgba(255, 215, 0, 0.03);
}

.battle-metric-box.best .bmb-val {
    color: #ffd700;
}

/* Copy button */
.battle-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 11px;
}

.battle-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Side-by-side split view */
.battle-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px 24px 24px;
    min-height: 200px;
}

.battle-split-panel {
    padding: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
}

.battle-split-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.battle-split-name {
    font-size: 12px;
    font-weight: 800;
    color: #fff;
}

.battle-split-rank {
    font-size: 7px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.battle-split-content {
    font-size: 12.5px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.75);
    max-height: 350px;
    overflow-y: auto;
}

.battle-split-content::-webkit-scrollbar {
    width: 2px;
}

.battle-split-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* View mode toggle */
.battle-view-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.battle-view-btn {
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    background: transparent;
    border: none;
    transition: all 0.2s;
}

.battle-view-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

@media(max-width:768px) {
    .battle-split {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }
}

/* Prompt Template Cards */
.prompt-tpl-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.prompt-tpl-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Focus Mode */
body.focus-mode .sidebar {
    transform: translateX(-100%) !important;
}

body.focus-mode .sidebar-toggle {
    opacity: 0;
    pointer-events: none;
}

body.focus-mode #hero-section {
    display: none !important;
}

body.focus-mode .chat-container {
    max-width: 900px;
}

/* All AI toggle button */
.all-ai-btn {
    position: relative;
    overflow: hidden;
}

.all-ai-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.all-ai-btn:hover::before {
    transform: translateX(100%);
}

/* Light mode for AI Models Modal */
[data-theme="light"] #ai-models-modal {
    background: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .model-grid-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .model-grid-item:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .model-grid-item.selected {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .model-grid-item .model-check {
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .model-grid-item.selected .model-check {
    background: #1d1d1f;
    border-color: #1d1d1f;
    color: #fff;
}

/* Light Mode — Battle Arena */
[data-theme="light"] .battle-arena {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .battle-arena-title {
    color: #111;
}

[data-theme="light"] .battle-arena-sub {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .battle-stat-pill {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .battle-stat-pill.gold {
    background: rgba(200, 150, 0, 0.08);
    border-color: rgba(200, 150, 0, 0.2);
    color: rgba(160, 120, 0, 0.9);
}

[data-theme="light"] .battle-tabs {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .battle-tab {
    color: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .battle-tab:hover {
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .battle-tab.active {
    color: #111;
    border-bottom-color: #111;
}

[data-theme="light"] .battle-tab .tab-rank {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .battle-tab.active .tab-rank {
    background: #111;
    color: #fff;
}

[data-theme="light"] .battle-panel-content {
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .battle-panel-footer {
    border-top-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .battle-metric-box {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .battle-metric-box .bmb-val {
    color: #111;
}

[data-theme="light"] .battle-metric-box .bmb-label {
    color: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .battle-metric-box.best {
    border-color: rgba(180, 140, 0, 0.25);
    background: rgba(255, 215, 0, 0.06);
}

[data-theme="light"] .battle-metric-box.best .bmb-val {
    color: #a08000;
}

[data-theme="light"] .battle-copy-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .battle-copy-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #111;
}

[data-theme="light"] .battle-split-panel {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .battle-split-header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .battle-split-name {
    color: #111;
}

[data-theme="light"] .battle-split-content {
    color: rgba(0, 0, 0, 0.75);
}

[data-theme="light"] .battle-view-toggle {
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .battle-view-btn {
    color: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .battle-view-btn.active {
    background: rgba(0, 0, 0, 0.08);
    color: #111;
}

[data-theme="light"] .battle-tab .tab-badge {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .battle-tab.active .tab-badge.best {
    background: rgba(200, 160, 0, 0.12);
    color: #9a7b00;
}

/* Light Mode — Prompt Templates */
[data-theme="light"] .prompt-tpl-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .prompt-tpl-card:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}