/* Floor agent life + sign-in polish (Nov 2026).
   Loaded last. Labels are positioned with transform in JS-driven left/top, so
   nothing here animates .desk-label's own transform — only shadows and
   pseudo-elements. Every animation stops under prefers-reduced-motion. */

/* ── Agent chips ───────────────────────────────────────────── */

.desk-label {
  overflow: visible;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

/* Live line under the chip: the agent's own latest message. */
.desk-label-status {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 156px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(7, 9, 13, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--ink-3, #8b95a3);
  font: 600 9.5px/1.25 var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.desk-label-status:empty { display: none; }
.desk-label[data-status="live"] .desk-label-status {
  color: color-mix(in srgb, var(--agent-accent, #7c6ff0) 70%, #ffffff);
  border-color: color-mix(in srgb, var(--agent-accent, #7c6ff0) 22%, transparent);
}
.desk-label[data-status="warn"] .desk-label-status {
  color: var(--wait, #e0ae57);
}
.scene-wrap.compact-scene .desk-label-status { display: none; }
@media (max-width: 1099px) {
  .desk-label-status { display: none; }
}

/* Working agents glow in their own colour. */
.desk-label[data-status="live"] {
  border-color: color-mix(in srgb, var(--agent-accent, #7c6ff0) 42%, rgba(255, 255, 255, 0.08));
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.3),
    0 0 18px color-mix(in srgb, var(--agent-accent, #7c6ff0) 24%, transparent);
}

/* Soft light sweep across a working chip. */
.desk-label[data-status="live"]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 32%, color-mix(in srgb, var(--agent-accent, #7c6ff0) 26%, transparent) 50%, transparent 68%);
  background-size: 260% 100%;
  animation: agent-sweep 3.4s ease-in-out infinite;
}

/* Status ring around the icon: pulses while working, amber on a warning. */
.desk-label-icon { position: relative; }
.desk-label[data-status="live"] .desk-label-icon::after,
.desk-label[data-status="warn"] .desk-label-icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 8px;
  border: 1.5px solid var(--agent-accent, #7c6ff0);
  pointer-events: none;
  animation: agent-ring 2.4s ease-out infinite;
}
.desk-label[data-status="warn"] .desk-label-icon::after {
  border-color: var(--wait, #e0ae57);
  animation-duration: 3.2s;
}

/* One-shot burst when an agent fires (idle → working). */
.desk-label.fired {
  animation: agent-fire 1.5s ease-out;
}

@keyframes agent-sweep {
  0% { background-position: 130% 0; }
  55%, 100% { background-position: -30% 0; }
}
@keyframes agent-ring {
  0% { opacity: 0.85; transform: scale(0.92); }
  70%, 100% { opacity: 0; transform: scale(1.45); }
}
@keyframes agent-fire {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--agent-accent, #7c6ff0) 70%, transparent),
      0 0 28px color-mix(in srgb, var(--agent-accent, #7c6ff0) 60%, transparent);
  }
  100% {
    box-shadow: 0 0 0 16px transparent, 0 0 18px color-mix(in srgb, var(--agent-accent, #7c6ff0) 20%, transparent);
  }
}

/* ── Live desk chip on the scene ──────────────────────────── */

.desk-hud {
  position: absolute;
  top: 14px;
  left: 44px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: rgba(7, 9, 13, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink-2, #c4cbd6);
  font: 600 11.5px/1 var(--font-sans, system-ui);
  pointer-events: none;
}
.desk-hud[hidden] { display: none; }
.desk-hud i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-4, #5c6573);
  box-shadow: 0 0 0 0 transparent;
}
.desk-hud[data-state="live"] i {
  background: var(--take, #4dd29a);
  animation: hud-dot 2s ease-out infinite;
}
.desk-hud[data-state="warn"] i { background: var(--wait, #e0ae57); }
.desk-hud-kicker {
  font: 700 9.5px/1 var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4, #7b8494);
}
.scene-wrap.compact-scene .desk-hud {
  top: 10px;
  left: 38px;
  padding: 5px 10px 5px 8px;
  font-size: 10.5px;
}
.scene-wrap.compact-scene .desk-hud-kicker { display: none; }

@keyframes hud-dot {
  0% { box-shadow: 0 0 0 0 rgba(77, 210, 154, 0.55); }
  100% { box-shadow: 0 0 0 9px rgba(77, 210, 154, 0); }
}

/* ── Sign-in ──────────────────────────────────────────────── */

.auth-live {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 2px 0 18px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(124, 111, 240, 0.18);
  background:
    linear-gradient(135deg, rgba(124, 111, 240, 0.09), rgba(77, 210, 154, 0.04));
  color: var(--ink-2, #c4cbd6);
  font: 500 12px/1.35 var(--font-sans, system-ui);
}
.auth-live[hidden] { display: none; }
.auth-live b { font-weight: 700; color: var(--ink, #eef1f6); }
.auth-live b.up, .auth-live b.long { color: var(--take, #4dd29a); }
.auth-live b.down, .auth-live b.short { color: var(--stop, #ef7077); }
.auth-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--take, #4dd29a);
  animation: hud-dot 2s ease-out infinite;
}
.auth-live-label {
  font: 700 9.5px/1 var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--take, #4dd29a);
}

.auth-field input:focus,
.auth-field input:focus-visible {
  outline: none;
  border-color: rgba(124, 111, 240, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 111, 240, 0.18);
}
.auth-submit {
  position: relative;
  overflow: hidden;
}
.auth-submit:not(:disabled)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.16) 50%, transparent 70%);
  background-size: 260% 100%;
  background-position: 130% 0;
  transition: background-position 0.7s ease;
  pointer-events: none;
}
.auth-submit:not(:disabled):hover::after { background-position: -30% 0; }

/* ── Motion off when asked ────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .desk-label[data-status="live"]::before,
  .desk-label[data-status="live"] .desk-label-icon::after,
  .desk-label[data-status="warn"] .desk-label-icon::after,
  .desk-label.fired,
  .desk-hud[data-state="live"] i,
  .auth-live-dot {
    animation: none !important;
  }
  .desk-label[data-status="live"]::before { display: none; }
}
