:root {
    --gold: #c2bcb6;
    --gold-hover: #dedad4;
    --bg: #0c0b0a;
    --bg-card: #141210;
    --bg-input: #1c1a17;
    --border: #2e2b27;
    --text: #e8e3dc;
    --text-muted: #8a8278;
    --user-bg: #1c1a17;
    --user-border: rgba(194,188,182,0.12);
    --sidebar-w: 280px;
    --header-h: 56px;
    --input-h: 70px;
    --radius: 12px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ── LOGIN ─────────────────────────────────────── */

.view { display: none; width: 100%; height: 100%; }
.view.active { display: flex; }

#login-view {
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
}

.login-logo {
    text-align: center;
    margin-bottom: 8px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.login-logo .logo-icon { color: var(--gold); margin-right: 6px; }
.login-logo .logo-dot  { color: var(--gold); }

.login-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.login-form { display: flex; flex-direction: column; gap: 12px; }

.login-form input[type="email"] {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color .2s;
}

.login-form input[type="email"]:focus { border-color: var(--gold); }

.btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--gold);
    color: #111;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.btn-primary:hover { background: var(--gold-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-spinner { display: none; }
.btn-spinner.hidden { display: none; }

.login-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.login-message.hidden { display: none; }
.login-message.success { background: rgba(100,200,100,.1); color: #6dcc6d; border: 1px solid rgba(100,200,100,.2); }
.login-message.error   { background: rgba(200,80,80,.1);  color: #e06060; border: 1px solid rgba(200,80,80,.2); }
.login-message.loading { background: rgba(194,188,182,.08); color: var(--gold); border: 1px solid rgba(194,188,182,.15); }

.login-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 20px;
    line-height: 1.5;
}

/* ── APP LAYOUT ────────────────────────────────── */

.app-layout {
    display: flex;
    width: 100%;
    height: 100%;
    height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    overflow: hidden;
}

/* ── SIDEBAR ───────────────────────────────────── */

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s ease;
}

.sidebar.open { transform: translateX(0); }

/* Overlay when sidebar open on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 199;
}

.sidebar-overlay.visible { display: block; }

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

.sidebar-header .logo-icon { color: var(--gold); font-size: 18px; }
.sidebar-header .logo-text { font-size: 15px; font-weight: 600; flex: 1; }

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
}

.sidebar-toggle-btn:hover { color: var(--text); background: var(--border); }

.btn-new-chat {
    margin: 12px;
    padding: 11px 14px;
    background: rgba(194,188,182,.1);
    border: 1px solid rgba(194,188,182,.25);
    border-radius: 8px;
    color: var(--gold);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background .2s;
}

.btn-new-chat:hover { background: rgba(194,188,182,.15); }

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

.conv-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    min-width: 0;
    transition: all .15s;
}

.conv-item:hover { background: var(--bg-input); color: var(--text); }
.conv-item.active { background: rgba(194,188,182,.1); color: var(--gold); }

.conv-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conv-actions {
    display: none;
    flex-shrink: 0;
    gap: 2px;
}

.conv-item:hover .conv-actions { display: flex; }

.conv-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1;
    color: var(--text-muted);
    opacity: .8;
    transition: opacity .15s, background .15s;
}

.conv-action:hover { opacity: 1; background: var(--border); }

.conv-loading {
    padding: 16px 12px;
    font-size: 13px;
    color: var(--text-muted);
}

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

.user-info { margin-bottom: 8px; }

.user-email {
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
}

.btn-logout {
    width: 100%;
    padding: 9px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}

.btn-logout:hover { border-color: #e06060; color: #e06060; }

/* ── CHAT AREA ─────────────────────────────────── */

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    margin-left: 0;
    transition: margin-left .25s ease;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: var(--header-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 10;
    position: sticky;
    top: 0;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    line-height: 1;
    flex-shrink: 0;
}

.btn-icon:hover { color: var(--text); background: var(--border); }

.chat-title-wrap { flex: 1; min-width: 0; }

.chat-title {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.model-selector {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
    cursor: pointer;
    max-width: 130px;
}

.model-selector:focus { border-color: var(--gold); }

/* ── CHAT BODY + MAIN ──────────────────────────── */

.chat-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.chat-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* ── MESSAGES ──────────────────────────────────── */

.messages-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 40px 20px;
    gap: 10px;
}

.welcome-icon { font-size: 36px; color: var(--gold); margin-bottom: 4px; }

.welcome-screen h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.welcome-screen p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 320px;
}

.welcome-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}

.suggestion-btn {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}

.suggestion-btn:hover { border-color: var(--gold); color: var(--gold); }

