html,
body {
  margin: 0;
  padding: 0;
  font-family: "Avenir Next", "Avenir", "Segoe UI", sans-serif;
}

.chat-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(circle at 10% 10%, rgba(47, 102, 255, 0.24), transparent 44%),
    radial-gradient(circle at 88% 75%, rgba(236, 72, 153, 0.2), transparent 46%),
    linear-gradient(180deg, #05070d 0%, #060b16 100%);
}

.chat-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.5;
}

.glow {
  position: absolute;
  width: 42vw;
  height: 42vw;
  border-radius: 9999px;
  filter: blur(100px);
  opacity: 0.32;
}

.glow.glow-a {
  top: -10%;
  left: -12%;
  background: rgba(34, 211, 238, 0.35);
}

.glow.glow-b {
  bottom: -16%;
  right: -12%;
  background: rgba(244, 114, 182, 0.28);
}

.prompt-chip {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.9rem;
  background: rgba(19, 24, 37, 0.74);
  color: #d4d4d8;
  font-size: 0.85rem;
  line-height: 1.3rem;
  padding: 0.75rem 0.9rem;
  text-align: left;
  transition: 180ms ease;
}

.prompt-chip:hover {
  border-color: rgba(186, 230, 253, 0.45);
  background: rgba(17, 26, 43, 0.95);
  color: #ffffff;
}

.message-row {
  display: flex;
  width: 100%;
  animation: message-fade 220ms ease;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
}

.message-bubble {
  max-width: min(85%, 620px);
  border-radius: 1rem;
  padding: 0.75rem 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  font-size: 0.92rem;
}

.message-bubble.user {
  background: linear-gradient(135deg, #f4f4f5 0%, #d4d4d8 100%);
  color: #111827;
  border-bottom-right-radius: 0.3rem;
}

.message-bubble.assistant {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(9, 13, 22, 0.88);
  color: #f4f4f5;
  border-top-left-radius: 0.3rem;
}

.auth-btn,
.auth-input {
  width: 100%;
  border-radius: 0.9rem;
  font-size: 0.9rem;
}

.auth-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f5;
  font-weight: 600;
  padding: 0.72rem 0.9rem;
  transition: 160ms ease;
}

.auth-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-btn-secondary {
  font-weight: 500;
}

.auth-input {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(2, 6, 12, 0.7);
  color: #ffffff;
  padding: 0.7rem 0.85rem;
  outline: none;
}

.auth-input:focus {
  border-color: rgba(103, 232, 249, 0.65);
}

.auth-input::placeholder {
  color: #71717a;
}

@keyframes message-fade {
  from {
    transform: translateY(6px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .message-bubble {
    max-width: 92%;
  }

  .glow {
    width: 75vw;
    height: 75vw;
  }
}



@keyframes bounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-6px);
  }
}

.animate-bounce {
  animation: bounce 1.4s infinite ease-in-out both;
}


/* =========================
   LuvrBot Thinking Indicator
========================= */

.lb-typing-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
}

.lb-heart-spinner {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  isolation: isolate;
}

.lb-heart-spinner::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.2);
  border-top-color: #f472b6;
  border-right-color: #a78bfa;
  animation: lb-heart-spin 1s linear infinite;
  z-index: 1;
}

.lb-heart-spinner::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.2) 0%, transparent 68%);
  animation: lb-heart-glow 1.6s ease-in-out infinite;
  z-index: 0;
}

@keyframes lb-heart-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes lb-heart-glow {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.92);
  }

  50% {
    opacity: 0.9;
    transform: scale(1);
  }
}

.lb-heart-icon {
  position: relative;
  z-index: 2;
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.45));
}

.lb-typing-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.86);
  animation: lb-think-pulse 1.4s ease-in-out infinite;
}

@keyframes lb-think-pulse {

  0%,
  100% {
    opacity: 0.56;
  }

  50% {
    opacity: 1;
  }
}


