/* ============================================================
   Ask Jaimin — Minimalist Editorial AI Portfolio Assistant
   Strict Left-Alignment, Generous Spacing, Consistent Typeface
   & Engaging Thinking Anticipation UX State.
   ============================================================ */

:root {
  --llm-drawer-width: 460px;
  --llm-font: 'Plus Jakarta Sans', 'Switzer', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --llm-font-mono: 'SF Mono', 'Menlo', monospace;
  --llm-bg: rgba(255, 255, 255, 0.98);
  --llm-bg-card: #f8f8f6;
  --llm-bg-card-hover: #f0f0ed;
  --llm-dark-base: #222426;
  --llm-dark-hover: #323539;
  --llm-text-primary: #212326;
  --llm-text-secondary: #5e6267;
  --llm-text-muted: #888c91;
  --llm-border: rgba(0, 0, 0, 0.07);
  --llm-border-subtle: rgba(0, 0, 0, 0.04);
  --llm-shadow: 0 24px 70px -15px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --llm-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Header Nav Button (Sleek Dark Pill) ---------- */
.llm-nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: var(--llm-dark-base);
  color: #ffffff;
  border: 1px solid var(--llm-dark-base);
  border-radius: 999px;
  font-family: var(--llm-font);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.2s var(--llm-ease);
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.llm-nav-trigger:hover {
  background: var(--llm-dark-hover);
  border-color: var(--llm-dark-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.llm-nav-trigger:active {
  transform: scale(0.97);
}

.llm-nav-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  position: relative;
  flex-shrink: 0;
}

.llm-nav-pulse-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid #10b981;
  animation: navPulseRing 2s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes navPulseRing {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.llm-nav-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: currentColor;
  display: flex;
}

/* ---------- Mobile Floating Circular Voice Button (FAB) ---------- */
.llm-mobile-fab {
  display: none;
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  z-index: 9999;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #141413;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 
    0 14px 34px -4px rgba(0, 0, 0, 0.38),
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.25);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.22s var(--llm-ease), box-shadow 0.22s var(--llm-ease);
}

.llm-mobile-fab:hover {
  transform: scale(1.06);
  box-shadow: 
    0 18px 40px -4px rgba(0, 0, 0, 0.45),
    0 0 20px 2px rgba(14, 165, 233, 0.3);
}

.llm-mobile-fab:active {
  transform: scale(0.92);
}

.llm-mobile-fab .llm-fab-pulse {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

@media (max-width: 768px) {
  .llm-nav-trigger {
    display: none !important;
  }
  .llm-mobile-fab {
    display: flex !important;
  }
}

/* ---------- Floating Selection Popover ("Ask Jaimin") ---------- */
.llm-selection-popover {
  position: fixed;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 11px;
  background: #141413;
  color: #ffffff;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--llm-font);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.18s var(--llm-ease), opacity 0.18s ease;
  user-select: none;
  animation: popoverFadeIn 0.2s var(--llm-ease);
}

.llm-selection-popover:hover {
  background: #222220;
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.llm-selection-popover:active {
  transform: scale(0.96);
}

.llm-selection-popover svg {
  width: 13px;
  height: 13px;
  stroke: #ffffff;
  stroke-width: 2.2;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(6px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Quote Context Banner in Drawer Footer ---------- */
.llm-quote-preview {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #f0f0ec;
  border-left: 2.5px solid var(--llm-dark-base);
  border-radius: 0 8px 8px 0;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: var(--llm-text-secondary);
}

.llm-quote-body {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  overflow: hidden;
}

.llm-quote-body svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: var(--llm-text-secondary);
  margin-top: 2px;
}

.llm-quote-text {
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.llm-dismiss-quote {
  background: none;
  border: none;
  color: var(--llm-text-muted);
  cursor: pointer;
  padding: 2px;
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
  flex-shrink: 0;
}

.llm-dismiss-quote:hover {
  color: var(--llm-text-primary);
}

/* ---------- Modal Backdrop ---------- */
.llm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 16, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--llm-ease);
}

.llm-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ---------- Slide-out Chat Drawer (Desktop) ---------- */
.llm-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--llm-drawer-width);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--llm-bg);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  border-left: 1px solid var(--llm-border);
  box-shadow: var(--llm-shadow);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
  font-family: var(--llm-font);
}

