* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow: hidden;
    height: 100vh;
}

:root {
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e9ecef;
    --gray-250: #e2e8f0;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #cbd5e1;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #1f2937;
    --gray-950: #f8fafc;

    --gray-warm-50: #fef8f5;
    --gray-warm-100: #f1f5f9;
    --gray-warm-200: #f8f9fa;

    --accent: #ce7a58;
    --accent-dark: #b86547;
    --accent-light: #fda172;

    --success: #4ade80;
    --success-dark: #10b981;
    --warning: #fbbf24;
    --warning-dark: #f59e0b;
    --error: #ef4444;
    --error-dark: #dc2626;
    --error-light: #fca5a5;

    --mark-bg: #fef3c7;
    --mark-text: #92400e;
    --shadow-sm: 4px 0 20px rgba(0, 0, 0, 0.08);
    --shadow-neumorphic: -3px -3px 8px rgba(255, 255, 255, 0.6), 3px 3px 12px rgba(0, 0, 0, 0.1), inset -1px -1px 3px rgba(0, 0, 0, 0.05), inset 2px 2px 5px rgba(255, 255, 255, 0.5);
    --shadow-neumorphic-sm: -2px -2px 5px rgba(255, 255, 255, 0.8), 2px 2px 8px rgba(0, 0, 0, 0.08), inset -1px -1px 2px rgba(0, 0, 0, 0.03), inset 1px 1px 3px rgba(255, 255, 255, 0.5);
    --shadow-gradient-btn: -3px -3px 8px rgba(255, 255, 255, 0.4), 3px 3px 12px rgba(206, 122, 88, 0.4), inset -2px -2px 4px rgba(0, 0, 0, 0.15), inset 3px 3px 6px rgba(255, 255, 255, 0.3);
    --shadow-gradient-btn-enhanced: -3px -3px 8px rgba(255, 255, 255, 0.4), 3px 3px 12px rgba(206, 122, 88, 0.4), 0 4px 20px rgba(206, 122, 88, 0.3), inset -2px -2px 4px rgba(0, 0, 0, 0.15), inset 3px 3px 6px rgba(255, 255, 255, 0.3);
    --shadow-icon-btn: -2px -2px 4px rgba(255, 255, 255, 0.3), 2px 2px 6px rgba(0, 0, 0, 0.2), inset -1px -1px 2px rgba(0, 0, 0, 0.1), inset 1px 1px 3px rgba(255, 255, 255, 0.3);
    --shadow-input: -3px -3px 8px rgba(255, 255, 255, 0.9), 3px 3px 12px rgba(0, 0, 0, 0.08), inset -2px -2px 4px rgba(0, 0, 0, 0.05), inset 3px 3px 6px rgba(255, 255, 255, 0.7);
    --shadow-input-focus: 0 0 0 4px rgba(206, 122, 88, 0.1), -3px -3px 8px rgba(255, 255, 255, 0.8), 3px 3px 12px rgba(206, 122, 88, 0.2), inset -2px -2px 4px rgba(0, 0, 0, 0.05), inset 3px 3px 6px rgba(255, 255, 255, 0.6);
    --shadow-modal: -5px -5px 15px rgba(255, 255, 255, 0.6), 5px 5px 20px rgba(0, 0, 0, 0.2), 0 10px 40px rgba(0, 0, 0, 0.3), inset -2px -2px 6px rgba(0, 0, 0, 0.05), inset 3px 3px 8px rgba(255, 255, 255, 0.5);
    --shadow-modal-icon: -3px -3px 8px rgba(255, 255, 255, 0.4), 3px 3px 12px rgba(251, 191, 36, 0.4), 0 4px 20px rgba(251, 191, 36, 0.3), inset -2px -2px 4px rgba(0, 0, 0, 0.15), inset 3px 3px 6px rgba(255, 255, 255, 0.3);
    --shadow-help-modal: -8px 0 24px rgba(0, 0, 0, 0.15), inset 2px 0 8px rgba(255, 255, 255, 0.5), inset -2px 0 6px rgba(0, 0, 0, 0.05);
    --shadow-link: -1px -1px 3px rgba(255, 255, 255, 0.6), 1px 1px 4px rgba(0, 0, 0, 0.08), inset -0.5px -0.5px 1px rgba(0, 0, 0, 0.05), inset 1px 1px 2px rgba(255, 255, 255, 0.4);
    --shadow-chat-input: 0 -2px 20px rgba(0, 0, 0, 0.05);
    --shadow-chat-container: inset -2px -2px 8px rgba(0, 0, 0, 0.1), inset 4px 4px 12px rgba(255, 255, 255, 0.6);
    --shadow-table: -2px -2px 6px rgba(255, 255, 255, 0.6), 2px 2px 10px rgba(0, 0, 0, 0.12), inset -1px -1px 3px rgba(0, 0, 0, 0.05), inset 1px 1px 4px rgba(255, 255, 255, 0.4);
    --shadow-help-icon: -2px -2px 4px rgba(255, 255, 255, 0.4), 2px 2px 6px rgba(206, 122, 88, 0.3), inset -1px -1px 2px rgba(0, 0, 0, 0.1), inset 1px 1px 3px rgba(255, 255, 255, 0.3);
    --shadow-help-header: 0 2px 8px rgba(206, 122, 88, 0.3), inset -2px -2px 4px rgba(0, 0, 0, 0.15), inset 3px 3px 6px rgba(255, 255, 255, 0.3);

    --shadow-icon-btn-hover: -3px -3px 6px rgba(255, 255, 255, 0.4), 3px 3px 8px rgba(0, 0, 0, 0.25), inset -1px -1px 2px rgba(0, 0, 0, 0.1), inset 2px 2px 4px rgba(255, 255, 255, 0.4);
    --shadow-gradient-btn-hover: -4px -4px 10px rgba(255, 255, 255, 0.5), 4px 4px 16px rgba(206, 122, 88, 0.5), inset -2px -2px 5px rgba(0, 0, 0, 0.2), inset 3px 3px 8px rgba(255, 255, 255, 0.4);
    --shadow-gradient-btn-enhanced-hover: -4px -4px 10px rgba(255, 255, 255, 0.5), 4px 4px 16px rgba(206, 122, 88, 0.5), 0 6px 24px rgba(206, 122, 88, 0.4), inset -2px -2px 5px rgba(0, 0, 0, 0.2), inset 3px 3px 8px rgba(255, 255, 255, 0.4);
    --shadow-send-btn-hover: -4px -4px 10px rgba(255, 255, 255, 0.5), 4px 4px 16px rgba(206, 122, 88, 0.5), inset -2px -2px 5px rgba(0, 0, 0, 0.2), inset 3px 3px 8px rgba(255, 255, 255, 0.4);
    --shadow-quick-action-hover: -3px -3px 8px rgba(255, 255, 255, 0.4), 3px 3px 15px rgba(206, 122, 88, 0.35), inset -1px -1px 3px rgba(0, 0, 0, 0.1), inset 2px 2px 5px rgba(255, 255, 255, 0.3);
    --shadow-link-hover: -2px -2px 5px rgba(255, 255, 255, 0.7), 2px 2px 10px rgba(206, 122, 88, 0.35), inset -1px -1px 2px rgba(0, 0, 0, 0.08), inset 1px 1px 3px rgba(255, 255, 255, 0.5);
    --shadow-neumorphic-hover: -3px -3px 8px rgba(255, 255, 255, 0.6), 3px 3px 15px rgba(0, 0, 0, 0.15), inset -1px -1px 3px rgba(0, 0, 0, 0.05), inset 2px 2px 5px rgba(255, 255, 255, 0.5);

    --shadow-skip-link: 0 4px 20px rgba(206, 122, 88, 0.4);
    --shadow-bot-avatar: -2px -2px 6px rgba(255, 255, 255, 0.5), 2px 2px 8px rgba(0, 0, 0, 0.15), inset -1px -1px 3px rgba(0, 0, 0, 0.1), inset 2px 2px 4px rgba(255, 255, 255, 0.4);
    --shadow-image: 0 2px 12px rgba(0, 0, 0, 0.1);
    --shadow-kbd: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-link-white: 0 2px 8px rgba(255, 255, 255, 0.2);
    --shadow-link-success: 0 2px 8px rgba(16, 185, 129, 0.3);
    --shadow-link-warning: 0 2px 8px rgba(245, 158, 11, 0.3);

    --shadow-error-btn: -3px -3px 8px rgba(255, 255, 255, 0.4), 3px 3px 12px rgba(239, 68, 68, 0.4), 0 4px 20px rgba(239, 68, 68, 0.3), inset -2px -2px 4px rgba(0, 0, 0, 0.15), inset 3px 3px 6px rgba(255, 255, 255, 0.3);
    --shadow-error-btn-hover: -4px -4px 10px rgba(255, 255, 255, 0.5), 4px 4px 16px rgba(239, 68, 68, 0.5), 0 6px 24px rgba(239, 68, 68, 0.4), inset -2px -2px 5px rgba(0, 0, 0, 0.2), inset 3px 3px 8px rgba(255, 255, 255, 0.4);

    --overlay-dark: rgba(0, 0, 0, 0.6);
    --overlay-light: rgba(0, 0, 0, 0.2);
    --black-30: rgba(0, 0, 0, 0.3);
    --black-40: rgba(0, 0, 0, 0.4);
    --black-50: rgba(0, 0, 0, 0.5);
    --black-60: rgba(0, 0, 0, 0.6);
    --black-70: rgba(0, 0, 0, 0.7);
    --black-80: rgba(0, 0, 0, 0.8);

    --text-primary: var(--gray-700);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-400);
    --border-color: var(--gray-200);
    --bg-primary: var(--white);
    --bg-warm: var(--gray-warm-50);
    --bg-gradient-start: var(--accent);
    --bg-gradient-end: var(--accent-dark);
    --sidebar-bg-start: var(--white);
    --sidebar-bg-end: var(--gray-950);
    --messages-bg-start: var(--gray-950);
    --messages-bg-end: var(--gray-250);
    --input-bg: var(--gray-warm-100);
    --scrollbar-color: var(--gray-500);
    --chat-bg: var(--white);
    --bubble-bg: var(--white);
    --bubble-border: var(--gray-200);
    --conversation-bg: var(--white);
    --quick-action-bg: var(--white);
    --quick-action-hover: var(--gray-warm-50);
    --scrollbar-thumb: var(--gray-500);

    --transition-base: 0.3s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --radius-full: 50%;
    --radius-xl: 30px;
    --size-btn-md: 40px;
    --size-btn-xl: 48px;

    --font-3xs: 11px;
    --font-2xs: 12px;
    --font-xs: 13px;
    --font-sm: 14px;
    --font-md: 15px;
    --font-base: 16px;
    --font-lg: 18px;
    --font-xl: 20px;
    --font-2xl: 22px;
    --font-3xl: 32px;

    --opacity-low: 0.3;
    --opacity-medium-low: 0.6;
    --opacity-medium-high: 0.8;
    --opacity-high: 0.9;

    --white-10: rgba(255, 255, 255, 0.1);
    --white-20: rgba(255, 255, 255, 0.2);
    --white-30: rgba(255, 255, 255, 0.3);
    --white-70: rgba(255, 255, 255, 0.7);
    --white-80: rgba(255, 255, 255, 0.8);
    --white-90: rgba(255, 255, 255, 0.9);
    --white-95: rgba(255, 255, 255, 0.95);

    --accent-10: rgba(206, 122, 88, 0.1);
    --accent-15: rgba(206, 122, 88, 0.15);
    --accent-20: rgba(206, 122, 88, 0.2);
    --accent-25: rgba(206, 122, 88, 0.25);
    --accent-30: rgba(206, 122, 88, 0.3);

    --success-10: rgba(74, 222, 128, 0.1);
    --success-20: rgba(74, 222, 128, 0.2);
    --success-border: rgba(16, 185, 129, 0.2);
    --warning-10: rgba(251, 191, 36, 0.1);
    --warning-20: rgba(251, 191, 36, 0.2);
    --warning-border: rgba(245, 158, 11, 0.2);
    --error-10: rgba(239, 68, 68, 0.1);

    --size-btn-xs: 36px;
    --size-avatar: 50px;
    --size-modal-icon: 70px;

    --scrollbar-hover: #94a3b8;
    --code-bg-light: #f8fafc;
    --link-border: rgba(206, 122, 88, 0.3);
    --cancel-hover-border: #cbd5e1;
    --help-strong-bg: rgba(206, 122, 88, 0.1);
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.transition-base {
    transition: all var(--transition-base);
}

