/* =========================================
   GLOSSY CHAT WIDGET (BUBBL + CHATBASE THEME)
   ========================================= */

#chat-widget-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  font-family: "Inter", sans-serif;
  pointer-events: none;
}

/* 2. THE CHAT POPUP WINDOW (glass box) */
#chat-window-popup {
  width: 380px;
  height: 580px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.hidden {
  opacity: 0;
  transform: scale(0.8) translateY(40px);
  pointer-events: none;
}

/* 3. HEADER AREA */
.chat-header {
  background: rgba(255, 255, 255, 0.3);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.chat-header-title {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #1a1a1a;
}

.chat-close-x {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: 0.2s;
}

.chat-close-x:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* 4. CHAT MESSAGES */
#chat-display {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.msg {
  max-width: 85%;
  padding: 14px 18px;
  font-size: 14.5px;
  line-height: 1.6;
  border-radius: 16px;
  font-weight: 500;
}

.bot {
  background: rgba(255, 255, 255, 0.7);
  color: #1a1a1a;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: visible;
}

/* --- Bot message formatted content (markdown rendering) --- */
.msg.bot p { margin: 0 0 8px 0; }
.msg.bot p:last-child { margin-bottom: 0; }
.msg.bot ul, .msg.bot ol { margin: 6px 0; padding-left: 20px; }
.msg.bot li { margin-bottom: 4px; line-height: 1.5; }
.msg.bot strong, .msg.bot b { font-weight: 700; }
.msg.bot em, .msg.bot i { font-style: italic; }
.msg.bot h1, .msg.bot h2, .msg.bot h3, .msg.bot h4 {
  font-weight: 700; margin: 10px 0 4px 0; line-height: 1.3;
}
.msg.bot h1 { font-size: 16px; }
.msg.bot h2 { font-size: 15px; }
.msg.bot h3 { font-size: 14.5px; }
.msg.bot code {
  background: rgba(0,0,0,0.06); padding: 2px 5px; border-radius: 4px;
  font-family: 'Courier New', monospace; font-size: 13px;
}
.msg.bot pre {
  background: rgba(0,0,0,0.05); padding: 10px 12px; border-radius: 8px;
  overflow-x: auto; margin: 8px 0; font-size: 12px;
}
.msg.bot pre code { background: none; padding: 0; }
.msg.bot table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 10px 0;
  font-size: 12.5px; border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.msg.bot table th, .msg.bot table td {
  border: none; border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 10px 12px; text-align: left; vertical-align: top;
  word-wrap: break-word; overflow-wrap: break-word;
  min-width: 70px; max-width: 140px;
}
.msg.bot table th {
  background: rgba(232,114,42,0.08); font-weight: 700; color: #1a1a1a;
  border-bottom: 2px solid rgba(232,114,42,0.2);
  position: sticky; top: 0; z-index: 1;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px;
}
.msg.bot table td {
  background: rgba(255,255,255,0.6);
}
.msg.bot table tr:nth-child(even) td { background: rgba(0,0,0,0.015); }
.msg.bot table tr:hover td { background: rgba(232,114,42,0.04); }
.msg.bot table tr:last-child td { border-bottom: none; }
.msg.bot hr { border: none; border-top: 1px solid rgba(0,0,0,0.08); margin: 10px 0; }
.msg.bot blockquote {
  border-left: 3px solid #E8722A; padding-left: 12px;
  margin: 8px 0; color: #555; font-style: italic;
}

.user {
  background: #000;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* 5. INPUT SECTION */
.chat-input-area {
  padding: 20px;
  background: rgba(255, 255, 255, 0.2);
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50px;
  padding: 5px 10px 5px 20px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-input-wrapper:focus-within {
  outline: 2px solid #b7531a;
  outline-offset: 2px;
}

#user-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 10px 0;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  color: #1a1a1a;
}

#voice-waveform:not([hidden]) {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 3px;
  height: 24px;
  margin-inline-end: 8px;
  color: #e8722a;
}
#voice-waveform i {
  width: 3px;
  height: 20px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleY(.23);
}
#voice-waveform i:nth-child(2), #voice-waveform i:nth-child(4) { height: 15px; }
#voice-waveform i:first-child, #voice-waveform i:last-child { height: 10px; }
@media (prefers-reduced-motion: reduce) {
  #voice-waveform i { transform: scaleY(.65) !important; }
}
#user-input[data-voice-busy] { cursor: progress; }

#voice-input-button {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: #51290f;
  background: #ffefe1;
  cursor: pointer;
  margin-right: 5px;
  vertical-align: middle;
}
#voice-input-button[aria-pressed="true"] { color: white; background: #a13b23; }
#voice-input-status { margin-top: 6px; font-size: .8rem; color: inherit; }

#send-btn-icon {
  flex-shrink: 0;
  background: #000;
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

