/* ═══════════════════════════════════════════════════════════════
   ATELIER SHELL · EIR DR. · Agentic Shell estilo Cursor/Claude Code
   Paleta oficial "Atelier Premium" (DESIGN.md)
   ═══════════════════════════════════════════════════════════════ */
:root {
  --surface: #0c1324;
  --surface-low: #151b2d;
  --surface-container: #191f31;
  --surface-high: #23293c;
  --surface-highest: #2e3447;
  --on-surface: #dce1fb;
  --on-surface-variant: #bbcabf;
  --primary: #4edea3;
  --primary-dim: #10b981;
  --primary-fixed: #6ffbbe;
  --secondary: #ffc640;
  --outline: #3c4a42;
  --error: #ffb4ab;
  --radius: 16px;
  --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--surface);
  color: var(--on-surface);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* glow de fondo */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(800px circle at 15% 0%, rgba(78,222,163,0.07), transparent 45%),
    radial-gradient(700px circle at 100% 100%, rgba(16,185,129,0.05), transparent 45%);
}

.shell-root { position: relative; z-index: 1; height: 100vh; display: flex; flex-direction: column; }

/* ─── Header ─── */
.shell-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(60,74,66,0.4);
  background: rgba(12,19,36,0.7);
  backdrop-filter: blur(14px);
  flex-shrink: 0;
}
.shell-brand { display: flex; align-items: center; gap: 12px; }
.brand-orb {
  width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
  border: 1px solid rgba(78,222,163,0.3);
  box-shadow: 0 0 18px rgba(78,222,163,0.35);
  flex-shrink: 0;
}
.brand-orb img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; transform: scale(1.5); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.brand-tag { font-size: 11px; color: var(--on-surface-variant); }
.shell-status { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--on-surface-variant); }
/* toggle idioma (Fase 8) */
.lang-toggle { display: inline-flex; border: 1px solid rgba(60,74,66,0.6); border-radius: 999px; overflow: hidden; }
.lang-btn {
  padding: 4px 10px; background: transparent; color: var(--on-surface-variant);
  border: none; cursor: pointer; font-size: 11px; font-weight: 600; font-family: 'JetBrains Mono'; transition: all .15s;
}
.lang-btn.active { background: var(--primary); color: var(--surface); }
.lang-btn:not(.active):hover { color: var(--primary-fixed); }
/* accesibilidad: foco visible (Fase 8) */
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.chip:focus-visible, .input-btn:focus-visible, .lang-btn:focus-visible { outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--outline); transition: background .3s; }
.status-dot.online { background: var(--primary); box-shadow: 0 0 10px var(--primary); animation: pulse 2s infinite; }
.status-dot.offline { background: var(--error); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ─── Body 3 columnas ─── */
.shell-body { flex: 1; display: flex; min-height: 0; }

/* Paneles laterales */
.shell-aside {
  width: 280px; flex-shrink: 0;
  background: rgba(21,27,45,0.45);
  border-right: 1px solid rgba(60,74,66,0.3);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.shell-aside-right { border-right: none; border-left: 1px solid rgba(60,74,66,0.3); }
.aside-toggle {
  display: none; /* visible solo en mobile */
  width: 100%; padding: 12px 18px; background: transparent; border: none;
  color: var(--on-surface); font-family: 'Outfit'; font-weight: 500; font-size: 14px;
  cursor: pointer; justify-content: space-between; align-items: center;
}
.aside-content { padding: 20px 18px; }
.aside-intro { font-size: 12.5px; color: var(--on-surface-variant); line-height: 1.5; margin-bottom: 16px; }
.aside-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--on-surface-variant); margin-bottom: 8px; }
.aside-divider { height: 1px; background: rgba(60,74,66,0.4); margin: 18px 0; }
.esp-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.esp-list li {
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px;
  cursor: pointer; transition: all .15s; border: 1px solid transparent;
}
.esp-list li:hover { background: rgba(78,222,163,0.08); border-color: rgba(78,222,163,0.25); transform: translateX(2px); }
.esp-list.quick li { color: var(--on-surface-variant); }
/* §enfoque · selector de rama clínica (radio activo) */
.enfoque-item { display: flex; align-items: center; gap: 9px; }
.enf-radio { width: 30px; height: 16px; border-radius: 999px; background: var(--surface-highest);
  border: 1px solid rgba(60,74,66,0.6); position: relative; flex-shrink: 0; transition: all .2s; }
