/* Master LMS · IA · Hermes (burbuja de ayuda). Colores propios: se ve igual en modo claro y oscuro. */
.hms { --hms-gold: #F2D27A; --hms-ink: #0E1530; position: fixed; z-index: 9990; right: 20px; bottom: 20px; font-family: inherit; }
.hms-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hms__fab { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 8px; border: 1px solid rgba(242, 210, 122, .45); border-radius: 999px; cursor: pointer; color: #fff; font: inherit; font-weight: 700;
	background: linear-gradient(135deg, #5B3F9E 0%, #1B2550 100%); box-shadow: 0 12px 30px rgba(14, 21, 48, .35), 0 0 0 4px rgba(242, 210, 122, .08); transition: transform .15s, box-shadow .15s; }
.hms__fab:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(14, 21, 48, .42), 0 0 0 6px rgba(242, 210, 122, .12); }
.hms__fab:focus-visible { outline: 2px solid var(--hms-gold); outline-offset: 3px; }
.hms__glyph, .hms__avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--hms-ink); background: radial-gradient(circle at 35% 30%, #FBE7A6, #C9A24A 75%); font-family: "DejaVu Sans", "Segoe UI Symbol", serif; }
.hms.is-open .hms__fab { display: none; }
.hms__panel { position: absolute; right: 0; bottom: 0; width: min(380px, calc(100vw - 24px)); height: min(600px, calc(100vh - 40px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; color: #fff;
	background: radial-gradient(120% 60% at 100% 0%, rgba(155, 78, 170, .45), transparent 60%), linear-gradient(180deg, #1B2550 0%, #0E1530 100%);
	border: 1px solid rgba(242, 210, 122, .3); box-shadow: 0 24px 60px rgba(0, 0, 0, .4); animation: hms-in .2s ease-out; }
.hms__panel[hidden] { display: none; }
@keyframes hms-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hms__panel { animation: none; } .hms__fab { transition: none; } }
.hms__head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.hms__head > div { flex: 1; min-width: 0; }
.hms__name { margin: 0 !important; font-weight: 800; font-size: 1.05rem; color: #fff; }
.hms__role { margin: 0 !important; font-size: .8rem; color: var(--hms-gold); }
.hms__reset, .hms__close { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); background: transparent; color: rgba(255, 255, 255, .8); font-size: 18px; line-height: 1; cursor: pointer; }
.hms__close { font-size: 22px; }
.hms__reset:hover, .hms__close:hover { border-color: var(--hms-gold); color: var(--hms-gold); }
.hms__log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px; scroll-behavior: smooth; }
.hms-msg { display: flex; }
.hms-msg__body { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: .94rem; line-height: 1.55; }
.hms-msg__body p { margin: 0 0 8px !important; }
.hms-msg__body p:last-child { margin-bottom: 0 !important; }
.hms-msg__body h3 { margin: 8px 0 4px !important; font-size: .95rem; color: #fff !important; }
.hms-msg--user { justify-content: flex-end; }
.hms-msg--user .hms-msg__body { color: #fff; background: linear-gradient(135deg, #9B4EAA, #6B2E7E); border-bottom-right-radius: 5px; }
.hms-msg--ai .hms-msg__body { color: rgba(255, 255, 255, .92); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-bottom-left-radius: 5px; }
.hms-msg--wait .hms-msg__body { font-style: italic; color: rgba(255, 255, 255, .65); }
.hms-links { display: flex; flex-direction: column; gap: 4px; margin-top: 8px !important; padding-top: 8px; border-top: 1px dashed rgba(255, 255, 255, .18); }
.hms-links a, .hms__foot a { color: var(--hms-gold); font-weight: 700; text-decoration: none; }
.hms-links a:hover, .hms__foot a:hover { text-decoration: underline; }
.hms-sugs { display: flex; flex-wrap: wrap; gap: 6px; }
.hms-sugs button { padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(242, 210, 122, .4); background: rgba(242, 210, 122, .08); color: var(--hms-gold); font: inherit; font-size: .85rem; cursor: pointer; }
.hms-sugs button:hover { background: rgba(242, 210, 122, .18); }
.hms-human { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, .18); }
.hms-human__btn { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--hms-gold); color: var(--hms-ink) !important; font-weight: 800; font-size: .85rem; text-decoration: none; }
.hms-human span { font-size: .78rem; color: rgba(255, 255, 255, .6); }
.hms__form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, .1); }
.hms__form input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(14, 21, 48, .6); color: #fff; font: inherit; font-size: .95rem; }
.hms__form input::placeholder { color: rgba(255, 255, 255, .5); }
.hms__form input:focus { outline: 2px solid var(--hms-gold); outline-offset: 1px; }
.hms__form button { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--hms-gold); color: var(--hms-ink); cursor: pointer; }
.hms__form[aria-busy="true"] button { opacity: .5; pointer-events: none; }
.hms__foot { margin: 0 !important; padding: 0 14px 12px; font-size: .78rem; color: rgba(255, 255, 255, .55); }
@media (max-width: 520px) {
	.hms { right: 12px; bottom: 12px; }
	.hms__fab-label { display: none; }
	.hms__fab { width: 56px; padding: 0; justify-content: center; }
	.hms.is-open { inset: 0; }
	.hms__panel { position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0; }
}
@media print { .hms { display: none; } }

