/* B2B Google Material 3 Design System & Theme Tokens */
:root {
    --primary-color: #9B86CD;
    --primary-hover: #8670b8;
    --primary-light: #f3eff9;
    --primary-text: #ffffff;

    --bg-app: #f8f9fc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f4f9;
    --bg-border: #e2e8f0;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --user-bubble-bg: #9B86CD;
    --user-bubble-text: #ffffff;
    --agent-bubble-bg: #ffffff;
    --agent-bubble-text: #1e293b;
    --agent-bubble-border: #e2e8f0;

    /* B2B Professional Radii */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);

    --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-fast: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Tokens (#52525b Professional Gray Theme) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-app: #52525b;
        --bg-surface: #3f3f46;
        --bg-surface-elevated: #27272a;
        --bg-border: #71717a;

        --text-primary: #ffffff;
        --text-secondary: #e4e4e7;
        --text-muted: #d4d4d8;

        --user-bubble-bg: #8972bd;
        --user-bubble-text: #ffffff;
        --agent-bubble-bg: #3f3f46;
        --agent-bubble-text: #ffffff;
        --agent-bubble-border: #71717a;
    }
}

[data-theme="dark"] {
    --bg-app: #52525b;
    --bg-surface: #3f3f46;
    --bg-surface-elevated: #27272a;
    --bg-border: #71717a;

    --text-primary: #ffffff;
    --text-secondary: #e4e4e7;
    --text-muted: #d4d4d8;

    --user-bubble-bg: #8972bd;
    --user-bubble-text: #ffffff;
    --agent-bubble-bg: #3f3f46;
    --agent-bubble-text: #ffffff;
    --agent-bubble-border: #71717a;
}

/* Custom Sleek B2B Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--bg-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Global Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow: hidden;
}

/* App Container Layout Structure */
.app-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    overflow: hidden;
}

.chat-app-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.chat-body-container {
    flex: 1;
    display: flex;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Sidebar Drawer (Flows under Header) */
.sidebar-drawer {
    width: 280px;
    height: 100%;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--bg-border);
    display: flex;
    flex-direction: column;
    z-index: 80;
    transition: width var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-drawer.collapsed-desktop {
    width: 0;
    border-right: none;
    opacity: 0;
    pointer-events: none;
}

.sidebar-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--bg-border);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #9B86CD, #7b64b8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

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

