/* ================================================================
   QUOTEPLAN AI ASSISTANT - MODERN PROFESSIONAL UI
   ================================================================ */

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.chatbot-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  height: 100vh;
  overflow: hidden;
  color: #222;
  line-height: 1.6;
}

/* ================================================================
   FLOATING CHAT BUTTON
   ================================================================ */
.chat-toggle-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  cursor: grab;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  font-size: 24px;
  --chat-icon-zoom: 1;
  transform: scale(var(--chat-icon-zoom));
  transform-origin: center;
}

.chat-toggle-btn:hover {
  transform: scale(var(--chat-icon-zoom)) scale(1.1) translateY(-2px);
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.5);
}

.chat-toggle-btn:active {
  transform: scale(var(--chat-icon-zoom)) scale(0.95);
  cursor: grabbing;
}

/* Chat icon options popover (right-click: zoom & reset) */
.chat-icon-popover {
  position: fixed;
  z-index: 1000;
  min-width: 200px;
  padding: 12px 14px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #334155;
}

.chat-icon-popover-title {
  font-weight: 600;
  margin-bottom: 10px;
  color: #0f172a;
}

.chat-icon-popover-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.chat-icon-popover-row label {
  flex-shrink: 0;
  font-weight: 500;
}

.chat-icon-zoom-slider {
  flex: 1;
  min-width: 80px;
  height: 6px;
  accent-color: #3b82f6;
}

.chat-icon-zoom-value {
  min-width: 36px;
  text-align: right;
  font-weight: 600;
  color: #1d4ed8;
}

.chat-icon-reset-btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.chat-icon-reset-btn:hover {
  background: #dbeafe;
  color: #1e40af;
}

.unread-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* ================================================================
   CHAT WIDGET CONTAINER
   ================================================================ */
.chat-widget {
  /* QuotePlan brand — use across widget + fullscreen */
  --qp-blue: #1e90ff;
  --qp-blue-deep: #0f4c81;
  --qp-accent: #3b82f6;
  --qp-accent-dark: #1d4ed8;
  --qp-surface: #ffffff;
  --qp-bg: #f8fafc;
  --qp-bg-chat: #f1f5f9;
  --qp-border: #e2e8f0;
  --qp-text: #1e293b;
  --qp-text-muted: #64748b;
  position: fixed;
  left: auto;
  top: auto;
  right: 24px;
  bottom: 24px;
  cursor: grab;
  width: 380px;
  height: 650px;
  max-height: 85vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  z-index: 998;
  /* Closed = slide off to the right (not visible on screen) */
  transform: translateX(calc(100% + 48px));
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  visibility: visible;
  pointer-events: auto;
}

.chat-widget:not(.visible) {
  visibility: hidden;
  pointer-events: none;
}

.chat-widget.visible {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  animation: widgetSlideIn 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes widgetSlideIn {
  from {
    opacity: 0.92;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.chat-menu-btn-standalone:focus-visible,
.send-btn:focus-visible,
.menu-task-guide-subguide-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .chat-widget.visible,
  .message,
  .message-greeting,
  .quick-prompts,
  .quick-prompt-btn,
  .loading-dot {
    animation: none !important;
    transition: none !important;
  }

  .quick-prompt-btn:hover {
    transform: none;
  }
}

/* ================================================================
   FULL SCREEN — ChatGPT-style wide layout
   ================================================================ */
body.quoteplan-chat-fullscreen-open {
  overflow: hidden !important;
}

.chat-widget.chat-widget-fullscreen {
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: none !important;
  border-radius: 0;
  transform: none !important;
  z-index: 2147483000;
  border: none;
  box-shadow: none;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto auto;
  background: var(--qp-bg-chat);
}

/* CPQ exit bar sits inside the input area (above the text box). */
.chat-widget.chat-widget-fullscreen.cpq-mode-active .chat-input-area {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-top: 10px;
}

.chat-widget.chat-widget-fullscreen .chat-header {
  grid-column: 1 / -1;
  grid-row: 1;
  border-radius: 0;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--qp-blue) 0%, var(--qp-blue-deep) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-sidebar {
  display: none;
}

.chat-widget.chat-widget-fullscreen .chat-sidebar {
  grid-column: 1;
  grid-row: 2 / 5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, var(--qp-surface) 55%, var(--qp-bg) 100%);
  color: var(--qp-text);
  padding: 16px 12px;
  overflow: hidden;
  box-shadow: inset -1px 0 0 rgba(30, 144, 255, 0.08);
}

.chat-new-btn {
  width: 100%;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, var(--qp-accent) 0%, var(--qp-accent-dark) 100%);
  color: #ffffff;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 14px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.chat-new-btn:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}

.chat-history-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  background: var(--qp-surface);
  color: var(--qp-text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.chat-history-search::placeholder {
  color: #94a3b8;
}

.chat-history-search:focus {
  outline: none;
  border-color: var(--qp-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.chat-history-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--qp-accent-dark);
  font-weight: 600;
  padding: 2px 4px 0;
  opacity: 0.85;
}

.chat-history-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.chat-history-empty {
  font-size: 13px;
  color: var(--qp-text-muted);
  padding: 16px 8px;
  text-align: center;
  line-height: 1.45;
}

.chat-history-item {
  display: flex;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--qp-border);
  background: var(--qp-surface);
  color: var(--qp-text);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.chat-history-item:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.chat-history-item.active {
  border-color: var(--qp-accent);
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.18);
}

.chat-history-item-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 8px 6px;
  border-radius: 8px;
  font: inherit;
}

.chat-history-item-main:hover {
  background: rgba(59, 130, 246, 0.06);
}

.chat-history-item.active .chat-history-item-main:hover {
  background: rgba(59, 130, 246, 0.08);
}

.chat-history-item-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding: 0 2px;
}

.chat-history-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--qp-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.chat-history-icon-btn:hover {
  background: rgba(59, 130, 246, 0.12);
  color: var(--qp-accent-dark);
}

.chat-history-icon-btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.chat-history-item-title {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-history-item-time {
  margin-top: 6px;
  font-size: 11px;
  color: var(--qp-text-muted);
}

.chat-rename-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.chat-rename-modal.show {
  display: flex;
}

.chat-rename-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.chat-rename-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.chat-rename-modal-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.chat-rename-modal-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  margin-bottom: 16px;
}