.msg {
    display: flex;
    max-width: 85%;
}

.msg-user    { align-self: flex-end;   justify-content: flex-end; }
.msg-assistant { align-self: flex-start; }

.msg-bubble {
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

.msg-user .msg-bubble {
    background: var(--user-bg);
    border: 1px solid var(--user-border);
    border-bottom-right-radius: 4px;
}

.msg-assistant .msg-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.msg-assistant .msg-bubble pre {
    background: #0d0d0d;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    font-size: 13px;
    margin: 8px 0;
}

.msg-assistant .msg-bubble code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    background: #0d0d0d;
    padding: 1px 5px;
    border-radius: 4px;
}

.msg-assistant .msg-bubble pre code { padding: 0; background: none; }

.msg-bubble.streaming::after {
    content: '▋';
    color: var(--gold);
    animation: blink .8s step-end infinite;
}

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

/* ── TOOL LOG ──────────────────────────────────────── */

.tool-log {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tool-entry {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.tool-running {
    color: var(--gold);
    border-color: rgba(194,188,182,.25);
    animation: pulse-tool 1s ease infinite;
}

.tool-ok {
    color: #6dcc6d;
    border-color: rgba(109,204,109,.3);
}

.tool-error {
    color: #e06060;
    border-color: rgba(224,96,96,.3);
}

@keyframes pulse-tool { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ── INPUT AREA ────────────────────────────────── */

.chat-input-area {
    padding: 10px 14px 14px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    resize: none;
    outline: none;
    line-height: 1.5;
    max-height: 120px;
    transition: border-color .2s;
}

.message-input:focus { border-color: var(--gold); }
.message-input::placeholder { color: var(--text-muted); }

/* ── Bild-Upload ─────────────────────────────────────────────────── */
.image-preview-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
}
.image-preview-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.image-preview-hint { font-size: 0.75rem; color: var(--muted); flex: 1; }
.image-clear-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
}
.image-clear-btn:hover { color: #e06060; }

.btn-image {
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color .2s, color .2s;
}
.btn-image svg { width: 18px; height: 18px; }
.btn-image:hover { border-color: var(--gold); color: var(--gold); }

.msg-with-image { display: flex; flex-direction: column; gap: 8px; }
.msg-image {
    max-width: 280px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid var(--border);
}

.btn-mic {
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .2s;
    align-self: flex-end;
}

.btn-mic:hover { border-color: var(--gold); }
.btn-mic.recording { border-color: #e06060; background: rgba(224,96,96,.1); animation: pulse-mic .8s ease infinite; }

@keyframes pulse-mic { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.btn-send {
    width: 44px;
    height: 44px;
    background: var(--gold);
    border: none;
    border-radius: 10px;
    color: #111;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}

.btn-send svg { width: 18px; height: 18px; }
.btn-send:hover:not(:disabled) { background: var(--gold-hover); }
.btn-send:disabled { opacity: .4; cursor: not-allowed; }

.btn-stop {
    width: 44px;
    height: 44px;
    background: #c04040;
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s;
}
.btn-stop svg { width: 16px; height: 16px; }
.btn-stop:hover { background: #e05050; }

.pause-indicator {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
}

.input-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding: 0 2px;
}

.memory-indicator {
    font-size: 11px;
    color: var(--gold);
    opacity: .7;
}

.input-hint {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── TASK PANEL — ALLE SCREENS: Overlay von rechts ── */

.task-panel {
    position: fixed;
    right: 0; top: 0; bottom: 0;
    z-index: 200;
    width: 88vw;
    max-width: 340px;
    box-shadow: -4px 0 20px rgba(0,0,0,.6);
    transform: translateX(100%);
    transition: transform .25s ease;
    border-left: 1px solid var(--border);
}

.task-panel.open {
    transform: translateX(0);
}

/* ── TASK PANEL ────────────────────────────────── */

.btn-tasks-toggle {
    position: relative;
    display: none;
    flex-shrink: 0;
    padding: 6px 8px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: color .2s, background .2s;
}

.btn-tasks-toggle.active { color: var(--gold); background: rgba(194,188,182,.1); }
.btn-tasks-toggle:hover  { color: var(--text); background: var(--border); }

.tasks-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--gold);
    color: #111;
    font-size: 9px;
    font-weight: 700;
    border-radius: 6px;
    padding: 1px 4px;
    line-height: 1.4;
    min-width: 14px;
    text-align: center;
}

/* .task-panel Basis — Inhalt (überschrieben durch Overlay-Block unten) */

.task-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    height: var(--header-h);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.task-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: .3px;
    text-transform: uppercase;
}

.task-add-form {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.task-new-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: 13px;
    padding: 7px 10px;
    outline: none;
    transition: border-color .2s;
}

.task-new-input:focus { border-color: var(--gold); }
.task-new-input::placeholder { color: var(--text-muted); }

.btn-task-add {
    background: rgba(194,188,182,.1);
    border: 1px solid rgba(194,188,182,.25);
    border-radius: 7px;
    color: var(--gold);
    font-size: 18px;
    line-height: 1;
    width: 32px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s;
}

.btn-task-add:hover { background: rgba(194,188,182,.2); }

.task-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-empty {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 24px 12px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg-input);
    border: 1px solid transparent;
    transition: border-color .15s;
}

.task-item:hover { border-color: var(--border); }
.task-item.erledigt { opacity: .5; }

.task-status-btn {
    flex-shrink: 0;
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: none;
    cursor: pointer;
    margin-top: 1px;
    transition: border-color .2s, background .2s;
    position: relative;
}

.task-status-btn[data-status="neu"]            { border-color: var(--border); }
.task-status-btn[data-status="in_bearbeitung"] { border-color: #6b9fd4; }
.task-status-btn[data-status="zum_pruefen"]    { border-color: var(--gold); }
.task-status-btn[data-status="erledigt"]       { border-color: #5aab6d; background: #5aab6d; }

.task-status-btn[data-status="erledigt"]::after {
    content: '';
    display: block;
    position: absolute;
    top: 2px; left: 4px;
    width: 5px; height: 8px;
    border: 2px solid #111;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.task-body { flex: 1; min-width: 0; }

.task-title {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
}

.task-item.erledigt .task-title { text-decoration: line-through; color: var(--text-muted); }

.task-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.task-status-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.task-by-ai {
    font-size: 10px;
    color: var(--gold);
    opacity: .7;
}

.task-del-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity .15s, color .15s;
    line-height: 1;
    margin-top: -1px;
}

.task-item:hover .task-del-btn { opacity: 1; }
.task-del-btn:hover { color: #e06060; }

/* ── SCROLLBAR ─────────────────────────────────── */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── FILE BROWSER PANEL ────────────────────────────────────────── */

.btn-files-toggle { color: var(--text-muted); }
.btn-files-toggle.active { color: var(--gold); }

.file-panel {
    position: fixed;
    right: 0; top: 0; bottom: 0;
    z-index: 200;
    width: 88vw;
    max-width: 360px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 20px rgba(0,0,0,.6);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s ease;
    overflow: hidden;
}

.file-panel.open { transform: translateX(0); }

.file-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.file-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .6px;
}

.file-list-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.file-breadcrumb {
    padding: 10px 14px 6px;
    font-size: 11px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bc-item {
    cursor: pointer;
    color: var(--gold);
    transition: color .15s;
}
.bc-item:hover { color: var(--text); }
.bc-sep { margin: 0 3px; color: var(--border); }

.file-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.file-loading, .file-empty, .file-error {
    padding: 20px 16px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}
.file-error { color: #e06060; }

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text);
    transition: background .15s;
    min-width: 0;
}

.file-item:hover { background: var(--bg-input); }

.file-item-up { color: var(--text-muted); }

.fi-icon { flex-shrink: 0; font-size: 14px; line-height: 1; }

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

.file-item-dir .fi-name { font-weight: 500; }

.fi-size {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* Content view */
.file-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.file-content-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.btn-file-back {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--gold);
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
}
.btn-file-back:hover { background: var(--bg-input); }

.file-content-name {
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
}

.file-content-pre {
    flex: 1;
    overflow: auto;
    padding: 14px;
    font-size: 11px;
    line-height: 1.6;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
    white-space: pre;
    tab-size: 4;
}

/* ── JARVIS QUEUE ─────────────────────────────────────────── */
.btn-jarvis {
    background: none;
    border: 1.5px solid #c9a040;
    color: #c9a040;
    border-radius: 50%;
    width: 36px; height: 36px;
    font-size: 1rem;
    cursor: pointer;
    transition: background .2s, color .2s;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.btn-jarvis:hover, .btn-jarvis.jarvis-sending {
    background: #c9a040;
    color: #0a0a0a;
}

.jarvis-panel-toggle {
    background: none;
    border: 1px solid #2a2a2a;
    color: #a09070;
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 20px;
    cursor: pointer;
    transition: border-color .2s, color .2s;
    margin-left: auto;
}
.jarvis-panel-toggle:hover { border-color: #c9a040; color: #c9a040; }

.jarvis-panel {
    position: fixed;
    right: 0; top: 0; bottom: 0;
    width: 340px;
    background: #0f0f0f;
    border-left: 1px solid #2a2a2a;
    z-index: 200;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s ease;
}
.jarvis-panel.open { transform: translateX(0); }

.jarvis-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}
.jarvis-panel-title {
    font-family: Cinzel, serif;
    color: #c9a040;
    font-size: .9rem;
    letter-spacing: .04em;
}

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

.jarvis-empty {
    color: #a09070;
    font-size: .8rem;
    text-align: center;
    padding: 2rem 0;
}

.jarvis-job {
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: .82rem;
}
.jarvis-job-header {
    display: flex; align-items: flex-start; gap: 8px;
    margin-bottom: 4px;
}
.jarvis-job-icon { font-size: 1rem; flex-shrink: 0; line-height: 1.4; }
.jarvis-job-input { color: #f0e6d0; flex: 1; line-height: 1.4; word-break: break-word; }
.jarvis-job-time  { color: #a09070; font-size: .72rem; flex-shrink: 0; padding-top: 2px; }

.jarvis-job-result {
    color: #a09070;
    font-size: .78rem;
    margin-top: 6px;
    line-height: 1.5;
    word-break: break-word;
}
.jarvis-job-error { color: #e05050; }
.jarvis-job-running { color: #c9a040; font-size: .78rem; margin-top: 4px; animation: pulse 1.5s infinite; }

.jarvis-job-expand {
    margin-top: 6px;
    background: none;
    border: 1px solid #2a2a2a;
    color: #a09070;
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.jarvis-job-expand:hover { border-color: #c9a040; color: #c9a040; }

.jarvis-status-pending { border-left: 3px solid #a09070; }
.jarvis-status-running { border-left: 3px solid #c9a040; }
.jarvis-status-done    { border-left: 3px solid #4caf50; }
.jarvis-status-error   { border-left: 3px solid #e05050; }

.jarvis-toast {
    position: fixed;
    bottom: 90px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #f0e6d0;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: .82rem;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    pointer-events: none;
    z-index: 500;
    white-space: nowrap;
}
.jarvis-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.jarvis-toast-error { border-color: #e05050; color: #e05050; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

@media (max-width: 600px) {
    .jarvis-panel { width: 100%; }
}


/* ── JARVIS ORB ─────────────────────────────────────────────────── */

.jarvis-orb-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 36px 0 20px;
    flex-shrink: 0;
    position: relative;
    transition: padding .4s cubic-bezier(.4,0,.2,1);
}

.jarvis-orb-section::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(194,188,182,0.16) 0%, transparent 70%);
    pointer-events: none;
    top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    transition: opacity .4s;
}

.has-messages .jarvis-orb-section {
    display: none;
}

/* Orb-Container enthält Kern + Ringe vollständig (200px) */
.jarvis-orb {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

/* Kern — zentriert im 200px Container (100px) */
.jarvis-orb-core {
    position: absolute;
    top: 50px; left: 50px; right: 50px; bottom: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 32%,
        #ffffff 0%,
        rgba(225,220,215,1) 20%,
        rgba(168,163,157,0.95) 50%,
        rgba(78,74,70,0.88) 80%,
        rgba(18,16,14,0.75) 100%
    );
    box-shadow:
        0 0 0 2px rgba(194,188,182,0.7),
        0 0 20px rgba(194,188,182,1),
        0 0 50px rgba(194,188,182,0.75),
        0 0 100px rgba(194,188,182,0.45),
        0 0 160px rgba(194,188,182,0.2);
    animation: orb-idle 3.8s ease-in-out infinite;
}

/* Ringe — alle INNERHALB des 200px Containers */
.jarvis-orb-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(194,188,182,0.45);
    pointer-events: none;
    animation: orb-ring-idle 3.8s ease-in-out infinite;
    transition: opacity .35s ease;
}

/* Ring 1: 118px innen (16px über Kern), Ring 2: 84px innen (32px), Ring 3: 50px innen (48px) */
.jarvis-orb-ring:nth-child(1) { inset: 34px; }
.jarvis-orb-ring:nth-child(2) { inset: 18px; animation-delay:-1.27s; opacity:.55; }
.jarvis-orb-ring:nth-child(3) { inset: 4px;  animation-delay:-2.53s; opacity:.28; }

@keyframes orb-idle {
    0%,100% {
        transform: scale(1);
        box-shadow: 0 0 0 1px rgba(194,188,182,0.6), 0 0 22px rgba(194,188,182,1), 0 0 55px rgba(194,188,182,0.6), 0 0 110px rgba(194,188,182,0.32);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 0 0 1px rgba(194,188,182,0.7), 0 0 30px rgba(194,188,182,1), 0 0 75px rgba(194,188,182,0.7), 0 0 140px rgba(194,188,182,0.38);
    }
}

@keyframes orb-ring-idle {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.09); }
}

/* Thinking */
.jarvis-orb.orb-thinking .jarvis-orb-core {
    animation: orb-think 1s ease-in-out infinite;
}
.jarvis-orb.orb-thinking .jarvis-orb-ring {
    animation: orb-ring-think 0.85s ease-in-out infinite;
}

@keyframes orb-think {
    0%,100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 1px rgba(194,188,182,0.35), 0 0 14px rgba(194,188,182,0.6), 0 0 38px rgba(194,188,182,0.25);
    }
    50% {
        transform: scale(1.14);
        box-shadow: 0 0 0 2px rgba(194,188,182,0.8), 0 0 45px rgba(194,188,182,1), 0 0 110px rgba(194,188,182,0.55), 0 0 180px rgba(194,188,182,0.22);
    }
}

@keyframes orb-ring-think {
    0%,100% { transform: scale(0.9); opacity: .18; }
    50% { transform: scale(1.22); opacity: .65; }
}

/* Streaming */
.jarvis-orb.orb-streaming .jarvis-orb-core {
    animation: orb-stream .5s ease-in-out infinite alternate;
}
.jarvis-orb.orb-streaming .jarvis-orb-ring {
    animation: orb-ring-stream .5s ease-in-out infinite alternate;
}

@keyframes orb-stream {
    0%   { transform: scale(0.96); }
    100% { transform: scale(1.1);
           box-shadow: 0 0 0 2px rgba(194,188,182,0.9), 0 0 38px rgba(194,188,182,1), 0 0 90px rgba(194,188,182,0.65); }
}

@keyframes orb-ring-stream {
    0%   { transform: scale(0.95); opacity: .15; }
    100% { transform: scale(1.25); opacity: .6; }
}

/* Label + Status */
.jarvis-orb-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 22px;
    transition: margin-top .4s, font-size .4s, letter-spacing .4s;
}

.jarvis-orb-status {
    font-size: 10px;
    color: var(--text-muted);
    opacity: .5;
    letter-spacing: 1px;
    margin-top: 3px;
    transition: opacity .3s;
}

/* ── MINI ORB (im Header, sichtbar während Chat) ─────── */
.jarvis-mini-orb-wrap {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.has-messages .jarvis-mini-orb-wrap {
    display: flex;
}

.jarvis-mini-orb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 32%,
        #ffffff 0%,
        rgba(225,220,215,1) 20%,
        rgba(168,163,157,0.95) 50%,
        rgba(78,74,70,0.88) 80%,
        rgba(18,16,14,0.75) 100%
    );
    box-shadow:
        0 0 0 1px rgba(194,188,182,0.6),
        0 0 6px rgba(194,188,182,0.9),
        0 0 14px rgba(194,188,182,0.5);
    animation: mini-orb-idle 3.8s ease-in-out infinite;
}

@keyframes mini-orb-idle {
    0%,100% { transform: scale(1);    box-shadow: 0 0 0 1px rgba(194,188,182,0.5), 0 0 6px rgba(194,188,182,0.8), 0 0 14px rgba(194,188,182,0.4); }
    50%      { transform: scale(1.15); box-shadow: 0 0 0 1px rgba(194,188,182,0.7), 0 0 10px rgba(194,188,182,1),   0 0 22px rgba(194,188,182,0.55); }
}

.jarvis-mini-orb.orb-thinking {
    animation: mini-orb-think 1s ease-in-out infinite;
}

@keyframes mini-orb-think {
    0%,100% { transform: scale(0.88); box-shadow: 0 0 0 1px rgba(194,188,182,0.3), 0 0 4px rgba(194,188,182,0.5); }
    50%      { transform: scale(1.2);  box-shadow: 0 0 0 1px rgba(194,188,182,0.8), 0 0 12px rgba(194,188,182,1), 0 0 26px rgba(194,188,182,0.5); }
}

.jarvis-mini-orb.orb-streaming {
    animation: mini-orb-stream .5s ease-in-out infinite alternate;
}

@keyframes mini-orb-stream {
    0%   { transform: scale(0.95); box-shadow: 0 0 0 1px rgba(194,188,182,0.5), 0 0 6px rgba(194,188,182,0.7); }
    100% { transform: scale(1.18); box-shadow: 0 0 0 1px rgba(194,188,182,0.9), 0 0 14px rgba(194,188,182,1), 0 0 28px rgba(194,188,182,0.6); }
}

/* welcome-screen ohne Icon — nur Suggestions */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 20px 20px;
}