.brand-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.brand-tag {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.sidebar-actions {
    padding: 12px 16px;
}

.btn-create-chat {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-create-chat:hover {
    background-color: var(--primary-hover);
}

.sidebar-filter-tabs {
    display: flex;
    padding: 0 16px;
    gap: 6px;
    border-bottom: 1px solid var(--bg-border);
}

.filter-tab {
    flex: 1;
    padding: 8px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.sidebar-sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.empty-sessions {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.session-item {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    transition: background-color var(--transition-fast);
}

.session-item:hover {
    background-color: var(--bg-surface-elevated);
}

.session-item.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

[data-theme="dark"] .session-item.active {
    background-color: rgba(155, 134, 205, 0.2);
}

.session-icon {
    color: var(--text-secondary);
    display: flex;
}

.session-item.active .session-icon {
    color: var(--primary-color);
}

.session-info {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.session-title {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* 3-Dots Menu Dropdown in Sidebar Session Item */
.session-menu-container {
    position: relative;
}

.btn-dots-menu {
    background: none;
    border: none;
    padding: 4px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-dots-menu:hover {
    background-color: var(--bg-border);
    color: var(--text-primary);
}

.session-dropdown-menu {
    position: absolute;
    right: 0;
    top: 26px;
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 120;
    min-width: 120px;
}

.dropdown-menu-item {
    background: none;
    border: none;
    padding: 6px 10px;
    font-size: 0.78rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    width: 100%;
    text-align: left;
}

.dropdown-menu-item:hover {
    background-color: var(--bg-surface-elevated);
}

.dropdown-menu-item.danger {
    color: #ef4444;
}

.dropdown-menu-item.danger:hover {
    background-color: #fef2f2;
}

[data-theme="dark"] .dropdown-menu-item.danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.sidebar-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--bg-border);
}

.btn-theme-toggle {
    width: 100%;
    padding: 8px;
    border-radius: var(--radius-md);
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--bg-border);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

/* Main Chat Canvas */
.chat-main-canvas {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-app);
    min-width: 0;
}

/* Chat Header (Fixed at Top, spans full width) */
.chat-header {
    height: 60px;
    min-height: 60px;
    padding: 0 20px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--bg-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 100;
    width: 100%;
    flex-shrink: 0;
}

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

.sidebar-toggle-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--bg-border);
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-title-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-title {
    font-size: 0.98rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

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

.control-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.control-label {
    font-weight: 500;
}

.form-select-header, .form-select-sm {
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-border);
    background-color: var(--bg-surface-elevated);
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
}

.form-select-header:focus, .form-select-sm:focus {
    border-color: var(--primary-color);
}

.action-buttons {
    display: flex;
    gap: 6px;
}

.btn-icon {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-border);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background-color: var(--bg-surface-elevated);
}

.btn-icon.text-danger {
    color: #ef4444;
}

.btn-icon.text-danger:hover {
    background-color: #fef2f2;
}

/* Chat Messages Thread */
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.chat-welcome-hero {
    margin: auto;
    text-align: center;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.chat-welcome-hero h1 {
    font-size: 1.35rem;
    font-weight: 700;
}

.chat-welcome-hero p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Message Wrapper & Bubbles */
.message-wrapper {
    display: flex;
    gap: 10px;
    max-width: 80%;
}

.message-wrapper.user-wrapper {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-wrapper.agent-wrapper {
    align-self: flex-start;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar.user-avatar {
    background-color: var(--primary-color);
    color: white;
}

.avatar.agent-avatar {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--bg-border);
    color: var(--primary-color);
}

.message-content-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.message-meta {
    display: flex;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.user-wrapper .message-meta {
    justify-content: flex-end;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    font-size: 0.88rem;
    line-height: 1.5;
    word-break: break-word;
}

.message-bubble.user-bubble {
    background-color: var(--user-bubble-bg);
    color: var(--user-bubble-text);
    border-bottom-right-radius: 2px;
}

.message-bubble.agent-bubble {
    background-color: var(--agent-bubble-bg);
    color: var(--agent-bubble-text);
    border: 1px solid var(--agent-bubble-border);
    border-bottom-left-radius: 2px;
    box-shadow: var(--shadow-sm);
}

/* Typing Indicator Animation */
.typing-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    min-width: 60px;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--primary-color);
    opacity: 0.4;
    animation: pulseDot 1.4s infinite ease-in-out;
}

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

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

@keyframes pulseDot {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Barcode Preview Card Component - Modern Studio Stage Layout */
.barcode-preview-card {
    margin-top: 12px;
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bg-border);
}

.card-header .header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-main {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-color);
}

.title-sub {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.badge {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
}

.badge.badge-preview {
    background-color: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge.badge-success {
    background-color: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Image Stage Studio View */
.image-stage {
    position: relative;
    background: radial-gradient(circle at center, #262938 0%, #15161e 100%);
    padding: 24px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-border);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.stage-overlay-badge {
    position: absolute;
    top: 10px;
    right: 12px;
}

.badge-size {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #a1a1aa;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.label-img-preview {
    max-width: 100%;
    max-height: 380px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.label-img-preview:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* Detailed LMIV Grid Layout */
.label-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-card {
    background-color: var(--bg-app);
    border: 1px solid var(--bg-border);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-card.full-width {
    grid-column: span 2;
}

.detail-card .card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--bg-border);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.info-label {
    color: var(--text-muted);
}

.info-val {
    color: var(--text-color);
}

.highlight-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.badge-pill {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-pill.volume { background-color: #1e3a8a; color: #93c5fd; }
.badge-pill.deposit { background-color: #065f46; color: #6ee7b7; }
.badge-pill.alc { background-color: #831843; color: #f472b6; }

.badge-code {
    background-color: #312e81;
    color: #c7d2fe;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.code-box {
    background-color: #18181b;
    color: #38bdf8;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.78rem;
    border: 1px solid #27272a;
}

/* Ingredients & Producer Content */
.ingredients-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.76rem;
    line-height: 1.35;
}

.allergen-text {
    color: #f87171;
}

.producer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--bg-border);
}

.sub-label {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.sub-val {
    font-size: 0.74rem;
    color: var(--text-color);
}

/* Nutrition Chips Grid */
.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.nut-chip {
    background-color: var(--bg-surface);
    border: 1px solid var(--bg-border);
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nut-key {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.nut-val {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Action Toolbar */
.card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.download-group {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
}

.btn-lg {
    padding: 10px 16px;
    font-size: 0.88rem;
    font-weight: 600;
}

.btn-outline-primary {
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-outline-primary:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

.btn-success-light {
    background-color: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-success-light:hover {
    background-color: rgba(34, 197, 94, 0.25);
}

.meta-value {
    font-weight: 600;
}

.badge-type {
    color: var(--primary-color);
}

.meta-code {
    font-family: monospace;
    background-color: var(--bg-surface-elevated);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.format-options {
    display: flex;
    gap: 6px;
}

.format-options .form-select-sm {
    flex: 1;
}

.btn {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.btn.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.btn-secondary {
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--bg-border);
    color: var(--text-primary);
}

.btn.btn-secondary:hover {
    background-color: var(--bg-border);
}

/* Chat Input Container */
.chat-input-container {
    padding: 12px 20px 16px;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--bg-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.suggestion-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    max-width: 100%;
}

.suggestion-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.chip {
    padding: 4px 10px;
    border-radius: 12px;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--bg-border);
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.input-form-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background-color: var(--bg-app);
    border: 1.5px solid var(--bg-border);
    border-radius: var(--radius-lg);
    padding: 6px 10px;
    transition: border-color var(--transition-fast);
    width: 100%;
}

.input-form-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(155, 134, 205, 0.2);
}

.chat-textarea {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    resize: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    padding: 4px;
    max-height: 120px;
    min-width: 0;
}

.btn-send {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--bg-border);
    color: var(--text-muted);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: not-allowed;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.btn-send.active {
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
}

.btn-send.active:hover {
    background-color: var(--primary-hover);
}

.input-validation-error {
    font-size: 0.75rem;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Spinners */
.spinner, .spinner-sm {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

.spinner {
    width: 14px;
    height: 14px;
}

.spinner-sm {
    width: 12px;
    height: 12px;
}

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

/* Responsive Rules for Mobile */
@media (max-width: 768px) {
    .sidebar-drawer {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        width: 280px !important;
        box-shadow: var(--shadow-lg);
    }

    .sidebar-drawer.open-mobile {
        transform: translateX(0);
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.4);
        z-index: 70;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .chat-header {
        padding: 8px 12px;
        min-height: 54px;
    }

    .chat-title {
        font-size: 0.88rem;
        max-width: 110px;
    }

    .header-controls {
        gap: 6px;
    }

    .control-group {
        font-size: 0.75rem;
    }

    .form-select-header {
        padding: 4px 6px;
        font-size: 0.75rem;
    }

    .btn-label-text {
        display: none;
    }

    .chat-messages-container {
        padding: 12px;
    }

    .message-wrapper {
        max-width: 92%;
    }

    .message-bubble {
        padding: 8px 12px;
        font-size: 0.84rem;
    }

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