/* ============================================================
   EGO chat panel + diagrama de la cinta
   ============================================================ */

/* ---------- panel EGO (escritorio: panel fijo a media pantalla, anclado arriba) ---------- */
.ego-panel {
  position: fixed;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -24px rgba(44, 36, 27, 0.4);
  overflow: hidden;
  z-index: 50;
}
@media (min-width: 1024px) {
  .ego-panel {
    top: 18px; right: 18px; bottom: 18px;
    width: var(--chat-w);
    border-radius: 22px;
  }
  .ego-collapse { display: none; }
}

.ego-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 16%, white), color-mix(in oklab, var(--accent) 6%, white));
  border-bottom: 1px solid var(--line);
  flex: none;
}
.ego-id { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.ego-id strong { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.02em; }
.ego-id span {
  font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden;
}
.ego-id span { text-overflow: ellipsis; }
.online-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ok); display: inline-block; flex: none; }
.ego-header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.ego-new {
  width: 32px; height: 32px; border-radius: 999px; flex: none;
  border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer;
  font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1;
  display: grid; place-items: center; padding: 0 0 2px;
  transition: border-color 0.15s, color 0.15s, transform 0.12s;
}
.ego-new:hover { border-color: var(--accent); color: var(--accent); }
.ego-new:active { transform: scale(0.94); }

.ego-avatar {
  width: 38px; height: 38px; border-radius: 999px; flex: none;
  background: var(--accent);
  display: grid; place-items: center;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.12);
}
.ego-lens {
  width: 45%; height: 45%; border-radius: 999px;
  background: #fff;
  display: grid; place-items: center;
  position: relative;
}
.ego-lens::after {
  content: ""; width: 42%; height: 42%; border-radius: 999px;
  background: var(--ink); position: absolute; inset: 0; margin: auto;
}

.ego-collapse {
  height: 40px; border-radius: 999px; border: none;
  background: var(--accent); cursor: pointer;
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
}
.ego-collapse-label { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: #fff; }
.chat-glyph {
  width: 18px; height: 15px; border-radius: 6px 6px 6px 1px;
  background: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; gap: 2.5px;
}
.chat-glyph i { width: 3px; height: 3px; border-radius: 999px; background: var(--accent); }
.ego-panel.open .chat-glyph { display: none; }
.ego-collapse .caret {
  width: 8px; height: 8px; border-right: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.2s ease;
}
.ego-panel.open .ego-collapse .caret { transform: rotate(225deg) translate(-2px, -2px); }

.ego-scroll {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  background:
    radial-gradient(500px 240px at 100% 0%, color-mix(in oklab, var(--accent) 7%, transparent), transparent 70%),
    var(--surface);
}
.msg { display: flex; gap: 9px; align-items: flex-end; }
.msg.user { justify-content: flex-end; }
.msg .ego-avatar { margin-bottom: 2px; }
.bubble-wrap { display: flex; flex-direction: column; gap: 8px; max-width: 82%; }
.bubble {
  padding: 11px 15px; border-radius: 16px; font-size: 15px; line-height: 1.5;
  animation: pop-in 0.2s ease;
  white-space: pre-wrap;
}
.msg.bot .bubble {
  background: var(--bg-deep);
  border-bottom-left-radius: 5px;
  max-width: 100%;
}
.msg.bot > .bubble { max-width: 82%; }
.msg.user .bubble {
  background: var(--accent); color: var(--accent-ink);
  border-bottom-right-radius: 5px;
  max-width: 82%;
}
.bubble.typing { display: flex; gap: 5px; align-items: center; padding: 14px 16px; }
.bubble.typing span {
  width: 7px; height: 7px; border-radius: 999px; background: var(--muted);
  animation: typing-bounce 1.1s infinite;
}
.bubble.typing span:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: none; opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.ego-suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 35px; }

.ego-register {
  margin: 6px 0 0 35px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: color-mix(in oklab, var(--accent) 10%, var(--surface));
  border: 1.5px dashed color-mix(in oklab, var(--accent) 45%, transparent);
  border-radius: 14px; padding: 11px 15px;
  font-size: 14px;
}
.ego-register span { color: var(--muted); font-weight: 600; }
.ego-register a {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: var(--accent); text-decoration: none;
}
.ego-register a:hover { text-decoration: underline; }

