/* InfiNet shared sidebar styles (test2). Extracted from the home page; every page with the sidebar links this file.
   Edit sidebar styles here only. */
/* Home page rules that are not sidebar specific but still style the sidebar (scoped to the sidebar, same specificity). */
:where(#sidebar-overlay, #sidebar, #cdm-modal, #conv-toast) {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --accent: #e5ff3a;
    --accent-hover: #b8cc2e;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --border: #333333;
    --border-light: #222222;
}
body.light-mode :where(#sidebar-overlay, #sidebar, #cdm-modal, #conv-toast) {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --border: #d0d0d0;
    --border-light: #e0e0e0;
    --accent: #000000;
    --accent-hover: #333333;
}
*:where(#sidebar-overlay, #sidebar, #sidebar *, #cdm-modal, #cdm-modal *, #conv-toast) { margin: 0px; padding: 0px; box-sizing: border-box; }
:where(#sidebar-overlay, #sidebar, #sidebar *, #cdm-modal, #cdm-modal *, #conv-toast)::-webkit-scrollbar { width: 8px; }
:where(#sidebar-overlay, #sidebar, #sidebar *, #cdm-modal, #cdm-modal *, #conv-toast)::-webkit-scrollbar-track { background: var(--bg-secondary); }
:where(#sidebar-overlay, #sidebar, #sidebar *, #cdm-modal, #cdm-modal *, #conv-toast)::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
:where(#sidebar-overlay, #sidebar, #sidebar *, #cdm-modal, #cdm-modal *, #conv-toast)::-webkit-scrollbar-thumb:hover { background: var(--accent); }
body.light-mode h1:where(#sidebar-overlay, #sidebar, #sidebar *, #cdm-modal, #cdm-modal *, #conv-toast),
body.light-mode h2:where(#sidebar-overlay, #sidebar, #sidebar *, #cdm-modal, #cdm-modal *, #conv-toast),
body.light-mode a:where(#sidebar-overlay, #sidebar, #sidebar *, #cdm-modal, #cdm-modal *, #conv-toast) { color: var(--accent) !important; }

/* Sidebar rules (moved from the home page) */
@media (max-width: 768px) {
@media (display-mode: standalone) {
.sidebar-header {
                    margin-top: 5mm !important;
                }
.sidebar-footer,
.sidebar-socials {
                    margin-top: 5mm !important;
                }
}
}
.sidebar {
            width: 280px;
            background: #121212;
            border-right: none;
            display: flex;
            flex-direction: column;
            height: 100vh;
            transition: transform 0.3s ease;
            position: fixed;
            left: 0;
            top: 0;
            z-index: 100;
            transform: translateX(-100%);
        }
.sidebar.sidebar-open {
            transform: translateX(0);
        }
.sidebar.mobile-hidden {
            transform: translateX(-100%);
        }
.sidebar.mobile-hidden .info-card-expanded {
            display: none !important;
            opacity: 0 !important;
            visibility: hidden !important;
        }
.sidebar-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 99;
        }
.sidebar-overlay.show {
            display: block;
        }
.sidebar-handle {
            position: absolute;
            right: -45px;
            top: 80px;
            width: 60px;
            height: 80px;
            cursor: pointer;
            z-index: 101;
            transition: all 0.3s ease;
            filter: drop-shadow(0 4px 8px rgba(229, 255, 58, 0.4));
        }
.sidebar-handle svg {
            width: 100%;
            height: 100%;
            transition: all 0.3s ease;
        }
.sidebar-handle:hover {
            right: -50px;
            filter: drop-shadow(0 6px 15px rgba(229, 255, 58, 0.7));
            animation: botBounce 0.6s ease-in-out infinite;
        }
.sidebar-handle:hover svg {
            transform: scale(1.1);
        }
.sidebar-handle:hover .bot-head {
            animation: botPeek 0.8s ease-in-out infinite;
        }
.sidebar-handle:hover .bot-hand-left {
            animation: handWave 0.5s ease-in-out 1;
            transform-origin: top center;
        }
.sidebar-handle:hover .bot-hand-right {
            animation: handWave 0.5s ease-in-out 1 0.25s;
            transform-origin: top center;
        }
.sidebar-handle:hover .bot-eye {
            animation: eyeBlink 2s ease-in-out infinite;
        }
.sidebar.sidebar-open .sidebar-handle {
            right: -45px;
        }
.sidebar-hint {
            position: absolute;
            right: -33px;
            top: 165px;
            font-size: 0.75rem;
            color: #e5ff3a;
            white-space: nowrap;
            pointer-events: none;
            z-index: 102;
            opacity: 0.9;
            font-weight: bold;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
            animation: hintJump 1.2s ease-in-out infinite;
            transition: opacity 0.3s ease;
        }
.sidebar.sidebar-open .sidebar-hint,
.sidebar-hint.hidden {
            opacity: 0;
            pointer-events: none;
        }
@media (max-width: 768px) {
.sidebar-hint {
                font-size: 0.75rem;
                right: -33px;
                top: 160px;
            }
}
.sidebar-header {
            padding: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
.sidebar-header img {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            transform: scale(1.5);
            object-fit: cover;
            object-position: center;
            overflow: hidden;
        }
.sidebar-header h1 {
            font-size: 1.25rem;
            color: var(--accent);
            font-weight: 700;
            margin: 0;
            margin-left: 3mm;
            line-height: 1.3;
        }
.sidebar-actions {
            padding: 1rem;
        }
.btn-new-chat {
            width: 100%;
            padding: 0.75rem;
            background: var(--accent);
            color: var(--bg-primary);
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.95rem;
        }
.btn-new-chat:hover {
            background: var(--accent-hover);
            transform: translateY(-1px);
        }
.sidebar-conversations {
            flex: 1;
            overflow-y: auto;
            padding: 0.5rem;
        }
.sidebar-info-cards {
            padding: 0.4rem 0.5rem;
            border-top: none;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
.sidebar-info-cards .info-card {
            padding: 0.6rem 0.75rem;
            margin: 0;
            background: var(--bg-tertiary);
            border: 1px solid var(--border);
            border-radius: 12px;
            cursor: pointer;
            position: relative;
            transition: all 0.2s;
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
            z-index: 1;
        }
.sidebar-info-cards .info-card:hover,
.sidebar-info-cards .info-card.expanded-active {
            z-index: 1001;
        }
.sidebar-info-cards .info-card:hover {
            border-color: var(--accent);
            transform: translateY(-2px);
        }
.sidebar-info-cards .info-card:active {
            transform: scale(0.98);
        }
.sidebar-info-cards .info-card h4 {
            font-size: 0.85rem;
            margin-bottom: 0.3rem;
            color: var(--accent);
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
.sidebar-info-cards .info-card p {
            font-size: 0.75rem;
            color: var(--text-secondary);
            margin: 0;
        }
.sidebar-info-cards .info-card .lock-icon {
            width: 14px;
            height: 14px;
            flex-shrink: 0;
            fill: currentColor;
        }
.conversation-item {
            padding: 0.75rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            margin-bottom: 0.25rem;
            transition: all 0.2s;
            color: var(--text-secondary);
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            position: relative;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
        }
.conversation-item:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }
.conversation-item.active {
            background: var(--bg-tertiary);
            color: var(--accent);
        }
.conversation-item-content {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
        }
.conversation-delete-btn {
            opacity: 0;
            transition: opacity 0.2s;
            padding: 0.25rem;
            background: transparent;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            border-radius: 4px;
            flex-shrink: 0;
        }
.conversation-item:hover .conversation-delete-btn {
            opacity: 1;
        }
.conversation-delete-btn:hover {
            color: #ff4444;
            background: rgba(255, 68, 68, 0.1);
        }
.conversation-delete-btn svg {
            width: 14px;
            height: 14px;
            fill: currentColor;
        }
.sidebar-footer {
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
.sidebar-footer a {
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.85rem;
            padding: 0.5rem;
            border-radius: 6px;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
.sidebar-footer a .sidebar-icon {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
            fill: currentColor;
        }
.sidebar-footer a:hover {
            color: var(--accent);
            background: var(--bg-tertiary);
        }
.sidebar-socials {
            padding: 0.75rem 1rem calc(3rem + 1cm);
            display: flex;
            gap: 0.5rem;
            justify-content: center;
            flex-wrap: wrap;
        }
.sidebar-socials .sidebar-cta-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5mm;
        }
.sidebar-socials .sidebar-cta {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
            padding: 0.65rem 1.5rem;
            border-radius: 8px;
            border: 1px solid #e5ff3a;
            background: #e5ff3a;
            color: #000000;
            transition: all 0.2s;
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 600;
            line-height: 1;
            white-space: nowrap;
        }
.sidebar-socials .sidebar-cta:hover {
            color: #000000;
            border-color: #b8cc2e;
            background: #b8cc2e;
        }
.sidebar-socials .sidebar-cta svg {
            width: 18px;
            height: 18px;
            fill: currentColor;
            flex-shrink: 0;
        }
.sidebar-socials .sidebar-link-text {
            color: #e5ff3a;
            font-weight: bold;
            text-decoration: none;
            font-size: 0.85rem;
            transition: opacity 0.2s;
        }
.sidebar-socials .sidebar-link-text:hover {
            opacity: 0.8;
        }
.sidebar-socials .sidebar-links-wrapper {
            display: flex;
            gap: 0.5rem;
            align-items: center;
            justify-content: center;
        }
body.light-mode .sidebar {
            background: #f8f8f8;
        }
body.light-mode .sidebar-hint {
            color: #000000;
        }
body.light-mode .sidebar-header h1 {
            color: var(--accent) !important;
        }
body.light-mode .btn-new-chat {
            background: var(--accent) !important;
            color: #ffffff !important;
        }
body.light-mode .btn-new-chat:hover {
            background: var(--accent-hover) !important;
        }
body.light-mode .sidebar-socials .sidebar-cta {
            /* 3D Effect for Light Mode */
            box-shadow: 
                0 4px 6px rgba(0, 0, 0, 0.1),
                0 2px 4px rgba(0, 0, 0, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.5),
                inset 0 -1px 0 rgba(0, 0, 0, 0.1);
            transform: translateY(0);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            border: none !important;
            padding: 0.65rem 1.5rem !important;
            font-size: 0.9rem !important;
        }
body.light-mode .sidebar-socials .sidebar-cta::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 8px;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.05) 100%);
            pointer-events: none;
            opacity: 1;
            transition: opacity 0.3s ease;
        }
body.light-mode .sidebar-socials .sidebar-cta:hover {
            color: #000000;
            border: none !important;
            background: #b8cc2e;
            transform: translateY(-2px) scale(1.02);
            box-shadow: 
                0 8px 12px rgba(0, 0, 0, 0.15),
                0 4px 6px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.6),
                inset 0 -2px 0 rgba(0, 0, 0, 0.15);
        }
body.light-mode .sidebar-socials .sidebar-cta:hover::before {
            opacity: 0.8;
        }
body.light-mode .sidebar-socials .sidebar-cta:active {
            transform: translateY(0) scale(0.98);
            box-shadow: 
                0 2px 4px rgba(0, 0, 0, 0.1),
                0 1px 2px rgba(0, 0, 0, 0.06),
                inset 0 2px 4px rgba(0, 0, 0, 0.1);
        }
body.light-mode .sidebar-socials .sidebar-cta:active::before {
            opacity: 0.6;
        }
.info-cards {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
            max-width: 1200px;
            margin: 1rem auto 0;
            padding: 0 1.5rem;
        }
.info-card {
            background: var(--bg-tertiary);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.25rem;
            cursor: pointer;
            position: relative;
            transition: all 0.2s;
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
            z-index: 1;
        }
.info-card:hover,
.info-card.expanded-active {
            z-index: 1001;
        }
.info-card:hover {
            border-color: var(--accent);
            transform: translateY(-2px);
        }
.info-card:active {
            transform: scale(0.98);
        }
@media (max-width: 768px) {
.info-card {
                padding: 1rem;
            }
}
.info-card h4 {
            color: var(--accent);
            font-size: 0.95rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
.info-card h4 .lock-icon {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
            fill: currentColor;
        }
.info-card p {
            color: var(--text-secondary);
            font-size: 0.8rem;
            line-height: 1.5;
            margin: 0;
        }
body.light-mode .info-card h4 {
            color: var(--accent);
        }
body.light-mode .info-card {
            background: var(--bg-secondary);
        }
.info-card-expanded {
            display: none;
            position: absolute;
            top: 0;
            left: calc(100% + 0.5rem);
            background: var(--bg-tertiary);
            border: 1px solid var(--accent);
            border-radius: 8px;
            padding: 0.625rem;
            z-index: 1002;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
            width: 200px;
            max-width: calc(100vw - 2rem);
        }
.sidebar-info-cards .info-card-expanded {
            left: calc(100% + 0.5rem);
        }
@media (max-width: 768px) {
.info-card-expanded {
                position: absolute;
                top: 0;
                left: 50%;
                transform: translateX(-50%);
                width: 180px;
                max-width: calc(100vw - 2rem);
                max-height: 60vh;
                overflow-y: auto;
                padding: 0.625rem;
                border-radius: 8px;
            }
.info-card-expanded-header {
                gap: 0.35rem;
                margin-bottom: 0.35rem;
            }
.info-card-expanded-header svg {
                width: 12px;
                height: 12px;
            }
.info-card-expanded-header h5 {
                font-size: 0.75rem;
            }
.info-card-expanded p {
                font-size: 0.65rem;
                line-height: 1.3;
            }
.info-cards {
                grid-template-columns: repeat(2, 1fr);
                gap: 0.5rem;
                padding: 0 0.75rem;
            }
.info-card {
                padding: 0.75rem;
            }
.info-card h4 {
                font-size: 0.8rem;
                margin-bottom: 0.25rem;
            }
.info-card h4 .lock-icon {
                width: 14px;
                height: 14px;
            }
.info-card p {
                font-size: 0.7rem;
            }
}
.info-card-expanded.show {
            display: block;
            animation: slideDown 0.2s ease;
            z-index: 1003;
        }
@media (max-width: 768px) {
.info-card-expanded.show {
                animation: fadeIn 0.2s ease;
            }
}
.info-card-expanded-header {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            margin-bottom: 0.4rem;
        }
.info-card-expanded-header svg {
            width: 14px;
            height: 14px;
            fill: var(--accent);
            flex-shrink: 0;
        }
.info-card-expanded-header h5 {
            color: var(--accent);
            font-size: 0.8rem;
            font-weight: 600;
            margin: 0;
        }
.info-card-expanded p {
            color: var(--text-secondary);
            font-size: 0.7rem;
            line-height: 1.4;
            margin: 0;
        }
body.light-mode .info-card-expanded {
            background: var(--bg-secondary);
            border-color: var(--accent);
        }
body.light-mode .info-card-expanded-header svg {
            fill: var(--accent);
        }
@media (max-width: 768px) {
.sidebar {
                position: fixed;
                left: 0;
                top: 0;
                width: 280px;
                box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
                z-index: 200;
                transform: translateX(-100%);
            }
.sidebar.sidebar-open {
                transform: translateX(0);
            }
.sidebar.mobile-hidden {
                transform: translateX(-100%);
            }
.sidebar.mobile-hidden .info-card-expanded {
                display: none !important;
                opacity: 0 !important;
                visibility: hidden !important;
            }
.sidebar-overlay {
                z-index: 199;
            }
}
.sidebar-studio-btn {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            width: 100%;
            margin-top: 0.6rem;
            padding: 0.7rem 0.9rem;
            background: transparent;
            border: 1px solid var(--border);
            border-radius: 10px;
            color: var(--text-primary);
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: border-color 0.2s, color 0.2s, background 0.2s;
            text-align: left;
            font-family: inherit;
        }
.sidebar-studio-btn:hover { border-color: var(--accent); color: var(--accent); }
body.light-mode .sidebar-studio-btn:hover,
body.light-mode .sidebar-studio-btn:focus,
body.light-mode .sidebar-studio-btn:focus-visible {
            background: #e5ff3a;
            color: #000;
            border-color: #000;
        }
body.light-mode .sidebar-studio-btn:hover svg,
body.light-mode .sidebar-studio-btn:focus svg,
body.light-mode .sidebar-studio-btn:focus-visible svg {
            fill: currentColor;
            color: #000;
        }
.sidebar-studio-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-studio-btn .studio-new-badge {
            margin-left: auto;
            font-size: 0.65rem;
            font-weight: 700;
            padding: 0.1rem 0.45rem;
            border-radius: 999px;
            background: var(--accent);
            color: var(--bg-primary);
            letter-spacing: 0.02em;
        }
.sidebar-actions { position: relative; }
.new-chat-split { display: flex; align-items: stretch; gap: 6px; }
.new-chat-split .btn-new-chat { flex: 1; width: auto; min-width: 0; }
.new-chat-chevron {
            flex: 0 0 46px;
            display: flex; align-items: center; justify-content: center;
            padding: 0;
            background: #e5ff3a;
            border: 2px solid #000000;
            box-shadow: 0 0 0 1px #e5ff3a;
            border-radius: 8px;
            cursor: pointer;
            transition: transform 0.2s, background 0.2s;
        }
.new-chat-chevron svg { width: 18px; height: 18px; transition: transform 0.2s; }
.new-chat-chevron:hover { background: #b8cc2e; }
.new-chat-chevron[aria-expanded="true"] svg { transform: rotate(180deg); }
body.light-mode .new-chat-chevron { background: #ffffff; border: 1.5px solid #000000; box-shadow: none; }
body.light-mode .new-chat-chevron:hover { background: #e5ff3a; }
html body .new-chat-chevron:is(:hover, :active, :focus-visible, [aria-expanded="true"]) {
    background: #e5ff3a;
    color: #000;
}
.new-chat-menu {
            display: none;
            position: absolute;
            left: 1rem; right: 1rem;
            top: calc(100% - 0.5rem);
            z-index: 3000;
            padding: 0.35rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
        }
body.light-mode .new-chat-menu { background: #ffffff; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15); }
.new-chat-menu.is-open { display: block; }
.new-chat-option {
            display: flex; align-items: flex-start; gap: 0.65rem; width: 100%;
            padding: 0.65rem 0.7rem; background: transparent; border: none; border-radius: 9px;
            color: var(--text-primary); text-align: left; cursor: pointer; font-family: inherit;
        }
.new-chat-option:hover { background: var(--bg-tertiary); }
.new-chat-option > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.new-chat-option-text { flex: 1; min-width: 0; }
.new-chat-option-name { display: block; font-size: 0.9rem; font-weight: 600; }
.new-chat-option-desc { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; line-height: 1.35; }
.new-chat-option .nc-check { width: 16px; height: 16px; color: var(--accent); visibility: hidden; flex-shrink: 0; margin-top: 2px; }
.new-chat-option.is-selected .nc-check { visibility: visible; }
.chat-search {
            position: relative; display: flex; align-items: center; margin-bottom: 0.6rem;
        }
.chat-search > svg {
            position: absolute; left: 0.7rem; width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
        }
.chat-search-input {
            width: 100%; box-sizing: border-box; height: 40px;
            padding: 0 2.3rem 0 2.2rem;
            background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 8px;
            color: var(--text-primary); font-family: inherit; font-size: 16px;
            -webkit-appearance: none; appearance: none;
        }
.chat-search-input::placeholder { color: var(--text-muted); }
.chat-search-input:focus { outline: none; border-color: var(--accent); }
.chat-search-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
body.light-mode .chat-search-input { background: #ffffff; }
.chat-search-clear {
            position: absolute; right: 0.35rem; width: 30px; height: 30px; display: none; align-items: center; justify-content: center;
            padding: 0; border: none; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer;
        }
.chat-search-clear.is-visible { display: flex; }
.chat-search-clear:hover { color: var(--text-primary); background: var(--bg-secondary); }
.chat-search-clear svg { width: 16px; height: 16px; }
.chat-search-status { padding: 0.75rem 0.5rem; color: var(--text-muted); font-size: 0.85rem; text-align: center; }
.conversation-item .conv-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.conversation-item .conv-snippet {
            font-size: 0.74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
.conversation-item mark { background: transparent; color: var(--accent); font-weight: 700; }
.conv-rename-btn {
            opacity: 0; transition: opacity 0.2s; padding: 0.25rem; background: transparent; border: none; cursor: pointer;
            display: flex; align-items: center; justify-content: center; color: var(--text-muted); border-radius: 4px; flex-shrink: 0;
        }
.conv-rename-btn svg { width: 14px; height: 14px; fill: currentColor; }
.conversation-item:hover .conv-rename-btn,
.conversation-item.active .conv-rename-btn,
.conv-rename-btn:focus-visible { opacity: 1; }
.conv-rename-btn:hover { color: var(--accent); background: var(--bg-secondary); }
@media (hover: none), (max-width: 768px) {
.conv-rename-btn { opacity: 0.85; padding: 0.45rem; margin: -0.2rem 0; }
.conv-rename-btn svg { width: 16px; height: 16px; }
}
.conv-rename-input {
            flex: 1; min-width: 0; height: 32px; padding: 0 0.5rem; box-sizing: border-box;
            background: var(--bg-primary); border: 1px solid var(--accent); border-radius: 6px;
            color: var(--text-primary); font-family: inherit; font-size: 16px;
        }
.conv-rename-input:focus { outline: none; }
.conversation-item.is-renaming { cursor: default; }
@media (max-width: 768px) {
body.chat-search-active .sidebar-info-cards,
body.chat-search-active .sidebar-footer,
body.chat-search-active .sidebar-socials { display: none !important; }
}
.conversation-item.is-renaming .conv-rename-btn,
.conversation-item.is-renaming .conversation-delete-btn { display: none; }

.cdm-modal {
            --cdm-accent: #e5ff3a; --cdm-on-accent: #000000; --cdm-card: #111111; --cdm-soft: #1c1c1c; --cdm-danger: #ff4d4d;
            display: none; position: fixed; inset: 0; z-index: 4200;
            align-items: center; justify-content: center; padding: 1.25rem; overscroll-behavior: contain;
        }
body.light-mode .cdm-modal { --cdm-accent: #000000; --cdm-on-accent: #e5ff3a; --cdm-card: #ffffff; --cdm-soft: #f1f1f1; --cdm-danger: #d92d2d; }
.cdm-modal.is-open { display: flex; }
.cdm-backdrop {
            position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5);
            -webkit-backdrop-filter: blur(10px) saturate(120%); backdrop-filter: blur(10px) saturate(120%);
            animation: cdmFade 0.18s ease-out;
        }
body.light-mode .cdm-backdrop { background: rgba(20, 20, 20, 0.28); }
.cdm-card {
            position: relative; width: min(340px, 100%); box-sizing: border-box; background: var(--cdm-card);
            color: var(--text-primary); border: 1px solid var(--border); border-radius: 18px;
            box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45); padding: 1.05rem 1.05rem 1rem; animation: cdmPop 0.2s ease-out;
        }
body.light-mode .cdm-card { box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18); }
.cdm-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.cdm-head h2 { margin: 0; font-size: 1.02rem; font-weight: 650; letter-spacing: -0.01em; color: var(--text-primary); }
.cdm-close {
            display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0;
            border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
            cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent;
        }
.cdm-close svg { width: 18px; height: 18px; fill: currentColor; }
.cdm-sub {
            margin: 0.3rem 0 0.9rem; font-size: 0.88rem; color: var(--text-secondary);
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
.cdm-list { display: flex; flex-direction: column; gap: 0.45rem; }
.cdm-item {
            display: flex; align-items: center; gap: 0.75rem; width: 100%; min-height: 46px; padding: 0.6rem 0.8rem;
            border-radius: 12px; border: 1px solid var(--border); background: var(--cdm-soft); color: var(--text-primary);
            font: inherit; font-size: 0.95rem; font-weight: 550; text-align: left; cursor: pointer; box-sizing: border-box;
            -webkit-tap-highlight-color: transparent; transition: border-color 0.15s;
        }
.cdm-item:hover { border-color: var(--cdm-accent); }
.cdm-item svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; color: var(--cdm-accent); }
.cdm-item.is-danger { color: var(--cdm-danger); }
.cdm-item.is-danger svg { color: var(--cdm-danger); }
.cdm-item.is-danger:hover { border-color: var(--cdm-danger); }
.cdm-item:focus-visible,
.cdm-close:focus-visible { outline: 2px solid var(--cdm-accent); outline-offset: 2px; }
body.cdm-open { overflow: hidden; }
@media (max-width: 600px) {
.cdm-modal { align-items: flex-end; padding: 0; }
.cdm-card {
                width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; border-left: 0; border-right: 0; border-bottom: 0;
                padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); animation: cdmSheet 0.22s ease-out;
            }
.cdm-item { min-height: 50px; }
}
.conv-select-bar {
            display: none; margin: 0.25rem 0.5rem 0.35rem; padding: 0.55rem 0.6rem; border-radius: 12px;
            border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-primary); font-size: 0.85rem;
        }
body.conv-selecting .conv-select-bar { display: block; }
.csb-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.csb-row + .csb-row { margin-top: 0.5rem; }
.csb-count { font-weight: 650; }
.csb-text { line-height: 1.35; }
.csb-btn {
            height: 32px; padding: 0 0.75rem; border-radius: 9px; border: 1px solid var(--border); background: transparent;
            color: var(--text-primary); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
            -webkit-tap-highlight-color: transparent; white-space: nowrap;
        }
.csb-btn:hover { border-color: var(--text-muted); }
.csb-btn.is-link { border-color: transparent; color: var(--accent); padding: 0 0.35rem; }
.csb-btn.is-danger { background: #ff4d4d; border-color: #ff4d4d; color: #000000; flex: 1; }
body.light-mode .csb-btn.is-danger { background: #d92d2d; border-color: #d92d2d; color: #ffffff; }
.csb-btn.is-danger:disabled { opacity: 0.45; cursor: default; }
.csb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.conv-select-box {
            width: 18px; height: 18px; margin: 0; flex-shrink: 0; cursor: pointer; accent-color: var(--accent);
        }
body.light-mode .conv-select-box { accent-color: #000000; }
body.conv-selecting .conversation-item .conversation-delete-btn { display: none; }
body.conv-selecting .conversation-item.is-selected { background: var(--bg-tertiary); color: var(--text-primary); }
@media (hover: none), (max-width: 768px) {
.conv-select-box { width: 20px; height: 20px; }
}
body.conv-selecting .sidebar-info-cards { display: none !important; }
@media (max-width: 768px) {
body.conv-selecting .sidebar-footer,
body.conv-selecting .sidebar-socials { display: none !important; }
}
.conv-toast {
            position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
            z-index: 4300; max-width: min(92vw, 420px); padding: 0.65rem 0.95rem; border-radius: 12px;
            background: #1c1c1c; color: #ffffff; border: 1px solid #333333; font-size: 0.88rem; line-height: 1.35;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); pointer-events: none; opacity: 0; transition: opacity 0.2s;
        }
body.light-mode .conv-toast { background: #ffffff; color: #000000; border-color: #d0d0d0; }
.conv-toast.is-on { opacity: 1; }

.conv-pin-btn {
            opacity: 0; transition: opacity 0.2s; padding: 0.25rem; background: transparent; border: none; cursor: pointer;
            display: flex; align-items: center; justify-content: center; color: var(--text-muted); border-radius: 4px; flex-shrink: 0;
        }
.conv-pin-btn svg { width: 14px; height: 14px; fill: currentColor; }
.conversation-item:hover .conv-pin-btn,
.conversation-item.active .conv-pin-btn,
.conv-pin-btn:focus-visible { opacity: 1; }
.conv-pin-btn:hover { color: var(--accent); background: var(--bg-secondary); }
.conv-pin-btn.is-pinned { opacity: 1; color: var(--accent); }
body.light-mode .conv-pin-btn.is-pinned { color: #000000; }
@media (hover: none), (max-width: 768px) {
.conv-pin-btn { opacity: 0.85; padding: 0.45rem; margin: -0.2rem 0; }
.conv-pin-btn svg { width: 16px; height: 16px; }
}
.conversation-item.is-renaming .conv-pin-btn { display: none; }
.conv-group-label {
            padding: 0.45rem 0.5rem 0.2rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
            text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 0.35rem;
        }
.conv-group-label svg { width: 12px; height: 12px; fill: currentColor; }
.conv-group-label + .conversation-item { margin-top: 0; }
.conv-group-label.is-rest { margin-top: 0.35rem; }
.chat-search-toggle {
            flex: 0 0 46px;
            display: flex; align-items: center; justify-content: center;
            padding: 0; cursor: pointer; border-radius: 8px;
            background: #000000; color: #f2f2f2;
            border: 1px solid rgba(255, 255, 255, 0.24);
            transition: border-color 0.2s, color 0.2s, background 0.2s;
        }
.chat-search-toggle svg { width: 19px; height: 19px; fill: currentColor; }
.chat-search-toggle:hover { border-color: rgba(255, 255, 255, 0.5); }
.chat-search-toggle[aria-expanded="true"],
.chat-search-toggle.has-query { color: var(--accent); border-color: var(--accent); }
.chat-search-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.light-mode .chat-search-toggle { background: #ffffff; color: #111111; border: 1.5px solid #000000; }
body.light-mode .chat-search-toggle:hover { background: #f0f0f0; }
body.light-mode .chat-search-toggle[aria-expanded="true"],
body.light-mode .chat-search-toggle.has-query { color: #000000; background: #f0f0f0; border-color: #000000; }
.sidebar-actions .chat-search { display: none; margin: 0.55rem 0 0.1rem; }
.sidebar-actions.search-open .chat-search { display: flex; }

.sidebar { height: 100vh; height: 100dvh; }
.sidebar-info-cards { padding: 0.2rem 0.5rem 0.15rem; }
.sidebar-info-cards .info-card { padding: 0.45rem 0.7rem; }
.sidebar-info-cards .info-card h4 { margin-bottom: 0.15rem; }
.sidebar-footer { padding: 0.2rem 0.6rem 0; gap: 0; }
.sidebar-footer a { padding: 0.4rem 0.5rem; min-height: 32px; box-sizing: border-box; }
.sidebar-socials { padding: 0.4rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px)); }
.sidebar-socials .sidebar-cta-wrapper { gap: 0.3rem; }
.sidebar-socials .sidebar-cta { padding: 0.6rem 1.5rem; }
.sidebar-socials .sidebar-links-wrapper { min-height: 32px; }
.sidebar-socials .sidebar-link-text { display: inline-flex; align-items: center; min-height: 32px; padding: 0 0.3rem; }
@media (max-width: 768px) {
.sidebar-footer a { min-height: 36px; }
}
@media (max-width: 768px) and (display-mode: standalone) {
.sidebar-footer,
.sidebar-socials { margin-top: 0 !important; }
}
.chat-search-toggle {
            flex: 0 0 46px; box-sizing: border-box; padding: 0; border-radius: 8px;
            border: 2px solid #000000;
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
        }
.chat-search-toggle:hover { border-color: #000000; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55); }
.chat-search-toggle[aria-expanded="true"],
.chat-search-toggle.has-query { border-color: #000000; box-shadow: 0 0 0 1px var(--accent); }
body.light-mode .chat-search-toggle,
body.light-mode .chat-search-toggle:hover,
body.light-mode .chat-search-toggle[aria-expanded="true"],
body.light-mode .chat-search-toggle.has-query { border: 1.5px solid #000000; box-shadow: none; }

.sidebar-footer.sidebar-user { position: relative; padding: 0.3rem 0.5rem 0.1rem; gap: 0; display: block; }
.su-row {
            width: 100%; display: flex; align-items: center; gap: 0.6rem; box-sizing: border-box;
            min-height: 46px; padding: 0.35rem 0.45rem 0.35rem 0.4rem; margin: 0;
            background: transparent; border: 1px solid var(--border); border-radius: 10px;
            color: var(--text-primary); font: inherit; text-align: left; cursor: pointer;
            transition: border-color 0.2s, background 0.2s; -webkit-tap-highlight-color: transparent;
        }
.su-row:hover { border-color: var(--accent); background: var(--bg-tertiary); }
.su-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.su-row[aria-expanded="true"] { border-color: var(--accent); background: var(--bg-tertiary); }
.su-avatar {
            width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; overflow: hidden; box-sizing: border-box;
            border: 2px solid var(--accent); background: var(--bg-tertiary);
            display: flex; align-items: center; justify-content: center;
            color: var(--accent); font-weight: 700; font-size: 0.85rem;
        }
.su-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.su-avatar svg { width: 18px; height: 18px; fill: currentColor; }
.su-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.05rem; line-height: 1.2; }
.su-name { font-size: 0.86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-sub { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-sub .su-credits { color: var(--accent); }
body.light-mode .su-sub .su-credits { color: #000000; }
.su-arrow {
            flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
            color: var(--text-secondary); background: var(--bg-tertiary); border: 1px solid var(--border);
        }
.su-arrow svg { width: 16px; height: 16px; transition: transform 0.2s; }
.su-row:hover .su-arrow,
.su-row[aria-expanded="true"] .su-arrow { color: var(--accent); border-color: var(--accent); }
.su-row[aria-expanded="true"] .su-arrow svg { transform: rotate(180deg); }
.su-menu {
            position: absolute; left: 0.5rem; right: 0.5rem; bottom: calc(100% + 0.2rem); z-index: 1100;
            display: flex; flex-direction: column; gap: 0.1rem; padding: 0.35rem;
            background: #1a1a1a; border: 1px solid var(--border); border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
            animation: suMenuIn 0.14s ease-out;
        }
.su-menu[hidden] { display: none; }
.sidebar-footer.sidebar-user .su-menu a {
            display: flex; align-items: center; gap: 0.6rem; min-height: 38px; box-sizing: border-box;
            padding: 0.45rem 0.6rem; border-radius: 8px; color: var(--text-secondary); text-decoration: none; font-size: 0.86rem;
        }
.sidebar-footer.sidebar-user .su-menu a:hover,
.sidebar-footer.sidebar-user .su-menu a:focus-visible {
            color: var(--accent); background: var(--bg-tertiary); outline: none;
        }
.sidebar-footer.sidebar-user .su-menu a .sidebar-icon { width: 16px; height: 16px; flex-shrink: 0; fill: currentColor; }
body.light-mode .su-row { border-color: rgba(0, 0, 0, 0.18); }
body.light-mode .su-row:hover,
body.light-mode .su-row[aria-expanded="true"] { border-color: #000000; background: #f0f0f0; }
body.light-mode .su-row:focus-visible { outline-color: #000000; }
body.light-mode .su-avatar { border-color: #000000; color: #000000; background: #ffffff; }
body.light-mode .su-arrow { background: #ffffff; border-color: rgba(0, 0, 0, 0.25); color: #333333; }
body.light-mode .su-row:hover .su-arrow,
body.light-mode .su-row[aria-expanded="true"] .su-arrow { color: #000000; border-color: #000000; }
body.light-mode .su-menu { background: #ffffff; border-color: rgba(0, 0, 0, 0.15); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
body.light-mode .sidebar-footer.sidebar-user .su-menu a { color: #333333; }
body.light-mode .sidebar-footer.sidebar-user .su-menu a:hover,
body.light-mode .sidebar-footer.sidebar-user .su-menu a:focus-visible { color: #000000; background: #f0f0f0; }
@media (max-width: 768px) {
.sidebar-footer.sidebar-user .su-menu a { min-height: 44px; }
}

/* Animations used by the sidebar */
@keyframes botBounce {

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

            50% {
                transform: translateY(-5px);
            }
        }
@keyframes botPeek {

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

            50% {
                transform: translateX(3px);
            }
        }
@keyframes handWave {

            0%,
            100% {
                transform: rotate(0deg);
            }

            50% {
                transform: rotate(15deg);
            }
        }
@keyframes eyeBlink {

            0%,
            90%,
            100% {
                transform: scaleY(1);
            }

            95% {
                transform: scaleY(0.1);
            }
        }
@keyframes hintJump {
            0%, 100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-8px);
            }
        }
@keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }
@keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
@keyframes cdmFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cdmPop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes cdmSheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes suMenuIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Go Uncensored label: keep one line so the button keeps its original size */
.new-chat-split .btn-new-chat { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 0.4rem; padding-right: 0.4rem; }

.sidebar-footer.sidebar-user .su-menu a.su-signout[hidden] { display: none !important; }
.sidebar-footer.sidebar-user .su-menu a.su-signout { color: #ff5c5c; }

.su-row:hover .su-arrow, body.light-mode .su-row:hover .su-arrow { border-color: transparent !important; outline: none !important; box-shadow: none !important; }

@media (max-width: 768px) {
    html.mobile-sidebar-locked {
        overflow: hidden !important;
        overscroll-behavior: none;
    }
    html.mobile-sidebar-locked body {
        position: fixed !important;
        inset: calc(-1 * var(--sidebar-page-scroll, 0px)) 0 auto;
        width: 100%;
        overflow: visible !important;
    }
    html.mobile-sidebar-locked #sidebar-overlay {
        display: block;
        inset-block: -160px;
        touch-action: none;
    }
    html.mobile-sidebar-locked #sidebar.sidebar-open {
        top: 0;
        bottom: 0;
        height: auto;
        /* Toolbar resize handlers can add mobile-hidden during an open drawer. */
        transform: translateX(0);
        isolation: isolate;
        background: #121212 !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    html.mobile-sidebar-locked body.light-mode #sidebar.sidebar-open {
        background: #fff !important;
    }
    html.mobile-sidebar-locked #sidebar.sidebar-open::before {
        /* Extend the panel surface into Safari's changing browser chrome. */
        content: "";
        position: absolute;
        inset: -160px 0;
        background: inherit;
        pointer-events: none;
        z-index: -1;
    }
    html.mobile-sidebar-locked .sidebar-conversations {
        min-height: 0;
        overscroll-behavior-y: none;
    }
}

/* One card, with the original privacy slide reserving its existing space. */
.sidebar-info-cards .sidebar-carousel {
    touch-action: pan-y;
}
.sidebar-carousel-slide {
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms;
    pointer-events: none;
}
.sidebar-carousel-slide.is-current {
    opacity: 1;
    visibility: visible;
}
.sidebar-carousel-slide:not(:first-child) {
    position: absolute;
    inset: 0.45rem 0.7rem;
}
.sidebar-info-cards .sidebar-carousel h4 {
    padding-right: 33px;
}
.sidebar-info-cards .sidebar-carousel-slide:not(:first-child) h4 {
    font-size: 0.775rem;
    line-height: 1.3;
    white-space: nowrap;
}
.sidebar-carousel-indicators {
    position: absolute;
    top: 0.5rem;
    right: 0.55rem;
    display: flex;
}
.sidebar-carousel-indicators button {
    display: grid;
    place-items: center;
    width: 11px;
    height: 14px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}
.sidebar-carousel-indicators button::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}
.sidebar-carousel-indicators button[aria-current] {
    color: var(--accent);
}
.sidebar-carousel:focus-visible,
.sidebar-carousel-indicators button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .sidebar-carousel-slide { transition: none; }
}
