        :root {
            color-scheme: dark;
            --bg-page: #121212;
            --bg-sidebar: #181817;
            --bg-card: #151518;
            --bg-input: #151518;
            --border-color: #202025;
            --text-primary: #f0f0f3;
            --text-secondary: #b0b0b6;
            --accent-blue: #3d80fc;
            --jbs-blue: #005b8f;
            --jbs-blue-bright: #0070b3;
            --jbs-blue-soft: #4aa6dd;
            --jbs-gold: #d6b04a;
            --jbs-gold-bright: #ffe27a;
            --hover-bg: #1c1c21;
            --border: var(--border-color);
            --accent: var(--accent-blue);
            --accent-color: var(--accent-blue);
            --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            --transition-speed: 0.2s;
        }

        html {
            background-color: var(--bg-page);
            min-height: 100vh;
            min-height: 100dvh;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: var(--font-main);
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        body {
            background-color: var(--bg-page);
            color: var(--text-primary);
            display: flex;
            height: 100vh;
            height: 100dvh;

            overflow: visible;
        }


        .sidebar {
            width: 250px;
            min-width: 250px;
            background-color: var(--bg-sidebar);
            border-right: 1px solid #2a2a2a;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 28px 12px 12px 12px;
            transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                        border-right-color 0.15s ease;
            position: relative;
            z-index: 10;
            flex-shrink: 0;
            overflow: hidden;
        }

        .sidebar.collapsed {
            width: 0;
            min-width: 0;
            padding: 12px 0;
            border-right-color: transparent;
            transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                        min-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                        padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                        border-right-color 0s 0.35s;
        }

        .sidebar-resize-handle {
            position: fixed;
            top: 0;
            width: 10px;
            height: 100vh;
            cursor: col-resize;
            z-index: 100;
        }

        .sidebar-resize-handle.dragging {
        }

        .sidebar > div {
            opacity: 1;
            transition: opacity 0.25s ease 0.15s;
            white-space: nowrap;
            min-width: 226px;
        }

        .sidebar > div:first-child {
            display: flex;
            flex: 1 1 auto;
            flex-direction: column;
            min-height: 0;
        }

        .sidebar.collapsed > div {
            opacity: 0;
            transition: opacity 0.15s ease;
        }

        .sidebar-header {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            margin-bottom: 28px;
            padding: 0 4px;
        }

        .sidebar-toggle-btn {
            margin-left: auto;
        }


        .logo-words-gradient {
            -webkit-mask-image: url('logo-words.png');
            mask-image: url('logo-words.png');
            -webkit-mask-size: contain;
            mask-size: contain;
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
            -webkit-mask-position: left center;
            mask-position: left center;
        }

        /* The color layer is bigger than the box, so a strong blur does not eat the edges. */
        .logo-words-gradient::before {
            content: '';
            position: absolute;
            inset: -30px;
            background-image: linear-gradient(-45deg, #002a6a, #0db9a4, #002a6a);
            background-size: 300% 300%;
            background-position: 0% 50%;
            animation: logoGradientShift 7s linear infinite;
            /* ponytail: filter runs before the mask, so the color blurs but the letters stay sharp */
            filter: blur(14px);
        }

        @keyframes logoGradientShift {
            from { background-position: 300% 50%; }
            to { background-position: 0% 50%; }
        }

        .logo-box {
            width: 36px;
            height: 36px;
            background-color: #ffffff;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #000000;
            font-weight: 800;
            font-size: 20px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.3);
            cursor: pointer;
        }

        .sidebar-toggle-btn {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 10px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background var(--transition-speed), color var(--transition-speed);
        }

        .sidebar-toggle-btn:hover {
            background-color: #242423;
            color: var(--text-primary);
        }


        .sidebar-float-toggle {
            position: absolute;
            left: 12px;
            top: 12px;
            z-index: 100;
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
            cursor: pointer;
            padding: 8px;
            border-radius: 8px;
            display: none;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(0,0,0,0.5);
            transition: all var(--transition-speed);
        }

        .sidebar-float-toggle:hover {
            color: var(--text-primary);
            background-color: var(--hover-bg);
        }

        .new-chat-btn {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            background-color: rgba(0, 91, 143, 0.16);
            border: 1px solid rgba(0, 112, 179, 0.45);
            color: var(--text-primary);
            border-radius: 10px;
            padding: 14px 16px;
            font-size: 15px;
            font-weight: 500;
            cursor: pointer;
            margin-bottom: 16px;
            transition: background-color var(--transition-speed), border-color var(--transition-speed);
        }

        .new-chat-btn:hover {
            background-color: rgba(0, 91, 143, 0.26);
            border-color: rgba(0, 112, 179, 0.65);
        }

        .new-chat-left {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .new-chat-left svg {
            color: #7cc0ee;
        }

        .hotkey-badge {
            background-color: rgba(0, 91, 143, 0.3);
            color: #9fcbe8;
            padding: 2px 7px;
            border-radius: 5px;
            font-size: 11px;
            font-family: monospace;
            border: 1px solid rgba(0, 112, 179, 0.4);
        }

        .menu-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 2px;
            margin-bottom: 12px;
        }

        .menu-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 14px;
            font-weight: 400;
            border-radius: 6px;
            cursor: pointer;
            transition: background-color var(--transition-speed), color var(--transition-speed);
        }

        .menu-item:hover {
            background-color: #242423;
            color: var(--text-secondary);
        }

        .menu-item svg {
            color: var(--text-secondary);
            flex-shrink: 0;
            transition: color var(--transition-speed);
        }

        .menu-item:hover svg {
            color: var(--text-secondary);
        }

        .beta-tag {
            color: var(--accent-blue);
            font-size: 9px;
            font-weight: 600;
            margin-left: 6px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .section-header {
            color: var(--jbs-gold);
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin: 16px 4px 6px 4px;
        }

        .chat-list-scroll {
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
            margin-bottom: 0;
            scrollbar-width: thin;
            scrollbar-color: transparent transparent;
        }

        .chat-list-scroll::-webkit-scrollbar {
            width: 4px;
        }
        .chat-list-scroll::-webkit-scrollbar-track {
            background: transparent;
        }
        .chat-list-scroll::-webkit-scrollbar-thumb {
            background-color: transparent;
            border-radius: 10px;
        }
        .chat-list-scroll.is-scrolling {
            scrollbar-color: #202024 transparent;
        }
        .chat-list-scroll.is-scrolling::-webkit-scrollbar-thumb {
            background-color: #202024;
        }

        .chat-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            padding-right: 36px;
            border-left: 3px solid transparent;
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 14px;
            border-radius: 6px;
            cursor: pointer;
            transition: background-color var(--transition-speed), color var(--transition-speed);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            position: relative;
        }

        .chat-item:hover {
            background-color: #242423;
            color: var(--text-secondary);
        }

        .chat-item.active {
            background-color: #242423;
            border-left-color: var(--jbs-gold);
            color: var(--jbs-gold);
        }

        .chat-item-inner {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
            min-width: 0;
        }

        .chat-item-inner > svg {
            flex: 0 0 10px;
            width: 10px;
            height: 10px;
        }

        .chat-item-title {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .chat-item-delete {
            display: flex;
            align-items: center;
            justify-content: center;
            position: absolute;
            top: 50%;
            right: 10px;
            transform: translateY(-50%);
            width: 22px;
            height: 22px;
            border-radius: 4px;
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            flex-shrink: 0;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.12s, color 0.12s, background 0.12s;
        }

        .chat-item:hover .chat-item-delete,
        .chat-item:focus-within .chat-item-delete {
            opacity: 1;
            visibility: visible;
        }

        .chat-item-delete:hover,
        .chat-item-delete:focus-visible {
            background: rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
        }

        .chat-item-delete:focus-visible,
        .msg-user-toolbar button:focus-visible,
        .msg-ai-toolbar button:focus-visible {
            outline: 2px solid var(--jbs-blue-soft);
            outline-offset: 1px;
        }

        /* A toggle only stays focused after keyboard activation (mouse focus is
           blurred in its onclick), so plain :focus here means keyboard focus in
           every browser — no :focus-visible heuristic lottery. */
        .pulled-chunk-toggle:focus,
        .pulled-info-toggle:focus {
            background: rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
            outline: 2px solid var(--jbs-blue-soft);
            outline-offset: 1px;
        }


        .invite-card {
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 10px 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
            cursor: pointer;
            transition: border-color var(--transition-speed);
        }

        .invite-card:hover {
            border-color: #2d2d34;
        }

        .invite-info {
            display: flex;
            flex-direction: column;
            gap: 1px;
        }

        .invite-title {
            font-size: 12px;
            font-weight: 500;
            color: var(--text-primary);
        }

        .invite-desc {
            font-size: 10px;
            color: var(--text-secondary);
        }


        .user-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding-top: 10px;
            border-top: 1px solid rgba(214, 176, 74, 0.22);
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
        }

        .avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background-color: var(--jbs-blue);
            color: var(--jbs-gold-bright);
            font-weight: 600;
            font-size: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .user-name {
            font-size: 14px;
            font-weight: 500;
            color: var(--text-primary);
        }

        .upgrade-btn {
            font-size: 9px;
            font-weight: 600;
            color: var(--jbs-gold);
            border: 1px solid rgba(214, 176, 74, 0.3);
            background: rgba(214, 176, 74, 0.08);
            padding: 1px 5px;
            border-radius: 4px;
            cursor: pointer;
            transition: all var(--transition-speed);
        }

        .upgrade-btn:hover {
            background: rgba(214, 176, 74, 0.15);
            border-color: rgba(214, 176, 74, 0.5);
        }

        .footer-actions {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .footer-action-btn {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 6px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: color var(--transition-speed), background var(--transition-speed);
        }

        .footer-action-btn:hover {
            color: var(--text-primary);
            background-color: var(--hover-bg);
        }

        .feedback-open-btn {
            background: transparent;
            border: 1px solid rgba(214, 176, 74, 0.35);
            border-radius: 7px;
            color: var(--jbs-gold);
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            padding: 6px 10px;
            transition: color var(--transition-speed), background var(--transition-speed), border-color var(--transition-speed);
        }

        .feedback-open-btn:hover {
            background-color: rgba(214, 176, 74, 0.12);
            border-color: rgba(214, 176, 74, 0.6);
            color: var(--jbs-gold-bright);
        }

        .feedback-modal {
            align-items: center;
            background: rgba(0, 0, 0, 0.68);
            display: flex;
            inset: 0;
            justify-content: center;
            padding: 20px;
            position: fixed;
            z-index: 300;
        }

        .feedback-modal[hidden] {
            display: none;
        }

        .feedback-panel {
            background: var(--bg-card);
            border: 1px solid #34343a;
            border-radius: 14px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
            max-width: 460px;
            padding: 22px;
            width: 100%;
        }

        .feedback-header {
            align-items: center;
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
        }

        .feedback-title {
            font-size: 20px;
            font-weight: 700;
        }

        .feedback-close-btn {
            align-items: center;
            background: transparent;
            border: none;
            border-radius: 6px;
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            font-size: 24px;
            height: 32px;
            justify-content: center;
            line-height: 1;
            width: 32px;
        }

        .feedback-close-btn:hover {
            background: var(--hover-bg);
            color: var(--text-primary);
        }

        .feedback-help {
            color: var(--text-secondary);
            font-size: 13px;
            line-height: 1.5;
            margin-bottom: 14px;
        }

        .feedback-label {
            display: block;
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 7px;
        }

        .feedback-textarea {
            background: #101013;
            border: 1px solid #35353b;
            border-radius: 9px;
            color: var(--text-primary);
            font-size: 15px;
            line-height: 1.5;
            min-height: 140px;
            outline: none;
            padding: 11px 12px;
            resize: vertical;
            width: 100%;
        }

        .feedback-textarea:focus {
            border-color: var(--accent-blue);
            box-shadow: 0 0 0 2px rgba(61, 128, 252, 0.18);
        }

        .feedback-footer {
            align-items: center;
            display: flex;
            gap: 12px;
            justify-content: flex-end;
            margin-top: 14px;
        }

        .feedback-consent {
            color: var(--text-secondary);
            font-size: 12px;
            line-height: 1.4;
            margin-top: 12px;
        }

        .feedback-consent a {
            color: var(--jbs-blue-soft);
        }

        .feedback-status {
            color: var(--text-secondary);
            flex: 1;
            font-size: 12px;
            line-height: 1.4;
        }

        .feedback-status.error {
            color: #ff8f8f;
        }

        .feedback-submit-btn {
            background: var(--accent-blue);
            border: none;
            border-radius: 8px;
            color: #fff;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            padding: 9px 14px;
        }

        .feedback-submit-btn:hover {
            background: #5791fc;
        }

        .feedback-submit-btn:disabled {
            cursor: wait;
            opacity: 0.65;
        }


        .visually-hidden {
            position: absolute !important;
            width: 1px;
            height: 1px;
            margin: -1px;
            padding: 0;
            overflow: hidden;
            clip: rect(0 0 0 0);
            white-space: nowrap;
            border: 0;
        }

        .skip-link {
            position: absolute;
            left: 12px;
            top: -48px;
            z-index: 10000;
            background-color: var(--bg-card);
            color: var(--text-primary);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 8px 14px;
            font-size: 14px;
            text-decoration: none;
            transition: top 0.15s ease;
        }

        .skip-link:focus-visible {
            top: 12px;
        }

        .main-content {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: flex-start;
            position: relative;
            background-color: var(--bg-page);
            overflow: hidden;
        }


        .main-header {
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 36px;
            flex-shrink: 0;
            padding: 12px 20px 0 20px;
            z-index: 5;
        }

        .upgrade-pill {
            background: rgba(61, 128, 252, 0.06);
            border: 1px solid rgba(61, 128, 252, 0.18);
            color: var(--accent-blue);
            font-size: 12px;
            font-weight: 500;
            padding: 5px 12px;
            border-radius: 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all var(--transition-speed);
        }

        .upgrade-pill:hover {
            background: rgba(61, 128, 252, 0.12);
            border-color: rgba(61, 128, 252, 0.3);
        }


        .center-hub {
            max-width: 780px;
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: absolute;
            left: 50%;
            bottom: calc(50% + 72px);
            transform: translateX(-50%);
            gap: 24px;
        }


        .brand-logo-container {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
            user-select: none;
            filter: drop-shadow(0 0 20px rgba(96, 165, 250, 0.3));
        }

        .brand-text {
            font-size: 52px;
            font-weight: 800;
            letter-spacing: -1.5px;
        }

        .brand-blue {
            color: #005b8f;
            position: relative;
        }

        .brand-blue::after {
            content: 'JBS';
            position: absolute;
            left: 0;
            top: 0;
            color: #0070b3;
            -webkit-mask-image: linear-gradient(-35deg, transparent 30%, #000 50%, transparent 70%);
            mask-image: linear-gradient(-35deg, transparent 30%, #000 50%, transparent 70%);
            -webkit-mask-size: 200%;
            mask-size: 200%;
            animation: shinePass 2s infinite;
        }

        @keyframes shinePass {
            from { -webkit-mask-position: 150%; mask-position: 150%; }
            to { -webkit-mask-position: -50%; mask-position: -50%; }
        }

        .brand-gold {
            background-image: linear-gradient(90deg, #ffe27a, #d6b04a, #ffe27a);
            background-size: 200% auto;
            background-position: 0% 50%;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            color: transparent;
            animation: shimmerBrand 3s linear infinite;
        }

        @keyframes shimmerBrand {
            from { background-position: 200% 50%; }
            to { background-position: 0% 50%; }
        }


        .chat-input-container {
            width: 100%;
            background-color: #1f1f1f;
            border: 1px solid rgba(0, 112, 179, 0.55);
            border-radius: 20px;
            padding: 18px 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.15);
            transition: border-color var(--transition-speed);
            cursor: text;
        }

        .chat-input-container:focus-within {
            border-color: rgba(0, 112, 179, 0.85);
        }

        .chat-textarea {
            width: 100%;
            background: transparent;
            border: none;
            outline: none;
            color: var(--text-primary);
            font-size: 16px;
            line-height: 1.5;
            resize: none;
            height: 56px;
            min-height: 56px;
            max-height: 240px;
            overflow-y: auto;
            font-family: var(--font-main);
        }

        .chat-textarea::placeholder {
            color: #8f8f98;
        }

        .chat-input-toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .toolbar-left {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .toolbar-btn {
            background-color: transparent;
            border: none;
            color: var(--text-secondary);
            width: 34px;
            height: 34px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: color var(--transition-speed), background-color var(--transition-speed);
        }

        .toolbar-btn:hover {
            color: var(--text-primary);
            background-color: var(--hover-bg);
        }

        .model-select-wrapper {
            position: relative;
        }

        .model-select-btn {
            background-color: transparent;
            border: none;
            color: var(--text-secondary);
            padding: 6px 8px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 4px;
            cursor: pointer;
            transition: color var(--transition-speed);
        }

        .model-select-btn:hover {
            color: var(--text-primary);
        }

        .model-select-btn .model-highlight {
            color: var(--text-primary);
            font-weight: 600;
        }

        .send-btn {
            background-color: #202024;
            border: none;
            color: #71717a;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: not-allowed;
            transition: all var(--transition-speed);
        }

        .send-btn.active {
            background-color: var(--jbs-blue-bright);
            color: #ffffff;
            cursor: pointer;
        }

        .send-btn.active:hover {
            background-color: #0a86cf;
        }


        .pills-container {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
            width: 100%;
        }

        .pill-btn {
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            color: #a3a3a8;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 400;
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            transition: all var(--transition-speed);
        }

        .pill-btn:hover {
            background-color: var(--hover-bg);
            color: var(--text-primary);
            border-color: #2d2d34;
        }


        .inspiration-capsule {
            width: 480px;
            height: 38px;
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 20px;
            padding: 0 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 12px;
            color: var(--text-secondary);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            transition: border-color var(--transition-speed);
        }

        .inspiration-capsule:hover {
            border-color: #2d2d34;
        }

        .explore-inspiration, .scroll-explore {
            display: flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            transition: color var(--transition-speed);
        }

        .explore-inspiration:hover, .scroll-explore:hover {
            color: var(--text-primary);
        }


        .chat-scroll-area {
            flex: 1 1 0;
            min-height: 0;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 0 20px;
        }

        .chat-scroll-area::-webkit-scrollbar { width: 6px; }
        .chat-scroll-area::-webkit-scrollbar-thumb {
            background-color: #2a2a30;
            border-radius: 10px;
        }


        .chat-scroll-area.chat-active .center-hub {
            display: none;
        }


        /* Space for the floating input bar lives on the message list, not on the
           scroll container: bottom padding of a flex scroll container is dropped
           from scrollHeight in WebKit, so the last messages became unreachable. */
        .chat-scroll-area.chat-active .chat-messages-container {
            padding-bottom: 220px;
            transition: padding-bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }


        .chat-messages-container {
            width: 100%;
            max-width: 780px;
            display: none;
            flex-direction: column;
            gap: 0;
            padding: 16px 0 24px 0;
        }

        .chat-messages-container.active {
            display: flex;
        }


        .chat-message {
            display: flex;
            width: 100%;
            padding: 16px 0;
            animation: fadeInMsg 0.3s ease-out;
        }

        @keyframes fadeInMsg {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }


        .chat-message.msg-ai {
            justify-content: flex-start;
        }

        .chat-message.msg-ai .message-body {
            display: flex;
            flex-direction: column;
        }


        .chat-message.msg-user {
            justify-content: flex-end;
        }

        .chat-message.msg-user .message-body {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            max-width: 75%;
            background-color: #2a2a30;
            border-radius: 18px 18px 4px 18px;
            padding: 12px 18px;
            position: relative;
        }


        .msg-user-toolbar {
            position: absolute;
            top: 100%;
            right: 0;
            display: flex;
            align-items: center;
            gap: 2px;
            padding-top: 4px;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.15s ease;
            z-index: 5;
        }

        .chat-message.msg-user:hover .msg-user-toolbar,
        .chat-message.msg-user:focus-within .msg-user-toolbar {
            opacity: 1;
            pointer-events: auto;
        }


        .msg-ai-toolbar {
            display: flex;
            align-items: center;
            gap: 2px;
            padding-top: 4px;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.15s ease;
            z-index: 5;
        }

        .chat-message.msg-ai:hover .msg-ai-toolbar,
        .chat-message.msg-ai:focus-within .msg-ai-toolbar {
            opacity: 1;
            pointer-events: auto;
        }

        .msg-consent,
        .msg-human {
            margin-top: 8px;
            padding: 10px 12px;
            border: 1px solid var(--border-color, rgba(128, 128, 128, 0.3));
            border-radius: 8px;
            background: rgba(128, 128, 128, 0.06);
            font-size: 13px;
        }

        .msg-consent .consent-text,
        .msg-human .consent-text {
            margin-bottom: 6px;
            color: var(--text-secondary, inherit);
        }

        .msg-consent .consent-btns {
            display: flex;
            gap: 8px;
        }

        .msg-consent .consent-btn {
            border: none;
            border-radius: 6px;
            padding: 6px 12px;
            font-size: 13px;
            cursor: pointer;
            background: var(--accent-color, #3d80fc);
            color: #fff;
        }

        .msg-consent .consent-btn.consent-no {
            background: transparent;
            color: var(--text-secondary, inherit);
            border: 1px solid rgba(128, 128, 128, 0.4);
        }

        .msg-consent.consent-busy {
            opacity: 0.6;
            pointer-events: none;
        }

        /* Shares .msg-consent's box (see the selector lists above) so the hand-off and
           the consent card read as one pair of footnotes, not two competing panels. */
        .msg-human .consent-text { margin-bottom: 0; }

        .msg-human a {
            color: var(--accent-color, #3d80fc);
        }

        .msg-chips {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 6px;
            margin-top: 8px;
        }

        .cal-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            max-width: 100%;
            border: 1px solid rgba(128, 128, 128, 0.35);
            border-radius: 999px;
            background: transparent;
            color: var(--text-primary, inherit);
            font-size: 12.5px;
            padding: 5px 12px;
            cursor: pointer;
        }

        .cal-chip-label {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            min-width: 0;
        }

        .cal-chip:hover {
            border-color: var(--accent-color, #3d80fc);
            color: var(--accent-color, #3d80fc);
        }

        .cal-chip-icon {
            font-weight: 700;
            opacity: 0.7;
        }

        .cal-chip-when {
            color: var(--text-secondary, inherit);
            white-space: nowrap;
        }

        /* 3+ events collapse behind a native <details> so a month query does not
           bury the answer under a wall of buttons. */
        .msg-chips-more {
            margin-top: 8px;
        }

        /* The summary is the ROW, not the pill. A <details> stretches to its widest
           content, so a sibling button would drift out to the far edge of the open
           chip list; the pill is an inner span and the bulk action sits next to it. */
        .msg-chips-more > summary {
            display: flex;
            align-items: center;
            gap: 6px;
            list-style: none;
        }

        .msg-chips-more > summary::-webkit-details-marker { display: none; }

        .cal-chip-summary {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            border: 1px solid rgba(128, 128, 128, 0.35);
            border-radius: 999px;
            color: var(--text-secondary, inherit);
            font-size: 12.5px;
            padding: 5px 12px;
            cursor: pointer;
        }

        .cal-chip-summary:hover {
            border-color: var(--accent-color, #3d80fc);
            color: var(--accent-color, #3d80fc);
        }

        .cal-chip-summary::after {
            content: '▾';
            font-size: 10px;
        }

        .msg-chips-more[open] .cal-chip-summary::after { content: '▴'; }

        .cal-chip-all {
            border-color: var(--accent-color, #3d80fc);
            color: var(--accent-color, #3d80fc);
            white-space: nowrap;
        }

        /* It is an action on what the dropdown reveals — no reason to offer it while
           the list is still hidden. */
        .msg-chips-more:not([open]) .cal-chip-all { display: none; }

        /* Indented off a rail so the chips read as contents of the summary above
           them rather than a second, unrelated row. */
        .msg-chips-more > .msg-chips {
            position: relative;
            margin-left: 11px;
            padding-left: 12px;
        }

        /* Turn the rail toward the final chip, but leave a small gap before it. */
        .msg-chips-more > .msg-chips::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 8px;
            height: 100%;
            border-left: 1px solid rgba(128, 128, 128, 0.25);
            border-bottom: 1px solid rgba(128, 128, 128, 0.25);
            border-bottom-left-radius: 8px;
            pointer-events: none;
        }

        .msg-user-toolbar .tb-date {
            font-size: 11px;
            color: var(--text-secondary);
            padding: 3px 6px;
            user-select: none;
            white-space: nowrap;
        }

        .msg-user-toolbar button,
        .msg-ai-toolbar button {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            background: none;
            border: none;
            border-radius: 4px;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 16px;
            transition: all 0.12s ease;
        }

        .msg-user-toolbar button:hover,
        .msg-ai-toolbar button:hover,
        .msg-user-toolbar button:focus-visible,
        .msg-ai-toolbar button:focus-visible {
            background: rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
        }

        .chat-message.msg-user {
            padding-bottom: 6px;
            position: relative;
            overflow: visible;
        }

        .msg-edit-input {
            width: 100%;
            background: #1a1a1f;
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 15px;
            font-family: inherit;
            padding: 8px 10px;
            resize: horizontal;
            outline: none;
            margin-bottom: 6px;
        }

        .msg-edit-input:focus {
            border-color: var(--accent);
        }

        .chat-message.msg-user:has(.msg-edit-input) .message-body {
            max-width: 100%;
            width: 100%;
            align-items: stretch;
        }

        .msg-edit-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }

        .msg-edit-actions button {
            padding: 4px 12px;
            border-radius: 6px;
            border: none;
            font-size: 13px;
            cursor: pointer;
            transition: background 0.12s ease;
        }

        .msg-edit-cancel {
            background: rgba(255, 255, 255, 0.08);
            color: var(--text-secondary);
        }

        .msg-edit-cancel:hover {
            background: rgba(255, 255, 255, 0.14);
        }

        .msg-edit-save {
            background: var(--accent);
            color: #fff;
        }

        .msg-edit-save:hover {
            opacity: 0.9;
        }

        .chat-limit-action {
            margin-top: 10px;
            padding: 7px 12px;
            border: none;
            border-radius: 6px;
            background: var(--accent-color, #3d80fc);
            color: #fff;
            font-size: 13px;
            cursor: pointer;
        }

        .chat-limit-action:hover {
            opacity: 0.9;
        }


        .message-avatar {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 12px;
            color: #fff;
        }

        .message-avatar.ai-avatar {
            background-color: #4285f4;
            margin-right: 12px;
            margin-top: 2px;
        }

        .message-avatar.user-avatar {
            background-color: #0e8f8f;
            margin-left: 12px;
            margin-top: 2px;
        }


        .message-sender {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 6px;
        }


        .message-sender .brand-blue,
        .message-sender .brand-gold {
            font-weight: 800;
            letter-spacing: -0.2px;
        }

        .message-sender {
            filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.25));
        }

        .msg-user .message-sender {
            display: none;
        }


        .message-text {
            font-size: 17px;
            line-height: 1.7;
            color: var(--text-primary);
            word-wrap: break-word;
            overflow-wrap: break-word;
        }

        .message-text > *:first-child { margin-top: 0; }
        .message-text > *:last-child { margin-bottom: 0; }

        .message-text p {
            margin-bottom: 10px;
        }

        .message-text p:last-child {
            margin-bottom: 0;
        }


        .message-text h1 { font-size: 24px; font-weight: 700; margin: 20px 0 10px; }
        .message-text h2 { font-size: 21px; font-weight: 700; margin: 18px 0 8px; }
        .message-text h3 { font-size: 19px; font-weight: 600; margin: 16px 0 6px; }
        .message-text h4 { font-size: 17px; font-weight: 600; margin: 14px 0 4px; }
        .message-text h5 { font-size: 16px; font-weight: 600; margin: 12px 0 4px; }
        .message-text h6 { font-size: 15px; font-weight: 600; margin: 12px 0 4px; color: var(--text-secondary); }


        .message-text code {
            background-color: #2a2a30;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 13px;
            font-family: 'SF Mono', 'Fira Code', monospace;
        }

        .message-text pre {
            background-color: #1a1a1f;
            border: 1px solid #2a2a30;
            border-radius: 8px;
            padding: 14px;
            overflow-x: auto;
            margin: 10px 0;
        }

        .message-text pre code {
            background: transparent;
            padding: 0;
            font-size: 13px;
            line-height: 1.5;
        }


        .message-text ul, .message-text ol {
            margin: 8px 0;
            padding-left: 24px;
        }

        .message-text li {
            margin-bottom: 4px;
        }

        .message-text li > p {
            margin-bottom: 4px;
        }


        .message-text table {
            border-collapse: collapse;
            width: 100%;
            margin: 12px 0;
            font-size: 15px;
        }

        .message-text thead th {
            background: #2a2a30;
            font-weight: 600;
            text-align: left;
            padding: 8px 12px;
            border: 1px solid #3a3a40;
        }

        .message-text tbody td {
            padding: 6px 12px;
            border: 1px solid #3a3a40;
        }

        .message-text tbody tr:nth-child(even) {
            background: rgba(255, 255, 255, 0.03);
        }

        .message-text tbody tr:hover {
            background: rgba(255, 255, 255, 0.06);
        }


        .message-text blockquote {
            border-left: 3px solid var(--accent);
            padding-left: 12px;
            margin: 10px 0;
            color: var(--text-secondary);
        }

        .message-text blockquote p {
            margin-bottom: 4px;
        }


        .message-text hr {
            border: none;
            border-top: 1px solid var(--border);
            margin: 16px 0;
        }


        .message-text a {
            color: var(--accent);
            text-decoration: none;
        }

        .message-text a:hover {
            text-decoration: underline;
        }


        .message-text del {
            color: var(--text-secondary);
        }


        .pulled-info {
            margin-bottom: 8px;
        }

        .pulled-info-wrapper {
            display: inline-block;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid var(--border);
            border-radius: 6px;
            overflow: hidden;
        }

        .pulled-info-toggle {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            background: transparent;
            border: none;
            color: var(--text-secondary);
            font-size: 12px;
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
        }

        .pulled-info-toggle:hover {
            color: var(--text-primary);
        }

        .pulled-info-toggle .chevron {
            display: inline-block;
            transition: transform 0.2s ease;
            font-size: 10px;
        }

        .pulled-info-toggle.open .chevron {
            transform: rotate(90deg);
        }

        .pulled-info-body {
            display: none;
            padding: 0 10px 8px;
        }

        .pulled-info-body.open {
            display: block;
        }

        .pulled-chunk {
            margin-bottom: 4px;
        }

        .pulled-chunk:last-child {
            margin-bottom: 0;
        }

        .pulled-chunk-toggle {
            display: flex;
            align-items: flex-start;
            gap: 6px;
            padding: 4px 8px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 4px;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 12px;
            line-height: 1.4;
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
            text-align: left;
            width: 100%;
            border: none;
        }

        .pulled-chunk-toggle:hover,
        .pulled-chunk-toggle:focus {
            background: rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
        }

        .pulled-chunk-toggle .chunk-chevron {
            flex-shrink: 0;
            margin-top: 2px;
            font-size: 9px;
            transition: transform 0.2s ease;
        }

        .pulled-chunk-toggle.open .chunk-chevron {
            transform: rotate(90deg);
        }

        .pulled-chunk-toggle .chunk-label {
            flex: 1;
        }

        /* Outside sources are visually separated from the school's own pages on purpose.
           A parent reading "Pulled Information" should be able to tell at a glance that a
           ranking came from Niche and not from John Burroughs School. */
        .chunk-badge-external {
            flex: none;
            margin-left: 6px;
            padding: 1px 6px;
            border-radius: 8px;
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.02em;
            text-transform: lowercase;
            color: var(--jbs-gold);
            background: rgba(214, 176, 74, 0.12);
            border: 1px solid rgba(214, 176, 74, 0.35);
        }

        .pulled-chunk-body {
            display: none;
            padding: 6px 10px;
            margin: 2px 0 0 14px;
            font-size: 12px;
            line-height: 1.5;
            color: var(--text-secondary);
            white-space: pre-wrap;
            border-left: 2px solid rgba(255, 255, 255, 0.08);
        }

        .pulled-chunk-body.open {
            display: block;
        }

        .chunk-match {
            color: var(--text-primary);
            background: transparent;
            font-weight: 700;
        }


        .typing-indicator {
            display: inline-flex;
            gap: 5px;
            align-items: center;
            padding: 6px 0;
        }

        .typing-indicator span {
            width: 7px;
            height: 7px;
            background-color: var(--text-secondary);
            border-radius: 50%;
            animation: blink 1.4s infinite both;
        }

        .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
        .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

        .typing-indicator .typing-status {
            width: auto;
            height: auto;
            background: none;
            border-radius: 0;
            animation: none;
            font-size: 0.85em;
            color: var(--text-secondary);
            font-style: italic;
            padding: 0 2px;
        }

        @keyframes blink {
            0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
            40% { opacity: 1; transform: scale(1.1); }
        }


        .chat-input-wrapper {
            position: absolute;
            left: 50%;
            top: calc(50% - 78px);
            bottom: auto;
            transform: translateX(-50%);
            width: 100%;
            max-width: 780px;
            padding: 0 20px;
            z-index: 10;
            transition:
                top 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .main-content.chat-active .chat-input-wrapper {
            top: auto;
            bottom: 16px;
        }

        .main-content.chat-active .main-header {
            display: none;
        }

        .chat-input-wrapper .chat-input-container {
            width: 100%;
        }

        .ai-disclaimer {
            margin-top: 4px;
            text-align: center;
            font-size: 11px;
            color: var(--text-secondary);
            opacity: 0.8;
        }

        .ai-disclaimer a {
            color: var(--jbs-blue-soft);
            margin-left: 6px;
        }


        /* Full-width fade behind the composer: a wrapper-width fade left the
           avatar column outside it, so the fade edge showed on the AI avatar. */
        .main-content::after {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            height: 200px;
            background: linear-gradient(to bottom, transparent 0%, var(--bg-page) 55%, var(--bg-page) 100%);
            pointer-events: none;
            z-index: 5;
            opacity: 0;
            transition: opacity 0.4s ease;
        }

        .main-content.chat-active::after {
            opacity: 1;
        }


        .dropdown-panel {
            position: absolute;
            bottom: calc(100% + 6px);
            right: 0;
            background-color: var(--bg-sidebar);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            width: 220px;
            padding: 4px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.4);
            display: none;
            flex-direction: column;
            z-index: 100;
        }

        .dropdown-panel.show {
            display: flex;
        }

        .dropdown-item {
            display: flex;
            flex-direction: column;
            padding: 8px;
            border-radius: 6px;
            cursor: pointer;
            transition: background var(--transition-speed);
        }

        .dropdown-item:hover {
            background-color: var(--hover-bg);
        }

        .dropdown-item-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .dropdown-item-desc {
            font-size: 10px;
            color: var(--text-secondary);
            margin-top: 1px;
        }

        .sidebar-overlay {
            position: fixed;
            top: env(safe-area-inset-top, 0px);
            bottom: env(safe-area-inset-bottom, 0px);
            left: 0;
            right: 0;
            background: transparent;
            z-index: 9;
            -webkit-tap-highlight-color: transparent;
            display: none;
        }
        .sidebar-overlay::before {
            content: '';
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            opacity: 0;
            transition: opacity 0.2s ease;
        }
        .sidebar-overlay.visible::before {
            opacity: 1;
        }


        @media (max-width: 767px) {

            input, textarea, select {
                font-size: 16px !important;
                touch-action: manipulation;
            }


            body {
                overflow: visible;
            }


            .sidebar {
                position: fixed;
                top: env(safe-area-inset-top, 0px);
                left: 0;
                bottom: env(safe-area-inset-bottom, 0px);
                width: 80vw !important;
                min-width: 80vw !important;
                max-width: 80vw;
                z-index: 50;
                border-right: none;
                background-color: transparent;
                box-shadow: 4px 0 24px rgba(0,0,0,0.5);
                transform: translateX(-100%);
                transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                overflow-y: auto;
                overflow-x: hidden;
                padding-top: 28px;
                padding-bottom: 12px;
            }
            .sidebar::before {
                content: '';
                position: absolute;
                inset: 0;
                background-color: var(--bg-sidebar);
                z-index: -1;
                pointer-events: none;
            }

            .sidebar:not(.collapsed) {
                transform: translateX(0);
                width: 80vw !important;
                min-width: 80vw !important;
            }

            .sidebar.collapsed {
                width: 0 !important;
                min-width: 0 !important;
                padding: 12px 0;
                border-right-color: transparent;
                transform: translateX(-100%);
                transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            }

            .sidebar > div {
                min-width: unset;
                white-space: normal;
            }

            .sidebar-resize-handle {
                display: none !important;
            }


            .sidebar-float-toggle {
                display: flex !important;
                position: fixed;
                left: calc(env(safe-area-inset-left, 0px) + 12px);
                top: calc(env(safe-area-inset-top, 0px) + 12px);
                z-index: 40;
            }

            .sidebar:not(.collapsed) ~ .sidebar-float-toggle,
            .sidebar-float-toggle.hidden {
                display: none !important;
            }


            .main-content {
                width: 100vw;
                overflow: hidden;
            }


            .center-hub {
                bottom: calc(50% + 60px) !important;
                padding: 0 16px;
            }

            .brand-text {
                font-size: 36px;
            }


            .chat-input-wrapper {
                position: fixed !important;
                left: 0 !important;
                right: 0;
                bottom: env(safe-area-inset-bottom, 0px) !important;
                top: auto !important;
                width: 100% !important;
                max-width: 100% !important;
                transform: none !important;
                padding: 0 12px 12px !important;
                z-index: 30;
                transition: none !important;
            }


            .main-content:not(.chat-active) .chat-input-wrapper {
                position: absolute !important;
                top: calc(50% - 60px) !important;
                bottom: auto !important;
                transform: translateX(-50%) !important;
                left: 50% !important;
                width: calc(100% - 24px) !important;
                max-width: 780px !important;
                padding: 0 12px !important;
            }


            .chat-input-container {
                padding: 14px 16px;
                border-radius: 16px;
            }

            .chat-textarea {
                font-size: 16px;
                min-height: 22px;
                height: 22px;
                max-height: 120px;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }


            .chat-scroll-area.chat-active .chat-messages-container {
                padding-bottom: 150px !important;
                transition: none !important;
            }

            .chat-scroll-area:not(.chat-active) {
                padding-top: 0;
                padding-bottom: 0;
            }


            .chat-messages-container {
                scroll-margin-top: 56px;
            }


            .message-body {
                max-width: 100%;
            }

            .msg-user .message-body {
                max-width: 85%;
            }
        }

        /* Hidden unless a challenge is actually running. Centred on the screen so it
           never sits on top of the chat input. */
        #turnstile-holder {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 9999;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
            border-radius: 6px;
        }

        #turnstile-holder.solving {
            display: block;
        }


        /* Follow the browser's light or dark appearance setting. */
        @media (prefers-color-scheme: light) {
            :root {
                color-scheme: light;
                --bg-page: #f7f8fa;
                --bg-sidebar: #eef1f5;
                --bg-card: #ffffff;
                --bg-input: #ffffff;
                --border-color: #d7dde6;
                --text-primary: #1f2937;
                --text-secondary: #5b6472;
                --accent-blue: #155eef;
                --jbs-blue: #005b8f;
                --jbs-blue-bright: #0070b3;
                --jbs-blue-soft: #176b9b;
                --jbs-gold: #946b00;
                --jbs-gold-bright: #ffe08a;
                --hover-bg: #e6ebf1;
                --border: var(--border-color);
                --accent: var(--accent-blue);
                --accent-color: var(--accent-blue);
            }

            .sidebar { border-right-color: #cbd3de; }
            .sidebar-toggle-btn:hover,
            .menu-item:hover,
            .chat-item:hover,
            .chat-item.active { background-color: #e6ebf1; }
            .chat-list-scroll.is-scrolling { scrollbar-color: #c2cad5 transparent; }
            .chat-list-scroll.is-scrolling::-webkit-scrollbar-thumb,
            .chat-scroll-area::-webkit-scrollbar-thumb { background-color: #c2cad5; }
            .chat-item-delete:hover,
            .chat-item-delete:focus-visible,
            .msg-user-toolbar button:hover,
            .msg-ai-toolbar button:hover,
            .msg-user-toolbar button:focus-visible,
            .msg-ai-toolbar button:focus-visible { background: rgba(0, 0, 0, 0.08); }
            .invite-card:hover,
            .pill-btn:hover,
            .inspiration-capsule:hover { border-color: #b8c2cf; }
            .feedback-panel { border-color: #c7d0dc; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18); }
            .feedback-textarea { background: #ffffff; border-color: #b5bfcc; }
            .chat-input-container { background-color: #ffffff; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); }
            .send-btn { background-color: #e1e7ef; color: #6b7280; }
            .pill-btn { color: #526072; }
            .chat-message.msg-user .message-body { background-color: #e3e9f0; }
            .msg-edit-input { background: #ffffff; }
            .msg-edit-cancel { background: rgba(0, 0, 0, 0.06); }
            .msg-edit-cancel:hover { background: rgba(0, 0, 0, 0.1); }
            .message-text code { background-color: #e8edf3; }
            .message-text pre { background-color: #f1f4f8; border-color: #d0d7e2; }
            .message-text thead th { background: #e8edf3; border-color: #c7d0dc; }
            .message-text tbody td { border-color: #c7d0dc; }
            .message-text tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.03); }
            .message-text tbody tr:hover { background: rgba(0, 0, 0, 0.06); }
            .pulled-info-wrapper { background: rgba(0, 0, 0, 0.04); }
            .pulled-chunk-toggle { background: rgba(0, 0, 0, 0.04); }
            .pulled-info-toggle:focus,
            .pulled-chunk-toggle:hover,
            .pulled-chunk-toggle:focus { background: rgba(0, 0, 0, 0.08); }
            .pulled-chunk-body { border-left-color: rgba(0, 0, 0, 0.12); }
            .new-chat-left svg { color: #005b8f; }
            .hotkey-badge {
                background-color: rgba(0, 91, 143, 0.1);
                border-color: rgba(0, 91, 143, 0.35);
                color: #005b8f;
            }
            .brand-gold {
                background-image: linear-gradient(90deg, #ffe08a, #d6b04a, #ffe08a);
            }
            .feedback-open-btn:hover { color: var(--jbs-gold); }
            .upgrade-btn { color: var(--jbs-gold); }
            .chat-textarea::placeholder { color: #687386; }
            .feedback-status.error { color: #b42318; }
            .send-btn { color: #536174; }
            .message-avatar.ai-avatar { background-color: #1d4ed8; }
            .message-avatar.user-avatar { background-color: #0b6b6b; }
            .chunk-badge-external {
                color: var(--jbs-gold);
                background: rgba(148, 107, 0, 0.12);
                border-color: rgba(148, 107, 0, 0.35);
            }
        }

/* Moved out of inline style="" attributes so the strict Content-Security-Policy
   (style-src with no 'unsafe-inline') doesn't block them. */
.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    cursor: pointer;
    transform: scale(1.5);
    transform-origin: left center;
    margin-right: 20px;
}

.sidebar-logo-words {
    width: 85px;
    height: 30.6px;
    position: relative;
    top: 4px;
}

.chat-input-toolbar--end {
    justify-content: flex-end;
}

