        /* ---------- CSS VARIABLES FOR THEMING ---------- */
        :root {
            --bg-primary: #0f0f0f;
            --bg-secondary: #1a1a1c;
            --bg-tertiary: #2c2c2e;
            --border-color: #2c2c2e;
            --border-light: #3a3a3c;
            --text-primary: #e8e8ed;
            --text-secondary: #a8a8b3;
            --accent: #10a37f;
            --accent-hover: #0e8c6e;
            --avatar-user: #ffffff;
            --avatar-assistant: #10a37f;
            --message-assistant: #1a1a1c;
            --input-bg: #2c2c2e;
            --dropdown-bg: #2c2c2e;
            --dropdown-hover: #3a3a3c;
            --send-bg-disabled: rgba(16, 163, 127, 0.4);
            --send-arrow-disabled: #a8a8b3;
            --link-bg: rgba(16, 163, 127, 0.1);
        }

        body.light-mode {
            --bg-primary: #f5f5f7;
            --bg-secondary: #ffffff;
            --bg-tertiary: #e5e5ea;
            --border-color: #d1d1d6;
            --border-light: #c6c6c8;
            --text-primary: #1c1c1e;
            --text-secondary: #6c6c70;
            --accent: #007aff;
            --accent-hover: #005bb5;
            --avatar-user: #1c1c1e;
            --avatar-assistant: #007aff;
            --message-assistant: #f0f0f5;
            --input-bg: #ffffff;
            --dropdown-bg: #ffffff;
            --dropdown-hover: #f0f0f5;
            --send-bg-disabled: rgba(0, 122, 255, 0.4);
            --send-arrow-disabled: #6c6c70;
            --link-bg: rgba(0, 122, 255, 0.1);
        }

        body, body * {
            transition: background-color 0.45s ease, border-color 0.45s ease, color 0.3s ease, box-shadow 0.3s ease;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }

        body {
            background-color: var(--bg-primary);
            display: flex;
            height: 100vh;
            overflow: hidden;
            color: var(--text-primary);
        }

        body.win-cutscene-active {
            overflow: hidden;
        }

        body.win-cutscene-active .sidebar,
        body.win-cutscene-active .collapse-toggle,
        body.win-cutscene-active .main > *:not(.win-cutscene-overlay) {
            pointer-events: none;
            user-select: none;
        }

        body.win-cutscene-proclamation-active .sidebar,
        body.win-cutscene-proclamation-active .collapse-toggle,
        body.win-cutscene-proclamation-active .main > *:not(.win-cutscene-overlay) {
            animation: win-cutscene-app-dim-in 1.05s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
        }

        body.win-cutscene-brightening .sidebar,
        body.win-cutscene-brightening .collapse-toggle,
        body.win-cutscene-brightening .main > *:not(.win-cutscene-overlay) {
            animation: win-cutscene-app-brighten 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        }

        /* ---------- SIDEBAR ---------- */
        .sidebar {
            width: 280px;
            background-color: var(--bg-secondary);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            font-size: 0.9rem;
            transition: transform 0.3s ease, width 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
            overflow: visible;
            position: relative;
            height: 100vh;
            z-index: 20;
        }

        .sidebar.collapsed {
            width: 0;
            border-right: none;
            overflow: hidden;
        }

        .sidebar-scroll {
            flex: 1;
            overflow-x: hidden;
            overflow-y: auto;
            padding: 2.9rem 0.75rem 0;
            position: relative;
            scrollbar-width: thin;
            scrollbar-color: #4a4a4e #232325;
            min-width: 280px;
        }
        .sidebar-logo-placeholder {
            position: absolute;
            top: 0.95rem;
            left: 0.75rem;
            color: var(--text-primary);
            font-size: 1rem;
            font-weight: 600;
            line-height: 1.2;
            text-align: left;
        }
        .sidebar-mobile-logo {
            display: none;
        }

        .new-chat-link {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.6rem 0.75rem;
            margin-bottom: 0.28rem;
            color: var(--text-primary);
            font-weight: 500;
            font-size: 0.9rem;
            cursor: pointer;
            border-radius: 8px;
            background-color: var(--bg-tertiary);
            border: 1px solid var(--border-light);
        }
        .new-chat-link:hover {
            background-color: var(--border-light);
        }
        .new-chat-link i {
            color: var(--accent);
            font-size: 0.9rem;
        }

        .personalities-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.3rem 0.25rem 0.22rem;
            color: var(--text-primary);
            font-weight: 500;
            font-size: 0.85rem;
        }
        .personality-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.4rem 0.5rem 0.4rem 0.9rem;
            border-radius: 6px;
            color: var(--text-primary);
            font-size: 0.85rem;
            cursor: pointer;
        }
        .personality-item:hover {
            background-color: var(--bg-tertiary);
        }
        .personality-avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 0.8rem;
            font-weight: 600;
        }
        .personality-avatar.simon { background: #e74c3c; }
        .personality-avatar.divina { background: #9b59b6; }
        .personality-avatar.gert { background: #f39c12; }

        .nav-section {
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 0.8rem;
            margin-top: 0.16rem;
        }
        .nav-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.5rem 0.5rem;
            border-radius: 6px;
            color: var(--text-primary);
            font-size: 0.9rem;
            cursor: default;
        }
        .nav-item#imageGenerator, .nav-item#deepMindNav, .nav-item#investNav, .nav-item#angelInvestNav {
            cursor: pointer;
        }
        .nav-item#imageGenerator:hover, .nav-item#deepMindNav:hover, .nav-item#investNav:hover, .nav-item#angelInvestNav:hover {
            background-color: var(--bg-tertiary);
        }
        .nav-item i {
            color: var(--text-secondary);
            width: 20px;
            text-align: center;
            font-size: 1rem;
        }
        .nav-item.is-hidden {
            display: none;
        }
        .nav-item#angelInvestNav.is-revealing {
            animation: angel-nav-reveal 0.42s cubic-bezier(0.2, 0.9, 0.24, 1);
        }
        .nav-item#angelInvestNav.is-enchanting {
            transform-origin: left center;
            box-shadow: none;
        }
        .angel-wings-icon {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            transform: scale(0.95);
        }
        .nav-item#angelInvestNav .angel-wings-icon {
            color: var(--text-secondary);
            background: transparent;
            box-shadow: none;
            filter: none;
            text-shadow:
                0 0 1px rgba(244, 197, 66, 0.28),
                0 0 4px rgba(244, 197, 66, 0.44),
                0 0 8px rgba(244, 197, 66, 0.36),
                0 0 14px rgba(244, 197, 66, 0.24);
            opacity: 1;
        }

        .chats-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.5rem 0.25rem;
            color: var(--text-primary);
            font-weight: 500;
            font-size: 0.85rem;
        }
        .chat-item {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            padding: 0.45rem 0.5rem;
            color: var(--text-primary);
            font-size: 0.85rem;
            border-radius: 6px;
            cursor: pointer;
            transition: opacity 0.3s ease;
        }
        .chat-item:hover {
            background-color: var(--bg-tertiary);
        }
        .chat-item.fade-out {
            opacity: 0;
            pointer-events: none;
        }
        .chat-item i {
            color: var(--text-secondary);
            width: 18px;
            font-size: 0.8rem;
        }
        .user-profile {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 1rem 0.75rem;
            border-top: 1px solid var(--border-color);
            background-color: var(--bg-secondary);
            flex-shrink: 0;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
            position: relative;
            overflow: visible;
        }
        .profile-avatar {
            width: 32px;
            height: 32px;
            background: var(--accent);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 0.85rem;
            font-weight: 600;
            flex-shrink: 0;
            border: 1px solid transparent;
        }
        .profile-meta {
            min-width: 0;
            flex: 1;
            position: relative;
            overflow: visible;
            --achievement-entry-raise: 3.15rem;
        }
        .profile-name {
            color: var(--text-primary);
            font-size: 0.9rem;
            font-weight: 500;
            line-height: 1.2;
            position: relative;
            z-index: 1;
        }
        .profile-name.win-cutscene-impact {
            animation: win-cutscene-profile-burst 0.76s cubic-bezier(0.18, 1, 0.32, 1);
        }
        .profile-progress-display {
            margin-top: 0.38rem;
        }
        .profile-xp-row {
            width: 100%;
            padding: 0;
            background: transparent;
            border: none;
            text-align: left;
            cursor: pointer;
            font: inherit;
            color: inherit;
        }
        .profile-achievement-entry {
            position: absolute;
            left: 0;
            top: calc(var(--achievement-entry-raise) * -1);
            width: auto;
            display: inline-flex;
            align-items: center;
            gap: 0.42rem;
            padding: 0.42rem 0.72rem;
            border-radius: 999px;
            background: color-mix(in srgb, var(--bg-tertiary) 88%, black 12%);
            border: 1px solid color-mix(in srgb, var(--border-light) 78%, transparent 22%);
            box-shadow: 0 10px 22px rgba(0,0,0,0.18);
            color: var(--text-primary);
            z-index: 6;
            transform: translateY(0);
            transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
        }
        .profile-achievement-entry:hover {
            border-color: color-mix(in srgb, var(--accent) 44%, var(--border-light) 56%);
            box-shadow: 0 12px 28px rgba(0,0,0,0.22);
        }
        .user-profile.profile-achievement-open .profile-achievement-entry {
            transform: translateY(-0.25rem);
            box-shadow: 0 16px 30px rgba(0,0,0,0.24);
        }
        .profile-achievement-entry-label {
            font-size: 0.73rem;
            font-weight: 700;
            letter-spacing: 0.02em;
            text-transform: uppercase;
        }
        .profile-xp-row:focus-visible {
            outline: 2px solid color-mix(in srgb, var(--accent) 58%, white 42%);
            outline-offset: 4px;
        }
        .profile-xp-bar {
            width: 100%;
            height: 6px;
            border-radius: 999px;
            background: var(--bg-tertiary);
            overflow: visible;
            border: 1px solid color-mix(in srgb, var(--border-light) 75%, transparent 25%);
            position: relative;
            --profile-xp-burst-color: var(--accent);
            --profile-xp-burst-glow: color-mix(in srgb, var(--accent) 28%, transparent 72%);
            z-index: 40;
        }
        .profile-xp-fill {
            width: 0;
            height: 100%;
            border-radius: inherit;
            background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 78%, white 22%), var(--accent));
            transition: width 0.22s ease;
            box-shadow: 0 0 0 rgba(0,0,0,0);
        }
        .profile-xp-burst {
            position: absolute;
            top: 50%;
            left: 100%;
            width: 48px;
            height: 48px;
            border-radius: 999px;
            pointer-events: none;
            opacity: 0;
            z-index: 41;
            transform: translate(-10px, -50%) scale(0.42);
            background:
                radial-gradient(circle at 28% 50%, color-mix(in srgb, var(--profile-xp-burst-color) 92%, white 8%) 0 16%, transparent 17% 100%),
                radial-gradient(circle at 54% 24%, color-mix(in srgb, var(--profile-xp-burst-color) 82%, white 18%) 0 8%, transparent 9% 100%),
                radial-gradient(circle at 70% 38%, color-mix(in srgb, var(--profile-xp-burst-color) 84%, white 16%) 0 7%, transparent 8% 100%),
                radial-gradient(circle at 64% 72%, color-mix(in srgb, var(--profile-xp-burst-color) 86%, white 14%) 0 7%, transparent 8% 100%),
                radial-gradient(circle at 42% 82%, color-mix(in srgb, var(--profile-xp-burst-color) 88%, white 12%) 0 8%, transparent 9% 100%);
            box-shadow:
                0 0 0 0 color-mix(in srgb, var(--profile-xp-burst-color) 34%, transparent 66%),
                0 0 0 0 color-mix(in srgb, var(--profile-xp-burst-color) 18%, transparent 82%);
            filter: drop-shadow(0 0 10px color-mix(in srgb, var(--profile-xp-burst-color) 34%, transparent 66%));
        }
        .profile-xp-bar.bursting .profile-xp-burst {
            animation: profileXpBurst 0.42s ease-out forwards;
        }
        @keyframes profileXpBurst {
            0% {
                opacity: 0;
                transform: translate(-10px, -50%) scale(0.42);
                box-shadow:
                    0 0 0 0 color-mix(in srgb, var(--profile-xp-burst-color) 34%, transparent 66%),
                    0 0 0 0 color-mix(in srgb, var(--profile-xp-burst-color) 18%, transparent 82%);
            }
            16% {
                opacity: 1;
                transform: translate(-8px, -50%) scale(0.95);
                box-shadow:
                    0 0 0 10px color-mix(in srgb, var(--profile-xp-burst-color) 14%, transparent 86%),
                    0 0 0 18px color-mix(in srgb, var(--profile-xp-burst-color) 0%, transparent 100%);
            }
            56% {
                opacity: 0.88;
                transform: translate(-8px, -50%) scale(1.08);
                box-shadow:
                    0 0 0 16px color-mix(in srgb, var(--profile-xp-burst-color) 10%, transparent 90%),
                    0 0 0 28px color-mix(in srgb, var(--profile-xp-burst-color) 0%, transparent 100%);
            }
            100% {
                opacity: 0;
                transform: translate(-8px, -50%) scale(1.22);
                box-shadow:
                    0 0 0 22px color-mix(in srgb, var(--profile-xp-burst-color) 0%, transparent 100%),
                    0 0 0 34px color-mix(in srgb, var(--profile-xp-burst-color) 0%, transparent 100%);
            }
        }
        .profile-xp-text {
            margin-top: 0.32rem;
            color: var(--text-secondary);
            font-size: 0.72rem;
            font-weight: 600;
            letter-spacing: 0.01em;
        }
        .profile-xp-meta {
            display: flex;
            align-items: center;
            justify-content: flex-start;
        }
        .profile-achievements-menu {
            position: absolute;
            left: 0.75rem;
            right: 0.75rem;
            top: calc((var(--achievement-entry-raise) + 0.5rem) * -1);
            padding: 0.85rem 0.85rem 0.6rem;
            border-radius: 16px;
            background: color-mix(in srgb, var(--bg-secondary) 88%, black 12%);
            border: 1px solid color-mix(in srgb, var(--border-light) 82%, transparent 18%);
            box-shadow: 0 14px 32px rgba(0,0,0,0.32);
            z-index: 5;
            transform: translateY(-100%);
        }
        .profile-achievements-header {
            color: var(--text-primary);
            font-size: 0.76rem;
            font-weight: 700;
            letter-spacing: 0.03em;
            text-transform: uppercase;
        }
        .profile-achievements-list {
            margin-top: 0.6rem;
            max-height: 216px;
            overflow-y: auto;
            padding-right: 0.15rem;
            display: grid;
            gap: 0.45rem;
            scrollbar-width: thin;
        }
        .profile-achievement-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 0.55rem 0.65rem;
            border-radius: 12px;
            background: color-mix(in srgb, var(--bg-tertiary) 86%, transparent 14%);
            border: 1px solid color-mix(in srgb, var(--border-light) 72%, transparent 28%);
        }
        .profile-achievement-title {
            min-width: 0;
            color: var(--text-primary);
            font-size: 0.8rem;
            font-weight: 500;
            line-height: 1.25;
        }
        .profile-achievement-xp {
            flex-shrink: 0;
            color: var(--accent);
            font-size: 0.74rem;
            font-weight: 700;
            white-space: nowrap;
        }
        .profile-achievements-empty {
            padding: 0.1rem 0 0.2rem;
            color: var(--text-secondary);
            font-size: 0.78rem;
            line-height: 1.4;
        }

        /* ---------- COLLAPSE TOGGLE – circular star ---------- */
        .collapse-toggle {
            position: absolute;
            left: 280px;
            top: 20px;
            width: 40px;
            height: 40px;
            background: transparent;
            border: none;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 100;
            font-size: 1.5rem;
            color: var(--text-secondary);
            transition: left 0.3s ease-in-out;
        }
        .collapse-toggle-logo {
            display: block;
            width: 44px;
            height: 44px;
            object-fit: contain;
            filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.42)) drop-shadow(0 0 4px rgba(255, 255, 255, 0.12));
        }
        body.light-mode .collapse-toggle-logo {
            filter: none;
        }
        .collapse-toggle:hover {
            color: var(--accent);
        }
        .collapse-toggle:active {
            transform: scale(0.92);
        }
        .sidebar.collapsed + .collapse-toggle {
            left: 0;
        }
        .collapse-toggle.opening {
            transition: left 0.2s ease-out;
        }
        @keyframes rotateCW {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        @keyframes rotateCCW {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(-360deg); }
        }
        .rotate-cw {
            animation: rotateCW 0.3s ease-in-out forwards;
        }
        .rotate-ccw {
            animation: rotateCCW 0.3s ease-in-out forwards;
        }

        /* Main panel */
        .main {
            flex: 1;
            display: flex;
            flex-direction: column;
            background-color: var(--bg-primary);
            transition: margin-left 0.2s ease, background-color 0.3s ease;
            height: 100vh;
            overflow: hidden;
        }

        /* Top bar – always visible now */
        .top-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.6rem 1.2rem;
            border-bottom: 0.5px solid var(--border-color);
            background-color: var(--bg-primary);
            z-index: 10;
        }
        .left-spacer {
            width: 40px;
        }
        .hamburger-menu {
            display: none; /* hidden on desktop */
            font-size: 1.2rem;
            color: var(--text-primary);
            cursor: pointer;
            width: 40px;
        }
        .model-pill {
            background-color: var(--bg-tertiary);
            border-radius: 100px;
            padding: 0.3rem 0.8rem;
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--text-primary);
            border: 0.3px solid var(--border-light);
            display: flex;
            align-items: center;
            gap: 0.4rem;
            cursor: pointer;
            transition: background-color 0.2s, transform 0.1s;
            height: 30px;
        }
        .model-pill:hover {
            background-color: var(--border-light);
        }
        .model-pill:active {
            transform: scale(0.96);
        }
        .model-pill.shimmer {
            animation: singlePulse 0.3s ease-out;
        }
        @keyframes singlePulse {
            0% {
                box-shadow: 0 0 0 0 rgba(16, 163, 127, 0.5);
                background-color: var(--accent);
                color: white;
            }
            100% {
                box-shadow: 0 0 0 6px rgba(16, 163, 127, 0);
                background-color: var(--bg-tertiary);
                color: var(--text-primary);
            }
        }
        body.light-mode .model-pill.shimmer {
            animation: singlePulseLight 0.3s ease-out;
        }
        @keyframes singlePulseLight {
            0% {
                box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.5);
                background-color: var(--accent);
                color: white;
            }
            100% {
                box-shadow: 0 0 0 6px rgba(0, 122, 255, 0);
                background-color: var(--bg-tertiary);
                color: var(--text-primary);
            }
        }
        .model-dropdown {
            position: absolute;
            top: 50px;
            left: 50%;
            transform: translateX(-50%);
            background-color: var(--dropdown-bg);
            border: 1px solid var(--border-light);
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
            z-index: 100;
            min-width: 160px;
            display: none;
            overflow: hidden;
        }
        .model-dropdown.active {
            display: block;
        }
        .model-dropdown-item {
            padding: 0.6rem 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--text-primary);
            cursor: pointer;
            font-size: 0.85rem;
            transition: background-color 0.2s;
        }
        .model-dropdown-item:hover {
            background-color: var(--dropdown-hover);
        }
        .model-dropdown-item i {
            color: var(--text-secondary);
            width: 20px;
            font-size: 0.9rem;
        }

        .right-icons {
            position: relative;
            display: flex;
            align-items: center;
            gap: 0.8rem;
            color: var(--text-secondary);
        }

        /* Theme toggle – smaller */
        .theme-toggle {
            background-color: var(--bg-tertiary);
            border-radius: 100px;
            padding: 0.15rem;
            display: flex;
            align-items: center;
            width: 48px;
            height: 24px;
            position: relative;
            cursor: pointer;
            border: 1px solid var(--border-light);
            transition: background-color 0.2s;
        }
        .theme-toggle .toggle-track {
            width: 100%;
            height: 100%;
            border-radius: 100px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 4px;
        }
        .theme-toggle .toggle-track i {
            font-size: 12px;
            color: var(--text-secondary);
            z-index: 2;
            pointer-events: none;
        }
        .theme-toggle .toggle-thumb {
            position: absolute;
            top: 50%;
            width: 20px;
            height: 20px;
            background-color: var(--accent);
            border-radius: 50%;
            transform: translateY(-50%);
            transition: left 0.2s ease, right 0.2s ease;
            z-index: 1;
            pointer-events: none;
        }
        .theme-toggle .toggle-thumb {
            left: auto;
            right: 2px;
        }
        body.light-mode .theme-toggle .toggle-thumb {
            left: 2px;
            right: auto;
        }

        /* Dropdown menu (share) */
        .dropdown-menu {
            position: absolute;
            top: 40px;
            right: 0;
            background-color: var(--dropdown-bg);
            border: 1px solid var(--border-light);
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
            z-index: 100;
            min-width: 150px;
            display: none;
        }
        .dropdown-menu.active {
            display: block;
        }
        .dropdown-item {
            padding: 0.8rem 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--text-primary);
            cursor: pointer;
            font-size: 0.9rem;
            transition: background-color 0.2s;
        }
        .dropdown-item:hover {
            background-color: var(--dropdown-hover);
        }
        .dropdown-item i {
            color: var(--text-secondary);
            width: 20px;
        }

        /* Centered prompt */
        .centered-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 2rem;
            background-color: var(--bg-primary);
            overflow-y: auto;
        }
        .large-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 2.5rem;
            font-weight: 600;
            margin-bottom: 1.5rem;
            display: none;
        }
        .welcome-message {
            font-size: 2.2rem;
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 1.5rem;
            text-align: center;
            line-height: 1.2;
        }
        .centered-input-area {
            width: 100%;
            max-width: 720px;
            margin-top: 0.5rem;
        }
        .centered-input-box {
            display: flex;
            align-items: flex-end;
            background-color: var(--input-bg);
            border-radius: 32px;
            padding: 0.8rem 1rem;
            border: 1px solid var(--border-light);
            flex-wrap: wrap;
        }
        .centered-input-box textarea {
            flex: 1;
            border: none;
            outline: none;
            resize: none;
            font-size: 1rem;
            padding: 0.2rem 0.5rem;
            max-height: 150px;
            background: transparent;
            color: var(--text-primary);
            font-family: inherit;
            min-width: 200px;
            line-height: 1.5;
        }
        .centered-input-box textarea::placeholder {
            color: var(--text-secondary);
        }
        .centered-input-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-left: 0.5rem;
        }
        .centered-input-actions i {
            color: var(--text-secondary);
            font-size: 1.3rem;
            cursor: pointer;
        }
        .centered-send-btn {
            background: var(--send-bg-disabled);
            color: var(--send-arrow-disabled);
            border-radius: 50%;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: default;
            transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
        }
        .centered-send-btn.primed {
            background: var(--accent);
            color: var(--text-primary);
            cursor: pointer;
        }
        .centered-send-btn.primed i {
            color: #fff;
        }
        body.light-mode .centered-send-btn.primed i {
            color: #000;
        }
        .centered-send-btn.primed:hover {
            filter: brightness(1.05);
            box-shadow: 0 2px 6px rgba(0,0,0,0.2);
        }
        .centered-send-btn.primed:active {
            transform: scale(0.94);
        }
        .centered-send-btn i {
            margin: 0;
            font-size: 1rem;
        }

        /* DeepMind pills */
        .deepmind-pill {
            display: inline-flex;
            align-items: center;
            background-color: var(--accent);
            color: white;
            border-radius: 100px;
            padding: 0.3rem 0.8rem;
            font-size: 0.85rem;
            font-weight: 500;
            margin-right: 0.5rem;
            margin-bottom: 0.25rem;
            cursor: pointer;
            gap: 0.4rem;
        }
        .deepmind-pill i {
            font-size: 0.8rem;
            color: white;
        }
        .deepmind-pill:hover {
            background-color: var(--accent-hover);
        }
        .deepmind-pill-static {
            display: inline-flex;
            align-items: center;
            background-color: var(--accent);
            color: white;
            border-radius: 100px;
            padding: 0.3rem 0.8rem;
            font-size: 0.85rem;
            font-weight: 500;
            gap: 0.4rem;
            cursor: default;
        }
        .deepmind-pill-static i {
            font-size: 0.8rem;
            color: white;
        }

        /* Chat input with two rows */
        .chat-input-box {
            display: flex;
            flex-direction: column;
            background-color: var(--input-bg);
            border-radius: 28px;
            padding: 0.8rem 1rem;
            max-width: 800px;
            margin: 0 auto;
            border: 0.5px solid var(--border-light);
        }
        .chat-input-row {
            display: flex;
            align-items: flex-end;
            width: 100%;
        }
        .chat-input-row textarea {
            flex: 1;
            border: none;
            outline: none;
            resize: none;
            font-size: 0.92rem;
            padding: 0.2rem 0.5rem;
            background: transparent;
            color: var(--text-primary);
            min-width: 200px;
            line-height: 1.5;
            max-height: 150px;
        }
        .chat-input-row textarea::placeholder {
            color: var(--text-secondary);
        }
        .chat-input-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-left: 0.5rem;
        }
        .chat-input-actions i {
            color: var(--text-secondary);
            font-size: 1.2rem;
            cursor: pointer;
        }
        .chat-send-btn {
            background: var(--send-bg-disabled);
            color: var(--send-arrow-disabled);
            border-radius: 50%;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: default;
            transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
        }
        .chat-send-btn.primed {
            background: var(--accent);
            color: var(--text-primary);
            cursor: pointer;
        }
        .chat-send-btn.primed i {
            color: #fff;
        }
        body.light-mode .chat-send-btn.primed i {
            color: #000;
        }
        .chat-send-btn.primed:hover {
            filter: brightness(1.05);
            box-shadow: 0 2px 6px rgba(0,0,0,0.2);
        }
        .chat-send-btn.primed:active {
            transform: scale(0.94);
        }
        .chat-send-btn i {
            margin: 0;
            font-size: 0.9rem;
        }
        .chat-pill-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            margin-top: 0.5rem;
        }
        .chat-pill-left {
            display: flex;
            align-items: center;
        }
        .chat-pill-right {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .chat-pill-row {
            display: none;
        }
        .chat-pill-row.active {
            display: flex;
        }

        /* DeepMind ring */
        .deepmind-ring {
            box-shadow: 0 0 0 2px var(--accent);
            border-radius: 50%;
        }

        .chat-container {
            flex: 1;
            overflow-y: auto;
            padding: 1rem 1.5rem 2rem;
            background-color: var(--bg-primary);
            display: none;
        }
        .chat-container.active {
            display: block;
        }

        .win-cutscene-overlay {
            position: fixed;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1.5rem;
            opacity: 0;
            pointer-events: none;
            z-index: 120;
        }
        .win-cutscene-overlay.active {
            opacity: 1;
            pointer-events: auto;
        }
        .win-cutscene-backdrop {
            position: absolute;
            inset: 0;
            background:
                radial-gradient(circle at 50% 20%, rgba(244, 197, 66, 0.20), transparent 44%),
                linear-gradient(180deg, rgba(4, 4, 6, 0.08), rgba(4, 4, 6, 0.12));
            backdrop-filter: blur(6px);
            opacity: 0;
        }
        body.light-mode .win-cutscene-backdrop {
            background:
                radial-gradient(circle at 50% 20%, rgba(212, 164, 32, 0.18), transparent 44%),
                linear-gradient(180deg, rgba(243, 239, 228, 0.06), rgba(225, 217, 195, 0.1));
        }
        body.win-cutscene-proclamation-active .win-cutscene-backdrop {
            animation: win-cutscene-backdrop-dim-in 1.05s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
        }
        body.win-cutscene-brightening .win-cutscene-backdrop {
            animation: win-cutscene-backdrop-brighten 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        }
        .win-cutscene-orb {
            position: fixed;
            left: 0;
            top: 0;
            width: 22px;
            height: 22px;
            border-radius: 999px;
            opacity: 0;
            pointer-events: none;
            z-index: 122;
            background:
                radial-gradient(circle at 30% 30%, rgba(255, 251, 235, 0.98), rgba(255, 245, 201, 0.88) 28%, rgba(244, 197, 66, 0.9) 62%, rgba(244, 197, 66, 0.18) 100%);
            box-shadow:
                0 0 18px rgba(255, 238, 166, 0.85),
                0 0 34px rgba(244, 197, 66, 0.48),
                0 0 64px rgba(244, 197, 66, 0.22);
            transform: translate3d(-999px, -999px, 0) scale(0.15);
        }
        body.light-mode .win-cutscene-orb {
            background:
                radial-gradient(circle at 30% 30%, rgba(255, 255, 252, 0.99), rgba(255, 242, 186, 0.96) 24%, rgba(224, 165, 28, 0.94) 58%, rgba(224, 165, 28, 0.22) 100%);
            box-shadow:
                0 0 18px rgba(255, 226, 122, 0.92),
                0 0 34px rgba(224, 165, 28, 0.52),
                0 0 64px rgba(224, 165, 28, 0.24);
        }
        .win-cutscene-orb.is-forming,
        .win-cutscene-orb.is-traveling,
        .win-cutscene-orb.is-impacting {
            opacity: 1;
        }
        .win-cutscene-shell {
            position: relative;
            width: min(760px, 100%);
            padding: 2.4rem 1.5rem 1.7rem;
            border-radius: 32px;
            border: 1px solid rgba(244, 197, 66, 0.16);
            background: linear-gradient(180deg, rgba(17, 15, 11, 0.78), rgba(17, 15, 11, 0.44));
            box-shadow: 0 30px 90px rgba(0, 0, 0, 0.2);
            text-align: center;
            opacity: 0;
            transform: translateY(24px) scale(0.965);
            transform-origin: center center;
            will-change: transform, opacity;
        }
        body.light-mode .win-cutscene-shell {
            background:
                linear-gradient(180deg, rgba(255, 250, 240, 0.92), rgba(255, 245, 223, 0.74)),
                rgba(255, 255, 255, 0.9);
            border-color: rgba(176, 127, 23, 0.24);
            box-shadow: 0 24px 64px rgba(82, 61, 16, 0.12);
        }
        body.win-cutscene-proclamation-active .win-cutscene-shell:not(.is-collapsing):not(.is-collapsed),
        body.win-cutscene-brightening .win-cutscene-shell:not(.is-collapsing):not(.is-collapsed) {
            animation: win-cutscene-shell-rise 1.35s cubic-bezier(0.18, 0.9, 0.24, 1) forwards;
        }
        body.win-cutscene-proclamation-active .win-cutscene-shell.is-collapsing,
        body.win-cutscene-brightening .win-cutscene-shell.is-collapsing,
        .win-cutscene-shell.is-collapsing {
            animation: win-cutscene-shell-collapse 0.98s cubic-bezier(0.22, 1, 0.36, 1) forwards;
            pointer-events: none;
        }
        .win-cutscene-shell.is-collapsed {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transform: scale(0.08);
        }
        .win-cutscene-kicker {
            margin-bottom: 1rem;
            color: rgba(247, 221, 118, 0.94);
            font-size: 0.86rem;
            font-weight: 700;
            letter-spacing: 0.22em;
            text-transform: uppercase;
            opacity: 0.92;
        }
        body.light-mode .win-cutscene-kicker {
            color: #8f6712;
        }
        .win-cutscene-title {
            font-size: clamp(3.3rem, 8vw, 6.8rem);
            line-height: 0.9;
            letter-spacing: -0.08em;
            margin-bottom: 1rem;
            color: #fff4c8;
            text-transform: uppercase;
            text-shadow:
                0 0 22px rgba(244, 197, 66, 0.2),
                0 0 48px rgba(244, 197, 66, 0.12);
        }
        body.light-mode .win-cutscene-title {
            color: #5b3a00;
            text-shadow:
                0 0 18px rgba(244, 197, 66, 0.16),
                0 0 30px rgba(244, 197, 66, 0.08);
        }
        .win-cutscene-copy {
            color: rgba(255, 244, 209, 0.82);
            font-size: 1.14rem;
            line-height: 1.5;
            max-width: 38rem;
            margin: 0 auto;
        }
        body.light-mode .win-cutscene-copy {
            color: rgba(91, 58, 0, 0.84);
        }
        .win-cutscene-dismiss {
            margin-top: 1.55rem;
            min-width: 240px;
            padding: 0.95rem 1.3rem;
            border: 1px solid rgba(244, 197, 66, 0.42);
            border-radius: 999px;
            background:
                linear-gradient(180deg, rgba(255, 231, 143, 0.34), rgba(244, 197, 66, 0.18)),
                rgba(244, 197, 66, 0.08);
            color: #fff8dc;
            font: inherit;
            font-size: 1.08rem;
            font-weight: 700;
            letter-spacing: 0.02em;
            cursor: pointer;
            box-shadow: 0 16px 36px rgba(244, 197, 66, 0.14);
        }
        .win-cutscene-dismiss:hover {
            background:
                linear-gradient(180deg, rgba(255, 235, 163, 0.4), rgba(244, 197, 66, 0.22)),
                rgba(244, 197, 66, 0.1);
            box-shadow: 0 18px 42px rgba(244, 197, 66, 0.18);
        }
        .win-cutscene-dismiss:focus-visible {
            outline: 2px solid rgba(244, 197, 66, 0.9);
            outline-offset: 3px;
        }
        .win-cutscene-dismiss:disabled {
            cursor: default;
            opacity: 0.72;
            box-shadow: none;
        }
        body.light-mode .win-cutscene-dismiss {
            color: #6c4c06;
            background:
                linear-gradient(180deg, rgba(244, 197, 66, 0.32), rgba(244, 197, 66, 0.18)),
                rgba(255, 255, 255, 0.72);
        }

        @keyframes win-cutscene-app-dim-in {
            0% {
                filter: saturate(1) brightness(1);
            }
            100% {
                filter: saturate(0.96) brightness(0.83);
            }
        }

        @keyframes win-cutscene-app-brighten {
            0% {
                filter: saturate(0.96) brightness(0.83);
            }
            100% {
                filter: saturate(0.99) brightness(0.96);
            }
        }

        @keyframes win-cutscene-backdrop-dim-in {
            0% {
                opacity: 0;
            }
            100% {
                opacity: 0.58;
            }
        }

        @keyframes win-cutscene-backdrop-brighten {
            0% {
                opacity: 0.58;
            }
            100% {
                opacity: 0.2;
            }
        }

        @keyframes win-cutscene-shell-rise {
            0% {
                opacity: 0;
                transform: translateY(24px) scale(0.965);
            }
            100% {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        @keyframes win-cutscene-shell-collapse {
            0% {
                opacity: 1;
                transform: translateY(0) scale(1);
                box-shadow: 0 30px 90px rgba(0, 0, 0, 0.2);
            }
            100% {
                opacity: 0;
                transform: translateY(0) scale(0.08);
                box-shadow: 0 0 0 rgba(0, 0, 0, 0);
            }
        }

        @keyframes win-cutscene-profile-burst {
            0% {
                transform: scale(1);
                text-shadow: 0 0 0 rgba(244, 197, 66, 0);
            }
            35% {
                transform: scale(1.1);
                text-shadow:
                    0 0 12px rgba(255, 242, 176, 0.88),
                    0 0 28px rgba(244, 197, 66, 0.52);
            }
            100% {
                transform: scale(1);
                text-shadow:
                    0 0 4px rgba(255, 242, 176, 0.42),
                    0 0 14px rgba(244, 197, 66, 0.24);
            }
        }

        @keyframes angel-nav-reveal {
            0% {
                opacity: 0;
                transform: translateX(-10px) scale(0.82);
                filter: brightness(1.35) saturate(1.12);
                box-shadow: none;
            }
            55% {
                opacity: 1;
                transform: translateX(0) scale(1.08);
                filter: brightness(1.18) saturate(1.06);
                box-shadow: none;
            }
            100% {
                opacity: 1;
                transform: translateX(0) scale(1);
                filter: brightness(1) saturate(1);
                box-shadow: none;
            }
        }

        .invest-container {
            flex: 1;
            display: none;
            overflow-y: auto;
            padding: 1.5rem 1.25rem;
            background:
                radial-gradient(circle at top, rgba(16, 163, 127, 0.12), transparent 32%),
                linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-primary) 100%);
        }
        body.light-mode .invest-container {
            background:
                radial-gradient(circle at top, rgba(0, 122, 255, 0.10), transparent 32%),
                linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-primary) 100%);
        }
        .angel-invest-container {
            background:
                radial-gradient(circle at top, rgba(244, 197, 66, 0.16), transparent 34%),
                linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-primary) 100%);
        }
        body.light-mode .angel-invest-container {
            background:
                radial-gradient(circle at top, rgba(244, 197, 66, 0.14), transparent 34%),
                linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-primary) 100%);
        }
        .invest-container.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .invest-shell {
            width: min(930px, 100%);
            margin: 0 auto;
            border: 1px solid var(--border-color);
            border-radius: 28px;
            background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0));
            box-shadow: 0 22px 60px rgba(0,0,0,0.22);
            overflow: hidden;
        }
        body.light-mode .invest-shell {
            background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72));
            box-shadow: 0 20px 54px rgba(28, 28, 30, 0.08);
        }
        .angel-invest-shell {
            border-color: rgba(244, 197, 66, 0.28);
            box-shadow: 0 22px 60px rgba(244, 197, 66, 0.10), 0 22px 60px rgba(0,0,0,0.22);
        }
        body.light-mode .angel-invest-shell {
            border-color: rgba(212, 164, 32, 0.24);
            box-shadow: 0 18px 48px rgba(212, 164, 32, 0.10), 0 20px 54px rgba(28, 28, 30, 0.08);
        }
        .portal-kind-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.55rem;
            margin-bottom: 0.9rem;
            padding: 0.45rem 0.9rem;
            border-radius: 999px;
            border: 1px solid var(--border-light);
            background: rgba(255,255,255,0.04);
            color: var(--text-primary);
            font-size: 0.82rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }
        .angel-portal-badge {
            border-color: rgba(244, 197, 66, 0.32);
            background: rgba(244, 197, 66, 0.10);
            color: #f7d66d;
            box-shadow: 0 10px 26px rgba(244, 197, 66, 0.10);
        }
        body.light-mode .angel-portal-badge {
            color: #8f6712;
            background: rgba(244, 197, 66, 0.14);
        }
        .invest-header {
            padding: 2rem 2rem 0.9rem;
            text-align: center;
        }
        .invest-title {
            font-size: clamp(2.35rem, 4vw, 3.7rem);
            line-height: 1.02;
            letter-spacing: -0.04em;
            margin-bottom: 0.75rem;
            color: var(--text-primary);
            font-weight: 600;
        }
        .invest-copy {
            width: min(640px, 100%);
            margin: 0 auto;
            color: var(--text-secondary);
            font-size: 1.45rem;
            line-height: 0.8;
        }
        .invest-copy em {
            display: block;
            font-size: 0.9em;
            margin-bottom: 0;
        }
        .mobile-only-break {
            display: none;
        }
        .desktop-only-break {
            display: inline;
        }
        .invest-copy-secondary {
            display: inline;
        }
        .invest-stage {
            padding: 0.3rem 1.65rem 1rem;
        }
        .invest-carousel {
            position: relative;
            display: grid;
            grid-template-columns: 56px minmax(0, 1fr) 56px;
            align-items: center;
            gap: 0.6rem;
        }
        .carousel-viewport {
            overflow: hidden;
            touch-action: pan-y;
        }
        .carousel-track {
            display: flex;
            transition: transform 0.45s ease-in-out;
            will-change: transform;
        }
        .carousel-slide {
            min-width: 100%;
            opacity: 0.72;
            transform: scale(0.985);
            transition: opacity 0.35s ease, transform 0.35s ease;
        }
        .carousel-slide.active {
            opacity: 1;
            transform: scale(1);
        }
        .product-placeholder {
            position: relative;
            min-height: 330px;
            border-radius: 24px;
            border: 1px solid var(--border-light);
            background:
                radial-gradient(circle at 20% 20%, rgba(16,163,127,0.18), transparent 22%),
                radial-gradient(circle at 80% 24%, rgba(255,255,255,0.05), transparent 18%),
                linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 1.8rem;
            text-align: center;
            overflow: hidden;
        }
        .product-link {
            display: block;
            text-decoration: none;
            color: inherit;
            width: min(520px, 100%);
            margin: 0 auto;
            padding: 0;
            border: none;
            background: transparent;
            cursor: zoom-in;
            font: inherit;
            text-align: inherit;
        }
        .invest-product-image {
            position: relative;
            z-index: 1;
            display: block;
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
        body.light-mode .product-placeholder {
            background:
                radial-gradient(circle at 20% 20%, rgba(0,122,255,0.14), transparent 22%),
                radial-gradient(circle at 80% 24%, rgba(255,255,255,0.65), transparent 18%),
                linear-gradient(145deg, #ffffff, #eef1f6);
        }
        .product-placeholder::before {
            content: "";
            position: absolute;
            inset: 18px;
            border-radius: 18px;
            border: 1px dashed rgba(255,255,255,0.12);
            pointer-events: none;
        }
        body.light-mode .product-placeholder::before {
            border-color: rgba(28,28,30,0.12);
        }
        .product-placeholder.alt {
            background:
                radial-gradient(circle at 70% 20%, rgba(16,163,127,0.16), transparent 20%),
                linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
        }
        body.light-mode .product-placeholder.alt {
            background:
                radial-gradient(circle at 70% 20%, rgba(0,122,255,0.12), transparent 20%),
                linear-gradient(135deg, #ffffff, #edf2f7);
        }
        .product-placeholder.alt-two {
            background:
                radial-gradient(circle at 50% 18%, rgba(16,163,127,0.2), transparent 18%),
                linear-gradient(180deg, var(--bg-secondary), var(--bg-tertiary));
        }
        body.light-mode .product-placeholder.alt-two {
            background:
                radial-gradient(circle at 50% 18%, rgba(0,122,255,0.14), transparent 18%),
                linear-gradient(180deg, #ffffff, #eef0f6);
        }
        .product-placeholder.alt-three {
            background:
                radial-gradient(circle at 30% 18%, rgba(16,163,127,0.18), transparent 18%),
                linear-gradient(160deg, var(--bg-secondary), var(--bg-primary));
        }
        body.light-mode .product-placeholder.alt-three {
            background:
                radial-gradient(circle at 30% 18%, rgba(0,122,255,0.14), transparent 18%),
                linear-gradient(160deg, #ffffff, #eef2f8);
        }
        .angel-placeholder {
            background:
                radial-gradient(circle at 50% 16%, rgba(244, 197, 66, 0.22), transparent 18%),
                radial-gradient(circle at 82% 20%, rgba(255,255,255,0.06), transparent 18%),
                linear-gradient(145deg, #1f1b10, #2b2414 48%, #16120c);
        }
        body.light-mode .angel-placeholder {
            background:
                radial-gradient(circle at 50% 16%, rgba(244, 197, 66, 0.22), transparent 18%),
                radial-gradient(circle at 82% 20%, rgba(255,255,255,0.82), transparent 18%),
                linear-gradient(145deg, #fffdf6, #f5ecd2 48%, #f8f2df);
        }
        .angel-placeholder::before {
            border-color: rgba(244, 197, 66, 0.28);
        }
        body.light-mode .angel-placeholder::before {
            border-color: rgba(143, 103, 18, 0.18);
        }
        .product-placeholder-label {
            font-size: clamp(1.35rem, 2vw, 1.85rem);
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 0.38rem;
        }
        .product-placeholder-note {
            color: var(--text-secondary);
            font-size: 1rem;
            letter-spacing: 0.02em;
        }
        .carousel-control {
            width: 56px;
            height: 56px;
            border: none;
            background: transparent;
            color: var(--accent);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.18s ease, opacity 0.2s ease;
        }
        .carousel-control:hover {
            opacity: 0.85;
        }
        .carousel-control:disabled {
            opacity: 0.26;
            cursor: default;
        }
        .carousel-control:active {
            transform: scale(0.94);
        }
        .carousel-arrow {
            width: 28px;
            height: 28px;
            display: inline-block;
            border-top: 5px solid currentColor;
            border-right: 5px solid currentColor;
            border-radius: 4px;
            opacity: 0.8;
        }
        .carousel-arrow-left {
            transform: rotate(-135deg);
        }
        .carousel-arrow-right {
            transform: rotate(45deg);
        }
        .carousel-dots {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.8rem;
            margin-top: 0.95rem;
        }
        .carousel-dot {
            width: 14px;
            height: 14px;
            border-radius: 999px;
            border: none;
            background: var(--border-light);
            cursor: pointer;
            transition: transform 0.18s ease, background-color 0.2s ease, width 0.2s ease;
        }
        .carousel-dot.active {
            width: 42px;
            background: var(--accent);
        }
        .carousel-dot:active {
            transform: scale(0.92);
        }
        .invest-cta-block {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 0 1.2rem 1.6rem;
            text-align: center;
        }
        .invest-offer-summary {
            display: flex;
            align-items: baseline;
            justify-content: center;
            gap: 0.55rem;
            width: fit-content;
            margin: 0.8rem auto 0.25rem;
            padding: 0.2rem 0 0.1rem;
            color: var(--text-primary);
            line-height: 1;
            pointer-events: none;
            user-select: none;
        }
        .invest-price {
            font-size: clamp(2.15rem, 3vw, 2.75rem);
            font-weight: 700;
            letter-spacing: -0.05em;
            color: var(--text-primary);
        }
        .invest-shipping {
            font-size: 0.92rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            color: var(--text-secondary);
            white-space: nowrap;
        }
        .invest-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.55rem;
            font-weight: 600;
            font-size: 2.3rem;
            text-decoration: none;
            color: var(--accent);
            background: var(--link-bg);
            border: 1px solid var(--border-light);
            border-radius: 999px;
            min-width: 360px;
            padding: 1.45rem 2.8rem;
            transition: background-color 0.2s ease, color 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
        }
        .invest-link:hover {
            background: var(--accent);
            color: var(--bg-primary);
            box-shadow: 0 14px 28px rgba(0,0,0,0.18);
        }
        .invest-link:active {
            transform: scale(0.97);
        }
        body.light-mode .invest-link:hover {
            color: #000;
        }
        .angel-invest-link {
            color: #f4c542;
            background: rgba(244, 197, 66, 0.10);
            border-color: rgba(244, 197, 66, 0.24);
        }
        .angel-invest-link:hover {
            background: #f4c542;
            color: #1b1505;
            box-shadow: 0 14px 28px rgba(244, 197, 66, 0.18);
        }
        body.light-mode .angel-invest-link:hover {
            color: #241a05;
        }
        .invest-lightbox {
            position: fixed;
            inset: 0;
            z-index: 1200;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 1.5rem;
        }
        .invest-lightbox.active {
            display: flex;
        }
        .invest-lightbox-backdrop {
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.72);
            backdrop-filter: blur(10px);
        }
        .invest-lightbox-dialog {
            position: relative;
            z-index: 1;
            width: min(1040px, 100%);
            border-radius: 28px;
            border: 1px solid var(--border-color);
            background: linear-gradient(180deg, rgba(12, 14, 18, 0.96), rgba(18, 21, 27, 0.93));
            box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
            padding: 1.4rem 1.2rem 1rem;
        }
        body.light-mode .invest-lightbox-dialog {
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(242, 245, 250, 0.95));
            box-shadow: 0 28px 80px rgba(28, 28, 30, 0.18);
        }
        .angel-invest-lightbox-dialog {
            border-color: rgba(244, 197, 66, 0.28);
            box-shadow: 0 28px 80px rgba(244, 197, 66, 0.12), 0 28px 80px rgba(0, 0, 0, 0.45);
        }
        .invest-lightbox-close {
            position: absolute;
            top: 0.9rem;
            right: 0.9rem;
            z-index: 3;
            width: 48px;
            height: 48px;
            border: none;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.08);
            color: var(--text-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 2rem;
            line-height: 1;
            transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
            pointer-events: auto;
        }
        body.light-mode .invest-lightbox-close {
            background: rgba(28, 28, 30, 0.08);
        }
        .invest-lightbox-close:hover {
            background: rgba(255, 255, 255, 0.18);
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
        }
        .invest-lightbox-close:active {
            transform: scale(0.95);
        }
        body.light-mode .invest-lightbox-close:hover {
            background: rgba(28, 28, 30, 0.14);
            box-shadow: 0 10px 24px rgba(28, 28, 30, 0.14);
        }
        .invest-lightbox-carousel {
            position: relative;
            display: grid;
            grid-template-columns: 64px minmax(0, 1fr) 64px;
            align-items: center;
            gap: 0.8rem;
        }
        .lightbox-control {
            width: 64px;
            height: 64px;
            border: none;
            background: transparent;
            color: var(--accent);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.18s ease, opacity 0.2s ease;
        }
        .lightbox-control:hover {
            opacity: 0.85;
        }
        .lightbox-control:disabled {
            opacity: 0.26;
            cursor: default;
        }
        .lightbox-control:active {
            transform: scale(0.94);
        }
        .lightbox-viewport {
            overflow: hidden;
            touch-action: pan-y;
        }
        .lightbox-track {
            display: flex;
            transition: transform 0.45s ease-in-out;
            will-change: transform;
        }
        .lightbox-slide {
            min-width: 100%;
        }
        .lightbox-slide .product-placeholder {
            min-height: min(72vh, 680px);
            padding: 2.5rem;
        }
        .lightbox-dots {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.8rem;
            margin-top: 1rem;
        }
        .lightbox-dot {
            width: 14px;
            height: 14px;
            border-radius: 999px;
            border: none;
            background: var(--border-light);
            cursor: pointer;
            transition: transform 0.18s ease, background-color 0.2s ease, width 0.2s ease;
        }
        .lightbox-dot.active {
            width: 42px;
            background: var(--accent);
        }
        .lightbox-dot:active {
            transform: scale(0.92);
        }
        body.lightbox-open {
            overflow: hidden;
        }

        .message-wrapper {
            display: flex;
            padding: 1.2rem 0.5rem;
            border-bottom: 0.5px solid var(--border-color);
        }
        .user-wrapper {
            background-color: var(--bg-primary);
            justify-content: flex-end;
        }
        .assistant-wrapper {
            background-color: var(--message-assistant);
            justify-content: flex-start;
        }

        .avatar {
            width: 28px;
            height: 28px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 1rem;
            flex-shrink: 0;
        }
        .user-avatar {
            background-color: var(--avatar-user);
            color: var(--bg-primary);
            order: 2;
            margin-right: 0;
            margin-left: 1rem;
            border: 1px solid transparent;
        }
        .assistant-avatar {
            background-color: var(--avatar-assistant);
            color: white;
        }

        .message-content {
            font-size: 0.95rem;
            line-height: 1.6;
            color: var(--text-primary);
            max-width: 800px;
            white-space: pre-wrap; /* Preserve line breaks */
        }
        .user-wrapper .message-content {
            text-align: right;
        }

        /* Link styling */
        a.response-link {
            color: var(--accent);
            font-weight: 600;
            text-decoration: none;
            border-bottom: 1px solid var(--accent);
            background-color: var(--link-bg);
            padding: 0 0.1rem;
            border-radius: 3px;
            transition: background-color 0.2s, color 0.2s;
        }
        a.response-link:hover {
            background-color: var(--accent);
            color: var(--bg-primary);
            text-decoration: none;
        }
        a.external-response-link {
            color: #8ab4ff;
            text-decoration: underline;
            text-underline-offset: 0.14em;
            text-decoration-thickness: 1px;
        }
        a.external-response-link:hover {
            color: #b8d0ff;
        }
        body.light-mode a.external-response-link {
            color: var(--accent);
        }
        body.light-mode a.external-response-link:hover {
            color: var(--accent-hover);
        }

        /* Word streaming fade-in animation */
        @keyframes fadeInWord {
            0% { opacity: 0; transform: translateY(2px); }
            100% { opacity: 1; transform: translateY(0); }
        }
        .fade-word {
            display: inline;
            animation: fadeInWord 0.2s ease-out forwards;
        }

        /* Thinking animation */
        .typing-indicator {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            margin-left: 0.6rem;
            padding: 0.5rem 0;
        }
        .typing-indicator span {
            height: 8px;
            width: 8px;
            background-color: var(--text-secondary);
            border-radius: 50%;
            display: inline-block;
            opacity: 0.6;
            animation: pulse 1.5s infinite;
        }
        .typing-indicator span:nth-child(1) {
            animation-delay: 0s;
        }
        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }
        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }
        @keyframes pulse {
            0%, 100% { opacity: 0.5; transform: scale(0.9); }
            50% { opacity: 1; transform: scale(1.2); }
        }

        .shimmer-placeholder {
            color: var(--text-secondary);
            background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-light) 50%, var(--bg-tertiary) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.8s infinite;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            display: inline;
        }
        @keyframes shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        .image-placeholder {
            background-color: var(--bg-tertiary);
            border-radius: 12px;
            padding: 1rem;
            margin-top: 0.5rem;
            text-align: center;
            color: var(--text-secondary);
            border: 1px dashed var(--border-light);
            font-size: 0.9rem;
        }
        .image-placeholder.partial {
            background: linear-gradient(45deg, var(--bg-tertiary) 25%, var(--border-light) 25%, var(--border-light) 50%, var(--bg-tertiary) 50%, var(--bg-tertiary) 75%, var(--border-light) 75%);
            background-size: 20px 20px;
            animation: loading-bar 1s linear infinite;
        }
        .generated-image-response {
            display: block;
            width: 100%;
            max-width: 420px;
            margin-top: 0.5rem;
            border-radius: 12px;
            opacity: 0;
            animation: generated-image-fade-in 0.45s ease forwards;
        }
        @keyframes generated-image-fade-in {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        @keyframes loading-bar {
            0% { background-position: 0 0; }
            100% { background-position: 20px 20px; }
        }

        .system-error {
            background-color: var(--bg-secondary);
            border-left: 4px solid #e74c3c;
            padding: 1rem;
            margin: 1rem 0;
            font-family: 'Courier New', monospace;
            color: #e74c3c;
            border-radius: 4px;
            font-size: 0.9rem;
            white-space: pre-wrap;
        }

        .achievement-toasts {
            position: fixed;
            left: 1.25rem;
            bottom: 6.25rem;
            z-index: 120;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 0.7rem;
            pointer-events: none;
        }
        .achievement-toast {
            min-width: 240px;
            max-width: min(360px, calc(100vw - 2.5rem));
            padding: 0.8rem 0.95rem 0.85rem;
            border-radius: 16px;
            border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border-light) 68%);
            background:
                linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--bg-secondary) 86%), var(--bg-secondary));
            box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
            opacity: 0;
            transform: translateX(-18px) translateY(10px);
            transition: opacity 0.26s ease, transform 0.26s ease;
        }
        .achievement-toast.visible {
            opacity: 1;
            transform: translateX(0) translateY(0);
        }
        .achievement-toast-title {
            display: block;
            font-size: 0.76rem;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--accent);
            margin-bottom: 0.28rem;
        }
        .achievement-toast-name {
            display: block;
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-primary);
            line-height: 1.25;
        }
        .achievement-toast-xp {
            display: inline-block;
            margin-top: 0.45rem;
            font-size: 0.84rem;
            font-weight: 600;
            color: var(--text-secondary);
        }
        body.light-mode .achievement-toast {
            box-shadow: 0 18px 36px rgba(28, 28, 30, 0.12);
        }

        .chat-input-area {
            padding: 1rem 1.5rem 1.2rem;
            background-color: var(--bg-primary);
            border-top: 0.5px solid var(--border-color);
            display: none;
        }
        .chat-input-area.active {
            display: block;
        }

        .disclaimer {
            font-size: 0.7rem;
            color: var(--text-secondary);
            text-align: center;
            margin-top: 0.6rem;
        }

        /* ---------- MOBILE OVERRIDES ---------- */
        @media screen and (max-width: 768px) {
            body {
                padding-top: 0;
                padding-bottom: 0;
                padding-left: 0;
                padding-right: 0;
                height: 100vh;
                height: -webkit-fill-available;
            }

            .collapse-toggle {
                display: none;
            }

            .hamburger-menu {
                display: block;
            }
            .left-spacer {
                display: none;
            }
            .top-bar {
                display: flex !important;
                padding: calc(0.6rem + env(safe-area-inset-top)) 0.8rem 0.6rem 0.8rem;
            }

            .sidebar {
                position: absolute;
                top: 0;
                left: 0;
                height: 100vh;
                height: -webkit-fill-available;
                transform: translateX(-100%);
                transition: transform 0.3s ease;
                width: 280px;
                z-index: 30;
                box-shadow: 2px 0 10px rgba(0,0,0,0.5);
                padding-top: env(safe-area-inset-top);
                padding-bottom: env(safe-area-inset-bottom);
            }
            .sidebar.mobile-visible {
                transform: translateX(0);
            }
            .sidebar-logo-placeholder {
                display: flex;
                align-items: center;
                gap: 0.35rem;
            }
            .sidebar-mobile-logo {
                display: block;
                width: 24px;
                height: 24px;
                object-fit: contain;
                flex: 0 0 auto;
                filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.42)) drop-shadow(0 0 4px rgba(255, 255, 255, 0.12));
            }
            body.light-mode .sidebar-mobile-logo {
                filter: none;
            }

            body.sidebar-open::after {
                content: '';
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0,0,0,0.5);
                z-index: 25;
            }

            .main {
                width: 100%;
                padding-top: 0;
                padding-bottom: 0;
                padding-left: 0;
                padding-right: 0;
                height: 100vh;
                height: -webkit-fill-available;
            }

            .welcome-message {
                font-size: 1.8rem;
                padding: 0 1rem;
            }

            .centered-input-box, .chat-input-box {
                margin: 0 0.5rem;
            }

            .avatar {
                width: 24px;
                height: 24px;
                font-size: 0.7rem;
            }

            .chat-container {
                padding: 1rem;
                padding-bottom: calc(1rem + env(safe-area-inset-bottom));
            }
            .achievement-toasts {
                bottom: calc(5.5rem + env(safe-area-inset-bottom));
                left: 0.85rem;
                right: auto;
                gap: 0.6rem;
            }
            .achievement-toast {
                min-width: 0;
                max-width: min(320px, calc(100vw - 1.7rem));
                padding: 0.72rem 0.82rem 0.78rem;
                border-radius: 14px;
                transform: translateX(-12px) translateY(8px);
            }
            .achievement-toast.visible {
                transform: translateX(0) translateY(0);
            }
            .profile-achievements-menu {
                left: 0.6rem;
                right: 0.6rem;
                top: calc((var(--achievement-entry-raise) + 0.4rem) * -1);
                padding: 0.78rem 0.78rem 0.56rem;
            }
            .profile-achievements-list {
                max-height: 180px;
            }
            .profile-meta {
                --achievement-entry-raise: 3rem;
            }
            .invest-container {
                padding: calc(3.25rem + env(safe-area-inset-top)) 0.65rem 1rem;
                padding-bottom: calc(1rem + env(safe-area-inset-bottom));
                justify-content: flex-start;
                align-items: center;
            }
            .invest-shell {
                border-radius: 20px;
                width: min(540px, 100%);
                margin-top: -28px;
            }
            .invest-header {
                padding: 1.45rem 1rem 0.58rem;
            }
            .invest-stage {
                padding: 0.28rem 0.8rem 0.8rem;
            }
            .invest-carousel {
                grid-template-columns: 38px minmax(0, 1fr) 38px;
                gap: 0.25rem;
            }
            .carousel-control {
                width: 38px;
                height: 38px;
            }
            .carousel-arrow {
                width: 20px;
                height: 20px;
                border-top-width: 4px;
                border-right-width: 4px;
            }
            .product-placeholder {
                min-height: 170px;
                border-radius: 16px;
                padding: 1rem 0.8rem;
            }
            .product-placeholder::before {
                inset: 12px;
                border-radius: 12px;
            }
            .invest-title {
                font-size: 1.85rem;
                margin-bottom: 0.5rem;
            }
            .invest-copy {
                font-size: 1.23rem;
                line-height: 0.8;
                width: min(320px, calc(100% - 1.5rem));
            }
            .invest-copy em {
                margin-bottom: 0;
            }
            .mobile-only-break {
                display: inline;
            }
            .desktop-only-break {
                display: none;
            }
            .invest-copy-secondary {
                font-size: 0.85em;
            }
            .product-placeholder-label {
                font-size: 1.6rem;
                margin-bottom: 0.28rem;
            }
            .product-placeholder-note {
                font-size: 1.1rem;
            }
            .carousel-dots {
                gap: 0.5rem;
                margin-top: 0.72rem;
            }
            .carousel-dot {
                width: 14px;
                height: 14px;
            }
            .carousel-dot.active {
                width: 42px;
            }
            .invest-cta-block {
                padding: 0 0.8rem 1rem;
            }
            .invest-offer-summary {
                gap: 0.45rem;
                margin: 0.72rem auto 0.25rem;
            }
            .invest-price {
                font-size: 2.05rem;
            }
            .invest-shipping {
                font-size: 0.8rem;
                letter-spacing: 0.02em;
            }
            .invest-link {
                width: 100%;
                min-width: 0;
                padding: 0.7rem 0.8rem;
                font-size: 2.42rem;
                background: color-mix(in srgb, var(--accent) 78%, white 22%);
                color: #fff;
            }
            .invest-lightbox {
                padding: 0.85rem;
            }
            .win-cutscene-overlay {
                padding: 1rem;
            }
            .win-cutscene-shell {
                width: min(100%, 520px);
                padding: 1.7rem 1rem 1.15rem;
                border-radius: 22px;
            }
            .win-cutscene-kicker {
                margin-bottom: 0.7rem;
                font-size: 0.74rem;
                letter-spacing: 0.12em;
            }
            .win-cutscene-title {
                font-size: 2.7rem;
                margin-bottom: 0.65rem;
            }
            .win-cutscene-copy {
                font-size: 0.95rem;
                line-height: 1.45;
            }
            .win-cutscene-dismiss {
                width: 100%;
                min-width: 0;
                margin-top: 1.05rem;
            }
            .invest-lightbox-dialog {
                width: min(100%, 620px);
                border-radius: 20px;
                padding: 3.2rem 0.65rem 0.8rem;
            }
            .invest-lightbox-close {
                top: 0.6rem;
                right: 0.6rem;
                width: 42px;
                height: 42px;
                font-size: 1.8rem;
            }
            .invest-lightbox-carousel {
                grid-template-columns: 38px minmax(0, 1fr) 38px;
                gap: 0.25rem;
            }
            .lightbox-control {
                width: 38px;
                height: 38px;
            }
            .lightbox-slide .product-placeholder {
                min-height: min(56vh, 420px);
                border-radius: 16px;
                padding: 1.2rem 0.9rem;
            }
            .lightbox-dots {
                gap: 0.5rem;
                margin-top: 0.72rem;
            }
            .lightbox-dot {
                width: 14px;
                height: 14px;
            }
            .lightbox-dot.active {
                width: 42px;
            }

            .centered-container {
                padding-top: 0;
                padding-bottom: calc(2rem + env(safe-area-inset-bottom));
            }
            .chat-input-area {
                padding-bottom: calc(1.2rem + env(safe-area-inset-bottom));
            }

            .centered-container, .chat-container, .invest-container {
                scroll-padding-bottom: env(safe-area-inset-bottom);
            }
        }