body.dark-mode {
    --dark-bg-1: #0d1117;
    --dark-bg-2: #161b22;
    --dark-bg-3: #1f2937;
    --dark-bg-4: #21262d;
    --dark-bg-5: #30363d;

    --dark-text-primary: #f0f6fc;
    --dark-text-secondary: #c9d1d9;
    --dark-text-muted: #8b949e;

    --dark-gray-3: rgba(148, 163, 184, 0.03);
    --dark-gray-5: rgba(148, 163, 184, 0.05);
    --dark-gray-8: rgba(148, 163, 184, 0.08);
    --dark-gray-10: rgba(148, 163, 184, 0.1);
    --dark-gray-20: rgba(148, 163, 184, 0.2);

    --dark-pre-bg: rgba(15, 23, 42, 0.5);

    --pre-dark: var(--dark-pre-bg);
    --code-bg-light: var(--dark-bg-2);

    --text-primary: var(--dark-text-primary);
    --text-secondary: var(--dark-text-secondary);
    --text-muted: var(--dark-text-muted);
    --border-color: var(--dark-bg-5);
    --bg-gradient-start: var(--dark-bg-1);
    --bg-gradient-end: var(--dark-bg-2);
    --sidebar-bg-start: var(--dark-bg-2);
    --sidebar-bg-end: var(--dark-bg-3);
    --messages-bg-start: var(--dark-bg-1);
    --messages-bg-end: var(--dark-bg-2);
    --chat-bg: var(--dark-bg-3);
    --bubble-bg: var(--dark-bg-3);
    --bubble-border: var(--dark-bg-4);
    --conversation-bg: var(--dark-bg-3);
    --quick-action-bg: var(--dark-bg-3);
    --quick-action-hover: var(--dark-bg-3);
    --input-bg: var(--dark-bg-1);
    --scrollbar-thumb: var(--dark-bg-5);

    --shadow-sm: 4px 0 20px rgba(0, 0, 0, 0.5);
    --shadow-neumorphic: -2px -2px 6px rgba(148, 163, 184, 0.03), 2px 2px 10px rgba(0, 0, 0, 0.4), inset -1px -1px 2px rgba(0, 0, 0, 0.2), inset 1px 1px 3px rgba(148, 163, 184, 0.05);
    --shadow-neumorphic-sm: -2px -2px 5px rgba(148, 163, 184, 0.03), 2px 2px 8px rgba(0, 0, 0, 0.4), inset -1px -1px 2px rgba(0, 0, 0, 0.15), inset 1px 1px 3px rgba(148, 163, 184, 0.05);
    --shadow-gradient-btn: -2px -2px 6px rgba(148, 163, 184, 0.05), 2px 2px 10px rgba(0, 0, 0, 0.5), inset -2px -2px 4px rgba(0, 0, 0, 0.15), inset 2px 2px 6px rgba(255, 255, 255, 0.1);
    --shadow-gradient-btn-enhanced: -2px -2px 6px rgba(148, 163, 184, 0.05), 2px 2px 10px rgba(0, 0, 0, 0.5), 0 4px 20px rgba(206, 122, 88, 0.2), inset -2px -2px 4px rgba(0, 0, 0, 0.15), inset 2px 2px 6px rgba(255, 255, 255, 0.1);
    --shadow-icon-btn: -2px -2px 4px rgba(148, 163, 184, 0.05), 2px 2px 6px rgba(0, 0, 0, 0.5), inset -1px -1px 2px rgba(0, 0, 0, 0.15), inset 1px 1px 3px rgba(148, 163, 184, 0.05);
    --shadow-input: -2px -2px 6px rgba(148, 163, 184, 0.03), 2px 2px 10px rgba(0, 0, 0, 0.4), inset -2px -2px 4px rgba(0, 0, 0, 0.2), inset 2px 2px 5px rgba(148, 163, 184, 0.03);
    --shadow-input-focus: 0 0 0 4px rgba(206, 122, 88, 0.2), -2px -2px 6px rgba(148, 163, 184, 0.05), 2px 2px 10px rgba(0, 0, 0, 0.5), inset -2px -2px 4px rgba(0, 0, 0, 0.2), inset 2px 2px 5px rgba(148, 163, 184, 0.05);
    --shadow-modal: -5px -5px 15px rgba(148, 163, 184, 0.05), 5px 5px 20px rgba(0, 0, 0, 0.8), 0 10px 40px rgba(0, 0, 0, 0.6), inset -2px -2px 6px rgba(0, 0, 0, 0.2), inset 3px 3px 8px rgba(148, 163, 184, 0.05);
    --shadow-modal-icon: -3px -3px 8px rgba(148, 163, 184, 0.05), 3px 3px 12px rgba(0, 0, 0, 0.6), 0 4px 20px rgba(251, 191, 36, 0.2), inset -2px -2px 4px rgba(0, 0, 0, 0.15), inset 3px 3px 6px rgba(255, 255, 255, 0.1);
    --shadow-help-modal: -8px 0 24px rgba(0, 0, 0, 0.5), inset 2px 0 8px rgba(148, 163, 184, 0.05), inset -2px 0 6px rgba(0, 0, 0, 0.3);
    --shadow-link: -1px -1px 2px rgba(148, 163, 184, 0.05), 1px 1px 4px rgba(0, 0, 0, 0.3), inset -0.5px -0.5px 1px rgba(0, 0, 0, 0.1), inset 1px 1px 2px rgba(206, 122, 88, 0.1);
    --shadow-chat-input: 0 -2px 20px rgba(0, 0, 0, 0.2);
    --shadow-chat-container: inset -2px -2px 8px rgba(0, 0, 0, 0.3), inset 4px 4px 12px rgba(148, 163, 184, 0.05);
    --shadow-table: -2px -2px 6px rgba(148, 163, 184, 0.03), 2px 2px 10px rgba(0, 0, 0, 0.4), inset -1px -1px 3px rgba(0, 0, 0, 0.2), inset 1px 1px 4px rgba(148, 163, 184, 0.05);
    --shadow-help-icon: -2px -2px 4px rgba(148, 163, 184, 0.05), 2px 2px 6px rgba(0, 0, 0, 0.5), inset -1px -1px 2px rgba(0, 0, 0, 0.15), inset 1px 1px 3px rgba(255, 255, 255, 0.1);
    --shadow-help-header: 0 2px 8px rgba(206, 122, 88, 0.3), inset -2px -2px 4px rgba(0, 0, 0, 0.15), inset 3px 3px 6px rgba(255, 255, 255, 0.1);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-xl);
}