.llm-drawer.open {
  transform: translateX(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ---------- Drawer Header (Clean Flexbox Architecture) ---------- */
.llm-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--llm-border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
  position: relative;
  min-height: 58px;
  gap: 12px;
  box-sizing: border-box;
}

.llm-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.llm-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.llm-header-status-dot,
.llm-status-dot {
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  display: inline-block;
  flex-shrink: 0;
}

.llm-title {
  font-family: var(--llm-font);
  font-size: 14px;
  font-weight: 700;
  color: #171715;
  letter-spacing: -0.02em;
  margin: 0;
  white-space: nowrap;
}

.llm-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.llm-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.llm-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s ease;
}

.llm-action-btn svg {
  width: 15.5px;
  height: 15.5px;
  stroke: currentColor;
  stroke-width: 2;
  display: block;
}

.llm-action-btn:hover,
.llm-action-btn:active {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #111827;
}

/* ---------- Drawer Body (Conversation Stream) ---------- */
.llm-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

/* ---------- Welcome State Card (Strict Left-Aligned) ---------- */
.llm-welcome-card {
  padding: 20px 20px 18px;
  background: var(--llm-bg-card);
  border: 1px solid var(--llm-border-subtle);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  align-items: flex-start;
}

.llm-welcome-title {
  font-family: var(--llm-font);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--llm-text-primary);
  letter-spacing: -0.02em;
  margin: 0;
  text-align: left;
}

.llm-welcome-sub {
  font-size: 13px;
  line-height: 1.55;
  color: var(--llm-text-secondary);
  margin: 0;
  text-align: left;
}

.llm-chips-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--llm-text-muted);
  margin-top: 6px;
  text-align: left;
  align-self: flex-start;
}

.llm-chips-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.llm-starter-chip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: #ffffff;
  border: 1px solid var(--llm-border);
  border-radius: 11px;
  font-family: var(--llm-font);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--llm-text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s var(--llm-ease);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.llm-starter-chip span:first-child {
  text-align: left;
  flex: 1;
}

.llm-starter-chip:hover {
  background: var(--llm-dark-base);
  color: #ffffff;
  border-color: var(--llm-dark-base);
  transform: translateY(-1px);
}

