/*
Purpose: style the Mullu Eye Helper cursor, target highlight, and action panel.
Governance scope: visible helper state, bounded interaction surface, and non-overlapping fixed overlays.
Dependencies: assets/helper/mullu-eye-helper-v3.bundle.js and browser DOM APIs.
Invariants: helper chrome stays above page content, does not cover primary navigation, and preserves readable action controls.
*/

:root {
  --mullu-eye-helper-bg: rgba(5, 8, 13, 0.92);
  --mullu-eye-helper-panel: rgba(10, 15, 23, 0.96);
  --mullu-eye-helper-line: rgba(126, 247, 209, 0.32);
  --mullu-eye-helper-text: #f3fff9;
  --mullu-eye-helper-muted: #9fb8b0;
  --mullu-eye-helper-accent: #7ef7d1;
  --mullu-eye-helper-warn: #ffd166;
  --mullu-eye-helper-danger: #ff6b6b;
  --mullu-eye-helper-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --mullu-eye-helper-eye-x: 0px;
  --mullu-eye-helper-eye-y: 0px;
}

.mullu-eye-helper-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 64px;
  max-width: min(320px, calc(100vw - 32px));
  height: 48px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--mullu-eye-helper-line);
  border-radius: 999px;
  color: var(--mullu-eye-helper-text);
  background: var(--mullu-eye-helper-bg);
  box-shadow: var(--mullu-eye-helper-shadow);
  cursor: pointer;
  user-select: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: mullu-eye-helper-dock-breathe 4.8s ease-in-out infinite;
}

.mullu-eye-helper-dock:focus-visible,
.mullu-eye-helper-panel button:focus-visible {
  outline: 2px solid var(--mullu-eye-helper-accent);
  outline-offset: 3px;
}

.mullu-eye-helper-dock-eyes,
.mullu-eye-helper-cursor-eyes {
  display: inline-grid;
  grid-template-columns: repeat(2, 18px);
  gap: 4px;
  align-items: center;
  transform-origin: center;
}

.mullu-eye-helper-eye {
  position: relative;
  overflow: hidden;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(126, 247, 209, 0.7);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.92) 0 6px, rgba(126, 247, 209, 0.92) 7px 9px, rgba(19, 35, 44, 0.92) 10px 11px, transparent 12px),
    linear-gradient(135deg, rgba(243, 255, 249, 0.96), rgba(126, 247, 209, 0.72));
  box-shadow: 0 0 18px rgba(126, 247, 209, 0.18);
  animation: mullu-eye-helper-eye-breathe 3.8s ease-in-out infinite;
}

.mullu-eye-helper-eye::before {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.92) 0 1px, transparent 2px),
    #051018;
  box-shadow:
    0 0 0 2px rgba(4, 11, 17, 0.18),
    0 0 8px rgba(126, 247, 209, 0.36);
  content: "";
  transform: translate(
    calc(-50% + var(--mullu-eye-helper-eye-x)),
    calc(-50% + var(--mullu-eye-helper-eye-y))
  );
  transition: transform 120ms ease-out;
}

.mullu-eye-helper-eye::after {
  position: absolute;
  inset: -1px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(5, 8, 13, 0.96), rgba(10, 18, 24, 0.94));
  content: "";
  transform: scaleY(0);
  transform-origin: top;
  animation: mullu-eye-helper-blink 6.2s infinite;
}

.mullu-eye-helper-dock[aria-pressed="false"] .mullu-eye-helper-eye::after {
  inset: 7px 2px auto;
  height: 2px;
  border-radius: 99px;
  background: rgba(126, 247, 209, 0.86);
  transform: scaleY(1);
  animation: mullu-eye-helper-sleep-twitch 7.6s ease-in-out infinite;
  transform-origin: center;
}

.mullu-eye-helper-dock[aria-pressed="false"]:hover .mullu-eye-helper-eye::before,
.mullu-eye-helper-dock[aria-pressed="false"]:focus-visible .mullu-eye-helper-eye::before {
  animation: mullu-eye-helper-peek-gaze 1.4s ease-in-out infinite;
}

.mullu-eye-helper-dock[aria-pressed="false"]:hover .mullu-eye-helper-eye::after,
.mullu-eye-helper-dock[aria-pressed="false"]:focus-visible .mullu-eye-helper-eye::after {
  inset: -1px;
  height: auto;
  transform: scaleY(0);
  animation: mullu-eye-helper-blink 5.4s infinite;
}

.mullu-eye-helper-dock[aria-pressed="true"] {
  border-color: rgba(126, 247, 209, 0.58);
  animation: mullu-eye-helper-awake-pulse 2.6s ease-in-out infinite;
}