/* =========================
   Typewriter Effect
========================= */

.lb-typewriter {
  white-space: pre-wrap;
  word-break: break-word;
}

.lb-typewriter.is-typing::after {
  content: "▍";
  margin-left: 1px;
  color: rgba(125, 211, 252, 0.9);
  animation: lb-caret 0.9s infinite;
}

.lb-assistant-message,
.lb-user-message {
  position: relative;
}

.lb-assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.lb-assistant-actions,
.lb-user-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.lb-assistant-message:hover .lb-assistant-actions,
.lb-assistant-message:focus-within .lb-assistant-actions,
.lb-user-message:hover .lb-user-actions,
.lb-user-message:focus-within .lb-user-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lb-assistant-action-btn {
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(255, 255, 255, 0.78);
  color: #0f172a;
  border-radius: 999px;
  min-height: 1.65rem;
  padding: 0.18rem 0.56rem;
  font-size: 0.7rem;
  line-height: 1;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.lb-assistant-action-btn:hover {
  border-color: rgba(56, 189, 248, 0.62);
  background: rgba(207, 250, 254, 0.9);
  transform: translateY(-1px);
}

.lb-assistant-action-btn:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.9);
  outline-offset: 1px;
}

.lb-assistant-action-btn.is-active {
  border-color: rgba(244, 114, 182, 0.72);
  color: #9d174d;
  background: rgba(253, 242, 248, 0.95);
}

.lb-assistant-action-btn.is-success {
  border-color: rgba(52, 211, 153, 0.75);
  color: #065f46;
  background: rgba(236, 253, 245, 0.95);
}

.dark .lb-assistant-action-btn {
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(15, 23, 42, 0.78);
  color: #e2e8f0;
}

.dark .lb-assistant-action-btn:hover {
  border-color: rgba(103, 232, 249, 0.66);
  background: rgba(8, 47, 73, 0.6);
  color: #f8fafc;
}

.dark .lb-assistant-action-btn.is-active {
  border-color: rgba(244, 114, 182, 0.7);
  background: rgba(131, 24, 67, 0.48);
  color: #fbcfe8;
}

.dark .lb-assistant-action-btn.is-success {
  border-color: rgba(52, 211, 153, 0.75);
  background: rgba(6, 78, 59, 0.48);
  color: #a7f3d0;
}

.lb-match-image-frame {
  position: relative;
}

.lb-sensitive-media-image {
  filter: blur(14px) saturate(0.66);
  transform: scale(1.04);
}

.lb-sensitive-media-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.4);
}

.lb-sensitive-text-wrap,
.lb-sensitive-media-wrap {
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: rgba(241, 245, 249, 0.72);
  border-radius: 0.9rem;
  padding: 0.7rem 0.75rem;
}

.lb-sensitive-text-mask {
  font-size: 0.82rem;
  color: #334155;
}

.lb-sensitive-caption {
  margin-top: 0.4rem;
  font-size: 0.74rem;
  color: #475569;
}

.lb-sensitive-actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.lb-sensitive-btn {
  border: 1px solid rgba(56, 189, 248, 0.54);
  background: rgba(224, 242, 254, 0.85);
  color: #0c4a6e;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.lb-sensitive-btn:hover {
  border-color: rgba(14, 165, 233, 0.65);
  background: rgba(186, 230, 253, 0.95);
}

.lb-sensitive-btn.is-ghost {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.84);
  color: #334155;
}

.lb-sensitive-btn.is-ghost:hover {
  background: rgba(248, 250, 252, 0.98);
}

.lb-sensitive-rejected {
  display: inline-flex;
  align-items: center;
  border: 1px dashed rgba(148, 163, 184, 0.46);
  background: rgba(248, 250, 252, 0.66);
  color: #475569;
  border-radius: 0.75rem;
  padding: 0.42rem 0.62rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.dark .lb-sensitive-text-wrap,
.dark .lb-sensitive-media-wrap {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.56);
}