.llm-starter-chip .chip-arrow {
  font-size: 12px;
  opacity: 0.4;
  margin-left: 8px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.llm-starter-chip:hover .chip-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* ---------- Chat Messages (Spacious & Crisp) ---------- */
.llm-msg-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.llm-msg-row.user {
  align-items: flex-end;
}

.llm-msg-row.assistant {
  align-items: flex-start;
}

.llm-quote-context-bubble {
  font-size: 11.5px;
  padding: 6px 12px;
  border-left: 2px solid #141413;
  background: rgba(20, 20, 19, 0.04);
  color: var(--llm-text-secondary);
  border-radius: 4px 8px 8px 4px;
  max-width: 85%;
  margin-bottom: 2px;
  font-style: italic;
  text-align: left;
}

.llm-msg-bubble {
  padding: 14px 17px;
  font-size: 13.5px;
  line-height: 1.62;
  letter-spacing: -0.01em;
  word-break: break-word;
  font-family: var(--llm-font);
}

.llm-msg-bubble.user {
  background: var(--llm-dark-base);
  color: #ffffff;
  border-radius: 14px;
  max-width: 85%;
  font-weight: 450;
  text-align: left;
}

.llm-msg-bubble.assistant,
.llm-msg-bubble-assistant {
  background: var(--llm-bg-card);
  color: var(--llm-text-primary);
  border-radius: 14px;
  border: 1px solid var(--llm-border-subtle);
  max-width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  text-align: left;
}

/* Rich Markdown Styling Inside Assistant */
.llm-msg-bubble.assistant p,
.llm-msg-bubble-assistant p {
  margin: 0 0 10px;
  text-align: left;
}
.llm-msg-bubble.assistant p:last-child,
.llm-msg-bubble-assistant p:last-child {
  margin-bottom: 0;
}

.llm-msg-bubble.assistant strong,
.llm-msg-bubble-assistant strong {
  font-weight: 700;
  color: #000000;
}

.llm-msg-bubble.assistant a,
.llm-msg-bubble-assistant a {
  color: #141413;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.llm-msg-bubble.assistant a:hover,
.llm-msg-bubble-assistant a:hover {
  opacity: 0.7;
}

.llm-msg-bubble.assistant ul, 
.llm-msg-bubble.assistant ol,
.llm-msg-bubble-assistant ul, 
.llm-msg-bubble-assistant ol {
  margin: 6px 0 10px;
  padding-left: 18px;
  text-align: left;
}

.llm-msg-bubble.assistant li,
.llm-msg-bubble-assistant li {
  margin-bottom: 4px;
}

/* ---------- Follow-up Chips (Strict Left-Aligned) ---------- */
.llm-followups-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  width: 100%;
}

.llm-followup-chip {
  width: 100%;
  padding: 10px 13px;
  background: #ffffff;
  border: 1px solid var(--llm-border);
  border-radius: 10px;
  font-family: var(--llm-font);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--llm-text-secondary);
  cursor: pointer;
  transition: all 0.16s var(--llm-ease);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.llm-followup-chip::after {
  content: '→';
  font-size: 12px;
  opacity: 0.45;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.llm-followup-chip:hover {
  background: var(--llm-dark-base);
  color: #ffffff;
  border-color: var(--llm-dark-base);
  transform: translateY(-1px);
}

.llm-followup-chip:hover::after {
  opacity: 1;
  transform: translateX(2px);
}

/* ---------- Claude & Gemini-style Integrated Thinking Bar ---------- */
.llm-thought-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  background: rgba(20, 20, 19, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  margin-bottom: 10px;
  font-family: var(--llm-font);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--llm-text-secondary);
  transition: all 0.25s var(--llm-ease);
  width: fit-content;
  user-select: none;
}

.llm-thought-pill.streaming {
  opacity: 0.75;
  margin-bottom: 8px;
  transform: scale(0.96);
  transform-origin: left center;
}

.llm-thought-sparkle {
  font-size: 11px;
  color: #141413;
  display: inline-block;
  animation: llmSparklePulse 1.8s ease-in-out infinite;
}

@keyframes llmSparklePulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.25) rotate(90deg); opacity: 1; }
}

.llm-thought-text {
  background: linear-gradient(90deg, #60605a 0%, #141413 50%, #60605a 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: llmTextShimmer 2.2s linear infinite;
  letter-spacing: -0.01em;
}

@keyframes llmTextShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Ambient Skeleton Loading Wave (before first token) */
.llm-ambient-shimmer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 4px 0 6px;
  animation: llmFadeIn 0.2s ease;
}

.llm-shimmer-row {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.04) 75%);
  background-size: 200% 100%;
  animation: llmWaveShimmer 1.5s infinite;
}

.llm-shimmer-row.w-95 { width: 95%; }
.llm-shimmer-row.w-80 { width: 80%; }
.llm-shimmer-row.w-60 { width: 60%; }

@keyframes llmWaveShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Streaming Typing Cursor */
.llm-cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: #141413;
  margin-left: 3px;
  vertical-align: -2px;
  animation: llmCursorBlink 0.8s infinite;
}

@keyframes llmCursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---------- Drawer Footer & Input Shell ---------- */
.llm-footer {
  padding: 16px 22px 20px;
  border-top: 1px solid var(--llm-border);
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.llm-input-context-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: var(--llm-bg-card);
  border: 1px solid var(--llm-border);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--llm-text-secondary);
}

.llm-input-context-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
  font-style: italic;
}

.llm-dismiss-context {
  background: none;
  border: none;
  color: var(--llm-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 11px;
}

.llm-dismiss-context:hover {
  color: #141413;
}

.llm-input-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 26px;
  padding: 5px 8px 5px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  width: 100%;
}

.llm-input-shell:focus-within {
  border-color: var(--llm-dark-base);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.06);
}

.llm-textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 22px;
  min-height: 22px;
  max-height: 120px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-family: var(--llm-font);
  font-size: 13.5px;
  color: var(--llm-text-primary);
  resize: none !important;
  padding: 1px 0 0 0;
  margin: 0;
  line-height: 20px;
  display: block;
  -webkit-appearance: none;
  appearance: none;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.llm-textarea::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.llm-textarea:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.llm-textarea::placeholder {
  color: var(--llm-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.llm-input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.llm-mic-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--llm-text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s var(--llm-ease);
}

.llm-mic-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--llm-dark-base);
}

