@import url("assistant-artifacts.css");

:root {
  --chat-text: rgba(255, 255, 255, 0.95);
  --chat-text-muted: rgba(255, 255, 255, 0.65);
  --chat-placeholder: rgba(255, 255, 255, 0.6);
  --chat-border: var(--glass-strong);
  --chat-sep: var(--glass);
  --chat-panel-bg: rgba(22, 24, 34, 0.78);
  --chat-panel-glow: rgba(12, 14, 24, 0.65);
  --chat-bubble-ai: rgba(255, 255, 255, 0.14);
  --chat-bubble-user: rgba(126, 184, 255, 0.22);
  --chat-input-bg: var(--glass);
  --chat-stream-glow: rgba(126, 184, 255, 0.78);
  --chat-complete-glow: rgba(127, 209, 174, 0.58);

  --chat-orb-idle-from: #8b5cf6;
  --chat-orb-idle-to: #3b82f6;
  --chat-orb-thinking-from: #22d3ee;
  --chat-orb-thinking-to: #2563eb;
  --chat-orb-done-from: #34d399;
  --chat-orb-done-to: #22c55e;
  --chat-c-definition: #7ea8d4;
  --chat-c-concept: #8bc4a0;
  --chat-c-comparison: #a0b8d4;
  --chat-c-formula: #c4a08b;
  --chat-c-visual: #8db7d6;
  --assistant-font-serif: "Playfair Display", serif;
  --assistant-font-prose: "Cormorant Garamond", serif;
  --assistant-font-sans: "Montserrat", sans-serif;
  --assistant-card-text-main: var(--chat-text);
  --assistant-card-text-muted: var(--chat-text-muted);
  --assistant-card-text-ghost: rgba(255, 255, 255, 0.36);
  --assistant-card-border: var(--chat-border);
  --assistant-card-border-subtle: var(--chat-border);
  --assistant-card-border-hover: rgba(255, 255, 255, 0.2);
  --assistant-card-label-color: rgba(255, 255, 255, 0.72);
  --assistant-card-label-gap: 0.4rem;
  --assistant-card-label-margin-bottom: 0.42rem;
  --assistant-card-padding: 0.82rem 0.92rem;
  --assistant-card-padding-inline: 0.92rem;
  --assistant-card-margin-bottom: 10px;
  --assistant-card-summary-color: #b0c4d4;
  --assistant-card-warning-color: #d4b87e;
  --assistant-card-connection-color: #d4a07e;
  --assistant-card-email-color: #7eb8ff;
  --assistant-card-calendar-color: #e8b87a;
  --assistant-card-action-color: #d47e8b;
  --assistant-card-definition-color: var(--chat-c-definition);
  --assistant-card-concept-color: var(--chat-c-concept);
  --assistant-card-comparison-color: var(--chat-c-comparison);
  --assistant-card-formula-color: var(--chat-c-formula);
  --assistant-card-visual-color: var(--chat-c-visual);
  --assistant-summary-body-line-height: 1.45;
  --assistant-summary-points-margin-top: 0.38rem;
  --assistant-summary-points-gap: 0.22rem;
  --assistant-summary-point-size: 0.92rem;
  --assistant-summary-point-line-height: 1.34;
  --assistant-summary-point-indent: 0.78rem;
  --assistant-warning-body-line-height: 1.4;
  --assistant-connection-gap: 0.72rem;
  --assistant-connection-icon-size: 26px;
  --assistant-connection-title-gap: 0.12rem;
  --assistant-connection-body-line-height: 1.36;
  --assistant-connection-link-margin-top: 0.3rem;
  --assistant-explain-title-size: 0.98rem;
  --assistant-explain-title-line-height: 1.35;
  --assistant-explain-body-margin-top: 0.18rem;
  --assistant-explain-body-size: 0.9rem;
  --assistant-explain-body-line-height: 1.4;
  --assistant-explain-points-gap: 0.26rem;
  --assistant-explain-points-margin-top: 0.46rem;
  --assistant-explain-point-indent: 0.8rem;
  --assistant-explain-point-size: 0.88rem;
  --assistant-explain-point-line-height: 1.36;
  --assistant-comparison-gap: 0.72rem;
  --assistant-comparison-heading-size: 0.94rem;
  --assistant-comparison-heading-margin-bottom: 0.3rem;
  --assistant-comparison-heading-padding-bottom: 0.22rem;
  --assistant-comparison-item-size: 0.84rem;
  --assistant-comparison-item-line-height: 1.36;
  --assistant-comparison-item-padding: 0.18rem 0;
  --assistant-formula-size: 1.24rem;
  --assistant-formula-line-height: 1.38;
  --assistant-formula-padding: 0.36rem 0.68rem;
  --assistant-formula-bg: var(--glass);
  --assistant-formula-caption-margin-top: 0.4rem;
  --assistant-formula-caption-size: 0.88rem;
  --assistant-formula-caption-line-height: 1.4;
  --assistant-visual-columns: 1.05fr 0.95fr;
  --assistant-visual-gap: 0.76rem;
  --assistant-visual-title-size: 0.96rem;
  --assistant-visual-title-margin-bottom: 0.24rem;
  --assistant-visual-copy-size: 0.88rem;
  --assistant-visual-copy-line-height: 1.42;
  --assistant-visual-panel-bg: var(--glass);
  --assistant-visual-panel-padding: 0.56rem;
  --assistant-swatch-gap: 0.68rem;
  --assistant-swatch-title-size: 0.86rem;
  --assistant-swatch-title-margin-bottom: 0.32rem;
  --assistant-swatch-row-margin-bottom: 0.32rem;
  --assistant-swatch-size: 24px;
  --assistant-swatch-note-size: 0.8rem;
  --assistant-swatch-note-line-height: 1.34;
  --assistant-email-stack-gap: 0.34rem;
  --assistant-email-item-gap: 0.56rem;
  --assistant-email-item-padding: 0.46rem 0.62rem;
  --assistant-email-item-bg: var(--glass);
  --assistant-email-detail-bg: var(--glass);
  --assistant-timeline-gap: 0.72rem;
  --assistant-timeline-item-padding: 0.28rem 0;
  --assistant-timeline-line-top: 10px;
  --assistant-timeline-line-bottom: 10px;
  --assistant-timeline-time-size: 0.64rem;
  --assistant-timeline-dot-top: 0.5rem;
  --assistant-timeline-body-padding-left: 0.56rem;
  --assistant-timeline-title-size: 0.88rem;
  --assistant-timeline-detail-size: 0.82rem;
  --assistant-timeline-tag-size: 0.5rem;
  --assistant-timeline-now-padding: 0.28rem 0;
  --assistant-action-body-line-height: 1.4;
  --assistant-action-body-margin-bottom: 0.5rem;
  --assistant-action-buttons-gap: 0.36rem;
  --assistant-action-button-padding: 0.34rem 0.72rem;
}

