/* ===== Eule – Farben: 2 ruhige Grundfarben (Papier + Tinte) + 1 Akzent (Petrol) ===== */
:root {
  --bg: #F7F4EE;          /* Grundfarbe 1: warmes Papier */
  --sidebar: #EFEAE1;
  --surface: #FFFFFF;
  --hover: rgba(43, 42, 39, .06);
  --active: rgba(43, 42, 39, .09);
  --text: #2B2A27;        /* Grundfarbe 2: warme Tinte */
  --text-2: #57534C;
  --muted: #8A857C;
  --border: #E2DCD0;
  --border-strong: #D3CBBD;
  --user-bubble: #EAE4D8;
  --code-bg: #F1ECE3;
  --accent: #0E9F9A;      /* Akzent: Petrol – sparsam! */
  --accent-hover: #0B8783;
  --accent-soft: rgba(14, 159, 154, .12);
  --on-accent: #FFFFFF;
  --danger: #C2410C;
  --shadow: 0 1px 2px rgba(43, 42, 39, .04), 0 4px 18px rgba(43, 42, 39, .07);
  --shadow-menu: 0 6px 30px rgba(43, 42, 39, .16), 0 0 0 1px var(--border);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sb-w: 288px;
  --content-w: 760px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #232220; --sidebar: #1B1A18; --surface: #2E2D2A; --hover: rgba(236, 232, 225, .06); --active: rgba(236, 232, 225, .1);
    --text: #ECE8E1; --text-2: #C6C0B6; --muted: #948E84; --border: #3A3834; --border-strong: #4A4742;
    --user-bubble: #34322E; --code-bg: #1C1B19; --accent: #1BB8B0; --accent-hover: #2BCBC3; --accent-soft: rgba(27, 184, 176, .16);
    --on-accent: #0F1A19; --shadow: 0 1px 2px rgba(0,0,0,.2), 0 4px 18px rgba(0,0,0,.25); --shadow-menu: 0 8px 30px rgba(0,0,0,.45), 0 0 0 1px var(--border);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #232220; --sidebar: #1B1A18; --surface: #2E2D2A; --hover: rgba(236, 232, 225, .06); --active: rgba(236, 232, 225, .1);
  --text: #ECE8E1; --text-2: #C6C0B6; --muted: #948E84; --border: #3A3834; --border-strong: #4A4742;
  --user-bubble: #34322E; --code-bg: #1C1B19; --accent: #1BB8B0; --accent-hover: #2BCBC3; --accent-soft: rgba(27, 184, 176, .16);
  --on-accent: #0F1A19; --shadow: 0 1px 2px rgba(0,0,0,.2), 0 4px 18px rgba(0,0,0,.25); --shadow-menu: 0 8px 30px rgba(0,0,0,.45), 0 0 0 1px var(--border);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.serif { font-family: var(--serif); font-weight: 400; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
a { color: var(--accent); }

/* ===== Grundlayout ===== */
.app { display: flex; height: 100dvh; }
.sidebar {
  width: var(--sb-w); flex: none; background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  transition: margin-left .22s ease, transform .22s ease;
}
.app.sb-collapsed .sidebar { margin-left: calc(-1 * var(--sb-w)); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }

.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); }
.icon-btn:hover { background: var(--hover); color: var(--text); }

.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px 8px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.brand img { border-radius: 7px; }
.brand-name { font-size: 22px; letter-spacing: -.01em; }

.new-chat {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; font-weight: 500; color: var(--text);
  margin-bottom: 6px; text-align: left;
}
.new-chat:hover { background: var(--hover); }
.new-chat .plus { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.new-chat .plus svg { width: 16px; height: 16px; stroke-width: 2.4; }

.sb-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; margin: 2px 0 10px; height: 38px; border-radius: 10px; color: var(--muted); }
.sb-search:focus-within { background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.sb-search svg { width: 17px; height: 17px; }
.sb-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 15px; }
.sb-search input::placeholder { color: var(--muted); }