.dark .lb-sensitive-caption,
.dark .lb-sensitive-text-mask {
  color: #cbd5e1;
}

.dark .lb-sensitive-btn {
  border-color: rgba(56, 189, 248, 0.56);
  background: rgba(2, 132, 199, 0.24);
  color: #bae6fd;
}

.dark .lb-sensitive-btn:hover {
  border-color: rgba(103, 232, 249, 0.75);
  background: rgba(8, 47, 73, 0.64);
  color: #e0f2fe;
}

.dark .lb-sensitive-btn.is-ghost {
  border-color: rgba(148, 163, 184, 0.42);
  background: rgba(30, 41, 59, 0.64);
  color: #cbd5e1;
}

.dark .lb-sensitive-btn.is-ghost:hover {
  background: rgba(51, 65, 85, 0.72);
}

.dark .lb-sensitive-rejected {
  border-color: rgba(148, 163, 184, 0.42);
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
}

.lb-match-image-safety-card {
  background:
    radial-gradient(120% 140% at 96% 10%, rgba(251, 113, 133, 0.17), rgba(251, 113, 133, 0) 60%),
    radial-gradient(120% 140% at 0% 100%, rgba(56, 189, 248, 0.14), rgba(56, 189, 248, 0) 58%),
    rgba(255, 248, 246, 0.96);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.lb-match-image-safety-aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 40% at 90% 0%, rgba(251, 113, 133, 0.2), rgba(251, 113, 133, 0) 66%),
    radial-gradient(44% 36% at 8% 92%, rgba(14, 165, 233, 0.16), rgba(14, 165, 233, 0) 66%);
}

.dark .lb-match-image-safety-card {
  background:
    radial-gradient(120% 140% at 96% 10%, rgba(251, 113, 133, 0.2), rgba(251, 113, 133, 0) 62%),
    radial-gradient(120% 140% at 0% 100%, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0) 60%),
    rgba(12, 16, 26, 0.95);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.62);
}

.lb-assistant-speech-progress {
  margin-top: -0.1rem;
  display: none;
  align-items: center;
  gap: 0.5rem;
  min-height: 0.95rem;
}

.lb-assistant-speech-progress.is-active {
  display: inline-flex;
}

.lb-assistant-speech-progress-track {
  position: relative;
  width: 108px;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.3);
}

.lb-assistant-speech-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.9), rgba(56, 189, 248, 0.95));
  transition: width 170ms linear;
}

.lb-assistant-speech-progress.is-indeterminate .lb-assistant-speech-progress-fill {
  animation: lb-assistant-progress-slide 1s ease-in-out infinite;
}

.lb-assistant-speech-progress-label {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: rgba(71, 85, 105, 0.95);
}

.dark .lb-assistant-speech-progress-track {
  background: rgba(71, 85, 105, 0.6);
}

.dark .lb-assistant-speech-progress-fill {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.85), rgba(125, 211, 252, 0.95));
}

.dark .lb-assistant-speech-progress-label {
  color: rgba(148, 163, 184, 0.96);
}

@keyframes lb-assistant-progress-slide {
  0% {
    transform: translateX(-60%);
  }
  100% {
    transform: translateX(260%);
  }
}

.lb-message-link {
  color: #60a5fa;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  word-break: break-word;
  transition: color 140ms ease, text-decoration-color 140ms ease;
}

.lb-message-link:hover {
  color: #3b82f6;
  text-decoration-color: rgba(59, 130, 246, 0.92);
}

.lb-link-previews {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.55rem;
  max-width: min(100%, 34rem);
}

.lb-link-preview-card {
  display: block;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.84));
  padding: 0.62rem 0.72rem;
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.dark .lb-link-preview-card {
  border-color: rgba(167, 139, 250, 0.34);
  background: linear-gradient(130deg, rgba(15, 23, 42, 0.9), rgba(30, 27, 75, 0.58));
  color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.32);
}

