/* =============================================================================
   LiveWorkPlay site-wide concierge — bottom-right floating chat bubble.
   Drop into any page that includes css/system.css. The bubble + Ask Panel
   are auto-injected by js/concierge.js.

   The homepage uses a different top-center "brand orb" — concierge.js
   skips injection if it detects #brandOrb already in the DOM.
   ========================================================================= */

/* ── Bottom-right floating bubble ───────────────────────────────────────── */

.concierge-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  z-index: 950;
  background: var(--cream, #FBF6E9);
  border: 1px solid rgba(15, 30, 61, 0.12);
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 14px rgba(15, 30, 61, 0.18),
    0 12px 32px rgba(15, 30, 61, 0.12);
  transition: transform 0.25s var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
              box-shadow 0.25s var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
  animation: conciergePulse 3.6s ease-in-out infinite;
}

.concierge-bubble img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
  display: block;
}

.concierge-bubble:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 6px 20px rgba(15, 30, 61, 0.24),
    0 18px 40px rgba(15, 30, 61, 0.16);
}

.concierge-bubble:focus-visible {
  outline: 2px solid var(--blue-deep, #0F1E3D);
  outline-offset: 3px;
}

.concierge-bubble.is-open {
  animation: none;
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(15, 30, 61, 0.18);
}

/* Subtle ring pulse to draw attention without being distracting. */
.concierge-bubble::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1.5px solid var(--blue-deep, #0F1E3D);
  opacity: 0;
  animation: conciergeRing 3.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes conciergePulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes conciergeRing {
  0% { opacity: 0; transform: scale(0.94); }
  35% { opacity: 0.42; transform: scale(1.0); }
  70%, 100% { opacity: 0; transform: scale(1.18); }
}

/* Hint label that floats above on hover. */
.concierge-bubble__hint {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 8px;
  background: rgba(15, 30, 61, 0.92);
  color: var(--cream, #FBF6E9);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.22s var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
              transform 0.22s var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}

.concierge-bubble:hover .concierge-bubble__hint,
.concierge-bubble:focus-visible .concierge-bubble__hint {
  opacity: 1;
  transform: translateY(0);
}

.concierge-bubble.is-open .concierge-bubble__hint {
  opacity: 0;
}

/* Mobile: smaller bubble, tighter to the edge. */
@media (max-width: 520px) {
  .concierge-bubble {
    width: 48px;
    height: 48px;
    bottom: 16px;
    right: 16px;
  }
  .concierge-bubble img {
    width: 30px;
    height: 30px;
  }
}

/* Reduce motion respect — kill the bob + ring. */
@media (prefers-reduced-motion: reduce) {
  .concierge-bubble {
    animation: none;
  }
  .concierge-bubble::after {
    animation: none;
    opacity: 0;
  }
}

/* ── Ask Panel (mirrors the homepage panel — same selectors so any
   future styling tweak only needs to happen in one place) ──────────────── */

.ask-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 24px));
  width: min(440px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 96px));
  background: var(--cream, #FBF6E9);
  color: var(--ink, #0F1E3D);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45),
              0 6px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
              transform 0.32s var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
  overflow: hidden;
}
.ask-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--rainbow, linear-gradient(90deg, #2B84D4, #5FB63F, #F5B220, #F1782B, #E2372A));
}
.ask-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}
.ask-panel[hidden] {
  display: none;
}

.ask-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 24px 12px;
  gap: 12px;
}
.ask-panel__eyebrow {
  font-family: var(--mono, monospace);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-ink, #1C2F56);
  margin-bottom: 6px;
}
.ask-panel__title {
  font-family: var(--serif, Georgia, serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.1;
  color: var(--ink, #0F1E3D);
  margin: 0;
}
.ask-panel__close {
  background: rgba(15, 30, 61, 0.06);
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--ink, #0F1E3D);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.ask-panel__close:hover {
  background: rgba(15, 30, 61, 0.14);
}

.ask-panel__log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}
.ask-msg {
  display: flex;
}
.ask-msg--bot {
  justify-content: flex-start;
}
.ask-msg--user {
  justify-content: flex-end;
}
.ask-msg__bubble {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.94rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ask-msg--bot .ask-msg__bubble {
  background: rgba(15, 30, 61, 0.06);
  color: var(--ink, #0F1E3D);
  border-bottom-left-radius: 4px;
}
.ask-msg--user .ask-msg__bubble {
  background: var(--blue-deep, #0F1E3D);
  color: var(--cream, #FBF6E9);
  border-bottom-right-radius: 4px;
}
.ask-msg__bubble a {
  color: var(--orange, #F1782B);
  text-decoration: underline;
}
.ask-msg--user .ask-msg__bubble a {
  color: #FFD9A8;
}
.ask-msg--typing .ask-msg__bubble::after {
  content: "•••";
  letter-spacing: 4px;
  opacity: 0.6;
  animation: askTypingBlink 1.2s infinite;
}
@keyframes askTypingBlink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.ask-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 24px 12px;
}
.ask-suggest.is-hidden {
  display: none;
}
.ask-chip {
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: white;
  color: var(--blue-ink, #1C2F56);
  border: 1px solid rgba(15, 30, 61, 0.16);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.ask-chip:hover {
  background: rgba(15, 30, 61, 0.04);
  border-color: var(--blue-deep, #0F1E3D);
}

.ask-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 24px;
  border-top: 1px solid rgba(15, 30, 61, 0.10);
  background: white;
}
.ask-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(15, 30, 61, 0.18);
  border-radius: 999px;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.95rem;
  color: var(--ink, #0F1E3D);
  background: white;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ask-input:focus {
  border-color: var(--blue-deep, #0F1E3D);
  box-shadow: 0 0 0 3px rgba(15, 30, 61, 0.10);
}
.ask-send {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--rainbow, linear-gradient(90deg, #2B84D4, #5FB63F, #F5B220, #F1782B, #E2372A));
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.ask-send:hover {
  transform: scale(1.05);
}
.ask-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ask-foot {
  padding: 8px 24px 16px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--ink-soft, #42506E);
  background: white;
  text-align: center;
}
.ask-foot a {
  color: var(--blue-deep, #0F1E3D);
}

.ask-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 8999;
}
.ask-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 520px) {
  .ask-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(20px);
    width: 100%;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
  }
  .ask-panel.is-open {
    transform: translateY(0);
  }
}
