/* ════════════════════════════════════════════════════
   JOSÉ IA — styles.css
   Paleta: Iris púrpura-eléctrico sobre fondos neutros.
   Firma visual: compositor con halo iris al foco.
════════════════════════════════════════════════════ */


/* ────────────────────────────────────────────────
   1. TOKENS
──────────────────────────────────────────────── */

:root {
  /* Paleta light */
  --bg:            #f7f7fb;
  --bg-main:       #ffffff;
  --sidebar:       #f0eff7;
  --surface:       #ededf5;
  --surface-hover: #e4e3f0;
  --border:        #dddbe8;

  --iris:          #0891B2;        /* acento primario — cian aditivo */
  --iris-dim:      #d6f4fa;        /* tint suave */
  --iris-glow:     rgba(8,145,178,.18);

  --text:          #18181f;
  --text-2:        #4c4a5e;
  --text-3:        #8b899e;

  --bubble-user:   #d6f4fa;
  --bubble-txt:    #18181f;

  --danger:        #c0392b;
  --danger-dim:    rgba(192,57,43,.12);

  --shadow-sm:     0 1px 4px rgba(0,0,0,.06);
  --shadow:        0 4px 16px rgba(0,0,0,.09);
  --shadow-md:     0 8px 28px rgba(0,0,0,.14);

  /* Dimensiones */
  --sb-open:       256px;
  --sb-closed:     64px;
  --msg-max:       800px;
  --cmp-max:       760px;
  --r-sm:          8px;
  --r:             12px;
  --r-lg:          18px;
  --r-xl:          24px;
  --r-pill:        999px;

  /* Movimiento */
  --ease:          cubic-bezier(.4,0,.2,1);
  --t:             .22s;
}

[data-theme="dark"] {
  --bg:            #111118;
  --bg-main:       #16151e;
  --sidebar:       #1b1a26;
  --surface:       #222133;
  --surface-hover: #2b2a3e;
  --border:        #2e2d42;

  --iris:          #22D3EE;        /* cian brillante — glow en oscuro */
  --iris-dim:      #1a3d47;
  --iris-glow:     rgba(34,211,238,.22);

  --text:          #e8e6f3;
  --text-2:        #aba9c0;
  --text-3:        #6e6c85;

  --bubble-user:   #1a3d47;
  --bubble-txt:    #e8e6f3;

  --shadow-sm:     0 1px 4px rgba(0,0,0,.3);
  --shadow:        0 4px 16px rgba(0,0,0,.4);
  --shadow-md:     0 8px 28px rgba(0,0,0,.55);
}


/* ────────────────────────────────────────────────
   2. RESET & BASE
──────────────────────────────────────────────── */

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

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  background: var(--bg-main);
  color: var(--text);
  overflow: hidden;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  -webkit-font-smoothing: antialiased;
}

button        { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
textarea      { font: inherit; color: inherit; border: none; outline: none; background: none; resize: none; }
a             { color: var(--iris); text-decoration: none; }
a:hover       { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* ────────────────────────────────────────────────
   3. SPLASH
──────────────────────────────────────────────── */

#splash {
  position: fixed; inset: 0; z-index: 900;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}

#splash-video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

#splash.fade-out {
  animation: splashFade .55s var(--ease) forwards;
}

@keyframes splashFade {
  to { opacity: 0; pointer-events: none; }
}


/* ────────────────────────────────────────────────
   4. APP LAYOUT
──────────────────────────────────────────────── */

#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  transition: opacity .4s var(--ease);
}

#app.app-hidden {
  opacity: 0;
  pointer-events: none;
}


/* ────────────────────────────────────────────────
   5. SIDEBAR
──────────────────────────────────────────────── */

#sidebar {
  width: var(--sb-open);
  min-width: var(--sb-open);
  height: 100vh;
  height: 100dvh;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    width var(--t) var(--ease),
    min-width var(--t) var(--ease),
    background var(--t) var(--ease);
  flex-shrink: 0;
  z-index: 10;
}

#sidebar.collapsed {
  width: var(--sb-closed);
  min-width: var(--sb-closed);
}

/* Encabezado (toggle) */
.sb-header {
  padding: 14px 12px 8px;
  flex-shrink: 0;
}

/* Nuevo chat */
.sb-new-chat {
  padding: 0 10px 4px;
  flex-shrink: 0;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-pill);
  background: var(--iris);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: background var(--t) var(--ease), transform .12s;
  white-space: nowrap;
  overflow: hidden;
}

.new-chat-btn:hover { background: color-mix(in srgb, var(--iris) 82%, #000); }
.new-chat-btn:active { transform: scale(.97); }

.new-chat-btn .material-symbols-outlined { font-size: 20px; flex-shrink: 0; }

/* Sección historial */
.sb-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 10px 0;
}

.sb-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.sb-section-title .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }

