/* Harvey AI Shared Styles */

/* Sidebar container - prevents flash on page load */
#sidebarContainer {
    width: 76px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
}

/* Sidebar base styles */
.sidebar {
    width: 76px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 16px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    background: var(--bg-primary, #ffffff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.new-chat-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
    background: transparent;
    border: 1px dashed #9ca3af;
    text-decoration: none;
}

.new-chat-btn:hover {
    background: var(--bg-primary, #ffffff);
    border-style: solid;
    border-color: #6b7280;
    color: #374151;
}

.new-chat-btn svg {
    width: 20px;
    height: 20px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-secondary, #62646a);
    text-decoration: none;
}

.nav-item:hover, .nav-item.active {
    background: var(--bg-primary, #ffffff);
    color: var(--text-primary, #151515);
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.sidebar-divider {
    width: 32px;
    height: 1px;
    background: var(--border-primary, #e5e5e5);
    margin: 4px 0;
}

.nav-text-link {
    font-size: 12px;
    color: var(--text-secondary, #62646a);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-text-link:hover, .nav-text-link.active {
    color: var(--text-primary, #151515);
}

/* Header base styles */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    flex-shrink: 0;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.harvey-dropdown {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #151515);
    cursor: pointer;
}

.harvey-dropdown svg {
    width: 16px;
    height: 16px;
}

.header-new-chat-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #005294;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.header-new-chat-btn:hover {
    background: #004177;
}

.header-new-chat-btn svg {
    width: 16px;
    height: 16px;
}

.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #005294;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.user-avatar-btn:hover {
    transform: scale(1.05);
}

.avatar-letter {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* Sidebar logo H */
.logo-h {
    font-size: 24px;
    font-weight: 700;
    color: #005294;
    font-family: 'Inter', sans-serif;
}

.sidebar-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0);
}

/* Theme switch toggle */
.theme-switch {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.theme-slider {
    width: 44px;
    height: 24px;
    background: #e5e5e5;
    border-radius: 12px;
    position: relative;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    padding: 0 4px;
}

.theme-switch input:checked + .theme-slider {
    background: #005294;
}

.theme-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.theme-switch input:checked + .theme-slider::after {
    transform: translateX(20px);
}

.theme-icon {
    width: 12px;
    height: 12px;
    position: absolute;
    z-index: 1;
}

.theme-icon.sun {
    left: 6px;
    color: #666;
}

.theme-switch input:checked + .theme-slider .theme-icon.sun {
    color: white;
}

/* Sidebar new chat button */
.sidebar-new-chat {
    width: 40px;
    height: 40px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-primary, #ecedee);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-new-chat:hover {
    background: var(--bg-secondary, #f7f7f7);
}

.sidebar-new-chat svg {
    width: 20px;
    height: 20px;
    stroke: #005294;
}

/* User avatar with coral ring */
.user-avatar-ring {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #FF6B6B;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.user-avatar-ring .user-avatar {
    width: 100%;
    height: 100%;
    margin: 0;
}

/* Hide modal overlay by default - show only when .active class is added */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

/* Hide user menu by default - show only when .open class is added */
.user-menu {
    display: none;
    position: fixed;
    top: 60px;
    right: 20px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-primary, #ecedee);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    min-width: 200px;
    padding: 8px 0;
}

.user-menu.open {
    display: block;
}

.user-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.user-menu-overlay.open {
    display: block;
}

.user-menu-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-primary, #ecedee);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #005294;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.user-menu-info {
    display: flex;
    flex-direction: column;
}

.user-menu-name {
    font-weight: 600;
    color: var(--text-primary, #151515);
}

.user-menu-email {
    font-size: 12px;
    color: var(--text-secondary, #62646a);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-primary, #151515);
    cursor: pointer;
    transition: background 0.2s;
}

.user-menu-item:hover {
    background: var(--bg-secondary, #f7f7f7);
}

.user-menu-item.danger {
    color: var(--text-primary, #151515);
}

.user-menu-item svg {
    width: 18px;
    height: 18px;
}

/* History sidebar - sits between main sidebar and content */
.history-sidebar {
    position: fixed;
    top: 0;
    left: 76px;
    width: 280px;
    height: 100vh;
    background: var(--bg-primary, #ffffff);
    border-right: 1px solid var(--border-primary, #ecedee);
    z-index: 50;
    transform: translateX(-280px);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s ease;
    display: flex;
    flex-direction: column;
}

.history-sidebar.open {
    transform: translateX(0);
    visibility: visible;
}

.history-sidebar.pinned {
    transform: translateX(0);
    visibility: visible;
}

/* History sidebar pin button */
.history-pin-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary, #62646a);
    transition: all 0.2s;
}

.history-pin-btn:hover {
    background: var(--bg-secondary, #f7f7f7);
    color: var(--text-primary, #151515);
}

.history-pin-btn.active {
    color: #005294;
    background: rgba(0, 82, 148, 0.1);
}

.history-pin-btn svg {
    width: 16px;
    height: 16px;
}

/* When history sidebar is open, push main content */
body.history-open .main-container {
    margin-left: 356px;
    width: calc(100% - 356px);
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.main-container {
    width: calc(100% - 76px);
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.history-overlay {
    display: none;
}

.history-overlay.open {
    display: none;
}

/* Modal styling */
.modal {
    background: var(--bg-primary, #ffffff);
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary, #ecedee);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #151515);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-secondary, #62646a);
}

.modal-close:hover {
    background: var(--bg-secondary, #f7f7f7);
}

.modal-body {
    padding: 24px;
}

/* Header user avatar ring - blue style matching reference */
.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #005294;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.header-avatar:hover {
    transform: scale(1.05);
}

/* Hide new chat button in header - moved to sidebar */
.header-right .new-chat-btn {
    display: none !important;
}

/* Simplified header styles */
.chat-header {
    padding: 20px 24px !important;
}

.header-left .model-selector {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 8px 12px !important;
}

.header-left .model-selector:hover {
    background: var(--bg-secondary) !important;
}

/* Auth buttons in header */
.auth-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.auth-btn-secondary {
    background: transparent;
    color: var(--text-primary, #151515);
    border: 1px solid var(--border-primary, #ecedee);
}

.auth-btn-secondary:hover {
    background: var(--bg-secondary, #f7f7f7);
    border-color: var(--text-tertiary, #8a8d93);
}

.auth-btn-primary {
    background: #005294;
    color: white;
    border: 1px solid #005294;
}

.auth-btn-primary:hover {
    background: #004175;
    border-color: #004175;
}

/* User dropdown menu */
.user-dropdown {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 220px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-primary, #ecedee);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    overflow: hidden;
}

.dropdown-header {
    padding: 12px 16px;
}

.dropdown-email {
    font-size: 13px;
    color: var(--text-secondary, #62646a);
    word-break: break-all;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-primary, #ecedee);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary, #151515);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-secondary, #f7f7f7);
}

.dropdown-item i {
    color: var(--text-tertiary, #8a8d93);
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

/* Ticker Search Component */
.ticker-search-container {
    position: relative;
    width: 450px;
}

.ticker-search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-primary, #ecedee);
    border-radius: 24px;
    font-size: 14px;
    background: var(--bg-primary, #ffffff);
    color: var(--text-primary, #151515);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ticker-search-input:focus {
    border-color: var(--accent-blue, #005294);
    box-shadow: 0 0 0 3px rgba(0, 82, 148, 0.1);
}

.ticker-search-input::placeholder {
    color: var(--text-tertiary, #8a8d93);
}

.ticker-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary, #8a8d93);
    pointer-events: none;
}

.ticker-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-primary, #ecedee);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.ticker-search-dropdown.active {
    display: block;
}

.ticker-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.ticker-search-result:first-child {
    border-radius: 16px 16px 0 0;
}

.ticker-search-result:last-child {
    border-radius: 0 0 16px 16px;
}

.ticker-search-result:hover {
    background: var(--bg-secondary, #f7f7f7);
}

.ticker-search-result-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ticker-search-symbol {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary, #151515);
    min-width: 60px;
}

.ticker-search-name {
    font-size: 14px;
    color: var(--text-secondary, #62646a);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticker-search-exchange {
    font-size: 12px;
    color: var(--text-tertiary, #8a8d93);
    padding: 2px 8px;
    background: var(--bg-secondary, #f7f7f7);
    border-radius: 4px;
}

.ticker-search-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary, #8a8d93);
    font-size: 14px;
}

.ticker-search-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary, #8a8d93);
    font-size: 14px;
}

/* Add to Watchlist Modal */
.watchlist-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

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

.watchlist-modal {
    background: var(--bg-primary, #ffffff);
    border-radius: 24px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.watchlist-modal-overlay.active .watchlist-modal {
    transform: scale(1);
}

.watchlist-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary, #ecedee);
}

.watchlist-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #151515);
}

.watchlist-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-secondary, #f7f7f7);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary, #62646a);
    transition: all 0.2s;
}

.watchlist-modal-close:hover {
    background: var(--border-primary, #ecedee);
    color: var(--text-primary, #151515);
}

.watchlist-modal-body {
    padding: 20px 24px;
    max-height: 50vh;
    overflow-y: auto;
}

.watchlist-modal-search {
    position: relative;
    margin-bottom: 20px;
}

.watchlist-modal-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--border-primary, #ecedee);
    border-radius: 12px;
    font-size: 14px;
    background: var(--bg-primary, #ffffff);
    color: var(--text-primary, #151515);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.watchlist-modal-search-input:focus {
    border-color: #005294;
    box-shadow: 0 0 0 3px rgba(0, 82, 148, 0.1);
}

.watchlist-modal-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary, #8a8d93);
}

.watchlist-modal-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-primary, #ecedee);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.watchlist-modal-search-results.active {
    display: block;
}

.watchlist-modal-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.watchlist-modal-search-result:hover {
    background: var(--bg-secondary, #f7f7f7);
}

.watchlist-modal-search-result-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.watchlist-modal-search-symbol {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #151515);
    min-width: 50px;
}

.watchlist-modal-search-name {
    font-size: 13px;
    color: var(--text-secondary, #62646a);
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.watchlist-modal-selected {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #e8f4fc;
    border-radius: 12px;
    margin-bottom: 20px;
}

[data-theme="dark"] .watchlist-modal-selected {
    background: rgba(0, 82, 148, 0.2);
}

.watchlist-modal-selected-symbol {
    font-size: 18px;
    font-weight: 600;
    color: #005294;
}

.watchlist-modal-selected-name {
    font-size: 14px;
    color: var(--text-secondary, #62646a);
}

.watchlist-modal-selected-remove {
    margin-left: auto;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary, #8a8d93);
    transition: color 0.2s;
}

.watchlist-modal-selected-remove:hover {
    color: #ef4444;
}

.watchlist-modal-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #62646a);
    margin-bottom: 10px;
}

.watchlist-modal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.watchlist-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary, #f7f7f7);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.watchlist-modal-item:hover {
    border-color: var(--border-primary, #ecedee);
}

.watchlist-modal-item.selected {
    border-color: #005294;
    background: #e8f4fc;
}

[data-theme="dark"] .watchlist-modal-item.selected {
    background: rgba(0, 82, 148, 0.2);
}

.watchlist-modal-item-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-primary, #ecedee);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.watchlist-modal-item.selected .watchlist-modal-item-radio {
    border-color: #005294;
    background: #005294;
}

.watchlist-modal-item.selected .watchlist-modal-item-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.watchlist-modal-item-info {
    flex: 1;
}

.watchlist-modal-item-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary, #151515);
}

.watchlist-modal-item-count {
    font-size: 13px;
    color: var(--text-tertiary, #8a8d93);
}

.watchlist-modal-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-tertiary, #8a8d93);
}

.watchlist-modal-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--text-tertiary, #8a8d93);
}

.watchlist-modal-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 16px;
    background: #005294;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.watchlist-modal-create-btn:hover {
    background: #003d70;
}

.watchlist-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border-primary, #ecedee);
}

.watchlist-modal-cancel-btn {
    flex: 1;
    padding: 12px 20px;
    background: var(--bg-secondary, #f7f7f7);
    color: var(--text-primary, #151515);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.watchlist-modal-cancel-btn:hover {
    background: var(--border-primary, #ecedee);
}

.watchlist-modal-add-btn {
    flex: 1;
    padding: 12px 20px;
    background: #005294;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.watchlist-modal-add-btn:hover:not(:disabled) {
    background: #003d70;
}

.watchlist-modal-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.watchlist-modal-add-btn.success {
    background: #22c55e;
}

/* ========================================
   SNACKBAR NOTIFICATION SYSTEM
   ======================================== */
.snackbar-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.snackbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--text-primary, #151515);
    color: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: 500;
    pointer-events: auto;
    animation: snackbar-in 0.3s ease-out;
    max-width: 400px;
}

.snackbar.snackbar-out {
    animation: snackbar-out 0.2s ease-in forwards;
}

.snackbar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.snackbar-message {
    flex: 1;
    line-height: 1.4;
}

.snackbar-action {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-transform: uppercase;
}

.snackbar-action:hover {
    background: rgba(255, 255, 255, 0.25);
}

.snackbar-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.snackbar-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Snackbar types */
.snackbar.snackbar-success {
    background: #16a34a;
}

.snackbar.snackbar-error {
    background: #dc2626;
}

.snackbar.snackbar-warning {
    background: #d97706;
}

.snackbar.snackbar-info {
    background: #005294;
}

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

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

/* ========================================
   SKELETON LOADING COMPONENTS
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, 
        var(--bg-secondary, #f7f7f7) 25%, 
        var(--bg-primary, #ffffff) 50%, 
        var(--bg-secondary, #f7f7f7) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 16px;
    border-radius: 4px;
}

.skeleton-text-sm {
    height: 12px;
    border-radius: 4px;
}

.skeleton-text-lg {
    height: 24px;
    border-radius: 6px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
    border-radius: 16px;
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.skeleton-table-row {
    display: grid;
    grid-template-columns: 40px 2fr 1fr 1fr 1fr 1fr 40px;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border-primary, #ecedee);
}

.skeleton-table-cell {
    height: 20px;
    border-radius: 4px;
}

.skeleton-button {
    height: 44px;
    border-radius: 12px;
}

.skeleton-image {
    border-radius: 12px;
    aspect-ratio: 16/9;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Skeleton variations for different content */
.skeleton-stock-row {
    display: grid;
    grid-template-columns: 40px 1fr 100px 80px 80px 100px 40px;
    gap: 16px;
    padding: 16px 24px;
    align-items: center;
    border-bottom: 1px solid var(--border-primary, #ecedee);
}

.skeleton-news-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-primary, #ecedee);
}

.skeleton-news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-chart {
    height: 200px;
    border-radius: 16px;
}

.skeleton-stat-card {
    padding: 20px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Follow-up questions */
.follow-up-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-primary, #ecedee);
}

.follow-up-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-primary, #ecedee);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary, #1a1a1a);
    cursor: pointer;
    transition: all 0.2s;
}

.follow-up-btn:hover {
    background: #005294;
    color: white;
    border-color: #005294;
}

.follow-up-btn:hover svg {
    stroke: white;
}

.follow-up-btn svg {
    flex-shrink: 0;
    stroke: #6b7280;
    transition: stroke 0.2s;
}

[data-theme="dark"] .follow-up-btn {
    background: var(--bg-secondary, #1e1e1e);
    border-color: var(--border-primary, #333);
}

[data-theme="dark"] .follow-up-btn:hover {
    background: #005294;
    border-color: #005294;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85%;
    height: 100%;
    background: var(--bg-primary, #ffffff);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-nav-overlay.active .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary, #ecedee);
}

.mobile-nav-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary, #666);
    border-radius: 8px;
}

.mobile-nav-close:hover {
    background: var(--bg-secondary, #f5f5f5);
}

.mobile-nav-links {
    flex: 1;
    padding: 16px 12px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-primary, #151515);
    text-decoration: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    background: var(--bg-secondary, #f5f5f5);
    color: #005294;
}

.mobile-nav-item svg {
    flex-shrink: 0;
    color: var(--text-secondary, #666);
}

.mobile-nav-item:hover svg,
.mobile-nav-item.active svg {
    color: #005294;
}

.mobile-nav-divider {
    height: 1px;
    background: var(--border-primary, #ecedee);
    margin: 12px 16px;
}

.mobile-auth-section {
    padding: 16px 20px;
    border-top: 1px solid var(--border-primary, #ecedee);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-auth-section .auth-btn {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
}

/* Dark mode for mobile nav */
[data-theme="dark"] .mobile-nav-content {
    background: var(--bg-primary, #1a1a1a);
}

[data-theme="dark"] .mobile-nav-header {
    border-color: var(--border-primary, #333);
}

[data-theme="dark"] .mobile-nav-divider {
    background: var(--border-primary, #333);
}

[data-theme="dark"] .mobile-auth-section {
    border-color: var(--border-primary, #333);
}

/* Mobile Navigation Toggle */
.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary, #151515);
    padding: 8px;
    border-radius: 8px;
}

.mobile-menu-toggle:hover {
    background: var(--bg-secondary, #f5f5f5);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Tablet styles (max-width: 1024px) */
@media (max-width: 1024px) {
    .main-content,
    .content-area,
    .page-content {
        margin-left: 76px;
        padding: 16px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid,
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile styles (max-width: 768px) */
@media (max-width: 768px) {
    /* Hide sidebar on mobile */
    .sidebar,
    #sidebarContainer {
        display: none;
    }
    
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* History sidebar mobile - full screen overlay */
    .history-sidebar {
        left: 0;
        width: 100%;
        max-width: 100%;
        transform: translateX(-100%);
        z-index: 1001;
    }
    
    .history-sidebar.open {
        transform: translateX(0);
    }
    
    .history-header {
        padding: 16px;
    }
    
    .history-header h3 {
        font-size: 18px;
    }
    
    .history-list {
        padding: 8px 12px;
    }
    
    .history-item {
        padding: 14px 12px;
        font-size: 15px;
        min-height: 48px;
    }
    
    .history-item-text {
        font-size: 14px;
    }
    
    .history-item-date {
        font-size: 12px;
    }
    
    .history-close-btn,
    .history-pin-btn {
        width: 40px;
        height: 40px;
    }
    
    /* Full width content */
    .main-content,
    .content-area,
    .page-content,
    .chat-container,
    .settings-container,
    .profile-container,
    .watchlist-container {
        margin-left: 0 !important;
        padding: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Header adjustments */
    .top-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .header-left,
    .header-right {
        gap: 8px;
    }
    
    .harvey-dropdown {
        font-size: 14px;
    }
    
    .header-new-chat-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .header-new-chat-btn span {
        display: none;
    }
    
    /* Typography scaling */
    h1, .page-title {
        font-size: 1.5rem !important;
    }
    
    h2, .section-title {
        font-size: 1.25rem !important;
    }
    
    h3 {
        font-size: 1.1rem !important;
    }
    
    /* Welcome section */
    .welcome-section,
    .welcome-content {
        padding: 20px 16px;
    }
    
    .welcome-text span:first-child {
        font-size: 1.5rem;
    }
    
    .welcome-text span:last-child {
        font-size: 1rem;
    }
    
    /* Chat input */
    .chat-input-container,
    .input-wrapper {
        padding: 12px;
        margin: 8px;
        border-radius: 16px;
    }
    
    .chat-input,
    #userInput {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    /* Message bubbles */
    .message {
        max-width: 95% !important;
        padding: 12px 14px;
        font-size: 15px;
    }
    
    /* Tables - horizontal scroll */
    .dividend-table,
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 13px;
    }
    
    .dividend-table th,
    .dividend-table td,
    table th,
    table td {
        padding: 8px 10px;
        white-space: nowrap;
    }
    
    /* Cards and grids */
    .stats-grid,
    .card-grid,
    .feature-grid,
    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .stat-card,
    .feature-card,
    .card {
        padding: 16px;
    }
    
    /* Watchlist table */
    .watchlist-table,
    .stock-table {
        font-size: 13px;
    }
    
    .watchlist-table th,
    .watchlist-table td,
    .stock-table th,
    .stock-table td {
        padding: 10px 8px;
    }
    
    /* Hide less important columns on mobile */
    .hide-mobile,
    .desktop-only {
        display: none !important;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-input,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 14px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Buttons - touch friendly */
    button,
    .btn,
    .button {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 15px;
    }
    
    /* Modal adjustments */
    .modal-content,
    .sheet-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Ticker modal */
    #tickerModal .modal-content {
        width: 95%;
        padding: 16px;
    }
    
    /* Video cards */
    .video-card {
        flex-direction: column !important;
        padding: 12px !important;
    }
    
    .video-card > div:first-child {
        width: 100% !important;
        height: 160px !important;
    }
    
    /* Follow-up questions */
    .follow-up-questions {
        flex-direction: column;
    }
    
    .follow-up-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Stock ticker strip */
    .stock-ticker {
        font-size: 12px;
    }
    
    /* Settings page */
    .settings-tabs,
    .tab-list {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .settings-tab,
    .tab-button {
        flex: 1 1 auto;
        min-width: 80px;
        padding: 8px 12px;
        font-size: 13px;
        text-align: center;
    }
    
    /* Profile page */
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .profile-avatar {
        margin: 0 auto;
    }
    
    /* Pricing cards */
    .pricing-card {
        padding: 20px;
    }
    
    .pricing-card .price {
        font-size: 2rem;
    }
    
    /* Footer */
    .footer,
    footer {
        padding: 20px 16px;
        text-align: center;
    }
    
    .footer-links,
    .footer-content {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Alert form */
    .alert-form,
    .notification-form {
        padding: 16px;
    }
    
    /* Skeleton loaders */
    .skeleton-stock-row {
        grid-template-columns: 40px 1fr 80px;
        gap: 8px;
        padding: 12px;
    }
}

/* Small mobile styles (max-width: 480px) */
@media (max-width: 480px) {
    .main-content,
    .content-area,
    .page-content {
        padding: 8px !important;
    }
    
    .top-header {
        padding: 8px 12px;
    }
    
    .welcome-text span:first-child {
        font-size: 1.25rem;
    }
    
    h1, .page-title {
        font-size: 1.3rem !important;
    }
    
    .message {
        max-width: 98% !important;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .stat-card,
    .card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    /* User avatar in header */
    .user-avatar-btn {
        width: 32px;
        height: 32px;
    }
    
    .avatar-letter {
        font-size: 12px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-item,
    .new-chat-btn,
    .icon-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Remove hover effects that don't work on touch */
    .nav-item:hover,
    .btn:hover,
    .card:hover {
        transform: none;
    }
    
    /* Add active states for touch feedback */
    .nav-item:active,
    .btn:active,
    .card:active {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .welcome-section {
        padding: 12px 16px;
    }
    
    .modal-content {
        max-height: 80vh;
    }
}

/* Global Scrolling Ticker Bar */
.global-ticker-bar {
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-primary, #ffffff);
    padding: 14px 0;
    min-height: 48px;
    box-sizing: border-box;
    margin: 0 24px;
}

.global-ticker-bar::before,
.global-ticker-bar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}

.global-ticker-bar::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-primary, #ffffff) 30%, transparent);
}

.global-ticker-bar::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-primary, #ffffff) 30%, transparent);
}

.global-ticker-bar .ticker-track {
    display: inline-flex;
    gap: 32px;
    white-space: nowrap;
    will-change: transform;
    animation: ticker-scroll 30s linear infinite;
}

.global-ticker-bar .ticker-track:hover {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.global-ticker-bar .ticker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 15px;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: all 0.2s;
}

.global-ticker-bar .ticker-item:hover .ticker-symbol {
    text-decoration: underline;
    color: #005294;
}

.global-ticker-bar .ticker-symbol {
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary, #111111);
    letter-spacing: 0.01em;
}

.global-ticker-bar .ticker-price {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-secondary, #475569);
}

.global-ticker-bar .ticker-change {
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 600;
    font-size: 20px;
}

.global-ticker-bar .ticker-change.up {
    color: #10b981;
}

.global-ticker-bar .ticker-change.down {
    color: #ef4444;
}

.global-ticker-bar .ticker-change svg {
    width: 14px;
    height: 14px;
}

/* Calendar-specific ticker labels */
.global-ticker-bar .ticker-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 2px;
}

.global-ticker-bar .ticker-label.ex-date {
    background: #fef2f2;
    color: #ef4444;
}

.global-ticker-bar .ticker-label.pay-date {
    background: #f0fdf4;
    color: #10b981;
}

.global-ticker-bar .ticker-label.declared {
    background: #fffbeb;
    color: #f59e0b;
}

[data-theme="dark"] .global-ticker-bar .ticker-label.ex-date {
    background: rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .global-ticker-bar .ticker-label.pay-date {
    background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .global-ticker-bar .ticker-label.declared {
    background: rgba(245, 158, 11, 0.15);
}

@media (max-width: 768px) {
    .global-ticker-bar {
        padding: 10px 0;
        margin: 0 12px;
        min-height: 40px;
    }
    .global-ticker-bar .ticker-item {
        font-size: 20px;
    }
    .global-ticker-bar .ticker-symbol {
        font-size: 20px;
    }
    .global-ticker-bar .ticker-price,
    .global-ticker-bar .ticker-change {
        font-size: 20px;
    }
}

/* Print styles */
@media print {
    .sidebar,
    #sidebarContainer,
    .mobile-menu-toggle,
    .chat-input-container,
    .follow-up-questions {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}
