:root {
    --bg-color: #f1f5f9;
    --panel-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-bright: #818cf8;
    --success: #10b981;
    --radius-lg: 24px;
    --radius-md: 16px;
    --font-code: 'Fira Code', monospace;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.05) 0px, transparent 50%);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-container { 
    display: flex; 
    flex-direction: row; 
    height: 100vh; 
    width: 100vw;
    overflow: hidden;
    background: var(--bg-color);
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: #f8fafc;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow: hidden;
    position: relative;
}

.sidebar.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
}

.sidebar-header, .sidebar-content, .sidebar-footer {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-header { padding: 24px 16px; }

.btn-new-chat {
    width: 100%;
    background: white;
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.btn-new-chat:hover {
    background: #f1f5f9;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 12px 8px;
}

.history-sidebar-list { display: flex; flex-direction: column; gap: 4px; }

.history-item {
    padding: 10px 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
    font-size: 0.9rem;
    group;
}

.history-item:hover { background: #e2e8f0; }
.history-item.active { background: #f1f5f9; color: var(--accent); border-right: 3px solid var(--accent); }

/* Refinements in Sidebar */
.history-item-container {
    margin-bottom: 4px;
}

.history-refinements {
    margin-left: 20px;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
    margin-top: 4px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-ref-item {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    transition: 0.2s;
}

.history-ref-item:hover {
    color: var(--text-main);
    background: #f1f5f9;
}

.ref-icon { font-size: 0.6rem; opacity: 0.5; }

.history-item-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-actions { display: flex; gap: 4px; opacity: 0; }
.history-item:hover .history-item-actions { opacity: 1; }

.history-item-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-item-btn.delete:hover { color: #ef4444; background: #fee2e2; }

.sidebar-footer-btn {
    width: 100%;
    background: transparent;
    border: none;
    padding: 10px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: 0.2s;
}

.sidebar-footer-btn:hover { background: #e2e8f0; }

/* Main Content Layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
    background: #f1f5f9; /* Светлый фон для контраста с панелями */
    padding: 20px;
    gap: 20px;
}

/* Header Adjustments */
.app-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 24px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

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

.btn-icon-only {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.btn-icon-only:hover { background: #f1f5f9; color: var(--text-main); }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 1.5rem; }
.logo h1 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text-main); }
.badge { font-size: 0.65rem; background: linear-gradient(135deg, #6366f1, #a855f7); color: white; padding: 4px 8px; border-radius: 8px; font-weight: 700; }
.header-actions { display: flex; gap: 12px; }

/* Panels */
.app-main { 
    display: grid; 
    grid-template-columns: 480px 4px 1fr; 
    gap: 20px; 
    flex: 1; 
    min-height: 0; 
}

.resizer {
    width: 4px;
    cursor: col-resize;
    position: relative;
    z-index: 10;
    background: transparent;
    transition: background 0.3s;
}

.resizer:hover, .resizer.dragging {
    background: var(--accent);
    border-radius: 4px;
}

.resizer::after {
    display: none; /* Убираем старую иконку */
}

.panel { 
    background: var(--panel-bg); 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-lg); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    box-shadow: var(--shadow-md); 
}

.panel-header { 
    padding: 16px 24px; 
    background: #ffffff; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.panel-content { flex: 1; display: flex; flex-direction: column; padding: 20px; gap: 16px; min-height: 0; }

/* Input Tabs */
.input-tab-content { display: none; flex: 1; flex-direction: column; gap: 16px; min-height: 0; }
.input-tab-content.active { display: flex; }

#input-container { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }

textarea#user-text { 
    flex: 1; 
    background: #fdfdfd; 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-md); 
    color: var(--text-main); 
    padding: 20px; 
    font-size: 1rem; 
    outline: none; 
    resize: none; 
    line-height: 1.7; 
}

.drop-zone {
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: #f8fafc;
    transition: 0.3s;
    cursor: pointer;
    gap: 8px;
    text-align: center;
    margin-top: 12px;
}

.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); background: #f5f3ff; }
.drop-icon { font-size: 1.8rem; opacity: 0.8; }
.drop-zone p { font-size: 0.9rem; font-weight: 700; color: var(--text-main); }
.drop-zone span { font-size: 0.75rem; color: var(--text-muted); }

/* User Profile Header */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.user-profile:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.username {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.logout-link {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.logout-link:hover {
    color: #ef4444;
}

/* Input Footer & Counter */
.input-footer {
    display: flex;
    justify-content: flex-end;
    padding: 8px 0;
}

.char-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

#char-count {
    color: var(--accent);
    font-weight: 600;
}

/* Vision Preview */
.vision-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f1f5f9;
    border-radius: var(--radius-md);
    min-height: 0;
}

#vision-img-preview {
    max-width: 100%;
    max-height: calc(100% - 40px);
    border-radius: 12px;
    object-fit: contain;
    box-shadow: var(--shadow-md);
}

.vision-options {
    padding: 12px;
    background: #f5f3ff;
    border-radius: 16px;
    border: 1px solid #ddd6fe;
}

/* Status Bar */
.generation-status { 
    padding: 16px 24px; 
    border-bottom: 1px solid var(--border-color); 
    background: #fff;
    position: relative;
}
.status-content { display: flex; align-items: center; gap: 12px; }
.status-icon { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.status-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }

.progress-bar { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: #f1f5f9; }
.progress-fill { height: 100%; background: var(--accent); transition: 0.3s; width: 0; }

.generation-status.thinking .status-icon { background: var(--accent); animation: pulse-indigo 2s infinite; }
.generation-status.success { background: #f0fdf4; }
.generation-status.success .status-icon { background: var(--success); }
.generation-status.success .status-label { color: var(--success); }

@keyframes pulse-indigo { 0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); } 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); } }

/* Buttons */
.action-group { display: flex; gap: 12px; width: 100%; }
.action-group button { flex: 1; }
.action-group .btn-stop { flex: 0 0 auto; }

.btn-primary-main {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    padding: 18px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-premium-copy {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    color: var(--accent);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-stop {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #ef4444;
    padding: 0 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
}

/* Tabs */
.tabs { display: flex; gap: 8px; background: #f1f5f9; padding: 4px; border-radius: 12px; }
.tab-btn { 
    background: transparent; 
    border: none; 
    color: var(--text-muted); 
    padding: 8px 16px; 
    font-size: 0.85rem; 
    font-weight: 600; 
    border-radius: 8px; 
    cursor: pointer; 
}
.tab-btn.active { background: white; color: var(--accent); box-shadow: var(--shadow-sm); }

.tab-content { display: none; height: 100%; min-height: 0; }
.tab-content.active { display: block; }

.code-wrapper { height: 100%; background: #1e293b; border-radius: var(--radius-md); overflow: hidden; }
pre { height: 100%; padding: 20px; overflow: auto; font-family: var(--font-code); font-size: 0.85rem; line-height: 1.6; color: #e2e8f0; }

#preview-frame { width: 100%; height: 100%; border: none; background: white; border-radius: var(--radius-md); }

/* Modal System */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(8px); }
.modal-container { 
    position: relative; 
    width: 90%; 
    max-width: 1000px; 
    max-height: 90vh; 
    background: white; 
    border-radius: 24px; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    box-shadow: 0 40px 100px rgba(0,0,0,0.2);
    animation: modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-container.modal-small {
    max-width: 450px;
    height: auto;
}

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

.modal-header { padding: 24px 40px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 1.5rem; font-weight: 800; color: var(--text-main); }
.btn-close { background: none; border: none; font-size: 2rem; color: var(--text-muted); cursor: pointer; }

.modal-content { 
    flex: 1; 
    padding: 32px 40px; 
    overflow-y: auto; 
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Auth Form Styling */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.form-group input {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
}

.form-group input:focus {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.auth-form .btn-primary-main {
    margin-top: 10px;
    width: 100%;
}

.auth-toggle {
    text-align: center;
    margin-top: 10px;
}


.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }

/* History Grid */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.history-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.history-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.history-card.active { border-color: var(--accent); background: #f5f3ff; }

.user-profile-sidebar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.user-details-sidebar { display: flex; flex-direction: column; line-height: 1.2; }
.username-sidebar { font-size: 0.8rem; font-weight: 700; }
.logout-link-sidebar { font-size: 0.7rem; color: var(--text-muted); border: none; background: none; padding: 0; text-align: left; cursor: pointer; text-decoration: underline; }


.history-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    height: 100%;
    color: var(--text-muted);
}

.history-empty-state .icon { font-size: 4rem; opacity: 0.2; }

/* Settings Modal Premium */
.settings-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 24px; 
    padding: 4px;
}

.settings-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: 0.3s;
}

.hint-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.settings-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }

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

.settings-card-header .icon {
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.settings-card-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-main); margin: 0; }

.settings-card-body { flex: 1; }

/* Chips Styling */
.chips-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip { cursor: pointer; position: relative; }
.chip input { position: absolute; opacity: 0; cursor: pointer; width: 0; height: 0; }

.chip span {
    display: inline-block;
    padding: 6px 14px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
}

.chip:hover span { border-color: var(--accent); color: var(--accent); }
.chip input:checked + span { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }

/* Checkbox List */
.checkbox-list { display: flex; flex-direction: column; gap: 12px; }
.checkbox-item { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.checkbox-item input { display: none; }
.checkbox-custom { width: 20px; height: 20px; border: 2px solid var(--border-color); border-radius: 6px; position: relative; transition: 0.2s; background: white; }
.checkbox-item input:checked + .checkbox-custom { background: var(--accent); border-color: var(--accent); }
.checkbox-item input:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.settings-footer-actions { margin-top: 32px; display: flex; justify-content: flex-end; }
.btn-primary-main { background: var(--accent); color: white; border: none; padding: 14px 32px; border-radius: 16px; font-weight: 700; cursor: pointer; transition: 0.2s; }
.btn-primary-main:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4); }

/* Drop Zone Premium */
.drop-zone {
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(8px);
    border: 3px dashed #cbd5e1;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: var(--accent);
    background: rgba(238, 242, 255, 0.98);
}

.drop-zone-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-zone-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.drop-zone-text { font-size: 1.25rem; font-weight: 700; color: var(--text-main); }
.drop-zone-subtext { font-size: 0.85rem; color: var(--text-muted); }

.btn-browse-mini {
    margin-top: 8px;
    background: white;
    border: 1px solid var(--border-color);
    padding: 8px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
}
.btn-browse-mini:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-sm); }

.code-editor-mini {
    width: 100%;
    height: 120px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    font-family: var(--font-code);
    font-size: 0.8rem;
    resize: vertical;
    outline: none;
    transition: 0.2s;
}

.code-editor-mini:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }

/* Fullscreen Card Mode */
.btn-expand-card {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    transition: 0.2s;
}

.btn-expand-card:hover { background: #e2e8f0; color: var(--accent); }

.settings-card.fullscreen {
    position: fixed;
    inset: 40px;
    z-index: 2000;
    background: white;
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    padding: 30px;
}

.settings-card.fullscreen .settings-card-body {
    flex: 1;
    display: flex;
}

.settings-card.fullscreen .code-editor-mini {
    height: 100% !important;
    font-size: 1rem;
}



/* Feedback & Chat */
.feedback-section { padding: 24px; background: white; border-top: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 16px; }

.chat-history {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 8px;
}

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

.chat-message.user { align-items: flex-end; }
.chat-message.assistant { align-items: flex-start; }

.message-bubble {
    max-width: 85%;
    padding: 10px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
}

.chat-message.user .message-bubble {
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .message-bubble {
    background: #f1f5f9;
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}

.message-role {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
    opacity: 0.7;
}

.message-text { word-break: break-word; }

.feedback-input-wrapper { display: flex; gap: 16px; background: #f8fafc; border: 1px solid var(--border-color); border-radius: 20px; padding: 12px; }
textarea#feedback-text { flex: 1; background: transparent; border: none; color: var(--text-main); padding: 12px; font-size: 1rem; outline: none; resize: none; height: 100px; }
.btn-refine { background: var(--accent); color: white; border: none; padding: 14px 28px; border-radius: 16px; font-weight: 700; cursor: pointer; }

.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
