/**
 * Onhora Agent Shell — premium chrome for assistant mode
 * Omega avatar stays in .face-area; this only wraps the experience.
 */
:root {
  --oa-teal: #05929e;
  --oa-teal-deep: #0e7490;
  --oa-ink: #0f172a;
  --oa-muted: #64748b;
  --oa-glass: rgba(255, 255, 255, 0.72);
  --oa-glass-border: rgba(5, 146, 158, 0.22);
  --oa-shadow: 0 24px 48px -20px rgba(15, 23, 42, 0.35),
    0 8px 20px -10px rgba(5, 146, 158, 0.25);
}

/* Active only in assistant mode */
.home-avatar.mode--assistant {
  --accent: var(--oa-teal);
}

.home-avatar.mode--assistant .hz-stage,
.home-avatar.mode--assistant .face-area {
  position: relative;
}

/* Premium status chip above face */
.onhora-agent-status {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--oa-glass);
  border: 1px solid var(--oa-glass-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-family: "Sora", "Outfit", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--oa-teal-deep);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.home-avatar.mode--assistant .onhora-agent-status {
  opacity: 1;
}

.onhora-agent-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--oa-teal);
  box-shadow: 0 0 0 0 rgba(5, 146, 158, 0.55);
  animation: oa-pulse 2.2s ease-out infinite;
}

.onhora-agent-status--thinking .onhora-agent-status__dot {
  background: #0ea5e9;
  animation: oa-pulse 1s ease-out infinite;
}

.onhora-agent-status--confirm .onhora-agent-status__dot {
  background: #f59e0b;
}

.onhora-agent-status--ok .onhora-agent-status__dot {
  background: #10b981;
}

@keyframes oa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(5, 146, 158, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(5, 146, 158, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 146, 158, 0); }
}

/* Glass convo panel */
.home-avatar.mode--assistant .hz-convo {
  border-radius: 22px !important;
  border: 1px solid var(--oa-glass-border) !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.88)) !important;
  box-shadow: var(--oa-shadow) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}

.home-avatar.mode--assistant .input-bar {
  border-top: 1px solid rgba(5, 146, 158, 0.12) !important;
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  gap: 8px;
  padding: 10px 12px !important;
}

.home-avatar.mode--assistant .chat-send {
  background: linear-gradient(145deg, #0ea5a8, #05929e 55%, #0e7490) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 8px 18px -8px rgba(5, 146, 158, 0.7);
}

.home-avatar.mode--assistant .chat-send:hover {
  filter: brightness(1.05);
}

/* Floating orb (minimize / reopen) — web + Capacitor WebView */
.onhora-agent-orb {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 100000;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.55), transparent 42%),
    linear-gradient(145deg, #14b8a6, #05929e 48%, #0f766e);
  box-shadow:
    0 14px 34px -10px rgba(5, 146, 158, 0.65),
    0 4px 12px rgba(15, 23, 42, 0.2),
    inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1.15), box-shadow 0.22s ease, opacity 0.2s ease;
}

.onhora-agent-orb:hover {
  transform: scale(1.06);
}

.onhora-agent-orb:active {
  transform: scale(0.97);
}

.onhora-agent-orb--visible {
  display: inline-flex;
}

.onhora-agent-orb__ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px solid rgba(5, 146, 158, 0.45);
  animation: oa-ring 2.8s ease-out infinite;
  pointer-events: none;
}

@keyframes oa-ring {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.45); opacity: 0; }
}

.onhora-agent-orb__mark {
  width: 22px;
  height: 22px;
  color: #fff;
}

.onhora-agent-orb__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f59e0b;
  color: #111;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.onhora-agent-orb--badge .onhora-agent-orb__badge {
  display: inline-flex;
}

/* When orb open (panel collapsed), hide heavy chrome but keep Omega face */
html.onhora-agent-minimized .home-avatar.mode--assistant .hz-convo,
html.onhora-agent-minimized .home-avatar.mode--assistant .input-bar {
  display: none !important;
}

