        .typing-dots::after {
            content: '';
            animation: typing 1.5s infinite;
        }
        
        @keyframes typing {
            0% { content: '.'; }
            33% { content: '..'; }
            66% { content: '...'; }
            100% { content: '.'; }
        }

        /* Hide scrollbar but keep functionality */
        .hide-scrollbar::-webkit-scrollbar {
            display: none;
        }
        .hide-scrollbar {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }

        /* Improved markdown styling */
        .markdown pre {
            background-color: #2d2d3a;
            border-radius: 6px;
            padding: 12px;
            margin: 12px 0;
            overflow-x: auto;
            position: relative;
            max-width: 100%;
            white-space: pre-wrap;
            word-wrap: break-word;
        }
        
        .markdown code {
            font-family: monospace;
        }
        
        .markdown p {
            margin-bottom: 12px;
        }
        
        .markdown ol, .markdown ul {
            margin-left: 24px;
            margin-bottom: 12px;
            padding-left: 1rem;
        }
        
        .markdown ol {
            list-style-type: decimal;
        }
        
        .markdown ul {
            list-style-type: disc;
        }
        
        .markdown h1, .markdown h2, .markdown h3, .markdown h4 {
            margin-top: 24px;
            margin-bottom: 16px;
            font-weight: bold;
            line-height: 1.25;
        }
        
        .markdown h1 { font-size: 1.5rem; }
        .markdown h2 { font-size: 1.4rem; }
        .markdown h3 { font-size: 1.3rem; }
        .markdown h4 { font-size: 1.2rem; }
        
        /* Code block styling */
        .code-block {
            margin: 16px 0;
            border-radius: 6px;
            overflow: hidden;
            border: 1px solid #4b5563;
            max-width: 100%;
        }
        
        .code-header {
            background-color: #374151;
            padding: 8px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .copy-code-btn {
            background: none;
            border: none;
            color: #9ca3af;
            cursor: pointer;
            font-size: 0.875rem;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .copy-code-btn:hover {
            color: #f9fafb;
        }
        
        /* Make chat history icons always visible */
        .chat-item .rename-chat-btn,
        .chat-item .delete-chat-btn {
            opacity: 1 !important;
        }
        
        /* Tables styling */
        .markdown table {
            border-collapse: collapse;
            width: 100%;
            margin: 16px 0;
            display: block;
            overflow-x: auto;
        }
        
        .markdown th, .markdown td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;
            min-width: 120px;
        }
        
        .markdown th {
            background-color: #f2f2f2;
            font-weight: bold;
        }
        
        .dark .markdown th {
            background-color: #333;
        }
        
        .dark .markdown th, .dark .markdown td {
            border-color: #444;
        }
        
        /* Improved overflow handling for code and tables */
        .overflow-x-auto {
            max-width: 100%;
            overflow-x: auto;
        }
        
        /* Fix sidebar overlay z-index */
        #sidebar {
            z-index: 40;
        }
        
        #sidebar-overlay {
            z-index: 35;
        }
        
        /* Make chat history items accessible above overlay */
        .chat-item {
            position: relative;
            z-index: 45;
        }
        
        /* Make chat history icons always visible and accessible */
        .chat-item .rename-chat-btn,
        .chat-item .delete-chat-btn {
            z-index: 50;
        }