/* Lista de chats */
.chat-list-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.chat-list-wrap::-webkit-scrollbar { width: 3px; }
.chat-list-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background var(--t) var(--ease);
}

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

.chat-item.active {
  background: var(--iris-dim);
}

.chat-item.active .ci-title { color: var(--iris); font-weight: 500; }

.ci-icon {
  font-size: 18px;
  color: var(--text-3);
  flex-shrink: 0;
}

.ci-title {
  flex: 1;
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ci-edit,
.ci-delete {
  opacity: 0;
  color: var(--text-3);
  border-radius: 6px;
  padding: 2px;
  flex-shrink: 0;
  transition: opacity .15s, color .15s, background .15s;
  display: flex; align-items: center;
}

.ci-edit .material-symbols-outlined,
.ci-delete .material-symbols-outlined { font-size: 16px; }

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

.ci-edit:hover {
  color: var(--iris);
  background: var(--iris-dim);
}

.ci-delete:hover {
  color: var(--danger);
  background: var(--danger-dim);
}

.ci-title-input {
  flex: 1;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-main);
  border: 1.5px solid var(--iris);
  border-radius: 6px;
  padding: 3px 7px;
  outline: none;
  min-width: 0;
}

.chat-empty {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  padding: 20px 8px;
}

.chat-empty.hidden { display: none; }

/* Footer */
.sb-footer {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

/* Labels ocultos cuando colapsado */
#sidebar.collapsed .sb-label { display: none; }

#sidebar.collapsed .new-chat-btn {
  border-radius: var(--r);
  padding: 9px;
  width: 40px;
  justify-content: center;
}

#sidebar.collapsed .sb-section-title { display: none; }
#sidebar.collapsed .chat-list-wrap   { display: none; }

#sidebar.collapsed .sb-new-chat { padding: 0 12px 4px; }
#sidebar.collapsed .sb-section  { padding: 8px 12px 0; }


/* ────────────────────────────────────────────────
   6. BOTÓN ICONO (shared)
──────────────────────────────────────────────── */

.icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  flex-shrink: 0;
}

.icon-btn:hover  { background: var(--surface-hover); color: var(--text); }
.icon-btn:active { transform: scale(.93); }

.icon-btn .material-symbols-outlined { font-size: 22px; }


/* ────────────────────────────────────────────────
   7. MAIN
──────────────────────────────────────────────── */

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-main);
  transition: background var(--t) var(--ease);
  min-width: 0;
}


/* ────────────────────────────────────────────────
   8. ÁREA DE CHAT
──────────────────────────────────────────────── */

#chat-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#chat-area::-webkit-scrollbar { width: 5px; }
#chat-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }


/* ────────────────────────────────────────────────
   9. ESTADO VACÍO
──────────────────────────────────────────────── */

#empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 18px;
  animation: fadeUp .4s var(--ease);
  padding: 24px;
}

#empty-state.hidden { display: none; }

.empty-glyph {
  width: 100px;
  height: 100px;
  object-fit: contain;
  opacity: .9;
}

.empty-title {
  font-size: 26px;
  font-weight: 400;
  color: var(--text-2);
  letter-spacing: -.015em;
  text-align: center;
}


/* ────────────────────────────────────────────────
   10. CONTENEDOR DE MENSAJES
──────────────────────────────────────────────── */

#messages {
  max-width: var(--msg-max);
  margin: 0 auto;
  padding: 36px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Animación entrada */
.message {
  display: flex;
  flex-direction: column;
  animation: fadeUp .28s var(--ease);
}

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


/* ────────────────────────────────────────────────
   11. BURBUJA USUARIO
──────────────────────────────────────────────── */

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

.user-bubble {
  background: var(--bubble-user);
  color: var(--bubble-txt);
  padding: 11px 17px;
  border-radius: var(--r-xl) var(--r-xl) var(--r-sm) var(--r-xl);
  max-width: 72%;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}

/* Preview adjunto en burbuja */
.bubble-attachment {
  margin-bottom: 8px;
}

.bubble-attachment img {
  display: block;
  max-width: 220px;
  max-height: 165px;
  border-radius: var(--r);
  object-fit: cover;
}

.bubble-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  background: rgba(0,0,0,.07);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-2);
}

.bubble-file .material-symbols-outlined { font-size: 17px; color: var(--iris); flex-shrink: 0; }
.bubble-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }


/* ────────────────────────────────────────────────
   12. RESPUESTA IA
──────────────────────────────────────────────── */

.message.ai { align-items: flex-start; width: 100%; }