.chat-rename-modal-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.chat-rename-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.chat-rename-cancel {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chat-rename-cancel:hover {
  background: #f9fafb;
}

.chat-rename-save {
  border: none;
  background: #2563eb;
  color: #fff;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chat-rename-save:hover {
  background: #1d4ed8;
}

.chat-widget.chat-widget-fullscreen .chat-messages-wrapper {
  grid-column: 2;
  grid-row: 2;
  flex: 1;
  min-height: 0;
  padding: 0;
  background:white;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-widget.chat-widget-fullscreen .messages {
  width: 100%;
  max-width: 87rem;
  padding: 24px 28px 32px;
  box-sizing: border-box;
  gap: 18px;
}

.chat-widget.chat-widget-fullscreen .message-greeting {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  position: relative;
  z-index: 1;
}

.chat-widget.chat-widget-fullscreen .message-greeting::before {
  content: "";
  position: absolute;
  inset: -26px -22px -16px -22px;
  z-index: -1;
  background: radial-gradient(circle at 50% 30%, rgba(30, 144, 255, 0.22) 0%, rgba(59, 130, 246, 0.12) 34%, rgba(2, 132, 199, 0) 70%);
  filter: blur(10px);
  opacity: 1;
}

.chat-widget.chat-widget-fullscreen .message-greeting h2 {
  font-size: 22px;
  color: #0f172a;
}

.chat-widget.chat-widget-fullscreen .message-greeting p {
  font-size: 14px;
  color: #475569;
}

.chat-widget.chat-widget-fullscreen .greeting-avatar {
  width: 108px;
  height: 108px;
  margin-bottom: 18px;
}

.chat-widget.chat-widget-fullscreen .greeting-avatar .eva-mascot-greeting {
  width: 96px;
  height: 96px;
}

.chat-widget.chat-widget-fullscreen .quick-prompts {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.chat-widget.chat-widget-fullscreen .chat-input-area {
  grid-column: 2;
  grid-row: 3;
  flex-shrink: 0;
  padding: 11px 28px;
  background: var(--qp-surface);
  border-top: none;
  display: flex;
  justify-content: center;
  box-shadow: none;
}

.chat-widget.chat-widget-fullscreen .chat-input-area form {
  width: 100%;
  max-width: 87rem;
  margin: 0 auto;
  box-sizing: border-box;
}

.chat-widget.chat-widget-fullscreen .chat-input-area .input-wrapper {
  width: 100%;
  max-width: none;
  align-items: center;
  gap: 14px;
}

.chat-widget.chat-widget-fullscreen .send-actions {
  flex-direction: row;
  align-items: center;
  gap: 0;
}

.chat-widget.chat-widget-fullscreen .input-with-count {
  flex: 1;
  min-width: 0;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  background: var(--qp-bg);
  min-height: 61px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.chat-widget.chat-widget-fullscreen .input-with-count:focus-within {
  border-color: var(--qp-accent);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), 0 4px 16px rgba(59, 130, 246, 0.08);
  background: var(--qp-surface);
}

.chat-widget.chat-widget-fullscreen .chat-input-footer {
  grid-column: 2;
  grid-row: 4;
  text-align: center;
  padding: 0 28px 12px;
  margin: 0;
  background: var(--qp-surface);
  border-top: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chat-widget.chat-widget-fullscreen .chat-input-footer .chat-disclaimer,
.chat-widget.chat-widget-fullscreen .chat-input-footer .chat-footer-responsible-ai {
  width: 100%;
  max-width: 87rem;
  box-sizing: border-box;
}

.chat-widget.chat-widget-fullscreen .chat-input-footer .chat-disclaimer {
  font-size: 13px;
  color: #004ab4;
}

.chat-widget.chat-widget-fullscreen .chat-input-footer .chat-footer-responsible-ai {
  color: var(--qp-text);
}

.chat-widget.chat-widget-fullscreen .message-body {
  max-width: 100%;
}

.chat-widget.chat-widget-fullscreen .message.bot-message .message-body {
  max-width: min(100%, 48rem);
}

.chat-widget.chat-widget-fullscreen .message.bot-message .message-body:has(.project-list-holder),
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body:has(.project-list-table),
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body:has(.item-catalog-projects-holder),
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body:has(.item-catalog-projects-table),
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body:has(.project-pnl-holder),
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body:has(.project-pnl-table) {
  max-width: 100% !important;
  width: 100% !important;
}

/* Safety: for fullscreen, allow wider bot bubbles so project tables don't look cramped. */
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body {
  max-width: 100% !important;
}

.chat-widget.chat-widget-fullscreen .message.user-message .message-body {
  max-width: min(92%, 36rem);
}

.chat-widget.chat-widget-fullscreen .message.bot-message .message-body:has(.enhanced-reply) {
  width: min(100%, 48rem);
}

/* Ensure project / item-catalog / P&L tables use the full fullscreen width (not the 48rem enhanced-reply cap). */
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body:has(.project-list-holder),
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body:has(.item-catalog-projects-holder),
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body:has(.project-pnl-holder) {
  width: 100% !important;
}

/* Fullscreen plain mode: no question/answer bubbles */
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body > .message-content {
  font-size: 16px;
  line-height: 1.72;
  padding: 0;
  color: var(--qp-text);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.chat-widget.chat-widget-fullscreen .message.user-message .message-body > .message-content {
  font-size: 13px;
  line-height: 1.62;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.6) 0%, rgba(239, 246, 255, 0.85) 100%);
  border: 1px solid #bfdbfe;
  border-left: 4px solid #1e90ff;
  color: #0c4a6e;
  box-shadow: 0 2px 8px rgba(30, 144, 255, 0.08);
}

.chat-widget.chat-widget-fullscreen .enhanced-reply {
  max-width: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  gap: 10px;
}

.chat-widget.chat-widget-fullscreen .enhanced-reply:has(.project-pnl-holder) {
  width: 100%;
  max-width: 100%;
}

.chat-widget.chat-widget-fullscreen .answer-section {
  font-size: 16px;
  line-height: 1.7;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.chat-widget.chat-widget-fullscreen .answer-section:hover {
  border-color: transparent;
  background: transparent;
}

.chat-widget.chat-widget-fullscreen .answer-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--qp-accent-dark);
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.chat-widget.chat-widget-fullscreen .answer-section p,
.chat-widget.chat-widget-fullscreen .answer-section li,
.chat-widget.chat-widget-fullscreen .answer-section .typing-content {
  color: #1f2937;
  font-size: 13px;
}

.chat-widget.chat-widget-fullscreen .answer-section p {
  margin-bottom: 10px;
}

.chat-widget.chat-widget-fullscreen .answer-section p:last-child {
  margin-bottom: 0;
}

.chat-widget.chat-widget-fullscreen .answer-section ol.steps-list li {
  background: #ffffff;
  border-color: #dbeafe;
  border-radius: 12px;
  padding: 12px 12px 12px 46px;
}

.chat-widget.chat-widget-fullscreen .answer-section ol.steps-list li::before {
  background: linear-gradient(135deg, var(--qp-accent) 0%, var(--qp-accent-dark) 100%);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.chat-widget.chat-widget-fullscreen .answer-section li > p {
  margin: 0;
}

.chat-widget.chat-widget-fullscreen .answer-section li > ul,
.chat-widget.chat-widget-fullscreen .answer-section li > ol {
  margin: 6px 0 0 16px;
  padding: 0;
}

/* Flat mode: remove extra nested boxes inside bot answer */
.chat-widget.chat-widget-fullscreen .summary-box,
.chat-widget.chat-widget-fullscreen .steps-box,
.chat-widget.chat-widget-fullscreen .followup-box,
.chat-widget.chat-widget-fullscreen .answer-box,
.chat-widget.chat-widget-fullscreen .clarification-box,
.chat-widget.chat-widget-fullscreen .suggested-follow-ups {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.chat-widget.chat-widget-fullscreen .summary-box h3,
.chat-widget.chat-widget-fullscreen .steps-box h3,
.chat-widget.chat-widget-fullscreen .followup-box h3,
.chat-widget.chat-widget-fullscreen .answer-box h3,
.chat-widget.chat-widget-fullscreen .suggested-follow-ups-label {
  margin: 4px 0 8px !important;
  color: var(--qp-accent-dark) !important;
  font-size: 12px !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-widget.chat-widget-fullscreen .summary-box .typing-content,
.chat-widget.chat-widget-fullscreen .followup-box .typing-content,
.chat-widget.chat-widget-fullscreen .answer-box .typing-content,
.chat-widget.chat-widget-fullscreen .answer-box .message-content.answer-formatted {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  width: 708px;
  box-shadow: none;
}

/* If this answer contains a project list or item-catalog table, don't keep it constrained to 708px. */
.chat-widget.chat-widget-fullscreen .answer-box .message-content.answer-formatted:has(.project-list-holder),
.chat-widget.chat-widget-fullscreen .answer-box .message-content.answer-formatted:has(.project-list-table),
.chat-widget.chat-widget-fullscreen .answer-box .message-content.answer-formatted:has(.item-catalog-projects-holder),
.chat-widget.chat-widget-fullscreen .answer-box .message-content.answer-formatted:has(.item-catalog-projects-table),
.chat-widget.chat-widget-fullscreen .answer-box .message-content.answer-formatted:has(.project-pnl-holder),
.chat-widget.chat-widget-fullscreen .answer-box .message-content.answer-formatted:has(.project-pnl-table) {
  width: 100%;
  max-width: none;
}

.chat-widget.chat-widget-fullscreen .steps-box .steps-list {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.chat-widget.chat-widget-fullscreen .steps-box .copy-btn {
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.chat-widget.chat-widget-fullscreen .suggested-follow-ups-chips {
  gap: 10px;
}

.chat-widget.chat-widget-fullscreen .suggested-follow-up-chip {
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.chat-widget.chat-widget-fullscreen #questionInput {
  font-size: 16px;
  width: 100%;
  max-width: 100%;
  line-height: 1.5;
  border: none !important;
  border-radius: 14px;
  background: transparent !important;
  box-shadow: none !important;
  padding: clamp(10px, 1.8vh, 16px) clamp(50px, 5vw, 65px) clamp(10px, 1.8vh, 16px) clamp(14px, 2vw, 18px);
  color: var(--qp-text);
}

.chat-widget.chat-widget-fullscreen .chat-menu-btn-standalone {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--qp-bg);
  border-color: #cbd5e1;
  color: var(--qp-accent-dark);
  align-self: center;
}

.chat-widget.chat-widget-fullscreen .input-field-group {
  flex: 1;
  min-width: 0;
  align-items: center;
}

.chat-widget.chat-widget-fullscreen #questionInput:focus {
  box-shadow: none !important;
  outline: none;
}

.chat-widget.chat-widget-fullscreen .input-with-count .char-count {
  right: 16px;
  bottom: 50%;
  transform: translateY(50%);
  font-size: 12px;
  color: #94a3b8;
}

.chat-widget.chat-widget-fullscreen .send-btn {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--qp-accent) 0%, var(--qp-accent-dark) 100%);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  align-self: center;
}

.chat-widget.chat-widget-fullscreen .send-btn:hover:not(:disabled) {
  box-shadow: 0 6px 22px rgba(59, 130, 246, 0.5);
}

.chat-widget.chat-widget-fullscreen .chat-messages-wrapper::-webkit-scrollbar-track {
  background: #e2e8f0;
}

.chat-widget.chat-widget-fullscreen .chat-messages-wrapper::-webkit-scrollbar-thumb {
  background: #94a3b8;
}

.chat-widget.chat-widget-fullscreen .chat-history-list::-webkit-scrollbar {
  width: 6px;
}

.chat-widget.chat-widget-fullscreen .chat-history-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.chat-widget.chat-widget-fullscreen .chat-history-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

@media (max-width: 920px) {
  .chat-widget.chat-widget-fullscreen {
    grid-template-columns: 1fr;
  }
  .chat-widget.chat-widget-fullscreen .chat-sidebar {
    display: none;
  }
  .chat-widget.chat-widget-fullscreen .chat-messages-wrapper,
  .chat-widget.chat-widget-fullscreen .chat-input-area,
  .chat-widget.chat-widget-fullscreen .chat-input-footer {
    grid-column: 1;
  }
}

/* ================================================================
   CHAT HEADER - ENHANCED BEAUTIFUL DESIGN
   ================================================================ */
.chat-header {
  background: linear-gradient(135deg, #00a3ea 0%, #108bf5 100%);
  color: #ffffff;
  padding: 12px 16px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: visible;
  box-sizing: border-box;
}

/* Animated background overlay */
.chat-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 50%, 
    transparent 100%);
  pointer-events: none;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
}

.chat-header-content {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.chat-header-content h1 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 !important;
  letter-spacing: -0.02em;
  /* color/gradient from .chat-title-info h1 */
}

.chat-subtitle {
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 12px;
  font-weight: 400;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.3;
}

/* Status indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
  animation: pulse 2.5s ease-in-out infinite;
}

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

.chat-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.chat-icon-link {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.chat-icon {
  font-size: 28px;
  display:flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.chat-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, 
    transparent 30%, 
    rgba(255, 255, 255, 0.2) 50%, 
    transparent 70%);
  animation: iconShine 3s ease-in-out infinite;
}

@keyframes iconShine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.chat-icon-link:hover .chat-icon {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.chat-icon:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.chat-icon img {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.chat-title-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.chat-header-username:empty {
  display: none;
}

.chat-title-info h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: #ffffff;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.chat-close-btn {
  background: transparent;
  backdrop-filter: none;
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: none;
  position: relative;
  z-index: 1;
  opacity: 0.92;
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
  opacity: 1;
}

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

/* Minimize button - same style as close, no rotate */
.chat-minimize-btn {
  background: transparent;
  backdrop-filter: none;
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: none;
  position: relative;
  z-index: 1;
  opacity: 0.92;
}

.chat-minimize-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
  opacity: 1;
}

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

/* ================================================================
   CHAT HEADER ACTIONS
   ================================================================ */
.chat-header-actions {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  align-self: center;
}

.chat-header-side-buttons {
  display: inline-flex;
  flex-direction: row;
  gap: 2px;
  align-items: center;
}

.chat-menu-dropdown {
  position: absolute;
  bottom: calc(100% + 10px);
  left: -8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
  border: 1px solid #dbeafe;
  padding: 8px 0;
  z-index: 20;
  min-width: 200px;
  animation: fadeIn 0.16s ease-out;
  font-family: inherit;
}

.chat-menu-item {
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 500;
}

.chat-menu-item-parent {
  position: relative;
  justify-content: space-between;
  white-space: nowrap;
}

.chat-menu-item-caret {
  margin-left: 10px;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1;
}

.chat-menu-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.chat-menu-item-parent:hover .chat-menu-item-caret {
  color: #1d4ed8;
}

.chat-menu-item-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.chat-menu-item:hover .chat-menu-item-icon {
  color: #1d4ed8;
}

.chat-menu-item-capabilities {
  font-weight: 600;
  border-bottom: 1px solid #dbeafe;
  margin-bottom: 2px;
}

.chat-menu-item-capabilities .chat-menu-item-icon {
  color: #2563eb;
}

.chat-submenu-dropdown {
  position: absolute;
  left: calc(100% + 2px);
  bottom: 0;
  top: auto;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
  border: 1px solid #dbeafe;
  padding: 6px 0;
  min-width: 320px;
  max-height: min(62vh, 420px);
  overflow-y: auto;
  display: none;
  z-index: 30;
  font-family: inherit;
}

.chat-menu-item-parent::after {
  content: "";
  position: absolute;
  top: 0;
  right: -10px;
  width: 12px;
  height: 100%;
}

.chat-menu-item-parent:hover .chat-submenu-dropdown {
  display: block;
}

.chat-submenu-section {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  pointer-events: none;
}

.chat-submenu-dropdown .chat-submenu-section:first-child {
  border-top: none;
}

.chat-submenu-item {
  justify-content: flex-start;
  padding: 8px 12px;
  white-space: normal;
  line-height: 1.35;
}

.chat-menu-dropdown--mobile {
  position: absolute;
  top: 60px;
  left: 10px;
  right: 10px;
  bottom: auto;
  min-width: 0;
  width: auto;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  z-index: 50;
  border: 1px solid #bfdbfe;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.28);
}

.chat-menu-dropdown--fullscreen {
  position: absolute;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  min-width: 220px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  z-index: 2147483002;
  border: 1px solid #bfdbfe;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.28);
}

/* Fullscreen uses accordion HTML: keep a fixed panel above the menu button */
.chat-menu-dropdown--fullscreen.chat-menu-dropdown--mobile {
  top: auto;
  right: auto;
  left: auto;
  bottom: auto;
  width: min(380px, calc(100vw - 32px));
  min-width: 260px;
  max-height: min(70vh, 520px);
  overflow: hidden;
}

.chat-menu-dropdown--fullscreen.chat-menu-dropdown--mobile .chat-menu-mobile-list {
  max-height: min(58vh, 440px);
}

.chat-menu-dropdown--fullscreen .chat-submenu-dropdown {
  z-index: 2147483003;
}

.chat-menu-mobile-head {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #e0f2fe;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  font-family: inherit;
}

.chat-menu-mobile-list {
  max-height: min(56vh, 380px);
  overflow-y: auto;
  background: #f8fbff;
}

.chat-menu-mobile-section {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  background: #eef6ff;
  border-bottom: 1px solid #dbeafe;
  font-family: inherit;
}

.chat-menu-mobile-item--capabilities {
  font-weight: 600;
  background: #f0f9ff;
}

.chat-menu-mobile-item {
  width: 100%;
  border: none;
  border-bottom: 1px solid #dbeafe;
  background: transparent;
  color: #0f172a;
  text-align: left;
  font-size: 14px;
  line-height: 1.35;
  padding: 11px 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}

.chat-menu-mobile-item:last-child {
  border-bottom: none;
}

.chat-menu-mobile-item:hover {
  background: #eaf3ff;
  color: #1d4ed8;
}

.chat-menu-mobile-module {
  width: 100%;
  border: none;
  border-bottom: 1px solid #dbeafe;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  font-size: 14px;
  line-height: 1.35;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-menu-mobile-module-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #eff6ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.chat-menu-mobile-module-caret {
  margin-left: auto;
  color: #94a3b8;
  font-size: 16px;
  transform: rotate(90deg);
  transition: transform 0.16s ease;
}

.chat-menu-mobile-module.is-open {
  background: #eff6ff;
  color: #1d4ed8;
}

.chat-menu-mobile-module.is-open .chat-menu-mobile-module-caret {
  transform: rotate(-90deg);
  color: #1d4ed8;
}

.chat-menu-mobile-module-body {
  display: none;
  background: #f8fbff;
  border-bottom: 1px solid #dbeafe;
}

.chat-menu-mobile-module-body.is-open {
  display: block;
}

.chat-menu-mobile-module-body .chat-menu-mobile-item {
  padding-left: 28px;
  font-weight: 500;
}

.chat-menu-mobile-module-body .chat-menu-mobile-section {
  padding-left: 28px;
}

.project-choice-card {
  margin-top: 8px;
}

.project-choice-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.project-choice-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f9fafb;
  color: #0f172a;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease;
}

.project-choice-btn.primary {
  background: linear-gradient(154deg, #e0c3ef 0%, #feeaff 100%);
  border-color: #dda9be;
  color: #010101;
}

.project-choice-btn.secondary {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #312e81;
}

.project-choice-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.menu-task-guide {
  margin-top: 8px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
  border-radius: 14px;
  padding: 4px 2px 2px;
}

.menu-task-guide-text {
  margin: 8px 0 6px 0;
  color: #1e293b;
  font-size: 12px;
  line-height: 1.5;
}

.menu-task-guide-intro {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.menu-task-guide-subguide-group {
  margin: 14px 0 4px;
}

.menu-task-guide-subguide-heading {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.menu-task-guide-subguide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu-task-guide-subguide-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #fff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.menu-task-guide-subguide-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.menu-task-guide-subtitle {
  margin: 12px 0 6px 0;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.menu-task-guide-list {
  margin: 0 0 10px 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: #334155;
}

.menu-task-guide-list li {
  margin-bottom: 5px;
}

.menu-task-guide-sample-label--tasks {
  margin-top: 14px;
}

.menu-task-guide-sample-label {
  margin: 10px 0 6px 0;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.menu-task-guide-format {
  font-size: 12px;
  color: #1d4ed8;
  font-weight: 600;
  margin-bottom: 8px;
}

.menu-task-guide-format--after-sample {
  margin-top: 10px;
}

.menu-task-guide-prompt-block {
  margin-bottom: 8px;
}

.menu-task-guide-prompt-label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.menu-task-guide-sample {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  cursor: default;
  box-sizing: border-box;
}

.menu-task-guide-prompt-block .menu-task-guide-sample {
  margin-bottom: 0;
}

.header-btn {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 1;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

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

.header-btn.disabled {
  opacity: 0.5;
}

/* ================================================================
   CHAT MESSAGES AREA
   ================================================================ */
.chat-messages-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px;
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(59, 130, 246, 0.06) 0%, transparent 55%),
    var(--qp-bg-chat, #f1f5f9);
  scroll-behavior: smooth;
  position: relative;
}

.chat-messages-wrapper::-webkit-scrollbar {
  width: 6px;
}

.chat-messages-wrapper::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 3px;
}

.chat-messages-wrapper::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 3px;
}

.chat-messages-wrapper::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ================================================================
   AUTO-SCROLL BUTTON
   ================================================================ */
.auto-scroll-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  padding: 0;
  animation: slideUp 0.3s ease-out;
}

.auto-scroll-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.auto-scroll-btn:active {
  transform: translateY(0);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 8px;
}

/* ================================================================
   GREETING SECTION
   ================================================================ */
.message-greeting {
  text-align: center;
  padding: 20px 8px 8px;
  animation: greetingFadeIn 0.45s ease-out;
}

@keyframes greetingFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-greeting.animating,
.quick-prompts.animating {
  animation: greetingFadeOut 0.38s ease forwards;
  pointer-events: none;
}

@keyframes greetingFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.greeting-avatar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 14px;
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 55%, #e0f2fe 100%);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 4px;
}

.greeting-avatar .eva-mascot-greeting {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.message-greeting h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--qp-text, #1e293b);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  font-family: inherit;
}

.message-greeting p {
  font-size: 13px;
  color: var(--qp-text-muted, #64748b);
  line-height: 1.5;
  margin-bottom: 4px;
}

.greeting-responsible-ai {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #334155;
}

.greeting-responsible-label {
  font-weight: 600;
  color: #0f172a;
}

.responsible-ai-trigger-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 450;
  color: #1d4ed8;
  text-decoration: underline;
  cursor: pointer;
}

.responsible-ai-trigger-btn:hover {
  color: #1e40af;
}

/* ================================================================
   QUICK PROMPTS
   ================================================================ */
.quick-prompts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 8px;
  animation: greetingFadeIn 0.5s ease-out 0.08s both;
}

