.chat-llm-floating {
  position: fixed;
  bottom: 20px;
  z-index: 99999;
}
.chat-llm-floating-right { right: 20px; }
.chat-llm-floating-left { left: 20px; }

.chat-llm-fab {
  width: 56px;
  height: 56px;
  border-radius: 70%;
  border: none;
  color: #fff;
  background: var(--chat-llm-accent, #6b4eff);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chat-llm-fab:hover {
  background: #7131d6;
}

.chat-llm-sheet {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: min(420px, calc(100% - 40px));
  max-height: 70vh;
  background: var(--chat-llm-bg-color, #fffbfe);
  color: var(--chat-llm-text-color, #1c1b1f);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
  overflow: hidden;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: all .18s ease;
}

.chat-llm-floating-left .chat-llm-sheet { left: 20px; right: auto; }

.chat-llm-sheet.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  height: 100%;
}

.chat-llm-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  /* background: var(--chat-llm-surface-color, #fff); */
  border-bottom: 0px;
}

/* Theme-specific header background for the floating sheet */
.chat-llm-sheet.light-theme { background: #fffbfe !important; color: #1c1b1f !important; }
.chat-llm-sheet.dark-theme { background: #0f0f13 !important; color: #f5f5f7 !important; }
.chat-llm-sheet.light-theme .chat-llm-sheet-header { background: #ffffff !important; color: #1c1b1f !important; }
.chat-llm-sheet.dark-theme .chat-llm-sheet-header { background: #0f0f13 !important; color: #f5f5f7 !important; }

/* Fallback: derive theme from inner container if sheet lacks theme classes */
.chat-llm-clean.dark-theme ~ .chat-llm-sheet .chat-llm-sheet-header,
.chat-llm-clean.dark-theme + .chat-llm-sheet .chat-llm-sheet-header,
.chat-llm-clean.dark-theme .chat-llm-sheet-header {
  background: #0f0f13 !important;
  color: #f5f5f7 !important;
}

.chat-llm-sheet-title { font-weight: 600; }

.chat-llm-sheet-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  box-shadow: none;
}

.chat-llm-sheet-close:hover {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  box-shadow: none;
}

.chat-llm-sheet-body {
  padding: 0;
}

.chat-llm-sheet-body > div {
  border-radius: 0;
}

.chat-llm-sheet .chat-llm-window {
  height: min(60vh, 520px);
}

/* Ensure floating chat content never overflows panel width */
.chat-llm-sheet .chat-llm-messages { max-width: 100%; overflow-x: hidden; }
.chat-llm-sheet .chat-llm-assistant table { width: 100% !important; table-layout: fixed; }
.chat-llm-sheet .chat-llm-assistant th,
.chat-llm-sheet .chat-llm-assistant td { word-break: break-word; }
.chat-llm-sheet .chat-llm-assistant pre,
.chat-llm-sheet .chat-llm-assistant code { white-space: pre-wrap; word-break: break-word; }

/* Hide inner header area inside floating panel; title already displayed in sheet header */
.chat-llm-sheet .chat-llm-header { display: none !important; }

/* Composer spacing to ensure visibility */
.chat-llm-sheet .chat-llm-input-container { padding-bottom: 20px; }

/* Markdown inside assistant bubbles */
.chat-llm-assistant code { background: rgba(0,0,0,0.06); padding: 0 4px; border-radius: 4px; }
.chat-llm-assistant pre { background: rgba(0,0,0,0.06); padding: 12px; border-radius: 8px; overflow:auto; }
.chat-llm-assistant pre code { background: transparent; padding: 0; }
.chat-llm-assistant a { color: var(--chat-llm-primary-color); text-decoration: none; }
.chat-llm-assistant a:hover { text-decoration: underline; }

/* Light/Dark theme parity with existing chat */
.chat-llm-clean.light-theme {
  --chat-llm-surface: #faf6ff;
  --chat-llm-on-surface: #111;
  --chat-llm-surface-variant: #f0ecf8;
}
.chat-llm-clean.dark-theme {
  --chat-llm-surface: #0f0f13;
  --chat-llm-on-surface: #f5f5f7;
  --chat-llm-surface-variant: #16161b;
}

/* Admin: field widths inside our pages */
.chat-llm-admin #chat-llm-fa-color {
  width: 120px;
}
.chat-llm-admin .md3-feature .label {
  max-width: 600px;
}