.chat-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; -webkit-overflow-scrolling: touch; }
.chat-group { font-size: 12.5px; color: var(--muted); padding: 14px 10px 6px; font-weight: 500; }
.chat-item { position: relative; display: flex; align-items: center; border-radius: 10px; }
.chat-item a { flex: 1; min-width: 0; display: block; padding: 8px 10px; color: var(--text); text-decoration: none; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 10px; }
.chat-item:hover a, .chat-item.active a { padding-right: 38px; }
@media (hover: none) { .chat-item a { padding-right: 38px; } }
.chat-item:hover, .chat-item.active { background: var(--hover); }
.chat-item.active { background: var(--active); }
.chat-item .more { position: absolute; right: 4px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); opacity: 0; background: inherit; }
.chat-item:hover .more, .chat-item.active .more, .chat-item .more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .chat-item .more { opacity: .7; } }
.chat-item .more:hover { background: var(--active); }
.chat-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; margin-right: 10px; animation: pulse 1.2s infinite; }
.chat-empty { color: var(--muted); font-size: 14px; padding: 12px 10px; }

.sb-bottom { padding-top: 8px; border-top: 1px solid var(--border); }
.profile { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; text-align: left; }
.profile:hover { background: var(--hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; }
.profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; font-size: 14.5px; font-weight: 500; }
.profile-text small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.chev { width: 16px; height: 16px; color: var(--muted); }

.scrim { display: none; }

/* ===== Kopfzeile ===== */
.topbar { height: 56px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 10px; padding-top: env(safe-area-inset-top); padding-left: max(10px, env(safe-area-inset-left)); }
.app:not(.sb-collapsed) #sb-open, .app:not(.sb-collapsed) .only-collapsed { display: none; }
.chat-title { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; max-width: min(60vw, 520px); font-size: 15px; font-weight: 500; }
.chat-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title:hover { background: var(--hover); }

/* ===== Verlauf ===== */
.scroller { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scroll-padding-bottom: 20px; }
.thread { max-width: var(--content-w); margin: 0 auto; padding: 8px 24px 40px; }
.app.empty .scroller { flex: 0 1 auto; display: flex; align-items: flex-end; min-height: 34vh; }
.app.empty .thread { display: none; }
.app:not(.empty) .welcome, .app:not(.empty) .chips { display: none; }
.welcome { width: 100%; padding: 0 24px 26px; display: flex; justify-content: center; }
.greet { display: flex; align-items: center; gap: 14px; }
.greet h1 { font-size: clamp(30px, 4.4vw, 42px); margin: 0; letter-spacing: -.015em; color: var(--text); }
.greet-logo { border-radius: 10px; }

.msg { margin: 22px 0; }
.msg-user { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.bubble { background: var(--user-bubble); padding: 10px 16px; border-radius: 18px; max-width: 85%; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg-user .actions { opacity: 0; }
.msg-user:hover .actions { opacity: 1; }
.msg-files { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 85%; }
.thumb { width: 120px; height: 90px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); background: var(--surface); }

.msg-assistant { position: relative; }
.answer { overflow-wrap: anywhere; }
.answer > :first-child { margin-top: 0; }
.answer > :last-child { margin-bottom: 0; }
.answer p, .answer ul, .answer ol, .answer blockquote, .answer table, .answer pre { margin: 0 0 14px; }
.answer h1, .answer h2, .answer h3, .answer h4 { font-weight: 600; line-height: 1.3; margin: 22px 0 10px; }
.answer h1 { font-size: 1.45em; } .answer h2 { font-size: 1.25em; } .answer h3 { font-size: 1.1em; }
.answer ul, .answer ol { padding-left: 1.4em; }
.answer li { margin: 4px 0; }
.answer li > p { margin: 0 0 6px; }
.answer blockquote { border-left: 3px solid var(--border-strong); padding: 2px 0 2px 14px; color: var(--text-2); }
.answer hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }
.answer code { font-family: var(--mono); font-size: .88em; background: var(--code-bg); padding: .12em .38em; border-radius: 6px; border: 1px solid var(--border); }
.answer pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.answer pre code { display: block; padding: 14px 16px; overflow-x: auto; border: 0; background: transparent !important; font-size: 13.5px; line-height: 1.55; border-radius: 0; }
.code-head { display: flex; justify-content: space-between; align-items: center; font: 12.5px var(--sans); color: var(--muted); padding: 7px 10px 7px 16px; border-bottom: 1px solid var(--border); }
.code-head button { display: flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 7px; color: var(--text-2); }
.code-head button:hover { background: var(--hover); }
.code-head svg { width: 15px; height: 15px; }
.table-wrap { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--border); border-radius: 12px; }
.answer table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 0; }
.answer th, .answer td { border-bottom: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.answer th { font-weight: 600; background: var(--hover); }
.answer tr:last-child td { border-bottom: 0; }
.answer img { max-width: 100%; border-radius: 10px; }
.answer .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.answer a { text-decoration: underline; text-underline-offset: 2px; }

.actions { display: flex; gap: 2px; margin-top: 6px; color: var(--muted); }
.actions button { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.actions button:hover { background: var(--hover); color: var(--text); }
.actions svg { width: 17px; height: 17px; }
.msg-assistant .actions { opacity: .85; }

/* Werkzeug-Schritte ("Sucht im Web …") */
.steps { margin: 0 0 12px; display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); }
.step .ico { width: 18px; height: 18px; display: grid; place-items: center; }
.step .ico svg { width: 15px; height: 15px; }
.step.done .ico { color: var(--accent); }
.step.err .ico { color: var(--danger); }
.spinner { width: 13px; height: 13px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }

/* "Denkt nach" */
.thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14.5px; height: 30px; }
.owl-mini { width: 26px; height: 26px; border-radius: 7px; animation: bob 1.6s ease-in-out infinite; }
.cursor-owl { display: inline-block; width: 22px; height: 22px; margin-top: 8px; border-radius: 6px; animation: bob 1.6s ease-in-out infinite; }