.enf-radio::after { content: ""; position: absolute; top: 1px; left: 1px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--on-surface-variant); transition: all .2s; }
.enfoque-item.active { background: rgba(78,222,163,0.1); border-color: rgba(78,222,163,0.3); color: var(--primary-fixed); }
.enfoque-item.active .enf-radio { background: var(--primary); border-color: var(--primary); }
.enfoque-item.active .enf-radio::after { left: 15px; background: var(--surface); }

/* Guía derecha */
.guide-block { display: flex; gap: 12px; margin-bottom: 16px; }
.guide-num { font-family: 'JetBrains Mono'; font-size: 12px; color: var(--primary); flex-shrink: 0; padding-top: 2px; }
.guide-block strong { font-family: 'Outfit'; font-weight: 600; font-size: 13.5px; display: block; margin-bottom: 2px; }
.guide-block p { font-size: 12px; color: var(--on-surface-variant); line-height: 1.45; }
.guide-promise {
  margin-top: 20px; padding: 14px; border-radius: var(--radius-sm);
  background: rgba(78,222,163,0.07); border: 1px solid rgba(78,222,163,0.2);
  font-size: 12.5px; color: var(--primary-fixed); line-height: 1.5; font-style: italic;
}

/* ─── Chat central ─── */
.shell-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 28px 24px; display: flex; flex-direction: column; gap: 18px; }

/* Welcome */
.chat-welcome { max-width: 620px; margin: auto; text-align: center; padding: 20px; }
/* contenedor minimalista premium del avatar · pulso esmeralda sereno (v3-ready) */
.welcome-orb {
  position: relative;
  width: 132px; height: 132px; border-radius: 50%; overflow: hidden; margin: 0 auto 26px;
  border: 1px solid rgba(78,222,163,0.18);
  animation: orb-breathe 5s ease-in-out infinite, orb-pulse 3.6s ease-in-out infinite;
}
/* círculo más grande + menos zoom → se ve el avatar completo (cuerpo + bandeja + consultorio) */
.welcome-orb img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; transform: scale(1.08); }
/* pulso esmeralda sereno vía box-shadow (emana hacia afuera, sin recortarse) */
@keyframes orb-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(78,222,163,0.30), 0 0 40px rgba(78,222,163,0.22); }
  50%     { box-shadow: 0 0 0 10px rgba(78,222,163,0.0), 0 0 64px rgba(78,222,163,0.34); }
}
@keyframes orb-breathe { 0%,100%{transform:scale(1)} 50%{transform:scale(1.035)} }
.chat-welcome h1 { font-family: 'Outfit'; font-weight: 600; font-size: 32px; letter-spacing: -0.02em; margin-bottom: 12px; }
.chat-welcome > p { font-size: 14.5px; color: var(--on-surface-variant); line-height: 1.6; margin-bottom: 22px; }
.welcome-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 24px; }
.chip {
  padding: 9px 16px; border-radius: 999px; font-size: 13px; cursor: pointer;
  background: var(--surface-high); color: var(--on-surface);
  border: 1px solid rgba(60,74,66,0.5); transition: all .15s; font-family: 'Inter';
}
.chip:hover { background: rgba(78,222,163,0.1); border-color: var(--primary); color: var(--primary-fixed); }
.welcome-disclaimer { font-size: 11.5px !important; color: var(--on-surface-variant) !important; opacity: .8; }

