:root {
    /* --- Color Variables --- */
    --background-dark: #212121;
    --background-darker: #1a1a1f;
    --text-color-light: #f0f0f0;
    --text-color-secondary: #dcdcdc;
    --primary-text-color: white;
    --link-color: #7ab6fe;
    --link-text-decoration: underline;
    --icon-color: #ffffff;
    --table-border-color: #ccc;

    /* Header Colors */
    --header-bg-color: #232323;
    --header-border-color: #2a2a2a;

    /* Content Colors */
    --content-bg-color: #141414;

    /* Scrollbar Colors */
    --scrollbar-track-color: rgba(46, 46, 46, 0);
    --scrollbar-thumb-color: #494949;

    /* Border and Radius */
    --border-radius-standard: 4px;
    --border-radius-circle: 50%;
    --border-radius-rounded: 16px;

    /* Transitions and Shadows */
    --transition-duration: 0.25s;
    --transition-smooth: 0.3s;
    --transition-speed: 0.3s;
    --shadow-base: 0px 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-normal: 4px 4px 15px rgba(0, 0, 0, 0.2);
    --shadow-hover: 2px 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-dark: rgba(0, 0, 0, 0.9);
    --artifact-panel-width: 760px;
    --artifact-panel-offset: 0px;

    /* Chatbox and Button Styles */
    --chatbox-border-color: rgba(255, 255, 255, 0.51);
    --button-bg-base: rgba(255, 255, 255, 0.09);
    --button-bg-hover: rgba(142, 142, 142, 0.43);

    /* Tooltip Colors */
    --tooltip-bg-color: rgba(0, 0, 0, 0.9);
    --tooltip-text-color: #ffffff;

    /* Edit Textarea Colors */
    --edit-textarea-bg: rgba(255, 255, 255, 0.05);
    --edit-textarea-border: rgba(255, 255, 255, 0.2);
    --edit-textarea-focus-bg: rgba(255, 255, 255, 0.276);
    --edit-textarea-focus-border: rgb(52, 52, 52);

    /* Layout Helpers */
    --left-sidebar-width: 260px;
    --right-sidebar-width: 320px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 56px;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --content-max-width: 880px;
    --chat-stage-max-width: 1200px;
    --composer-max-width: var(--content-max-width);
    --composer-shell-max-width: 760px;
    --composer-gutter: var(--space-5);
    --composer-reserved-height: 150px;
    --chat-shell-max-width: var(--chat-stage-max-width);
    --composer-mobile-height: 190px;
    --composer-side-pad: 0.95rem;
    --composer-font-size: 15px;
    --composer-line-height: 1.6;
    --composer-letter-spacing: 0.005em;
    --composer-font-weight: 400;
    --composer-padding-y: 0.4rem;
    --composer-padding-x: 0.65rem;
    --composer-radius: 24px;
    --composer-border-width: 1px;
    --composer-border-opacity: 0.15;
    --composer-bg-opacity: 0.95;
    --composer-min-lines: 1;
    --composer-max-lines: 6;
    --composer-line-height-em: calc(var(--composer-line-height) * 1em);
    --composer-single-line-height: 34px;
    --composer-locked-height: 48px;
    --composer-min-height: var(--composer-locked-height);
    --composer-max-height: calc(var(--composer-line-height-em) * var(--composer-max-lines) + 12px);
    --composer-white-space: pre-wrap;
    --composer-word-wrap: break-word;
    --composer-overflow-wrap: break-word;
    --composer-caret-color: currentColor;
    --composer-caret-width: 1px;
    --placeholder-opacity: 0.45;
    --placeholder-font-weight: 400;
    --composer-focus-border-opacity: 0.35;
    --composer-focus-shadow: none;
    --composer-selection-bg: rgba(255, 255, 255, 0.2);
    --composer-scrollbar-width: thin;
    --composer-scrollbar-opacity: 0.3;
    --composer-gap: 0.18rem;
    --composer-icon-size: 30px;
    --send-button-size: 30px;
    --composer-text-pad-right: 84px;
    --composer-text-pad-bottom: 34px;
    --send-button-radius: 999px;
    --send-button-gap: 0.4rem;
    --composer-disabled-opacity: 0.5;
    --mobile-composer-font-size: 16px;
    --mobile-composer-padding-y: 0.7rem;
    --mobile-composer-padding-x: 0.85rem;
    --composer-input-pad-y: 0.2rem;
    --composer-input-pad-x: 0.75rem;
    --composer-margin-top: 0.75rem;
    --composer-safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --composer-surface: rgba(48, 48, 48, 0.92);
    --composer-border-color: rgba(255, 255, 255, 0.1);
    --sidebar-bg: #0b0b10;
    --conversation-panel-bg: rgba(18, 18, 28, 0.92);
    --conversation-panel-border: rgba(255, 255, 255, 0.07);
    --conversation-panel-shadow: 0 30px 80px rgba(3, 3, 5, 0.55);
    --active-right-sidebar-width: 0px;
}

body.sidebar-collapsed {
    --sidebar-width: var(--sidebar-collapsed-width);
    --left-sidebar-width: var(--sidebar-collapsed-width);
}

body.right-sidebar-open {
    --active-right-sidebar-width: var(--right-sidebar-width);
}

/* Global Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

.message-header {
    width: 100%;
    max-width: 582px;
    height: 0px;
    padding: 0px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f9fa00;
    border-bottom: 1px solid #e9ecef00;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
}


/* --- Body Styling --- */
body, html {
    width: 100%;
    min-height: 100%;
    background-color: var(--background-dark);
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}

body {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden; /* DOAR #chat-scroll-region scrollează */
}

body,
.chat-shell__messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

body::-webkit-scrollbar,
.chat-shell__messages::-webkit-scrollbar {
    width: 12px;
}

body::-webkit-scrollbar-track,
.chat-shell__messages::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 999px;
}

body::-webkit-scrollbar-thumb,
.chat-shell__messages::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.15));
    border: 2px solid rgba(0, 0, 0, 0);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

body::-webkit-scrollbar-thumb:hover,
.chat-shell__messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.25));
}

.offline-status {
    display: none;
    margin: 0 auto 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 193, 7, 0.4);
    background: rgba(255, 193, 7, 0.12);
    color: var(--text-color-light);
    font-size: 0.95rem;
    line-height: 1.4;
    max-width: 36rem;
    text-align: center;
}

.offline-status.active {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.offline-status .offline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffc107;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.7);
}

.offline-status .offline-text {
    display: flex;
    flex-direction: column;
}

.offline-status .offline-heading {
    font-weight: 600;
    font-size: 0.95rem;
}

.offline-status .offline-detail {
    font-size: 0.85rem;
    color: var(--text-color-secondary);
}

/* Positioning .model-select-wrapper as a header for .chatbox */
.chatbox {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 2px solid transparent;
    background-color: transparent;
    color: inherit;
    border-radius: 0.8125rem;
    box-shadow: none;
    transition: width 0.3s ease, padding 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    min-height: 0;
}

/* When chat has messages, reset to normal flow */
.chatbox:has(#chat-display > *) {
    justify-content: flex-start;
    align-items: stretch;
}

/* Center greeting and options on home view */
.chatbox > .greeting-container,
.chatbox > .options {
    width: 100%;
    max-width: 48rem;
}

.page-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.1rem 0;
    color: #fff;
    font-size: 0.85rem;
}

.page-controls:not(.hidden) {
    opacity: 1;
}

.page-controls .page-counter {
    font-weight: 600;
}

.page-controls .page-nav {
    width: auto;
    height: auto;
    border: none;
    background: transparent;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-weight: 600;
}

.page-controls .page-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-controls .page-nav:not(:disabled):hover {
    text-decoration: underline;
}

.inline-page-controls {
    display: inline-flex;
    flex: 0 0 auto;
    margin: 0;
    justify-content: flex-start;
    font-size: 0.8rem;
    gap: 0.25rem;
    align-items: center;
    font-weight: 600;
    color: inherit;
    letter-spacing: 0.01em;
}

.message-bubble-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0;
    width: auto;
    margin: 0.1rem 0 0.4rem;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    flex-wrap: nowrap;
    position: relative;
}

.message-bubble-footer .inline-page-controls {
    order: 1;
}

.message.user-message .message-bubble-footer {
    align-self: flex-end;
    justify-content: flex-end;
    padding-right: 1.5rem;
}

.message.ai-message .message-bubble-footer {
    align-self: flex-start;
    justify-content: flex-start;
    padding-left: 0.5rem;
}

.message.user-message .message-bubble-footer .edit-button {
    margin-left: 0;
}

.message.ai-message .message-bubble-footer .edit-button {
    margin-left: 0.25rem;
}