#send-btn-icon:hover {
  transform: scale(1.05);
  background: #333;
}

/* 6. SPRITE + PILL CONTAINER
   Flexbox column: sprite on top, pill below. Auto-sized to content.
   Sprite is decorative (pointer-events:none) — never blocks page buttons. */
#sprite-ask-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  text-align: center;
  z-index: 1001;
  transform-origin: bottom center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1),
              right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1),
              transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1),
              opacity 0.3s ease;
}

#bot-sprite {
  width: 300px;
  height: 165px;
  background: url("/static/images/bubbl-mark-96.png") center / 48px 48px no-repeat;
  pointer-events: none;
  margin-bottom: -20px;
  /* CRISP: source image is 240000x330 (600px/frame). Browser DOWNSCALES it
     to 300px/frame for display, which is always sharp. No transform:scale
     (upscaling a small image is what caused the blur before). On retina/2x
     screens, 300 CSS px = 600 device px = 1:1 with the source = perfect. */
}

#sprite-ask-container.chat-open {
  bottom: 620px;
  right: 20px;
  transform: scale(0.45);
  transform-origin: bottom center;
  pointer-events: none;
  opacity: 1;
  display: flex !important;
}

#sprite-ask-container.chat-open #sprite-hit-area {
  display: none;
}

/* Medium desktops: slightly smaller sprite so it doesn't dominate */
@media screen and (min-width: 769px) and (max-width: 1200px) {
  #bot-sprite {
    width: 220px;
    height: 121px;
    background-size: 48px 48px;
  }
  #sprite-ask-container.chat-open {
    bottom: 580px;
    transform: scale(0.4);
  }
}

/* =========================================
   CHAT WIDGET INVISIBLE SHIELD FIX
   ========================================= */

/* Desktop: container is transparent to clicks (only children are clickable).
   Mobile: mobile_chat.css overrides this to pointer-events:auto. */
#chat-widget-container {
  pointer-events: none;
}

/* Clickable circle over the visible mascot — opens the chat.
   Small (120px) and centered on the mascot so it doesn't block page
   buttons elsewhere. This is the only clickable part of the sprite. */
#sprite-hit-area {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  pointer-events: auto !important;
  z-index: 3;
}

/* Container is pointer-events:none on DESKTOP so it never blocks page buttons.
   Only the hit-area over the sprite is clickable.
   On mobile, mobile_chat.css overrides this to pointer-events:auto. */
#sprite-ask-container {
  pointer-events: none;
}

/* Sprite is decorative on desktop — clicks pass through to page buttons behind it.
   On mobile, mobile_chat.css enables pointer-events for tapping. */
#bot-sprite {
  pointer-events: none;
}

#chat-window-popup {
  pointer-events: auto !important;
  will-change: opacity;
  transform-origin: center center;
}

#chat-window-popup.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(0.85) translateY(20px) !important;
}

/* When open, the popup is always perfectly upright — no rotation. */
#chat-window-popup:not(.hidden) {
  transform: none !important;
}
/* =========================================
   MOBILE RESPONSIVE TWEAKS (PHONES ONLY)
   =========================================
   NOTE: Primary mobile overrides live in mobile_chat.css (768px breakpoint).
   This section only covers small refinements for very narrow screens (<600px)
   that DON'T conflict with mobile_chat.css. Sprite positioning is handled
   entirely by mobile_chat.css to avoid duplication.
   ========================================= */
@media screen and (max-width: 600px) {
  /* Tighten up chat bubbles for mobile */
  .msg {
    max-width: 90%;
    font-size: 12px;
    padding: 8px 12px;
  }
}


/* =========================================
   INTERACTIVE BUTTONS — Categorized Pills
   ========================================= */

.bubbl-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: flex-start;
  max-width: 90%;
  padding: 2px 0;
}

.bubbl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
  border: none;
  white-space: nowrap;
  line-height: 1;
}

.bubbl-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.bubbl-btn:active {
  transform: scale(0.96);
}

.bubbl-btn-arrow {
  font-size: 11px;
  opacity: 0.8;
}

/* --- Inline Auto-Linked URLs/Emails in bot messages --- */
.bubbl-inline-link {
  color: #3b82f6;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
  transition: color 0.15s ease;
}
.bubbl-inline-link:hover {
  color: #1d4ed8;
}
.bubbl-inline-link:visited {
  color: #6d28d9;
}

/* --- Category Colors --- */

/* Pricing — Orange (brand) */
.bubbl-btn--pricing {
  background: #E8722A;
  color: #fff;
}

/* Action/CTA — Green */
.bubbl-btn--action {
  background: #10b981;
  color: #fff;
}

/* Info/Learn — Blue */
.bubbl-btn--info {
  background: #3b82f6;
  color: #fff;
}

