/* ZenGpt styles - dark, minimal, ChatGPT-like */
:root {
  --bg: #0b0f14;
  --panel: #0f1520;
  --muted: #a3b1c2;
  --text: #e6edf3;
  --border: #1c2633;
  --accent: #3b82f6;
  --accent-strong: #2563eb;
  --assistant: #141b26;
  --user: #1e2a3a;
  --danger: #ef4444;
  --surface-subtle: #0b1220; /* subtle hover/bg blocks */
  --input-bg: #0b1220;
  --input-bg-focus: #0c1422;
  --header-bg: #0b1f3a; /* azul sólido en tema oscuro */
}

:root.theme-light {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --muted: #4b5563;
  --text: #0b0f14;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --assistant: #f3f6fb;
  --user: #eef2f7;
  --danger: #dc2626;
  --surface-subtle: #eef2f7;
  --input-bg: #ffffff;
  --input-bg-focus: #ffffff;
  --header-bg: #ffffff; /* blanco sólido en tema claro */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Degradados aplicados al elemento html para evitar bandas visibles */
html.theme-light {
  background: linear-gradient(180deg, #ffffff 0%, #fff 20%, #ffeaf5 60%, #ffe0f0 100%);
  background-attachment: fixed;
}
html.theme-light body { background: transparent; }

/* Degradado azul intenso para tema oscuro */
html.theme-dark {
  background: linear-gradient(180deg, #0a1326 0%, #0b1f3a 60%, #081629 100%);
  background-attachment: fixed;
}
html.theme-dark body { background: transparent; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 12px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  transition: transform .25s ease;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(110%);
  box-shadow: 4px 0 20px rgba(0,0,0,.12);
}
.sidebar-top { display: flex; }
.sidebar-bottom { margin-top: auto; }
.chat-list { display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: all .15s ease;
}
.chat-item:hover { 
  background: var(--surface-subtle); 
  border-color: var(--border); 
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.chat-item.active { 
  background: var(--surface-subtle); 
  border-color: var(--accent); 
  box-shadow: 0 4px 12px rgba(59,130,246,.15);
}
.chat-item .title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .delete { color: var(--danger); opacity: .8; }
.chat-item .delete:hover { opacity: 1; }

.main { margin-left: 260px; min-height: 100%; display: grid; grid-template-rows: auto 1fr auto auto; }
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  box-shadow: 0 2px 16px rgba(0,0,0,.1), 0 0 0 1px rgba(255,255,255,.08);
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(16px) saturate(120%);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 24px; height: 24px; }
.brand h1 { font-size: 16px; margin: 0; font-weight: 600; }
.model-chip { 
  font-size: 14px; 
  color: var(--muted); 
  border: 1px solid var(--border); 
  padding: 6px 12px; 
  border-radius: 999px; 
  box-shadow: 0 8px 20px rgba(37, 99, 235, .25);
  backdrop-filter: blur(8px);
  transition: all .2s ease;
}
.model-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, .35);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--panel);
  color: var(--text);
  width: 92%;
  max-width: 520px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  /* Animations */
  transform: translateY(12px) scale(.98);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}