/* Datei-Karten */
.files { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 4px; }
.file-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 14px; min-width: 240px; max-width: 360px; text-decoration: none; color: var(--text); box-shadow: var(--shadow);
}
.file-card:hover { border-color: var(--border-strong); }
.file-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: #fff; font: 700 11px var(--sans); letter-spacing: .02em; flex: none; }
.file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.file-meta b { font-weight: 500; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta small { color: var(--muted); font-size: 12.5px; }
.file-dl { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--text-2); }
.file-card:hover .file-dl { background: var(--hover); color: var(--text); }
.ft-pptx { background: #D2552C; } .ft-docx { background: #2B6CC4; } .ft-xlsx { background: #1F8A4C; } .ft-pdf { background: #C8342B; }
.ft-img { background: #7A5AC8; } .ft-txt, .ft-other { background: #6B675F; }

.notice { margin-top: 10px; padding: 10px 14px; border-radius: 12px; font-size: 14.5px; background: var(--hover); color: var(--text-2); }
.notice.error { background: rgba(194, 65, 12, .1); color: var(--danger); }

/* ===== Eingabefeld ===== */
.composer-wrap { flex: none; padding: 0 24px max(10px, env(safe-area-inset-bottom)); }
.app.empty .composer-wrap { flex: 1; }
.composer {
  max-width: var(--content-w); margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: var(--shadow); padding: 12px 12px 10px 16px; transition: border-color .15s, box-shadow .15s; cursor: text;
}
.composer:focus-within { border-color: var(--border-strong); box-shadow: var(--shadow), 0 0 0 3px var(--accent-soft); }
.composer textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: transparent; padding: 4px 2px; max-height: 40vh; min-height: 28px;
  font-size: 16px; line-height: 1.5; display: block;
}
.composer textarea::placeholder { color: var(--muted); }
.app.empty .composer textarea { min-height: 52px; }
.composer-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.composer-row .left, .composer-row .right { display: flex; align-items: center; gap: 6px; }
.tool-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); }
.tool-btn:hover { background: var(--hover); color: var(--text); }
.model-btn { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 10px; font-size: 14px; color: var(--text-2); }
.model-btn:hover { background: var(--hover); color: var(--text); }
.send-btn { width: 36px; height: 36px; border-radius: 11px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; transition: opacity .15s, background .15s; }
.send-btn:hover:not(:disabled) { background: var(--accent-hover); }
.send-btn:disabled { opacity: .35; cursor: default; }
.send-btn svg { stroke-width: 2.3; }
.send-btn .i-stop { display: none; fill: currentColor; stroke: none; }
.send-btn.stop { background: var(--text); color: var(--bg); opacity: 1; }
.send-btn.stop .i-send { display: none; } .send-btn.stop .i-stop { display: block; }