/* Burbujas */
.msg { max-width: 760px; width: 100%; margin: 0 auto; display: flex; gap: 12px; animation: rise .3s ease; }
@keyframes rise { from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:translateY(0)} }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 1px solid rgba(78,222,163,0.3); }
.msg-avatar img { width:100%; height:100%; object-fit: cover; object-position: center 38%; transform: scale(1.5); }
.msg-body { flex: 1; padding-top: 3px; }
.msg-role { font-size: 11px; font-weight: 600; color: var(--primary); margin-bottom: 4px; font-family:'Outfit'; }
.msg-content { font-size: 14.5px; line-height: 1.65; color: var(--on-surface); }
.msg-content code { font-family: 'JetBrains Mono'; font-size: 13px; background: var(--surface-high); padding: 1px 6px; border-radius: 5px; }
/* markdown render estilo Stitch */
.msg-content p { margin: 0 0 10px; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-content strong { color: var(--on-surface); font-weight: 600; }
.msg-content em { color: var(--on-surface-variant); }
.msg-content h4 {
  font-family: 'Outfit'; font-weight: 600; font-size: 14px; color: var(--primary-fixed);
  margin: 16px 0 8px; padding-bottom: 5px; border-bottom: 1px solid rgba(78,222,163,0.18);
}
.msg-content .md-sub {
  font-family: 'Outfit'; font-weight: 600; font-size: 13.5px; color: var(--primary);
  margin: 14px 0 6px;
}
.msg-content ol, .msg-content ul { margin: 4px 0 12px; padding-left: 22px; }
.msg-content li { margin-bottom: 5px; line-height: 1.55; }
.msg-content ol li::marker { color: var(--primary); font-family: 'JetBrains Mono'; font-size: 12px; }
.msg-content ul li::marker { color: var(--primary); }
.msg.user { flex-direction: row-reverse; }
.msg.user .msg-body { display: flex; justify-content: flex-end; }
.msg.user .msg-content {
  background: var(--surface-high); padding: 10px 16px; border-radius: 16px 16px 4px 16px;
  max-width: 80%; border: 1px solid rgba(60,74,66,0.5);
}
.msg.user .msg-avatar { background: var(--primary-dim); display:flex; align-items:center; justify-content:center; font-size:15px; }

/* §F3 · barra de modos (toggle clínico) */
.chat-modes { display: flex; align-items: center; gap: 10px; padding: 8px 24px 0; flex-wrap: wrap; }
.mode-toggle {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-family: 'Inter'; font-weight: 600;
  background: var(--surface-high); color: var(--on-surface-variant);
  border: 1px solid rgba(60,74,66,0.6); transition: all .15s;
}
.mode-toggle .mode-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--outline); transition: all .2s; }
.mode-toggle.on { background: rgba(78,222,163,0.12); color: var(--primary-fixed); border-color: var(--primary); }
.mode-toggle.on .mode-dot { background: var(--primary); box-shadow: 0 0 8px var(--primary); }
.mode-hint { font-size: 11px; color: var(--on-surface-variant); opacity: .85; }

