/* ═══════════════════════════════════════════════════════════════════
   Luma Chat Widget — External Stylesheet
   Generated from luma-chat-core/src/lib/chat-widget.scss

   Include after luma-chat-widget.js. All rules are outside @layer,
   so they override widget defaults without !important.
   ═══════════════════════════════════════════════════════════════════ */
  luma-chat-widget {
    display: block;
    --lcw-z-index: 999;
    --lcw-bottom: 18px !important;
    --lcw-right: 24px;
    --lcw-panel-width: 500px;
    --lcw-panel-height: 600px;
    --lcw-panel-radius: 16px;
    --lcw-panel-bg: #ffffff;
    --lcw-panel-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    --lcw-header-bg: #f97316;
    --lcw-header-color: #ffffff;
    --lcw-header-height: 64px;
    --lcw-messages-bg: #f8f9fa;
    --lcw-ai-bubble-bg: #ffffff;
    --lcw-ai-bubble-color: #1a1a1a;
    --lcw-ai-bubble-border: 1px solid #e8e8e8;
    --lcw-user-bubble-bg: #f97316;
    --lcw-user-bubble-color: #ffffff;
    --lcw-status-error-bg: #fdecea;
    --lcw-status-error-color: #611a15;
    --lcw-status-warning-bg: #fffaeb;
    --lcw-status-warning-color: #5c4a00;
    --lcw-status-success-bg: #e8f5e9;
    --lcw-status-success-color: #1b5e20;
    --lcw-input-bg: #ffffff;
    --lcw-input-border: #e0e0e0;
    --lcw-input-color: #1a1a1a;
    --lcw-input-placeholder-color: #9e9e9e;
    --lcw-send-btn-bg: #f97316;
    --lcw-send-btn-color: #ffffff;
    --lcw-send-btn-disabled-bg: #e0e0e0;
    --lcw-send-btn-disabled-color: #9e9e9e;
    --lcw-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --lcw-font-size: 14px;
    --lcw-font-size-sm: 12px;
    --lcw-received-color: #61ae55;
    --lcw-error-color: #b71c1c;
    --lcw-sending-color: #9e9e9e;
  }
  @media (max-width: 440px) {
    luma-chat-widget {
      --lcw-panel-width: calc(100vw - 16px);
      --lcw-panel-height: calc(100vh - 90px);
      --lcw-bottom: 16px;
      --lcw-right: 8px;
    }
  }

  @keyframes lcw-wave {
    0% {
      background-position: 200% 0;
    }
    100% {
      background-position: -200% 0;
    }
  }
  .lcw {
    position: fixed;
    bottom: var(--lcw-bottom);
    right: var(--lcw-right);
    z-index: var(--lcw-z-index);
    font-family: var(--lcw-font-family);
    font-size: var(--lcw-font-size);
    color: var(--lcw-ai-bubble-color);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
  }
  .lcw-rtl {
    direction: rtl;
    right: auto;
    left: var(--lcw-right);
  }
  .lcw-panel {
    width: var(--lcw-panel-width);
    height: var(--lcw-panel-height);
    background: var(--lcw-panel-bg);
    border-radius: var(--lcw-panel-radius);
    box-shadow: var(--lcw-panel-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: lcw-panel-enter 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .lcw-rtl .lcw-panel {
    transform-origin: bottom left;
  }
  @keyframes lcw-panel-enter {
    from {
      transform: scale(0.75) translateY(20px);
      opacity: 0;
    }
    to {
      transform: scale(1) translateY(0);
      opacity: 1;
    }
  }
  .lcw-header {
    background: var(--lcw-header-bg);
    color: var(--lcw-header-color);
    height: var(--lcw-header-height);
    min-height: var(--lcw-header-height);
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .lcw-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
  }
  .lcw-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .lcw-header-avatar::before {
    content: "";
    width: 36px;
    height: 36px;
    background-image: url('media/avatar-bot.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  .lcw-header-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .lcw-header-name {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .lcw-header-status {
    font-size: var(--lcw-font-size-sm);
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .lcw-header-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
  }
  .lcw-header-status-dot-connected {
    background: #4ade80;
    box-shadow: 0 0 4px #4ade80;
  }
  .lcw-header-status-dot-disconnected {
    background: rgba(255, 255, 255, 0.5);
  }
  .lcw-header-status-dot-connecting {
    background: #facc15;
    animation: lcw-blink 1s ease-in-out infinite;
  }
  .lcw-header-close {
    background: none;
    border: none;
    color: var(--lcw-header-color);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity 0.15s, background 0.15s;
    flex-shrink: 0;
  }
  .lcw-header-close::before {
    content: "";
    width: 18px;
    height: 18px;
    background-image: url('media/close.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  .lcw-header-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
  }
  .lcw-header-close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
  }
  @keyframes lcw-blink {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.3;
    }
  }
  .lcw-handoff-banner {
    background: #fffde7;
    color: #5c4a00;
    border-bottom: 1px solid #ffe082;
    padding: 8px 14px;
    font-size: var(--lcw-font-size-sm);
    display: flex;
    align-items: flex-start;
    gap: 6px;
    animation: lcw-slide-in 0.2s ease;
  }
  .lcw-handoff-banner::before {
    content: "";
    width: 16px;
    height: 16px;
    background-image: url('media/info.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    margin-top: 1px;
  }
  @keyframes lcw-slide-in {
    from {
      transform: translateY(-8px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  .lcw-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--lcw-messages-bg);
    scroll-behavior: smooth;
  }
  .lcw-messages::-webkit-scrollbar {
    width: 4px;
  }
  .lcw-messages::-webkit-scrollbar-track {
    background: transparent;
  }
  .lcw-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
  }
  .lcw-empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .lcw-empty-state::before {
    content: "";
    width: 40px;
    height: 40px;
    background-image: url('media/chat-bubble.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  .lcw-connecting {
    display: flex;
    justify-content: flex-start;
    padding: 4px 0;
  }
  .lcw-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
  }
  .lcw-message-user {
    align-self: flex-end;
    align-items: flex-end;
  }
  .lcw-message-ai {
    align-self: flex-start;
    align-items: flex-start;
  }
  .lcw-message-status {
    align-self: center;
    max-width: 90%;
  }
  .lcw-message-error, .lcw-message-warning, .lcw-message-success {
    align-self: stretch;
    max-width: 100%;
  }
  .lcw-bubble-row {
    display: flex;
    align-items: flex-end;
    gap: 4px;
  }
  .lcw-bubble-meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 3px;
    padding: 0 4px;
    color: var(--lcw-ai-bubble-color);
  }
  .lcw-bubble-author {
    font-size: var(--lcw-font-size-sm);
    font-weight: 600;
    color: inherit;
    opacity: 0.75;
  }
  .lcw-bubble-time {
    font-size: 10px;
    color: inherit;
    opacity: 0.6;
    white-space: nowrap;
  }
  .lcw-bubble {
    padding: 8px 12px;
    border-radius: 16px;
    max-width: 100%;
    position: relative;
  }
  .lcw-message-ai .lcw-bubble {
    background: var(--lcw-ai-bubble-bg);
    color: var(--lcw-ai-bubble-color);
    border: var(--lcw-ai-bubble-border);
    border-bottom-left-radius: 4px;
  }
  .lcw-message-user .lcw-bubble {
    background: var(--lcw-user-bubble-bg);
    color: var(--lcw-user-bubble-color);
    border-bottom-right-radius: 4px;
    border: none;
  }
  .lcw-bubble-progress {
    background: transparent !important;
    border: none !important;
    padding: 2px 8px;
  }
  .lcw-bubble-body {
    font-size: var(--lcw-font-size);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .lcw-bubble-body-wave {
    display: inline-block;
    background: linear-gradient(90deg, #9e9e9e 0%, #1a1a1a 50%, #9e9e9e 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: lcw-wave 2s linear infinite;
    font-style: italic;
    opacity: 0.75;
  }
  .lcw-bubble-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 21px;
    height: 21px;
    border-radius: 4px;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
  }
  .lcw-bubble-action::before {
    content: "";
    width: 13px;
    height: 13px;
    background-image: url('media/copy.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  .lcw-bubble-action:hover {
    opacity: 0.9;
  }
  .lcw-message:hover .lcw-bubble-action {
    opacity: 0.5;
  }
  .lcw-wave-text {
    display: inline-block;
    background: linear-gradient(90deg, #9e9e9e 0%, #1a1a1a 50%, #9e9e9e 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: lcw-wave 2s linear infinite;
  }
  .lcw-status-message {
    padding: 7px 14px;
    border-radius: 8px;
	font-size: var(--lcw-font-size);
    font-size: var(--lcw-font-size-sm);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
  }
  .lcw-message-error .lcw-status-message {
    background: var(--lcw-status-error-bg);
    color: var(--lcw-status-error-color);
    border: 1px solid #f5c6cb;
  }
  .lcw-message-warning .lcw-status-message {
    background: var(--lcw-status-warning-bg);
    color: var(--lcw-status-warning-color);
    border: 1px solid #ffe082;
  }
  .lcw-message-success .lcw-status-message {
    background: var(--lcw-status-success-bg);
    color: var(--lcw-status-success-color);
    border: 1px solid #a5d6a7;
  }
  .lcw-message-status .lcw-status-message {
    background: transparent;
    color: #9e9e9e;
    font-style: italic;
    border: none;
    padding: 4px 8px;
  }
  .lcw-delivery-state {
    display: flex;
    justify-content: flex-end;
    margin-top: 3px;
    padding: 0 4px;
  }
  .lcw-delivery-state-sending::before, .lcw-delivery-state-received::before, .lcw-delivery-state-error::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  .lcw-delivery-state-sending::before {
    background-image: url('media/spinner.svg');
    animation: lcw-spin 1s linear infinite;
  }
  .lcw-delivery-state-received::before {
    background-image: url('media/check-circle.svg');
  }
  .lcw-delivery-state-error::before {
    background-image: url('media/error-circle.svg');
  }
  @keyframes lcw-spin {
    100% {
      transform: rotate(360deg);
    }
  }
  .lcw-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--lcw-input-border);
    background: var(--lcw-input-bg);
  }
  .lcw-input {
    flex: 1;
    min-height: 20px;
    max-height: 120px;
    padding: 8px 12px;
    border: 1px solid var(--lcw-input-border);
    border-radius: 20px;
    resize: none;
    font-family: var(--lcw-font-family);
    font-size: var(--lcw-font-size);
    color: var(--lcw-input-color);
    background: var(--lcw-input-bg);
    outline: none;
    line-height: 1.4;
    overflow-y: auto;
    transition: border-color 0.15s;
    box-sizing: border-box;
  }
  .lcw-input::placeholder {
    color: var(--lcw-input-placeholder-color);
  }
  .lcw-input:focus {
    border-color: var(--lcw-header-bg);
  }
  .lcw-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }
  .lcw-input::-webkit-scrollbar {
    width: 3px;
  }
  .lcw-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--lcw-send-btn-bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, background 0.15s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  }
  .lcw-send-btn::before {
    content: "";
    width: 18px;
    height: 18px;
    background-image: url('media/send.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  .lcw-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
  }
  .lcw-send-btn:active:not(:disabled) {
    transform: scale(0.95);
  }
  .lcw-send-btn:disabled {
    background: var(--lcw-send-btn-disabled-bg);
    cursor: not-allowed;
    box-shadow: none;
  }
  .lcw-send-btn:disabled::before {
    background-image: url('media/send-disabled.svg');
  }
  .lcw-send-btn:focus-visible {
    outline: 2px solid var(--lcw-header-bg);
    outline-offset: 2px;
  }
  .lcw-message-history {
    opacity: 1;
  }
  .lcw-history-loading {
    display: flex;
    justify-content: center;
    padding: 8px 0 4px;
    opacity: 0.5;
  }
  .lcw-message-a2ui {
    max-width: 100%;
    min-width: 0;
    align-self: stretch;
  }
  .lcw-a2ui {
    display: block;
    width: calc(100% - 10px);
    min-width: 0;
    background: var(--lcw-ai-bubble-bg);
    border: var(--lcw-ai-bubble-border);
    border-radius: 12px;
    padding: 10px;
    overflow: hidden;
  }
  .lcw-a2ui .dynamic-form-wrapper {
    position: relative;
  }
  .lcw-a2ui markdown,
  .lcw-a2ui .text {
    display: block;
    overflow-x: auto;
    word-break: break-word;
  }
  .lcw-a2ui markdown pre,
  .lcw-a2ui .text pre {
    overflow-x: auto;
    max-width: 100%;
  }
  .lcw-a2ui markdown table,
  .lcw-a2ui .text table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
  }
  .lcw-a2ui markdown img,
  .lcw-a2ui .text img {
    max-width: 100%;
    height: auto;
  }
  .lcw-agent-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
  }
  .lcw-agent-list-selected {
    opacity: 0.6;
    pointer-events: none;
  }
  .lcw-agent-list-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 8px 10px;
    border: 1px solid var(--lcw-input-border);
    border-radius: 8px;
    background: var(--lcw-messages-bg);
    cursor: pointer;
    text-align: left;
    width: 100%;
    font-family: var(--lcw-font-family);
    transition: border-color 0.15s, background 0.15s;
  }
  .lcw-agent-list-item:hover:not(:disabled) {
    border-color: var(--lcw-header-bg);
    background: #fff8f3;
  }
  .lcw-agent-list-item:focus-visible {
    outline: 2px solid var(--lcw-header-bg);
    outline-offset: 2px;
  }
  .lcw-agent-list-item:disabled {
    cursor: default;
  }
  .lcw-agent-list-item-name {
    font-size: var(--lcw-font-size);
    font-weight: 600;
    color: var(--lcw-header-bg);
  }
  .lcw-agent-list-item-desc {
    font-size: var(--lcw-font-size-sm);
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  @media (max-width: 440px) {
    .lcw-panel {
      border-bottom-right-radius: 0;
      border-bottom-left-radius: 0;
    }
  }

/* ── Launcher button ─────────────────────────────────────────────────
   Floating button that opens/closes the chat panel.
   ─────────────────────────────────────────────────────────────────── */
.lcw-launcher {
  position: fixed;
  bottom: 20px;
  height: 68px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lcw-launcher::before {
  content: '';
  display: block;
  width: 254px;
  height: 154px;
  background: url('media/launcher-new.svg') center / contain no-repeat;
}

.lcw-launcher:hover  { transform: scale(1.08);}
.lcw-launcher:active { transform: scale(0.96); }
.lcw-a2ui .text {
    font-size: 14px;
    font-family: inherit;
    font-weight: normal;
    line-height: 1.5;
    color: inherit;
}
.lcw { 
  --lcw-panel-height: calc(100vh - 230px);
  right: auto !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  align-items: center !important;
}

/* Center the launcher (keep separate so hover transform still works) */
.lcw-launcher {
  right: auto !important;
  left: calc(50%) !important;
  transform: translateX(-50%) !important;
}
/* ── Mask overlay ────────────────────────────────────────────────── */
#lcw-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 998;
  /* just below widget z-index 999 */
}
#lcw-mask.visible {
  display: block;
}
 
} 