.quick-prompt-btn {
  background: var(--qp-surface, #ffffff);
  border: 1px solid var(--qp-border, #e2e8f0);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--qp-text, #374151);
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.quick-prompt-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}

.quick-prompt-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
}

.quick-prompt-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.prompt-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.prompt-label {
  line-height: 1.3;
}

/* ================================================================
   MESSAGE BUBBLES - ENHANCED
   ================================================================ */
.message {
  display: flex;
  gap: 10px;
  animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.bot-message {
  justify-content: flex-start;
  align-items: flex-start;
}

.message.user-message {
  justify-content: flex-end;
}

/* Added avatar icons for bot and user messages */
.message::before, .message.bot-message::before, .message.user-message::before {
  display: none !important;
}

.message-body {
  max-width: 85%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message.user-message .message-body {
  order: 1;
  max-width: 85%;
}

.message-content {
  background: var(--qp-surface, #ffffff);
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.65;
  color: #00275e;
  word-wrap: break-word;
  position: relative;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.message.bot-message .message-content {
  color: #334155;
  border-radius: 4px 16px 16px 16px;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Bot bubble containing enhanced-reply - hide only direct .message-content child, not content inside sections */
.message.bot-message .message-body:has(.enhanced-reply) > .message-content {
  display: none;
}

.message.bot-message .message-body:has(.enhanced-reply) {
  max-width: 100%;
}

.message.bot-message .message-body:has(.enhanced-reply) .enhanced-reply {
  margin: 0;
}

/* User question — QuotePlan blue accent */
.message.user-message .message-content {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #0c4a6e;
  border: 1px solid #93c5fd;
  border-right: 3px solid #1e90ff;
  border-radius: 14px 4px 14px 14px;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.12);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.65;
}

/* Added timestamp styling */
.message-timestamp {
  font-size: 11px;
  color: #94a3b8;
  padding: 0 4px;
  margin-top: 4px;
}

.message.user-message .message-timestamp {
  text-align: right;
  color: #64748b;
}

/* Code blocks in messages */
.message-content code {
  background: rgba(0, 0, 0, 0.06);
  padding: 3px 7px;
  border-radius: 6px;
  font-family: "Monaco", "Courier New", monospace;
  font-size: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.message.user-message .message-content code {
  background: rgba(30, 64, 175, 0.2);
  border-color: rgba(30, 64, 175, 0.3);
  color: #1e3a8a;
}

/* Strong text (step numbers, key terms) */
.message-content strong {
  font-weight: 700;
  color: #1e3a5f;
}

.message.user-message .message-content strong {
  color: #1e40af;
}

/* Step list spacing - minimal gap after intro */
.message-content br + strong,
.answer-section br + strong {
  display: inline-block;
  margin-top: 4px;
}

/* Links - inside bot response */
.message-content a,
.answer-section a {
  color: #2563eb;
  text-decoration: none;
  border-bottom: 1px solid rgba(37, 99, 235, 0.4);
  transition: color 0.2s, border-color 0.2s;
}

.message.user-message .message-content a {
  color: #1d4ed8;
  border-bottom-color: rgba(29, 78, 216, 0.5);
}

.message-content a:hover,
.answer-section a:hover {
  color: #1d4ed8;
  border-bottom-color: #2563eb;
}

/* Strong/bold in answers - menu paths, step numbers */
.answer-section strong {
  font-weight: 700;
  color: #1e293b;
}

/* ================================================================
   STRUCTURED ANSWER SECTIONS - ENHANCED UI FORMAT
   ================================================================ */
.enhanced-reply {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 114%;  
  border-radius: 16px;
  animation: fadeIn 0.36s;
}

.answer-section {
  padding: 5px 5px;
  background: #ffffff;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.65;
  color: #334155;
  transition: all 0.2s ease;
  border: groove #4f46e5 1px;
}

.answer-section:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.answer-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
  text-transform: none;
}

/* Section content - paragraphs and lists */
.answer-section .typing-content p,
.answer-section p {
  margin: 0 0 10px 0;
}
.answer-section .typing-content p:last-child,
.answer-section p:last-child {
  margin-bottom: 0;
}

.answer-section ol.steps-list {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.answer-section ol.steps-list li {
  position: relative;
  margin-bottom: 14px;
  padding: 12px 12px 12px 44px;
  padding-left: 44px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  counter-increment: step;
  min-height: 2.5em;
}

.answer-section ol.steps-list li:last-child {
  margin-bottom: 0;
}

.answer-section ol.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.answer-section ol:not(.steps-list),
.answer-section ul {
  margin: 0 0 0 18px;
  padding: 0;
}

.answer-section li:not(.steps-list li) {
  margin-bottom: 8px;
  padding-left: 4px;
}

.answer-section li::marker {
  font-weight: 600;
  color: #64748b;
}

/* Keep list-item spacing stable when formatter injects nested <p>/<ul>/<ol>. */
.answer-section li > p {
  margin: 0;
}

.answer-section li > ul,
.answer-section li > ol {
  margin: 6px 0 0 16px;
  padding: 0;
}

/* Intro line (## from backend) - bold heading, minimal space below */
.answer-section .answer-intro,
.message-content .answer-intro {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  margin: 0 0 4px 0;
  padding: 0 0 2px 0;
  border-bottom: 1px solid #e2e8f0;
  letter-spacing: 0.01em;
}
.answer-section .answer-intro em,
.message-content .answer-intro em {
  font-style: italic;
  font-weight: 700;
  color: #475569;
}

/* Subheading (### from backend) - bold subheading, minimal space below */
.answer-section .answer-subhead,
.message-content .answer-subhead {
  font-size: 13px;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.4;
  margin: 4px 0 2px 0;
  padding: 0;
}
.answer-section .answer-subhead em,
.message-content .answer-subhead em {
  font-style: italic;
  font-weight: 700;
  color: #475569;
}

.answer-section .answer-subhead:first-child,
.message-content .answer-subhead:first-child {
  margin-top: 0;
}

/* Section heading (e.g. "Steps to...:", "Result and Notes:") - bold, clear hierarchy */
.answer-section .answer-section-head,
.message-content .answer-section-head {
  font-size: 13px;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.5;
  margin: 6px 0 4px 0;
  padding: 0;
}

/* Bullet & numbered lists inside message/answer - proper spacing */
.answer-section .answer-list,
.message-content .answer-list {
  margin: 8px 0 12px 0;
  padding-left: 20px;
  line-height: 1.6;
}

.answer-section .answer-list li,
.message-content .answer-list li {
  margin-bottom: 6px;
  padding-left: 4px;
}

.answer-section .answer-list-num {
  list-style: decimal;
  padding-left: 24px;
}

.answer-section .answer-list-num li {
  margin-bottom: 6px;
}

/* Indented sub-steps / sub-sub (from backend: 2 or 4 space indent; bullets rendered as hierarchy) */
.answer-section .answer-indent,
.message-content .answer-indent {
  margin: 2px 0 10px 0;
  padding-left: 0.75em;
  border-left: 2px solid #cbd5e1;
  font-size: 0.95em;
  line-height: 1.55;
  color: #334155;
}
.answer-section .answer-indent-line,
.message-content .answer-indent-line {
  margin: 2px 0;
  line-height: 1.5;
}
/* Sub-list under a step: bullets with proper hierarchy */
.answer-section .answer-sublist,
.message-content .answer-sublist {
  margin: 4px 0 6px 0;
  padding-left: 1.25em;
  list-style-type: disc;
}
.answer-section .answer-sublist li,
.message-content .answer-sublist li {
  margin: 0.2em 0 0.35em 0;
  padding-left: 2px;
  line-height: 1.5;
}
.answer-section .answer-sublist-nested,
.message-content .answer-sublist-nested {
  margin-left: 1em;
  padding-left: 0.5em;
  list-style-type: circle;
}
.message-content .answer-formatted .answer-sublist {
  margin: 0.25em 0 0.5em 0;
  padding-left: 1.25em;
}
.message-content .answer-formatted .answer-sublist li {
  margin: 0.2em 0;
}
.message-content .answer-formatted .answer-sublist-nested {
  margin-left: 1em;
  list-style-type: circle;
}

/* Inline code in responses */
.answer-section .answer-inline-code,
.message-content .answer-inline-code {
  background: rgba(30, 64, 175, 0.08);
  color: #1e40af;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-size: 12px;
  font-weight: 500;
}

/* Paragraph spacing in typed content - professional readability */
.answer-section .typing-content br + br,
.message-content br + br {
  display: block;
  content: "";
  margin-top: 6px;
}

.message-content strong,
.answer-section .typing-content strong {
  font-weight: 700;
  color: #1e3a5f;
}

.message-content em,
.answer-section .typing-content em {
  font-style: italic;
  color: #475569;
}

/* Bold + italic combined (e.g. ***word*** in headings) */
.message-content strong em,
.message-content em strong,
.answer-section .typing-content strong em,
.answer-section .typing-content em strong {
  font-weight: 700;
  font-style: italic;
  color: #334155;
}

/* ================================================================
   FORMATTED BOT ANSWER - steps, sub-steps, indentation (same as frontend)
   ================================================================ */
.message-content.answer-formatted {
  white-space: normal;
  line-height: 1.6;
  word-wrap: break-word;
}
.message-content.answer-formatted p.answer-plain {
  white-space: pre-wrap;
  margin: 0 0 0.75em;
}
.message-content.answer-formatted p {
  margin: 0 0 0.75em;
}
.message-content.answer-formatted p:last-child {
  margin-bottom: 0;
}
.message-content.answer-formatted p.answer-heading {
  font-weight: 700;
  margin-top: 1em;
  margin-bottom: 0.35em;
  font-size: 1em;
  color: #1e3a5f;
}
.message-content.answer-formatted p.answer-heading:first-child {
  margin-top: 0;
}
.message-content.answer-formatted .answer-indent {
  margin: 0.35em 0 0.75em;
  border-left: 2px solid #e2e8f0;
  font-size: 0.875em;
  font-weight: 400;
  line-height: 1.55;
  color: #334155;
  padding-left: 0.5em;
}
.message-content.answer-formatted .answer-indent-line {
  margin: 0.2em 0;
  padding-left: 0.25em;
}
.message-content.answer-formatted p.answer-step {
  margin: 0.4em 0 0.25em 0;
  padding-left: 0;
  line-height: 1.55;
  font-weight: 500;
  color: #1e3a5f;
}
.message-content.answer-formatted p.answer-step:first-of-type {
  margin-top: 0;
}
.message-content.answer-formatted .answer-indent {
  margin-top: 0.15em;
  margin-bottom: 0.6em;
}
.message-content.answer-formatted ol.list-top,
.message-content.answer-formatted ul.list-top {
  margin: 0.5em 0 0.75em;
  padding-left: 1.5em;
}
.message-content.answer-formatted ol.list-top {
  list-style-type: decimal;
}
.message-content.answer-formatted ul.list-top {
  list-style-type: disc;
}
.message-content.answer-formatted .list-top li {
  margin: 0.4em 0;
  padding-left: 0.35em;
}
.message-content.answer-formatted .list-top li.indent {
  list-style-type: circle;
  margin-left: 1.25em;
  padding-left: 0.25em;
}
.message-content.answer-formatted ol.list-nested,
.message-content.answer-formatted ul.list-nested {
  margin: 0.25em 0 0.5em 1em;
  padding-left: 1.25em;
}
.message-content.answer-formatted ol.list-nested {
  list-style-type: lower-alpha;
}
.message-content.answer-formatted ul.list-nested {
  list-style-type: circle;
}
.message-content.answer-formatted .list-nested li {
  margin: 0.2em 0;
}
.message-content.answer-formatted strong {
  font-weight: 700;
  color: #1e3a5f;
}
.message-content.answer-formatted strong em,
.message-content.answer-formatted em strong {
  font-weight: 700;
  font-style: italic;
  color: #0c4a6e;
}

/* Summary card */
.summary-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f8fafc 100%);
  border: 1px solid #bae6fd;
  border-left: 4px solid #0284c7;
  padding: 14px 16px 14px 18px;
  border-radius: 12px;
}

.summary-box h3 {
  color: #0369a1;
  font-size: 13px;
  margin-bottom: 10px;
}

.summary-box .typing-content {
  font-size: 14px;
  font-weight: 500;
  color: #0c4a6e;
  line-height: 1.6;
}

/* Steps card - numbered steps with badges */
.steps-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #2563eb;
  padding: 14px 16px;
  border-radius: 12px;
}

.steps-box .steps-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.steps-box h3 {
  color: #1e40af;
  font-size: 13px;
  margin: 0;
}

.steps-box .copy-btn {
  margin-left: auto;
}

/* Follow-up / Tip callout */
.followup-box {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 40%, #faf5ff 100%);
  border: 1px solid #c4b5fd;
  border-left: 4px solid #7c3aed;
  padding: 12px 16px;
  border-radius: 12px;
}

.followup-box h3 {
  color: #5b21b6;
  font-size: 13px;
  margin-bottom: 8px;
}

.followup-box .typing-content {
  font-size: 13px;
  color: #4c1d95;
  line-height: 1.55;
}

/* Video link at end of answer (no separate section; title as clickable link) */
.answer-video-at-end {
  margin-top: 0.75em;
  margin-bottom: 0;
}
.answer-video-at-end .answer-video-link {
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
  cursor: pointer;
  text-decoration: underline;
}
.answer-video-at-end .answer-video-link:hover {
  text-decoration: underline;
  color: #1e40af;
}

/* Suggested follow-up questions (Related questions) */
.suggested-follow-ups {
  border: 1px solid #e2e8f0;
  border-left: 4px solid #64748b;
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 8px;
}
.suggested-follow-ups-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}
.suggested-follow-ups-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.suggested-follow-up-chip {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.suggested-follow-up-chip:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

/* Sources list */
.sources-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #64748b;
  padding: 10px 14px;
  border-radius: 10px;
}

.sources-box h3 {
  font-size: 12px;
  color: #475569;
  margin: 0 0 8px 0;
}

.sources-box .sources-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.sources-box .sources-list li {
  margin-bottom: 4px;
}

/* Full answer (no steps) */
.answer-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #64748b;
  padding: 11px 11px;
  border-radius: 12px;
}

.answer-box h3 {
  color: #475569;
  font-size: 13px;
}

.answer-box .typing-content {
  font-size: 13px;
  color: #334155;
  line-height: 1.65;
}

/* Copy button - clear CTA */
.copy-btn {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy-btn:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #60a5fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.copy-btn:active {
  transform: translateY(0);
}

.copy-btn::before {
  content: "ðŸ“‹";
  font-size: 12px;
}

/* ================================================================
   CREATE PO CTA + FORM (inline inside bot answer)
   ================================================================ */
.po-cta {
  background: #f8fafc;
  border-left-color: #0ea5e9;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.po-cta-text {
  font-size: 13px;
  color: #334155;
  margin: 0;
}

.po-cta-button {
  align-items: flex-start;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #0ea5e9;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0369a1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.po-cta-button:hover {
  background: linear-gradient(135deg, #bae6fd 0%, #7dd3fc 100%);
  border-color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.po-cta-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.po-form-holder {
  margin-top: 4px;
}

.po-form {
  margin-top: 6px;
  background: #ffffff;
  border-left-color: #0ea5e9;
}

.po-form h3 {
  margin-bottom: 6px;
  font-size: 13px;
  color: #0f172a;
}

.po-form-intro {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 10px 0;
}

.po-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.po-row-inline {
  flex-direction: row;
  gap: 10px;
}

.po-row-inline .po-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.po-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.po-label-helper {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #94a3b8;
}

.po-input {
  width: 100%;
  padding: 7px 9px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f9fafb;
  color: #0f172a;
  outline: none;
  transition: all 0.15s ease;
}

.po-input:focus {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.po-input-date {
  min-height: 34px;
}

.po-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.po-submit-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.35);
  transition: all 0.2s ease;
}

.po-submit-btn:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 3px 10px rgba(34, 197, 94, 0.45);
  transform: translateY(-1px);
}

.po-submit-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.po-cancel-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.po-cancel-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}

