/*! © Ordyx Lab. Oxy, robot de Ordyx. */
.oxy { position: fixed; right: 20px; bottom: 20px; z-index: 60; font: 400 14.5px/1.5 var(--f-body); color: var(--text); }
.oxy [hidden] { display: none !important; }

/* Botón flotante */
.oxy-fab { position: relative; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line-2); background: radial-gradient(circle at 30% 25%, #17233f, #0a1120 70%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45), 0 0 0 0 rgba(233, 201, 119, .35); transition: transform .25s var(--ease), box-shadow .25s; animation: oxyPulse 3.2s 4s infinite; }
.oxy-fab:hover { transform: translateY(-2px) scale(1.04); }
.oxy-fab img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(80, 120, 255, .35)); }
.oxy-dot { position: absolute; right: 4px; bottom: 5px; width: 13px; height: 13px; border-radius: 50%; background: var(--ok); border: 2px solid #0a1120; }
.oxy.open .oxy-fab { transform: scale(.92); animation: none; }
@keyframes oxyPulse { 0%, 70%, 100% { box-shadow: 0 12px 32px rgba(0, 0, 0, .45), 0 0 0 0 rgba(233, 201, 119, .35); } 85% { box-shadow: 0 12px 32px rgba(0, 0, 0, .45), 0 0 0 12px rgba(233, 201, 119, 0); } }

/* Globo de invitación */
.oxy-teaser { position: absolute; right: 4px; bottom: 76px; width: 250px; padding: 14px 16px 14px; border-radius: 16px 16px 4px 16px;
  background: rgba(14, 22, 40, .97); border: 1px solid var(--line-2); box-shadow: 0 18px 40px rgba(0, 0, 0, .5); animation: oxyIn .35s var(--ease); }
.oxy-teaser p { margin: 0 18px 10px 0; color: var(--text); }
.oxy-teaser b { color: var(--gold-2); }
.oxy-teaser .oxy-go { font: 600 13.5px var(--f-body); color: #170f02; border: 0; border-radius: 9px; padding: 8px 14px; cursor: pointer;
  background: linear-gradient(135deg, #fff1c7 0%, #e9c977 30%, #d6a84a 70%); }
.oxy-x { position: absolute; top: 6px; right: 8px; width: 26px; height: 26px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; border-radius: 6px; }
.oxy-x:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

/* Ventana del chat */
.oxy-panel { position: absolute; right: 0; bottom: 76px; width: 370px; height: min(580px, calc(100dvh - 110px)); display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden; background: rgba(8, 13, 26, .98); border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .02) inset; animation: oxyIn .3s var(--ease); }
@keyframes oxyIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.oxy-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 13px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23, 35, 63, .9), rgba(10, 17, 32, .9)); }
.oxy-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #0d1528; border: 1px solid var(--line-2); }
.oxy-av img { width: 26px; height: 26px; object-fit: contain; }
.oxy-head b { display: block; font: 700 15.5px var(--f-head); letter-spacing: -.01em; }
.oxy-head small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.oxy-head small i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.oxy-head .oxy-x { position: static; margin-left: auto; width: 34px; height: 34px; font-size: 22px; }

.oxy-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; overscroll-behavior: contain; }
.oxy-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; white-space: pre-line; animation: oxyMsg .25s var(--ease); }
@keyframes oxyMsg { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.oxy-msg.bot { align-self: flex-start; background: #131d33; border: 1px solid rgba(150, 175, 230, .1); border-bottom-left-radius: 4px; }
.oxy-msg.me { align-self: flex-end; background: linear-gradient(135deg, #e9c977, #d6a84a); color: #170f02; font-weight: 500; border-bottom-right-radius: 4px; }
.oxy-msg b { color: var(--gold-2); font-weight: 600; }
.oxy-msg a { color: var(--gold-2); }
.oxy-msg .oxy-tbl { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; margin: 6px 0 4px; font-size: 13.5px; }
.oxy-msg .oxy-tbl span:nth-child(even) { color: var(--gold-2); font-family: var(--f-mono); font-size: 12.5px; text-align: right; white-space: nowrap; }
.oxy-msg .oxy-list { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 7px; white-space: normal; }
.oxy-msg .oxy-list li::marker { color: var(--gold-2); }
.oxy-msg .oxy-note { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.oxy-sum { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 6px 0 2px; font-size: 13.5px; }
.oxy-sum dt { color: var(--muted); } .oxy-sum dd { margin: 0; }
.oxy-folio { display: inline-block; margin-top: 6px; padding: 4px 10px; border-radius: 8px; font: 600 14px var(--f-mono); color: var(--gold-2); background: rgba(214, 168, 74, .1); border: 1px solid var(--line-2); }
.oxy-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.oxy-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: oxyDot 1s infinite; }
.oxy-typing i:nth-child(2) { animation-delay: .15s; } .oxy-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes oxyDot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.oxy-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 14px 14px; max-height: 42%; overflow-y: auto; }
.oxy-chips:empty { display: none; }
.oxy-chip { font: 500 13.5px var(--f-body); color: var(--text); padding: 8px 13px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .03); border: 1px solid rgba(233, 201, 119, .3); transition: background .2s, border-color .2s, transform .2s; }
.oxy-chip:hover, .oxy-chip:focus-visible { background: rgba(214, 168, 74, .12); border-color: var(--gold-2); outline: none; }
.oxy-chip.main { color: #170f02; border: 0; font-weight: 600; background: linear-gradient(135deg, #fff1c7 0%, #e9c977 30%, #d6a84a 70%); }
.oxy-chip.soft { border-color: rgba(150, 175, 230, .2); color: var(--muted); }

.oxy-in { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.oxy-in input, .oxy-in textarea { flex: 1; min-width: 0; font: 400 15px var(--f-body); color: var(--text); background: #0d1528; border: 1px solid rgba(150, 175, 230, .18);
  border-radius: 11px; padding: 10px 12px; outline: none; resize: none; }
.oxy-in input:focus, .oxy-in textarea:focus { border-color: var(--gold-2); }
.oxy-in button { flex: none; width: 44px; border: 0; border-radius: 11px; cursor: pointer; display: grid; place-items: center; color: #170f02;
  background: linear-gradient(135deg, #fff1c7 0%, #e9c977 30%, #d6a84a 70%); }
.oxy-in button svg { width: 18px; height: 18px; }
.oxy-legal { padding: 0 14px 10px; color: var(--muted-2); font-size: 11.5px; }
.oxy-legal a { color: var(--muted); }

/* El botón "volver arriba" queda encima de Oxy */
.to-top { right: 28px; bottom: 96px; }

/* Botones de la página que abren a Oxy */
.oxy-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 9px 14px; border-radius: 10px; cursor: pointer;
  font: 500 14px var(--f-body); color: var(--gold-2); background: rgba(214, 168, 74, .08); border: 1px solid var(--line-2); }
.oxy-cta:hover { background: rgba(214, 168, 74, .15); }
.oxy-cta img { width: 18px; height: 18px; }

@media (max-width: 560px) {
  .oxy { right: 14px; bottom: 14px; }
  .to-top { right: 19px; bottom: 82px; }
  .oxy-fab { width: 56px; height: 56px; } .oxy-fab img { width: 34px; height: 34px; }
  .oxy-panel { position: fixed; left: 10px; right: 10px; bottom: 80px; width: auto; height: min(600px, calc(100dvh - 96px)); }
  .oxy-teaser { width: min(250px, calc(100vw - 40px)); bottom: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  .oxy-fab, .oxy-panel, .oxy-teaser, .oxy-msg, .oxy-typing i { animation: none !important; }
}
