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

/* ── VARIABLES — paleta unificada con login ─────────────────────── */
:root {
  /* Fondos */
  --bg-main:              #0a0f1e;
  --bg-card:              rgba(255,255,255,0.04);
  --bg-input:             rgba(0,212,255,0.05);
  --bg-grid:              rgba(0,212,255,0.07);

  /* Acento principal */
  --primary:              #00d4ff;
  --primary-hover:        rgba(0,212,255,0.1);
  --primary-border-light: rgba(0,212,255,0.2);
  --primary-border-strong:rgba(0,212,255,0.25);
  --primary-glow:         rgba(0,212,255,0.6);

  /* Tipografía */
  --text-primary:         #ffffff;
  --text-secondary:       rgba(255,255,255,0.4);
  --text-muted:           rgba(255,255,255,0.2);

  /* Estados */
  --error-text:           #f87171;
  --error-bg:             rgba(220,38,38,0.1);
  --error-border:         rgba(220,38,38,0.3);

  /* Semánticos internos */
  --success:              #5DEBB0;
  --success-bg:           rgba(93,235,176,0.1);
  --warning:              #FCD34D;
  --border:               rgba(0,212,255,0.15);
  --radius-sm:            6px;
  --radius-md:            12px;
  --radius-bubble:        20px;
}

/* ── BASE ──────────────────────────────────────────────────────── */
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ── FONDO PROFESIONAL — gradiente sutil empresarial ───────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(0,212,255,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(0,150,200,0.04) 0%, transparent 60%);
  z-index: 0;
  pointer-events: none;
}

/* ── LAYOUT ────────────────────────────────────────────────────── */
.app  { display: flex; height: 100vh; overflow: hidden; position: relative; z-index: 1; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── SKELETON LOADING ──────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  display: inline-block;
  border-radius: 4px;
  background: linear-gradient(90deg,
    rgba(0,212,255,0.04) 25%,
    rgba(0,212,255,0.10) 50%,
    rgba(0,212,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}
.sk-line    { width: 130px; height: 14px; }
.sk-line-sm { width: 90px;  height: 11px; }

/* ── SIDEBAR ───────────────────────────────────────────────────── */
.sidebar {
  width: 280px; min-width: 280px;
  background: rgba(10,15,30,0.95);
  border-right: 1px solid var(--primary-border-light);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: width 0.25s ease, min-width 0.25s ease;
}
.sidebar-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,212,255,0.12) transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.12); border-radius: 3px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden;
}
.sidebar-logo {
  padding: 1.4rem 1.4rem 1rem;
  display: flex; align-items: center; gap: 0.5rem;
  border-bottom: 1px solid var(--primary-border-light);
}
.logo-icon {
  font-size: 1.3rem;
  color: var(--primary);
  text-shadow: 0 0 12px var(--primary-glow);
}
.logo-text {
  color: var(--text-primary);
  font-size: 1.1rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
}
.logo-text span { color: var(--primary); }

.sidebar-section {
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--primary-border-light);
}
.sidebar-label {
  font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: rgba(0,212,255,0.5);
  margin-bottom: 0.9rem;
}
.patient-name { color: var(--text-primary); font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem; min-height: 1.2rem; }
.patient-id   { color: var(--text-secondary); font-size: 0.75rem; margin-bottom: 0.75rem; min-height: 1rem; }

/* ── STATUS ROW ────────────────────────────────────────────────── */
.status-row {
  display: flex; align-items: center; gap: 0.5rem;
  flex-wrap: wrap; margin-bottom: 0.9rem;
}
.status-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(93,235,176,0.3);
  border-radius: 20px; padding: 0.2rem 0.65rem;
  font-size: 0.72rem; font-weight: 500;
}
.status-badge.inactive {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: var(--error-border);
}
.status-dot { width: 6px; height: 6px; background: var(--success); border-radius: 50%; }
.status-badge.inactive .status-dot { background: var(--error-text); }