[data-theme="light"] {
  --chat-text: rgba(17, 24, 39, 0.95);
  --chat-text-muted: rgba(55, 65, 81, 0.82);
  --chat-placeholder: rgba(55, 65, 81, 0.65);
  --chat-border: rgba(15, 23, 42, 0.16);
  --chat-sep: rgba(15, 23, 42, 0.1);
  --chat-panel-bg: rgba(255, 255, 255, 0.92);
  --chat-panel-glow: rgba(15, 23, 42, 0.18);
  --chat-bubble-ai: rgba(15, 23, 42, 0.06);
  --chat-bubble-user: rgba(59, 130, 246, 0.18);
  --chat-input-bg: rgba(255, 255, 255, 0.74);
  --chat-stream-glow: rgba(59, 130, 246, 0.72);
  --chat-complete-glow: rgba(16, 185, 129, 0.45);
}

[data-theme="light"] .chatbot-button {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
  cursor: pointer;
  box-shadow: 0 0 30px rgba(184, 134, 11, 0.6);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  animation: chatbot-orb-breathe 4s ease-in-out infinite;
}

[data-theme="light"] .chatbot-button:focus-visible {
  outline-color: rgba(15, 23, 42, 0.5);
}

[data-theme="light"] .chatbot-button::before {
  background: rgba(255, 255, 255, 0.42);
}