.lb-link-preview-card:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.55);
  box-shadow: 0 10px 28px rgba(56, 189, 248, 0.2);
}

.lb-link-preview-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.lb-link-preview-icon {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.lb-link-preview-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.3;
}

.lb-link-preview-domain {
  margin-top: 0.32rem;
  display: inline-block;
  font-size: 0.72rem;
  opacity: 0.78;
  letter-spacing: 0.01em;
}

.lb-first-visit-intro-card {
  backdrop-filter: blur(10px);
}

.lb-first-visit-intro-viewport {
  overflow: hidden;
}

.lb-first-visit-intro-track {
  display: flex;
  width: 100%;
  transform: translateX(0);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.lb-first-visit-intro-step {
  flex: 0 0 100%;
}

.lb-first-visit-intro-dot {
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
  transition: background-color 180ms ease, transform 180ms ease;
}

.lb-first-visit-intro-dot.is-active {
  background: linear-gradient(135deg, #ec4899, #7c3aed);
  transform: scale(1.1);
}

.lb-first-visit-highlight {
  position: relative;
  z-index: 95;
  border-radius: 1rem;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.9), 0 0 0 9999px rgba(2, 6, 23, 0.62);
  transition: box-shadow 170ms ease;
}

#sidebar-profile-btn.lb-first-visit-highlight,
#chat-web-btn.lb-first-visit-highlight,
#chat-mic-btn.lb-first-visit-highlight,
#message-input.lb-first-visit-highlight {
  border-radius: 999px;
}

#message-input.lb-first-visit-highlight {
  outline: 2px solid rgba(56, 189, 248, 0.98);
  outline-offset: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.dark #message-input.lb-first-visit-highlight {
  background: rgba(15, 23, 42, 0.44);
}

#welcome-first-impression.lb-first-visit-highlight,
#composer-shell.lb-first-visit-highlight {
  border-radius: 1.15rem;
}

.lb-first-visit-guide {
  position: fixed;
  z-index: 96;
  width: min(22rem, calc(100vw - 1.5rem));
  border-radius: 1rem;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(15, 23, 42, 0.96);
  color: #e2e8f0;
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.48);
  padding: 0.9rem 0.95rem;
  backdrop-filter: blur(8px);
}

.lb-first-visit-guide-progress {
  margin: 0 0 0.3rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.lb-first-visit-guide-title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
  font-weight: 750;
  color: #f8fafc;
}

.lb-first-visit-guide-description {
  margin: 0.52rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.92);
}

.lb-first-visit-guide-actions {
  margin-top: 0.82rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.lb-first-visit-guide-btn {
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  padding: 0.34rem 0.72rem;
  font-size: 0.73rem;
  font-weight: 700;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.lb-first-visit-guide-btn-secondary {
  background: transparent;
  color: #cbd5e1;
}

.lb-first-visit-guide-btn-secondary:hover {
  border-color: rgba(125, 211, 252, 0.58);
  color: #f8fafc;
}

.lb-first-visit-guide-btn-primary {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.95), rgba(56, 189, 248, 0.9));
  border-color: transparent;
  color: #0f172a;
}

.lb-first-visit-guide-btn-primary:hover {
  filter: brightness(1.06);
}

@keyframes lb-caret {

  0%,
  50%,
  100% {
    opacity: 1;
  }

  25%,
  75% {
    opacity: 0;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

  .lb-heart-spinner::before,
  .lb-heart-spinner::after,
  .lb-typing-label,
  .lb-typewriter.is-typing::after,
  .lb-assistant-speech-progress.is-indeterminate .lb-assistant-speech-progress-fill,
  .lb-first-visit-intro-track {
    animation: none;
    transition: none;
  }

  .lb-link-preview-card {
    transition: none;
  }

  .lb-first-visit-highlight {
    transition: none;
  }
}

@media (hover: none) {
  .lb-assistant-actions,
  .lb-user-actions {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}