/* Support/Contact — Purple */
.bubbl-btn--support {
  background: #8b5cf6;
  color: #fff;
}

/* External/General — Uses bot's theme color (not gray) */
.bubbl-btn--link {
  background: var(--theme-color, #E8722A);
  color: #fff;
  border: none;
}

.bubbl-btn--link:hover {
  filter: brightness(1.15);
}

/* --- Mobile Responsive --- */
@media screen and (max-width: 600px) {
  .bubbl-btn-row {
    gap: 6px;
    max-width: 95%;
  }

  .bubbl-btn {
    padding: 6px 11px;
    font-size: 11px;
  }

  /* Tables on mobile: tighter spacing */
  .msg.bot table th, .msg.bot table td {
    padding: 7px 8px;
    font-size: 11.5px;
    min-width: 55px;
    max-width: 110px;
  }
}


/* Email — Teal */
.bubbl-btn--email {
  background: #0d9488;
  color: #fff;
}

/* Phone — Indigo */
.bubbl-btn--phone {
  background: #4f46e5;
  color: #fff;
}


/* Powered by Bubbl — branding in chat widget */
.powered-by-bubbl {
  text-align: center;
  padding: 6px 0 2px;
  font-size: 10px;
}

.powered-by-bubbl a {
  color: #9ca3af;
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s;
}

.powered-by-bubbl a strong {
  font-weight: 700;
  color: #6b7280;
}

.powered-by-bubbl a:hover {
  color: #E8722A;
}

.powered-by-bubbl a:hover strong {
  color: #E8722A;
}



/* --- Bot Message Rating Buttons --- */
.msg-rating {
  padding: 0 4px;
}
.rate-btn {
  background: none;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
}
.rate-btn:hover {
  opacity: 1;
  transform: scale(1.15);
  border-color: rgba(0,0,0,0.2);
}
.rate-btn:disabled {
  cursor: default;
}



/* =========================================
   EDIT MESSAGE — Inline editing on user messages
   ========================================= */

.msg-user-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  align-self: flex-end;
  max-width: 85%;
  position: relative;
}

.msg-user-wrapper .msg.user {
  align-self: auto;
  max-width: 100%;
}

.msg-edit-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  color: #9ca3af;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  flex-shrink: 0;
}

.msg-user-wrapper:hover .msg-edit-btn {
  opacity: 0.7;
}

.msg-edit-btn:hover {
  opacity: 1 !important;
  color: #4b5563;
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

.msg-edit-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  align-self: flex-end;
}

.msg-edit-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.8);
  color: #1a1a1a;
  transition: border-color 0.2s;
}

.msg-edit-input:focus {
  border-color: var(--theme-color, #E8722A);
}

.msg-edit-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.msg-edit-save,
.msg-edit-cancel {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}

.msg-edit-save {
  background: #10b981;
  color: #fff;
}

.msg-edit-save:hover {
  transform: scale(1.1);
  background: #059669;
}

.msg-edit-cancel {
  background: rgba(0, 0, 0, 0.08);
  color: #6b7280;
}

.msg-edit-cancel:hover {
  transform: scale(1.1);
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}


/* =========================================
   SHARE CONVERSATION — Dropdown + Toast
   ========================================= */

.share-chat-btn,
.chat-header-icon-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s, transform 0.15s;
}

.chat-header-icon-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  transform: scale(1.05);
}

.chat-header-icon-btn:active {
  transform: scale(0.95);
}

.share-chat-btn:hover {
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.06);
  transform: scale(1.08);
}

.share-chat-btn:active {
  transform: scale(0.93);
}

/* --- Share Dropdown Menu --- */
.share-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 6px;
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.share-dropdown--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.share-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
  color: #1a1a1a;
}

.share-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.share-dropdown-item:active {
  background: rgba(0, 0, 0, 0.08);
  transform: scale(0.98);
}

.share-dropdown-item svg {
  flex-shrink: 0;
  color: #6b7280;
}

.share-dropdown-item:hover svg {
  color: var(--theme-color, #E8722A);
}

.share-dropdown-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.2;
}

.share-dropdown-desc {
  display: block;
  font-size: 10.5px;
  color: #9ca3af;
  font-weight: 400;
  margin-top: 1px;
}

/* --- Toast Notification (enhanced) --- */
.share-toast {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #1a1a1a;
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  z-index: 600;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  gap: 7px;
}