/* Input bar */
.chat-inputbar {
  flex-shrink: 0; display: flex; align-items: flex-end; gap: 10px;
  padding: 16px 24px 22px; border-top: 1px solid rgba(60,74,66,0.3);
  background: rgba(12,19,36,0.6); backdrop-filter: blur(10px);
}
#chat-input {
  flex: 1; resize: none; max-height: 160px;
  background: var(--surface-container); color: var(--on-surface);
  border: 1px solid rgba(60,74,66,0.6); border-radius: 14px;
  padding: 13px 16px; font-family: 'Inter'; font-size: 14.5px; line-height: 1.4;
  outline: none; transition: border-color .15s;
}
#chat-input:focus { border-color: var(--primary); }
#chat-input::placeholder { color: var(--on-surface-variant); opacity: .7; }
.input-btn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; cursor: pointer;
  background: var(--surface-high); color: var(--on-surface); border: 1px solid rgba(60,74,66,0.6);
  font-size: 18px; transition: all .15s; display: flex; align-items: center; justify-content: center;
}
.input-btn:hover { background: var(--surface-highest); }
.input-btn.rec { background: var(--error); color: #fff; border-color: var(--error); animation: rec-pulse 1.2s infinite; }
@keyframes rec-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(255,82,82,.5)} 50%{box-shadow:0 0 0 6px rgba(255,82,82,0)} }
.input-send { background: var(--primary); color: var(--surface); border-color: var(--primary); font-weight: 700; }
.input-send:hover { background: var(--primary-fixed); }
.input-send:disabled { opacity: .4; cursor: not-allowed; }

/* cards inline (Fase 2/3) */
.eir-card {
  background: var(--surface-container); border: 1px solid rgba(78,222,163,0.25);
  border-radius: 14px; padding: 14px 16px; margin: 6px 0; max-width: 480px;
}
.eir-card-title { font-family:'Outfit'; font-weight:600; font-size:14px; color: var(--primary-fixed); margin-bottom:4px; }
.eir-card-sub { font-size:12px; color: var(--on-surface-variant); margin-bottom:8px; }
.eir-card-row { font-size:13px; line-height:1.5; color: var(--on-surface); margin-bottom:8px; }
.eir-card-price { font-family:'JetBrains Mono'; font-size:13px; color: var(--secondary); margin-bottom:10px; }
.eir-card-btn {
  padding:8px 14px; border-radius:10px; border:1px solid var(--primary);
  background: var(--primary); color: var(--surface); font-weight:600; font-size:13px; cursor:pointer;
}
.eir-card-btn:disabled { opacity:.5; cursor:not-allowed; }

/* formulario de reserva in-chat (Fase 4) */
.eir-card-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.eir-input {
  background: var(--surface); color: var(--on-surface);
  border: 1px solid rgba(60,74,66,0.6); border-radius: 9px;
  padding: 9px 11px; font-family: 'Inter'; font-size: 13px; outline: none;
}
.eir-input:focus { border-color: var(--primary); }
.eir-fase-sel { width: 100%; cursor: pointer; }
.eir-reservar { margin-top: 2px; }
.eir-reserva-msg { font-size: 12px; }
.eir-err { color: var(--error); }
.eir-ok-block { display: flex; flex-direction: column; gap: 6px; }
.eir-ok-title { font-family:'Outfit'; font-weight:600; font-size:13.5px; color: var(--primary-fixed); }
.eir-ok-row { font-family:'JetBrains Mono'; font-size:12px; color: var(--secondary); }
.eir-pay {
  display:inline-block; text-align:center; text-decoration:none; margin-top:4px;
  padding:10px 14px; border-radius:10px; background: var(--primary); color: var(--surface);
  font-weight:700; font-size:13.5px;
}
.eir-pay:hover { background: var(--primary-fixed); }
.eir-ok-hint { font-size:11px; color: var(--on-surface-variant); line-height:1.4; }

/* pulso ecosistema (Fase 7) */
.eir-pulso-grid { display: flex; gap: 10px; margin-top: 4px; }
.eir-pulso-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 8px; border-radius: 11px; background: rgba(78,222,163,0.06);
  border: 1px solid rgba(78,222,163,0.18);
}
.eir-pulso-num { font-family: 'Outfit'; font-weight: 700; font-size: 22px; color: var(--primary-fixed); }
.eir-pulso-lbl { font-size: 10.5px; color: var(--on-surface-variant); text-transform: uppercase; letter-spacing: .05em; }

/* §F5 · Dashboard Historia Clínica */
.hc-overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  background: rgba(7,13,31,0.85); backdrop-filter: blur(8px); padding: 16px; }
.hc-panel { width: 100%; max-width: 680px; max-height: 92vh; overflow-y: auto;
  background: var(--surface-container); border: 1px solid rgba(78,222,163,0.18); border-radius: 20px; }