.aseguradora-badge {
  background: var(--bg-card);
  border: 1px solid var(--primary-border-light);
  border-radius: 20px; padding: 0.2rem 0.6rem;
  font-size: 0.68rem; color: var(--text-secondary);
}

/* ── PLAN & COPAGOS ────────────────────────────────────────────── */
.plan-label { color: var(--text-secondary); font-size: 0.72rem; margin-bottom: 0.4rem; }
.plan-name  { color: var(--text-primary); font-size: 0.85rem; font-weight: 500; margin-bottom: 1rem; min-height: 1rem; }

.copago-chips  { display: flex; flex-direction: column; gap: 0.4rem; }
.copago-chip {
  background: var(--bg-input);
  border: 1px solid var(--primary-border-light);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  display: flex; justify-content: space-between; align-items: center;
}
.chip-label { color: var(--text-secondary); font-size: 0.75rem; }
.chip-value        { color: var(--text-primary); font-size: 0.82rem; font-weight: 600; }
.chip-value.green  { color: var(--success); }
.chip-value.orange { color: var(--warning); }
.chip-value.muted  { color: var(--text-muted); }

/* ── COBERTURAS ────────────────────────────────────────────────── */
.coverage-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.coverage-tag {
  background: rgba(0,212,255,0.08);
  border: 1px solid var(--primary-border-light);
  border-radius: 20px;
  padding: 0.2rem 0.6rem;
  font-size: 0.68rem; color: rgba(0,212,255,0.9);
}

/* ── HISTORIAL ─────────────────────────────────────────────────── */
.history-list { display: flex; flex-direction: column; gap: 0.15rem; }

.history-group-label {
  font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.07em; color: rgba(0,212,255,0.3);
  padding: 0.6rem 0.5rem 0.25rem;
}

.history-item {
  display: flex; align-items: center; gap: 0.3rem;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}
.history-item:hover { background: rgba(0,212,255,0.06); }

.history-item-content {
  flex: 1; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0;
}

.history-symptom {
  color: rgba(255,255,255,0.75); font-size: 0.8rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history-specialty { color: rgba(0,212,255,0.7); font-size: 0.68rem; }

.history-delete-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.2);
  cursor: pointer; font-size: 0.72rem;
  padding: 0.2rem 0.4rem; border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0; line-height: 1;
}
.history-item:hover .history-delete-btn { opacity: 1; }
.history-delete-btn:hover {
  color: var(--error-text);
  background: var(--error-bg);
}
.history-delete-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── SUGERENCIAS RÁPIDAS EN CHAT ──────────────────────────────── */
.quick-suggestions {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  padding: 0 0.5rem 0.5rem;
}
.quick-chip {
  background: var(--bg-card);
  border: 1px solid var(--primary-border-light);
  border-radius: 20px;
  color: rgba(0,212,255,0.85);
  padding: 0.45rem 1rem;
  font-size: 0.82rem; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.quick-chip:hover {
  background: var(--primary-hover);
  border-color: var(--primary-border-strong);
  color: var(--primary);
}

/* ── QUICK BUTTONS ─────────────────────────────────────────────── */
.quick-btns { display: flex; flex-direction: column; gap: 0.45rem; }
.quick-btn {
  background: var(--bg-card);
  border: 1px solid var(--primary-border-light);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem; text-align: left; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.quick-btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-border-strong);
  color: var(--primary);
}

/* ── SIDEBAR FOOTER ────────────────────────────────────────────── */
.sidebar-footer { padding: 1rem 1.4rem; margin-top: auto; }
.footer-status  { display: flex; align-items: center; gap: 0.45rem; }
.footer-status p { color: var(--text-muted); font-size: 0.68rem; }
.footer-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.footer-dot.loading { background: var(--warning); animation: pulse-dot 1.4s ease-in-out infinite; }
.footer-dot.ok      { background: var(--success); }
.footer-dot.error   { background: var(--error-text); }

