/* Asesor con el LAYOUT tipo Claude (riel de iconos a la izquierda + saludo
   centrado + caja grande de entrada + pastillas de categorías), pero con el
   diseño de AvoHass (cremas/verde, claro) y sus funciones. Archivo propio para
   que llegue al instante pese a la caché. */

:root { --rail-w: 226px; --rail-wc: 64px; --rail-ink: #55634f; }

/* ── Riel DESPLEGABLE de la izquierda (como el de Claude), monocromo ── */
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail-w); z-index: 30;
  background: var(--crema-tarjeta); border-right: 1px solid rgba(47, 93, 58, 0.12);
  display: flex; flex-direction: column; padding: 12px 10px; gap: 2px;
  transition: width 0.18s ease; overflow: hidden;
}
html.rail-collapsed .rail { width: var(--rail-wc); }

.rail-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; padding: 2px 4px; }
.rail-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--verde-texto); min-width: 0; }
.rail-brand img { width: 30px; height: 30px; flex: 0 0 auto; }
.rail-brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.18rem; }
.rail-toggle { flex: 0 0 auto; width: 34px; height: 34px; border: 0; background: transparent; color: var(--rail-ink); cursor: pointer; border-radius: 10px; display: grid; place-items: center; }
.rail-toggle:hover { background: var(--verde-suave); }
.rail-toggle svg { width: 20px; height: 20px; }