[data-theme="light"] .chatbot-panel {
  pointer-events: none;
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: min(600px, 80vh);
  background: var(--bg-panel);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-heavy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100000;
}

[data-theme="light"] .chatbot-select {
  background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .chatbot-proactive-btn,
[data-theme="light"] .chatbot-source-open-all,
[data-theme="light"] .chatbot-source-link,
[data-theme="light"] .chatbot-source-attachment-link,
[data-theme="light"] .chatbot-suggestion-link,
[data-theme="light"] .chatbot-send {
  background: rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .chatbot-proactive-btn:hover,
[data-theme="light"] .chatbot-source-open-all:hover,
[data-theme="light"] .chatbot-source-link:hover,
[data-theme="light"] .chatbot-source-attachment-link:hover,
[data-theme="light"] .chatbot-suggestion-link:hover,
[data-theme="light"] .chatbot-send:hover {
  background: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .chatbot-send {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.34);
}

[data-theme="light"] .chatbot-jump-latest {
  background: rgba(255, 255, 255, 0.96);
}

[data-theme="light"] .chatbot-jump-latest:hover {
  background: rgba(245, 248, 255, 1);
}

[data-theme="light"] .chatbot-source-group-chip {
  background: rgba(15, 23, 42, 0.04);
}

.chatbot-shell {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99999;
  pointer-events: none;
}

.chatbot-shell-embedded {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.chatbot-shell-embedded .chatbot-button,
.chatbot-button.is-hidden {
  display: none !important;
}

.chatbot-shell-embedded .chatbot-panel {
  pointer-events: auto;
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: min(600px, 80vh);
  background: var(--bg-panel);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-heavy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100000;
}

.chatbot-shell-embedded .chatbot-header,
.chatbot-shell-embedded .chatbot-toolbar,
.chatbot-shell-embedded .chatbot-footer {
  background: var(--glass);
}

.chatbot-shell-embedded .chatbot-close-panel {
  display: none;
}

.chatbot-button {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
  cursor: pointer;
  box-shadow: 0 0 30px rgba(184, 134, 11, 0.6);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  animation: chatbot-orb-breathe 4s ease-in-out infinite;
}

.chatbot-button::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 12px;
  width: 26px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  filter: blur(0.6px);
}

.chatbot-button:hover {
  transform: scale(1.1);
  box-shadow: 0 0 45px rgba(139, 92, 246, 0.9);
}

.chatbot-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.82);
  outline-offset: 3px;
}

.chatbot-button.has-alert {
  border-color: rgba(127, 209, 174, 0.55);
  box-shadow:
    0 0 0 3px rgba(127, 209, 174, 0.2),
    0 0 34px rgba(127, 209, 174, 0.55);
  animation: chatbot-orb-alert 1.35s ease-in-out infinite;
}

.chatbot-button.is-thinking {
  background: radial-gradient(circle at 30% 30%, var(--chat-orb-thinking-from), var(--chat-orb-thinking-to));
  border-color: rgba(34, 211, 238, 0.62);
  box-shadow: 0 0 36px rgba(34, 211, 238, 0.68);
  animation: chatbot-orb-thinking 1s ease-in-out infinite;
}

.chatbot-button.is-done {
  background: radial-gradient(circle at 30% 30%, var(--chat-orb-done-from), var(--chat-orb-done-to));
  border-color: rgba(52, 211, 153, 0.62);
  box-shadow: 0 0 34px rgba(52, 211, 153, 0.64);
  animation: chatbot-orb-done 480ms ease-out 1;
}

@keyframes chatbot-orb-breathe {
  0% { box-shadow: 0 0 15px rgba(180, 140, 70, 0.4); filter: blur(1px); }
  100% { box-shadow: 0 0 25px rgba(180, 140, 70, 0.8); filter: blur(2px); }
}
  50% {
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.8);
  }
}