.hc-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 24px 14px;
  border-bottom: 1px solid rgba(60,74,66,0.4); position: sticky; top: 0; background: var(--surface-container); z-index: 2; }
.hc-head h2 { font-family: 'Outfit'; font-weight: 600; font-size: 20px; }
.hc-estado { font-size: 11px; color: var(--secondary); font-family: 'JetBrains Mono'; }
.hc-estado.hc-cerrada { color: var(--primary); }
.hc-x { background: transparent; border: none; color: var(--on-surface-variant); font-size: 18px; cursor: pointer; }
.hc-body { padding: 18px 24px; }
.hc-field { margin-bottom: 13px; }
.hc-field label { display: block; font-size: 11.5px; color: var(--on-surface-variant); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.hc-field input, .hc-field textarea { width: 100%; background: var(--surface); color: var(--on-surface);
  border: 1px solid rgba(60,74,66,0.6); border-radius: 10px; padding: 10px 13px; font-family: 'Inter'; font-size: 14px; outline: none; resize: vertical; }
.hc-field input:focus, .hc-field textarea:focus { border-color: var(--primary); }
.hc-row { display: flex; gap: 12px; } .hc-edad { max-width: 100px; }
.hc-label-odon { display: block; font-size: 11.5px; color: var(--on-surface-variant); margin: 6px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.hc-odontograma { background: var(--surface); border: 1px solid rgba(60,74,66,0.5); border-radius: 12px; padding: 14px; overflow-x: auto; }
.hc-odontograma svg { width: 100%; min-width: 520px; height: auto; }
.hc-legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.leg-item { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--on-surface-variant); }
.leg-dot { width: 10px; height: 10px; border-radius: 3px; }
.hc-actions { display: flex; gap: 12px; padding: 16px 24px; border-top: 1px solid rgba(60,74,66,0.4); position: sticky; bottom: 0; background: var(--surface-container); }
.hc-btn-save { flex: 1; padding: 12px; border-radius: 11px; border: 1px solid rgba(60,74,66,0.6); background: var(--surface-high); color: var(--on-surface); font-weight: 600; cursor: pointer; font-family: 'Outfit'; }
.hc-btn-sign { flex: 1; padding: 12px; border-radius: 11px; border: none; background: var(--primary); color: var(--surface); font-weight: 700; cursor: pointer; font-family: 'Outfit'; }
.hc-btn-sign:disabled, .hc-btn-save:disabled { opacity: .5; cursor: not-allowed; }
.hc-legal { font-size: 10.5px; color: var(--on-surface-variant); padding: 0 24px 18px; line-height: 1.5; }
/* §F7 · periodontograma + consentimientos */
.hc-perio-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 4px; }
.hc-perio-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--on-surface-variant); }
.hc-perio-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hc-consent-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 6px 0 10px; }
.hc-consent-btn { padding: 8px 13px; border-radius: 10px; cursor: pointer; font-size: 12.5px; font-weight: 600; font-family: 'Inter'; border: 1px solid rgba(60,74,66,0.6); background: var(--surface-high); color: var(--on-surface); transition: all .15s; }
.hc-consent-btn:hover { border-color: var(--primary); color: var(--primary); }
.hc-consent-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.hc-consent-item { font-size: 12px; color: var(--on-surface-variant); padding: 7px 11px; background: var(--surface); border: 1px solid rgba(60,74,66,0.4); border-radius: 9px; }
.hc-consent-item a { color: var(--primary); text-decoration: none; font-weight: 600; }
.hc-firma-ok { color: #4edea3; font-size: 10.5px; margin-left: 6px; }
/* §F8 · imágenes + presupuesto */
.hc-img-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 4px 0 10px; }
.hc-img-tipo { padding: 8px 11px; border-radius: 10px; border: 1px solid rgba(60,74,66,0.6); background: var(--surface-high); color: var(--on-surface); font-family: 'Inter'; font-size: 12.5px; }
.hc-img-galeria { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.hc-img-card { margin: 0; width: 96px; cursor: pointer; }
.hc-img-card img { width: 96px; height: 96px; object-fit: cover; border-radius: 9px; border: 1px solid rgba(60,74,66,0.5); display: block; }
.hc-img-card figcaption { font-size: 10px; color: var(--on-surface-variant); text-align: center; margin-top: 3px; text-transform: capitalize; }
.hc-presu-tabla { width: 100%; border-collapse: collapse; margin: 4px 0 8px; font-size: 12px; }
.hc-presu-tabla th { text-align: left; font-size: 10px; color: var(--on-surface-variant); text-transform: uppercase; letter-spacing: .04em; padding: 4px 6px; border-bottom: 1px solid rgba(60,74,66,0.4); }
.hc-presu-tabla td { padding: 4px 6px; color: var(--on-surface); }
.hc-presu-in { width: 100%; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(60,74,66,0.5); background: var(--surface); color: var(--on-surface); font-family: 'Inter'; font-size: 12px; }
.hc-presu-num { max-width: 90px; }
.hc-presu-del { background: none; border: none; color: #ff8a80; cursor: pointer; font-size: 13px; }
.hc-presu-total { font-weight: 700; color: var(--primary); text-align: right; }
/* §F12.1 · tarifario */
.hc-tarifa-panel { background: var(--surface); border: 1px solid rgba(60,74,66,0.5); border-radius: 11px; padding: 12px; margin: 8px 0; }
.hc-tarifa-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.hc-tarifa-form input { flex: 1; min-width: 110px; padding: 7px 9px; border-radius: 8px; border: 1px solid rgba(60,74,66,0.5); background: var(--surface-high); color: var(--on-surface); font-family: 'Inter'; font-size: 12px; }
.hc-tarifa-lista { display: flex; flex-direction: column; gap: 5px; }
.hc-tarifa-item { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--on-surface); padding: 6px 10px; background: var(--surface-high); border-radius: 8px; }
.hc-tarifa-del { background: none; border: none; color: #ff8a80; cursor: pointer; font-size: 12px; }
/* §F13 · escáneres 3D */
.hc-scan-mini { display: inline-block; margin-left: 6px; padding: 3px 9px; border-radius: 7px; border: 1px solid rgba(60,74,66,0.6); background: var(--surface-high); color: var(--primary); font-size: 11px; font-weight: 600; cursor: pointer; text-decoration: none; }
.hc-scan-mini:hover { border-color: var(--primary); }
.hc-scan-del { color: #ff8a80; }
.hc-scan-viewer { width: 100%; height: 340px; background: #0c1324; border-radius: 12px; margin: 8px 0; overflow: hidden; }
.hc-scan-viewer canvas { display: block; }
/* §F6 · voz→ficha */
.hc-voz { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 12px; }
.hc-mic, .hc-estructurar { padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: 'Inter'; border: 1px solid rgba(60,74,66,0.6); background: var(--surface-high); color: var(--on-surface); transition: all .15s; }
.hc-mic.on { background: var(--error); color: #fff; border-color: var(--error); }
.hc-estructurar { background: rgba(78,222,163,0.12); color: var(--primary-fixed); border-color: var(--primary); }
.hc-estructurar:hover { background: rgba(78,222,163,0.2); }
.hc-estructurar:disabled { opacity: .6; cursor: wait; }
.hc-voz-estado { font-size: 12px; color: var(--primary); }

/* §F1 · auth · chip de usuario + botón */
.auth-zone { display: flex; align-items: center; }
.btn-auth {
  padding: 5px 14px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 600;
  background: var(--primary); color: var(--surface); border: none; font-family: 'Inter'; transition: all .15s;
}
.btn-auth:hover { background: var(--primary-fixed); }
.user-chip { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.user-tier { font-family: 'JetBrains Mono'; font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; letter-spacing: .05em; }
.tier-free { background: rgba(187,202,191,0.15); color: var(--on-surface-variant); }
.tier-pago { background: var(--primary); color: var(--surface); }
.btn-logout { background: transparent; border: none; color: var(--on-surface-variant); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.btn-logout:hover { color: var(--error); }
/* §F10 · botón Pro */
.btn-pro { background: linear-gradient(135deg, var(--primary), var(--primary-fixed, var(--primary))); color: var(--surface); border: none; border-radius: 7px; font-family: 'Outfit'; font-size: 11px; font-weight: 700; padding: 3px 9px; cursor: pointer; letter-spacing: .02em; transition: filter .15s; }
.btn-pro:hover { filter: brightness(1.12); }
.btn-pro:disabled { opacity: .6; cursor: wait; }
/* modal de auth */
.auth-modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(7,13,31,0.82); backdrop-filter: blur(8px); padding: 20px;
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface-container);
  border: 1px solid rgba(78,222,163,0.18); border-radius: 20px; padding: 30px 26px; text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.5);
}
.auth-orb { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; margin: 0 auto 16px; border: 1px solid rgba(78,222,163,0.25); box-shadow: 0 0 30px rgba(78,222,163,0.3); }
.auth-orb img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; transform: scale(1.08); }
.auth-card h2 { font-family: 'Outfit'; font-weight: 600; font-size: 22px; margin-bottom: 6px; }
.auth-sub { font-size: 13px; color: var(--on-surface-variant); line-height: 1.5; margin-bottom: 18px; }
.auth-error { background: rgba(255,180,171,0.12); color: var(--error); font-size: 12.5px; padding: 9px 12px; border-radius: 9px; margin-bottom: 14px; }
.auth-field { margin-bottom: 11px; }
.auth-field input {
  width: 100%; background: var(--surface); color: var(--on-surface);
  border: 1px solid rgba(60,74,66,0.6); border-radius: 11px; padding: 12px 14px;
  font-family: 'Inter'; font-size: 14px; outline: none; transition: border-color .15s;
}
.auth-field input:focus { border-color: var(--primary); }
.auth-consent { display: flex; align-items: flex-start; gap: 8px; text-align: left; font-size: 11.5px; color: var(--on-surface-variant); margin-bottom: 16px; line-height: 1.4; cursor: pointer; }
.auth-consent input { margin-top: 2px; accent-color: var(--primary); }
.auth-submit {
  width: 100%; padding: 13px; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 14.5px;
  background: var(--primary); color: var(--surface); border: none; font-family: 'Outfit'; transition: all .15s;
}
.auth-submit:hover { background: var(--primary-fixed); }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-switch { font-size: 12.5px; color: var(--on-surface-variant); margin-top: 16px; }
.auth-link { background: none; border: none; color: var(--primary); cursor: pointer; font-weight: 600; font-size: 12.5px; }

/* sesiones previas / memoria (Fase 6) */
.sesiones-list { display: flex; flex-direction: column; gap: 6px; }
.sesiones-vacio { font-size: 12px; color: var(--on-surface-variant); opacity: .8; line-height: 1.5; }
.sesiones-perfil {
  font-size: 11px; color: var(--primary); margin-bottom: 8px;
  font-family: 'JetBrains Mono'; letter-spacing: .01em;
}
.sesion-item {
  padding: 8px 10px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent; transition: all .15s; background: rgba(21,27,45,0.4);
}
.sesion-item:hover { background: rgba(78,222,163,0.08); border-color: rgba(78,222,163,0.25); }
.ses-top { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; margin-bottom: 3px; }
.ses-fecha { margin-left: auto; font-size: 10px; color: var(--on-surface-variant); font-family: 'JetBrains Mono'; font-weight: 400; }
.ses-txt { font-size: 11.5px; color: var(--on-surface-variant); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ses-flag { color: var(--secondary); font-size: 11px; }

/* visión: thumbnail de imagen subida (Fase 5) */
.eir-thumb {
  max-width: 200px; max-height: 200px; border-radius: 10px;
  border: 1px solid rgba(78,222,163,0.3); margin-bottom: 6px; display: block;
}
/* voz: barra de acciones + botón escuchar (Fase 5) */
.msg-actions { margin-top: 8px; display: flex; gap: 8px; }
.speak-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--on-surface-variant);
  border: 1px solid rgba(60,74,66,0.6); font-size: 12px; font-family: 'Inter';
  transition: all .15s;
}
.speak-btn:hover { border-color: var(--primary); color: var(--primary-fixed); background: rgba(78,222,163,0.06); }
.speak-btn:disabled { opacity: .6; cursor: wait; }

/* typing indicator */
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: blink 1.2s infinite; }
.typing span:nth-child(2){ animation-delay:.2s } .typing span:nth-child(3){ animation-delay:.4s }
@keyframes blink { 0%,60%,100%{opacity:.3} 30%{opacity:1} }

/* scrollbars */
.chat-scroll::-webkit-scrollbar, .shell-aside::-webkit-scrollbar { width: 8px; }
.chat-scroll::-webkit-scrollbar-thumb, .shell-aside::-webkit-scrollbar-thumb { background: rgba(60,74,66,0.5); border-radius: 4px; }

/* ─── Responsive mobile ─── */
@media (max-width: 1024px) {
  .shell-body { flex-direction: column; overflow-y: auto; }
  .shell-aside { width: 100%; border: none; border-bottom: 1px solid rgba(60,74,66,0.3); }
  .shell-aside-left { order: 2; } .shell-chat { order: 1; min-height: 72vh; }
  .shell-aside-right { order: 3; }
  .aside-toggle { display: flex; }
  .aside-content { display: none; }
  .aside-content.open { display: block; }
  .chat-welcome h1 { font-size: 26px; }
  .welcome-orb { width: 76px; height: 76px; margin-bottom: 16px; }
  .chat-scroll { padding: 18px 14px; }
  /* input bar respeta el notch/safe-area iOS y queda cómodo al pulgar */
  .chat-inputbar { padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); position: sticky; bottom: 0; }
  .brand-tag { display: none; } /* ahorra espacio en header mobile */
}
/* tap targets cómodos en touch */
@media (hover: none) {
  .esp-list li, .sesion-item { padding-top: 11px; padding-bottom: 11px; }
}

/* ─── Módulos nav (sidebar izquierdo) ─── */
.modulos-nav li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.modulo-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  background: rgba(78,222,163,.15);
  color: var(--primary);
  border: 1px solid rgba(78,222,163,.3);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* ─── Feature cards (sidebar derecho) ─── */
.feat-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid rgba(60,74,66,0.35);
  background: rgba(21,27,45,0.6);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.feat-card:hover {
  background: rgba(78,222,163,.07);
  border-color: rgba(78,222,163,.3);
  transform: translateY(-1px);
}
.feat-card--active {
  border-color: rgba(78,222,163,.4);
  background: rgba(78,222,163,.05);
}
.feat-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.feat-card > div {
  flex: 1;
  min-width: 0;
}
.feat-card strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}
.feat-card p {
  font-size: 10.5px;
  color: var(--text-dim);
  line-height: 1.4;
  margin: 0;
}
.feat-status {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
}
.feat-on {
  background: rgba(78,222,163,.15);
  color: var(--primary);
  border: 1px solid rgba(78,222,163,.3);
}
.feat-pro {
  background: rgba(255,198,64,.12);
  color: #ffc640;
  border: 1px solid rgba(255,198,64,.3);
}