.arrow-down {
    position: absolute; /* Positioned within its container */
    cursor: pointer;
    z-index: 2;
    bottom: calc(100% + 0.75rem); /* Position above the element it relates to */
    width: 2rem; /* Width of the arrow button */
    height: 2rem; /* Height of the arrow button */
    border-radius: 50%; /* Circular button */
    background-color: rgba(39, 33, 33, 0.797); /* Semi-transparent background */
    color: var(--icon-color); /* Icon color */
    font-size: 1.125rem; /* Size of the arrow icon */
    display: flex; /* Center content within the button */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    border: 1px solid rgba(255, 255, 255, 0.35); /* Subtle border for contrast */
    text-align: center; /* Aligns any text content centrally */
    line-height: 1.875rem; /* Adjusts the icon alignment */
    transition: all var(--transition-duration) ease; /* Smooth transitions */
    margin-left: 0; /* Resets any margin */
    left: 50%; /* Start at the center horizontally */
    transform: translateX(-50%); /* Adjust for centering */
}


.arrow-down i {
    font-size: 1.25rem; /* 20px */
    transform: scaleX(0.6) scaleY(0.8);
    color: var(--icon-color);
    display: inline-block;
}

.arrow-down:hover {
    background-color: rgba(45, 45, 45, 0.9);
}

/* Hide arrow when at bottom or no scroll needed */
body.at-scroll-bottom .arrow-down {
    display: none;
}

body:not(.has-messages) .arrow-down {
    display: none;
}

.input-container {
    position: relative;
    width: 100%;
    max-width: var(--composer-shell-max-width);
    margin: var(--composer-margin-top) auto 0;
    padding: 0 var(--composer-side-pad);
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    box-sizing: border-box;
}

.input-container:focus-within {
    border-color: transparent;
    box-shadow: none;
}