.custom-scrollbar-8::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar-8::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar-8::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-xl);
}

.custom-scrollbar-horizontal::-webkit-scrollbar {
    height: 4px;
}

.custom-scrollbar-horizontal::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar-horizontal::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-xl);
}

.gradient-header-base {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: var(--white);
    position: relative;
    box-shadow: var(--shadow-gradient-btn);
}

.gradient-header-base::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white-10);
    backdrop-filter: blur(10px);
}

.icon-btn-base {
    background: var(--white-20);
    border: none;
    border-radius: var(--radius-full);
    color: var(--white);
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-icon-btn);
}

.icon-btn-40 {
    width: var(--size-btn-md);
    height: var(--size-btn-md);
    font-size: var(--font-base);
}

.icon-btn-36 {
    width: var(--size-btn-xs);
    height: var(--size-btn-xs);
    font-size: var(--font-base);
}

.modal-overlay-base {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
}

.modal-overlay-base.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay-dark {
    background: var(--overlay-dark);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-overlay-light {
    background: var(--overlay-light);
    pointer-events: none;
}

.modal-overlay-light.active {
    pointer-events: auto;
}

.list-arrow-style {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-arrow-style li {
    padding: 8px 0 8px 25px;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: var(--font-sm);
}

.list-arrow-style li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    height: 100vh;
    overflow: hidden;
    display: flex;
    transition: background var(--transition-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sidebar {
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.sidebar-header {
    padding: 20px 30px;
    min-height: 91px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow-gradient-btn);
    z-index: 10;
}

.sidebar-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white-10);
    backdrop-filter: blur(10px);
}

.sidebar-header h3 {
    font-size: var(--font-base);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.sidebar-close {
    display: none;
    width: 40px;
    height: 40px;
    background: var(--white-20);
    border: none;
    border-radius: var(--radius-xl);
    color: var(--white);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: var(--font-base);
    transition: all var(--transition-base);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-icon-btn);
}

.sidebar-close:hover {
    background: var(--white-30);
    transform: scale(1.05);
    box-shadow: var(--shadow-icon-btn-hover);
}

.new-chat-btn {
    margin: 20px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-xl);
    font-size: var(--font-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-gradient-btn);
}

.new-chat-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-gradient-btn);
}

.new-chat-btn:active {
    transform: translateY(0);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 10px 20px;
}

.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track {
    background: transparent;
}

.conversations-list::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-xl);
}

.sidebar-footer {
    display: none;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
    gap: 15px;
}

.sidebar-action-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border: none;
    border-radius: var(--radius-full);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-xl);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-gradient-btn);
}

.sidebar-action-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-gradient-btn-hover);
}

.sidebar-action-btn:active {
    transform: scale(0.95);
}

.conversation-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    background: var(--conversation-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-neumorphic);
}

.conversation-item:hover {
    background: var(--quick-action-hover);
    border-color: var(--accent);
    transform: translateX(4px);
    box-shadow: var(--shadow-neumorphic);
}

.conversation-item.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: var(--white);
    border-color: var(--accent-dark);
    box-shadow: var(--shadow-neumorphic);
}

.conversation-content {
    flex: 1;
    min-width: 0;
}