.mullu-eye-helper-dock[aria-pressed="true"] .mullu-eye-helper-dock-eyes {
  animation: mullu-eye-helper-attention 3.2s ease-in-out infinite;
}

html.mullu-eye-helper-waking .mullu-eye-helper-dock[aria-pressed="true"] {
  animation:
    mullu-eye-helper-wake-flash 560ms ease-out 1,
    mullu-eye-helper-awake-pulse 2.6s ease-in-out infinite 560ms;
}

html.mullu-eye-helper-risky .mullu-eye-helper-dock[aria-pressed="true"],
html.mullu-eye-helper-risky .mullu-eye-helper-highlight {
  border-color: rgba(255, 209, 102, 0.72);
}

html.mullu-eye-helper-risky .mullu-eye-helper-eye {
  border-color: rgba(255, 209, 102, 0.86);
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.24);
}

html.mullu-eye-helper-risky .mullu-eye-helper-eye::before {
  box-shadow:
    0 0 0 2px rgba(4, 11, 17, 0.18),
    0 0 12px rgba(255, 209, 102, 0.44);
}

html.mullu-eye-helper-pinned .mullu-eye-helper-dock[aria-pressed="true"] {
  border-color: rgba(243, 255, 249, 0.72);
}

html.mullu-eye-helper-scanning .mullu-eye-helper-dock[aria-pressed="true"] {
  border-color: rgba(116, 192, 252, 0.62);
}

html.mullu-eye-helper-scanning .mullu-eye-helper-eye::before {
  animation: mullu-eye-helper-search-saccade 1.72s steps(1, end) infinite;
}

html.mullu-eye-helper-keyboard-lock .mullu-eye-helper-highlight {
  border-color: rgba(186, 156, 255, 0.8);
  box-shadow:
    0 0 0 1px rgba(5, 8, 13, 0.74),
    0 0 32px rgba(186, 156, 255, 0.28);
}

html.mullu-eye-helper-panel-open .mullu-eye-helper-dock[aria-pressed="true"] .mullu-eye-helper-eye {
  box-shadow:
    0 0 0 2px rgba(126, 247, 209, 0.14),
    0 0 24px rgba(126, 247, 209, 0.34);
}

html.mullu-eye-helper-pinned .mullu-eye-helper-highlight {
  border-width: 3px;
  box-shadow:
    0 0 0 1px rgba(5, 8, 13, 0.74),
    0 0 34px rgba(243, 255, 249, 0.26);
  animation: mullu-eye-helper-pin-hold 2.4s ease-in-out infinite;
}

html.mullu-eye-helper-revealing .mullu-eye-helper-highlight {
  animation:
    mullu-eye-helper-reveal-pulse 920ms ease-out 1,
    mullu-eye-helper-target-scan 1.8s ease-in-out infinite 920ms;
}

html.mullu-eye-helper-target-link:not(.mullu-eye-helper-risky) .mullu-eye-helper-highlight {
  border-color: rgba(116, 192, 252, 0.72);
}

html.mullu-eye-helper-target-button:not(.mullu-eye-helper-risky) .mullu-eye-helper-highlight {
  border-color: rgba(126, 247, 209, 0.82);
  box-shadow:
    0 0 0 1px rgba(5, 8, 13, 0.74),
    0 0 30px rgba(126, 247, 209, 0.28);
}

html.mullu-eye-helper-target-input:not(.mullu-eye-helper-risky) .mullu-eye-helper-eye {
  border-color: rgba(186, 156, 255, 0.76);
}

html.mullu-eye-helper-target-card:not(.mullu-eye-helper-risky) .mullu-eye-helper-highlight,
html.mullu-eye-helper-target-section:not(.mullu-eye-helper-risky) .mullu-eye-helper-highlight {
  border-style: dashed;
}

.mullu-eye-helper-dock-label {
  overflow: hidden;
  max-width: 210px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mullu-eye-helper-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2147482998;
  width: 54px;
  height: 34px;
  pointer-events: none;
  transform: translate3d(-200px, -200px, 0);
  transition: opacity 140ms ease;
  animation: mullu-eye-helper-cursor-float 2.8s ease-in-out infinite;
}

.mullu-eye-helper-cursor[hidden],
.mullu-eye-helper-highlight[hidden],
.mullu-eye-helper-panel[hidden] {
  display: none;
}

.mullu-eye-helper-cursor-eyes {
  transform: scale(var(--mullu-eye-helper-scale, 1));
  transform-origin: center;
}