.llm-mic-btn.listening {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
  animation: micListeningPulse 1.2s infinite ease-in-out;
}

@keyframes micListeningPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.llm-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--llm-dark-base);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s var(--llm-ease);
}

.llm-send-btn:not(:disabled):hover {
  background: var(--llm-dark-hover);
  transform: scale(1.05);
}

.llm-send-btn:disabled {
  background: #eaeae6;
  color: #a8a8a0;
  cursor: not-allowed;
}

/* ---------- Futuristic Voice AI Mode & Shaders ---------- */
.llm-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #f1f1ee;
  padding: 3.5px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.llm-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-family: var(--llm-font);
  font-size: 12.5px;
  font-weight: 550;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s var(--llm-ease);
  user-select: none;
}

.llm-mode-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  display: block;
}

.llm-mode-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  font-weight: 600;
}

/* Voice Mode Footer Suppression */
.llm-drawer.mode-voice .llm-footer {
  display: none !important;
}

/* Voice Screen & Seamless Chromatic Fluid Interface (No nested card-in-card) */
.llm-voice-screen {
  display: none;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 20px;
  height: 100%;
  flex: 1;
  text-align: center;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
  animation: fadeIn 0.3s var(--llm-ease);
}

.llm-voice-screen.active {
  display: flex;
}

.llm-chat-screen {
  display: none;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.llm-chat-screen.active {
  display: flex;
}

/* Central Chromatic Fluid Orb Container (Matches Reference Images 2 & 3) */
.llm-voice-orb-wrap {
  position: relative;
  width: 190px;
  height: 190px;
  margin: 10px auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 
    0 24px 50px -10px rgba(14, 165, 233, 0.35),
    0 12px 25px -5px rgba(99, 102, 241, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.8),
    inset 0 -2px 6px rgba(0, 0, 0, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  background: #0e1118;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: transform 0.3s var(--llm-ease), box-shadow 0.3s var(--llm-ease);
}

.llm-voice-orb-wrap:hover {
  transform: scale(1.03);
  box-shadow: 
    0 28px 60px -8px rgba(14, 165, 233, 0.45),
    0 16px 30px -4px rgba(99, 102, 241, 0.32),
    inset 0 2px 4px rgba(255, 255, 255, 0.9);
}

.llm-voice-orb-wrap:active {
  transform: scale(0.97);
}

/* Dynamic State Auras for Immediate Visual Feedback */
.llm-voice-screen.listening .llm-voice-orb-wrap {
  animation: orbListeningAura 2s infinite ease-in-out;
}

@keyframes orbListeningAura {
  0%, 100% {
    box-shadow: 
      0 24px 50px -10px rgba(16, 185, 129, 0.45),
      0 0 0 0 rgba(16, 185, 129, 0.35),
      inset 0 2px 4px rgba(255, 255, 255, 0.8);
  }
  50% {
    box-shadow: 
      0 30px 65px -6px rgba(16, 185, 129, 0.55),
      0 0 0 14px rgba(16, 185, 129, 0),
      inset 0 2px 4px rgba(255, 255, 255, 0.95);
  }
}

.llm-voice-screen.speaking .llm-voice-orb-wrap {
  animation: orbSpeakingAura 1.5s infinite ease-in-out;
}

@keyframes orbSpeakingAura {
  0%, 100% {
    box-shadow: 
      0 26px 55px -8px rgba(14, 165, 233, 0.45),
      0 14px 28px -4px rgba(99, 102, 241, 0.35),
      inset 0 2px 4px rgba(255, 255, 255, 0.8);
  }
  50% {
    box-shadow: 
      0 32px 70px -5px rgba(14, 165, 233, 0.6),
      0 18px 36px -2px rgba(236, 72, 153, 0.4),
      inset 0 2px 4px rgba(255, 255, 255, 0.95);
  }
}

#llm-shader-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

/* Clear VUI State Directive Pill (Answers "Is it listening?" instantly) */
.llm-voice-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 999px;
  margin: 10px auto 4px;
  transition: all 0.25s var(--llm-ease);
  user-select: none;
  cursor: pointer;
}

.llm-voice-status-pill:hover {
  background: rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

.llm-voice-status-pill .llm-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
  display: inline-block;
  transition: all 0.25s ease;
}

.llm-voice-screen.listening .llm-voice-status-pill .llm-status-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: dotPulse 1.2s infinite;
}