/* ── SIDEBAR TOGGLE ────────────────────────────────────────────── */
.sidebar-toggle {
  background: transparent;
  border: 1px solid var(--primary-border-light);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.4rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex; align-items: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.sidebar-toggle svg { fill: currentColor; display: block; }
.sidebar-toggle:hover {
  background: var(--primary-hover);
  color: var(--primary);
  border-color: var(--primary-border-strong);
}

/* ── CHAT HEADER ───────────────────────────────────────────────── */
.chat-header {
  background: rgba(10,15,30,0.9);
  border-bottom: 1px solid var(--primary-border-light);
  padding: 0.9rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}
.chat-header-left { display: flex; align-items: center; gap: 0.75rem; }
.agent-avatar {
  width: 38px; height: 38px;
  background: var(--primary-hover);
  border: 1px solid var(--primary-border-strong);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 1rem; font-weight: 700;
  text-shadow: 0 0 8px var(--primary-glow);
}
.agent-name { font-weight: 600; font-size: 0.95rem; letter-spacing: 1px; color: var(--text-primary); }
.agent-sub  { color: var(--text-secondary); font-size: 0.75rem; }

.header-right { display: flex; align-items: center; gap: 0.9rem; }
.online-badge {
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--success); font-size: 0.78rem; font-weight: 500;
}
.online-dot {
  width: 8px; height: 8px;
  background: var(--success); border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity:1; transform:scale(1); }
  50%     { opacity:0.6; transform:scale(0.85); }
}

.clear-btn {
  display: flex; align-items: center; gap: 0.35rem;
  background: transparent;
  border: 1px solid var(--primary-border-light);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 1px;
}
.clear-btn svg { fill: currentColor; flex-shrink: 0; }
.clear-btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-border-strong);
  color: var(--primary);
  box-shadow: 0 0 10px rgba(0,212,255,0.1);
}

/* ── MESSAGES ──────────────────────────────────────────────────── */
.messages {
  flex: 1; overflow-y: auto;
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1.2rem;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,212,255,0.12) transparent;
}
.messages::-webkit-scrollbar { width: 3px; }
.messages::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.12); border-radius: 3px; }
.messages::-webkit-scrollbar-track { background: transparent; }

/* ── WELCOME CARD ──────────────────────────────────────────────── */
.welcome-card {
  background: var(--bg-card);
  border: 1px solid var(--primary-border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.8rem;
  box-shadow: 0 0 20px rgba(0,212,255,0.05);
}
.welcome-card-title {
  font-size: 0.82rem; font-weight: 600; color: var(--primary);
  display: flex; align-items: center; gap: 0.4rem;
  letter-spacing: 1px; text-transform: uppercase;
}
.welcome-hints { display: flex; flex-direction: column; gap: 0.4rem; }
.welcome-hint {
  font-size: 0.8rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 0.5rem;
}
.hint-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
  box-shadow: 0 0 6px var(--primary-glow);
}

/* ── MESSAGE ROW ───────────────────────────────────────────────── */
.msg-row      { display: flex; gap: 0.6rem; max-width: 100%; }
.msg-row.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-hover);
  border: 1px solid var(--primary-border-strong);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; margin-top: 2px;
}
.msg-avatar.user-av {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  color: var(--text-secondary);
}

.msg-content { display: flex; flex-direction: column; gap: 0.5rem; max-width: 72%; }
.msg-row.user .msg-content { align-items: flex-end; }

/* ── BUBBLES ───────────────────────────────────────────────────── */
.bubble {
  padding: 0.7rem 1rem;
  font-size: 0.9rem; line-height: 1.55;
  word-break: break-word;
}
.bubble.bot {
  background: var(--bg-card);
  border: 1px solid var(--primary-border-light);
  border-radius: var(--radius-bubble) var(--radius-bubble) var(--radius-bubble) 4px;
  color: var(--text-primary);
  box-shadow: 0 0 12px rgba(0,212,255,0.04);
}
.bubble.user {
  background: rgba(0,212,255,0.15);
  border: 1px solid rgba(0,212,255,0.3);
  color: #ffffff;
  border-radius: var(--radius-bubble) var(--radius-bubble) 4px var(--radius-bubble);
}
.msg-time { font-size: 0.68rem; color: var(--text-muted); padding: 0 0.2rem; }