/* Icono de Hermes con vida. */
.hms__fab .hms__glyph { position: relative; animation: hms-float 4s ease-in-out infinite; }
.hms__fab .hms__glyph::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid rgba(242, 210, 122, .6); animation: hms-ring 4s ease-out infinite; }
.hms__avatar { animation: hms-glow 4s ease-in-out infinite; }
@keyframes hms-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-6deg); } }
@keyframes hms-ring { 0% { transform: scale(.9); opacity: .9; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
@keyframes hms-glow { 0%, 100% { box-shadow: 0 0 0 rgba(242, 210, 122, 0); } 50% { box-shadow: 0 0 16px rgba(242, 210, 122, .55); } }
@media (prefers-reduced-motion: reduce) { .hms__fab .hms__glyph, .hms__fab .hms__glyph::after, .hms__avatar { animation: none; } }

/* Mensaje proactivo (globo junto a la burbuja). */
.hms__nudge { position: absolute; right: 0; bottom: 70px; display: flex; align-items: flex-start; width: min(320px, calc(100vw - 24px)); border-radius: 18px 18px 6px 18px; color: #fff; border: 1px solid rgba(242, 210, 122, .5);
	background: radial-gradient(120% 140% at 100% 0%, rgba(155, 78, 170, .5), transparent 60%), linear-gradient(160deg, #1B2550, #0E1530); box-shadow: 0 14px 40px rgba(8, 12, 30, .45);
	opacity: 0; transform: translateY(8px) scale(.97); transform-origin: bottom right; transition: opacity .35s ease, transform .35s ease; }
.hms__nudge.is-in { opacity: 1; transform: none; }
.hms__nudge-text { flex: 1; display: flex; gap: 10px; align-items: flex-start; padding: 14px 4px 14px 14px; border: 0; background: none; color: inherit; font: inherit; font-size: .92rem; line-height: 1.45; text-align: left; cursor: pointer; }
.hms__nudge-text:hover span:last-child { text-decoration: underline; text-decoration-color: rgba(242, 210, 122, .6); }
.hms__nudge-glyph { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--hms-ink); font-weight: 900; background: linear-gradient(135deg, #F6E3A8, #D9B45A); }
.hms__nudge-x { flex: none; width: 32px; height: 32px; margin: 6px 6px 0 0; border: 0; border-radius: 50%; background: transparent; color: rgba(255, 255, 255, .6); font-size: 20px; line-height: 1; cursor: pointer; }
.hms__nudge-x:hover { background: rgba(255, 255, 255, .1); color: #fff; }
@media (max-width: 520px) { .hms__nudge { bottom: 66px; } }
@media (prefers-reduced-motion: reduce) { .hms__nudge { transition: none; } }