.mullu-eye-helper-cursor .mullu-eye-helper-eye {
  animation-duration: 2.9s;
}

.mullu-eye-helper-highlight {
  position: fixed;
  z-index: 2147482997;
  border: 2px solid var(--mullu-eye-helper-accent);
  border-radius: 8px;
  pointer-events: none;
  box-shadow:
    0 0 0 1px rgba(5, 8, 13, 0.74),
    0 0 26px rgba(126, 247, 209, 0.22);
  transition: left 120ms ease, top 120ms ease, width 120ms ease, height 120ms ease, opacity 120ms ease;
  animation: mullu-eye-helper-target-scan 1.8s ease-in-out infinite;
}

.mullu-eye-helper-panel {
  position: fixed;
  z-index: 2147483001;
  width: min(340px, calc(100vw - 32px));
  max-height: min(440px, calc(100vh - 32px));
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--mullu-eye-helper-line);
  border-radius: 8px;
  color: var(--mullu-eye-helper-text);
  background: var(--mullu-eye-helper-panel);
  box-shadow: var(--mullu-eye-helper-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.mullu-eye-helper-panel-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.mullu-eye-helper-kicker {
  margin: 0 0 4px;
  color: var(--mullu-eye-helper-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mullu-eye-helper-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.25;
}

.mullu-eye-helper-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: var(--mullu-eye-helper-text);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.mullu-eye-helper-summary {
  margin: 0 0 12px;
  color: var(--mullu-eye-helper-muted);
  font-size: 13px;
  line-height: 1.45;
}

.mullu-eye-helper-meta {
  display: grid;
  grid-template-columns: 0.5fr 0.72fr 1.15fr 1fr;
  gap: 6px;
  margin: 0 0 12px;
}

.mullu-eye-helper-meta span {
  overflow: hidden;
  min-height: 24px;
  padding: 5px 7px;
  border: 1px solid rgba(126, 247, 209, 0.18);
  border-radius: 8px;
  color: var(--mullu-eye-helper-muted);
  background: rgba(126, 247, 209, 0.05);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mullu-eye-helper-actions {
  display: grid;
  gap: 8px;
}

.mullu-eye-helper-actions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid rgba(126, 247, 209, 0.22);
  border-radius: 8px;
  color: var(--mullu-eye-helper-text);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.mullu-eye-helper-actions button:hover {
  border-color: rgba(126, 247, 209, 0.56);
  background: rgba(126, 247, 209, 0.1);
}

.mullu-eye-helper-actions button[data-risk="true"] {
  border-color: rgba(255, 209, 102, 0.42);
}

.mullu-eye-helper-action-note {
  color: var(--mullu-eye-helper-muted);
  font-size: 11px;
  font-weight: 700;
}

.mullu-eye-helper-warning {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 209, 102, 0.32);
  border-radius: 8px;
  color: var(--mullu-eye-helper-warn);
  background: rgba(255, 209, 102, 0.08);
  font-size: 12px;
  line-height: 1.4;
}

.mullu-eye-helper-toast {
  position: fixed;
  right: 18px;
  bottom: 76px;
  z-index: 2147483002;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid var(--mullu-eye-helper-line);
  border-radius: 8px;
  color: var(--mullu-eye-helper-text);
  background: var(--mullu-eye-helper-bg);
  box-shadow: var(--mullu-eye-helper-shadow);
  font-size: 13px;
  line-height: 1.35;
}

.mullu-eye-helper-toast[hidden] {
  display: none;
}

html.mullu-eye-helper-active,
html.mullu-eye-helper-active body {
  cursor: none;
}

html.mullu-eye-helper-active input,
html.mullu-eye-helper-active textarea,
html.mullu-eye-helper-active select,
html.mullu-eye-helper-active [contenteditable="true"] {
  cursor: text;
}

@keyframes mullu-eye-helper-dock-breathe {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: var(--mullu-eye-helper-shadow), 0 0 0 rgba(126, 247, 209, 0);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: var(--mullu-eye-helper-shadow), 0 0 20px rgba(126, 247, 209, 0.12);
  }
}

@keyframes mullu-eye-helper-awake-pulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: var(--mullu-eye-helper-shadow), 0 0 0 rgba(126, 247, 209, 0);
  }
  45% {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--mullu-eye-helper-shadow), 0 0 28px rgba(126, 247, 209, 0.2);
  }
}

@keyframes mullu-eye-helper-attention {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.18);
  }
}