.attachments { display: flex; gap: 8px; flex-wrap: wrap; }
.attachments:not(:empty) { margin: 2px 0 10px; }
.att { position: relative; display: flex; align-items: center; gap: 9px; padding: 6px 30px 6px 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); max-width: 240px; }
.att img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.att .file-icon { width: 40px; height: 40px; border-radius: 8px; font-size: 10px; }
.att .file-meta b { font-size: 13.5px; }
.att .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.att .x:hover { background: var(--hover); color: var(--text); }
.att .x svg { width: 14px; height: 14px; }
.att.loading { opacity: .6; }
.att.loading .file-meta small::after { content: ' · lädt hoch …'; }

.chips { max-width: var(--content-w); margin: 16px auto 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chips button { display: flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 11px; font-size: 14px; color: var(--text-2); background: transparent; }
.chips button:hover { background: var(--surface); color: var(--text); }
.chips svg { width: 16px; height: 16px; }
.disclaimer { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.app.empty .disclaimer { display: none; }

/* Drag & Drop */
.drop-overlay { position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); display: none; place-items: center; text-align: center; z-index: 30; pointer-events: none; }
.drop-overlay.show { display: grid; }
.drop-overlay svg { width: 40px; height: 40px; color: var(--accent); }
.drop-overlay p { font-size: 18px; font-weight: 500; margin: 8px 0 2px; }
.drop-overlay small { color: var(--muted); }

/* ===== Menüs, Dialoge, Hinweise ===== */
.menu { position: fixed; z-index: 50; min-width: 210px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-menu); padding: 6px; }
.menu button, .menu .menu-label { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; font-size: 14.5px; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--danger); }
.menu button .check { margin-left: auto; color: var(--accent); }
.menu svg { width: 18px; height: 18px; color: var(--text-2); }
.menu button.danger svg { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.menu .menu-label { color: var(--muted); font-size: 12.5px; padding: 6px 10px 4px; }
.menu .sub { display: block; font-size: 12.5px; color: var(--muted); }
.menu .model-opt { align-items: flex-start; }
.usage-bar { height: 6px; border-radius: 3px; background: var(--hover); margin: 4px 10px 8px; overflow: hidden; }
.usage-bar > div { height: 100%; background: var(--accent); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14.5px; z-index: 60; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }

dialog { border: 0; border-radius: 18px; padding: 22px; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-menu); }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
dialog h2 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
dialog p { margin: 0 0 14px; color: var(--text-2); }
dialog input { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg); outline: 0; }
dialog input:focus { border-color: var(--accent); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn-primary { background: var(--text); color: var(--bg); border-radius: 10px; padding: 9px 16px; font-weight: 500; }
.btn-primary.danger { background: var(--danger); color: #fff; }
.btn-ghost { border-radius: 10px; padding: 9px 16px; border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--hover); }

/* ===== Login ===== */
.login-page { display: grid; place-items: center; min-height: 100dvh; overflow: auto; }
.login { width: min(360px, calc(100vw - 32px)); text-align: center; padding: 24px 0; }
.login-logo { border-radius: 14px; }
.login h1 { font-size: 34px; margin: 18px 0 6px; }
.login p { margin: 0 0 26px; }
.login form { display: flex; flex-direction: column; gap: 10px; }
.login input { padding: 13px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); outline: 0; font-size: 16px; }
.login input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login .btn-primary { padding: 12px; font-size: 16px; }
.login .btn-primary:disabled { opacity: .6; }
.login-error { color: var(--danger); min-height: 1.5em; margin: 6px 0 0 !important; font-size: 14.5px; }

/* ===== Animationen ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== iPad hochkant / Handy: Seitenleiste als Schublade ===== */
@media (max-width: 900px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); margin-left: 0 !important; width: min(var(--sb-w), 86vw); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; }
  .app.sb-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-menu); transition: transform .22s ease; }
  .app.sb-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 39; }
  #sb-open, .only-collapsed { display: grid !important; }
  .chat-title { max-width: calc(100vw - 140px); }
}
@media (max-width: 600px) {
  .thread { padding: 4px 16px 32px; }
  .composer-wrap { padding: 0 10px max(8px, env(safe-area-inset-bottom)); }
  .welcome { padding: 0 16px 20px; }
  .greet { flex-direction: column; gap: 10px; text-align: center; }
  .bubble { max-width: 92%; }
  .file-card { min-width: 0; width: 100%; max-width: none; }
  .chips button:nth-child(n+4) { display: none; }
}