/* ── Ver razonamiento ── */
.reasoning-block {
  width: 100%;
  margin-bottom: 10px;
}

.reasoning-block summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  list-style: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  user-select: none;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  letter-spacing: .01em;
}

.reasoning-block summary::-webkit-details-marker { display: none; }
.reasoning-block summary:hover { background: var(--surface-hover); color: var(--text-2); }

.reasoning-block summary .rsn-icon { font-size: 15px; }

.reasoning-chevron {
  font-size: 15px;
  transition: transform .2s var(--ease);
}

.reasoning-block[open] summary .reasoning-chevron { transform: rotate(90deg); }

.reasoning-body {
  margin-top: 8px;
  padding: 12px 16px;
  border-left: 2px solid var(--border);
  background: var(--surface);
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ── Texto IA ── */
.ai-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  word-break: break-word;
  width: 100%;
}

/* Cursor de streaming */
.ai-text.streaming::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: .95em;
  background: var(--iris);
  margin-left: 2px;
  vertical-align: text-bottom;
  border-radius: 2px;
  animation: blink .75s ease infinite;
}

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

/* Markdown dentro de .ai-text */
.ai-text p            { margin: 0 0 10px; }
.ai-text p:last-child { margin-bottom: 0; }

.ai-text h1 { font-size: 21px; font-weight: 600; margin: 18px 0 8px; letter-spacing: -.01em; }
.ai-text h2 { font-size: 17px; font-weight: 600; margin: 16px 0 7px; }
.ai-text h3 { font-size: 15px; font-weight: 600; margin: 12px 0 6px; }

.ai-text ul, .ai-text ol { padding-left: 22px; margin: 6px 0 10px; }
.ai-text li { margin: 3px 0; }

.ai-text strong { font-weight: 600; }
.ai-text em     { font-style: italic; }

.ai-text code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--iris);
  border: 1px solid var(--border);
}

.ai-text pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 10px 0;
  position: relative;
}

.ai-text pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.ai-text blockquote {
  border-left: 3px solid var(--iris);
  padding: 4px 14px;
  color: var(--text-2);
  margin: 8px 0;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--iris-dim);
}

.ai-text table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
  font-size: 14px;
}

.ai-text th, .ai-text td {
  border: 1px solid var(--border);
  padding: 7px 12px;
  text-align: left;
}

.ai-text th { background: var(--surface); font-weight: 600; }
.ai-text tr:nth-child(even) td { background: var(--bg); }

.ai-text hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* ── Acciones IA ── */
.ai-actions {
  display: flex;
  gap: 2px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity .2s;
}

.message.ai:hover .ai-actions,
.ai-actions.shown { opacity: 1; }

.ai-action-btn {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  flex-shrink: 0;
}

.ai-action-btn:hover  { background: var(--surface-hover); color: var(--text-2); }
.ai-action-btn:active { transform: scale(.91); }

.ai-action-btn .material-symbols-outlined { font-size: 17px; }

.ai-action-btn.active {
  color: var(--iris);
  background: var(--iris-dim);
}

.ai-action-btn.copied {
  color: #2e7d32;
  background: rgba(46,125,50,.1);
}


/* ────────────────────────────────────────────────
   13. COMPOSITOR
──────────────────────────────────────────────── */

#composer-wrap {
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  flex-shrink: 0;
  background: var(--bg-main);
  transition: background var(--t) var(--ease);
}

#composer {
  max-width: var(--cmp-max);
  margin: 0 auto;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 6px 6px 6px 4px;
  transition:
    border-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease),
    background var(--t) var(--ease);
  box-shadow: var(--shadow-sm);
}

/* Firma visual: halo iris cuando el usuario escribe */
#composer:focus-within {
  border-color: var(--iris);
  box-shadow: 0 0 0 3px var(--iris-glow), var(--shadow);
}

/* Preview adjuntos */
#attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 8px 2px;
}

#attach-preview:empty { display: none; }

.prev-item {
  position: relative;
  border-radius: var(--r);
  border: 1px solid var(--border);
  overflow: visible;
}

.prev-item img {
  width: 72px; height: 72px;
  object-fit: cover;
  display: block;
  border-radius: var(--r);
}

.prev-file {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--bg-main);
  border-radius: var(--r);
  max-width: 190px;
}

.prev-file .material-symbols-outlined { font-size: 17px; color: var(--iris); flex-shrink: 0; }

.prev-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prev-remove {
  position: absolute;
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg-main);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: background .15s;
}

.prev-remove:hover { background: var(--danger); }
.prev-remove .material-symbols-outlined { font-size: 13px; }

/* Fila principal */
.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

/* Zona de adjunto */
.attach-zone { position: relative; flex-shrink: 0; }