.po-error {
  margin-top: 6px;
  font-size: 12px;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 6px;
  padding: 6px 8px;
  border: 1px solid #fecaca;
  display: none;
}

.po-error div + div {
  margin-top: 2px;
}

.po-summary-holder {
  margin-top: 10px;
}

.po-summary {
  margin-top: 4px;
  background: #f8fafc;
  border-left-color: #0ea5e9;
}

.po-summary-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 4px 10px;
  margin-bottom: 8px;
}

.po-summary-header .po-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: #64748b;
}

.po-summary-header .po-value {
  display: inline-block;
  margin-left: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
}

.po-summary-table {
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  font-size: 12px;
}

/* ================================================================
   PROJECT P&L TABLE
   ================================================================ */
/* Shared sizing tokens for chatbot data tables */
.chat-widget {
  --qp-table-font: 11px;
  --qp-table-head-font: 10px;
  --qp-table-gap: 0;
  --qp-table-col-gap: 6px;
  --qp-table-pad-y: 6px;
  --qp-table-pad-x: 8px;
  --qp-table-head-pad-y: 8px;
  --qp-table-scroll-max: 300px;
  --qp-table-scroll-max-many: 340px;
  --qp-table-border: #dbe4f0;
  --qp-table-head-bg: #f1f5f9;
  --qp-table-head-color: #1e3a8a;
  --qp-table-zebra: #f8fafc;
  --qp-table-hover: #f0f7ff;
  --qp-table-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --qp-table-radius: 10px;
  --qp-table-accent: #2563eb;
}

/* Shared shell: project list, P&L, item catalog, PO pending */
.project-list-table,
.project-pnl-table,
.item-catalog-projects-table {
  border-radius: var(--qp-table-radius);
  border: 1px solid var(--qp-table-border);
  background: #ffffff;
  font-size: var(--qp-table-font);
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: var(--qp-table-shadow);
}

.project-list-holder,
.project-pnl-holder,
.item-catalog-projects-holder,
.po-list-holder {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 8px;
  padding: 10px 10px 8px;
  border-radius: 12px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e8eef5;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.project-list-holder h3,
.project-pnl-holder h3,
.item-catalog-projects-holder h3,
.po-list-holder h3 {
  margin: 0 0 6px 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-list-holder h3::before,
.project-pnl-holder h3::before,
.item-catalog-projects-holder h3::before,
.po-list-holder h3::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  flex-shrink: 0;
}

.project-list-summary,
.project-pnl-summary,
.item-catalog-projects-summary,
.po-list-holder .project-list-summary {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  margin: 0 0 8px 0;
  padding: 4px 10px;
  line-height: 1.35;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
}

.chatbot-table-scroll-hint {
  margin: 0 0 8px 0;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 500;
  color: #475569;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.chat-widget.chat-widget-fullscreen .chatbot-table-scroll-hint {
  display: none;
}

.project-list-scroll,
.project-pnl-scroll,
.item-catalog-projects-scroll,
.po-list-holder .project-list-scroll {
  max-height: var(--qp-table-scroll-max);
  overflow: auto;
  border-radius: calc(var(--qp-table-radius) - 2px);
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e8eef5;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.project-list-scroll::-webkit-scrollbar,
.project-pnl-scroll::-webkit-scrollbar,
.item-catalog-projects-scroll::-webkit-scrollbar,
.po-list-holder .project-list-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.project-list-scroll::-webkit-scrollbar-thumb,
.project-pnl-scroll::-webkit-scrollbar-thumb,
.item-catalog-projects-scroll::-webkit-scrollbar-thumb,
.po-list-holder .project-list-scroll::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.project-list-scroll::-webkit-scrollbar-track,
.project-pnl-scroll::-webkit-scrollbar-track,
.item-catalog-projects-scroll::-webkit-scrollbar-track,
.po-list-holder .project-list-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.project-list-scroll.project-list-scroll--many-rows,
.po-list-holder .project-list-scroll.project-list-scroll--many-rows {
  max-height: var(--qp-table-scroll-max-many);
}

.project-list-row:not(.project-list-row-head) > div,
.project-pnl-row:not(.project-pnl-row-head):not(.project-pnl-row-total) > div,
.item-catalog-projects-row:not(.item-catalog-projects-row-head) > div,
.item-catalog-projects-cell,
.po-list-row:not(.project-list-row-head) > div,
.project-records-row:not(.project-list-row-head) > div,
.project-list-cell:not(.project-list-cell-head) {
  min-width: min-content;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  color: #1e293b;
  padding: var(--qp-table-pad-y) var(--qp-table-pad-x);
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.12s ease, color 0.12s ease;
  text-align: center;
}

.project-list-row-head > div,
.project-pnl-row-head > div,
.item-catalog-projects-row-head > div,
.po-list-row.project-list-row-head > div,
.project-records-row.project-list-row-head > div,
.project-list-cell-head {
  font-size: var(--qp-table-head-font);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--qp-table-head-color);
  background: var(--qp-table-head-bg);
  border-bottom: 1px solid #cbd5e1;
  padding-top: var(--qp-table-head-pad-y);
  padding-bottom: var(--qp-table-head-pad-y);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  line-height: 1.35;
  hyphens: auto;
  align-self: stretch;
  text-align: center;
}

.project-list-row:not(.project-list-row-head):hover > div,
.project-pnl-row:not(.project-pnl-row-head):not(.project-pnl-row-total):hover > div,
.item-catalog-projects-row:not(.item-catalog-projects-row-head):hover > div,
.po-list-row:not(.project-list-row-head):hover > div,
.project-records-row:not(.project-list-row-head):hover > div {
  background: var(--qp-table-hover);
}

.project-list-row:not(.project-list-row-head):last-child > div,
.item-catalog-projects-row:not(.item-catalog-projects-row-head):last-child > div,
.po-list-row:not(.project-list-row-head):last-child > div,
.project-records-row:not(.project-list-row-head):last-child > div {
  border-bottom: none;
}

.answer-section.project-pnl-holder {
  border: none;
}

.answer-section.project-pnl-holder:hover {
  box-shadow: none;
}

/* Export CSV — matches data-table toolbar (compact, blue) */
.project-graph-export-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.chatbot-btn-export-csv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0 0 6px 0;
  padding: 4px 10px 4px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #1d4ed8;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #93c5fd;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.chatbot-btn-export-csv::before {
  content: "";
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d4ed8' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.9;
}

.chatbot-btn-export-csv:hover {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #60a5fa;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.chatbot-btn-export-csv:active {
  background: #dbeafe;
  box-shadow: none;
}

.chatbot-btn-export-csv:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* Align export with table card (right side, same row feel as summary) */
.chatbot-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 8px 0;
  position: relative;
  z-index: 2;
}

.chatbot-table-toolbar--with-summary {
  justify-content: space-between;
}

.chatbot-table-toolbar .project-list-summary,
.chatbot-table-toolbar .item-catalog-projects-summary,
.chatbot-table-toolbar .project-pnl-summary {
  margin: 0;
  flex: 1 1 auto;
}