.conversation-title {
    font-size: var(--font-sm);
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.conversation-preview {
    font-size: var(--font-2xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: var(--font-3xs);
    opacity: var(--opacity-medium-low);
    white-space: nowrap;
}

.conversation-delete {
    width: 28px;
    height: 28px;
    background: var(--error-10);
    border: none;
    border-radius: var(--radius-full);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-2xs);
    transition: all var(--transition-base);
    flex-shrink: 0;
    opacity: 0;
}

.conversation-item:hover .conversation-delete {
    opacity: 1;
}

.conversation-delete:hover {
    background: var(--error);
    color: var(--white);
    transform: scale(1.1);
}

.conversation-item.active .conversation-title {
    color: var(--white-95);
}

.conversation-item.active .conversation-preview {
    color: var(--white-80);
}

.conversation-item.active .conversation-time {
    color: var(--white-70);
}

.conversation-item.active .conversation-delete {
    background: var(--white-20);
    color: var(--white);
}

.conversation-item.active .conversation-delete:hover {
    background: var(--white-30);
}

.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: var(--white-20);
    border: none;
    border-radius: var(--radius-xl);
    color: var(--white);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: var(--font-base);
    margin-right: 15px;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-icon-btn);
}

.sidebar-toggle:hover {
    background: var(--white-30);
    transform: scale(1.05);
    box-shadow: var(--shadow-icon-btn-hover);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black-50);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.empty-conversations {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-conversations i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: var(--opacity-low);
}

.empty-conversations p {
    font-size: var(--font-sm);
    line-height: 1.6;
}

.chat-container {
    width: 100vw;
    height: 100vh;
    background: var(--chat-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    margin-left: 280px;
    transition: margin-left 0.3s ease, background 0.3s ease;
    box-shadow: var(--shadow-chat-container);
}

.chat-header {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: var(--white);
    padding: 20px 30px;
    min-height: 91px;
    position: relative;
    box-shadow: var(--shadow-gradient-btn);
    z-index: 10;
}

.chat-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white-10);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.bot-avatar {
    width: var(--size-avatar);
    height: var(--size-avatar);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-lg);
    flex-shrink: 0;
    box-shadow: var(--shadow-bot-avatar);
}

.header-info h3 {
    font-size: var(--font-xl);
    font-weight: 600;
    margin-bottom: 5px;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-sm);
    opacity: var(--opacity-high);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 40px;
    height: 40px;
    background: var(--white-20);
    border: none;
    border-radius: var(--radius-xl);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-base);
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-icon-btn);
}

.action-btn:hover {
    background: var(--white-30);
    transform: scale(1.05);
    box-shadow: var(--shadow-icon-btn-hover);
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.chat-messages {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(to bottom, var(--messages-bg-start) 0%, var(--messages-bg-end) 100%);
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-xl);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
}

.message {
    animation: fadeInUp 0.4s ease-out;
    margin-bottom: 10px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message,
.bot-message {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    max-width: 800px;
}
.user-message {
    align-items: flex-end;
    margin-left: auto;
}
.message-avatar {
    display: none;
}
.message-content {
    width: 100%;
    margin-bottom: 10px;
}

.message-bubble {
    padding: 15px 20px;
    border-radius: var(--radius-xl);
    font-size: var(--font-md);
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    box-shadow: var(--shadow-neumorphic);
}

.bot-bubble {
    background: var(--bubble-bg);
    color: var(--text-primary);
    border: 1px solid var(--bubble-border);
}

.user-bubble {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: var(--white);
}

.message-time {
    font-size: var(--font-2xs);
    color: var(--text-muted);
    margin-top: 6px;
    text-align: left;
}

.user-message .message-time {
    text-align: right;
}

.welcome-text h4 {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: var(--font-base);
}

.welcome-text p {
    margin-bottom: 10px;
}

.welcome-text ul {
    margin: 15px 0;
    padding-left: 0;
    list-style: none;
}

.welcome-text li {
    margin-bottom: 8px;
    padding-left: 5px;
}

.scroll-to-bottom {
    position: fixed;
    bottom: 140px;
    right: 40px;
    width: var(--size-btn-xl);
    height: var(--size-btn-xl);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border: none;
    border-radius: var(--radius-full);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-xl);
    box-shadow: var(--shadow-gradient-btn-enhanced);
    transition: all var(--transition-base);
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.scroll-to-bottom:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-gradient-btn-enhanced-hover);
}

.scroll-to-bottom:active {
    transform: translateY(-1px) scale(1);
}

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

.typing-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-12px);
        opacity: 1;
    }
}

.quick-actions {
    padding: 20px 30px;
    background: var(--messages-bg-start);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.quick-actions::-webkit-scrollbar {
    height: 4px;
}

.quick-actions::-webkit-scrollbar-track {
    background: transparent;
}

.quick-actions::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-xl);
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--quick-action-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    font-size: var(--font-sm);
    color: var(--text-primary);
    box-shadow: var(--shadow-neumorphic-sm);
}

.quick-action-item:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-quick-action-hover);
}
.quick-action-item i {
    font-size: var(--font-base);
}

.chat-input-container {
    padding: 25px 30px;
    background: var(--chat-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-chat-input);
}

.chat-form {
    max-width: 1200px;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border-radius: var(--radius-xl);
    padding: 6px;
    transition: all var(--transition-base);
    border: 2px solid transparent;
    box-shadow: var(--shadow-input);
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-input-focus);
}

.attachment-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-full);
    font-size: var(--font-base);
}

.attachment-btn:hover {
    background: var(--accent-10);
    color: var(--accent);
}
#user-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    font-size: var(--font-base);
    outline: none;
    color: var(--text-primary);
    min-height: 20px;
    resize: none;
    -webkit-appearance: none;
    appearance: none;
    -webkit-user-select: text;
    user-select: text;
}

#user-input::placeholder {
    color: var(--text-muted);
}

#send-button {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: var(--white);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-base);
    transition: all var(--transition-base);
    flex-shrink: 0;
    box-shadow: var(--shadow-gradient-btn);
}

#send-button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-send-btn-hover);
}

#send-button:active {
    transform: scale(0.95);
}

#send-button:disabled {
    opacity: var(--opacity-medium-low);
    cursor: not-allowed;
    transform: none;
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
    margin: 15px 0 10px 0;
    font-weight: 600;
    line-height: 1.3;
}

.message-bubble h1 {
    font-size: var(--font-lg);
    color: var(--gray-900);
}

.message-bubble h2 {
    font-size: var(--font-base);
    color: var(--text-primary);
}

.message-bubble h3 {
    font-size: var(--font-md);
    color: var(--text-secondary);
}

.user-bubble h1,
.user-bubble h2,
.user-bubble h3 {
    color: var(--white-95);
}

.message-bubble strong {
    font-weight: 600;
    color: var(--gray-900);
}

.user-bubble strong {
    color: var(--white-95);
}

.message-bubble em {
    font-style: italic;
}

.user-bubble em {
    color: var(--white-90);
}

.message-bubble code {
    background: var(--gray-100);
    color: var(--error-dark);
    padding: 2px 6px;
    border-radius: var(--radius-xl);
    font-family: "Courier New", monospace;
    font-size: var(--font-xs);
}

.user-bubble code {
    background: var(--white-20);
    color: var(--white-95);
}

.message-bubble pre {
    background: var(--code-bg-light);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 12px;
    margin: 10px 0;
    overflow-x: auto;
    font-family: "Courier New", monospace;
    font-size: var(--font-xs);
    line-height: 1.4;
}

.user-bubble pre {
    background: var(--white-10);
    border-color: var(--white-20);
    color: var(--white-95);
}

.message-bubble ul,
.message-bubble ol {
    margin: 10px 0;
    padding-left: 20px;
}

.message-bubble li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.message-bubble ul li {
    list-style-type: disc;
}

.message-bubble ol li {
    list-style-type: decimal;
}

.message-bubble p {
    margin: 8px 0;
    line-height: 1.5;
}

