/* LL Rho — site-wide, owner-only agent widget.
   Summoned by Ctrl+Shift+L from any page; invisible otherwise (no icon,
   no DOM footprint clients would notice). Concept-preview visuals:
   liquid blob is a CSS/SVG approximation of the Canva reference, not an
   embedded video — kept light enough to sit on every page. */

#llrho-root {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(3, 4, 10, 0.72);
  backdrop-filter: blur(6px) saturate(1.1);
  -webkit-backdrop-filter: blur(6px) saturate(1.1);
  font-family: "Inter", system-ui, sans-serif;
}
#llrho-root.is-open {
  display: flex;
}

.llrho-stage {
  position: relative;
  width: min(920px, 94vw);
  height: min(640px, 88vh);
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(ellipse 120% 100% at 50% 20%, #12162e 0%, #04050c 70%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(120, 150, 255, 0.14);
}

.llrho-close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  z-index: 20;
  background: none;
  border: none;
  color: rgba(220, 230, 255, 0.55);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  transition: color 0.2s;
}
.llrho-close:hover {
  color: #fff;
}

.llrho-badge {
  position: absolute;
  top: 0.9rem;
  left: 1.1rem;
  z-index: 20;
  font-family: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(210, 225, 255, 0.4);
}
.llrho-badge strong {
  color: #a8e6b8;
  font-weight: 600;
}

/* ---- blob ---- */
.llrho-blob-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.llrho-blob {
  position: relative;
  width: min(46vh, 260px);
  height: min(46vh, 260px);
  border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95) 0%, rgba(200, 220, 255, 0.55) 18%, transparent 45%),
    radial-gradient(circle at 68% 70%, rgba(70, 110, 255, 0.95) 0%, rgba(30, 50, 170, 0.95) 45%, rgba(8, 14, 40, 1) 78%);
  filter: drop-shadow(0 0 55px rgba(70, 110, 255, 0.5));
  animation: llrho-morph 9s ease-in-out infinite, llrho-hue 16s linear infinite;
  transition: filter 0.6s ease;
}
.llrho-blob::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.5), transparent 55%);
  mix-blend-mode: screen;
  animation: llrho-morph 9s ease-in-out infinite reverse;
}
@keyframes llrho-morph {
  0%, 100% { border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%; }
  25% { border-radius: 58% 42% 38% 62% / 55% 65% 35% 45%; }
  50% { border-radius: 50% 50% 55% 45% / 40% 55% 45% 60%; }
  75% { border-radius: 65% 35% 45% 55% / 60% 35% 65% 40%; }
}
@keyframes llrho-hue {
  0% { filter: drop-shadow(0 0 55px rgba(70, 110, 255, 0.5)) hue-rotate(0deg); }
  100% { filter: drop-shadow(0 0 55px rgba(70, 110, 255, 0.5)) hue-rotate(18deg); }
}

/* Working / processing: blob shifts toward violet, spins a touch faster */
#llrho-root.is-working .llrho-blob {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.9) 0%, rgba(220, 200, 255, 0.5) 18%, transparent 45%),
    radial-gradient(circle at 68% 70%, rgba(150, 70, 220, 0.95) 0%, rgba(90, 30, 150, 0.95) 45%, rgba(20, 6, 30, 1) 78%);
  animation-duration: 5.5s, 9s;
}

.llrho-lens-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  font-family: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: #050810;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  pointer-events: auto;
  border: none;
  transition: transform 0.15s ease;
}
.llrho-lens-label:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

/* ---- login ---- */
.llrho-login {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.72);
  padding: 0.85rem 1.1rem;
  border-radius: 4px;
  pointer-events: auto;
  min-width: 220px;
}
.llrho-login input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #eafff2;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem;
  border-radius: 3px;
  outline: none;
}
.llrho-login input:focus {
  border-color: rgba(143, 212, 168, 0.7);
}
.llrho-login label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  color: rgba(220, 230, 255, 0.65);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.llrho-login button {
  margin-top: 0.2rem;
  background: #a8e6b8;
  color: #06120a;
  border: none;
  border-radius: 3px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}
.llrho-login .llrho-error {
  color: #ff9d9d;
  font-size: 0.66rem;
  min-height: 0.9em;
}

/* ---- chat chrome ---- */
.llrho-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.1rem;
  padding: 0.7rem 3rem 0.7rem 1.1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#llrho-root.is-chat .llrho-toolbar,