@keyframes chatbot-orb-alert {
  0% {
    box-shadow:
      0 0 0 0 rgba(127, 209, 174, 0.48),
      0 0 32px rgba(127, 209, 174, 0.52);
  }
  70% {
    box-shadow:
      0 0 0 8px rgba(127, 209, 174, 0),
      0 0 35px rgba(127, 209, 174, 0.58);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(127, 209, 174, 0),
      0 0 32px rgba(127, 209, 174, 0.52);
  }
}

@keyframes chatbot-orb-thinking {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 28px rgba(34, 211, 238, 0.55);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 44px rgba(34, 211, 238, 0.85);
  }
}

@keyframes chatbot-orb-done {
  0% {
    transform: scale(0.96);
    box-shadow: 0 0 16px rgba(52, 211, 153, 0.48);
  }
  70% {
    transform: scale(1.06);
    box-shadow: 0 0 40px rgba(52, 211, 153, 0.8);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 34px rgba(52, 211, 153, 0.64);
  }
}

.chatbot-orb-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.chatbot-panel {
  pointer-events: none;
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: min(600px, 80vh);
  background: var(--bg-panel);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-heavy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100000;
}

.chatbot-panel.is-open, .chatbot-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--chat-sep);
}

.chatbot-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.chatbot-title {
  color: var(--chat-text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.chatbot-close {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--chat-text-muted);
  cursor: pointer;
  font-size: 0.78rem;
}

.chatbot-close:hover {
  color: var(--chat-text);
}

.chatbot-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--chat-sep);
  opacity: 0.9;
}

.chatbot-select {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid var(--chat-border);
  background: var(--glass);
  color: var(--chat-text);
  font-size: 0.8rem;
  padding: 6px 8px;
}

.chatbot-select:focus {
  outline: 2px solid rgba(59, 130, 246, 0.58);
  outline-offset: 1px;
}

.chatbot-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  overflow-y: auto;
  font-size: 0.9rem;
  scroll-behavior: smooth;
}

.chatbot-message-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  width: 100%;
}

.chatbot-message {
  position: relative;
  max-width: 80%;
  align-self: flex-start;
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--chat-bubble-ai);
  border: 1px solid var(--chat-border);
  color: var(--chat-text);
  font-size: 0.86rem;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow: visible;
  animation: chatbot-pop 180ms ease-out;
  height: auto;
}

@keyframes chatbot-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chatbot-message.assistant.is-streaming::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 7px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, var(--chat-stream-glow) 50%, transparent 100%);
  animation: chatbot-stream-sweep 1.1s linear infinite;
  opacity: 0.94;
  pointer-events: none;
}

.chatbot-message.assistant.is-pending {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 10px;
  line-height: 1.2;
}

@keyframes chatbot-stream-sweep {
  from {
    transform: translateX(-42%);
  }
  to {
    transform: translateX(42%);
  }
}

.chatbot-message.assistant.is-complete {
  animation: chatbot-complete-pulse 700ms ease-out 1;
}