.hub-card {
  background: var(--surface); border: 1.5px dashed color-mix(in oklab, var(--accent) 50%, transparent);
  border-radius: 14px; padding: 14px 16px; font-size: 14.5px;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.hub-card .hub-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.hub-card p { color: var(--muted); }
.hub-card a { text-decoration: none; display: inline-block; }

.ego-input {
  flex: none; display: flex; gap: 10px; align-items: center;
  padding: 14px 16px; border-top: 1px solid var(--line); background: var(--surface);
}
.ego-input input {
  flex: 1; min-width: 0; font-family: var(--font-body); font-size: 15.5px; color: var(--ink);
  background: var(--bg-deep); border: 1.5px solid transparent; border-radius: 999px;
  padding: 11px 18px; outline: none; transition: border-color 0.15s, background 0.15s;
}
.ego-input input:focus { border-color: var(--accent); background: var(--surface); }
.send-btn {
  width: 44px; height: 44px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--accent); display: grid; place-items: center; flex: none;
  transition: transform 0.12s ease, opacity 0.15s;
}
.send-btn:active { transform: scale(0.94); }
.send-btn:disabled { opacity: 0.4; cursor: default; }
.send-arrow {
  width: 11px; height: 11px;
  border-top: 2.5px solid #fff; border-right: 2.5px solid #fff;
  transform: rotate(45deg) translate(-1px, 1px);
}

/* ---------- móvil: hoja anclada ARRIBA ---------- */
@media (max-width: 1023px) {
  .content { padding: 96px 22px 60px; }
  .ego-panel {
    top: 0; left: 0; right: 0; bottom: auto;
    width: auto;
    border-radius: 0 0 22px 22px;
    height: 68px;
    transition: height 0.28s ease;
  }
  .ego-panel .ego-scroll, .ego-panel .ego-input { display: none; }
  .ego-panel.open { height: min(62vh, 560px); }
  .ego-panel.open .ego-scroll { display: flex; }
  .ego-panel.open .ego-input { display: flex; }
  .ego-header { cursor: pointer; }
}

/* ---------- diagrama de la cinta ---------- */
.strap-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 26px; padding: 26px;
}

.strap-diagram {
  background:
    radial-gradient(420px 260px at 30% 20%, color-mix(in oklab, var(--accent) 8%, transparent), transparent 70%),
    var(--bg-deep);
  border-radius: 14px;
  min-height: 360px;
  display: grid; place-items: center;
  overflow: hidden;
  padding: 16px;
}
.strap-scene { position: relative; width: 280px; height: 330px; }

/* figura */
.strap-floor {
  position: absolute; bottom: 2px; left: 36px;
  width: 210px; height: 18px; border-radius: 50%;
  background: color-mix(in oklab, var(--ink) 9%, transparent);
}
.strap-shoulders {
  position: absolute; top: 248px; left: 30px;
  width: 156px; height: 72px; border-radius: 38px 38px 8px 8px;
  background: #4a4136;
}
.strap-sun {
  position: absolute; left: 50%; top: 28px; transform: translateX(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: repeating-conic-gradient(#f2c14e 0deg 16deg, transparent 16deg 45deg);
}
.strap-sun::after {
  content: ""; position: absolute; inset: 7px;
  border-radius: 50%;
  background: #f2c14e;
  box-shadow: 0 0 0 2.5px #4a4136;
}
.strap-neck {
  position: absolute; top: 208px; left: 94px;
  width: 38px; height: 52px; border-radius: 12px;
  background: #d8a87e;
}
.strap-head {
  position: absolute; top: 70px; left: 42px;
  width: 126px; height: 126px; border-radius: 50%;
  background: #e8bd98;
  box-shadow: inset -12px -10px 0 rgba(0, 0, 0, 0.055);
}
.strap-ear {
  position: absolute; top: 132px; left: 86px;
  width: 21px; height: 21px; border-radius: 50%;
  background: #d8a87e;
}
.strap-eye {
  position: absolute; top: 146px; left: 138px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink);
}
.strap-smile {
  position: absolute; top: 160px; left: 130px;
  width: 24px; height: 14px;
  border-bottom: 3.5px solid #b97f54;
  border-radius: 0 0 999px 999px;
}

/* cinta: banda alrededor de la frente */
.strap-band {
  position: absolute; top: 100px; left: 34px;
  width: 142px; height: 21px; border-radius: 999px;
  background: var(--ink); opacity: 0.82;
  transition: transform 0.35s ease, opacity 0.35s ease, box-shadow 0.35s ease;
}
.strap-band.tight {
  transform: scaleY(0.78); opacity: 1;
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ok) 55%, transparent);
}

