/* Smiley Hub - Stylesheet */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark: #0a0f1a;
    --bg-darker: #060a12;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --bg-input: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --border-color: #1e293b;
    --border-light: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

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

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

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

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

.btn-success {
    background: var(--accent-green);
    color: white;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--accent-red);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--accent-green);
    color: #6ee7b7;
}

/* ===== AUTH PAGES ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header .logo {
    font-size: 48px;
    margin-bottom: 12px;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-form {
    margin-bottom: 20px;
}

.auth-footer {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-blue);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ===== APP LAYOUT ===== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 220px;
    background: var(--bg-darker);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    font-size: 28px;
}

.sidebar-header .logo-text {
    font-size: 18px;
    font-weight: 600;
}

.nav-menu {
    list-style: none;
    padding: 12px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 4px;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-blue);
    color: white;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    font-size: 20px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
}

.logout-btn:hover {
    background: var(--bg-card);
    color: var(--accent-red);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== CHAT VIEW ===== */
.chat-view {
    display: flex;
    height: 100%;
}

.chat-sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.back-link {
    font-size: 13px;
    color: var(--accent-blue);
    text-decoration: none;
    width: 100%;
}

.back-link:hover {
    text-decoration: underline;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
}

.chat-item:hover {
    background: var(--bg-card-hover);
}

.chat-item.active {
    background: var(--bg-input);
    border: 1px solid var(--border-light);
}

.chat-item-icon {
    font-size: 18px;
}

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

.chat-item-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.chat-item-delete {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: var(--transition);
}

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

.chat-item-delete:hover {
    color: var(--accent-red);
}

/* Chat Main */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

/* AI Selector Dropdown */
.ai-selector {
    position: relative;
}

.ai-selector-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.ai-selector-btn:hover {
    border-color: var(--border-light);
}

/* Service Lock Styles */
.ai-selector-btn.locked {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-card-hover);
}

.ai-selector-btn.locked::after {
    content: '🔒';
    font-size: 12px;
    margin-left: 6px;
}

.ai-selector-btn.locked:hover {
    border-color: var(--border-color);
}

.dropdown-arrow {
    margin-left: 4px;
    transition: transform 0.2s;
}

.ai-selector.open .dropdown-arrow {
    transform: rotate(180deg);
}

.ai-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 100;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.ai-selector.open .ai-dropdown {
    display: block;
}

.ai-dropdown-group {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.ai-dropdown-group:last-child {
    border-bottom: none;
}

.ai-dropdown-label {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.ai-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
}

.ai-dropdown-item:hover {
    background: var(--bg-card-hover);
}

.ai-dropdown-item.selected {
    background: rgba(59, 130, 246, 0.15);
}

.ai-dropdown-item-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.ai-dropdown-item-content {
    flex: 1;
}

.ai-dropdown-item-name {
    font-size: 14px;
    font-weight: 500;
}

.ai-dropdown-item-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-chat h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    max-width: 85%;
}

.message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--accent-blue);
}