.llm-voice-screen.thinking .llm-voice-status-pill .llm-status-dot {
  background: #6366f1;
  box-shadow: 0 0 8px #6366f1;
  animation: dotPulse 0.8s infinite;
}

.llm-voice-screen.speaking .llm-voice-status-pill .llm-status-dot {
  background: #0ea5e9;
  box-shadow: 0 0 8px #0ea5e9;
  animation: dotPulse 0.6s infinite;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

.llm-status-text {
  font-family: var(--llm-font);
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  letter-spacing: -0.01em;
}

.llm-voice-screen.listening .llm-status-text {
  color: #065f46;
}

.llm-voice-screen.speaking .llm-status-text {
  color: #0369a1;
}

/* Centered Live Editorial Subtitles (Matches Reference Image 1) */
.llm-voice-subtitles {
  width: 100%;
  max-width: 320px;
  margin: 6px auto 14px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.llm-subtitles-text {
  font-family: var(--llm-font);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.45;
  color: #1f2937;
  margin: 0;
  transition: all 0.2s ease;
}

/* Subtle Horizontal Topic Quick Chips */
.llm-voice-quick-chips {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  margin: 8px auto 0;
}

.llm-voice-chip {
  padding: 8px 16px;
  min-height: 38px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 999px;
  font-family: var(--llm-font);
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.2s var(--llm-ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.llm-voice-chip:hover {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #111827;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.llm-voice-chip:active {
  transform: scale(0.97);
}

/* ---------- Responsive & Touch Screen Adaptations ---------- */
@media (max-width: 768px) {
  .llm-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-top: none;
    background: #ffffff;
    transform: translateY(100%);
    box-shadow: none;
    z-index: 999999;
    overscroll-behavior: contain;
  }

  .llm-drawer.open {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .llm-mobile-handle {
    display: none;
  }

  .llm-header {
    padding: 12px 16px;
    min-height: 52px;
    box-sizing: border-box;
    width: 100%;
  }

  .llm-header-left {
    gap: 6px;
    flex-shrink: 0;
  }

  .llm-title {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
  }

  .llm-header-right {
    gap: 6px;
  }

  .llm-mode-switch {
    padding: 3px;
    gap: 2px;
  }

  .llm-mode-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 550;
    gap: 4px;
  }

  .llm-mode-btn svg {
    width: 12px;
    height: 12px;
  }

  .llm-header-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
  }

  .llm-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .llm-action-btn svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
  }

  .llm-body {
    padding: 16px 16px;
    -webkit-overflow-scrolling: touch;
  }

  .llm-welcome-card {
    padding: 18px 16px;
    border-radius: 12px;
  }

  .llm-welcome-title {
    font-size: 15px;
  }

  .llm-welcome-sub {
    font-size: 12.5px;
  }

  .llm-starter-chip {
    padding: 10px 12px;
    font-size: 12.5px;
  }

  .llm-msg-bubble {
    padding: 12px 15px;
    font-size: 13.5px;
  }

  .llm-msg-bubble.user {
    max-width: 90%;
  }

  .llm-msg-bubble.assistant {
    max-width: 100%;
  }

  .llm-footer {
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .llm-voice-screen {
    padding: 10px 14px 18px;
    justify-content: center;
    gap: 10px;
  }

  .llm-voice-orb-wrap {
    width: 165px;
    height: 165px;
    margin: 4px auto 0;
  }

  .llm-voice-status-pill {
    margin: 6px auto 2px;
  }

  .llm-voice-subtitles {
    max-width: 290px;
    margin: 2px auto 8px;
    min-height: 40px;
  }

  .llm-subtitles-text {
    font-size: 13.5px;
  }
}

@media (max-width: 480px) {
  .llm-starter-chip span:first-child {
    font-size: 12px;
  }
}