.temp-composer-header {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.temp-composer-header .incognito {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fefefe, #d7d7d7);
    color: #383838;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.temp-composer-header .incognito svg {
    width: 100%;
    height: 100%;
    display: block;
}

body.artifact-panel-open .temp-composer-header .incognito {
    transform: translateX(calc(-1 * min(var(--artifact-panel-offset, 0px), 420px) * 0.4)) translateY(6px) scale(0.95);
    box-shadow: 0 18px 26px rgba(0, 0, 0, 0.45);
}

body.artifact-panel-resizing {
    cursor: ew-resize;
    user-select: none;
}

.temp-composer-header .temp-composer-label {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
}

.input-row {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var(--composer-gap);
    padding: 12px 16px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--input-row-bg, #2d2d2d);
    box-shadow: none;
    min-height: var(--composer-locked-height);
    backdrop-filter: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

/* Cover sides and bottom to hide scrolling text (U-shape, not above) */
.input-row::after {
    content: '';
    position: absolute;
    left: -50px;
    right: -50px;
    top: 0;
    bottom: -50px;
    background: var(--background-dark);
    z-index: -1;
}

/* When textarea expands to multiple lines */
.input-row.composer-expanded {
    padding-top: calc(var(--composer-padding-y) + 0.2rem);
    gap: 0; /* Remove gap since + button becomes absolute */
}

/* Position + button absolutely so text can use full width above it */
.input-row.composer-expanded .actions-menu {
    position: absolute;
    left: var(--composer-padding-x);
    bottom: var(--composer-padding-y);
    z-index: 3;
}

.input-row:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--input-row-bg-focus, #333);
}

.input-row .actions-menu {
    align-self: flex-end;
    display: flex;
    align-items: center;
}

/* Search Auto-Detect Indicator */
.search-auto-indicator {
    display: none;
    width: 100%;
    max-width: 100%;
    padding: 0 2px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.search-auto-indicator.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.search-auto-indicator-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-radius: 20px;
    font-size: 12px;
    color: #38bdf8;
}

.search-auto-indicator-content i {
    font-size: 11px;
    opacity: 0.9;
}

.search-auto-indicator-text {
    font-weight: 500;
    letter-spacing: 0.01em;
}

.search-auto-indicator-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 2px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    font-size: 9px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.search-auto-indicator-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Disabled/Override state */
.search-auto-indicator.disabled .search-auto-indicator-content {
    background: rgba(115, 115, 115, 0.15);
    border-color: rgba(115, 115, 115, 0.25);
    color: #a3a3a3;
}

.search-auto-indicator.disabled .search-auto-indicator-toggle {
    color: rgba(255, 255, 255, 0.5);
}

/* URL Preview Indicator */
/* URL Preview - ChatGPT Style Cards */
.url-preview-container {
    display: none;
    width: 100%;
    max-width: 100%;
    padding: 0 4px 8px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.url-preview-container.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.url-preview-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.url-card {
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    max-width: 320px;
    min-width: 200px;
    transition: all 0.2s ease;
    position: relative;
}

.url-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.url-card.loading {
    min-height: 60px;
}

/* YouTube thumbnail */
.url-card-thumbnail {
    position: relative;
    width: 100px;
    min-width: 100px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

.url-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.url-card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s;
}

.url-card-thumbnail:hover .url-card-play,
.url-card:hover .url-card-play {
    opacity: 1;
}

.url-card-thumbnail:hover .url-card-play i {
    transform: scale(1.1);
}

.url-card-play i {
    color: white;
    font-size: 24px;
    transition: transform 0.15s ease;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Card content */
.url-card-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    flex: 1;
    min-width: 0;
}

.url-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

.url-card-icon img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.url-card-icon i {
    font-size: 14px;
}

.url-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.url-card-title {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.url-card-title.skeleton {
    height: 14px;
    width: 120px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

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

.url-card-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.url-card-domain {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.url-card-domain i {
    font-size: 10px;
}

/* Remove button */
.url-card-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s ease;
    padding: 0;
}

.url-card:hover .url-card-remove {
    opacity: 1;
}

.url-card-remove:hover {
    background: rgba(239, 68, 68, 0.8);
    color: white;
}

.url-card-remove i {
    font-size: 10px;
}

.attachment-preview-tray {
    display: none;
    max-width: var(--composer-shell-max-width);
    margin: 0 auto 0.2rem;
    padding: 0.35rem 0.6rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
    box-sizing: border-box;
}

.attachment-preview-tray.has-attachments {
    display: flex;
}

body.temporary-chat-mode .options {
    display: none !important;
}

body.temporary-chat-mode .arrow-down {
    display: none !important;
}

body.temporary-chat-mode .input-container,
body.temporary-chat-mode .chat-shell__composer,
body.temporary-chat-mode .chatbox,
body.temporary-chat-mode .content-wrapper,
body.temporary-chat-mode .container,
body.temporary-chat-mode .toggle-button,
body.temporary-chat-mode .model-select-wrapper {
    transition: none !important;
}

body.composer-transition-skip .input-container,
body.composer-transition-skip .chat-shell__composer,
body.composer-transition-skip .chatbox,
body.composer-transition-skip .content-wrapper,
body.composer-transition-skip .container {
    transition: none !important;
}

body.temporary-chat-centered .input-container {
    position: fixed;
    top: 42%;
    bottom: auto;
    left: calc(
        var(--left-sidebar-width, 0px) +
        (100% - var(--left-sidebar-width, 0px) - var(--right-sidebar-width, 0px)) / 2
    );
    right: auto;
    width: min(
        var(--composer-shell-max-width),
        calc(100% - var(--left-sidebar-width, 0px) - var(--right-sidebar-width, 0px) - 2.5rem)
    );
    transform: translate(-50%, -50%);
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    z-index: 1300;
}

body.temporary-chat-centered .input-row,
body.temporary-chat-centered .attachment-preview-tray {
    width: 100%;
    max-width: none;
}

body.temporary-chat-centered .temp-composer-header {
    display: flex;
}

/* Hide greeting container in incognito mode - greeting shows in temp-composer-label instead */
/* But NOT in guest mode - guests don't have temp-composer-label, so show greeting-container */
body.temporary-chat-centered:not([data-guest-mode="true"]) .greeting-container {
    display: none !important;
}

/* Hide chat content when in incognito centered mode */
body.temporary-chat-centered #chat-display,
body.temporary-chat-centered .chat-shell__messages,
body.temporary-chat-centered .options {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Guest mode greeting - ensure it shows on desktop */
body[data-guest-mode="true"] .greeting-container:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    z-index: 100 !important;
    padding: 2rem 1rem !important;
}

body[data-guest-mode="true"] .greeting-text {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1.5rem !important;
    text-align: center !important;
}

body[data-guest-mode="true"] .greeting-container.hidden {
    display: none !important;
}

body.temporary-chat-centered .attachment-preview-tray {
    margin: 0 auto 0.75rem;
}

body.temporary-chat-centered .input-row {
    border-radius: 24px;
}

.textarea-container {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: flex-end;
    width: 100%;
    min-height: var(--composer-single-line-height);
}

.chat-input {
    width: 100%;
    min-height: var(--composer-single-line-height);
    max-height: var(--composer-max-height);
    height: var(--composer-single-line-height);
    background: transparent;
    color: #f5f5f5;
    font-family: 'Inter', 'Söhne', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: var(--composer-font-size);
    line-height: var(--composer-single-line-height);
    letter-spacing: var(--composer-letter-spacing);
    font-weight: var(--composer-font-weight);
    border: none;
    outline: none;
    resize: none;
    overflow-y: hidden;
    padding: 0 var(--composer-text-pad-right) 0 var(--composer-input-pad-x);
    border-radius: 0;
    display: block;
    white-space: var(--composer-white-space);
    overflow-wrap: var(--composer-overflow-wrap);
    word-wrap: var(--composer-word-wrap);
    word-break: break-word;
    caret-color: var(--composer-caret-color);
}

/* When expanded: text uses full width, buttons overlay at bottom corners */
.input-row.composer-expanded .chat-input {
    padding-left: 4px;
    padding-right: 4px;
    padding-bottom: 38px; /* Space for bottom row with buttons */
}


.chat-input::placeholder {
    color: rgba(255, 255, 255, var(--placeholder-opacity));
    font-weight: var(--placeholder-font-weight);
    font-size: var(--composer-font-size);
    line-height: var(--composer-single-line-height);
}

.chat-input::selection {
    background: var(--composer-selection-bg);
    color: inherit;
}

.chat-input:focus {
    outline: none;
}

.chat-input[disabled] {
    opacity: var(--composer-disabled-opacity);
    cursor: not-allowed;
}

.chat-input {
    scrollbar-width: var(--composer-scrollbar-width);
    scrollbar-color: rgba(255, 255, 255, var(--composer-scrollbar-opacity)) transparent;
}

.chat-input::-webkit-scrollbar {
    width: 6px;
}

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

.chat-input::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, var(--composer-scrollbar-opacity));
    border-radius: 999px;
}

/* Mobile responsive styles moved to mobile.css */
/* --- File Preview Container --- */
.file-preview-container {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.3rem 0.45rem;
    padding-right: 1.4rem;
    border: 1px solid #2b2b2b;
    border-radius: 0.6rem;
    background: linear-gradient(135deg, #1c1c1c, #121212);
    color: var(--primary-text-color);
    min-height: 3.4rem;
    min-width: 8.5rem;
    max-width: 12.5rem;
    box-sizing: border-box;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    margin-right: 0.25rem;
    margin-bottom: 0.2rem;
}

/* Upload loading state */
.file-preview-container.uploading {
    pointer-events: none;
}

.upload-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.upload-progress-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.upload-progress-status {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.upload-progress-track {
    width: 85%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 2px;
    transition: width 0.15s ease-out;
    position: relative;
}

.upload-progress-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.upload-progress-percent {
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
}

/* Processing state */
.upload-progress-container.processing .upload-progress-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.upload-progress-container.processing .upload-progress-status {
    animation: status-pulse 1s ease-in-out infinite;
}

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

.file-preview-container.clickable-preview {
    cursor: pointer;
}

.file-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-text-color);
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 0.125rem; /* 2px */
    max-width: 100%;
}

.file-name--image {
    width: 100%;
    margin: 0.1rem 0 0;
    margin-left: 0;
    opacity: 0.85;
}

.icon {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-right: 0.125rem; /* 2px */
}

.close-button {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    background-color: transparent;
    border: none;
    border-radius: var(--border-radius-circle);
    width: 1rem;
    height: 1rem;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    visibility: visible;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
}

.file-preview-container:hover .close-button {
    opacity: 1;
    background-color: transparent;
    color: var(--primary-text-color);
}

.close-button:focus-visible {
    opacity: 1;
    outline: 2px solid var(--primary-text-color);
    outline-offset: 2px;
}

img.composer-attachment-thumb {
    width: 100%;
    height: 3.75rem;
    display: block;
    margin: 0;
    object-fit: cover;
    border-radius: 0.45rem;
    border: 1px solid #242424;
    background: #1f1f1f;
}

img.composer-attachment-thumb--empty {
    background: repeating-linear-gradient(
        45deg,
        #1f1f1f,
        #1f1f1f 10px,
        #252525 10px,
        #252525 20px
    );
}

.image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.image-lightbox.open {
    display: flex;
}

.image-lightbox__content {
    position: relative;
    max-width: min(90vw, 1024px);
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-lightbox__img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 0.75rem;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    border: 1px solid #1f1f1f;
    background: #0f0f0f;
}

.image-lightbox__fallback {
    display: none;
    color: var(--primary-text-color);
    text-align: center;
}

.image-lightbox__fallback-link {
    color: var(--primary-text-color);
    text-decoration: underline;
    display: inline-block;
    margin-top: 0.35rem;
}

.image-lightbox__caption {
    margin-top: 0.6rem;
    color: var(--primary-text-color);
    text-align: center;
    font-weight: 600;
}

.image-lightbox__close {
    position: absolute;
    top: -0.75rem;
    right: -0.75rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.1rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.image-lightbox__close:hover,
.image-lightbox__close:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

/* --- File Upload Styling --- */
.attachment-icon {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #404040;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* --- Updated Layout for Attachment and Search --- */
.attachment-search-container {
    display: flex;
    align-items: center;
    gap: 0.625rem; /* Consistent spacing */
}
/* --- Buttons Container --- */
/* Grouped buttons on the left */
.grouped-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Spacing between left buttons */
}

.actions-menu {
    position: relative;
    display: inline-flex;
    align-items: flex-end;
}

.actions-toggle {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    padding: 0;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.actions-toggle svg {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.actions-toggle:hover,
.actions-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    outline: none;
}

.actions-toggle:active {
    transform: scale(0.94);
}

.actions-menu.open .actions-toggle {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.actions-menu.open .actions-toggle svg {
    transform: rotate(45deg);
}

.actions-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    visibility: hidden;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 6px;
    background: rgba(32, 32, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    z-index: 20;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
}

.actions-menu.open .actions-popover,
.actions-popover:focus-within {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Action button base */
.action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: none;
    transition: all 0.15s ease;
    position: relative;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
}

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

.action-btn svg {
    transition: all 0.15s ease;
}

/* Tooltip - appears below button */
.action-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.15s ease;
}

.action-btn:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Divider */
.popover-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 2px;
}

/* Search toggle specific */
.search-btn input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.search-btn.active {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.search-btn.active svg {
    filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.4));
}

/* Form reset */
.actions-popover .action-form {
    display: flex;
    margin: 0;
    padding: 0;
}


/* --- Microphone Button (absolute inside pill, left of send) --- */
.microphone-button {
    position: absolute;
    right: 44px;
    bottom: 4px;
    height: var(--send-button-size);
    width: var(--send-button-size);
    min-width: var(--send-button-size);
    min-height: var(--send-button-size);
    background-color: transparent;
    border: none;
    border-radius: var(--send-button-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    z-index: 2;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
}

/* Tooltip for microphone button */
.microphone-button::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #000;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 100;
}

.microphone-button::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 100;
}

.microphone-button:hover::before,
.microphone-button:hover::after {
    opacity: 1;
    visibility: visible;
}

.microphone-button:hover {
    color: rgba(255, 255, 255, 0.9);
}


.microphone-button.recording {
    color: #ef4444;
    animation: pulse-recording 1.5s ease-in-out infinite;
}

.microphone-button.recording:hover {
    color: #f87171;
}

.microphone-button.processing {
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

.microphone-button.processing i {
    animation: spin 1s linear infinite;
}

@keyframes pulse-recording {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

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

/* --- Dictation Recording Overlay --- */
.dictation-recording-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    background: transparent;
    border-radius: 20px;
    z-index: 10;
    min-height: 34px;
}

.dictation-recording-overlay.active {
    display: flex;
}

.dictation-waveform {
    flex: 1;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dictation-waveform-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.dictation-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dictation-cancel-btn,
.dictation-confirm-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s ease, transform 0.1s ease;
    position: relative;
}

.dictation-cancel-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.dictation-cancel-btn:hover {
    background: rgba(239, 68, 68, 0.35);
}

.dictation-confirm-btn {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

.dictation-confirm-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.dictation-cancel-btn:active,
.dictation-confirm-btn:active {
    transform: scale(0.95);
}

/* Tooltips for dictation buttons */
.dictation-cancel-btn::before,
.dictation-confirm-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #000;
    color: #fff;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 100;
}

.dictation-cancel-btn::after,
.dictation-confirm-btn::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 100;
}

.dictation-cancel-btn:hover::before,
.dictation-cancel-btn:hover::after,
.dictation-confirm-btn:hover::before,
.dictation-confirm-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Processing state */
.dictation-processing {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.dictation-processing i {
    font-size: 16px;
}

/* --- Send Button (absolute inside pill) --- */
.send-button {
    position: absolute;
    right: 8px;
    bottom: 4px;
    height: var(--send-button-size);
    width: var(--send-button-size);
    min-width: var(--send-button-size);
    min-height: var(--send-button-size);
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--send-button-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

.send-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}

.send-button:disabled {
    opacity: var(--composer-disabled-opacity);
    cursor: not-allowed;
    box-shadow: none;
}


.send-button.typing {
    background-color: rgb(255, 255, 255);
    border-color: rgb(255, 255, 255);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.send-button.typing i.fas.fa-arrow-up {
    color: rgb(0, 0, 0);
}

/* --- Arrow Icon --- */
.send-button i.fas.fa-arrow-up {
    color: #f5f5f5;
    font-size: 1rem;
}

/* --- Stop Icon --- */
.send-button .fa-arrow-up,
.send-button .fa-stop {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: auto;
    width: auto;
    height: auto;
    line-height: 1;
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.16s ease;
}

.send-button .fa-arrow-up {
    color: #f5f5f5;
    font-size: 0.95rem;
    opacity: 1;
    transform: scale(1);
}

.send-button.show-stop .fa-arrow-up {
    opacity: 0;
    transform: scale(0.8);
}

.send-button .fa-stop {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    opacity: 0;
    transform: scale(0.85);
}

.send-button.show-stop .fa-stop {
    opacity: 1;
    transform: scale(1);
}

.send-button.is-sending {
    background-color: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
}

.send-button.is-sending:hover {
    background-color: rgba(255, 255, 255, 0.18);
}

/* --- Voice Mode Button --- */
.voice-mode-button {
    position: absolute;
    right: 10px;
    bottom: 4px;
    height: 30px;
    width: 30px;
    min-width: 30px;
    min-height: 30px;
    background-color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.voice-mode-button:hover {
    background-color: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.voice-mode-button.hidden {
    display: none;
}

/* Checkmark icon (hidden by default) */
.voice-check {
    display: none;
    align-items: center;
    justify-content: center;
}

.voice-check i {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

/* Recording state - theme colored button with checkmark */
.voice-mode-button.recording {
    background: linear-gradient(145deg, #1a1a1a, #141414);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.voice-mode-button.recording:hover {
    background: linear-gradient(145deg, #222222, #1a1a1a);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.voice-mode-button.recording .voice-bars {
    display: none;
}

.voice-mode-button.recording .voice-check {
    display: flex;
}

/* Voice bars (audio level icon) - 4 bars with different heights */
.voice-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 14px;
}

.voice-bar {
    width: 2px;
    background-color: #1a1a1a;
    border-radius: 1.5px;
}

.voice-bar:nth-child(1) {
    height: 5px;
}

.voice-bar:nth-child(2) {
    height: 10px;
}

.voice-bar:nth-child(3) {
    height: 14px;
}

.voice-bar:nth-child(4) {
    height: 8px;
}


/* --- Tooltip Styling --- */
.tooltip {
    position: absolute;
    background-color: var(--tooltip-bg-color);
    color: var(--tooltip-text-color);
    padding: 0.375rem 0.75rem; /* 6px 12px */
    border-radius: 0.375rem; /* 6px */
    font-size: 0.75rem; /* 12px */
    white-space: nowrap;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
    text-align: center;
    box-shadow: 0px 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--tooltip-bg-color) transparent transparent transparent;
}

/* --- Prompt Styles --- */
#prompt:enabled {
    caret-color: auto;
}

#prompt:disabled {
    caret-color: black;
}

/* General Spinner Container Styles */
.load-more-spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.load-more-spinner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Spinner Variants */

/* Default Spinner */
.load-more-spinner.default {
    border: 4px solid transparent;
    border-top-color: #ffffff;
    width: 20px; /* Set the size of the spinner */
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2); /* Light, translucent border */
    border-top: 2px solid #ffffff; /* Bright white for the spinning segment */
    border-radius: 50%;
    position: absolute; /* Center within the container */
}

/* Circle Spinner */
.load-more-spinner.spinner-circle {
    width: 25px; /* Set the size of the spinner */
    height: 25px;
    border: 2px solid rgba(255, 255, 255, 0.2); /* Light, translucent border */
    border-top: 3px solid #ffffff; /* Bright white for the spinning segment */
    border-radius: 50%;
    position: absolute; /* Center within the container */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: spin 0.9s linear infinite; /* Faster rotation for a smooth effect */
}

/* Keyframes for Spin Animation */
@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}




/* Sticky Top Spinner */
.load-more-spinner-container.top {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
}

/* Standard Bottom Spinner */
.load-more-spinner-container.bottom {
    margin-top: 10px;
}

/* Spinner Animations */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* --- Edit & Copy Buttons --- */
.edit-button,
.copy-message-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #b5b5b5;
    font-size: 0.85rem;
    padding: 0.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    line-height: 1;
    margin-left: 0;
    opacity: 0;
    pointer-events: none;
    transition: color 0.2s ease, opacity 0.15s ease;
}

.edit-button:hover,
.copy-message-button:hover {
    color: #ffffff;
}

.message.user-message:hover .edit-button,
.message.user-message:hover .copy-message-button,
.chat-message.user:hover .edit-button,
.chat-message.user:hover .copy-message-button {
    opacity: 1;
    pointer-events: auto;
}

/* Desktop: Force buttons close together */
body:not(.device-phone):not(.device-tablet):not(.is-mobile):not(.is-ios):not(.viewport-mobile) .message.user-message .message-bubble-footer {
    gap: 10px !important;
}

body:not(.device-phone):not(.device-tablet):not(.is-mobile):not(.is-ios):not(.viewport-mobile) .message.user-message .message-bubble-footer .edit-button,
body:not(.device-phone):not(.device-tablet):not(.is-mobile):not(.is-ios):not(.viewport-mobile) .message.user-message .message-bubble-footer .copy-message-button {
    margin: 0 !important;
    padding: 0.15rem !important;
}

/* Custom tooltips for edit/copy buttons */
.edit-button[data-tooltip],
.copy-message-button[data-tooltip] {
    position: relative;
}

.edit-button[data-tooltip]::after,
.copy-message-button[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: #000000;
    color: #e0e0e0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1000;
}

.edit-button[data-tooltip]:hover::after,
.copy-message-button[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.message-container {
    position: relative;
    width: 100%;
    background: #2b2b2b;
    border-radius: 12px;
    padding: 1px;
}

.edit-textarea {
    width: 100%;
    min-height: 80px;
    padding: 15px 20px 50px; /* Combined padding for cleaner look */
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    outline: none;
    background-color: transparent;
    color: #ffffff;
    box-sizing: border-box;
    border: none;
    overflow-y: auto; /* Ensure scroll functionality */
}

.button-container {
    position: absolute;
    bottom: 10px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.cancel-button, .save-button {
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    border: none;
}

.cancel-button {
    background-color: #1e1e1e;
    color: #ffffff;
}

.save-button {
    background-color: #ffffff;
    color: #000000;
}

/* Scrollbar Styles */
.edit-textarea::-webkit-scrollbar {
    width: 6px;
}

.edit-textarea::-webkit-scrollbar-track {
    background-color: rgba(255, 255, 255, 0.1);
}

.edit-textarea::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.edit-textarea::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.edit-textarea::-webkit-scrollbar-button {
    display: none;
}

/* --- Action Buttons --- */
.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    padding: 0.25rem 0;
    margin-top: 0.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 0.35rem;
}

.action-buttons-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.action-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    color: var(--text-color-secondary);
    font-size: 0.85rem;
    padding: 0.25rem;
    border-radius: 0.35rem;
    cursor: pointer;
    outline: none;
    transition: color 0.2s ease;
    position: relative;
}

.action-btn:hover,
.action-btn:focus-visible {
    color: var(--primary-text-color);
}

.action-btn i {
    font-size: 0.9rem;
    pointer-events: none;
}

.action-more-wrapper {
    position: relative;
    display: inline-flex;
}

.action-more-button {
    background: transparent;
    border: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    color: var(--text-color-secondary);
    font-size: 1rem;
    line-height: 1;
    padding: 0.15rem 0.3rem;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.action-more-button:hover,
.action-more-button:focus-visible {
    color: var(--primary-text-color);
}

.action-more-menu {
    position: absolute;
    bottom: calc(100% + 0.25rem);
    left: calc(100% + 0.6rem);
    right: auto;
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    display: none;
    flex-direction: column;
    min-width: 160px;
    z-index: 30;
}

.action-more-menu.open {
    display: flex;
}

.action-more-menu button {
    background: transparent;
    border: none;
    color: var(--text-color-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    width: 100%;
    justify-content: flex-start;
}

.action-more-menu button svg {
    width: 1rem;
    height: 1rem;
    color: inherit;
}

.action-more-menu button:hover {
    background: rgba(255, 255, 255, 0.05);
}

.action-sources-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 0.82rem;
    padding: 0.2rem 0.4rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.action-sources-button span {
    display: inline-flex;
    align-items: center;
}

.action-sources-favicons {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: 0.1rem;
}

.action-sources-favicons img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.action-sources-button:hover,
.action-sources-button:focus-visible {
    background: rgba(123, 182, 254, 0.18);
    color: #ffffff;
}

#sources-btn {
    display: none;
}


/* Button Styling */
#sources-btn {
    position: fixed; /* Sticks to the viewport */
    align-items: center;
    padding: 5px 10px;
    background-color: #33333300;
    color: white;
    border: 1.5px solid #444;
    border-radius: 13px;
    cursor: pointer;
    font-size: 14px;
    font-family: Arial, sans-serif;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
}



/* Container for favicons */
#favicon-container {
    display: inline-flex;
    margin-left: 6px;
    position: relative;
}