@keyframes mullu-eye-helper-wake-flash {
  0% {
    transform: translateY(0) scale(0.94);
    box-shadow: var(--mullu-eye-helper-shadow), 0 0 0 rgba(126, 247, 209, 0);
  }
  52% {
    transform: translateY(-3px) scale(1.06);
    box-shadow: var(--mullu-eye-helper-shadow), 0 0 34px rgba(126, 247, 209, 0.32);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: var(--mullu-eye-helper-shadow), 0 0 10px rgba(126, 247, 209, 0.12);
  }
}

@keyframes mullu-eye-helper-eye-breathe {
  0%,
  100% {
    box-shadow: 0 0 14px rgba(126, 247, 209, 0.14);
  }
  50% {
    box-shadow: 0 0 22px rgba(126, 247, 209, 0.28);
  }
}

@keyframes mullu-eye-helper-blink {
  0%,
  90%,
  100% {
    transform: scaleY(0);
  }
  93%,
  95% {
    transform: scaleY(1);
  }
}

@keyframes mullu-eye-helper-sleep-twitch {
  0%,
  82%,
  100% {
    opacity: 0.86;
    transform: translateY(0) scaleX(1);
  }
  86% {
    opacity: 1;
    transform: translateY(-1px) scaleX(0.72);
  }
  90% {
    opacity: 0.86;
    transform: translateY(0) scaleX(1);
  }
}

@keyframes mullu-eye-helper-peek-gaze {
  0%,
  100% {
    transform: translate(calc(-50% - 2px), calc(-50% + 1px));
  }
  45% {
    transform: translate(calc(-50% + 2px), calc(-50% - 1px));
  }
  68% {
    transform: translate(calc(-50% + 1px), calc(-50% + 1px));
  }
}

@keyframes mullu-eye-helper-search-saccade {
  0%,
  100% {
    transform: translate(calc(-50% - 2px), calc(-50% - 1px));
  }
  22% {
    transform: translate(calc(-50% + 2px), calc(-50% + 1px));
  }
  48% {
    transform: translate(calc(-50% + 1px), calc(-50% - 2px));
  }
  74% {
    transform: translate(calc(-50% - 1px), calc(-50% + 2px));
  }
}

@keyframes mullu-eye-helper-cursor-float {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(126, 247, 209, 0));
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(126, 247, 209, 0.22));
  }
}

@keyframes mullu-eye-helper-target-scan {
  0%,
  100% {
    opacity: 0.78;
  }
  50% {
    opacity: 1;
  }
}

@keyframes mullu-eye-helper-pin-hold {
  0%,
  100% {
    outline: 0 solid rgba(243, 255, 249, 0);
  }
  50% {
    outline: 4px solid rgba(243, 255, 249, 0.12);
  }
}

@keyframes mullu-eye-helper-reveal-pulse {
  0% {
    transform: scale(0.98);
    box-shadow:
      0 0 0 1px rgba(5, 8, 13, 0.74),
      0 0 0 rgba(243, 255, 249, 0);
  }
  42% {
    transform: scale(1.018);
    box-shadow:
      0 0 0 1px rgba(5, 8, 13, 0.74),
      0 0 42px rgba(243, 255, 249, 0.34);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 1px rgba(5, 8, 13, 0.74),
      0 0 26px rgba(126, 247, 209, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mullu-eye-helper-dock,
  .mullu-eye-helper-dock[aria-pressed="true"],
  html.mullu-eye-helper-waking .mullu-eye-helper-dock[aria-pressed="true"],
  .mullu-eye-helper-dock[aria-pressed="true"] .mullu-eye-helper-dock-eyes,
  html.mullu-eye-helper-scanning .mullu-eye-helper-eye::before,
  .mullu-eye-helper-eye,
  .mullu-eye-helper-dock[aria-pressed="false"]:hover .mullu-eye-helper-eye::before,
  .mullu-eye-helper-dock[aria-pressed="false"]:focus-visible .mullu-eye-helper-eye::before,
  .mullu-eye-helper-eye::after,
  .mullu-eye-helper-dock[aria-pressed="false"] .mullu-eye-helper-eye::after,
  .mullu-eye-helper-cursor,
  .mullu-eye-helper-highlight,
  html.mullu-eye-helper-pinned .mullu-eye-helper-highlight,
  html.mullu-eye-helper-revealing .mullu-eye-helper-highlight {
    animation: none;
  }

  .mullu-eye-helper-eye::before {
    transition: none;
  }
}

@media (max-width: 640px) {
  .mullu-eye-helper-dock {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }

  .mullu-eye-helper-dock-label {
    max-width: 150px;
  }

  .mullu-eye-helper-toast {
    right: 12px;
    bottom: 70px;
  }

  .mullu-eye-helper-meta {
    grid-template-columns: 1fr;
  }
}