.modal header { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal .content { padding: 16px; display: grid; gap: 12px; }
.modal .actions { padding: 12px 16px 16px; display: flex; gap: 8px; justify-content: flex-end; }
.radio-row { display: flex; gap: 10px; align-items: center; }
.radio-row input { accent-color: var(--accent); }

/* When backdrop visible, play modal in animation */
.modal-backdrop.show .modal { transform: translateY(0) scale(1); opacity: 1; }
/* Out animation */
.modal.closing { transform: translateY(12px) scale(.98); opacity: 0; }

.messages { padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; overflow-x: hidden; padding-bottom: 120px; min-width: 0; }
/* Scrollbar visible y cómodo para el área de chat */
.messages::-webkit-scrollbar { width: 12px; height: 12px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb {
  background: rgba(163,177,194,0.45);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.messages:hover::-webkit-scrollbar-thumb { background: rgba(163,177,194,0.7); background-clip: content-box; }
.messages { scrollbar-width: thin; scrollbar-color: rgba(163,177,194,0.6) transparent; }
.quick-actions {
  padding: 8px 16px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.quick-actions-select-wrap { display: none; padding: 0 16px; }
.qa-dd-toggle {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.qa-dd-list {
  position: absolute;
  left: 16px; right: 16px;
  bottom: calc(100% + 6px);
  margin: 0; padding: 8px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  display: block; /* keep in flow to allow transition */
  visibility: hidden;
  pointer-events: none;
  max-height: 50vh;
  overflow: auto;
  transform-origin: bottom center;
  transform: translateY(6px) scale(.98);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease, visibility 0s linear .22s;
  z-index: 41;
}
.qa-dd-list.open {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: transform .22s ease, opacity .22s ease;
}
.qa-dd-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.qa-dd-item:hover { background: var(--surface-subtle); }
.qa-dd-emoji { width: 18px; height: 18px; display: grid; place-items: center; }
.qa-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.qa-chip:hover { 
  background: var(--surface-subtle); 
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.qa-emoji { width: 18px; height: 18px; display: grid; place-items: center; }
.qa-chip.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59,130,246,.2) inset;
}
.msg { 
  display: grid; 
  grid-template-columns: 44px 1fr; 
  gap: 12px; 
  padding: 14px; 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  max-width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: box-shadow .2s ease;
}
.msg:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.msg.assistant { background: var(--assistant); }
.msg.user { background: var(--user); }
.msg .avatar { width: 44px; height: 44px; border-radius: 8px; background: var(--surface-subtle); display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.msg .content { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }

/* Code blocks in user messages should have the same styling as assistant */
.msg.user .content .code-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #0c1220;
  max-width: 100%;
  margin: 8px 0;
}
.msg.user .content .code-block .code-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}
.msg.user .content .code-block .code-actions .lang { 
  color: var(--muted); 
  font-size: 12px; 
}
.msg.user .content .code-block .code-actions .copy-code {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}
.msg.user .content .code-block pre { 
  margin: 0; 
  padding: 12px; 
  overflow: auto; 
  max-width: 100%; 
  background: #0c1220;
}
.msg.user .content .code-block code { 
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 
  font-size: 13px; 
  max-width: 100%; 
  display: block; 
  color: #e6edf3;
}
.msg .content strong.h4 { display: block; font-size: 1.05em; font-weight: 700; margin: 8px 0 4px; }

/* File attachments styling */
.msg .content h2 { 
  font-size: 1.1em; 
  font-weight: 600; 
  margin: 16px 0 8px; 
  color: var(--accent); 
  border-left: 3px solid var(--accent); 
  padding-left: 8px;
}
.msg .content h3 { 
  font-size: 1em; 
  font-weight: 600; 
  margin: 12px 0 6px; 
  color: var(--text); 
  background: var(--surface-subtle);
  padding: 6px 8px;
  border-radius: 6px;
}
.msg .content h4 { 
  font-size: 0.9em; 
  font-weight: 500; 
  margin: 10px 0 4px; 
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.msg .content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
  opacity: 0.6;
}
@keyframes revealMsg { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.msg.assistant .content.reveal { animation: revealMsg .35s ease; }
.code-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #0c1220;
  max-width: 100%;
}
.code-block .code-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}
.code-block .code-actions .lang { color: var(--muted); font-size: 12px; }
/* Language badges */
.code-block[data-lang="js"] .code-actions .lang,
.code-block[data-lang="javascript"] .code-actions .lang { color: #f7df1e; }
.code-block[data-lang="ts"] .code-actions .lang,
.code-block[data-lang="typescript"] .code-actions .lang { color: #3178c6; }
.code-block[data-lang="py"] .code-actions .lang,
.code-block[data-lang="python"] .code-actions .lang { color: #ffde57; }
.code-block[data-lang="php"] .code-actions .lang { color: #777bb3; }
.code-block[data-lang="cpp"] .code-actions .lang,
.code-block[data-lang="c++"] .code-actions .lang { color: #00599c; }
.code-block[data-lang="c"] .code-actions .lang { color: #a8b9cc; }
.code-block[data-lang="java"] .code-actions .lang { color: #f89820; }
.code-block[data-lang="cs"] .code-actions .lang,
.code-block[data-lang="csharp"] .code-actions .lang { color: #239120; }
.code-block[data-lang="go"] .code-actions .lang { color: #00add8; }
.code-block[data-lang="rb"] .code-actions .lang,
.code-block[data-lang="ruby"] .code-actions .lang { color: #cc342d; }
.code-block[data-lang="swift"] .code-actions .lang { color: #f05138; }
.code-block[data-lang="sql"] .code-actions .lang { color: #e38c00; }
.code-block[data-lang="bash"] .code-actions .lang,
.code-block[data-lang="sh"] .code-actions .lang { color: #89e051; }
.code-block[data-lang="json"] .code-actions .lang { color: #cbcb41; }
.code-block[data-lang="comprobante"] .code-actions .lang { color: #28a745; }
.code-block[data-lang="rutina"] .code-actions .lang { color: #6f42c1; }
.code-block[data-lang="datos"] .code-actions .lang { color: #17a2b8; }
.code-block[data-lang="text"] .code-actions .lang { color: #6c757d; }
.code-block[data-lang="info"] .code-actions .lang { color: #ffc107; }
.code-block[data-lang="error"] .code-actions .lang { color: #dc3545; }

/* User message code blocks - same colors */
.msg.user .content .code-block[data-lang="comprobante"] .code-actions .lang { color: #28a745; }
.msg.user .content .code-block[data-lang="rutina"] .code-actions .lang { color: #6f42c1; }
.msg.user .content .code-block[data-lang="datos"] .code-actions .lang { color: #17a2b8; }
.msg.user .content .code-block[data-lang="text"] .code-actions .lang { color: #6c757d; }
.msg.user .content .code-block[data-lang="info"] .code-actions .lang { color: #ffc107; }
.msg.user .content .code-block[data-lang="error"] .code-actions .lang { color: #dc3545; }
.code-block .code-actions .copy-code {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}
.code-block pre { margin: 0; padding: 12px; overflow: auto; max-width: 100%; }
.code-block code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 13px; max-width: 100%; display: block; }

/* Light theme overrides for code header to ensure contrast with Prism dark background */
html.theme-light .code-block .code-actions {
  background: #2d2d2d;
  border-bottom-color: #2d2d2d;
  color: #e6edf3;
}
html.theme-light .code-block .code-actions .lang { color: #cbd5e1; }
html.theme-light .code-block .code-actions .copy-code {
  color: #e6edf3;
  border-color: rgba(255,255,255,0.25);
}
html.theme-light .code-block .code-actions .copy-code:hover {
  background: rgba(255,255,255,0.08);
}

/* Light theme overrides for user message code blocks */
html.theme-light .msg.user .content .code-block .code-actions {
  background: #2d2d2d;
  border-bottom-color: #2d2d2d;
  color: #e6edf3;
}
html.theme-light .msg.user .content .code-block .code-actions .lang { color: #cbd5e1; }
html.theme-light .msg.user .content .code-block .code-actions .copy-code {
  color: #e6edf3;
  border-color: rgba(255,255,255,0.25);
}
html.theme-light .msg.user .content .code-block .code-actions .copy-code:hover {
  background: rgba(255,255,255,0.08);
}

/* Glassmorphism para tema claro */
:root.theme-light .msg.assistant,
:root.theme-light .msg.user {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
:root.theme-light .msg .avatar {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.msg.typing .content { color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.dots { display: inline-flex; gap: 4px; }
.dots span { width: 6px; height: 6px; background: var(--muted); opacity: .35; border-radius: 50%; animation: dotBlink 1s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotBlink { 0%, 80%, 100% { opacity: .35 } 40% { opacity: 1 } }


.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: linear-gradient(0deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  position: sticky;
  bottom: 0;
  z-index: 30;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.composer textarea {
  resize: none;
  max-height: 180px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  padding: 12px 14px 12px 14px;
  border-radius: 12px;
  outline: none;
  transition: box-shadow .25s ease, background .25s ease, transform .25s ease, border-color .25s ease;
  overflow-y: auto;
  scrollbar-gutter: stable;
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 15px;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}
.composer textarea::placeholder { color: #7f8ea3; }
.composer textarea:focus { border-color: transparent; box-shadow: 0 18px 36px rgba(37, 99, 235, .25); background: var(--input-bg-focus); transform: translateY(-1px); }

/* Custom scrollbar for the input */
.composer textarea::-webkit-scrollbar { width: 10px; height: 10px; }
.composer textarea::-webkit-scrollbar-track { background: transparent; }
.composer textarea::-webkit-scrollbar-thumb {
  background: rgba(163,177,194,0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.composer textarea:hover::-webkit-scrollbar-thumb { background: rgba(163,177,194,0.6); background-clip: content-box; }
.composer textarea:focus::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.8); background-clip: content-box; }
.composer textarea { scrollbar-width: thin; scrollbar-color: rgba(163,177,194,0.5) transparent; }

/* File upload styles */
.file-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.file-upload-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
  transition: all .2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.file-upload-btn:hover {
  background: var(--surface-subtle);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.file-upload-btn.has-files {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59,130,246,.2);
}
.file-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  max-width: 200px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  position: relative;
}
.file-item .file-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.file-item .file-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.file-item .file-remove {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 2px;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.file-item .file-remove:hover {
  color: #ff4444;
}
.file-drag-overlay {
  position: absolute;
  inset: 0;
  background: rgba(59,130,246,.1);
  border: 2px dashed var(--accent);
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--accent);
  backdrop-filter: blur(4px);
}
.file-drag-overlay.show {
  display: flex;
}

.btn {
  background: var(--accent);
  color: white;
  border: 0;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 2px 8px rgba(59,130,246,.25);
}
.btn:hover { 
  background: var(--accent-strong); 
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59,130,246,.35);
}
.btn.primary { width: 100%; }

.btn.send {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 16px;
  padding: 0;
}
.btn.send img { width: 18px; height: 18px; display: block; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px; height: 36px; border-radius: 8px;
  display: inline-grid; place-items: center;
  margin-right: 8px;
}
.icon-btn:hover { background: var(--surface-subtle); }

.mobile-only { display: none; }

.fab-down {
  position: fixed;
  right: 16px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(59,130,246,.4);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  z-index: 40;
  transition: all .25s ease;
  backdrop-filter: blur(10px);
}
.fab-down.show { 
  display: inline-flex; 
  animation: fabIn .3s ease;
}
.fab-down:hover { 
  background: var(--accent-strong); 
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 32px rgba(59,130,246,.5);
}
@keyframes fabIn {
  from { opacity: 0; transform: translateY(8px) scale(.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.footer { text-align: center; padding: 12px 16px 24px; color: var(--muted); }
.small { font-size: 12px; }
.muted { color: var(--muted); }

@media (max-width: 900px) {
  .main { margin-left: 0; }
  .mobile-only { display: inline-grid; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; z-index: 40;
  }
  .sidebar-backdrop.show { display: block; }
  .app-header { padding: 12px 14px; }
  .messages { padding: 10px; }
  .quick-actions { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
  .quick-actions { display: none; }
  .quick-actions-select-wrap { display: block; position: relative; }
}

/* Disable background scroll when sidebar/modal open */
body.no-scroll { overflow: hidden; }

@media (max-width: 600px) {
  .brand h1 { font-size: 14px; }
  .model-chip { font-size: 12px; padding: 4px 10px; }
  .btn.send { width: 40px; height: 40px; }
  .composer { padding: 12px; }
  .composer textarea { font-size: 14px; padding: 10px 12px; }
  .msg { grid-template-columns: 36px 1fr; gap: 10px; padding: 12px; }
  .msg .avatar { width: 36px; height: 36px; }
  .code-block .code-actions { padding: 6px 8px; }
  .code-block .copy-code { padding: 3px 6px; font-size: 12px; }
  .code-block pre { padding: 10px; }
  .code-block code { font-size: 12px; }
  .file-upload-btn { width: 40px; height: 40px; font-size: 16px; }
  .file-preview { max-width: 150px; }
  .file-item { padding: 4px 6px; font-size: 11px; }
}

/* Welcome overlay */
.welcome {
  position: fixed; inset: 0; display: none; place-items: center; z-index: 60;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
}
.welcome.show { display: grid; animation: fadeIn .28s ease; }
.welcome-card {
  width: min(560px, 92%);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  transform: translateY(10px) scale(.98);
  opacity: 0;
  animation: welcomeIn .35s ease forwards;
}
.welcome-logo { width: 48px; height: 48px; margin-bottom: 8px; }
@keyframes welcomeIn { to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

/* Intro sequence */
.wa-logo { animation: waPop .45s .1s ease both; }
.wa-title { opacity: 0; transform: translateY(8px); animation: waRise .45s .25s ease forwards; }
.wa-sub { opacity: 0; transform: translateY(8px); animation: waRise .45s .35s ease forwards; }
.wa-points { margin: 14px 0 10px; padding: 0; list-style: none; display: grid; gap: 8px; }
.wa-points li { opacity: 0; transform: translateY(8px); background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; }
.wa-points li:nth-child(1) { animation: waRise .4s .45s ease forwards; }
.wa-points li:nth-child(2) { animation: waRise .4s .55s ease forwards; }
.wa-points li:nth-child(3) { animation: waRise .4s .65s ease forwards; }
.wa-cta { opacity: 0; transform: translateY(8px); animation: waRise .45s .8s ease forwards; }

@keyframes waPop { 0% { transform: scale(.8); opacity: 0 } 60% { transform: scale(1.05); opacity: 1 } 100% { transform: scale(1) } }
@keyframes waRise { to { opacity: 1; transform: none } }

/* Slides controls */
.welcome-slides { position: relative; overflow: hidden; }
.welcome-slide { display: none; }
.welcome-slide.active { display: block; }
.welcome-nav { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.welcome-dots { display: inline-flex; gap: 8px; }
.welcome-dots .dot { width: 10px; height: 10px; border-radius: 999px; background: rgba(255,255,255,.25); border: 1px solid var(--border); cursor: default; }
.welcome-dots .dot.active { background: var(--accent); border-color: var(--accent); }