/* Favicon Styling */
.source-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    background-color: white;
    border: 1.5px solid #333;
    margin-left: -10px;
    position: relative;
    z-index: 1;
    transition: transform 0.2s ease, z-index 0.2s ease;
}

#favicon-container .source-icon:first-child {
    margin-left: 0;
}

.source-icon:hover {
    transform: scale(1.2);
    z-index: 2;
}

.loading-container {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    width: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
}

.loading-circle {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(4px);
}

.loading-icon {
    animation: pulse 1.5s infinite;
    will-change: transform, opacity;
}

.loading-icon i {
    font-size: 32px;
    color: #666;
    display: block;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.5;
    }
}

/* ==================== Thinking Indicator ==================== */
.thinking-indicator {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    margin: 8px 0;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.thinking-indicator.visible {
    opacity: 1;
}

.thinking-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    animation: thinking-bounce 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(1) { animation-delay: 0s; }
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.thinking-text {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.thinking-message {
    font-size: 14px;
    color: var(--text-secondary, #666);
    font-weight: 500;
    transition: opacity 0.15s ease;
}

.thinking-elapsed {
    font-size: 12px;
    color: var(--text-tertiary, #999);
    font-variant-numeric: tabular-nums;
}

.thinking-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary, rgba(0,0,0,0.03));
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-secondary, #666);
    line-height: 1.4;
}

.thinking-tip .tip-icon {
    flex-shrink: 0;
}

.thinking-tip .tip-text {
    transition: opacity 0.15s ease;
}

/* Streaming mode header */
.thinking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 4px 0;
}

.thinking-header:hover {
    opacity: 0.8;
}

.thinking-chevron {
    font-size: 12px;
    color: var(--text-tertiary, #999);
    transition: transform 0.2s ease;
    padding: 4px;
}

.thinking-chevron.expanded {
    transform: rotate(180deg);
}

/* Streaming reasoning area */
.thinking-reasoning {
    max-height: 300px;
    overflow-y: auto;
    margin: 8px 0;
    padding: 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(59, 130, 246, 0.06));
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.15);
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.thinking-reasoning.collapsed {
    max-height: 0;
    padding: 0 12px;
    opacity: 0;
    border: none;
    margin: 0;
}

.reasoning-stream {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary, #666);
    font-family: var(--font-mono, 'SF Mono', Monaco, monospace);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Scrollbar for reasoning */
.thinking-reasoning::-webkit-scrollbar {
    width: 5px;
}

.thinking-reasoning::-webkit-scrollbar-track {
    background: transparent;
}

.thinking-reasoning::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.25);
    border-radius: 3px;
}