@keyframes chatbot-complete-pulse {
  0% {
    border-color: var(--chat-border);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
  35% {
    border-color: var(--chat-complete-glow);
    box-shadow: 0 0 0 2px var(--chat-complete-glow);
  }
  100% {
    border-color: var(--chat-border);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
}

.chatbot-message.user {
  align-self: flex-end;
  background: var(--chat-bubble-user);
}

.chatbot-message.assistant {
  align-self: flex-start;
}

.chatbot-message.is-compact {
  max-width: none;
  width: 100%;
  font-size: 0.82rem;
}

.chatbot-message-grid .chatbot-message {
  max-width: none;
  width: 100%;
}

.chatbot-message.chatbot-proactive {
  max-width: 92%;
}

.chatbot-message.assistant.has-sources,
.chatbot-message.assistant.has-suggestions {
  max-width: 94%;
}

.chatbot-message.assistant.has-cards {
  max-width: 94%;
  background: transparent;
  border: none;
  padding: 0;
}

.chatbot-response-summary {
  font-size: 0.82rem;
  line-height: 1.38;
  color: var(--chat-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.chatbot-response-details {
  margin-top: 8px;
  border-top: 1px solid var(--chat-sep);
  padding-top: 6px;
}

.chatbot-response-toggle {
  cursor: pointer;
  color: var(--chat-text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  user-select: none;
}

.chatbot-response-details[open] .chatbot-response-toggle {
  color: var(--chat-text);
}

.chatbot-response-body {
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.34;
  color: var(--chat-text-muted);
}

.chatbot-message.chatbot-proactive {
  border-color: rgba(127, 209, 174, 0.4);
  background: linear-gradient(180deg, rgba(127, 209, 174, 0.11), rgba(127, 209, 174, 0.05));
}

.chatbot-message.chatbot-proactive.is-urgent {
  border-color: rgba(255, 129, 129, 0.5);
  background: linear-gradient(180deg, rgba(255, 129, 129, 0.14), rgba(255, 129, 129, 0.06));
}

.chatbot-message.chatbot-proactive.is-dismissing {
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chatbot-proactive-title,
.chatbot-source-title,
.chatbot-suggestion-title {
  color: var(--chat-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chatbot-proactive-body,
.chatbot-proactive-note,
.chatbot-source-summary,
.chatbot-source-meta,
.chatbot-source-attachment-meta,
.chatbot-suggestion-meta,
.chatbot-muted {
  color: var(--chat-text-muted);
}

.chatbot-proactive-body,
.chatbot-source-summary,
.chatbot-suggestion-meta {
  font-size: 0.78rem;
  line-height: 1.35;
}

.chatbot-proactive-line + .chatbot-proactive-line {
  margin-top: 3px;
}

.chatbot-proactive-note,
.chatbot-muted,
.chatbot-source-meta,
.chatbot-source-attachment-meta {
  font-size: 0.72rem;
}

.chatbot-proactive-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chatbot-proactive-btn,
.chatbot-source-open-all,
.chatbot-source-link,
.chatbot-source-attachment-link,
.chatbot-suggestion-link,
.chatbot-send {
  border-radius: 10px;
  border: 1px solid var(--chat-border);
  background: var(--glass-strong);
  color: var(--chat-text);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.chatbot-proactive-btn {
  padding: 5px 8px;
  font-size: 0.72rem;
}

.chatbot-proactive-btn:hover,
.chatbot-source-open-all:hover,
.chatbot-source-link:hover,
.chatbot-source-attachment-link:hover,
.chatbot-suggestion-link:hover,
.chatbot-send:hover {
  background: rgba(255, 255, 255, 0.18);
}

.chatbot-proactive-btn.ghost {
  background: var(--glass);
}

.chatbot-proactive-btn.warn {
  border-color: rgba(255, 129, 129, 0.42);
  background: rgba(255, 129, 129, 0.16);
}

.chatbot-proactive-btn.warn:hover {
  background: rgba(255, 129, 129, 0.22);
}

.chatbot-proactive-btn:disabled {
  opacity: 0.72;
  cursor: default;
}

.chatbot-source-group-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--chat-border);
  background: var(--glass-strong);
  color: var(--chat-text);
  font-size: 0.7rem;
  padding: 3px 8px;
}

.chatbot-source-list,
.chatbot-suggestion-list {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--chat-sep);
}

.chatbot-source-groups,
.chatbot-source-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chatbot-source-item + .chatbot-source-item,
.chatbot-suggestion-item + .chatbot-suggestion-item {
  margin-top: 6px;
}

.chatbot-source-image-preview {
  margin-top: 8px;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--chat-border);
  background: var(--glass);
  cursor: pointer;
}

.chatbot-source-image-preview:hover {
  border-color: rgba(126, 184, 255, 0.42);
}

.chatbot-source-open-all,
.chatbot-source-link,
.chatbot-source-attachment-link,
.chatbot-suggestion-link {
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  font-size: 0.74rem;
  line-height: 1.3;
}

.chatbot-footer {
  border-top: 1px solid var(--chat-sep);
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--chat-input-bg);
}

.chatbot-jump-latest {
  position: absolute;
  right: 12px;
  bottom: 62px;
  z-index: 2;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  border-radius: 999px;
  border: 1px solid var(--chat-border);
  background: rgba(20, 28, 42, 0.86);
  color: var(--chat-text);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  transition: opacity 0.22s ease, transform 0.22s ease, background 0.2s ease;
}

.chatbot-jump-latest.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.chatbot-jump-latest:hover {
  background: rgba(20, 28, 42, 0.95);
}

.chatbot-input {
  flex: 1;
  min-height: 34px;
  max-height: 120px;
  border: 0;
  resize: none;
  border-radius: 12px;
  background: transparent;
  color: var(--chat-text);
  padding: 8px 10px;
  font-size: 0.82rem;
  line-height: 1.3;
}

.chatbot-input::placeholder {
  color: var(--chat-placeholder);
}

.chatbot-input:focus {
  outline: none;
}

.chatbot-send {
  padding: 0 16px;
  min-height: 36px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(126, 184, 255, 0.22);
  border-color: rgba(126, 184, 255, 0.4);
}

@media (max-width: 640px) {
  :root {
    --assistant-card-padding-mobile: 0.74rem 0.8rem;
    --assistant-card-padding-inline-mobile: 0.8rem;
    --assistant-card-margin-bottom-mobile: 0.74rem;
    --assistant-card-label-size-mobile: 0.58rem;
  }

  .chatbot-shell {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99999;
  pointer-events: none;
}

  .chatbot-shell-embedded {
    right: auto;
    bottom: auto;
    width: 100%;
  }

  .chatbot-shell-embedded .chatbot-panel {
  pointer-events: auto;
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: min(600px, 80vh);
  background: var(--bg-panel);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-heavy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100000;
}

  .chatbot-button {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
  cursor: pointer;
  box-shadow: 0 0 30px rgba(184, 134, 11, 0.6);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  animation: chatbot-orb-breathe 4s ease-in-out infinite;
}

  .chatbot-panel {
  pointer-events: auto;
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: min(600px, 80vh);
  background: var(--bg-panel);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-heavy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100000;
}

  .chatbot-toolbar {
    gap: 6px;
    padding: 8px 10px;
  }

  .chatbot-body {
    gap: 8px;
    padding: 14px;
    font-size: 0.86rem;
  }

  .chatbot-message {
    max-width: 90%;
    padding: 9px 12px;
    font-size: 0.82rem;
    line-height: 1.38;
    animation-duration: 130ms;
    overflow: visible;
  }

  .chatbot-message.assistant.is-streaming::after {
    left: 8px;
    right: 8px;
    top: 6px;
    opacity: 0.78;
    animation-duration: 1.35s;
  }

  .chatbot-message.assistant.is-pending {
    min-height: 40px;
    padding-top: 12px;
    padding-bottom: 8px;
  }

  .chatbot-message.assistant.is-complete {
    animation-duration: 540ms;
  }

  .chatbot-message.assistant.has-cards .action-buttons,
  .chatbot-message.assistant.has-cards .connection-layout {
    gap: 0.34rem;
  }

  .chatbot-response-summary {
    font-size: 0.79rem;
  }

  .chatbot-response-toggle {
    font-size: 0.68rem;
  }

  .chatbot-response-body {
    font-size: 0.74rem;
  }

  .chatbot-jump-latest {
    right: 10px;
    bottom: 58px;
    font-size: 0.66rem;
    padding: 7px 10px;
  }

  .chatbot-footer {
    gap: 8px;
    padding: 8px 10px;
  }

  .chatbot-input {
    min-height: 32px;
    font-size: 0.8rem;
  }

  .chatbot-send {
    min-height: 34px;
    padding: 0 14px;
    font-size: 0.74rem;
  }

  .chatbot-close {
    font-size: 0.84rem;
  }
}