/* Menú adjunto */
.attach-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  z-index: 40;
  min-width: 175px;
  animation: menuPop .15s var(--ease);
}

.attach-menu.hidden { display: none; }

@keyframes menuPop {
  from { opacity: 0; transform: translateY(5px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.attach-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  font-size: 14px;
  color: var(--text);
  transition: background var(--t) var(--ease);
}

.attach-opt:hover { background: var(--surface-hover); }
.attach-opt .material-symbols-outlined { font-size: 20px; color: var(--iris); }

/* Textarea */
#msg-input {
  flex: 1;
  padding: 9px 6px;
  font-size: 15px;
  line-height: 1.5;
  min-height: 38px;
  max-height: 200px;
  overflow-y: auto;
  color: var(--text);
  scrollbar-width: thin;
}

#msg-input::placeholder { color: var(--text-3); }

/* Botón acción dinámico */
.action-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--t) var(--ease), transform .12s, box-shadow var(--t);
}

.action-btn .material-symbols-outlined { font-size: 21px; }

/* Estado: micrófono (default, sin texto) */
.action-btn.state-mic {
  background: var(--surface-hover);
  color: var(--text-2);
}

.action-btn.state-mic:hover { background: var(--border); color: var(--text); }

/* Estado: escuchando (grabando voz) */
.action-btn.state-listening {
  background: var(--iris);
  color: #fff;
  animation: micPulse 1.3s ease infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--iris-glow); }
  55%       { box-shadow: 0 0 0 9px transparent; }
}

/* Estado: enviar (hay texto en el input) */
.action-btn.state-send {
  background: var(--iris);
  color: #fff;
  box-shadow: 0 2px 10px var(--iris-glow);
}

.action-btn.state-send:hover {
  background: color-mix(in srgb, var(--iris) 82%, #000);
  transform: scale(1.04);
}

/* Estado: detener (IA escribiendo) */
.action-btn.state-stop {
  background: var(--danger);
  color: #fff;
}

.action-btn.state-stop:hover {
  background: color-mix(in srgb, var(--danger) 85%, #000);
}

/* Disclaimer */
.composer-disclaimer {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 7px;
  max-width: var(--cmp-max);
  margin-left: auto;
  margin-right: auto;
}


/* ────────────────────────────────────────────────
   14. MODAL CÁMARA
──────────────────────────────────────────────── */

.modal {
  position: fixed; inset: 0;
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s var(--ease);
}

.modal.hidden { display: none !important; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  background: var(--sidebar);
  border-radius: var(--r-lg);
  overflow: hidden;
  width: min(460px, 92vw);
  box-shadow: var(--shadow-md);
  animation: cardIn .22s var(--ease);
}

@keyframes cardIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 10;
  background: rgba(0,0,0,.38) !important;
  color: #fff !important;
  border-radius: 50% !important;
}

#cam-stream {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: #000;
}

#cam-canvas { display: none; }

.cam-controls {
  display: flex;
  justify-content: center;
  padding: 18px;
  background: var(--sidebar);
}

.capture-btn {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--iris);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px var(--iris-glow);
  transition: transform .14s, background var(--t);
}

.capture-btn:hover  { transform: scale(1.07); }
.capture-btn:active { transform: scale(.95); }
.capture-btn .material-symbols-outlined { font-size: 28px; }

/* ────────────────────────────────────────────────
   14b. TOAST
──────────────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg-main);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  max-width: min(90vw, 420px);
}

.toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast .toast-icon { font-size: 18px; flex-shrink: 0; }

.toast-error .toast-icon { color: #ff8a80; }
.toast-info  .toast-icon { color: var(--iris); }

.toast-msg {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ────────────────────────────────────────────────
   15. UTILITARIOS
──────────────────────────────────────────────── */

.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ────────────────────────────────────────────────
   16. RESPONSIVE
──────────────────────────────────────────────── */

@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.25);
    transition:
      transform var(--t) var(--ease),
      width var(--t) var(--ease),
      min-width var(--t) var(--ease);
  }

  #sidebar.collapsed {
    transform: translateX(-100%);
    /* Recupera ancho completo para que el slide-in se vea bien */
    width: var(--sb-open);
    min-width: var(--sb-open);
  }

  #main { width: 100%; }

  .user-bubble  { max-width: 85%; }
  #messages     { padding: 24px 14px 16px; }
  .empty-title  { font-size: 21px; }
  .empty-glyph  { font-size: 48px; }
}

@media (max-width: 480px) {
  #composer-wrap { padding: 8px 10px 12px; }
  .composer-disclaimer { font-size: 10.5px; }
}

#mobile-sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 50;
  background: var(--bg-main);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  #mobile-sidebar-toggle {
    display: flex;
  }
}