.message-bubble p:first-child {
    margin-top: 0;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble a {
    color: var(--accent);
    text-decoration: underline;
    transition: color var(--transition-base);
}

.message-bubble a:hover {
    color: var(--accent-dark);
}

.user-bubble a {
    color: var(--white-90);
}

.user-bubble a:hover {
    color: var(--white);
}

.message-bubble br {
    line-height: 1.5;
}

.markdown-table-wrapper {
    margin: 15px 0;
    overflow-x: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-table);
}

.markdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
    background: var(--white);
    border: 1px solid var(--border-color);
}

.markdown-table thead {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: var(--white);
}

.markdown-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-dark);
    white-space: nowrap;
}

.markdown-table tbody tr {
    transition: background-color 0.2s ease;
}

.markdown-table tbody tr:nth-child(even) {
    background-color: var(--gray-50);
}

.markdown-table tbody tr:hover {
    background-color: var(--quick-action-hover);
}

.markdown-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    line-height: 1.5;
}

.markdown-table tbody tr:last-child td {
    border-bottom: none;
}

.user-bubble .markdown-table {
    background: var(--white-95);
    border-color: var(--white-30);
}

.user-bubble .markdown-table thead {
    background: var(--white-30);
    color: var(--white-95);
}

.user-bubble .markdown-table thead th {
    border-bottom-color: var(--white-30);
}

.user-bubble .markdown-table tbody tr:nth-child(even) {
    background-color: var(--white-10);
}

.user-bubble .markdown-table tbody tr:hover {
    background-color: var(--white-20);
}

.user-bubble .markdown-table tbody td {
    border-bottom-color: var(--white-20);
    color: var(--black-80);
}

.markdown-blockquote {
    border-left: 4px solid var(--accent);
    background: var(--quick-action-hover);
    padding: 12px 20px;
    margin: 15px 0;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.user-bubble .markdown-blockquote {
    border-left-color: var(--white-30);
    background: var(--white-10);
    color: var(--white-90);
}

.markdown-blockquote p {
    margin: 8px 0;
}

.markdown-blockquote p:first-child {
    margin-top: 0;
}

.markdown-blockquote p:last-child {
    margin-bottom: 0;
}

.markdown-hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 20px 0;
    opacity: var(--opacity-medium-low);
}

.user-bubble .markdown-hr {
    border-top-color: var(--white-30);
}

.markdown-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
    margin: 15px 0;
    box-shadow: var(--shadow-image);
    display: block;
}

.message-bubble del,
.message-bubble s {
    text-decoration: line-through;
    opacity: 0.7;
}

.message-bubble mark {
    background-color: var(--mark-bg);
    color: var(--mark-text);
    padding: 2px 4px;
    border-radius: var(--radius-xl);
}

.user-bubble mark {
    background-color: var(--white-30);
    color: var(--white-95);
}

.message-bubble kbd {
    background-color: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-xl);
    padding: 2px 6px;
    font-family: monospace;
    font-size: var(--font-xs);
    box-shadow: var(--shadow-kbd);
}

.user-bubble kbd {
    background-color: var(--white-20);
    border-color: var(--white-30);
    color: var(--white-95);
}

.message-bubble ul ul,
.message-bubble ul ol,
.message-bubble ol ul,
.message-bubble ol ol {
    margin-top: 5px;
    margin-bottom: 5px;
}

.message-bubble dl {
    margin: 10px 0;
}

.message-bubble dt {
    font-weight: 600;
    margin-top: 10px;
    color: var(--gray-900);
}

.user-bubble dt {
    color: var(--white-95);
}

.message-bubble dd {
    margin-left: 20px;
    margin-top: 5px;
    color: var(--text-secondary);
}

.user-bubble dd {
    color: var(--white-90);
}

.message-bubble pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: inherit;
}

.message-bubble pre {
    position: relative;
    max-width: 100%;
}

.message-bubble pre code::before {
    content: attr(class);
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.message-bubble table:not(.markdown-table) {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: var(--font-sm);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.message-bubble table:not(.markdown-table) th,
.message-bubble table:not(.markdown-table) td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.message-bubble table:not(.markdown-table) th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--text-primary);
}

.chat-link {
    color: var(--accent) !important;
    text-decoration: none !important;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-10);
    border: 1px solid var(--accent-20);
    box-shadow: var(--shadow-link);
}

.chat-link:hover {
    background: var(--accent-20);
    transform: translateY(-1px);
    box-shadow: var(--shadow-link-hover);
}

.chat-link:active {
    transform: scale(0.95);
}

.chat-link i {
    font-size: var(--font-2xs);
    opacity: var(--opacity-medium-high);
}

.user-bubble .chat-link {
    color: var(--white-95) !important;
    background: var(--white-20);
    border-color: var(--white-30);
}

.user-bubble .chat-link:hover {
    background: var(--white-30);
    box-shadow: var(--shadow-link-white);
}

.phone-link {
    color: var(--success-dark) !important;
    background: var(--success-10);
    border-color: var(--success-border);
}

.phone-link:hover {
    background: var(--success-20);
    box-shadow: var(--shadow-link-success);
}

.user-bubble .phone-link {
    color: var(--white-95) !important;
    background: var(--white-20);
    border-color: var(--white-30);
}

.email-link {
    color: var(--warning-dark) !important;
    background: var(--warning-10);
    border-color: var(--warning-border);
}

.email-link:hover {
    background: var(--warning-20);
    box-shadow: var(--shadow-link-warning);
}

.user-bubble .email-link {
    color: var(--white-95) !important;
    background: var(--white-20);
    border-color: var(--white-30);
}

@keyframes linkPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(206, 122, 88, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(206, 122, 88, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(206, 122, 88, 0);
    }
}

.chat-link:focus {
    outline: none;
    animation: linkPulse 0.6s;
}

.loading {
    opacity: var(--opacity-medium-high);
    pointer-events: none;
}

.loading #send-button::before {
    content: "■";
    font-size: 30px;
    position: relative;
    top: -2px;
}

.loading #send-button i {
    display: none;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

body.dark-mode .sidebar {
    box-shadow: 4px 0 20px var(--black-50);
}

body.dark-mode .chat-container {
    box-shadow: inset -2px -2px 8px var(--black-30), inset 4px 4px 12px var(--dark-gray-5);
}

body.dark-mode .message-bubble {
    box-shadow: -2px -2px 6px var(--dark-gray-3), 2px 2px 10px var(--black-40), inset -1px -1px 2px var(--overlay-light), inset 1px 1px 3px var(--dark-gray-5);
}

body.dark-mode .bot-bubble {
    background: var(--bubble-bg);
    border-color: var(--bubble-border);
    box-shadow: -2px -2px 6px var(--dark-gray-3), 2px 2px 10px var(--black-40), inset -1px -1px 2px var(--overlay-light), inset 1px 1px 3px var(--dark-gray-5);
}

body.dark-mode .conversation-item {
    box-shadow: -2px -2px 5px var(--dark-gray-3), 2px 2px 8px var(--black-40), inset -1px -1px 2px var(--overlay-light), inset 1px 1px 3px var(--dark-gray-5);
}

body.dark-mode .conversation-item:hover {
    background: var(--quick-action-hover);
    box-shadow: -2px -2px 6px var(--dark-gray-5), 2px 2px 10px var(--black-50), inset -1px -1px 2px var(--overlay-light), inset 1px 1px 3px var(--dark-gray-8);
}

body.dark-mode .conversation-item:hover .conversation-title {
    color: var(--text-primary);
}

body.dark-mode .conversation-item:hover .conversation-preview {
    color: var(--text-muted);
}

body.dark-mode .conversation-item:hover .conversation-time {
    color: var(--text-muted);
}

