/* Treatly Spectral Agency — live drive (no blur lock; UI stays visible & tappable) */

body.spectral-agency-active.spectral-agency-live,
body.spectral-agency-active.spectral-agency-sweeping,
body.spectral-agency-active.spectral-agency-hover {
  /* Keep scroll + taps — AI runs on top of the real app */
}

#spectral-agency-root {
  position: fixed;
  inset: 0;
  z-index: 10040;
  pointer-events: none !important;
  opacity: 0;
}

#spectral-agency-root.spectral-agency-root--on {
  opacity: 0;
  pointer-events: none !important;
}

.spectral-wash {
  display: none !important;
}

.spectral-narration {
  position: fixed;
  top: max(8px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10090;
  max-width: min(92vw, 420px);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(12, 18, 22, 0.88);
  border: 1px solid rgba(107, 255, 218, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-family: Manrope, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: rgba(200, 245, 240, 0.95);
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

.spectral-narration--on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spectral-ui-float {
  position: relative !important;
  z-index: 60 !important;
  transform: translateY(-12px) scale(1.03);
  box-shadow:
    0 22px 52px rgba(50, 181, 190, 0.38),
    0 10px 28px rgba(0, 0, 0, 0.18),
    0 0 0 2px rgba(107, 255, 218, 0.45) !important;
  transition:
    transform 0.5s cubic-bezier(0.34, 1.25, 0.64, 1),
    box-shadow 0.45s ease;
  animation: spectral-ui-float-bob 2.5s ease-in-out infinite;
  animation-delay: calc(var(--spectral-float-i, 0) * 0.1s);
  will-change: transform;
}

.spectral-ui-slam {
  transition:
    transform 0.22s cubic-bezier(0.55, 0.06, 0.68, 0.19),
    box-shadow 0.2s ease,
    opacity 0.18s ease !important;
  transform: translateY(0) scale(1) !important;
  animation: none !important;
  box-shadow: 0 6px 18px rgba(50, 181, 190, 0.2) !important;
}

.spectral-review-bar {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 10092;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(12, 18, 22, 0.94);
  border: 1.5px solid rgba(107, 255, 218, 0.4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  max-width: min(96vw, 420px);
  pointer-events: auto;
}

.spectral-review-bar[hidden] {
  display: none !important;
}

.spectral-review-undo {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f0fffc;
  font-family: Manrope, sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.spectral-review-msg {
  flex: 1;
  min-width: 0;
  font-family: Manrope, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: rgba(200, 245, 240, 0.9);
  line-height: 1.35;
}

.spectral-review-hint {
  flex-shrink: 0;
  font-family: Manrope, sans-serif;
  font-size: 10px;
  font-weight: 800;
  color: rgba(107, 255, 218, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spectral-review-chip {
  position: absolute;
  top: -8px;
  right: -4px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: min(220px, 88vw);
  padding: 5px 8px 5px 10px;
  border-radius: 999px;
  border: 1.5px solid rgba(107, 255, 218, 0.55);
  background: rgba(14, 22, 26, 0.95);
  color: #c8f5f0;
  font-family: Manrope, sans-serif;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.spectral-review-chip-lbl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spectral-review-chip-x {
  opacity: 0.75;
  font-size: 12px;
  line-height: 1;
}

@keyframes spectral-ui-float-bob {
  0%,
  100% {
    transform: translateY(-12px) scale(1.03);
  }
  50% {
    transform: translateY(-18px) scale(1.035);
  }
}

.spectral-ui-dim {
  opacity: 0.48 !important;
  filter: saturate(0.82);
  transition: opacity 0.35s ease, filter 0.35s ease;
  pointer-events: none;
}

.spectral-touch {
  outline: none !important;
}

@keyframes spectral-touch-breathe {
  0%,
  100% {
    outline-color: rgba(50, 181, 190, 0.55);
  }
  50% {
    outline-color: rgba(107, 255, 218, 0.95);
  }
}

.spectral-touch--reading {
  animation-duration: 1.8s;
}

.spectral-live-chip {
  position: fixed;
  z-index: 10085;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(18, 28, 32, 0.92);
  border: 1.5px solid rgba(107, 255, 218, 0.55);
  font-family: Manrope, sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #c8f5f0;
  pointer-events: none;
  animation: spectral-live-chip-in 0.28s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

@keyframes spectral-live-chip-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spectral-task-move {
  transition:
    transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1),
    box-shadow 0.35s ease;
  box-shadow: 0 14px 32px rgba(50, 181, 190, 0.22) !important;
  z-index: 3;
  position: relative;
}

.spectral-staged-host {
  display: none;
}

.spectral-clarify {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 10070;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(14, 22, 26, 0.94);
  border: 1.5px solid rgba(107, 255, 218, 0.5);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  max-width: min(340px, calc(100vw - 28px));
  pointer-events: auto;
}

.spectral-clarify-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(107, 255, 218, 0.85);
}

.spectral-clarify-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spectral-clarify-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spectral-clarify-item-label {
  font-size: 13px;
  font-weight: 800;
  color: #eef8f6;
  line-height: 1.35;
}

.spectral-clarify-item-detail {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(200, 220, 215, 0.78);
}

body.spectral-review-mode .spectral-clarify {
  bottom: calc(118px + env(safe-area-inset-bottom, 0px));
}

.spectral-clarify-old-placeholder {
  display: none;
}

.spectral-memory-echo {
  position: fixed;
  z-index: 10030;
  border: 2px dashed rgba(107, 255, 218, 0.35);
  border-radius: 14px;
  background: rgba(50, 181, 190, 0.06);
  pointer-events: none;
  opacity: 0.7;
  animation: spectral-memory-fade 2s ease forwards;
}

@keyframes spectral-memory-fade {
  0% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
  }
}

body.spectral-agency-hover #n-add.ni-add--turbo-on .ni-add-holo-mini[data-holo-logo],
body.spectral-agency-hover #n-add.ni-add--turbo-on .ni-add-ring,
body.spectral-agency-sweeping #n-add.ni-add--turbo-on .ni-add-holo-mini[data-holo-logo],
body.spectral-agency-sweeping #n-add.ni-add--turbo-on .ni-add-ring {
  animation: spectral-flower-pulse 2.2s ease-in-out infinite;
}

body.spectral-ambient-ready #n-add .ni-add-aura {
  animation: spectral-ambient-aura 3.5s ease-in-out infinite;
}

@keyframes spectral-flower-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(50, 181, 190, 0.45));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(107, 255, 218, 0.75));
  }
}

@keyframes spectral-ambient-aura {
  0%,
  100% {
    opacity: 0.32;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

#n-add.spectral-priority-next {
  outline: 2px solid rgba(255, 220, 120, 0.8);
  outline-offset: 4px;
}

body.spectral-agency-live #n-add,
body.spectral-agency-sweeping #n-add,
body.spectral-agency-hover #n-add {
  pointer-events: auto !important;
  z-index: 10095;
}

@media (prefers-reduced-motion: reduce) {
  .spectral-ui-float {
    animation: none !important;
    transform: translateY(-8px) scale(1.02);
  }
  .spectral-narration,
  body.spectral-agency-hover #n-add .ni-add-ring,
  .spectral-task-move {
    animation: none !important;
    transition: none !important;
  }
}