/* ── COVERAGE CARD ─────────────────────────────────────────────── */
.rec-card {
  background: var(--bg-card);
  border-left: 3px solid var(--primary);
  border: 1px solid var(--primary-border-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: 0 0 20px rgba(0,212,255,0.06);
  overflow: hidden;
}
.rec-card.emergency {
  border-left-color: var(--error-text);
  border-color: var(--error-border);
}
.rec-card.emergency .rec-card-header {
  background: var(--error-bg);
  color: var(--error-text);
}
.rec-card-header {
  background: rgba(0,212,255,0.06);
  padding: 0.55rem 0.9rem;
  font-size: 0.68rem; font-weight: 700;
  color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.1em;
  display: flex; align-items: center; justify-content: space-between;
}
.rec-card-body { padding: 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.65rem; }
.rec-row   { display: flex; align-items: flex-start; gap: 0.5rem; }
.rec-icon  { font-size: 0.95rem; margin-top: 0.1rem; flex-shrink: 0; }
.rec-detail { display: flex; flex-direction: column; }
.rec-key   { font-size: 0.68rem; color: var(--text-secondary); margin-bottom: 0.1rem; letter-spacing: 0.05em; }
.rec-val   { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.rec-val.big-green  { font-size: 1.15rem; color: var(--primary); text-shadow: 0 0 6px rgba(0,212,255,0.3); }
.rec-val.big-orange { font-size: 1.15rem; color: var(--warning); }

.rec-card-footer {
  padding: 0.5rem 0.9rem 0.65rem;
  border-top: 1px solid var(--primary-border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.rec-consult-id { font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.05em; }

/* ── TYPING ────────────────────────────────────────────────────── */
.typing-bubble { display: flex; align-items: center; gap: 4px; padding: 0.7rem 1rem; }
.typing-dot {
  width: 7px; height: 7px;
  background: var(--primary-border-strong);
  border-radius: 50%;
  animation: bounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%,60%,100% { transform: translateY(0); }
  30%         { transform: translateY(-6px); }
}

/* ── INPUT BAR ─────────────────────────────────────────────────── */
.input-bar {
  background: rgba(10,15,30,0.9);
  border-top: 1px solid var(--primary-border-light);
  padding: 0.9rem 1.2rem;
  display: flex; align-items: center; gap: 0.75rem;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}
.input-wrap {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--primary-border-strong);
  border-radius: 24px; padding: 0.6rem 1.1rem;
  display: flex; align-items: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}
.input-wrap input {
  flex: 1; border: none; background: transparent;
  font-size: 0.9rem; color: var(--text-primary);
  outline: none; font-family: inherit;
}
.input-wrap input::placeholder { color: var(--text-muted); }

.send-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: transparent;
  border: 1px solid var(--primary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
  color: var(--primary);
}
.send-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 16px rgba(0,212,255,0.2);
  transform: scale(1.05);
}
.send-btn svg      { width: 16px; height: 16px; fill: var(--primary); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── CERRAR SESIÓN ─────────────────────────────────────────────── */
.logout-btn {
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.logout-btn:hover {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}

/* ── MODAL INACTIVIDAD ─────────────────────────────────────────── */
.inactivity-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 999;
  align-items: center; justify-content: center;
}
.inactivity-modal {
  background: #0d1426;
  border: 1px solid var(--primary-border-light);
  border-radius: 16px;
  padding: 2rem;
  max-width: 360px; width: 90%;
  text-align: center;
  box-shadow: 0 0 40px rgba(0,212,255,0.1);
}
.inactivity-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.inactivity-modal h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-primary); }
.inactivity-modal p  { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.inactivity-btns { display: flex; gap: 10px; justify-content: center; }
.btn-continuar {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 8px; font-size: 13px;
  letter-spacing: 1px; cursor: pointer;
  transition: all 0.15s;
}
.btn-continuar:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 16px rgba(0,212,255,0.15);
}
.btn-salir {
  padding: 10px 20px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; font-size: 13px; cursor: pointer;
  transition: all 0.15s;
}
.btn-salir:hover {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}

/* ── SIDEBAR BACKDROP (móvil) ──────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-backdrop.active { display: block; }

/* ── MOBILE ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Sidebar: drawer que desliza desde la izquierda */
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: -280px;
    z-index: 200;
    transition: left 0.28s ease, box-shadow 0.28s ease;
    box-shadow: none;
  }
  .sidebar.mobile-open {
    left: 0;
    box-shadow: 6px 0 32px rgba(0,0,0,0.6);
  }

  /* Botón hamburguesa */
  .mobile-menu-btn {
    background: transparent; border: none;
    color: var(--primary); cursor: pointer;
    display: flex; align-items: center;
    padding: 0.2rem; flex-shrink: 0;
  }
  .mobile-menu-btn svg { fill: currentColor; display: block; }

  /* Mobile bar */
  .mobile-bar {
    display: flex; align-items: center; gap: 0.75rem;
    background: rgba(10,15,30,0.95);
    border-bottom: 1px solid var(--primary-border-light);
    padding: 0.7rem 1rem; flex-shrink: 0;
  }
  .mobile-logo-text {
    color: var(--text-primary); font-weight: 600;
    font-size: 0.95rem; flex: 1; letter-spacing: 2px;
  }
  .mobile-policy {
    background: var(--bg-input);
    border: 1px solid var(--primary-border-strong);
    border-radius: 20px; padding: 0.3rem 0.85rem;
    color: var(--primary); font-size: 0.78rem; cursor: pointer;
  }

  /* Chat header: más compacto */
  .chat-header { padding: 0.65rem 0.9rem; }
  .sidebar-toggle { display: none; }
  .agent-avatar { width: 32px; height: 32px; font-size: 0.85rem; }
  .agent-sub { display: none; }
  .online-badge { display: none; }
  .clear-btn { padding: 0.25rem 0.65rem; font-size: 0.7rem; gap: 0.25rem; }
  .clear-btn svg { width: 12px; height: 12px; }

  /* Área de mensajes */
  .messages { padding: 0.85rem 0.75rem; gap: 0.9rem; }
  .msg-content { max-width: 88%; }
  .bubble { font-size: 0.85rem; padding: 0.6rem 0.85rem; }

  /* Welcome card */
  .welcome-card { padding: 1rem 1.1rem; }
  .welcome-card-title { font-size: 0.78rem; }
  .welcome-hint { font-size: 0.76rem; }

  /* Quick suggestion chips */
  .quick-suggestions { padding: 0 0.25rem 0.4rem; gap: 0.4rem; }
  .quick-chip { font-size: 0.76rem; padding: 0.35rem 0.7rem; }

  /* Coverage card: ancho completo en móvil */
  .msg-content { width: 100%; }
  .rec-card { width: 100%; }
  .rec-val.big-green, .rec-val.big-orange { font-size: 1rem; }

  /* Input bar */
  .input-bar { padding: 0.65rem 0.75rem; gap: 0.5rem; }
  .input-wrap { padding: 0.5rem 0.9rem; }
  .input-wrap input { font-size: 0.85rem; }
  .send-btn { width: 36px; height: 36px; }
  .send-btn svg { width: 14px; height: 14px; }

  /* Modal inactividad: botones apilados */
  .inactivity-btns { flex-direction: column; }
  .btn-continuar, .btn-salir { width: 100%; }
}

@media (min-width: 641px) {
  .mobile-bar { display: none; }
  .mobile-menu-btn { display: none; }
}