#llrho-root.is-working .llrho-toolbar {
  opacity: 1;
  pointer-events: auto;
}
.llrho-toolbar button {
  background: none;
  border: none;
  color: rgba(210, 225, 255, 0.5);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  transition: color 0.2s;
}
.llrho-toolbar button:hover {
  color: #a8e6b8;
}
.llrho-menu-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.llrho-sidemenu {
  position: absolute;
  top: 3.2rem;
  right: 1.1rem;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: flex-end;
}
.llrho-sidemenu button {
  background: none;
  border: none;
  cursor: pointer;
  text-align: right;
  padding: 0;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  transition-delay: calc(var(--i, 0) * 0.05s);
}
#llrho-root.is-menu-open .llrho-sidemenu button {
  opacity: 1;
  transform: translateX(0);
}
.llrho-sidemenu .llrho-code {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 1.1rem;
  color: #a8e6b8;
  line-height: 1;
}
.llrho-sidemenu .llrho-name {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: rgba(210, 225, 255, 0.6);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.llrho-greeting {
  position: absolute;
  left: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  font-family: "Chakra Petch", "IBM Plex Mono", monospace;
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  color: #baffb0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  max-width: 8.5rem;
  line-height: 1.25;
  opacity: 0;
  transition: opacity 0.5s ease;
}
#llrho-root.is-chat.is-greeting .llrho-greeting {
  opacity: 1;
}

.llrho-status {
  position: absolute;
  right: 1.4rem;
  top: 1.4rem;
  z-index: 12;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  color: rgba(220, 230, 255, 0.8);
  text-align: center;
}
#llrho-root.is-working .llrho-status {
  display: flex;
}
.llrho-status__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #c9a8ff;
  box-shadow: 0 0 10px rgba(201, 168, 255, 0.9);
  animation: llrho-pulse 1s ease-in-out infinite;
}
@keyframes llrho-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
.llrho-status__code {
  font-weight: 700;
  color: #c9a8ff;
  font-size: 0.9rem;
}

/* Scrolling scan-text backdrop during 'working' */
.llrho-scan {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  line-height: 1.5;
  color: rgba(120, 220, 160, 0.4);
  padding: 3.2rem 1rem 0 1rem;
  opacity: 0;
  transition: opacity 0.4s ease;
  white-space: pre;
}
#llrho-root.is-working .llrho-scan {
  opacity: 1;
}

/* ---- chat panel (glass rect over the blob) ---- */
.llrho-panel {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  z-index: 9;
  width: min(72%, 560px);
  height: 58%;
  max-height: 360px;
  background: rgba(15, 20, 40, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
}
#llrho-root.is-chat .llrho-panel,
#llrho-root.is-working .llrho-panel {
  opacity: 1;
  pointer-events: auto;
}

.llrho-log {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem 1rem 0.4rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  color: rgba(230, 240, 255, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.llrho-msg--user {
  color: rgba(200, 215, 255, 0.75);
}
.llrho-msg--rho {
  color: #d8ffe4;
}
.llrho-msg__crm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  background: rgba(168, 230, 184, 0.14);
  border: 1px solid rgba(168, 230, 184, 0.4);
  color: #a8e6b8;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
}
.llrho-msg__crm:hover {
  background: rgba(168, 230, 184, 0.24);
}

.llrho-compose {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.llrho-compose textarea {
  flex: 1;
  resize: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: #eafff2;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.8rem;
  padding: 0.45rem 0.6rem;
  height: 2.2rem;
  outline: none;
}
.llrho-compose textarea:focus {
  border-color: rgba(143, 212, 168, 0.6);
}
.llrho-compose button {
  flex-shrink: 0;
  background: #fff;
  color: #1a1330;
  border: none;
  border-radius: 999px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}
.llrho-compose button:disabled {
  opacity: 0.5;
  cursor: default;
}

.llrho-disclaimer {
  position: absolute;
  bottom: 0.6rem;
  left: 1.1rem;
  right: 1.1rem;
  z-index: 20;
  text-align: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: rgba(255, 200, 120, 0.65);
  opacity: 0;
  transition: opacity 0.4s ease;
}
#llrho-root.is-chat .llrho-disclaimer,
#llrho-root.is-working .llrho-disclaimer {
  opacity: 1;
}

@media (max-width: 640px) {
  .llrho-greeting { display: none; }
  .llrho-panel { width: 88%; height: 62%; }
  .llrho-sidemenu .llrho-name { display: none; }
}