.chatbot-table-toolbar .chatbot-btn-export-csv {
  align-self: auto;
  margin: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.project-list-holder .chatbot-btn-export-csv,
.project-pnl-holder .chatbot-btn-export-csv,
.item-catalog-projects-holder .chatbot-btn-export-csv,
.po-list-holder .chatbot-btn-export-csv {
  align-self: flex-end;
  margin: -2px 0 6px 0;
}

.project-graph-export-actions .chatbot-btn-export-csv {
  margin: 0;
  padding: 5px 11px 5px 9px;
  font-size: 10px;
}

.project-pnl-holder {
  --qp-pnl-font: 11px;
  --qp-pnl-head-font: 10px;
  --qp-pnl-pad-y: 8px;
  --qp-pnl-pad-x: 10px;
  --qp-pnl-scroll-max: min(52vh, 460px);
}

.project-pnl-holder h3 {
  font-size: 14px;
}

.project-pnl-holder .project-pnl-summary {
  font-size: 12px;
  padding: 5px 12px;
}

.project-pnl-holder .project-pnl-table {
  font-size: var(--qp-pnl-font);
}

.project-pnl-holder .project-pnl-row-head > div {
  font-size: var(--qp-pnl-head-font);
  padding-top: calc(var(--qp-pnl-pad-y) + 1px);
  padding-bottom: calc(var(--qp-pnl-pad-y) + 1px);
}

.project-pnl-holder .project-pnl-row > div {
  padding: var(--qp-pnl-pad-y) var(--qp-pnl-pad-x);
}

.project-pnl-scroll {
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
}

.project-pnl-scroll.project-pnl-scroll--scrollable {
  max-height: var(--qp-pnl-scroll-max);
  overflow-y: auto;
}

.project-pnl-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.project-pnl-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.project-pnl-table.po-list-table {
  width: max-content;
  max-width: none;
  min-width: max-content;
  overflow: visible;
}

.project-pnl-table.po-list-table .project-list-cell--pnl-category {
  font-weight: 600;
  color: #1e3a8a;
  text-align: center;
}

.project-pnl-table.po-list-table .project-list-cell--pnl-total {
  background: linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
  font-weight: 700;
  color: #1e3a8a;
  border-top: 2px solid #93c5fd;
}

.project-pnl-table.po-list-table .project-list-cell--pnl-total:hover {
  background: linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
}

.project-pnl-row {
  display: grid;
  grid-template-columns:
    minmax(6.5rem, max-content) minmax(6.5rem, max-content) minmax(6.5rem, max-content)
    minmax(6.5rem, max-content) minmax(6.5rem, max-content) minmax(6rem, max-content);
  gap: 0 var(--qp-table-col-gap);
  padding: 0;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  justify-content: start;
}

.project-pnl-row:nth-child(even):not(.project-pnl-row-head):not(.project-pnl-row-total) > div {
  background: var(--qp-table-zebra);
}

.project-pnl-row-head {
  position: static;
  top: auto;
  z-index: auto;
  box-shadow: none;
}

.project-pnl-row > div:not(:first-child) {
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.project-pnl-row > div:first-child {
  font-weight: 600;
  color: #1e3a8a;
  text-align: center;
}

.project-pnl-row-total > div {
  background: linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
  font-weight: 700;
  color: #1e3a8a;
  border-top: 2px solid #93c5fd;
  border-bottom: none;
  text-align: center;
}

.project-pnl-row-total:hover > div {
  background: linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
}

.project-pnl-chart {
  margin: 4px 0 10px 0;
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.project-pnl-chart-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.project-pnl-chart-row {
  display: grid;
  grid-template-columns: 110px 1fr 120px;
  gap: 8px;
  align-items: center;
  margin: 4px 0;
}

.project-pnl-chart-label {
  font-size: 12px;
  color: #0f172a;
}

.project-pnl-chart-bar-host {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.project-pnl-chart-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  border-radius: 999px;
}

.project-pnl-chart-value {
  text-align: center;
  font-size: 12px;
  color: #1e3a8a;
  font-variant-numeric: tabular-nums;
}

.project-pnl-multi-chart {
  margin: 6px 0 14px 0;
  padding: 14px 14px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(165deg, #ffffff 0%, #f0f7ff 55%, #e8f2ff 100%);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.project-pnl-multi-chart--empty {
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}

.project-pnl-multi-chart-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-pnl-multi-chart-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: 0.01em;
}

.project-pnl-multi-chart-subtitle {
  font-size: 11px;
  color: #64748b;
}

.project-pnl-multi-chart-legend {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.project-pnl-multi-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.project-pnl-multi-chart-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.project-pnl-multi-chart-dot--quoted {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.project-pnl-multi-chart-dot--current {
  background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 100%);
}

.project-pnl-multi-chart-dot--actual {
  background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
}

.project-pnl-column-chart {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: stretch;
  min-height: calc(var(--pnl-chart-plot-h, 190px) + 56px);
}

.project-pnl-column-chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 0 28px 0;
  min-height: var(--pnl-chart-plot-h, 190px);
}

.project-pnl-column-chart-y-tick {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.project-pnl-column-chart-plot {
  position: relative;
  min-height: calc(var(--pnl-chart-plot-h, 190px) + 36px);
  padding: 0 4px 0 0;
}

.project-pnl-column-chart-grid {
  position: absolute;
  inset: 0 0 28px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.project-pnl-column-chart-grid-line {
  border-top: 1px dashed #dbe4f0;
}

.project-pnl-column-chart-categories {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  min-height: calc(var(--pnl-chart-plot-h, 190px) + 36px);
  padding-bottom: 28px;
}

.project-pnl-column-chart-category {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  height: 100%;
}

.project-pnl-column-chart-bar-group {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  flex: 1;
  width: 100%;
  height: var(--pnl-chart-plot-h, 190px);
  min-height: var(--pnl-chart-plot-h, 190px);
}

.project-pnl-column-chart-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  max-width: 40px;
  height: 100%;
  cursor: default;
}

.project-pnl-column-chart-bar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
}

.project-pnl-column-chart-bar-wrap:hover .project-pnl-column-chart-bar {
  filter: brightness(1.06);
  transform: scaleY(1.02);
  transform-origin: bottom center;
}

.project-pnl-column-chart-bar-value {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  line-height: 1;
  letter-spacing: 0.01em;
  max-height: 88px;
  overflow: visible;
  white-space: nowrap;
}

.project-pnl-column-chart-bar {
  width: 100%;
  flex-shrink: 0;
  min-height: 8px;
  border-radius: 6px 6px 2px 2px;
  transition: filter 0.15s ease, transform 0.15s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.project-pnl-column-chart-bar--quoted {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.project-pnl-column-chart-bar--current {
  background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 100%);
}

.project-pnl-column-chart-bar--actual {
  background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
}

.project-pnl-column-chart-bar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  transition: transform 0.15s ease;
}

.project-pnl-column-chart-bar-dot.project-pnl-column-chart-bar--quoted {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.project-pnl-column-chart-bar-dot.project-pnl-column-chart-bar--current {
  background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 100%);
}

.project-pnl-column-chart-bar-dot.project-pnl-column-chart-bar--actual {
  background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
}

.project-pnl-column-chart-bar-wrap:hover .project-pnl-column-chart-bar-dot {
  transform: scale(1.15);
}

.project-pnl-column-chart-cat-label {
  flex-shrink: 0;
  width: 100%;
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .project-pnl-holder {
    --qp-pnl-font: 11px;
    --qp-pnl-head-font: 10px;
    --qp-pnl-pad-y: 8px;
    --qp-pnl-pad-x: 8px;
  }

  .project-pnl-table {
    min-width: 480px;
  }

  .project-pnl-column-chart {
    grid-template-columns: 44px 1fr;
    min-height: 190px;
  }

  .project-pnl-column-chart-categories {
    gap: 6px;
    min-height: 168px;
  }

  .project-pnl-column-chart-bar-group {
    gap: 4px;
    min-height: 140px;
  }

  .project-pnl-column-chart-bar-wrap {
    max-width: 26px;
  }

  .project-pnl-column-chart-bar-value {
    font-size: 8px;
  }

  .project-pnl-column-chart-cat-label {
    font-size: 10px;
  }
}

/* ================================================================
   PROJECT LIST TABLE (between dates)
   ================================================================ */
/* Table answers: card style from .project-list-holder; drop default answer-section chrome */
.answer-section.project-list-holder,
.answer-section.project-pnl-holder,
.answer-section.item-catalog-projects-holder,
.answer-section.po-list-holder {
  border: none;
}

.answer-section.project-list-holder:hover,
.answer-section.project-pnl-holder:hover,
.answer-section.item-catalog-projects-holder:hover,
.answer-section.po-list-holder:hover {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.project-list-table:not(.po-list-table):not(.project-records-table) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.project-list-row:not(.po-list-row):not(.project-records-row) {
  display: grid;
  grid-template-columns:
    minmax(5.5rem, max-content) minmax(6.5rem, max-content) minmax(5rem, max-content)
    minmax(6rem, max-content) minmax(5rem, max-content) minmax(5rem, max-content) minmax(4.5rem, max-content);
  gap: 0 var(--qp-table-col-gap);
  padding: 0;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  justify-content: start;
}

.project-list-row:nth-child(even):not(.project-list-row-head):not(.po-list-row):not(.project-records-row) > div {
  background: var(--qp-table-zebra);
}

.project-list-row-head,
.po-list-row.project-list-row-head,
.project-records-row.project-list-row-head {
  position: static;
  top: auto;
  z-index: auto;
  box-shadow: none;
}

.project-list-scroll--many-rows .project-list-row-head {
  box-shadow: none;
}

.project-list-cell {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
  text-align: center;
}

.project-list-cell--nowrap {
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-list-row:not(.project-list-row-head) > div.project-list-cell--nowrap,
.po-list-row:not(.project-list-row-head) > div.project-list-cell--nowrap,
.project-records-row:not(.project-list-row-head) > div.project-list-cell--nowrap {
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-list-cell--expandable {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 2px 4px;
  text-align: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.project-list-cell-text {
  line-height: 1.35;
  word-break: break-word;
}

.project-list-cell--expandable:not(.project-list-cell--expanded) .project-list-cell-text {
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 2.5rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.project-list-cell--expandable.project-list-cell--expanded .project-list-cell-text {
  flex: 1 1 100%;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
}

.project-list-cell-more-btn {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 2px;
  flex-shrink: 0;
  border-radius: 4px;
  pointer-events: auto;
}

.project-list-cell-more-btn:hover {
  color: #1d4ed8;
  background: #eff6ff;
}

.project-list-cell-more-btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}

/* Status column accent (legacy project list last column) */
.project-list-row:not(.project-list-row-head):not(.po-list-row):not(.project-records-row) > div:last-child {
  font-weight: 600;
  color: #1d4ed8;
}

.project-list-load-more-wrap {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-list-load-more-counter {
  font-size: 11px;
  color: #475569;
  font-weight: 600;
  padding: 4px 10px;
  background: #f8fafc;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}

.project-list-load-more-btn {
  border: 1px solid #93c5fd;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: #1d4ed8;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.project-list-load-more-btn:hover {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #60a5fa;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.project-list-load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ================================================================
   SMALL WIDGET: horizontal scroll for wide tables (fullscreen unchanged)
   ================================================================ */
.chat-widget:not(.chat-widget-fullscreen) .project-list-scroll,
.chat-widget:not(.chat-widget-fullscreen) .project-pnl-scroll,
.chat-widget:not(.chat-widget-fullscreen) .item-catalog-projects-scroll,
.chat-widget:not(.chat-widget-fullscreen) .po-list-holder .project-list-scroll {
  overflow-x: auto;
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
}

.chat-widget:not(.chat-widget-fullscreen) .project-list-scroll::-webkit-scrollbar,
.chat-widget:not(.chat-widget-fullscreen) .project-pnl-scroll::-webkit-scrollbar,
.chat-widget:not(.chat-widget-fullscreen) .item-catalog-projects-scroll::-webkit-scrollbar,
.chat-widget:not(.chat-widget-fullscreen) .po-list-holder .project-list-scroll::-webkit-scrollbar {
  height: 8px;
}

.chat-widget:not(.chat-widget-fullscreen) .project-list-table:not(.po-list-table):not(.project-records-table),
.chat-widget:not(.chat-widget-fullscreen) .project-pnl-table:not(.po-list-table) {
  width: max-content;
  max-width: none;
  min-width: 100%;
  overflow: hidden;
}

.chat-widget:not(.chat-widget-fullscreen) .item-catalog-projects-table,
.chat-widget:not(.chat-widget-fullscreen) .project-list-table.po-list-table,
.chat-widget:not(.chat-widget-fullscreen) .project-pnl-table.po-list-table,
.chat-widget:not(.chat-widget-fullscreen) .project-list-table.project-records-table {
  width: max-content;
  max-width: none;
  min-width: max-content;
  overflow: visible;
}

/* PO pending table on small widget: keep shared grid cells clipped inside column tracks */
.chat-widget:not(.chat-widget-fullscreen) .po-list-holder .project-list-table.po-list-table {
  width: max-content;
  min-width: max-content;
  max-width: none;
  display: grid;
  isolation: isolate;
}

.chat-widget:not(.chat-widget-fullscreen) .po-list-holder .project-list-table.po-list-table .project-list-cell,
.chat-widget:not(.chat-widget-fullscreen) .po-list-holder .project-list-table.po-list-table .project-list-cell-head {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  position: static;
  box-sizing: border-box;
}

.chat-widget:not(.chat-widget-fullscreen) .po-list-holder .project-list-table .project-list-cell-head {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  word-break: normal;
}

.chat-widget:not(.chat-widget-fullscreen) .po-list-holder .project-list-cell--po-full,
.chat-widget:not(.chat-widget-fullscreen) .po-list-holder .project-list-cell--report-full {
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.chat-widget:not(.chat-widget-fullscreen) .project-list-row:not(.po-list-row):not(.project-records-row) {
  width: max-content;
  min-width: 100%;
  grid-template-columns:
    minmax(5rem, max-content) minmax(6rem, max-content) minmax(4.75rem, max-content)
    minmax(5.5rem, max-content) minmax(4.75rem, max-content) minmax(4.75rem, max-content) minmax(4.25rem, max-content);
}

.chat-widget:not(.chat-widget-fullscreen) .item-catalog-projects-row {
  width: max-content;
  min-width: 100%;
  grid-template-columns:
    minmax(5rem, max-content) minmax(5.5rem, max-content) minmax(6.5rem, max-content) minmax(6rem, max-content)
    minmax(5.5rem, max-content) minmax(5rem, max-content) minmax(5rem, max-content) minmax(5.5rem, max-content);
}

.chat-widget:not(.chat-widget-fullscreen) .item-catalog-projects-table--multi .item-catalog-projects-row {
  width: max-content;
  min-width: 100%;
  grid-template-columns:
    minmax(4.5rem, max-content) minmax(5rem, max-content) minmax(5.5rem, max-content) minmax(6.5rem, max-content)
    minmax(6rem, max-content) minmax(5.5rem, max-content) minmax(5rem, max-content) minmax(5rem, max-content) minmax(5.5rem, max-content);
}

.chat-widget:not(.chat-widget-fullscreen) .project-pnl-row {
  width: max-content;
  min-width: 100%;
  grid-template-columns:
    minmax(6.5rem, max-content) minmax(6rem, max-content) minmax(6rem, max-content)
    minmax(6rem, max-content) minmax(6rem, max-content) minmax(5.5rem, max-content);
}

.chat-widget:not(.chat-widget-fullscreen) .project-list-row:not(.po-list-row):not(.project-records-row) > div,
.chat-widget:not(.chat-widget-fullscreen) .item-catalog-projects-row:not(.item-catalog-projects-row-head) > div,
.chat-widget:not(.chat-widget-fullscreen) .item-catalog-projects-cell,
.chat-widget:not(.chat-widget-fullscreen) .project-list-table:not(.po-list-table):not(.project-records-table) .po-list-row:not(.project-list-row-head) > div,
.chat-widget:not(.chat-widget-fullscreen) .project-list-table:not(.po-list-table):not(.project-records-table) .project-records-row:not(.project-list-row-head) > div,
.chat-widget:not(.chat-widget-fullscreen) .project-pnl-row:not(.project-pnl-row-head) > div,
.chat-widget:not(.chat-widget-fullscreen) .project-list-table:not(.po-list-table):not(.project-records-table) .project-list-cell:not(.project-list-cell-head) {
  min-width: min-content;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
  box-sizing: border-box;
  position: relative;
}

.chat-widget:not(.chat-widget-fullscreen) .project-list-row-head > div,
.chat-widget:not(.chat-widget-fullscreen) .po-list-row.project-list-row-head > div,
.chat-widget:not(.chat-widget-fullscreen) .project-records-row.project-list-row-head > div,
.chat-widget:not(.chat-widget-fullscreen) .item-catalog-projects-row-head > div,
.chat-widget:not(.chat-widget-fullscreen) .project-pnl-row-head > div,
.chat-widget:not(.chat-widget-fullscreen) .project-list-cell-head {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  word-break: break-word;
  max-width: none;
}

/* Fullscreen: same balanced density, more vertical scroll room */
.chat-widget.chat-widget-fullscreen {
  --qp-table-font: 11px;
  --qp-table-head-font: 11px;
  --qp-table-head-pad-y: 9px;
  --qp-table-scroll-max: min(48vh, 380px);
  --qp-table-scroll-max-many: min(52vh, 440px);
}

.chat-widget.chat-widget-fullscreen .project-list-table:not(.po-list-table):not(.project-records-table),
.chat-widget.chat-widget-fullscreen .project-pnl-table:not(.po-list-table),
.chat-widget.chat-widget-fullscreen .item-catalog-projects-table,
.chat-widget.chat-widget-fullscreen .project-list-table.po-list-table,
.chat-widget.chat-widget-fullscreen .project-pnl-table.po-list-table,
.chat-widget.chat-widget-fullscreen .project-list-table.project-records-table {
  width: max-content;
  min-width: 100%;
  max-width: none;
}

.chat-widget.chat-widget-fullscreen .project-list-scroll,
.chat-widget.chat-widget-fullscreen .project-pnl-scroll,
.chat-widget.chat-widget-fullscreen .item-catalog-projects-scroll,
.chat-widget.chat-widget-fullscreen .po-list-holder .project-list-scroll {
  overflow-x: auto;
}

.chat-widget.chat-widget-fullscreen .project-list-row:not(.po-list-row):not(.project-records-row) {
  grid-template-columns:
    minmax(5.5rem, max-content) minmax(7rem, max-content) minmax(5rem, max-content)
    minmax(6.5rem, max-content) minmax(5rem, max-content) minmax(5rem, max-content) minmax(4.5rem, max-content);
}

.chat-widget.chat-widget-fullscreen .project-pnl-holder {
  --qp-pnl-font: 12px;
  --qp-pnl-head-font: 11px;
  --qp-pnl-pad-y: 10px;
  --qp-pnl-pad-x: 12px;
  --qp-pnl-scroll-max: none;
  width: 100%;
  max-width: 100%;
  padding: 12px 14px 10px;
  box-sizing: border-box;
}

.chat-widget.chat-widget-fullscreen .project-pnl-scroll {
  overflow: visible;
  max-height: none;
  border: none;
  background: transparent;
  width: 100%;
}

.chat-widget.chat-widget-fullscreen .project-pnl-scroll.project-pnl-scroll--scrollable {
  overflow: visible;
  max-height: none;
}

.chat-widget.chat-widget-fullscreen .project-pnl-row {
  grid-template-columns:
    minmax(6.5rem, max-content)
    minmax(7rem, max-content)
    minmax(7rem, max-content)
    minmax(7rem, max-content)
    minmax(7rem, max-content)
    minmax(6.5rem, max-content);
}

.chat-widget.chat-widget-fullscreen .project-pnl-row > div {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

.chat-widget.chat-widget-fullscreen .project-pnl-row-head > div {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  line-height: 1.35;
  letter-spacing: 0.01em;
  padding-top: calc(var(--qp-table-head-pad-y) + 1px);
  padding-bottom: calc(var(--qp-table-head-pad-y) + 1px);
}

.chat-widget.chat-widget-fullscreen .project-pnl-table:not(.po-list-table) {
  min-width: 0;
  width: max-content;
  max-width: none;
}

.chat-widget.chat-widget-fullscreen .project-pnl-column-chart {
  min-height: 280px;
}

.chat-widget.chat-widget-fullscreen .project-pnl-column-chart-bar-wrap {
  max-width: 52px;
}

.chat-widget.chat-widget-fullscreen .project-pnl-column-chart-bar-value {
  font-size: 11px;
  max-height: 100px;
}

/* PO pending — shared table grid keeps header + body columns aligned */
.project-list-table.po-list-table,
.project-list-table.project-records-table {
  display: grid;
  width: max-content;
  max-width: none;
  min-width: max-content;
  column-gap: var(--qp-table-col-gap);
  align-items: stretch;
}

.project-list-table.po-list-table .project-list-rows-host,
.project-list-table.project-records-table .project-list-rows-host {
  display: contents;
}

.project-list-table.po-list-table > .project-list-row-head.po-list-row,
.project-list-table.po-list-table > .project-list-rows-host > .po-list-row,
.project-list-table.po-list-table > .po-list-row:not(.project-list-row-head),
.project-list-table.po-list-table > .po-list-row.project-pnl-row-total,
.project-list-table.project-records-table > .project-list-row-head.project-records-row,
.project-list-table.project-records-table > .project-list-rows-host > .project-records-row,
.project-list-table.project-records-table > .project-records-row:not(.project-list-row-head) {
  display: contents;
}

.project-list-table.po-list-table .project-list-cell-head,
.project-list-table.project-records-table .project-list-cell-head {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.25;
  padding-left: 6px;
  padding-right: 6px;
}

.project-list-table.po-list-table .project-list-cell,
.project-list-table.project-records-table .project-list-cell {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.project-list-cell-head-line {
  display: block;
  line-height: 1.2;
}

/* PO / project / item catalog reports: all header labels on one line */
.po-list-holder .project-list-table .project-list-cell-head {
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  line-height: 1.3;
}

/* PO pending: Description / Project Name — one line, ellipsis, full text on hover */
.po-list-holder .project-list-table.po-list-table .project-list-cell--po-ellipsis,
.po-list-holder .project-list-table.po-list-table .po-list-row:not(.project-list-row-head) > .project-list-cell--po-ellipsis,
.chat-widget.chat-widget-fullscreen .po-list-holder .project-list-table.po-list-table .project-list-cell--po-ellipsis,
.chat-widget.chat-widget-fullscreen .po-list-holder .project-list-table.po-list-table .po-list-row:not(.project-list-row-head) > .project-list-cell--po-ellipsis {
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  line-height: 1.35;
  cursor: default;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Fullscreen PO table: keep cells clipped inside column tracks (same as widget mode) */
.chat-widget.chat-widget-fullscreen .po-list-holder .project-list-table.po-list-table .project-list-cell,
.chat-widget.chat-widget-fullscreen .po-list-holder .project-list-table.po-list-table .project-list-cell-head {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  position: static;
}

.chat-widget.chat-widget-fullscreen .po-list-holder .project-list-table.po-list-table .project-list-cell--po-ellipsis {
  overflow: hidden;
}

/* PO / project / item catalog: show full values for key ID / reference columns */
.po-list-holder .project-list-cell--po-full,
.po-list-holder .project-list-cell--report-full {
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: clip;
  line-height: 1.35;
}

.project-list-cell--zebra {
  background: var(--qp-table-zebra);
}

.project-list-table.po-list-table .project-list-cell:not(.project-list-cell-head):hover,
.project-list-table.project-records-table .project-list-cell:not(.project-list-cell-head):hover {
  background: var(--qp-table-hover);
}

.po-list-row,
.project-records-row {
  /* Legacy row shell; overridden to display:contents on data tables above. */
  display: grid;
  width: max-content;
  min-width: 100%;
  justify-content: start;
  gap: 0 var(--qp-table-col-gap);
  padding: 0;
}

.po-list-row:nth-child(even):not(.project-list-row-head) > div,
.project-records-row:nth-child(even):not(.project-list-row-head) > div {
  background: var(--qp-table-zebra);
}

.po-list-row.project-list-row-head,
.project-records-row.project-list-row-head {
  box-shadow: none;
}


/* Item catalog — uses po-list-table inline grid (see chatbot-item-catalog.js) */
.item-catalog-projects-table:not(.po-list-table) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.item-catalog-projects-table.po-list-table {
  width: max-content;
  max-width: none;
  min-width: 0;
}

.item-catalog-projects-row {
  display: grid;
  grid-template-columns:
    minmax(5rem, max-content) minmax(5.5rem, max-content) minmax(6rem, max-content) minmax(5.5rem, max-content)
    minmax(5rem, max-content) minmax(4.5rem, max-content) minmax(5rem, max-content);
  gap: 0 var(--qp-table-col-gap);
  padding: 0;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  justify-content: start;
}

.item-catalog-projects-table--multi .item-catalog-projects-row {
  grid-template-columns:
    minmax(4.5rem, max-content) minmax(5rem, max-content) minmax(5.5rem, max-content) minmax(6rem, max-content)
    minmax(5.5rem, max-content) minmax(5rem, max-content) minmax(4.5rem, max-content) minmax(5rem, max-content);
}

.item-catalog-projects-row:nth-child(even):not(.item-catalog-projects-row-head) > div {
  background: var(--qp-table-zebra);
}

.item-catalog-projects-row-head {
  position: static;
  top: auto;
  z-index: auto;
  box-shadow: none;
}

.chat-widget.chat-widget-fullscreen .item-catalog-projects-row {
  grid-template-columns:
    minmax(5.5rem, max-content) minmax(6rem, max-content) minmax(6.5rem, max-content) minmax(6rem, max-content)
    minmax(5.5rem, max-content) minmax(5rem, max-content) minmax(5.5rem, max-content);
}

.chat-widget.chat-widget-fullscreen .item-catalog-projects-table--multi .item-catalog-projects-row {
  grid-template-columns:
    minmax(5rem, max-content) minmax(5.5rem, max-content) minmax(6rem, max-content) minmax(6.5rem, max-content)
    minmax(6rem, max-content) minmax(5.5rem, max-content) minmax(5rem, max-content) minmax(5.5rem, max-content);
}

.project-list-cell-head--quoted,
.project-list-cell--quoted {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.po-list-row .project-list-cell--quoted,
.project-records-row .project-list-cell--quoted {
  font-weight: 600;
  color: #0f766e;
}

.po-list-row .project-list-cell--status,
.project-records-row .project-list-cell--status {
  text-align: center;
  font-weight: 600;
  color: #1d4ed8;
}

.po-list-row .project-list-cell--vendor-confirm,
.po-list-row .project-list-cell-head--vendor-confirm {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  line-height: 1.35;
}

.project-list-cell-head--status {
  text-align: center;
}

.po-summary-row {
  display: grid;
  grid-template-columns: 2fr 0.7fr 1fr 1fr;
  gap: 6px;
  padding: 6px 8px;
  align-items: center;
  text-align: center;
}

.po-summary-row:nth-child(even):not(.po-summary-row-head):not(.po-summary-row-total) {
  background: #f9fafb;
}

.po-summary-row-head {
  background: #e5f3ff;
  font-weight: 600;
  color: #1e3a8a;
}

.po-summary-row-total {
  background: #f1f5f9;
  font-weight: 600;
  color: #111827;
}

.po-summary-row-total div:first-child {
  grid-column: 1 / 4;
  text-align: center;
  padding-right: 6px;
}

/* ================================================================
   CREATE PROJECT CTA + FORM (inline inside bot answer)
   ================================================================ */
.project-cta {
  background: #f8fafc;
  border-left-color: #4f46e5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.project-cta-text {
  font-size: 13px;
  color: #334155;
  margin: 0;
}

.project-cta-button {
  align-items: flex-start;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #4f46e5;
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: #3730a3;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.project-cta-button:hover {
  background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
  border-color: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.project-cta-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.project-form-holder {
  margin-top: 4px;
}

.project-form {
  margin-top: 6px;
  background: #ffffff;
  border-left-color: #4f46e5;
  border: groove #4f46e5 1px;
}

.project-form h3 {
  margin-bottom: 6px;
  font-size: 13px;
  color: #0f172a;
}

.project-form-intro {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 10px 0;
}

.project-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.project-row-inline {
  flex-direction: row;
  gap: 10px;
}

.project-row-inline .project-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-required {
  color: #dc2626;
  font-weight: 700;
}

.project-input {
  width: 100%;
  padding: 7px 2px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f9fafb;
  color: #0f172a;
  outline: none;
  transition: all 0.15s ease;
}

.project-input:focus {
  background: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.18);
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.project-submit-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.35);
  transition: all 0.2s ease;
}

.project-submit-btn:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 3px 10px rgba(34, 197, 94, 0.45);
  transform: translateY(-1px);
}

.project-submit-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.project-cancel-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.project-cancel-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}

.project-error {
  margin-top: 6px;
  font-size: 12px;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 6px;
  padding: 6px 8px;
  border: 1px solid #fecaca;
  display: none;
}

.project-result {
  margin-top: 6px;
  font-size: 12px;
  color: #166534;
  background: #ecfdf3;
  border-radius: 6px;
  padding: 6px 8px;
  border: 1px solid #bbf7d0;
  display: none;
}

/* Match bot answer bubble typography (see .message.bot-message .message-content) */
.answer-section .project-result.project-result--answer-match {
  font-size: 13px;
  line-height: 1.65;
  font-weight: 400;
  color: #334155;
  background: #ffffff;
  border: none;
  padding: 11px 10px;
  border-radius: 14px 14px 14px 4px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  white-space: pre-wrap;
}

.project-form--completed .project-submit-btn {
  opacity: 0.85;
  cursor: default;
}

.chat-widget.chat-widget-fullscreen .answer-section .project-result.project-result--answer-match {
  font-size: 13px;
  line-height: 1.7;
  padding: 0;
  color: #1f2937;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.project-graphs-form {
  margin-top: 6px;
  background: #ffffff;
  border-left-color: #0f766e;
}

.project-graph-result:not(.project-result--answer-match) {
  font-weight: 600;
}

.project-graph-canvas {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-pie-chart {
  width: 100%;
}

.project-pie-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.project-pie-wrap {
  position: relative;
  width: 168px;
  min-width: 140px;
  flex-shrink: 0;
  aspect-ratio: 1;
}

.project-pie-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.project-pie-hole {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 58%;
  height: 58%;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  pointer-events: none;
}

.project-pie-total-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.project-pie-total-value {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.project-pie-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-pie-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #0f172a;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1.35;
}

.project-pie-legend-item.is-selected {
  background: #f0fdfa;
  outline: 1px solid #99f6e4;
}

.project-pie-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.project-pie-legend-text {
  flex: 1;
}

.project-pie-highlight {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.project-graph-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  align-items: center;
}

.project-graph-label {
  font-size: 12px;
  color: #0f172a;
  text-transform: capitalize;
}

.project-graph-bar-wrap {
  width: 100%;
  height: 22px;
  border-radius: 8px;
  background: #e2e8f0;
  overflow: hidden;
}

.project-graph-bar {
  height: 100%;
  min-width: 0;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
}

/* Customer dropdown (custom combobox with search + infinite scroll) */
.project-customer-combobox {
  position: relative;
}

.project-customer-combobox--enhanced .project-customer-display {
  padding-right: 36px;
}

.project-customer-display {
  cursor: pointer;
  width: 100%;
}

.project-customer-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  transition: transform 0.15s ease, color 0.15s ease;
}

.project-customer-combobox--open .project-customer-chevron {
  transform: translateY(-50%) rotate(180deg);
  color: #2563eb;
}

.project-customer-combobox--open .project-customer-display {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.project-customer-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 340px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  z-index: 20;
}

.project-customer-panel.hidden {
  display: none;
}

.project-customer-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 10px 10px 0 0;
}

.project-customer-search-icon {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: #94a3b8;
  pointer-events: none;
}

.project-customer-search {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 36px 9px 12px;
  font-size: 14px;
  color: #0f172a;
  background: #ffffff;
  outline: none;
}

.project-customer-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.project-customer-search::-webkit-search-cancel-button {
  cursor: pointer;
}

.project-customer-count {
  padding: 4px 14px 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #94a3b8;
  background: #ffffff;
}

.project-customer-list {
  overflow: auto;
  max-height: 270px;
  padding: 0;
  scrollbar-color: #3b82f6 #eef2ff;
  scrollbar-width: thin;
}

.project-customer-list::-webkit-scrollbar {
  width: 8px;
}

.project-customer-list::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 999px;
}

.project-customer-list::-webkit-scrollbar-track {
  background: #eef2ff;
}

.project-customer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  font-size: 14px;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  transition: background 0.12s ease;
}

.project-customer-item:last-of-type {
  border-bottom: none;
}

.project-customer-item:hover,
.project-customer-item:focus {
  background: #f8fafc;
}

.project-customer-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-customer-item-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
  word-break: break-word;
}

.project-customer-item-type {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  color: #64748b;
}

.project-customer-item-info {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #94a3b8;
  cursor: default;
}

.project-customer-item-info svg {
  display: block;
}

.project-customer-mark {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.project-customer-end {
  padding: 8px 10px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}


.project-cta-highlight {
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.35);
  border-color: #4f46e5;
}

.po-cta-highlight {
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.35);
  border-color: #0ea5e9;
}

/* ================================================================
   LOADING INDICATOR - ENHANCED
   ================================================================ */
#loading-indicator .message-body {
  max-width: 88%;
}

#loading-indicator .loading-bubble {
  padding: 12px 14px;
  min-width: 140px;
}

.chatbot-loading {
  display: flex;
  gap: 6px;
  padding: 2px 0;
  align-items: center;
}

.loading-message {
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
  line-height: 1.4;
  font-weight: 500;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  animation: dotPulse 1.4s ease-in-out infinite;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.loading-dot:nth-child(1) {
  animation-delay: 0s;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {
  0%,
  60%,
  100% {
    opacity: 0.4;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* ================================================================
   INPUT AREA - ENHANCED
   ================================================================ */
.chat-input-area {
  padding: 12px 14px;
  background: var(--qp-surface, #ffffff);
  border-top: 1px solid var(--qp-border, #e2e8f0);
  flex-shrink: 0;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
}

.chat-input-area form {
  display: block;
  width: 100%;
}

.chat-input-footer {
  flex-shrink: 0;
  text-align: center;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.chat-input-footer .chat-disclaimer {
  margin: 0;
  padding: 8px 16px 4px;
  font-size: 12px;
  line-height: 1.35;
  color: #3a8cff;
  background: transparent;
  border-top: none;
}

.chat-footer-responsible-ai {
  margin: 0;
  padding: 0 16px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #334155;
}

.chat-meta-fields {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.chat-meta-field {
  flex: 1;
  min-width: 120px;
}

.chat-meta-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.chat-meta-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #f9fafb;
  color: #374151;
  box-sizing: border-box;
}

.chat-meta-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
}

.input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  position: relative;
}

.input-field-group {
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.chat-menu-btn-standalone {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--qp-bg, #f8fafc);
  border: 1px solid var(--qp-border, #e2e8f0);
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  align-self: center;
}

.chat-menu-btn-standalone:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.chat-menu-btn-standalone:active {
  transform: scale(0.97);
}

.send-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.input-with-count {
  flex: 1;
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
}

.input-with-count .char-count {
  position: absolute;
  right: 12px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  font-size: 10px;
  color: #9ca3af;
  margin: 0;
  padding: 0;
  line-height: 1;
  pointer-events: none;
}
.input-with-count .char-count.near-limit {
  color: #dc2626;
}

#questionInput {
  width: 100%;
  min-height: 48px;
  height: 48px;
  padding: 0 52px 0 14px;
  border: 1px solid var(--qp-border, #e2e8f0);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
  background: var(--qp-bg, #f8fafc);
  line-height: 48px;
  color: var(--qp-text, #1e293b);
  box-sizing: border-box;
}

#questionInput:focus {
  background: var(--qp-surface, #ffffff);
  border-color: var(--qp-accent, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

#questionInput::placeholder {
  color: #94a3b8;
}

.send-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--qp-accent, #3b82f6) 0%, var(--qp-accent-dark, #1d4ed8) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  align-self: center;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(38, 118, 223, 0.09);
}

.send-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.45);
}

.send-btn:active:not(:disabled) {
  transform: translateY(0);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Cancel mode: red ✕ button while request is in progress */
.send-btn.send-btn-cancel {
  background: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}
.send-btn.send-btn-cancel:hover {
  background: #b91c1c;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

/* ================================================================
   RESPONSIVE DESIGN
   ================================================================ */
@media (max-width: 640px) {
  .chat-widget {
    --qp-table-font: 11px;
    --qp-table-head-font: 10px;
    --qp-table-head-pad-y: 7px;
    --qp-table-col-gap: 5px;
    --qp-table-gap: 0;
    --qp-table-pad-y: 6px;
    --qp-table-pad-x: 6px;
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-height: 100vh;
    transform: translateY(100%);
  }

  .chat-widget.visible {
    transform: translateY(0);
  }

  .message::before {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .message-body {
    max-width: 80%;
  }

  .chat-messages-wrapper {
    padding: 16px;
  }

  .quick-prompts {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .quick-prompt-btn {
    font-size: 12px;
    padding: 10px 12px;
  }

  .answer-section {
    padding: 12px 14px;
  }

  .enhanced-reply {
    padding: 12px 10px;
  }

  .answer-section ol.steps-list li {
    padding-left: 42px;
  }

  .answer-section ol.steps-list li::before {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .project-list-scroll,
  .project-pnl-scroll,
  .item-catalog-projects-scroll {
    max-width: 100%;
  }

  .chat-widget.chat-widget-fullscreen .project-list-table:not(.po-list-table):not(.project-records-table),
  .chat-widget.chat-widget-fullscreen .project-pnl-table:not(.po-list-table),
  .chat-widget.chat-widget-fullscreen .item-catalog-projects-table,
  .chat-widget.chat-widget-fullscreen .project-list-table.po-list-table,
  .chat-widget.chat-widget-fullscreen .project-pnl-table.po-list-table,
  .chat-widget.chat-widget-fullscreen .project-list-table.project-records-table {
    min-width: 0;
    width: max-content;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .chat-widget {
    --qp-table-font: 10px;
    --qp-table-head-font: 10px;
    --qp-table-head-pad-y: 7px;
    --qp-table-col-gap: 4px;
    --qp-table-gap: 0;
    --qp-table-pad-y: 5px;
    --qp-table-pad-x: 5px;
  }

  .chat-widget.chat-widget-fullscreen .project-list-table:not(.po-list-table):not(.project-records-table),
  .chat-widget.chat-widget-fullscreen .project-pnl-table:not(.po-list-table),
  .chat-widget.chat-widget-fullscreen .item-catalog-projects-table,
  .chat-widget.chat-widget-fullscreen .project-list-table.po-list-table,
  .chat-widget.chat-widget-fullscreen .project-pnl-table.po-list-table,
  .chat-widget.chat-widget-fullscreen .project-list-table.project-records-table {
    min-width: 0;
    width: max-content;
    max-width: none;
  }

  .chat-toggle-btn {
    right: 16px;
    bottom: 16px;
    width: 50px;
    height: 50px;
  }

  .chat-header {
    padding: 14px 16px;
  }
  
  .chat-icon {
    width: 42px;
    height: 42px;
  }
  
  .chat-title-info h1 {
    font-size: 17px;
  }
  
  .chat-subtitle {
    font-size: 11px;
  }

  .chat-title-info h1 {
    font-size: 16px;
  }

  .message-content {
    font-size: 13px;
    padding: 12px 14px;
  }

  .message::before {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .message-greeting h2 {
    font-size: 18px;
  }

  .chat-input-area {
    padding: 10px 12px;
  }

  #questionInput {
    min-height: 44px;
    height: 44px;
    line-height: 44px;
    padding: 0 48px 0 12px;
    font-size: 13px;
  }

  .chat-menu-btn-standalone {
    width: 44px;
    height: 44px;
  }

  .send-btn {
    width: 44px;
    height: 44px;
  }
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */
.hidden {
  display: none !important;
}

/* Added fade-in animation for smoother appearance */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

/* ================================================================
   TYPING ANIMATION CURSOR
   ================================================================ */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #3b82f6;
  margin-left: 2px;
  animation: blink 1s infinite;
  vertical-align: baseline;
}

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

.typing-content {
  min-height: 1em;
}

/* ================================================================
   FEEDBACK SCREEN (before close)
   ================================================================ */
.feedback-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  animation: fadeIn 0.25s ease-out;
}

.feedback-screen[hidden] {
  display: none !important;
}

.feedback-screen-content {
  text-align: center;
  padding: 24px 20px;
  max-width: 320px;
}

.feedback-screen-message {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.5;
  color: #374151;
  font-weight: 500;
}

.feedback-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.feedback-star {
  padding: 4px;
  border: none;
  background: none;
  cursor: pointer;
  color: #d1d5db;
  transition: transform 0.15s ease, color 0.15s ease;
}

.feedback-star:hover {
  transform: scale(1.15);
}

.feedback-star .star-icon {
  font-size: 32px;
  line-height: 1;
  display: block;
}

.feedback-star.active,
.feedback-star.filled {
  color: #f59e0b;
}

.feedback-star:hover {
  color: #fbbf24;
}

.feedback-rating-text {
  margin: 0 0 20px;
  font-size: 13px;
  color: #6b7280;
}

.feedback-screen-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feedback-submit-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
}

.feedback-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.feedback-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.feedback-skip-btn {
  padding: 8px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  color: #6b7280;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.feedback-skip-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

/* ================================================================
   CLOSE CHAT MODAL
   ================================================================ */
.close-chat-modal {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  animation: fadeIn 0.2s ease-out;
}

.close-chat-modal.show {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.close-chat-modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  width: calc(100% - 32px);
  max-width: min(320px, 100%);
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-chat-modal-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.close-chat-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.close-chat-modal-body {
  padding: 16px 20px;
}

.close-chat-modal-body p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

.close-chat-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px 12px;
}

.close-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.close-chat-btn svg {
  flex-shrink: 0;
}

.close-chat-btn.clear-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(87, 67, 67, 0.3);
}

.close-chat-btn.clear-btn:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.close-chat-btn.clear-btn:active {
  transform: translateY(0);
}

.close-chat-btn.keep-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.close-chat-btn.keep-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.close-chat-btn.keep-btn:active {
  transform: translateY(0);
}

.close-chat-cancel-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px 16px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-chat-cancel-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

.close-chat-cancel-btn:active {
  transform: scale(0.98);
}

/* ================================================================
   RESPONSIBLE AI MODAL
   ================================================================ */
.responsible-ai-modal {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1001;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  padding: 14px;
}

.responsible-ai-modal.show {
  display: flex;
}

.responsible-ai-modal-content {
  width: min(100%, 540px);
  max-height: calc(100% - 12px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.3);
}

.responsible-ai-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.responsible-ai-modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: #0f172a;
}

.responsible-ai-modal-close {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
}

.responsible-ai-modal-close:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.responsible-ai-modal-body {
  padding: 14px 16px 16px;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

.responsible-ai-modal-body p {
  margin: 0 0 10px;
}

.responsible-ai-modal-body ul {
  margin: 0 0 12px 18px;
}

.responsible-ai-modal-body li {
  margin-bottom: 7px;
}

.responsible-ai-modal-body h4 {
  margin: 6px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

@media (max-width: 480px) {
  .close-chat-modal-content {
    width: calc(100% - 24px);
    max-width: none;
  }

  .close-chat-modal-header,
  .close-chat-modal-body,
  .close-chat-modal-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .close-chat-cancel-btn {
    width: calc(100% - 32px);
    margin-left: 16px;
    margin-right: 16px;
  }
}

/* ================================================================
   EMBED SAFETY OVERRIDES (prevent host page CSS collisions)
   ================================================================ */
.chat-widget .chat-messages-wrapper .messages {
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
  padding-bottom: 8px !important;
}

.chat-widget .chat-messages-wrapper .message {
  display: flex !important;
  gap: 10px !important;
  margin: 0 !important;
}

.chat-widget .chat-messages-wrapper .message.bot-message {
  justify-content: flex-start !important;
}

.chat-widget .chat-messages-wrapper .message.user-message {
  justify-content: flex-end !important;
}

.chat-widget .chat-messages-wrapper .message-body {
  max-width: 85% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.chat-widget .chat-messages-wrapper .message-content {
  line-height: 1.65 !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: anywhere !important;
}

.chat-widget .chat-messages-wrapper .message-content p {
  margin: 0 0 0.75em !important;
}

.chat-widget .chat-messages-wrapper .message-content p:last-child {
  margin-bottom: 0 !important;
}

/* ================================================================
   Native CPQ mode (no iframe — uses Eva messages + input)
   ================================================================ */
/* Compact CPQ notice bar above input */
.cpq-mode-banner.cpq-trial-notice-card {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 2;
  padding: 8px 12px 8px 10px !important;
  border-radius: 8px !important;
  border: 1px solid #fecaca !important;
  border-left: 3px solid #dc2626 !important;
  background: #fff7f7 !important;
  box-shadow: none;
  color: #7f1d1d;
}

.chat-widget.chat-widget-fullscreen .chat-input-area .cpq-mode-banner.cpq-trial-notice-card {
  width: 100%;
  max-width: 87rem;
  margin: 0 auto;
}

.cpq-mode-banner.cpq-trial-notice-card .cpq-trial-notice-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.cpq-mode-banner.cpq-trial-notice-card .cpq-trial-notice-text {
  font-size: 12px;
  line-height: 1.35;
  color: #7f1d1d;
}

.cpq-mode-banner.cpq-trial-notice-card .cpq-trial-notice-text strong {
  font-weight: 700;
  color: #991b1b;
}

.cpq-trial-notice-exit-line {
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #991b1b;
}

.cpq-mode-exit-btn {
  appearance: none;
  flex-shrink: 0;
  align-self: center;
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #fff;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cpq-mode-exit-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* Loading card */
.cpq-loading-msg .message-body {
  padding-top: 2px;
}

.cpq-loading-card {
  display: flex !important;
  align-items: center;
  gap: 14px;
  max-width: min(480px, 100%) !important;
  padding: 14px 16px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(15, 39, 68, 0.12) !important;
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%) !important;
  box-shadow: 0 4px 18px rgba(15, 39, 68, 0.08);
}

.cpq-loading-spinner {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid rgba(15, 39, 68, 0.12);
  border-top-color: #1a5f9e;
  animation: cpq-spin 0.75s linear infinite;
}

@keyframes cpq-spin {
  to {
    transform: rotate(360deg);
  }
}

.cpq-loading-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cpq-loading-title {
  font-size: 14px;
  font-weight: 650;
  color: #0f2744;
  line-height: 1.3;
}

.cpq-loading-sub {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

/* Trial / beta warning card (shown when CPQ opens) */
.cpq-trial-notice .message-body {
  padding-top: 4px;
}

.chat-widget .message-content.cpq-trial-notice-card {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  max-width: min(640px, 100%) !important;
  width: 100%;
  padding: 12px 14px 12px 12px !important;
  border-radius: 10px !important;
  border: 1px solid #fecaca !important;
  border-left: 4px solid #dc2626 !important;
  background: #fff7f7 !important;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.08);
  color: #7f1d1d;
}

.cpq-trial-notice-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fee2e2;
  color: #dc2626;
}

.cpq-trial-notice-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cpq-trial-notice-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b91c1c;
}

.cpq-trial-notice-title {
  font-size: 14px;
  font-weight: 700;
  color: #991b1b;
  line-height: 1.3;
}

.cpq-trial-notice-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: #7f1d1d;
}

.chat-widget.chat-widget-fullscreen .message.bot-message .message-body > .message-content.cpq-trial-notice-card {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 12px 14px 12px 12px !important;
  border-radius: 10px !important;
  border: 1px solid #fecaca !important;
  border-left: 4px solid #dc2626 !important;
  background: #fff7f7 !important;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.08) !important;
  color: #7f1d1d !important;
  max-width: min(640px, 100%) !important;
}

/* Options / mode panels */
.cpq-native-options .message-body {
  padding-top: 4px;
}

.chat-widget .message-content.cpq-options-panel,
.chat-widget .message-content.cpq-mode-picker-panel {
  max-width: min(640px, 100%) !important;
  width: 100%;
  padding: 14px 16px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(15, 39, 68, 0.1) !important;
  background: #fff !important;
  box-shadow: 0 6px 24px rgba(15, 39, 68, 0.07);
}

.cpq-options-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.cpq-step-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(26, 95, 158, 0.1);
  color: #1a5f9e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cpq-options-title {
  font-size: 15px;
  font-weight: 650;
  color: #0f2744;
  line-height: 1.35;
}

.cpq-native-options-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
  line-height: 1.4;
}

.cpq-native-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cpq-native-chip {
  appearance: none;
  border: 1px solid rgba(15, 39, 68, 0.16);
  background: #f4f7fb;
  color: #0f2744;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  line-height: 1.3;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.cpq-native-chip:hover {
  background: #e8eef6;
  border-color: rgba(26, 95, 158, 0.45);
  box-shadow: 0 2px 8px rgba(15, 39, 68, 0.08);
}

.cpq-native-chip:active {
  transform: translateY(1px);
}

.cpq-native-chip:focus-visible {
  outline: 2px solid #1a5f9e;
  outline-offset: 2px;
}

.cpq-select-wrap {
  position: relative;
  max-width: 320px;
}

.cpq-native-select {
  width: 100%;
  max-width: 320px;
  padding: 10px 36px 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(15, 39, 68, 0.18);
  font-size: 14px;
  font-weight: 550;
  color: #0f2744;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230f2744' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
}

.cpq-native-select:focus {
  outline: none;
  border-color: #1a5f9e;
  box-shadow: 0 0 0 3px rgba(26, 95, 158, 0.15);
}

/* Long kit / folder options as cards */
.cpq-option-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(360px, 48vh);
  overflow: auto;
  padding-right: 2px;
}

.cpq-option-card {
  appearance: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid rgba(15, 39, 68, 0.12);
  background: #f8fafc;
  color: #0f2744;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.cpq-option-card:hover {
  background: #fff;
  border-color: rgba(26, 95, 158, 0.4);
  box-shadow: 0 4px 14px rgba(15, 39, 68, 0.08);
}

.cpq-option-card:focus-visible {
  outline: 2px solid #1a5f9e;
  outline-offset: 2px;
}

.cpq-option-card-idx {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.cpq-option-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cpq-option-card-label {
  font-size: 13px;
  font-weight: 550;
  line-height: 1.4;
  color: #0f2744;
  word-break: break-word;
}

.cpq-option-card-meta {
  font-size: 11px;
  color: #64748b;
}

.cpq-option-card-go {
  flex-shrink: 0;
  color: #1a5f9e;
  font-size: 16px;
  line-height: 1;
  opacity: 0.55;
  padding-top: 2px;
}

.cpq-option-card:hover .cpq-option-card-go {
  opacity: 1;
}

/* Mode start cards — match Eva chat choice style */
.cpq-mode-cards {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  max-width: 440px;
  width: 100%;
}

.cpq-mode-card {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: 440px !important;
  text-align: left !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  border: 1px solid #93c5fd !important;
  border-left: 4px solid #1e90ff !important;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
  color: #0c4a6e !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(30, 144, 255, 0.08) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease !important;
}

.cpq-mode-card:hover {
  border-color: #60a5fa !important;
  box-shadow: 0 4px 14px rgba(30, 144, 255, 0.16) !important;
  transform: translateY(-1px);
}

.cpq-mode-card:active {
  transform: translateY(0);
}

.cpq-mode-card-primary {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
}

.cpq-mode-card-icon {
  flex: 0 0 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 9px !important;
  background: #1e90ff !important;
  color: #fff !important;
  border: none !important;
}

.cpq-mode-card:not(.cpq-mode-card-primary) .cpq-mode-card-icon {
  background: #fff !important;
  color: #1e90ff !important;
  border: 1px solid #93c5fd !important;
}

.cpq-mode-card-copy {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 3px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

.cpq-mode-card-title {
  display: block !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: #0c4a6e !important;
  margin: 0 !important;
}

.cpq-mode-card-desc {
  display: block !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #475569 !important;
  line-height: 1.4 !important;
  margin: 0 !important;
}

.cpq-pdf-review .message-body {
  max-width: min(920px, 100%);
  width: 100%;
}

.cpq-pdf-review-panel {
  padding: 12px 14px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(15, 39, 68, 0.1) !important;
  background: #fff !important;
  box-shadow: 0 6px 24px rgba(15, 39, 68, 0.07);
}

.cpq-pdf-review-head {
  margin-bottom: 10px;
}

.cpq-pdf-review-title {
  font-size: 14px;
  font-weight: 700;
  color: #0c4a6e;
  line-height: 1.3;
}

.cpq-pdf-review-sub {
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.cpq-pdf-section-label {
  margin: 12px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e3a8a;
}

.cpq-pdf-table-scroll {
  max-height: 320px;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid #dbe4f0;
}

.cpq-pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  overflow: hidden;
}

.cpq-pdf-table-scroll .cpq-pdf-table {
  border: none;
  border-radius: 0;
}

.cpq-pdf-table th,
.cpq-pdf-table td {
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e8eef5;
}

.cpq-pdf-table thead th {
  background: #f1f5f9;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.cpq-pdf-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.cpq-pdf-table-meta {
  margin-top: 4px;
}

.cpq-pdf-table-meta th {
  width: 28%;
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 11px;
}

.cpq-pdf-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cpq-pdf-status.is-ok {
  background: #dcfce7;
  color: #166534;
}

.cpq-pdf-status.is-pending {
  background: #fef3c7;
  color: #92400e;
}

.cpq-pdf-status.is-none {
  background: #f1f5f9;
  color: #64748b;
}

.cpq-pdf-row-ai td {
  background: #fffbeb;
}

.cpq-pdf-plan-basis {
  font-size: 10.5px;
  color: #64748b;
  max-width: 260px;
}

/* Assembly / final BOM — reuse Project/PO holder look */
.cpq-bom-holder {
  width: 100%;
  max-width: 100%;
}

.chat-widget .message-content.cpq-assembly-picker,
.chat-widget .message.cpq-native-final-bom .message-content {
  max-width: min(960px, 100%);
  width: 100%;
  padding: 12px 14px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(15, 39, 68, 0.1) !important;
  background: #fff !important;
  box-shadow: 0 6px 24px rgba(15, 39, 68, 0.07);
}

.chat-widget.chat-widget-fullscreen .message.bot-message .message-body:has(.cpq-bom-holder) {
  max-width: min(1100px, 100%);
  width: 100%;
}

.cpq-assembly-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
}

.cpq-link-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #1a5f9e;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cpq-link-btn:disabled {
  opacity: 0.4;
  cursor: default;
  text-decoration: none;
}

.cpq-bom-scroll {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.cpq-bom-html-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
}

.cpq-bom-html-table th,
.cpq-bom-html-table td {
  padding: 9px 11px;
  text-align: left;
  border-bottom: 1px solid #e8eef5;
  vertical-align: middle;
  color: #1e293b;
}

.cpq-bom-html-table thead th {
  background: #f0f4f9;
  font-weight: 650;
  color: #0f2744;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

.cpq-bom-html-table .cpq-col-check {
  width: 36px;
  text-align: center;
}

.cpq-bom-html-table .cpq-col-sr {
  width: 72px;
  min-width: 64px;
  max-width: 88px;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #0f2744;
}

.cpq-bom-html-table th.cpq-col-sr {
  text-align: center;
}

.cpq-pdf-table td:first-child,
.cpq-pdf-table th:first-child {
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
  min-width: 3.25rem;
}

.cpq-bom-html-table tr.cpq-row-unselected td {
  opacity: 0.42;
}

.cpq-bom-html-table tbody tr:hover td {
  background: #f8fafc;
}

.cpq-bom-grid-table .project-list-cell,
.cpq-bom-grid-table .project-list-cell-head {
  padding: 8px 10px;
  border-bottom: 1px solid #e8eef5;
  font-size: 12px;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.cpq-bom-grid-table .project-list-cell-head {
  background: #f0f4f9;
  font-weight: 600;
  color: #0f2744;
  position: sticky;
  top: 0;
  z-index: 1;
}

.cpq-bom-grid-table .cpq-col-check {
  justify-content: center;
}

.cpq-bom-grid-table .cpq-row-unselected {
  opacity: 0.42;
}

.cpq-cell-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.cpq-bom-edit-input {
  width: 72px;
  padding: 5px 7px;
  border: 1px solid rgba(15, 39, 68, 0.2);
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
}

.cpq-bom-edit-input:focus {
  outline: none;
  border-color: #1a5f9e;
  box-shadow: 0 0 0 2px rgba(26, 95, 158, 0.12);
}

.cpq-bom-qty-input {
  width: 56px;
}

.cpq-bom-price-input {
  width: 84px;
}

.cpq-assembly-confirm-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cpq-export-row {
  margin-top: 12px;
}

.cpq-btn-confirm,
.cpq-btn-secondary {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.cpq-btn-confirm {
  background: #0f2744;
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 39, 68, 0.2);
}

.cpq-btn-confirm:hover:not(:disabled) {
  background: #1a3a5c;
}

.cpq-btn-confirm:active:not(:disabled) {
  transform: translateY(1px);
}

.cpq-btn-secondary {
  background: #fff;
  color: #0f2744;
  border: 1px solid rgba(15, 39, 68, 0.28);
}

.cpq-btn-secondary:hover:not(:disabled) {
  background: #f4f7fb;
}

.cpq-btn-confirm:disabled,
.cpq-btn-secondary:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.cpq-quote-ref {
  margin: 8px 0 0;
  font-size: 12px;
  color: #334155;
}

/* Soften CPQ bot bubbles while in CPQ mode */
.chat-widget.cpq-mode-active .chat-input-area {
  border-top: 1px solid rgba(15, 39, 68, 0.08);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.chat-widget.cpq-mode-active .chat-input-area .cpq-mode-banner {
  width: 100%;
  border-radius: 10px;
  box-sizing: border-box;
}

@media (max-width: 559px) {
  .chat-widget .message-content.cpq-options-panel,
  .chat-widget .message-content.cpq-mode-picker-panel {
    padding: 12px !important;
  }
}


/* ---- CPQ production overrides (fullscreen Eva flattens bubbles) ---- */
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body > .message-content.cpq-options-panel,
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body > .message-content.cpq-mode-picker-panel,
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body > .message-content.cpq-loading-card,
.chat-widget.chat-widget-fullscreen .message.bot-message .message-body > .message-content.cpq-assembly-picker {
  padding: 16px !important;
  background: #fff !important;
  border: 1px solid rgba(15, 39, 68, 0.12) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 28px rgba(15, 39, 68, 0.08) !important;
  color: #0f2744 !important;
  max-width: min(100%, 100%) !important;
}

.cpq-trial-notice-label,
.cpq-trial-notice-text,
.cpq-trial-notice-exit-line {
  display: block !important;
}

.cpq-trial-notice-copy {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.cpq-trial-notice-icon {
  display: inline-flex !important;
}

.cpq-mode-card-title,
.cpq-mode-card-desc,
.cpq-option-card-label,
.cpq-option-card-meta,
.cpq-options-title,
.cpq-native-options-label,
.cpq-loading-title,
.cpq-loading-sub {
  display: block !important;
}

.cpq-mode-card-copy,
.cpq-option-card-body,
.cpq-loading-copy {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  min-width: 0 !important;
}

.cpq-mode-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
}

.cpq-mode-banner.cpq-trial-notice-card {
  flex-wrap: nowrap !important;
  overflow: visible;
  opacity: 0.75;
}

.cpq-options-answered {
  opacity: 0.92;
}

.cpq-options-answered .cpq-options-panel {
  background: #f8fafc !important;
  border-style: solid !important;
}

.cpq-selected-mark {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(26, 95, 158, 0.1);
  color: #0f2744;
  font-size: 12px;
  font-weight: 650;
  border: 1px solid rgba(26, 95, 158, 0.2);
}

.cpq-option-picked {
  border-color: #1a5f9e !important;
  background: #e8f1fa !important;
  box-shadow: 0 0 0 1px rgba(26, 95, 158, 0.25);
}

.cpq-options-head-top {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100%;
}

.cpq-back-link {
  appearance: none !important;
  border: none !important;
  background: transparent !important;
  color: #1a5f9e !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  cursor: pointer !important;
  padding: 2px 4px !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
  line-height: 1.2 !important;
}

.cpq-back-link:hover {
  color: #0f2744 !important;
}

.cpq-options-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.cpq-selected-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 50%;
  background: #1e90ff;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.cpq-selected-mark {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 4px !important;
  margin-top: 10px !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  background: #eff6ff !important;
  color: #0c4a6e !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  border: 1px solid #bfdbfe !important;
}

.cpq-native-chip {
  border-radius: 10px !important;
  border: 1px solid #93c5fd !important;
  background: #eff6ff !important;
  color: #0c4a6e !important;
  font-weight: 650 !important;
  padding: 8px 14px !important;
}

.cpq-native-chip:hover {
  background: #dbeafe !important;
  border-color: #60a5fa !important;
}

.cpq-option-picked {
  background: #bfdbfe !important;
  border-color: #1e90ff !important;
}

.cpq-select-wrap {
  max-width: 100%;
}

.cpq-native-select {
  max-width: 100% !important;
  min-height: 44px;
  font-size: 14px !important;
}

/* ---------- Customer documents upload + review ---------- */
.cpq-doc-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 6px 0;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.cpq-doc-slot.is-set {
  border-style: solid;
  border-color: #86efac;
  background: #f0fdf4;
}

.cpq-doc-slot-copy {
  flex: 1;
  min-width: 0;
}

.cpq-doc-slot-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f2744;
}

.cpq-doc-slot-file {
  font-size: 11.5px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cpq-doc-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.cpq-doc-list {
  margin: 4px 0 8px 18px;
  padding: 0;
  font-size: 12px;
}

.cpq-doc-list li {
  margin: 2px 0;
  line-height: 1.4;
}

.cpq-doc-list.is-warning li {
  color: #92400e;
}

.cpq-doc-list.is-change li {
  color: #1e40af;
}

.cpq-doc-details {
  margin-top: 8px;
  border-top: 1px solid #e2e8f0;
  padding-top: 6px;
}

.cpq-doc-details > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.cpq-doc-bom .cpq-doc-total td {
  font-weight: 700;
  background: #f1f5f9;
}