.share-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.share-toast--success { background: #065f46; }
.share-toast--error { background: #7f1d1d; }
.share-toast--loading { background: #1e3a5f; }

@keyframes share-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.share-toast-spin {
  animation: share-spin 1s linear infinite;
}

/* Mobile adjustments */
@media screen and (max-width: 600px) {
  .msg-user-wrapper {
    max-width: 90%;
  }

  .msg-edit-btn {
    opacity: 0.5; /* Always slightly visible on mobile (no hover) */
  }

  .msg-edit-input {
    font-size: 13px;
    padding: 8px 12px;
  }

  .share-dropdown {
    width: 190px;
    right: -20px;
  }

  .share-toast {
    font-size: 11px;
    padding: 7px 12px;
  }
}

.chat-training { margin:12px; padding:14px; color:#442d20; background:#fff3e5; border:1px solid #e4c7a9; border-radius:12px; }
.chat-training[hidden] { display:none; }
.chat-training p { margin:6px 0 8px; }
.chat-training progress { width:100%; accent-color:#993f18; }
#chat-training:not([hidden]) ~ #chat-display { opacity:.5; }
#chat-training:not([hidden]) ~ .chat-input-area { display:none; }
.rich-reply { align-self:flex-start; width:min(100%, 35rem); min-width:0; box-sizing:border-box; overflow-wrap:anywhere; padding:12px; margin:4px 0 8px; border-radius:var(--chat-bubble-radius,12px); background:var(--bot-bubble-bg,#f7f0e9); color:inherit; border:1px solid color-mix(in srgb,currentColor 20%,transparent); }
.rich-reply h3,.rich-reply caption { margin:0 0 8px; font-size:1.05em; text-align:left; font-weight:700; }
.rich-reply ol,.rich-reply dl { margin:0; }
.rich-reply ol { padding-inline-start:1.4em; }
.rich-reply li + li,.rich-reply dt:not(:first-child) { margin-top:8px; }
.rich-reply dt { font-weight:700; }
.rich-reply dd { margin:3px 0 0; }
.rich-reply p { margin:3px 0 0; }
.rich-reply details { border-top:1px solid color-mix(in srgb,currentColor 18%,transparent); padding:7px 0; }
.rich-reply summary { cursor:pointer; font-weight:650; }
.rich-reply-table { max-width:100%; overflow:auto; }
.rich-reply table { border-collapse:collapse; min-width:100%; }
.rich-reply th,.rich-reply td { text-align:start; vertical-align:top; padding:8px; border-bottom:1px solid color-mix(in srgb,currentColor 20%,transparent); }
.rich-reply summary:focus-visible,.rich-reply-table:focus-visible { outline:2px solid var(--theme-color,#9a3e0e); outline-offset:2px; }

.chat-header-avatar { flex: none; }
.chat-header-actions { flex: none; }
.chat-header-actions .chat-size-button,
.chat-header-actions .chat-feedback-button { display:inline-grid; place-items:center; padding:0; margin:0; background:transparent; }
.chat-header-actions [aria-pressed="true"] { background:color-mix(in srgb,currentColor 10%,transparent); }
.chat-size-button .size-exit, .chat-size-button[aria-pressed="true"] .size-enter { display:none; }
.chat-size-button[aria-pressed="true"] .size-exit { display:initial; }
.chat-size-button:focus-visible, .chat-feedback-button:focus-visible { outline:2px solid currentColor; outline-offset:-2px; }
#chat-window-popup[data-display-size="fullscreen"] [data-chat-size="expanded"] { display:none; }
#chat-window-popup[data-display-size="expanded"]:not(.hidden) {
  width:min(680px,calc(100vw - 44px));
  height:min(760px,calc(100dvh - 48px));
}
#chat-window-popup[data-display-size="fullscreen"]:not(.hidden) {
  position:fixed !important;
  top:var(--chat-full-top,0px) !important;
  left:var(--chat-full-left,0px) !important;
  right:auto !important;
  bottom:auto !important;
  width:var(--chat-full-width,100vw) !important;
  height:var(--chat-full-height,100dvh) !important;
  max-width:none !important;
  max-height:none !important;
  margin:0 !important;
  border-radius:0 !important;
  background: #fff8f1 !important;
  z-index:2147483647;
}
#chat-window-popup[data-display-size="fullscreen"][data-chat-theme="dark"]:not(.hidden) { background:#111827 !important; }
@media (max-width: 480px) {
  .chat-header-actions { gap:1px !important; }
  .chat-header-actions button { min-width:32px; }
  .chat-header-info .chat-header-avatar { margin-inline-end:3px; }
  .chat-header-title { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .chat-header-info > div:last-child { min-width:0; }
}

.chat-handoff-offer { align-self:flex-start; padding:12px; border:1px solid color-mix(in srgb,currentColor 24%,transparent); border-radius:12px; margin:6px 0; color:inherit; }
.chat-handoff-offer p { margin:0 0 8px; }
.chat-handoff-offer button { color:inherit; background:transparent; border:1px solid color-mix(in srgb,currentColor 36%,transparent); border-radius:8px; margin:3px 4px 0 0; padding:8px 10px; min-height:36px; cursor:pointer; }
.chat-handoff-offer button:first-of-type { font-weight:700; }