.message-content {
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.message.user .message-content {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.message-text {
    font-size: 14px;
    line-height: 1.6;
}

.message-text p {
    margin-bottom: 12px;
}

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

.message-text img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 8px 0;
}

.message-text code {
    background: var(--bg-darker);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
}

.message-text pre {
    background: var(--bg-darker);
    padding: 14px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 12px 0;
    position: relative;
}

.message-text pre code {
    background: none;
    padding: 0;
    display: block;
    font-size: 13px;
    line-height: 1.5;
}

.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 11px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.code-copy-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.message-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* Token-/Zeit-Statistik: rechts unten, y-zentriert auf der Aktionszeile */
.message-stats {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 9px;
    background: var(--bg-input);
    border: 1px solid var(--border-light, rgba(255,255,255,0.08));
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    color: var(--text-muted);
    white-space: nowrap;
    user-select: none;
}

.message-stats .stat {
    display: inline-flex;
    align-items: center;
    font-variant-numeric: tabular-nums;
}

.message-action-btn {
    padding: 4px 8px;
    font-size: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
}

.message-action-btn:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* Chat Input Area */
.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.input-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.toolbar-btn:hover {
    border-color: var(--border-light);
}

.toolbar-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.image-preview {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
}

.image-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
    min-height: 48px;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-wrapper textarea {
    flex: 1;
    border: none;
    background: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    line-height: 24px;
    resize: none;
    min-height: 24px;
    max-height: 150px;
    outline: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

.input-wrapper textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.voice-btn,
.send-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.voice-btn {
    font-size: 20px;
    color: var(--text-secondary);
}

.voice-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.voice-btn.recording {
    color: var(--accent-red);
    animation: pulse 1s infinite;
}

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

.send-btn {
    background: var(--accent-blue);
    color: white;
}

.send-btn:hover {
    background: var(--accent-blue-hover);
}

/* ===== PROJECTS VIEW ===== */
.projects-view {
    padding: 24px;
    overflow-y: auto;
    height: 100%;
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.view-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.project-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.project-icon {
    font-size: 32px;
}

.project-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-actions {
    opacity: 1;
}

.project-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.project-action-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.project-action-btn.delete:hover {
    color: var(--accent-red);
}

.project-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.project-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.project-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.git-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    margin: 20px;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 24px;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}

/* ===== CODE VIEW ===== */
/* ===== CODE REASONING AGENT ===== */
.code-agent-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.code-agent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.code-agent-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.code-agent-icon {
    font-size: 32px;
}

.code-agent-title h2 {
    margin: 0;
    font-size: 18px;
}

.code-agent-title p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.code-agent-model-select {
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.code-agent-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.code-agent-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.code-agent-message {
    margin-bottom: 20px;
}

.code-agent-message.system .message-content {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.code-agent-message.system h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
}

.code-agent-message.system ul {
    margin: 12px 0 0 0;
    padding-left: 20px;
}

.code-agent-message.system li {
    margin: 6px 0;
}

.code-agent-message.user .message-content {
    background: var(--accent-blue);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-left: 40px;
}

.code-agent-message.assistant .message-content {
    background: var(--bg-input);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-right: 40px;
}

.code-agent-message .thinking-step {
    background: rgba(251, 191, 36, 0.1);
    border-left: 3px solid #fbbf24;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 14px;
}

.code-agent-message .thinking-step-title {
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 6px;
    font-size: 13px;
}

.code-agent-input-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.code-input-wrapper,
.question-input-wrapper {
    margin-bottom: 14px;
}

.code-input-wrapper label,
.question-input-wrapper label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.code-input {
    width: 100%;
    padding: 12px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    resize: vertical;
}

.question-input-wrapper textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
}

.code-input:focus,
.question-input-wrapper textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.code-agent-actions {
    display: flex;
    gap: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

/* Thinking Tags Styling für DeepSeek-R1 */
.thinking-example {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius);
    padding: 12px;
    margin: 12px 0;
}

.thinking-label {
    font-size: 12px;
    color: #fbbf24;
    margin-bottom: 6px;
}

.thinking-example code {
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.code-agent-message .message-content .hint {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin-top: 12px;
    font-size: 13px;
}

.code-agent-message .message-content .hint code {
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Thinking Block Rendering im Output */
.thinking-block {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
    border-left: 3px solid #fbbf24;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.thinking-block::before {
    content: '💭 Denkprozess';
    display: block;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== SERVICES VIEW ===== */
.services-view {
    padding: 24px;
    overflow-y: auto;
    height: 100%;
}

.auto-badge {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
}

.services-section {
    margin-bottom: 32px;
}

.services-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.services-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.status-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
}

.status-indicator.offline {
    background: var(--accent-red);
}

.status-indicator.loading {
    background: var(--accent-yellow);
    animation: pulse 1s infinite;
}

.models-list {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.loaded-models {
    margin-top: 12px;
    padding: 12px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius);
}

.loaded-models h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #fbbf24;
}

.loaded-models .loaded-model {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.loaded-models .loaded-model:last-child {
    border-bottom: none;
}

.loaded-models .model-name {
    font-weight: 500;
}

.loaded-models .model-size {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.loaded-models.empty {
    color: var(--text-muted);
    font-size: 13px;
}

.model-tag {
    background: var(--bg-input);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    border: 1px solid var(--border-color);
}

/* Laufstatus-Badge einer Sandbox */
.sb-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.sb-status-on       { background: rgba(34, 197, 94, 0.15);  color: #22c55e; }
.sb-status-starting { background: rgba(245, 158, 11, 0.18); color: #f59e0b; animation: sb-pulse 1.2s ease-in-out infinite; }
.sb-status-off      { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.sb-status-unknown  { background: rgba(148, 163, 184, 0.12); color: #94a3b8; }
@keyframes sb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
}

.service-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.service-card-icon {
    font-size: 24px;
}

.service-card-name {
    font-weight: 600;
    font-size: 15px;
}

.service-card-status {
    margin-left: auto;
}

.service-card-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.ai-services-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.ai-service-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.ai-service-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: var(--bg-input);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-service-info {
    flex: 1;
}

.ai-service-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.ai-service-model {
    font-size: 12px;
    color: var(--text-muted);
}

.ai-service-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
}

.ai-service-status.available {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.ai-service-status.unavailable {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* ===== NOTIFICATIONS ===== */
.notifications {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 14px;
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.notification.info {
    border-left: 3px solid var(--accent-blue);
}

.notification.success {
    border-left: 3px solid var(--accent-green);
}

.notification.error {
    border-left: 3px solid var(--accent-red);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== SYNTAX HIGHLIGHTING ===== */
.hljs-keyword { color: #c792ea; }
.hljs-string { color: #c3e88d; }
.hljs-comment { color: #546e7a; font-style: italic; }
.hljs-number { color: #f78c6c; }
.hljs-function { color: #82aaff; }
.hljs-class { color: #ffcb6b; }

/* ===== LOADING ===== */
.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .code-assistant {
        width: 300px;
    }
}

/* Streaming Cursor */
.cursor-blink {
    animation: cursorBlink 1s step-end infinite;
    color: var(--accent-blue);
}

@keyframes cursorBlink {
    50% { opacity: 0; }
}

/* Error Text */
.error-text {
    color: var(--accent-red);
}

/* Warning notification */
.notification.warning {
    background: #f59e0b;
    color: white;
}

@media (max-width: 992px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-header .logo-text,
    .nav-item span:not(.nav-icon),
    .user-name {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 14px;
    }
    
    .chat-sidebar {
        width: 240px;
    }
    
    .code-assistant {
        display: none;
    }
}

@media (max-width: 768px) {
    .chat-sidebar {
        display: none;
    }
    
    .code-sidebar {
        display: none;
    }
}

/* ===== Settings / Profil-View & Pre-Prompts ===== */
.settings-view {
    padding: 24px;
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
}

.settings-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.settings-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 14px;
    margin-bottom: -1px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.settings-tab:hover {
    color: var(--text-primary);
}

.settings-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.settings-panel {
    display: none;
    animation: settingsFade 0.15s ease;
}

.settings-panel.active {
    display: block;
}

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

.settings-textarea {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    transition: var(--transition);
}

.settings-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.settings-textarea::placeholder {
    color: var(--text-muted);
}

.settings-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 12px;
}

.char-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Zahnrad im Chat-Header */
.chat-settings-btn {
    margin-left: auto;
}

/* Chat-Pre-Prompt-Modal: Textarea volle Breite */
#chatPromptModal textarea {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
}

#chatPromptModal textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Chat-Header als Flex, damit das Zahnrad rechts sitzt */
.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Custom-Instructions-Indikator im Chat-Header (User #2) */
.preprompt-indicator {
    margin-left: auto;
    font-size: 12px;
    color: var(--accent, #6c8cff);
    background: rgba(108, 140, 255, 0.12);
    border: 1px solid rgba(108, 140, 255, 0.3);
    border-radius: 12px;
    padding: 3px 10px;
    text-decoration: none;
    white-space: nowrap;
}
.preprompt-indicator:hover { background: rgba(108, 140, 255, 0.22); }

/* Capability-Badges im Modell-Dropdown (User #11) */
.cap-badge {
    display: inline-block;
    font-size: 11px;
    line-height: 1;
    margin-left: 2px;
    opacity: 0.9;
    cursor: help;
}
.ai-dropdown-item-name { display: flex; align-items: center; gap: 4px; }

/* ===== Avatare (Batch B, User #8/#9/#10) ===== */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    overflow: hidden;
    flex-shrink: 0;
    user-select: none;
}
.avatar img, .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

/* Sidebar-Footer ist jetzt ein klickbarer Link zum Profil */
.user-info {
    text-decoration: none;
    color: inherit;
    padding: 6px 8px;
    border-radius: var(--radius-md, 8px);
    flex: 1;
    min-width: 0;
    transition: background 0.15s ease;
}
.user-info:hover, .user-info.active { background: var(--bg-input); }
.user-info .user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* User-Avatar in Chat-Nachrichten füllt das 36px-Rund */
.message.user .message-avatar { overflow: hidden; }
.message.user .message-avatar .avatar-img { width: 100%; height: 100%; object-fit: cover; }

/* Avatar-Einstellungen in der Profil-View */
.avatar-settings { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar-preview .avatar { width: 72px; height: 72px; font-size: 30px; }
.avatar-settings-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Batch F: QOL ===== */
/* Markdown-Blöcke in Nachrichten (F4) */
.message-text h1 { font-size: 1.4em; margin: 10px 0 6px; }
.message-text h2 { font-size: 1.25em; margin: 10px 0 6px; }
.message-text h3 { font-size: 1.1em; margin: 8px 0 4px; }
.message-text ul, .message-text ol { margin: 6px 0; padding-left: 22px; }
.message-text li { margin: 2px 0; }
.message-text blockquote {
    margin: 6px 0;
    padding: 4px 12px;
    border-left: 3px solid var(--accent-blue, #6c8cff);
    color: var(--text-muted, #9aa0b4);
}
.message-text hr { border: none; border-top: 1px solid var(--border-color); margin: 10px 0; }

/* Bild im Nachrichtenverlauf (F5) */
.message-image {
    max-width: 260px;
    max-height: 260px;
    border-radius: var(--radius-md, 8px);
    margin-bottom: 8px;
    display: block;
    object-fit: cover;
}

/* Stop-Button-Zustand des Sende-Buttons (F1) */
.send-btn.streaming { background: var(--danger, #e5484d); color: #fff; }
.chat-item-title { cursor: pointer; }

/* ===== Batch D: Code-Agent als Chat ===== */
.code-agent-header-actions { display: flex; align-items: center; gap: 10px; }
.code-agent-messages { display: flex; flex-direction: column; }
.code-agent-messages .empty-chat { margin: auto; }
/* Eingabebereich nutzt denselben .input-wrapper wie der Hauptchat */
.code-agent-input-area .input-wrapper { margin: 0; }
.code-agent-message.assistant .message-content { overflow-x: auto; }

/* ===== Zeilennummern neben Codeblöcken (eigene, nicht-selektierbare Spalte) ===== */
.message-text pre.code-block {
    display: flex;
    padding: 0;
    overflow: hidden;            /* horizontales Scrollen läuft im <code> */
}
.code-gutter {
    flex: 0 0 auto;
    padding: 14px 10px 14px 14px;
    text-align: right;
    color: var(--text-muted, #6b7280);
    background: rgba(0, 0, 0, 0.18);
    border-right: 1px solid var(--border-color);
    white-space: pre;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    pointer-events: none;        /* nicht anklick-/markierbar */
}
.message-text pre.code-block code {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    overflow-x: auto;
    white-space: pre;
    padding: 14px 14px 14px 12px;
    font-size: 13px;
    line-height: 1.5;
}

/* ===== Batch H: Mitglieder / Teilen ===== */
.chat-shared-badge { font-size: 11px; opacity: 0.85; }

/* Members-Modal hat kein <form> -> Body braucht eigenes Padding (sonst klebt alles am Rand) */
#membersModal #memberInviteSection { padding: 18px 20px 6px; }
#membersModal .members-list { padding: 6px 20px; }
#membersModal .modal-footer { padding: 16px 20px; margin-top: 8px; }
#membersModal .services-info { margin-bottom: 12px; line-height: 1.45; }

.invite-row { display: flex; gap: 8px; margin-bottom: 8px; }
.invite-row input {
    flex: 1; padding: 9px 12px; background: var(--bg-input);
    border: 1px solid var(--border-color); border-radius: var(--radius);
    color: var(--text-primary); font-size: 14px;
}
.invite-row select {
    padding: 9px 10px; background: var(--bg-input);
    border: 1px solid var(--border-color); border-radius: var(--radius);
    color: var(--text-primary); font-size: 14px; cursor: pointer;
}
.member-search-results { margin-bottom: 12px; }
.member-search-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border-radius: var(--radius); cursor: pointer;
}
.member-search-item:hover { background: var(--bg-input); }
.member-search-item .member-add { margin-left: auto; font-size: 12px; color: var(--accent-blue, #6c8cff); }
.member-search-empty { padding: 8px 10px; color: var(--text-muted); font-size: 13px; }

.members-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; }
.member-row .member-name { font-size: 14px; }
.member-row .member-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.member-role-tag { font-size: 12px; color: var(--text-muted); }
.member-role-select {
    padding: 4px 8px; background: var(--bg-input); border: 1px solid var(--border-color);
    border-radius: var(--radius); color: var(--text-primary); font-size: 13px; cursor: pointer;
}
.member-remove-btn {
    width: 24px; height: 24px; border-radius: 50%; border: none;
    background: var(--bg-input); color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1;
}
.member-remove-btn:hover { background: var(--danger, #e5484d); color: #fff; }
.btn-danger { background: var(--danger, #e5484d); color: #fff; }

/* ===== Batch H4: "jemand schreibt" Indikator ===== */
.others-generating {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    margin: 4px 0 8px 48px;
    font-size: 13px;
    color: var(--text-muted);
}
.others-generating .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-muted);
    display: inline-block;
    animation: og-bounce 1.2s infinite ease-in-out both;
}
.others-generating .dot:nth-child(2) { animation-delay: 0.15s; }
.others-generating .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes og-bounce {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

/* ===== DATEIEN / WEB-EDITOR (Epic I / I2) ===== */
.files-view { display: flex; height: 100%; }

.files-sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.files-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}
.files-sidebar-head h3 { font-size: 15px; font-weight: 600; }
.files-list { flex: 1; overflow-y: auto; padding: 8px; }
.files-empty { color: var(--text-muted); font-size: 13px; padding: 12px; }
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.file-item:hover { background: var(--bg-input); }
.file-item.active { background: var(--bg-input); }
.file-item-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-meta { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

.files-editor { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.file-editor-pane { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.file-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}
.file-name-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--text-primary);
    font-size: 14px;
}
.file-editor-status { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.file-editor-status.dirty { color: var(--warning, #e0a800); }
.file-editor-actions { display: flex; gap: 8px; flex-shrink: 0; }
.file-editor-body { flex: 1; display: flex; overflow: hidden; min-height: 0; }
.file-content-area {
    flex: 1;
    min-width: 0;
    resize: none;
    border: none;
    outline: none;
    background: var(--bg-primary, var(--bg-card));
    color: var(--text-primary);
    padding: 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    line-height: 1.5;
    tab-size: 4;
}

/* LaTeX-Export-Modal (I4): breiter + PDF-Vorschau-Höhe */
.modal-content.modal-lg { max-width: 900px; }
.latex-export-body {
    display: flex;
    height: 68vh;
    margin: 12px 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: #525659;
}
.latex-export-body .file-pdf-frame { flex: 1; }
.latex-export-body .file-pdf-error { flex: 1; }

/* PDF-Vorschau rechts neben dem Editor (LaTeX, I3) */
.file-pdf-pane {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    background: #525659; /* PDF-Viewer-Grau */
}
.file-pdf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.file-pdf-frame { flex: 1; width: 100%; border: none; }

/* SSH-Config-Karten (Profil) */
.ssh-config-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}
.ssh-config-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-card);
    font-size: 13px;
}
.ssh-direct-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
}
.ssh-direct {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: var(--text-primary);
    background: var(--bg-input);
    border-radius: 6px;
    padding: 6px 9px;
}
.ssh-config-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 12px 0;
    font-size: 12px;
    color: var(--text-muted);
}
.ssh-config-pre {
    margin: 0;
    padding: 12px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.5;
    white-space: pre;
    overflow-x: auto;
}

/* Workspace-View (I1) */
.workspace-view { display: flex; flex-direction: column; height: 100%; }
.workspace-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.workspace-info { display: flex; align-items: center; gap: 10px; }
.workspace-status { font-size: 12px; color: var(--text-muted); }
.workspace-actions { display: flex; align-items: center; gap: 10px; }
.workspace-pw {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 4px 8px;
    color: var(--text-primary);
    user-select: all;
}
.workspace-frame { flex: 1; width: 100%; border: none; background: #1e1e1e; }
/* Terminal/VS-Code-Umschalter (segmented control) */
.ws-viewswitch { display: inline-flex; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.ws-view-btn { background: var(--bg-input); color: var(--text-secondary); border: none; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.ws-view-btn + .ws-view-btn { border-left: 1px solid var(--border-color); }
.ws-view-btn.active { background: var(--accent-blue); color: #fff; }
.ws-spinner {
    width: 40px; height: 40px; margin: 0 auto 14px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-blue, #6c8cff);
    border-radius: 50%;
    animation: wsspin 0.8s linear infinite;
}
@keyframes wsspin { to { transform: rotate(360deg); } }

/* Code-Ausführung: Run-Pane mit Argumenten/stdin + Ausgabe (I5) */
.file-run-pane {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    background: var(--bg-card);
    overflow: hidden;
}
.run-io {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.run-label { font-size: 12px; color: var(--text-muted); }
.run-input, .run-stdin {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 7px 9px;
    color: var(--text-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    width: 100%;
    resize: vertical;
}
.run-io .btn { align-self: flex-start; }
.run-output-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.run-output {
    flex: 1;
    margin: 0;
    overflow: auto;
    padding: 12px 14px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
.file-pdf-error {
    flex: 1;
    margin: 0;
    overflow: auto;
    padding: 14px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Tool-Calling-Aktivität (Function-Calling im Chat) ─────────────────── */
.tool-activity {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 10px 0;
}
.tool-step {
    font-size: 13px;
    padding: 6px 10px;
    border-left: 3px solid var(--accent, #6c8cff);
    background: rgba(108, 140, 255, 0.07);
    border-radius: 4px;
}
.tool-step.pending { opacity: 0.85; }
.tool-step .tool-name { font-weight: 600; }
.tool-step .tool-args {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12px;
    opacity: 0.8;
}
.tool-step .tool-spinner { animation: toolblink 1s steps(3) infinite; }
@keyframes toolblink { 50% { opacity: 0.3; } }
.tool-step .tool-result { margin-top: 4px; }
.tool-step .tool-result summary {
    cursor: pointer;
    font-size: 12px;
    opacity: 0.7;
}
.tool-step .tool-result pre {
    margin: 4px 0 0 0;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow: auto;
}