body.dark-mode .conversation-item.active:hover {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

body.dark-mode .conversation-item.active:hover .conversation-preview {
    color: var(--white-80);
}

body.dark-mode .conversation-item.active:hover .conversation-time {
    color: var(--white-70);
}

body.dark-mode .conversation-time {
    color: var(--text-muted);
}

body.dark-mode .quick-action-item {
    box-shadow: -2px -2px 5px var(--dark-gray-3), 2px 2px 8px var(--black-40), inset -1px -1px 2px var(--overlay-light), inset 1px 1px 3px var(--dark-gray-5);
}

body.dark-mode .quick-action-item:hover {
    background: var(--accent);
    color: var(--white);
    box-shadow: -2px -2px 6px var(--dark-gray-5), 2px 2px 10px var(--black-50), 0 0 15px var(--accent-10);
}

body.dark-mode .input-wrapper {
    box-shadow: -2px -2px 6px var(--dark-gray-3), 2px 2px 10px var(--black-40), inset -2px -2px 4px var(--overlay-light), inset 2px 2px 5px var(--dark-gray-3);
}

body.dark-mode .input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-20), -2px -2px 6px var(--dark-gray-5), 2px 2px 10px var(--black-50), inset -2px -2px 4px var(--overlay-light), inset 2px 2px 5px var(--dark-gray-5);
}

body.dark-mode .new-chat-btn {
    box-shadow: -2px -2px 6px var(--dark-gray-5), 2px 2px 10px var(--black-50), inset -2px -2px 4px var(--overlay-light), inset 2px 2px 6px var(--white-10);
}

body.dark-mode .new-chat-btn:hover {
    box-shadow: -2px -2px 6px var(--dark-gray-8), 2px 2px 12px var(--black-60), 0 0 20px var(--accent-15), inset -2px -2px 4px var(--overlay-light), inset 2px 2px 6px var(--white-10);
}

body.dark-mode .sidebar-footer {
    border-top-color: var(--border-color);
}

body.dark-mode .sidebar-action-btn {
    box-shadow: -2px -2px 6px var(--dark-gray-5), 2px 2px 10px var(--black-50), inset -2px -2px 4px var(--overlay-light), inset 2px 2px 6px var(--white-10);
}

body.dark-mode .sidebar-action-btn:hover {
    box-shadow: -2px -2px 6px var(--dark-gray-8), 2px 2px 12px var(--black-60), 0 0 20px var(--accent-15), inset -2px -2px 4px var(--overlay-light), inset 2px 2px 6px var(--white-10);
}

body.dark-mode .welcome-text h4 {
    color: var(--accent-light);
}

body.dark-mode .welcome-text p,
body.dark-mode .welcome-text li {
    color: var(--text-secondary);
}

body.dark-mode .message-bubble h1,
body.dark-mode .message-bubble h2,
body.dark-mode .message-bubble h3 {
    color: var(--text-primary);
}

body.dark-mode .message-bubble strong {
    color: var(--text-primary);
}

body.dark-mode .message-bubble code {
    background: var(--dark-gray-10);
    color: var(--error-light);
    border: 1px solid var(--dark-gray-20);
}

body.dark-mode .message-bubble pre {
    background: var(--pre-dark);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

body.dark-mode .markdown-table {
    background: var(--bubble-bg);
    border-color: var(--border-color);
}

body.dark-mode .markdown-table thead {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

body.dark-mode .markdown-table tbody tr:nth-child(even) {
    background-color: var(--dark-gray-3);
}

body.dark-mode .markdown-table tbody tr:hover {
    background-color: var(--dark-gray-8);
}

body.dark-mode .markdown-table tbody td {
    border-bottom-color: var(--border-color);
    color: var(--text-secondary);
}

body.dark-mode .markdown-blockquote {
    background: var(--accent-15);
    border-left-color: var(--accent-light);
    color: var(--text-primary);
}

body.dark-mode .chat-link {
    background: var(--accent-15);
    border-color: var(--link-border);
    box-shadow: -1px -1px 2px var(--dark-gray-5), 1px 1px 4px var(--black-30), inset -0.5px -0.5px 1px var(--overlay-light), inset 1px 1px 2px var(--accent-10);
}

body.dark-mode .chat-link:hover {
    background: var(--accent-25);
    box-shadow: -2px -2px 4px var(--dark-gray-8), 2px 2px 8px var(--black-40), 0 0 10px var(--accent-20);
}

body.dark-mode #user-input::placeholder {
    color: var(--text-muted);
}

body.dark-mode #send-button {
    box-shadow: -2px -2px 6px var(--dark-gray-5), 2px 2px 10px var(--black-50), inset -2px -2px 4px var(--overlay-light), inset 2px 2px 6px var(--white-10);
}

body.dark-mode #send-button:hover {
    box-shadow: -2px -2px 6px var(--dark-gray-8), 2px 2px 12px var(--black-60), 0 0 20px var(--accent-15), inset -2px -2px 4px var(--overlay-light), inset 2px 2px 6px var(--white-10);
}

body.dark-mode .scroll-to-bottom {
    box-shadow: -2px -2px 6px var(--dark-gray-5), 2px 2px 10px var(--black-50), 0 4px 20px var(--accent-20), inset -2px -2px 4px var(--overlay-light), inset 2px 2px 6px var(--white-10);
}

body.dark-mode .scroll-to-bottom:hover {
    box-shadow: -2px -2px 6px var(--dark-gray-8), 2px 2px 12px var(--black-60), 0 6px 24px var(--accent-25), inset -2px -2px 4px var(--overlay-light), inset 2px 2px 6px var(--white-10);
}