.rail-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; margin-top: 6px; }
.rail-bottom { display: flex; flex-direction: column; gap: 2px; }
.rail-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 11px; border-radius: 11px;
  color: var(--rail-ink); text-decoration: none; font-size: 0.94rem; font-weight: 500;
  font-family: var(--sans); border: 0; background: transparent; cursor: pointer; width: 100%;
  text-align: left; white-space: nowrap;
}
.rail-item:hover { background: var(--verde-suave); }
.rail-item.activo { background: var(--verde-oscuro); color: #fff; }
.rail-ico { flex: 0 0 auto; display: grid; place-items: center; width: 22px; height: 22px; }
.rail-ico svg { width: 21px; height: 21px; }
.rail-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rail-new { color: var(--verde-oscuro); font-weight: 600; margin-bottom: 4px; }

/* Colapsado: solo iconos */
html.rail-collapsed .rail-label, html.rail-collapsed .rail-brand-name { display: none; }
html.rail-collapsed .rail-top { flex-direction: column; gap: 8px; justify-content: center; }
html.rail-collapsed .rail-brand { gap: 0; justify-content: center; }
html.rail-collapsed .rail-item { justify-content: center; padding: 10px 0; gap: 0; }

/* ── Zona principal ── */
.asesor-main { margin-left: var(--rail-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.18s ease; }
html.rail-collapsed .asesor-main { margin-left: var(--rail-wc); }
.asesor-center { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 11vh 20px 48px; }
.asesor-answered .asesor-center { padding-top: 40px; }

/* ── Saludo centrado con la marca (aguacate flotando) ── */
.ase-greet { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 26px; }
.ase-greet img { width: 44px; height: 44px; animation: markFloat 3.2s ease-in-out infinite alternate; will-change: transform; }
.ase-greet h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.5px;
  font-size: clamp(1.55rem, 4vw, 2.15rem); color: var(--verde-texto); margin: 0; line-height: 1.1;
}
.ase-greet h1 .verde { color: #3E7C4F; }
@keyframes markFloat { 0% { transform: translateY(-5px) rotate(-2deg); } 100% { transform: translateY(5px) rotate(2deg); } }

/* ── Caja grande de entrada (compositor), como Claude ── */
.composer {
  max-width: 720px; margin: 0 auto; background: #fff;
  border: 1.5px solid rgba(47, 93, 58, 0.22); border-radius: 22px;
  box-shadow: 0 12px 34px -18px rgba(20, 45, 28, 0.30); padding: 16px 18px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.composer:focus-within { border-color: var(--verde-oscuro); box-shadow: 0 0 0 4px rgba(47, 93, 58, 0.09); }
.composer textarea {
  width: 100%; border: 0; resize: none; background: transparent; font-family: var(--sans);
  font-size: 1.05rem; color: var(--tinta); line-height: 1.5; outline: none; max-height: 220px; display: block;
}
.composer textarea::placeholder { color: var(--tinta-suave); }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.composer-hint { font-size: 0.8rem; color: var(--tinta-suave); }
.composer-send {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--verde-oscuro); color: #fff; display: grid; place-items: center;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.composer-send:hover { transform: translateY(-1px); filter: brightness(1.1); }
.composer-send svg { width: 20px; height: 20px; }

/* ── Pastillas de categorías (como Código/Escribir/… de Claude) ── */
.ase-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px;
  border: 1px solid rgba(47, 93, 58, 0.20); background: #fff; color: var(--verde-texto);
  font-weight: 600; font-size: 0.9rem; cursor: pointer; font-family: var(--sans); transition: background 0.12s ease;
}
.pill:hover { background: var(--verde-suave); }

/* Al preguntar, se ocultan saludo y pastillas (deja el compositor + respuesta). */
.asesor-answered .ase-greet, .asesor-answered .ase-pills { display: none; }

/* Entrada suave del centro. */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.asesor-center > * { animation: fadeUp 0.5s ease-out both; }
.asesor-center > *:nth-child(2) { animation-delay: 0.08s; }
.asesor-center > *:nth-child(3) { animation-delay: 0.16s; }
@media (prefers-reduced-motion: reduce) { .asesor-center > *, .ase-greet img { animation: none; } }

/* ── Móvil: el riel pasa a barra inferior (tabs de iconos), sin colapso ── */
@media (max-width: 760px) {
  .rail, html.rail-collapsed .rail {
    top: auto; right: 0; bottom: 0; width: auto; height: 58px; flex-direction: row;
    justify-content: space-around; align-items: center; border-right: 0;
    border-top: 1px solid rgba(47, 93, 58, 0.14); padding: 0 6px; gap: 0; transition: none;
  }
  .rail-top, .rail-new { display: none; }
  /* nav y bottom "desaparecen" como caja: sus iconos se reparten en la barra */
  .rail-nav, .rail-bottom { display: contents; }
  .rail-item, html.rail-collapsed .rail-item { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .rail-label { display: none; }
  .asesor-main, html.rail-collapsed .asesor-main { margin-left: 0; margin-bottom: 58px; }
  .asesor-center { padding-top: 6vh; }
}

/* ── Pie mínimo dentro del asesor ── */
.ase-foot { text-align: center; padding: 24px 20px 8px; font-size: 0.8rem; color: var(--tinta-suave); }
.ase-foot a { color: var(--verde-oscuro); }

/* ── Respuesta tipo chat (mismo look de la app) ── */
.asesor-status { font-size: 0.85rem; color: var(--tinta-suave); margin: 12px auto 0; max-width: 720px; text-align: center; }
.asesor-out { margin: 22px auto 0; max-width: 720px; }
.asesor-cargando, .asesor-vacio { padding: 18px; border-radius: 14px; background: var(--crema-tarjeta); border: 1px solid rgba(47, 93, 58, 0.14); color: var(--tinta-suave); }
.asesor-vacio strong { color: var(--tinta); }
.asesor-cta { margin-top: 14px; }
.chat { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.chat-user {
  align-self: flex-end; max-width: 82%;
  background: linear-gradient(135deg, #3E7C4F, #2A5C39); color: #FBFDF6;
  padding: 13px 18px; border-radius: 18px 18px 18px 6px;
  font-weight: 500; line-height: 1.45; box-shadow: 0 6px 16px -8px rgba(20, 45, 28, 0.45);
}
.chat-bot {
  position: relative; overflow: hidden; background: #FCFAF3;
  border: 1px solid rgba(25, 48, 31, 0.12); border-radius: 6px 26px 26px 26px;
  box-shadow: 0 10px 30px -16px rgba(20, 45, 28, 0.30);
}
.chat-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--acc, #9DBE6A); }
.chat-in { padding: 18px 22px 18px 24px; }
.s-verde { --acc: #2F8B57; } .s-amarillo { --acc: #B0801F; } .s-rojo { --acc: #AE4128; }
.sem-flag {
  display: inline-flex; align-items: center; gap: 9px; padding: 5px 13px 5px 11px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--acc);
}
.s-verde .sem-flag { background: rgba(47, 139, 87, 0.13); }
.s-amarillo .sem-flag { background: rgba(176, 128, 31, 0.13); }
.s-rojo .sem-flag { background: rgba(174, 65, 40, 0.13); }
.sem-flag .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.chat-preg { font-family: var(--serif); font-size: 1.14rem; color: var(--verde-texto); margin: 13px 0 8px; line-height: 1.3; letter-spacing: -0.01em; }
.chat-resp { font-size: 1rem; line-height: 1.7; color: #19301F; white-space: pre-wrap; }
.chat-nota { font-size: 0.8rem; color: var(--tinta-suave); margin: 14px 0 12px; }
.chat-citas { margin: 12px 0 2px; }
.chat-citas > summary { cursor: pointer; font-weight: 700; font-size: 0.85rem; color: var(--verde-oscuro); }
.chat-citas ul { margin: 8px 0 0; padding-left: 18px; font-size: 0.82rem; color: var(--tinta-suave); }
.chat-citas li { margin-bottom: 6px; line-height: 1.4; }
@keyframes chatIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.chat-user, .chat-bot { animation: chatIn 0.32s ease-out both; }
.chat-bot { animation-delay: 0.06s; }
@media (prefers-reduced-motion: reduce) { .chat-user, .chat-bot { animation: none; } }
.asesor-rel { margin: 20px auto 0; max-width: 720px; }
.asesor-rel-t { font-size: 0.9rem; font-weight: 700; color: var(--verde-texto); margin: 0 0 8px; }
.asesor-rel .chip { display: inline-block; padding: 7px 13px; border-radius: 999px; cursor: pointer; border: 1.5px solid rgba(47, 93, 58, 0.25); background: #fff; color: var(--verde-texto); font-size: 0.85rem; font-weight: 600; font-family: var(--sans); margin: 0 6px 6px 0; }
.asesor-rel .chip:hover { background: var(--verde-suave); }