/* Dark mode */
.dark-mode .thinking-indicator {
    background: var(--bg-secondary, #1e1e1e);
}

.dark-mode .thinking-dots span {
    background: rgba(255, 255, 255, 0.85);
}

.dark-mode .thinking-tip {
    background: var(--bg-tertiary, rgba(255,255,255,0.05));
}

.dark-mode .thinking-reasoning {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    border-color: rgba(139, 92, 246, 0.25);
}

.dark-mode .reasoning-stream {
    color: var(--text-secondary, #aaa);
}

/* ==================== Simple Pulsing Dot (non-DeepSeek) ==================== */
/* Uses streaming-cursor class for visual consistency with streaming text cursor */
.simple-pulsing-dot {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin: 8px 0;
}

/* ==================== Reasoning Section (DeepSeek R1) ==================== */
.reasoning-section {
    margin-bottom: 12px;
    border-radius: 8px;
    background: #212121;
    border: 1px solid var(--border-secondary, #262626);
    overflow: hidden;
    transition: all 0.2s ease;
}

.reasoning-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary, #a3a3a3);
    text-align: left;
    transition: background 0.15s ease;
}

.reasoning-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.reasoning-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.reasoning-label {
    flex: 1;
    font-weight: 500;
    color: var(--text-secondary, #a3a3a3);
}

.reasoning-chevron {
    font-size: 10px;
    color: var(--text-tertiary, #737373);
    transition: transform 0.3s ease;
}

.reasoning-section:not(.collapsed) .reasoning-chevron {
    transform: rotate(180deg);
}

.reasoning-preview {
    font-size: 12px;
    color: var(--text-tertiary, #737373);
    font-style: italic;
    opacity: 0.8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    transition: opacity 0.2s ease, max-height 0.2s ease;
}

/* Hide preview when expanded */
.reasoning-section:not(.collapsed) .reasoning-preview {
    opacity: 0;
    max-height: 0;
    margin-top: -6px;
}

.reasoning-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.reasoning-section:not(.collapsed) .reasoning-content {
    max-height: 500px;
    overflow-y: auto;
}

.reasoning-text {
    padding: 0 14px 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary, #666);
    font-family: var(--font-mono, monospace);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Scrollbar for reasoning content */
.reasoning-content::-webkit-scrollbar {
    width: 6px;
}

.reasoning-content::-webkit-scrollbar-track {
    background: transparent;
}

.reasoning-content::-webkit-scrollbar-thumb {
    background: var(--border-primary, #404040);
    border-radius: 3px;
}

.reasoning-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary, #737373);
}


.chat-image,
.generated-image {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1 / 1; /* fixed square to match placeholder */
    object-fit: cover;
    display: block;
    margin: 6px auto;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28), 0 1px 0 rgba(255, 255, 255, 0.05);
    opacity: 0;
    filter: blur(10px);
    transform: scale(0.98);
    animation: none;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: zoom-in;
}

.image-layer {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1 / 1;
    margin: 6px auto;
}

.image-layer .image-placeholder,
.image-layer .chat-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
}

/* Grok-style image generation placeholder */
.image-layer .image-placeholder {
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--background-darker, #1a1a1f);
}

/* Animated aurora background - hidden */
.image-placeholder__aurora {
    display: none;
}

.image-placeholder__aurora::before,
.image-placeholder__aurora::after {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    border-radius: 50%;
    filter: blur(60px);
    animation: auroraMove 8s ease-in-out infinite;
}

.image-placeholder__aurora::before {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 60%);
    top: -50%;
    left: -25%;
    animation-delay: 0s;
}

.image-placeholder__aurora::after {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, transparent 60%);
    bottom: -50%;
    right: -25%;
    animation-delay: -4s;
}

/* Secondary aurora layer - hidden */
.image-placeholder__aurora-secondary {
    display: none;
}

.image-placeholder__aurora-secondary::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 50%);
    top: 20%;
    left: -10%;
    filter: blur(50px);
    animation: auroraMove 10s ease-in-out infinite reverse;
}

@keyframes auroraMove {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(10%, 5%) scale(1.1);
    }
    50% {
        transform: translate(-5%, 10%) scale(0.95);
    }
    75% {
        transform: translate(-10%, -5%) scale(1.05);
    }
}

/* Floating particles - hidden */
.image-placeholder__particles {
    display: none;
}

/* Central orb with pulse */
.image-placeholder__orb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.image-placeholder__orb-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.5) 0%, transparent 70%);
    border-radius: 50%;
    animation: orbPulse 2s ease-in-out infinite;
}

.image-placeholder__orb-ring {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: orbRingSpin 8s linear infinite;
}

.image-placeholder__orb-ring::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: rgba(168, 85, 247, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
}