@media (max-width: 768px) {
    html {
        height: 100%;
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    body {
        height: 100%;
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    .chat-container {
        margin-left: 0;
        height: 100%;
        overflow: hidden;
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
        display: flex;
        flex-direction: column;
    }

    .chat-header {
        flex-shrink: 0;
    }

    .chat-messages {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .quick-actions {
        flex-shrink: 0;
    }

    .chat-input-container {
        flex-shrink: 0;
        position: relative;
    }

    .sidebar {
        -webkit-transform: translateX(-100%);
        transform: translateX(-100%);
        position: fixed;
        height: 100%;
    }

    .sidebar.active {
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-close {
        display: flex;
    }

    .sidebar-footer {
        display: flex;
    }

    .header-actions {
        display: none !important;
    }

    .conversation-delete {
        opacity: 1;
    }

    .scroll-to-bottom {
        bottom: 100px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: var(--font-lg);
    }

    .sidebar-header {
        padding: 15px 20px;
        min-height: 72px;
    }

    .chat-header {
        padding: 15px 20px;
        min-height: 72px;
    }

    .header-content {
        gap: 15px;
    }

    .header-info h3 {
        font-size: var(--font-lg);
    }

    .status {
        font-size: var(--font-xs);
    }

    .quick-actions {
        padding: 15px 20px;
        gap: 10px;
    }

    .chat-input-container {
        padding: 15px 20px;
    }

    .user-message,
    .bot-message {
        max-width: 100%;
    }

    .header-actions {
        gap: 5px;
    }

    .action-btn {
        width: 36px;
        height: 36px;
        font-size: var(--font-sm);
    }

    .markdown-table-wrapper {
        margin: 10px -5px;
        border-radius: 20px;
    }

    .markdown-table {
        font-size: var(--font-xs);
    }

    .markdown-table thead th,
    .markdown-table tbody td {
        padding: 10px 12px;
    }

    .markdown-table thead th {
        font-size: var(--font-xs);
    }

    .markdown-blockquote {
        padding: 10px 15px;
        margin: 10px 0;
        font-size: var(--font-xs);
    }

    .markdown-image {
        margin: 10px 0;
        max-width: 100%;
    }

    .message-bubble pre {
        font-size: var(--font-2xs);
        overflow-x: auto;
        padding: 10px;
    }

    .message-bubble {
        font-size: var(--font-sm);
    }
}

@media (max-width: 480px) {
    .chat-container {
        max-height: 100%;
    }

    .chat-header {
        padding: 12px 15px;
    }

    .header-content {
        gap: 10px;
    }

    .header-left {
        gap: 12px;
    }

    .sidebar-toggle {
        width: 32px;
        height: 32px;
        font-size: var(--font-sm);
    }

    .sidebar-close {
        width: 32px;
        height: 32px;
        font-size: var(--font-sm);
    }

    .bot-avatar {
        width: 40px;
        height: 40px;
        font-size: var(--font-sm);
    }

    .header-info h3 {
        font-size: var(--font-base);
        margin-bottom: 3px;
    }

    .status {
        font-size: var(--font-2xs);
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }

    .header-actions {
        gap: 5px;
    }

    .action-btn {
        width: 32px;
        height: 32px;
        font-size: var(--font-xs);
    }

    .chat-messages {
        padding: 12px;
    }

    .message {
        margin-bottom: 10px;
    }

    .message-bubble {
        padding: 12px 16px;
        font-size: var(--font-sm);
        border-radius: 20px;
        line-height: 1.6;
    }

    .message-bubble h1 {
        font-size: var(--font-base);
    }

    .message-bubble h2 {
        font-size: var(--font-md);
    }

    .message-bubble h3 {
        font-size: var(--font-sm);
    }

    .message-time {
        font-size: var(--font-3xs);
        margin-top: 6px;
    }

    .welcome-text h4 {
        font-size: var(--font-md);
    }

    .welcome-text p {
        font-size: var(--font-sm);
    }

    .welcome-text li {
        font-size: var(--font-sm);
        margin-bottom: 6px;
    }

    .quick-actions {
        padding: 12px 15px;
        gap: 8px;
    }

    .quick-action-item {
        padding: 10px 14px;
        font-size: var(--font-xs);
        border-radius: 20px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .quick-action-item i {
        font-size: var(--font-sm);
    }

    .chat-input-container {
        padding: 12px 15px;
    }

    .input-wrapper {
        padding: 4px;
        border-radius: 25px;
    }

    .attachment-btn {
        width: 36px;
        height: 36px;
        font-size: var(--font-sm);
    }

    #user-input {
        padding: 10px 12px;
    }

    #send-button {
        width: 40px;
        height: 40px;
        font-size: var(--font-sm);
    }

    .markdown-table-wrapper {
        margin: 10px -6px;
        border-radius: 15px;
    }

    .markdown-table {
        font-size: var(--font-3xs);
        display: block;
        overflow-x: auto;
    }

    .markdown-table thead th,
    .markdown-table tbody td {
        padding: 8px 10px;
        font-size: var(--font-3xs);
        white-space: nowrap;
        min-width: 80px;
    }

    .markdown-blockquote {
        padding: 8px 12px;
        margin: 8px 0;
        font-size: var(--font-xs);
        border-radius: 0 20px 20px 0;
    }

    .markdown-image {
        margin: 8px 0;
        border-radius: 20px;
    }

    .message-bubble pre {
        font-size: var(--font-3xs);
        padding: 10px;
        border-radius: 15px;
        margin: 8px 0;
    }

    .message-bubble code {
        font-size: var(--font-3xs);
        padding: 2px 5px;
    }

    .message-bubble ul,
    .message-bubble ol {
        padding-left: 18px;
    }

    .message-bubble li {
        margin-bottom: 4px;
        font-size: var(--font-sm);
    }

    .chat-link {
        padding: 3px 6px;
        font-size: var(--font-xs);
    }

    .chat-link i {
        font-size: var(--font-3xs);
    }
}

@media (max-width: 360px) {
    .header-info h3 {
        font-size: var(--font-sm);
    }

    .status {
        font-size: var(--font-3xs);
    }

    .action-btn {
        width: 30px;
        height: 30px;
        font-size: var(--font-2xs);
    }

    .message-bubble {
        padding: 10px 14px;
        font-size: var(--font-xs);
    }

    .quick-action-item {
        padding: 8px 12px;
        font-size: var(--font-2xs);
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .chat-header {
        padding: 10px 20px;
    }

    .bot-avatar {
        width: 40px;
        height: 40px;
    }

    .header-info h3 {
        font-size: var(--font-md);
    }

    .status {
        font-size: var(--font-3xs);
    }

    .chat-messages {
        padding: 15px 20px;
    }

    .message-bubble {
        padding: 10px 14px;
    }

    .quick-actions {
        padding: 10px 20px;
    }

    .chat-input-container {
        padding: 10px 20px;
    }
}

@media (max-width: 768px) {
    #user-input {
        font-size: var(--font-base);
    }

    .chat-messages {
        overscroll-behavior-y: contain;
        position: relative;
        will-change: scroll-position;
    }

    #user-input:focus {
        transform: translateZ(0);
    }
}

@supports (-webkit-touch-callout: none) {
    html {
        height: 100%;
        position: fixed;
        width: 100%;
    }

    body {
        height: 100%;
        min-height: 100%;
        position: fixed;
        width: 100%;
    }

    .sidebar {
        height: 100%;
    }

    .chat-container {
        height: 100%;
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
    }

    .sidebar-overlay,
    .confirm-modal-overlay {
        height: 100%;
    }

    .chat-input-container {
        padding-bottom: calc(25px + env(safe-area-inset-bottom));
    }

    .quick-actions {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        .chat-messages {
            padding-bottom: calc(20px + env(safe-area-inset-bottom));
            overscroll-behavior: contain;
        }

        .scroll-to-bottom {
            bottom: calc(100px + env(safe-area-inset-bottom));
        }

        .sidebar {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }

    @media (max-width: 480px) {
        .chat-input-container {
            padding-bottom: calc(12px + env(safe-area-inset-bottom));
        }

        .chat-messages {
            padding-bottom: calc(12px + env(safe-area-inset-bottom));
        }
    }
}

button,
input,
select,
textarea {
    touch-action: manipulation;
}

*:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--warning);
    outline-offset: 3px;
}

.chat-messages,
.conversations-list,
.quick-actions {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.chat-link.loading {
    opacity: 0.7;
    pointer-events: none;
}

.chat-link.loading::after {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    margin-left: 4px;
}

.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-dark);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.confirm-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-modal {
    background: var(--chat-bg);
    border-radius: var(--radius-xl);
    padding: 35px;
    max-width: 450px;
    width: 90%;
    box-shadow: var(--shadow-modal);
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition-base);
}

.confirm-modal-overlay.active .confirm-modal {
    transform: scale(1) translateY(0);
}

.confirm-modal-icon {
    width: var(--size-modal-icon);
    height: var(--size-modal-icon);
    margin: 0 auto 25px;
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-3xl);
    color: var(--white);
    box-shadow: var(--shadow-modal-icon);
    animation: modalIconPulse 2s ease-in-out infinite;
}

@keyframes modalIconPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.confirm-modal-content {
    text-align: center;
    margin-bottom: 30px;
}