html.onhora-agent-minimized .onhora-agent-orb {
  display: inline-flex;
}

/* Tool timeline toast strip */
.onhora-agent-timeline {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(10px);
  z-index: 99998;
  max-width: min(92vw, 420px);
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 16px 36px rgba(0,0,0,0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.onhora-agent-timeline--on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .onhora-agent-orb {
    width: 54px;
    height: 54px;
  }
  .home-avatar.mode--assistant .hz-convo {
    border-radius: 18px !important;
  }
}

/* Confirm gate */
.onhora-agent-confirm {
  position: fixed;
  left: 50%;
  bottom: calc(108px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(12px);
  z-index: 99999;
  width: min(92vw, 420px);
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.onhora-agent-confirm--on {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.onhora-agent-confirm__eyebrow {
  margin: 0 0 4px;
  color: #fbbf24;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.onhora-agent-confirm__text {
  margin: 0 0 6px;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}
.onhora-agent-confirm__hint {
  margin: 0 0 12px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.onhora-agent-confirm__actions {
  display: flex;
  gap: 8px;
}
.onhora-agent-confirm__yes,
.onhora-agent-confirm__no {
  flex: 1;
  border: none;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.onhora-agent-confirm__yes {
  background: linear-gradient(145deg, #14b8a6, #05929e);
  color: #fff;
}
.onhora-agent-confirm__no {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.onhora-agent-min-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: none;
  background: rgba(5, 146, 158, 0.12);
  color: #0e7490;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Coach guide panel */
.onhora-agent-coach {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  z-index: 99990;
  width: min(92vw, 320px);
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--oa-glass-border);
  box-shadow: var(--oa-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  font-family: "Sora", "Outfit", system-ui, sans-serif;
}
.onhora-agent-coach--on {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.onhora-agent-coach__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.onhora-agent-coach__head strong {
  font-size: 13px;
  color: var(--oa-ink);
  font-weight: 700;
}
.onhora-agent-coach__x {
  border: none;
  background: rgba(15, 23, 42, 0.06);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--oa-muted);
}
.onhora-agent-coach__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.onhora-agent-coach__steps li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: #334155;
  font-weight: 550;
}
.onhora-agent-coach__steps li span {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 146, 158, 0.12);
  color: var(--oa-teal-deep);
  font-size: 10px;
  font-weight: 800;
}
.onhora-agent-coach__steps li.is-done {
  color: #059669;
  text-decoration: line-through;
  opacity: 0.75;
}
.onhora-agent-coach__steps li.is-done span {
  background: #10b981;
  color: #fff;
}
.onhora-agent-coach__note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--oa-muted);
}

/* Suggestion chips above input — hidden until «opciones rápidas» */
.onhora-agent-suggest {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 8px;
  max-height: 42vh;
}
.onhora-agent-suggest--hidden {
  display: none !important;
}
.onhora-agent-suggest__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}
.onhora-agent-suggest__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--oa-muted);
}
.onhora-agent-suggest__close {
  border: none;
  background: transparent;
  color: var(--oa-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.onhora-agent-suggest__close:hover {
  color: var(--oa-teal-deep);
}
.onhora-agent-suggest__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.onhora-agent-suggest__chip {
  border: 1px solid rgba(5, 146, 158, 0.22);
  background: rgba(255, 255, 255, 0.9);
  color: var(--oa-teal-deep);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  font-family: "Sora", "Outfit", system-ui, sans-serif;
  transition: background 0.15s ease, transform 0.15s ease;
}
.onhora-agent-suggest__chip:hover {
  background: rgba(5, 146, 158, 0.1);
  transform: translateY(-1px);
}

html.onhora-agent-minimized .onhora-agent-coach,
html.onhora-agent-minimized .onhora-agent-suggest {
  display: none !important;
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .onhora-agent-status__dot,
  .onhora-agent-orb__ring {
    animation: none;
  }
}

/* coach permanently hidden */
.onhora-agent-coach,
.onhora-agent-coach--on {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