/* teléfono + cono (se mueven juntos) */
.strap-rig { position: absolute; inset: 0; pointer-events: none; }
.strap-rig.wobble { animation: strap-wobble 1.5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .strap-rig.wobble { animation: none; } }
@keyframes strap-wobble {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  28% { transform: translate(0.5px, -2.5px) rotate(-0.6deg); }
  62% { transform: translate(-0.5px, 1.5px) rotate(0.5deg); }
}
.strap-phone {
  position: absolute; top: 90px; left: 152px;
  width: 52px; height: 26px; border-radius: 7px;
  background: var(--ink);
  transform-origin: 15% 50%;
  transition: transform 0.45s cubic-bezier(0.3, 1.2, 0.4, 1);
  z-index: 3;
  box-shadow: 2px 3px 8px rgba(44, 36, 27, 0.28);
}
.strap-phone.down { transform: rotate(17deg); }
.strap-phone .strap-lens {
  position: absolute; right: 5px; top: 50%; margin-top: -4.5px;
  width: 9px; height: 9px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2.5px rgba(255, 255, 255, 0.6);
}
.strap-rec {
  position: absolute; left: 7px; top: 50%; margin-top: -3.5px;
  width: 7px; height: 7px; border-radius: 999px;
  background: #e6493a;
  animation: rec-pulse 1.1s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 73, 58, 0.55); }
  50% { box-shadow: 0 0 0 5px rgba(230, 73, 58, 0); }
}
.strap-cone {
  position: absolute; top: 88px; left: 200px;
  width: 96px; height: 56px;
  background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 42%, transparent), color-mix(in oklab, var(--accent) 6%, transparent) 85%, transparent);
  clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 58%);
  transform-origin: 0% 50%;
  transition: transform 0.45s cubic-bezier(0.3, 1.2, 0.4, 1);
  z-index: 2;
}
.strap-cone.down { transform: rotate(46deg) scaleX(1.45) scaleY(1.15); }

/* línea de ojos */
.strap-eyeline {
  position: absolute; top: 138px; left: 0; right: 0;
  border-top: 2px dashed color-mix(in oklab, var(--ink) 26%, transparent);
  transition: border-color 0.3s;
  z-index: 1;
}
.strap-eyeline i {
  position: absolute; top: -26px; left: 8px;
  white-space: nowrap;
  font-family: var(--font-mono); font-style: normal; font-size: 10px;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  padding: 2px 8px; border-radius: 999px;
  transition: color 0.3s, background 0.3s;
}
.strap-eyeline.on { border-top-color: var(--accent); }
.strap-eyeline.on i { color: var(--accent); background: var(--surface); font-weight: 600; }

/* zona de manos */
.strap-hands {
  position: absolute; bottom: 36px; left: 176px;
  width: 100px; height: 62px; border-radius: 18px;
  border: 2px dashed color-mix(in oklab, var(--ink) 32%, transparent);
  opacity: 0.5;
  transition: opacity 0.35s, border-color 0.35s, background 0.35s;
}
.strap-hand {
  position: absolute; width: 20px; height: 20px; border-radius: 50% 50% 45% 45%;
  background: #e8bd98;
}
.strap-hand.h1 { left: 22px; top: 16px; }
.strap-hand.h2 { left: 52px; top: 22px; }
.strap-hands.seen .strap-hand { animation: hand-work 1.4s ease-in-out infinite; }
.strap-hands.seen .strap-hand.h2 { animation-delay: 0.35s; }
@media (prefers-reduced-motion: reduce) { .strap-hands.seen .strap-hand { animation: none; } }
@keyframes hand-work {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.strap-hands-label {
  position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted);
  transition: color 0.3s;
}
.strap-hands.seen { opacity: 1; border-color: var(--ok); background: color-mix(in oklab, var(--ok) 10%, transparent); }
.strap-hands.seen .strap-hands-label { color: var(--ok); font-weight: 700; }

/* anotación del paso */
.strap-chip {
  position: absolute; top: 10px; left: 0;
  font-family: var(--font-display); font-size: 12.5px; font-weight: 700;
  background: var(--accent); color: var(--accent-ink);
  padding: 6px 13px; border-radius: 999px;
  box-shadow: 0 8px 18px -8px color-mix(in oklab, var(--accent) 70%, transparent);
  animation: chip-in 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
  z-index: 4;
}
@keyframes chip-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

/* pasos de la cinta */
.strap-side { display: flex; flex-direction: column; gap: 16px; }
.strap-steps { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.strap-step {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  background: none; border: 1.5px solid transparent; border-radius: 14px;
  padding: 11px 13px; cursor: pointer; font-family: var(--font-body);
  transition: background 0.15s, border-color 0.15s;
}
.strap-step:hover { background: var(--bg-deep); }
.strap-step.active { background: color-mix(in oklab, var(--accent) 9%, white); border-color: color-mix(in oklab, var(--accent) 40%, transparent); }
.strap-num {
  width: 26px; height: 26px; border-radius: 999px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13.5px;
  background: var(--bg-deep); color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.strap-step.active .strap-num { background: var(--accent); color: var(--accent-ink); }
.strap-step.done .strap-num { background: var(--ok-soft); color: var(--ok); }
.strap-step-body { display: flex; flex-direction: column; gap: 3px; }
.strap-step-body strong { font-family: var(--font-display); font-size: 15.5px; color: var(--ink); }
.strap-step-body em { font-style: normal; font-size: 14px; color: var(--muted); animation: pop-in 0.2s ease; }
.strap-nav { display: flex; gap: 10px; justify-content: flex-end; }