.image-placeholder__orb-inner {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.3) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.image-placeholder__orb-icon {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes orbPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

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

@keyframes iconPulse {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Status text */
.image-placeholder__status {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.image-placeholder__text {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
}

/* Progress bar */
.image-placeholder__progress {
    width: 120px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.image-placeholder__progress-bar {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    border-radius: 2px;
    animation: progressSweep 2s ease-in-out infinite;
}

@keyframes progressSweep {
    0% {
        width: 0%;
        margin-left: 0%;
    }
    50% {
        width: 60%;
        margin-left: 20%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

/* Grid overlay for texture */
.image-placeholder__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

.image-layer .chat-image {
    opacity: 0;
    transform: scale(1.02);
    filter: blur(20px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.image-layer.revealed .image-placeholder {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s 0.6s;
}

.image-layer.revealed .chat-image {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.chat-image--reveal {
    filter: blur(20px);
    opacity: 0;
    transform: scale(1.02);
}

@keyframes imageReveal {
    from {
        opacity: 0;
        filter: blur(20px);
        transform: scale(1.02);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

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

.attachment-lightbox {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(22, 27, 45, 0.95), rgba(5, 5, 5, 0.85));
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: clamp(1rem, 3vw, 2rem);
}

.attachment-lightbox.open {
    display: flex;
}

.attachment-lightbox__content {
    position: relative;
    width: min(1100px, 96vw);
    max-height: 92vh;
    background: linear-gradient(145deg, rgba(16, 17, 25, 0.95), rgba(7, 7, 9, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    padding: clamp(1rem, 2vw, 1.5rem);
    overflow: hidden;
}

.attachment-lightbox__body {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.9fr);
    gap: clamp(1rem, 2vw, 1.5rem);
    height: 100%;
}

.attachment-lightbox__media {
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: clamp(0.75rem, 2vw, 1.25rem);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.attachment-lightbox__frame {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    background: #050505;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: clamp(0.5rem, 1vw, 1rem);
}

.attachment-lightbox__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    background: #0c0c0c;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.attachment-lightbox__panel {
    background: linear-gradient(160deg, rgba(21, 23, 33, 0.9), rgba(7, 7, 8, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: clamp(1rem, 2vw, 1.5rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.attachment-lightbox__info {
    flex: 1;
    min-height: 0;
}

.attachment-lightbox__eyebrow {
    margin: 0 0 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.attachment-lightbox__title {
    color: #f8fbff;
    font-weight: 600;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    line-height: 1.35;
    margin: 0;
    word-break: break-word;
}

.attachment-lightbox__details {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.attachment-lightbox__detail {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
}

.attachment-lightbox__actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.attachment-lightbox__btn {
    padding: 0.65rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    color: #f4f7ff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.attachment-lightbox__btn.secondary {
    background: transparent;
}

.attachment-lightbox__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.attachment-lightbox__btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.3);
}

.attachment-lightbox__fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    border-radius: 14px;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    background: rgba(0, 0, 0, 0.65);
}

.attachment-lightbox__fallback-link {
    color: #9dd0ff;
    font-weight: 600;
    text-decoration: none;
}

.attachment-lightbox__fallback-link:hover {
    text-decoration: underline;
}

.attachment-lightbox__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(3, 3, 3, 0.65);
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease, border-color 0.18s ease;
}

.attachment-lightbox__close:hover,
.attachment-lightbox__close:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.page-wrapper {
    flex: 1;
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    position: relative;
    transition: none; /* No transition for layout mode switch */
}

/* Desktop: becomes grid when artifact open */
@media (min-width: 769px) {
  body.artifact-panel-open .content-wrapper {
    display: grid;
    grid-template-columns: var(--artifact-split-left, 1fr) var(--artifact-split-right, 1fr);
    gap: 0;
    transition: none;
  }
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Desktop split-view: chat-area becomes 50% */
@media (min-width: 769px) {
  body.artifact-panel-open .chat-area {
    width: 100%;
    max-width: 100%;
  }
}

.page-wrapper .content-wrapper > .container {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: var(--space-5) 0 0;
    gap: var(--space-5);
    box-sizing: border-box;
    min-height: 100vh;
}

.chat-stage {
    flex: 1 1 auto;
    width: 100%;
    /* FĂRĂ max-width aici - lasă scroll container să fie full-width */
    padding: 0; /* Padding mutat pe .conversation-panel */
    display: flex;
    flex-direction: column;
    align-items: stretch; /* Full width pentru copii */
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    min-height: 0;
    overflow: hidden;
}


/* Mobile chat-stage styles moved to mobile.css */
.chat-shell {
    flex: 1 1 auto;
    width: 100%;
    /* FĂRĂ max-width aici - lasă scroll container să fie full-width */
    display: flex;
    flex-direction: column;
    gap: 0; /* Gap mutat pe .conversation-panel */
    min-height: 0;
    align-items: stretch; /* Full width pentru copii */
    overflow: hidden;
}

.chat-shell__header {
    flex: 0 0 auto;
    width: 100%;
    max-width: var(--composer-shell-max-width);
    margin: 0 auto; /* Centrat ca și .conversation-panel */
    padding: var(--space-3) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    align-items: stretch;
    text-align: left;
}

/* #chat-scroll-region - SINGURUL container care scrollează */
.chat-shell__messages,
#chat-scroll-region {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto; /* SCROLL AICI */
    overflow-x: hidden;
    overflow-anchor: none; /* Prevent browser scroll anchoring - we manage scroll manually */
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Hide scrollbar for WebKit browsers (Chrome, Safari, Edge) */
.chat-shell__messages::-webkit-scrollbar,
#chat-scroll-region::-webkit-scrollbar {
    display: none;
}

.chat-shell__messages > * {
    width: 100%;
    max-width: var(--chat-shell-max-width);
    margin-left: auto;
    margin-right: auto;
}

/* Inner wrapper - CENTRARE + MAX-WIDTH aici */
.conversation-panel {
    width: 100%;
    max-width: var(--composer-shell-max-width);
    margin: 0 auto;
    padding: var(--space-5);
    padding-bottom: calc(var(--space-6) + var(--composer-reserved-height, 150px)); /* Spațiu pentru composer */
    border-radius: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: var(--space-5);
    box-sizing: border-box;
}

#chat-display {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Dynamic padding added via JS when scrolling user message to top */
#chat-display.scroll-padding-active {
    padding-bottom: 70vh;
}

/* Mobile conversation-panel styles moved to mobile.css */

.chat-shell__extras {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    text-align: left;
}

.chat-shell__extras > * {
    width: 100%;
    max-width: var(--composer-shell-max-width);
    margin-left: auto;
    margin-right: auto;
}

.formatted-response,
#image-container,
.message-warning {
    width: 100%;
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
}

.formatted-response {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
    color: var(--text-color-light);
    line-height: 1.6;
}

#image-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.message-warning {
    text-align: left;
}

.chat-shell__composer {
    flex: 0 0 auto;
    width: calc(100% - var(--left-sidebar-width, 0px) - var(--active-right-sidebar-width, 0px));
    max-width: none;
    padding: var(--space-3) var(--composer-side-pad) calc(var(--space-3) + var(--composer-safe-area-bottom) + 16px);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--composer-margin-top);
    position: fixed;
    left: var(--left-sidebar-width, 0px);
    bottom: 0;
    z-index: 100;
    box-shadow: none;
    border-top: none;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none; /* Allow clicks through transparent area */
}


body.right-sidebar-open .chat-shell__composer {
    width: calc(100% - var(--left-sidebar-width, 0px) - var(--right-sidebar-width, 0px));
}

/* Adjust for artifact panel in split-view (desktop only) */
@media (min-width: 769px) {
  body.artifact-panel-open .chat-shell__composer {
    width: calc((100% - var(--left-sidebar-width, 0px) - var(--active-right-sidebar-width, 0px)) * var(--artifact-chat-width-percent, 0.5));
  }
}

/* Mobile composer styles moved to mobile.css */

.chat-shell__composer > * {
    width: 100%;
    max-width: var(--composer-shell-max-width);
    margin-left: auto;
    margin-right: auto;
    pointer-events: auto;
}

.temp-chat-launcher {
    position: fixed;
    top: 1.2rem;
    right: 1.5rem;
    z-index: 1600;
    pointer-events: none;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

body.right-sidebar-open .temp-chat-launcher {
    right: calc(var(--right-sidebar-width, 320px) + 1.5rem);
}

/* Desktop: position based on grid split - stay just in front of artifact panel */
@media (min-width: 769px) {
    /* Sidebar collapsed: use full viewport width */
    body.sidebar-collapsed.artifact-panel-open .temp-chat-launcher {
        right: auto;
        left: calc((var(--artifact-chat-width-percent, 0.5) * 100vw) - 4.5rem);
    }

    /* Sidebar open: account for sidebar width */
    body:not(.sidebar-collapsed).artifact-panel-open .temp-chat-launcher {
        right: auto;
        left: calc(var(--sidebar-width, 260px) + (var(--artifact-chat-width-percent, 0.5) * (100vw - var(--sidebar-width, 260px))) - 4.5rem);
    }

    /* During resize: no transition, follow immediately */
    body.artifact-panel-resizing .temp-chat-launcher {
        transition: none !important;
    }
}

/* Mobile artifact panel styles moved to mobile.css */

.temp-chat-button {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 999px;
    padding: 0.4rem;
    color: #f3f3f3;
    box-shadow: none;
    transition: transform 0.2s ease;
    position: relative;
}

.temp-chat-button:hover {
    transform: translateY(-1px);
}

.temp-chat-button:focus-visible {
    outline: none;
}

.temp-chat-button::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 110%;
    right: 0;
    transform: translateY(6px);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.85);
    color: #f7f7f7;
    font-size: 0.75rem;
    white-space: nowrap;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.temp-chat-button:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.temp-chat-icon {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f3f3f3;
}

.temp-chat-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.temp-chat-icon .ghost-eye {
    transition: transform 140ms ease;
}
.left-sidebar,
.right-sidebar {
    transition: width 0.25s ease;
}

.left-sidebar {
    width: var(--sidebar-width);
}

.left-sidebar .sidebar-action-text,
.left-sidebar .sidebar-item span:not(.sidebar-action-icon),
.left-sidebar .profile-name,
.left-sidebar .profile-email,
.left-sidebar .profile-tags,
.left-sidebar .dropdown-container,
.left-sidebar .sidebar-footer .profile-email {
    opacity: 1;
    max-width: 240px;
    transition: none;
    display: inline-flex;
    align-items: center;
}

.left-sidebar .sidebar-action-btn,
.left-sidebar .sidebar-item {
    transition: none;
    position: relative;
}

body.sidebar-collapsed .left-sidebar .sidebar-header h1,
body.sidebar-collapsed .left-sidebar .sidebar-action-text,
body.sidebar-collapsed .left-sidebar .sidebar-item span:not(.sidebar-action-icon),
body.sidebar-collapsed .left-sidebar .profile-name,
body.sidebar-collapsed .left-sidebar .profile-email,
body.sidebar-collapsed .left-sidebar .profile-tags,
body.sidebar-collapsed .left-sidebar .dropdown-container,
body.sidebar-collapsed .left-sidebar .sidebar-footer .profile-email {
    opacity: 0;
    max-width: 0;
    margin: 0;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
}

body.sidebar-collapsed .left-sidebar .sidebar-action-btn,
body.sidebar-collapsed .left-sidebar .sidebar-item {
    justify-content: center;
    gap: 0;
}

body.sidebar-collapsed .left-sidebar .sidebar-action-btn {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .left-sidebar .sidebar-action-icon {
    opacity: 1;
    width: 1.3rem;
    height: 1.3rem;
    flex-shrink: 0;
    color: var(--text-secondary);
}

body.sidebar-collapsed .left-sidebar .sidebar-action-btn::after {
    content: attr(aria-label);
    position: absolute;
    left: calc(100% + 0.65rem);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 20, 20, 0.95);
    color: #fff;
    padding: 0.4rem 0.65rem;
    border-radius: 0.55rem;
    white-space: nowrap;
    font-size: 0.75rem;
    letter-spacing: 0.01em;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    transition: none;
    z-index: 10;
}

body.sidebar-collapsed .left-sidebar .sidebar-action-btn:focus-visible::after,
body.sidebar-collapsed .left-sidebar .sidebar-action-btn:hover::after {
    opacity: 1;
}

body.sidebar-collapsed .left-sidebar .profile-header {
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

body.sidebar-collapsed .section-header {
    display: none;
}

body.sidebar-collapsed .chat-tab,
body.sidebar-collapsed .sidebar-empty-state {
    display: none;
}

/* ============================================
   Guest Mode Styles
   ============================================ */

/* Hide elements for guests */
.guest-hidden {
    display: none !important;
}

/* Disabled state for guest-restricted features */
.guest-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Keep absolute positioning for buttons inside input-pill */
.microphone-button.guest-disabled,
.voice-mode-button.guest-disabled {
    position: absolute;
}

/* Allow pointer events only on voice mode button for tooltip */
.voice-mode-button.guest-disabled {
    pointer-events: auto;
}

.guest-disabled::after {
    content: '';
    position: absolute;
    inset: 0;
    cursor: not-allowed;
}

/* Lock icon for disabled features */
.guest-lock-icon {
    position: absolute;
    top: -4px;
    right: -4px;
    background: rgba(255, 100, 100, 0.9);
    border-radius: 50%;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guest-lock-icon svg {
    fill: white;
}

/* Model selector disabled state */
.model-select.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.model-select-wrapper.guest-disabled {
    display: none !important;
}

/* Guest Signup Banner - Modern ChatGPT Style */
.guest-banner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #2f2f2f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    animation: bannerEmerge 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center bottom;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
}

@keyframes bannerEmerge {
    0% {
        opacity: 0;
        transform: scaleY(0.3) scaleX(0.8) translateY(20px);
        filter: blur(4px);
    }
    50% {
        opacity: 0.8;
        filter: blur(1px);
    }
    100% {
        opacity: 1;
        transform: scaleY(1) scaleX(1) translateY(0);
        filter: blur(0);
    }
}

.guest-banner-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guest-banner-icon {
    display: none;
}

.guest-banner-text {
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.guest-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.guest-banner-btn {
    padding: 0.5rem 0.875rem;
    border-radius: 18px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
    border: none;
    cursor: pointer;
}

.guest-banner-btn-primary {
    background: #fff;
    color: #000;
}

.guest-banner-btn-primary:hover {
    background: #e5e5e5;
}

.guest-banner-btn-secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 0.75rem;
}

.guest-banner-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Guest Signup Modal - Modern Glassmorphism Design */
.guest-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.guest-modal-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(10, 10, 10, 0.85) 0%, rgba(0, 0, 0, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: backdropFadeIn 0.3s ease-out;
}

@keyframes backdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.guest-modal-content {
    position: relative;
    background: rgba(20, 20, 24, 0.9);
    border-radius: 1.25rem;
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow:
        0 24px 80px -12px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* Gradient glow effect */
.guest-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.guest-modal-header {
    position: relative;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Icon badge */
.guest-modal-header::before {
    content: '';
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 28px;
}

.guest-modal-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.guest-modal-body {
    position: relative;
    text-align: center;
    margin-bottom: 1.75rem;
}

.guest-modal-body p {
    color: #a3a3a3;
    margin: 0 0 1.25rem 0;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.guest-modal-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.guest-modal-features li {
    padding: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.625rem;
    transition: all 0.2s ease;
}

.guest-modal-features li:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.guest-modal-features li::before {
    content: '';
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

.guest-modal-footer {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.guest-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: 0.625rem;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
}

.guest-modal-btn-primary {
    background: rgba(20, 20, 24, 0.9);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.guest-modal-btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.guest-modal-btn-primary:hover {
    background: rgba(35, 35, 40, 0.95);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.guest-modal-btn-primary:hover::before {
    opacity: 1;
}

.guest-modal-btn-secondary {
    background: transparent;
    color: #737373;
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
}

.guest-modal-btn-secondary:hover {
    color: #a3a3a3;
}

/* Mobile adjustments for guest elements */
@media (max-width: 768px) {
    .guest-banner {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
        border-radius: 16px;
    }

    .guest-banner-text {
        font-size: 0.8rem;
    }

    .guest-banner-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .guest-modal-content {
        padding: 1.75rem;
        margin: 0;
    }

    .guest-modal-header::before {
        width: 48px;
        height: 48px;
        background-size: 24px;
    }

    .guest-modal-title {
        font-size: 1.125rem;
    }

    .guest-modal-body p {
        font-size: 0.875rem;
    }

    .guest-modal-features {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .guest-modal-features li {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    .guest-modal-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* =============================================================================
   Guest Sidebar Content - Clean ChatGPT Style
   ============================================================================= */

.guest-sidebar-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
}

.guest-sidebar-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.guest-sidebar-empty p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
    line-height: 1.5;
    max-width: 180px;
}

/* Guest auth buttons in sidebar footer */
.guest-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.guest-auth-btn {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s ease;
}

.guest-auth-btn.signup {
    background: #fff;
    color: #000;
}

.guest-auth-btn.signup:hover {
    background: rgba(255, 255, 255, 0.9);
}

.guest-auth-btn.login {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.guest-auth-btn.login:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Hide sidebar content when sidebar is closed - GUEST ONLY */
.left-sidebar.guest-sidebar.closed .guest-auth-buttons,
.left-sidebar.guest-sidebar.closed .sidebar-footer,
.left-sidebar.guest-sidebar.closed .guest-sidebar-content,
.left-sidebar.guest-sidebar.closed .sidebar-content {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Guest Floating Login Button (visible when sidebar closed by user) */
.guest-floating-login {
    position: fixed;
    bottom: 16px;
    left: 0;
    width: var(--sidebar-collapsed-width, 56px);
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: opacity 0.15s ease;
    z-index: 1000;
}

/* Only show when sidebar-toggled class is added by JS */
.guest-floating-login.visible {
    display: flex;
}

.guest-floating-login svg {
    width: 20px;
    height: 20px;
}

.guest-floating-login:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ================================
   Personalized Greeting Styles
   ================================ */

.greeting-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 1rem 0.25rem;
    margin-bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.greeting-container.visible {
    opacity: 1;
}

.greeting-container.hidden {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.greeting-text {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

/* Typewriter cursor */
.greeting-text.typewriter-active .greeting-typed-text::after {
    content: '|';
    animation: cursorBlink 0.6s step-end infinite;
    margin-left: 1px;
    color: rgba(255, 255, 255, 0.8);
}

.greeting-text.typewriter-done .greeting-typed-text::after {
    animation: cursorFade 0.15s ease-out forwards;
}

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

@keyframes cursorFade {
    to { opacity: 0; }
}

/* Text reveal - curtain slide effect (desktop only) */
.greeting-text.greeting-fade-in {
    position: relative;
    clip-path: inset(0 100% 0 0);
    animation: textRevealCurtain 0.8s ease-out forwards;
    overflow: visible;
}

@keyframes textRevealCurtain {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

/* After animation completes, remove clip-path so weather shows */
.greeting-text.greeting-fade-in.animation-done {
    clip-path: none;
}

/* Tiny Weather Gem - inline with greeting */
.weather-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    margin-left: 8px;
    vertical-align: middle;
    background: none;
    border: none;
    opacity: 0;
    -webkit-animation: gemReveal 0.4s ease-out forwards;
    animation: gemReveal 0.4s ease-out forwards;
    cursor: default;
    position: relative;
    overflow: visible;
}


@-webkit-keyframes gemReveal {
    0% {
        opacity: 0;
        -webkit-transform: translateX(-10px);
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        -webkit-transform: translateX(0);
        transform: translateX(0);
    }
}

@keyframes gemReveal {
    0% {
        opacity: 0;
        transform: translateX(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tiny icon container */
.weather-badge .weather-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    overflow: visible;
}

.weather-badge .weather-icon svg {
    width: 16px;
    height: 16px;
}

/* Sun - golden pulse */
.weather-badge .weather-icon.weather-clear-day svg {
    color: #fbbf24;
    animation: sunGem 2.5s ease-in-out infinite;
}

@keyframes sunGem {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgba(251, 191, 36, 0.6));
        transform: rotate(0deg);
    }
    50% {
        filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.9));
        transform: rotate(20deg);
    }
}

/* Clouds - gentle drift */
.weather-badge .weather-icon.weather-cloudy svg,
.weather-badge .weather-icon.weather-partly-cloudy-day svg,
.weather-badge .weather-icon.weather-partly-cloudy-night svg {
    color: #94a3b8;
    animation: cloudGem 3s ease-in-out infinite;
}

@keyframes cloudGem {
    0%, 100% {
        transform: translateX(0);
        filter: drop-shadow(0 0 2px rgba(148, 163, 184, 0.4));
    }
    50% {
        transform: translateX(2px);
        filter: drop-shadow(0 0 4px rgba(148, 163, 184, 0.6));
    }
}

/* Rain - droplet bounce */
.weather-badge .weather-icon.weather-rain svg,
.weather-badge .weather-icon.weather-drizzle svg {
    color: #38bdf8;
    animation: rainGem 1s ease-in-out infinite;
}

@keyframes rainGem {
    0%, 100% {
        transform: translateY(0);
        filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.5));
    }
    50% {
        transform: translateY(2px);
        filter: drop-shadow(0 1px 5px rgba(56, 189, 248, 0.7));
    }
}

/* Clear Night - subtle cloud with stars */
.weather-badge .weather-icon.weather-clear-night svg {
    color: #94a3b8;
    animation: nightCloudGem 3.5s ease-in-out infinite;
}

@keyframes nightCloudGem {
    0%, 100% {
        transform: translateX(0);
        filter: drop-shadow(0 0 2px rgba(148, 163, 184, 0.3));
    }
    50% {
        transform: translateX(1px);
        filter: drop-shadow(0 0 3px rgba(148, 163, 184, 0.5));
    }
}

/* Snow - twinkle float */
.weather-badge .weather-icon.weather-snow svg {
    color: #e0f2fe;
    animation: snowGem 2.5s ease-in-out infinite;
}

@keyframes snowGem {
    0%, 100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 2px rgba(224, 242, 254, 0.6));
    }
    50% {
        transform: translateY(-2px) scale(1.1);
        filter: drop-shadow(0 0 5px rgba(224, 242, 254, 0.9));
    }
}

/* Thunder - electric flash */
.weather-badge .weather-icon.weather-thunderstorm svg {
    color: #facc15;
    animation: thunderGem 1.5s ease-in-out infinite;
}

@keyframes thunderGem {
    0%, 80%, 100% {
        filter: drop-shadow(0 0 2px rgba(250, 204, 21, 0.4));
    }
    85%, 95% {
        filter: drop-shadow(0 0 8px rgba(250, 204, 21, 1));
    }
}

/* PNG Cloud Weather Icons */
.weather-badge .weather-icon.weather-png {
    width: 28px;
    height: 28px;
    overflow: visible;
}

.weather-cloud-wrapper {
    position: relative;
    width: 100%;
    height: 70%;
    z-index: 2;
}

.weather-cloud-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: cloudFloat 4s ease-in-out infinite;
}

@keyframes cloudFloat {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(2px); }
}

/* Rain drops */
.weather-rain-drops {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 60%;
    pointer-events: none;
    z-index: 1;
}

.weather-drop {
    position: absolute;
    width: 2px;
    height: 6px;
    background: linear-gradient(to bottom, #60a5fa, #3b82f6);
    border-radius: 2px;
    animation: rainFall 0.8s linear infinite;
    opacity: 0.9;
}

@keyframes rainFall {
    0% {
        transform: translateY(-4px);
        opacity: 0;
    }
    20% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(12px);
        opacity: 0;
    }
}

/* Snowflakes */
.weather-snowflakes {
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 70%;
    pointer-events: none;
    z-index: 1;
}

.weather-flake {
    position: absolute;
    background: radial-gradient(circle, #ffffff 0%, #e0f2fe 50%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
}

.weather-flake:nth-child(1) {
    width: 4px;
    height: 4px;
    animation: snowFall1 2.5s ease-in-out infinite;
}

.weather-flake:nth-child(2) {
    width: 3px;
    height: 3px;
    animation: snowFall2 3s ease-in-out infinite 0.5s;
}

.weather-flake:nth-child(3) {
    width: 5px;
    height: 5px;
    animation: snowFall3 2.8s ease-in-out infinite 1s;
}

.weather-flake:nth-child(4) {
    width: 3px;
    height: 3px;
    animation: snowFall1 3.2s ease-in-out infinite 1.5s;
}

.weather-flake:nth-child(5) {
    width: 4px;
    height: 4px;
    animation: snowFall2 2.6s ease-in-out infinite 0.8s;
}

@keyframes snowFall1 {
    0% {
        transform: translateY(-2px) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    50% {
        transform: translateY(6px) translateX(-3px);
        opacity: 0.8;
    }
    100% {
        transform: translateY(14px) translateX(2px);
        opacity: 0;
    }
}

@keyframes snowFall2 {
    0% {
        transform: translateY(-2px) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.85;
    }
    50% {
        transform: translateY(5px) translateX(3px);
        opacity: 0.7;
    }
    100% {
        transform: translateY(12px) translateX(-2px);
        opacity: 0;
    }
}

@keyframes snowFall3 {
    0% {
        transform: translateY(-2px) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.95;
    }
    30% {
        transform: translateY(3px) translateX(-2px);
    }
    70% {
        transform: translateY(8px) translateX(3px);
        opacity: 0.6;
    }
    100% {
        transform: translateY(14px) translateX(0);
        opacity: 0;
    }
}

/* Lightning bolt */
.weather-lightning {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    animation: lightningFlash 2s ease-in-out infinite;
}

.weather-lightning svg {
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.8));
}

@keyframes lightningFlash {
    0%, 75%, 100% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
    80%, 85% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    82% {
        opacity: 0.3;
    }
    90% {
        opacity: 0;
    }
}

/* Cloud color adjustments */
.weather-badge .weather-icon.weather-cloudy .weather-cloud-img,
.weather-badge .weather-icon.weather-partly-cloudy-day .weather-cloud-img,
.weather-badge .weather-icon.weather-partly-cloudy-night .weather-cloud-img {
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.3));
}

.weather-badge .weather-icon.weather-rain .weather-cloud-img {
    filter: brightness(0.7) saturate(0.8) drop-shadow(0 1px 3px rgba(56, 189, 248, 0.4));
}

.weather-badge .weather-icon.weather-drizzle .weather-cloud-img {
    filter: brightness(0.8) saturate(0.85) drop-shadow(0 1px 2px rgba(56, 189, 248, 0.3));
}

.weather-badge .weather-icon.weather-snow .weather-cloud-img {
    filter: brightness(0.9) saturate(0.9) drop-shadow(0 1px 3px rgba(224, 242, 254, 0.5));
}

.weather-badge .weather-icon.weather-thunderstorm .weather-cloud-img {
    filter: brightness(0.5) saturate(0.6) drop-shadow(0 1px 4px rgba(250, 204, 21, 0.4));
}

/* Compact info */
.weather-badge-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.weather-badge .weather-temp {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: -0.02em;
}

/* Username wrapper with weather above/below */
.weather-username-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    margin-left: 8px;
    opacity: 0;
    animation: gemReveal 0.4s ease-out forwards;
}

/* Icon+degrees above username */
.weather-username-wrapper .weather-icon-wrapper {
    display: inline-flex;
    align-items: center;
    position: relative;
    overflow: visible;
    margin-bottom: -2px;
}

.weather-username-wrapper .weather-icon {
    width: 22px;
    height: 22px;
    overflow: visible;
}

.weather-username-wrapper .weather-icon svg {
    width: 16px;
    height: 16px;
}

/* Temperature next to icon */
.weather-username-wrapper .weather-temp-badge {
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-left: 3px;
    line-height: 1;
}

/* City below */
.weather-username-wrapper .weather-city {
    font-size: 0.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
    margin-top: -2px;
}

/* Large screens - more presence */
@media (min-width: 1200px) {
    .greeting-text {
        font-size: 1.65rem;
    }
}

/* Responsive greeting text */
@media (max-width: 768px) {
    .greeting-container {
        padding: 0 0.5rem 0.15rem;
    }

    .greeting-text {
        font-size: 1.35rem;
    }
}

@media (max-width: 480px) {
    .greeting-container {
        padding: 0 0.5rem 0.1rem;
    }

    .greeting-text {
        font-size: 1.2rem;
    }
}

/* ================================
   Background Request Notification Dot
   ================================ */

/* Notification dot for session tabs with completed background requests */
.chat-tab .session-notification-dot {
    display: none;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    flex-shrink: 0;
    animation: notification-pulse 2s ease-in-out infinite;
}

.chat-tab.has-notification .session-notification-dot {
    display: inline-block;
}

/* Pulse animation for notification dot */
@keyframes notification-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.85);
    }
}

/* Tab content layout for notification dot */
.chat-tab .tab-content {
    display: flex;
    align-items: center;
}

.chat-tab .tab-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