.confirm-modal-title {
    font-size: var(--font-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.confirm-modal-message {
    font-size: var(--font-md);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.confirm-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-xl);
    font-size: var(--font-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-base);
    min-width: 120px;
}

.confirm-btn i {
    font-size: var(--font-base);
}

.confirm-btn-cancel {
    background: var(--bubble-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-neumorphic);
}

.confirm-btn-cancel:hover {
    background: var(--quick-action-hover);
    border-color: var(--cancel-hover-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-neumorphic-hover);
}

.confirm-btn-cancel:active {
    transform: translateY(0);
}

.confirm-btn-confirm {
    background: linear-gradient(135deg, var(--error) 0%, var(--error-dark) 100%);
    color: var(--white);
    box-shadow: var(--shadow-error-btn);
}

.confirm-btn-confirm:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-error-btn-hover);
}

.confirm-btn-confirm:active {
    transform: translateY(0) scale(1);
}

body.dark-mode .confirm-modal {
    box-shadow: -5px -5px 15px var(--dark-gray-5), 5px 5px 20px var(--black-80), 0 10px 40px var(--overlay-dark), inset -2px -2px 6px var(--overlay-light), inset 3px 3px 8px var(--dark-gray-5);
}

body.dark-mode .confirm-modal-icon {
    box-shadow: -3px -3px 8px var(--dark-gray-5), 3px 3px 12px var(--black-60), 0 4px 20px var(--warning-20), inset -2px -2px 4px var(--overlay-light), inset 3px 3px 6px var(--white-10);
}

body.dark-mode .confirm-btn-cancel {
    background: var(--bubble-bg);
    border-color: var(--border-color);
    box-shadow: -2px -2px 6px var(--dark-gray-5), 2px 2px 10px var(--black-60), inset -1px -1px 3px var(--overlay-light), inset 2px 2px 5px var(--dark-gray-5);
}

body.dark-mode .confirm-btn-cancel:hover {
    background: var(--quick-action-hover);
    border-color: var(--text-muted);
    box-shadow: -2px -2px 6px var(--dark-gray-8), 2px 2px 12px var(--black-70), inset -1px -1px 3px var(--overlay-light), inset 2px 2px 5px var(--dark-gray-8);
}

body.dark-mode .confirm-btn-confirm {
    box-shadow: -3px -3px 8px var(--dark-gray-5), 3px 3px 12px var(--black-60), 0 4px 20px var(--accent-20), inset -2px -2px 4px var(--overlay-light), inset 3px 3px 6px var(--white-10);
}

body.dark-mode .confirm-btn-confirm:hover {
    box-shadow: -4px -4px 10px var(--dark-gray-8), 4px 4px 16px var(--black-70), 0 6px 24px var(--accent-25), inset -2px -2px 5px var(--overlay-light), inset 3px 3px 8px var(--white-10);
}

@media (max-width: 480px) {
    .confirm-modal {
        padding: 25px;
        max-width: 90%;
    }

    .confirm-modal-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
        margin-bottom: 20px;
    }

    .confirm-modal-title {
        font-size: var(--font-lg);
        margin-bottom: 10px;
    }

    .confirm-modal-message {
        font-size: var(--font-sm);
    }

    .confirm-modal-actions {
        flex-direction: column;
        gap: 12px;
    }

    .confirm-btn {
        width: 100%;
        padding: 12px 20px;
    }
}

.streaming-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: baseline;
    border-radius: 2px;
}

@keyframes blink {
    0%,
    50% {
        opacity: 1;
    }
    51%,
    100% {
        opacity: 0;
    }
}

body.dark-mode .streaming-cursor {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
}

.help-modal {
    background: var(--chat-bg);
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    padding: 0;
    width: 420px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    box-shadow: var(--shadow-help-modal);
    transform: translateX(100%);
    transition: transform var(--transition-smooth);
    z-index: 10001;
}

.help-modal-overlay.active .help-modal {
    transform: translateX(0);
}

.help-modal-header {
    min-height: 91px;
    padding: 25px 30px;
    border-radius: var(--radius-xl) 0 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-help-header);
}

.help-modal-header::before {
    border-radius: 30px 0 0 0;
}

.help-modal-header h3 {
    font-size: var(--font-xl);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.help-modal-close {
    position: relative;
    z-index: 1;
}

.help-modal-close:hover {
    background: var(--white-30);
    transform: scale(1.05);
    box-shadow: var(--shadow-icon-btn-hover);
}

.help-modal-content {
    padding: 30px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.help-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-section h4 {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section h4 i {
    color: var(--accent);
    font-size: var(--font-lg);
}

.help-section li strong {
    color: var(--text-primary);
    font-weight: 600;
    padding: 2px 6px;
    background: var(--accent-10);
    border-radius: var(--radius-xl);
    font-size: var(--font-xs);
}

.help-icon {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border: none;
    border-radius: var(--radius-full);
    color: var(--white) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    transition: all var(--transition-base);
    position: relative;
    vertical-align: middle;
    margin: 0 3px;
    flex-shrink: 0;
    z-index: 1;
    box-shadow: var(--shadow-help-icon);
}

.help-icon::before {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
}

body.dark-mode .help-section {
    border-bottom-color: var(--border-color);
}

body.dark-mode .help-section li strong {
    background: var(--help-strong-bg);
}

@media (max-width: 768px) {
    .help-modal {
        width: 85%;
        max-width: 360px;
    }

    .help-modal-header {
        min-height: 72px;
        padding: 15px 20px;
    }

    .help-modal-header h3 {
        font-size: var(--font-lg);
        gap: 8px;
    }

    .help-modal-header h3 i {
        font-size: var(--font-base);
    }

    .help-modal-content {
        padding: 20px;
    }

    .help-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .help-section h4 {
        font-size: var(--font-md);
        gap: 6px;
    }

    .help-section h4 i {
        font-size: var(--font-base);
    }

    .help-section li {
        font-size: var(--font-sm);
        padding: 6px 0 6px 20px;
    }

    .help-section li strong {
        font-size: var(--font-2xs);
        padding: 1px 5px;
    }

    .help-icon {
        width: 20px;
        height: 20px;
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .help-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }

    .help-modal-header {
        min-height: 64px;
        padding: 12px 15px;
        border-radius: 0;
    }

    .help-modal-header::before {
        border-radius: 0;
    }

    .help-modal-header h3 {
        font-size: var(--font-base);
        gap: 6px;
    }

    .help-modal-header h3 i {
        font-size: var(--font-sm);
    }

    .help-modal-close {
        width: 32px;
        height: 32px;
        font-size: var(--font-sm);
    }

    .help-modal-content {
        padding: 15px;
    }

    .help-section {
        margin-bottom: 18px;
        padding-bottom: 12px;
    }

    .help-section h4 {
        font-size: var(--font-sm);
        margin-bottom: 10px;
        gap: 5px;
    }

    .help-section h4 i {
        font-size: var(--font-sm);
    }

    .help-section li {
        font-size: var(--font-xs);
        padding: 5px 0 5px 18px;
        line-height: 1.5;
    }

    .help-section li::before {
        font-size: var(--font-2xs);
    }

    .help-section li strong {
        font-size: var(--font-3xs);
        padding: 1px 4px;
    }

    .help-icon {
        width: 18px;
        height: 18px;
        font-size: 8px;
        margin: 0 2px;
    }
}

@media (max-width: 360px) {
    .help-modal-header {
        min-height: 60px;
        padding: 10px 12px;
    }

    .help-modal-header h3 {
        font-size: var(--font-md);
    }

    .help-modal-close {
        width: 28px;
        height: 28px;
        font-size: var(--font-2xs);
    }

    .help-modal-content {
        padding: 12px;
    }

    .help-section {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .help-section h4 {
        font-size: var(--font-xs);
        margin-bottom: 8px;
    }

    .help-section li {
        font-size: var(--font-2xs);
        padding: 4px 0 4px 16px;
    }
}
