.chat-workspace {
  --chat-navy: var(--portal-navy, #14213d);
  --chat-teal: var(--portal-teal, #087f8c);
  --chat-green: #0aac87;
  --chat-mint: #e9f8f4;
  --chat-muted: #667085;
  --chat-line: #dce3e9;
  display: grid !important;
  grid-template-columns: minmax(235px, 25%) minmax(410px, 1fr) minmax(250px, 27%);
  width: 100%;
  height: clamp(620px, calc(100vh - 120px), 840px);
  overflow: hidden;
  border: 1px solid var(--chat-line);
  border-radius: 8px;
  background: #fff !important;
  box-shadow: 0 5px 18px rgba(28, 39, 56, .045);
  color: #263244;
}
.chat-modal-backdrop {
  --chat-navy: var(--portal-navy, #14213d);
  --chat-teal: var(--portal-teal, #087f8c);
  --chat-green: #0aac87;
  --chat-mint: #e9f8f4;
  --chat-muted: #667085;
  --chat-line: #dce3e9;
}
.chat-workspace *, .chat-workspace *::before, .chat-workspace *::after, .chat-modal-backdrop * { box-sizing: border-box; }
.chat-conversations-panel, .chat-main-area, .chat-context-panel { min-width: 0; min-height: 0; background: #fff !important; }
.chat-conversations-panel { display: flex; flex-direction: column; border-right: 1px solid var(--chat-line); }
.chat-panel-heading { flex: 0 0 auto; padding: 20px 15px 14px; }
.chat-panel-heading h1 { margin: 0 0 17px; color: var(--chat-navy); font: 700 1.05rem/1.3 Manrope, sans-serif; letter-spacing: 0; }
.chat-search { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #d3dbe2; border-radius: 6px; }
.chat-search .material-icons { color: #758395; font-size: 18px; }
.chat-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #263244; font: 500 .78rem/1.3 "DM Sans", sans-serif; }
.chat-search:focus-within { border-color: var(--chat-teal); outline: 3px solid rgba(8,127,140,.13); }
.chat-thread-list-items { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; padding: 0 !important; margin: 0 !important; list-style: none; }
.chat-thread-list-item { min-width: 0; min-height: 76px; margin: 0 !important; border: 0 !important; border-top: 1px solid #eef1f3 !important; border-radius: 0 !important; box-shadow: none !important; }
.chat-thread-btn { width: 100%; min-height: 76px; min-width: 0; display: flex !important; align-items: center; gap: 10px !important; padding: 13px 12px !important; border: 1px solid transparent !important; border-radius: 0 !important; background: #fff !important; text-align: left; cursor: pointer; }
.chat-thread-btn:hover { background: #f6f9f9 !important; }
.selected-chat-thread > .chat-thread-btn { border-color: #35bda5 !important; background: #edfaf7 !important; box-shadow: inset 3px 0 var(--chat-green) !important; }
.chat-avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: var(--chat-navy); color: #fff; font: 800 .72rem/1 Manrope, sans-serif; }
.chat-avatar.is-small { width: 36px; height: 36px; }
.chat-avatar.is-message { width: 32px; height: 32px; font-size: .63rem; }
.chat-avatar.is-quote { width: 44px; height: 44px; }
.chat-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.chat-thread-copy { min-width: 0; flex: 1; display: block; }
.chat-thread-primary { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-thread-primary strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--chat-navy); font: 700 .76rem/1.3 Manrope, sans-serif; }
.chat-thread-primary time { flex: 0 0 auto; color: #8793a1; font-size: .63rem; }
.chat-thread-activity { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.chat-unread-marker { width: 7px; height: 7px; border-radius: 50%; background: var(--chat-green); }
.chat-thread-list-item.is-unread .chat-thread-primary strong { font-weight: 800; }
.chat-thread-secondary { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--chat-muted); font-size: .69rem; }
.chat-quote-badge { display: inline-block; margin-top: 6px; padding: 3px 6px; border-radius: 4px; background: #fff1c7; color: #9a6700; font-size: .57rem; font-weight: 800; }
.chat-quote-badge.is-approved { background: #ddf5eb; color: #087052; }
.chat-quote-badge.is-declined { background: #fce8e6; color: #a62b21; }
.chat-quote-badge.is-viewed { background: #e9eef5; color: #536171; }
.chat-main-area { display: flex; flex-direction: column; position: relative; }
.chat-conversation-header { min-height: 72px; display: flex; align-items: center; gap: 11px; flex: 0 0 auto; padding: 12px 16px; border-bottom: 1px solid var(--chat-line); }
.chat-conversation-title { min-width: 0; flex: 1; }
.chat-conversation-title h2 { margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--chat-navy); font: 700 .9rem/1.25 Manrope, sans-serif; }
.chat-conversation-title p { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0; color: var(--chat-muted); font-size: .68rem; }
.chat-active-badge { padding: 3px 6px; border-radius: 4px; background: var(--chat-mint); color: #087052; font-weight: 800; }
.chat-icon-button { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #66778b; cursor: pointer; }
.chat-icon-button:hover { background: #edf3f4; color: var(--chat-teal); }
.chat-icon-button .material-icons { font-size: 19px; }
.chat-mobile-back { display: none; width: 34px; height: 34px; place-items: center; padding: 0; border: 0; background: transparent; color: var(--chat-navy); }
.chat-message-history { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; background: #fbfcfc; }
.chat-date-separator { display: flex; align-items: center; gap: 9px; margin: 4px 0 20px; color: #8793a1; font-size: .62rem; font-weight: 700; text-align: center; }
.chat-date-separator::before, .chat-date-separator::after { content: ""; height: 1px; flex: 1; background: #e8ecef; }
.chat-message-row { display: flex; align-items: flex-end; gap: 9px; margin: 0 0 16px; }
.chat-message-row.is-mine { justify-content: flex-end; }
.chat-message-content { max-width: min(72%, 520px); }
.chat-message-bubble { margin: 0; padding: 10px 13px; border-radius: 8px 8px 8px 2px; background: #eef1f4; color: #263244; font-size: .78rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.is-mine .chat-message-bubble { border-radius: 8px 8px 2px 8px; background: #e5f5f2; }
.chat-message-content time, .chat-quote-message > time { display: block; margin-top: 5px; color: #8995a3; font-size: .59rem; }
.is-mine .chat-message-content time, .is-mine .chat-quote-message > time { text-align: right; }
.chat-composer { flex: 0 0 auto; padding: 10px 16px 14px; border-top: 1px solid var(--chat-line); background: #fff; }
.chat-composer-toolbar { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.chat-composer-toolbar span, .chat-composer-toolbar button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: #748091; font-size: .7rem; font-weight: 700; }
.chat-composer-toolbar .is-active, .chat-composer-toolbar button:hover { color: var(--chat-green); }
.chat-composer-toolbar .material-icons { font-size: 16px; }
.chat-composer-toolbar button { margin-left: auto; padding: 7px 10px; border-radius: 6px; background: var(--chat-green); color: #fff; cursor: pointer; }
.chat-message-form { display: flex; align-items: flex-end; gap: 8px; padding: 8px 9px 8px 12px; border: 1px solid #d7dfe5; border-radius: 7px; }
.chat-message-form:focus-within { border-color: var(--chat-teal); outline: 3px solid rgba(8,127,140,.12); }
.chat-message-form textarea { flex: 1; min-width: 0; max-height: 110px; resize: none; border: 0; outline: 0; color: #263244; font: 500 .78rem/1.45 "DM Sans", sans-serif; }
.chat-send-button { width: 37px; height: 37px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 0; border-radius: 50%; background: var(--chat-green); color: #fff; cursor: pointer; }
.chat-send-button:disabled { opacity: .55; cursor: wait; }
.chat-send-button .material-icons { font-size: 18px; }
.chat-context-panel { overflow-y: auto; padding: 10px; border-left: 1px solid var(--chat-line); background: #f8fafb !important; }
.chat-context-card { padding: 15px; border: 1px solid var(--chat-line); border-radius: 7px; background: #fff; }
.chat-context-card + .chat-context-card { margin-top: 10px; }
.chat-context-card h2 { margin: 0 0 13px; color: var(--chat-navy); font: 700 .78rem/1.3 Manrope, sans-serif; }
.chat-context-card > p { margin: 0 0 12px; color: var(--chat-muted); font-size: .68rem; line-height: 1.5; }
.chat-context-list { margin: 0 0 14px; }
.chat-context-list > div { margin-bottom: 9px; }
.chat-context-list dt { color: #8793a1; font-size: .59rem; }
.chat-context-list dd { margin: 2px 0 0; color: var(--chat-navy); font-size: .7rem; font-weight: 700; overflow-wrap: anywhere; }
.chat-context-status { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.chat-context-status strong { color: var(--chat-navy); font-size: .7rem; }
.chat-context-status .chat-quote-badge { margin-top: 0; }
.chat-context-benefits { display: grid; gap: 7px; padding: 0; margin: 0 0 13px; list-style: none; }
.chat-context-benefits li { display: flex; gap: 6px; color: #526174; font-size: .65rem; }
.chat-context-benefits .material-icons { color: var(--chat-green); font-size: 14px; }
.chat-business-summary { display: flex; align-items: center; gap: 10px; }
.chat-business-summary strong, .chat-business-summary span { display: block; }
.chat-business-summary strong { color: var(--chat-navy); font-size: .7rem; }
.chat-business-summary span { margin-top: 3px; color: var(--chat-muted); font-size: .63rem; }
.chat-primary-button, .chat-secondary-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 12px; border: 1px solid var(--chat-green); border-radius: 6px; font: 700 .68rem/1.2 Manrope, sans-serif; cursor: pointer; }
.chat-primary-button { background: var(--chat-green); color: #fff; }
.chat-secondary-button { background: #fff; color: var(--chat-teal); }
.chat-secondary-button.is-danger { border-color: #d92d20; color: #b42318; }
.chat-context-card > .chat-primary-button, .chat-context-card > .chat-secondary-button { width: 100%; }
.chat-empty-state, .chat-list-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: 28px; text-align: center; color: var(--chat-muted); }
.chat-empty-state .material-icons, .chat-list-empty > .material-icons { color: #9aadb3; font-size: 34px; }
.chat-empty-state h2, .chat-list-empty strong { margin: 12px 0 5px; color: var(--chat-navy); font: 700 .9rem/1.3 Manrope, sans-serif; }
.chat-empty-state p, .chat-list-empty p { margin: 0; font-size: .72rem; line-height: 1.5; }
.chat-list-empty { min-height: 220px; list-style: none; }
.chat-thread-skeleton { height: 70px; margin: 8px 12px; border-radius: 6px; background: linear-gradient(90deg,#edf1f3 25%,#f8fafb 50%,#edf1f3 75%); background-size: 200% 100%; animation: chat-loading 1.3s infinite; }
.chat-messages-empty { padding: 40px 15px; color: var(--chat-muted); font-size: .75rem; text-align: center; }
.chat-quote-row .chat-quote-message { width: min(370px, 82%); }
.chat-quote-kicker { display: block; margin-bottom: 7px; color: var(--chat-muted); font-size: .64rem; font-weight: 700; }
.chat-quote-card { padding: 13px; border: 1px solid var(--chat-line); border-radius: 7px; background: #fff; text-align: left; box-shadow: 0 4px 14px rgba(28,39,56,.05); }
.chat-quote-card-header { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; }
.chat-quote-card-header strong, .chat-quote-card-header span { display: block; }
.chat-quote-card-header strong { color: var(--chat-navy); font-size: .7rem; }
.chat-quote-card-header div span { margin-top: 3px; color: var(--chat-muted); font-size: .64rem; }
.chat-quote-reference { margin: 11px 0 6px; color: var(--chat-muted); font-size: .61rem; }
.chat-quote-total { display: block; margin-bottom: 10px; color: var(--chat-navy); font: 800 1rem/1.2 Manrope,sans-serif; }
.chat-system-message { width: fit-content; max-width: 80%; display: grid; grid-template-columns: auto auto; gap: 3px 7px; margin: 14px auto; padding: 10px 13px; border-radius: 7px; background: #e8f7f2; color: #087052; }
.chat-system-message .material-icons { grid-row: 1/3; font-size: 19px; }
.chat-system-message strong { font-size: .68rem; }
.chat-system-message span { font-size: .62rem; }
.chat-system-message.is-declined { background: #fceeed; color: #a62b21; }
@keyframes chat-loading { to { background-position: -200% 0; } }

.chat-modal-open { overflow: hidden; }
.chat-modal-backdrop { position: fixed; inset: 0; z-index: 1400; display: grid; place-items: center; padding: 24px; background: rgba(20,33,61,.48); }
.chat-modal { width: min(860px, 100%); max-height: min(92vh, 920px); display: flex; flex-direction: column; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 24px 60px rgba(20,33,61,.24); color: #263244; }
.chat-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 19px 22px; border-bottom: 1px solid #dce3e9; }
.chat-modal-header h2 { margin: 0 0 4px; color: #14213d; font: 700 1.05rem/1.3 Manrope,sans-serif; }
.chat-modal-header p { margin: 0; color: #667085; font-size: .73rem; }
.chat-modal-body { overflow-y: auto; padding: 22px; }
.quick-quote-form { display: grid; gap: 17px; }
.quick-quote-form label { display: grid; gap: 6px; color: #344054; font-size: .7rem; font-weight: 700; }
.quick-quote-form input, .quick-quote-form textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #ccd6de; border-radius: 6px; color: #263244; font: 500 .76rem/1.4 "DM Sans",sans-serif; }
.quick-quote-form input:focus, .quick-quote-form textarea:focus { outline: 3px solid rgba(8,127,140,.13); border-color: #087f8c; }
.quote-context-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid #dce3e9; border-radius: 6px; background: #dce3e9; }
.quote-context-grid > div { padding: 10px; background: #f6f9f9; }
.quote-context-grid dt { color: #7c8998; font-size: .6rem; }
.quote-context-grid dd { margin: 3px 0 0; color: #14213d; font-size: .7rem; font-weight: 700; overflow-wrap: anywhere; }
.quote-form-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.quote-form-heading h3 { margin: 0; color: #14213d; font: 700 .83rem/1.3 Manrope,sans-serif; }
.quote-items-editor { display: grid; gap: 9px; }
.quote-item-row { display: grid; grid-template-columns: minmax(180px,1fr) 75px 100px 100px 36px; gap: 8px; align-items: end; padding: 11px; border: 1px solid #e2e7eb; border-radius: 6px; background: #fbfcfc; }
.quote-item-amount { min-height: 36px; display: flex; align-items: center; color: #14213d; font-size: .72rem; font-weight: 700; }
.quote-options-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.quote-options-grid.is-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.quote-checkbox-field { display: flex !important; flex-direction: row; align-items: center; align-self: end; min-height: 37px; }
.quote-checkbox-field input { width: 17px; }
.quote-live-preview { padding: 15px; border: 1px solid #c6e3de; border-radius: 6px; background: #f8fcfb; }
.quote-preview-brand { display: flex; align-items: center; gap: 10px; }
.quote-preview-brand strong, .quote-preview-brand span { display: block; }
.quote-preview-brand strong { color: #14213d; font-size: .73rem; }
.quote-preview-brand span { margin-top: 3px; color: #667085; font-size: .62rem; }
.quote-live-preview > h3 { margin: 14px 0 3px; color: #14213d; font: 700 .85rem/1.3 Manrope,sans-serif; }
.quote-live-preview > p { margin: 0; color: #667085; font-size: .66rem; }
.quote-preview-totals { width: min(280px,100%); margin: 12px 0 0 auto; }
.quote-preview-totals div, .quote-document-totals div { display: flex; justify-content: space-between; gap: 20px; padding: 5px 0; font-size: .7rem; }
.quote-preview-totals dd, .quote-document-totals dd { margin: 0; font-weight: 700; }
.quote-preview-totals div:last-child, .quote-document-totals div:last-child { padding-top: 8px; border-top: 1px solid #ccd8d8; color: #14213d; font-weight: 800; }
.chat-modal-actions { display: flex; justify-content: flex-end; gap: 9px; }
.quote-form-status { margin: 0; color: #667085; font-size: .69rem; }
.quote-form-status.is-error { color: #b42318; }
.quote-document { padding: 4px; }
.quote-document-header { display: flex; align-items: center; gap: 11px; padding-bottom: 16px; border-bottom: 2px solid #14213d; }
.quote-document-header strong, .quote-document-header span { display: block; }
.quote-document-header strong { color: #14213d; font: 700 .8rem/1.3 Manrope,sans-serif; }
.quote-document-header span { margin-top: 3px; color: #667085; font-size: .65rem; }
.quote-document-title { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0; }
.quote-document-title > div:last-child { text-align: right; }
.quote-document-title span { display: block; color: #087f8c; font-size: .61rem; font-weight: 800; }
.quote-document-title h3 { margin: 4px 0; color: #14213d; font: 800 1.25rem/1.25 Manrope,sans-serif; }
.quote-document-title p, .quote-document-title strong { margin: 0; color: #667085; font-size: .68rem; }
.quote-document-items { border: 1px solid #dce3e9; border-radius: 6px; overflow: hidden; }
.quote-document-items > div { display: grid; grid-template-columns: minmax(180px,1fr) 60px 100px 100px; gap: 8px; padding: 10px; border-bottom: 1px solid #e8ecef; font-size: .7rem; }
.quote-document-items > div:last-child { border-bottom: 0; }
.quote-document-items .is-header { background: #f3f6f7; color: #667085; font-size: .62rem; font-weight: 700; }
.quote-document-items strong { text-align: right; }
.quote-document-totals { width: min(310px,100%); margin: 17px 0 0 auto; }
.quote-document-note { margin-top: 17px; }
.quote-document-note h4 { margin: 0 0 4px; color: #14213d; font: 700 .72rem/1.3 Manrope,sans-serif; }
.quote-document-note p { margin: 0; color: #526174; font-size: .7rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.quote-viewer-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 17px; border-top: 1px solid #e2e7eb; }
.quote-viewer-footer .chat-quote-badge { margin: 0 auto 0 0; }

@media (max-width: 1100px) {
  .chat-workspace { grid-template-columns: minmax(250px,32%) minmax(390px,1fr); }
  .chat-context-panel { position: absolute; z-index: 10; top: 0; right: 0; bottom: 0; width: min(310px,90%); transform: translateX(102%); box-shadow: -10px 0 30px rgba(20,33,61,.14); transition: transform .2s ease; }
  .chat-workspace { position: relative; }
  .chat-workspace.show-context .chat-context-panel { transform: translateX(0); }
}
@media (max-width: 700px) {
  .chat-workspace { display: block !important; height: calc(100vh - 92px); min-height: 560px; border-radius: 0; }
  .chat-conversations-panel, .chat-main-area { width: 100%; height: 100%; }
  .chat-main-area { display: none; }
  .chat-workspace.has-active-chat .chat-conversations-panel { display: none; }
  .chat-workspace.has-active-chat .chat-main-area { display: flex; }
  .chat-mobile-back { display: grid; }
  .chat-message-history { padding: 16px 12px; }
  .chat-message-content { max-width: 82%; }
  .chat-context-panel { position: fixed; z-index: 1200; top: 74px; width: min(320px,100%); }
  .chat-modal-backdrop { padding: 0; align-items: stretch; }
  .chat-modal { width: 100%; max-height: 100vh; border-radius: 0; }
  .quote-item-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quote-item-row > label:first-child { grid-column: 1/-1; }
  .quote-item-row .chat-icon-button { grid-column: 2; justify-self: end; }
  .quote-options-grid.is-three { grid-template-columns: minmax(0,1fr); }
  .quote-document-items > div { grid-template-columns: minmax(100px,1fr) 38px 72px 78px; gap: 5px; font-size: .62rem; }
}
@media (max-width: 400px) {
  .chat-conversation-header { padding-inline: 10px; }
  .chat-composer { padding-inline: 10px; }
  .chat-quote-row .chat-quote-message { width: 92%; }
  .chat-modal-header, .chat-modal-body { padding: 16px; }
  .quote-context-grid, .quote-options-grid { grid-template-columns: minmax(0,1fr); }
  .quote-document-title { display: grid; }
  .quote-document-title > div:last-child { text-align: left; }
  .quote-document-items > div { grid-template-columns: minmax(95px,1fr) 32px 62px 68px; padding: 8px 5px; }
}
@media (prefers-reduced-motion: reduce) { .chat-thread-skeleton { animation: none; } .chat-context-panel { transition: none; } }
#chat-section { --chat-navy: var(--portal-navy, #14213d); --chat-teal: var(--portal-teal, #087f8c); --chat-mint: #e8f7f3; --chat-line: #dce3e9; --chat-muted: #667085; padding: 0 !important; }
#chat-section *, .chat-modal-backdrop * { box-sizing: border-box; }
.chat-workspace { display: grid !important; grid-template-columns: 240px minmax(560px, 1fr) 280px; height: calc(100vh - 112px); min-height: 610px; overflow: hidden; border: 1px solid var(--chat-line); border-radius: 8px; background: #fff !important; box-shadow: 0 5px 18px rgba(28,39,56,.045); }
.chat-conversations-panel, .chat-main-area, .chat-context-panel { min-width: 0; min-height: 0; background: #fff !important; }
.chat-conversations-panel { display: flex; flex-direction: column; border-right: 1px solid var(--chat-line); }
.chat-panel-heading { padding: 20px 14px 13px; border-bottom: 1px solid var(--chat-line); }
.chat-panel-heading h1 { margin: 0 0 17px; color: var(--chat-navy); font: 700 1.12rem/1.3 Manrope,sans-serif; letter-spacing: 0; }
.chat-search { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid #ced7df; border-radius: 6px; color: #7c8997; }
.chat-search:focus-within { border-color: var(--chat-teal); outline: 3px solid rgba(8,127,140,.13); }
.chat-search .material-icons { font-size: 18px; }
.chat-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #263244; font: 500 .79rem/1.2 "DM Sans",sans-serif; }
.chat-thread-list-items { flex: 1; overflow-y: auto; min-height: 0; padding: 0; margin: 0; list-style: none; }
.chat-thread-list-item { margin: 0; border-bottom: 1px solid #edf0f2; }
.chat-thread-btn { width: 100%; display: flex; align-items: center; gap: 11px; padding: 14px 12px; border: 0; border-left: 3px solid transparent; border-radius: 0; background: #fff; color: #263244; text-align: left; cursor: pointer; }
.chat-thread-btn:hover { background: #f7f9fa; }
.selected-chat-thread .chat-thread-btn { border-left-color: var(--chat-teal); background: #edf9f6 !important; }
.chat-avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: #e8edf1; color: var(--chat-navy); font: 800 .75rem/1 Manrope,sans-serif; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-avatar.is-small { width: 37px; height: 37px; }
.chat-avatar.is-message { width: 32px; height: 32px; margin-bottom: 18px; font-size: .64rem; }
.chat-avatar.is-quote { width: 46px; height: 46px; }
.chat-thread-copy, .chat-thread-primary, .chat-thread-secondary { display: block; min-width: 0; }
.chat-thread-copy { flex: 1; }
.chat-thread-primary { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-thread-primary strong { overflow: hidden; color: var(--chat-navy); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread-primary time { flex: 0 0 auto; color: #8b97a5; font-size: .65rem; }
.chat-thread-secondary { margin-top: 5px; overflow: hidden; color: var(--chat-muted); font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.chat-quote-badge { display: inline-flex; width: fit-content; margin-top: 6px; padding: 3px 6px; border-radius: 4px; background: #fff2cc; color: #996600; font-size: .58rem; font-weight: 800; }
.chat-quote-badge.is-approved { background: #e5f6ed; color: #14704e; }
.chat-quote-badge.is-declined { background: #feeceb; color: #b42318; }
.chat-quote-badge.is-viewed { background: #edf1f5; color: #526174; }
.chat-quote-badge.is-completed { background: #e8eef8; color: #34598c; }
.chat-list-empty { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; color: var(--chat-muted); text-align: center; }
.chat-list-empty .material-icons { color: #93a2ae; font-size: 28px; }
.chat-list-empty strong { color: var(--chat-navy); font-size: .85rem; }
.chat-list-empty p { margin: 0; font-size: .72rem; line-height: 1.5; }
.chat-thread-skeleton { height: 67px; margin: 10px; border-radius: 6px; background: linear-gradient(90deg,#edf1f3 25%,#f8fafb 50%,#edf1f3 75%); background-size: 200% 100%; animation: chat-loading 1.3s infinite; }
.chat-main-area { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.chat-empty-state { grid-row: 1/-1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }
.chat-empty-state > .material-icons { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--chat-mint); color: var(--chat-teal); font-size: 27px; }
.chat-empty-state h2 { margin: 13px 0 5px; color: var(--chat-navy); font: 700 1rem/1.3 Manrope,sans-serif; }
.chat-empty-state p { margin: 0; color: var(--chat-muted); font-size: .78rem; }
.chat-conversation-header { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 76px; padding: 12px 16px; border-bottom: 1px solid var(--chat-line); }
.chat-conversation-title h2 { margin: 0 0 4px; overflow: hidden; color: var(--chat-navy); font: 700 .9rem/1.3 Manrope,sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.chat-conversation-title p { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0; color: var(--chat-muted); font-size: .68rem; }
.chat-active-badge { padding: 3px 6px; border-radius: 4px; background: var(--chat-mint); color: #14704e; font-weight: 800; }
.chat-icon-button, .chat-mobile-back { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #6b7c8f; cursor: pointer; }
.chat-icon-button:hover, .chat-mobile-back:hover { background: #f0f4f5; color: var(--chat-teal); }
.chat-icon-button .material-icons, .chat-mobile-back .material-icons { font-size: 20px; }
.chat-mobile-back { display: none; }
.chat-message-history { min-height: 0; overflow-y: auto; padding: 17px 20px; background: #fbfcfc; scroll-behavior: smooth; }
.chat-date-separator { display: flex; align-items: center; gap: 10px; margin: 5px 0 16px; color: #8a96a3; font-size: .64rem; text-align: center; }
.chat-date-separator::before, .chat-date-separator::after { content: ""; height: 1px; flex: 1; background: #e6ebee; }
.chat-message-row { display: flex; align-items: flex-end; gap: 9px; margin: 0 0 14px; }
.chat-message-row.is-mine { justify-content: flex-end; }
.chat-message-content { max-width: 72%; }
.chat-message-bubble { margin: 0; padding: 10px 13px; border: 1px solid #e4e9ed; border-radius: 8px 8px 8px 2px; background: #f0f3f5; color: #314052; font-size: .78rem; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.is-mine .chat-message-bubble { border-color: #cce8e2; border-radius: 8px 8px 2px 8px; background: #eaf7f4; }
.chat-message-content time, .chat-quote-message > time { display: block; margin-top: 4px; color: #8b97a4; font-size: .61rem; }
.is-mine .chat-message-content time, .is-mine .chat-quote-message > time { text-align: right; }
.chat-messages-empty { margin-top: 60px; color: var(--chat-muted); font-size: .76rem; text-align: center; }
.chat-composer { padding: 10px 16px 13px; border-top: 1px solid var(--chat-line); background: #fff; }
.chat-composer-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.chat-composer-toolbar span, .chat-composer-toolbar button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--chat-muted); font-size: .7rem; font-weight: 700; }
.chat-composer-toolbar .is-active { color: var(--chat-teal); }
.chat-composer-toolbar button { padding: 6px 9px; border-radius: 5px; background: var(--chat-teal); color: #fff; cursor: pointer; }
.chat-composer-toolbar .material-icons { font-size: 15px; }
.chat-message-form { display: grid; grid-template-columns: minmax(0,1fr) 39px; align-items: end; gap: 9px; padding: 7px; border: 1px solid #d5dde3; border-radius: 7px; }
.chat-message-form:focus-within { border-color: var(--chat-teal); outline: 3px solid rgba(8,127,140,.12); }
.chat-message-form textarea { min-height: 34px; max-height: 100px; resize: vertical; padding: 8px; border: 0; outline: 0; color: #263244; font: 500 .78rem/1.4 "DM Sans",sans-serif; }
.chat-send-button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--chat-teal); color: #fff; cursor: pointer; }
.chat-send-button:disabled { opacity: .55; cursor: wait; }
.chat-send-button .material-icons { font-size: 19px; }
.chat-context-panel { overflow-y: auto; padding: 12px; border-left: 1px solid var(--chat-line); background: #f9fbfb !important; }
.chat-context-placeholder { display: grid; place-items: center; min-height: 180px; padding: 20px; color: var(--chat-muted); font-size: .73rem; text-align: center; }
.chat-context-card { padding: 14px; border: 1px solid var(--chat-line); border-radius: 7px; background: #fff; }
.chat-context-card + .chat-context-card { margin-top: 11px; }
.chat-context-card h2 { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid #edf0f2; color: var(--chat-navy); font: 700 .8rem/1.3 Manrope,sans-serif; }
.chat-context-card > p { margin: 0 0 12px; color: var(--chat-muted); font-size: .69rem; line-height: 1.5; }
.chat-context-list { display: grid; gap: 10px; margin: 0 0 13px; }
.chat-context-list div { display: grid; gap: 2px; }
.chat-context-list dt { color: var(--chat-muted); font-size: .61rem; }
.chat-context-list dd { margin: 0; color: var(--chat-navy); font-size: .7rem; font-weight: 700; overflow-wrap: anywhere; }
.chat-context-card .chat-secondary-button, .chat-context-card .chat-primary-button { width: 100%; }
.chat-context-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-context-status strong { color: var(--chat-navy); font-size: .72rem; }
.chat-context-benefits { display: grid; gap: 7px; padding: 0; margin: 0 0 14px; list-style: none; }
.chat-context-benefits li { display: flex; align-items: flex-start; gap: 6px; color: #536171; font-size: .66rem; }
.chat-context-benefits .material-icons { color: var(--chat-teal); font-size: 14px; }
.chat-business-summary { display: flex; align-items: center; gap: 10px; }
.chat-business-summary strong, .chat-business-summary span { display: block; }
.chat-business-summary strong { color: var(--chat-navy); font-size: .72rem; overflow-wrap: anywhere; }
.chat-business-summary span { margin-top: 4px; color: var(--chat-muted); font-size: .64rem; }
.chat-primary-button, .chat-secondary-button { min-height: 37px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 13px; border: 1px solid var(--chat-teal); border-radius: 6px; background: var(--chat-teal); color: #fff; font: 700 .7rem/1.2 Manrope,sans-serif; cursor: pointer; }
.chat-secondary-button { background: #fff; color: var(--chat-teal); }
.chat-secondary-button.is-danger { border-color: #d92d20; color: #b42318; }
.chat-primary-button:focus-visible, .chat-secondary-button:focus-visible, .chat-icon-button:focus-visible, .chat-thread-btn:focus-visible, .chat-send-button:focus-visible { outline: 3px solid rgba(8,127,140,.2); outline-offset: 2px; }
.chat-quote-row { justify-content: center !important; }
.chat-quote-message { width: min(390px, 88%); }
.chat-quote-kicker { display: block; margin-bottom: 7px; color: var(--chat-muted); font-size: .65rem; text-align: center; }
.chat-quote-card { padding: 13px; border: 1px solid #d8e2e7; border-radius: 7px; background: #fff; box-shadow: 0 3px 10px rgba(28,39,56,.05); }
.chat-quote-card-header { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; }
.chat-quote-card-header strong, .chat-quote-card-header span { display: block; }
.chat-quote-card-header strong { color: var(--chat-navy); font-size: .72rem; overflow-wrap: anywhere; }
.chat-quote-card-header div span { margin-top: 3px; color: var(--chat-muted); font-size: .65rem; }
.chat-quote-reference { margin: 11px 0 5px; color: var(--chat-muted); font-size: .62rem; }
.chat-quote-total { display: block; margin-bottom: 10px; color: var(--chat-navy); font: 800 1.1rem/1.2 Manrope,sans-serif; }
.chat-quote-card .chat-secondary-button { width: 100%; }
.chat-system-message { width: fit-content; max-width: 85%; display: grid; grid-template-columns: auto 1fr; gap: 2px 7px; margin: 12px auto; padding: 10px 13px; border: 1px solid #bfe4d2; border-radius: 7px; background: #edf9f3; color: #14704e; }
.chat-system-message.is-declined { border-color: #f2c8c4; background: #fff5f4; color: #b42318; }
.chat-system-message.is-completed { border-color: #cddce9; background: #f3f6fa; color: #34598c; }
.chat-system-message .material-icons { grid-row: 1/3; font-size: 18px; }
.chat-system-message strong { font-size: .7rem; }
.chat-system-message span { font-size: .65rem; }
.chat-modal-open { overflow: hidden; }
.chat-modal-backdrop { position: fixed; z-index: 10020; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(20,33,61,.48); }
.chat-modal { width: min(820px,100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 22px 60px rgba(20,33,61,.25); }
.chat-modal-header { display: flex; align-items: flex-start; justify-content: space-between; flex: 0 0 auto; gap: 20px; padding: 20px 22px; border-bottom: 1px solid #dce3e9; }
.chat-modal-header h2 { margin: 0 0 4px; color: #14213d; font: 700 1.05rem/1.3 Manrope,sans-serif; }
.chat-modal-header p { margin: 0; color: #667085; font-size: .74rem; }
.chat-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 21px 22px; }
.quick-quote-form { display: grid; gap: 17px; }
.quick-quote-form label { display: grid; gap: 6px; color: #344054; font-size: .7rem; font-weight: 700; }
.quick-quote-form input, .quick-quote-form textarea { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid #cfd8df; border-radius: 6px; color: #263244; font: 500 .78rem/1.35 "DM Sans",sans-serif; }
.quick-quote-form textarea { resize: vertical; }
.quick-quote-form input:focus, .quick-quote-form textarea:focus { border-color: #087f8c; outline: 3px solid rgba(8,127,140,.13); }
.quote-context-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid #dce3e9; border-radius: 6px; background: #dce3e9; }
.quote-context-grid div { padding: 10px 12px; background: #f6f9fa; }
.quote-context-grid dt { color: #667085; font-size: .61rem; }
.quote-context-grid dd { margin: 3px 0 0; color: #14213d; font-size: .72rem; font-weight: 700; overflow-wrap: anywhere; }
.quote-form-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 4px; }
.quote-form-heading h3 { margin: 0; color: #14213d; font: 700 .85rem/1.3 Manrope,sans-serif; }
.quote-items-editor { display: grid; gap: 8px; }
.quote-item-row { display: grid; grid-template-columns: minmax(180px,1fr) 80px 110px 110px 36px; gap: 8px; align-items: end; padding: 10px; border: 1px solid #e1e6ea; border-radius: 6px; background: #fafbfc; }
.quote-item-amount { min-height: 39px; display: flex; align-items: center; padding: 10px; border: 1px solid #e1e6ea; border-radius: 6px; background: #fff; color: #14213d; font-size: .76rem; }
.quote-options-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.quote-options-grid.is-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.quote-checkbox-field { display: flex !important; align-items: center; gap: 8px; align-self: end; min-height: 39px; }
.quote-checkbox-field input { width: 17px; height: 17px; }
.quote-live-preview { padding: 15px; border: 1px solid #d9e3e7; border-radius: 7px; background: #f7fbfb; }
.quote-preview-brand { display: flex; align-items: center; gap: 10px; }
.quote-preview-brand strong, .quote-preview-brand span { display: block; }
.quote-preview-brand strong { color: #14213d; font-size: .75rem; }
.quote-preview-brand span { margin-top: 2px; color: #667085; font-size: .65rem; overflow-wrap: anywhere; }
.quote-live-preview h3 { margin: 14px 0 3px; color: #14213d; font: 700 .9rem/1.3 Manrope,sans-serif; }
.quote-live-preview > p { margin: 0; color: #667085; font-size: .68rem; }
.quote-preview-totals, .quote-document-totals { width: min(270px,100%); margin: 12px 0 0 auto; }
.quote-preview-totals div, .quote-document-totals div { display: flex; justify-content: space-between; gap: 20px; padding: 5px 0; }
.quote-preview-totals div:last-child, .quote-document-totals div:last-child { padding-top: 8px; border-top: 1px solid #cfdce1; color: #14213d; font-weight: 800; }
.quote-preview-totals dt, .quote-preview-totals dd, .quote-document-totals dt, .quote-document-totals dd { margin: 0; font-size: .7rem; }
.chat-modal-footer { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; gap: 16px; padding: 15px 22px; border-top: 1px solid #dce3e9; background: #fff; box-shadow: 0 -5px 14px rgba(20,33,61,.04); }
.chat-modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-left: auto; }
.chat-modal-footer > .quote-form-status { min-width: 0; }
.chat-modal-footer .chat-primary-button, .chat-modal-footer .chat-secondary-button { min-height: 42px; padding: 10px 18px; }
.chat-modal-footer .chat-primary-button:hover:not(:disabled) { border-color: #066b76; background: #066b76; }
.chat-modal-footer .chat-secondary-button:hover:not(:disabled) { background: #eef9f8; }
.chat-modal-footer .chat-secondary-button.is-danger:hover:not(:disabled) { border-color: #b42318; background: #fff1f0; }
.chat-modal-footer .chat-primary-button:disabled, .chat-modal-footer .chat-secondary-button:disabled { opacity: .58; cursor: wait; }
.quote-form-status { margin: 0; color: #14704e; font-size: .7rem; }
.quote-form-status.is-error { color: #b42318; }
.quote-document { padding: 5px; }
.quote-document-header { display: flex; align-items: center; gap: 11px; padding-bottom: 15px; border-bottom: 2px solid #14213d; }
.quote-document-header strong, .quote-document-header span { display: block; }
.quote-document-header strong { color: #14213d; font: 700 .85rem/1.3 Manrope,sans-serif; }
.quote-document-header span { margin-top: 3px; color: #667085; font-size: .68rem; }
.quote-document-title { display: flex; justify-content: space-between; gap: 25px; padding: 19px 0; }
.quote-document-title > div:last-child { text-align: right; }
.quote-document-title span { color: #087f8c; font-size: .62rem; font-weight: 800; }
.quote-document-title h3 { margin: 4px 0; color: #14213d; font: 800 1.15rem/1.3 Manrope,sans-serif; }
.quote-document-title p, .quote-document-title strong { margin: 0; color: #536171; font-size: .7rem; }
.quote-document-title > div:last-child span { display: block; margin-top: 4px; color: #667085; font-weight: 500; }
.quote-document-items { border: 1px solid #dce3e9; border-radius: 6px; overflow: hidden; }
.quote-document-items > div { display: grid; grid-template-columns: minmax(180px,1fr) 60px 100px 100px; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #e6eaed; }
.quote-document-items > div:last-child { border-bottom: 0; }
.quote-document-items .is-header { background: #f0f4f5; color: #536171; font-size: .65rem; font-weight: 700; }
.quote-document-items span, .quote-document-items strong { color: #344054; font-size: .7rem; overflow-wrap: anywhere; }
.quote-document-note { margin-top: 15px; }
.quote-document-lifecycle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 15px 0 0; padding: 13px; border-radius: 6px; background: #f5f8f8; }
.quote-document-lifecycle div { min-width: 0; }
.quote-document-lifecycle dt { color: #7a8696; font-size: .59rem; font-weight: 700; text-transform: uppercase; }
.quote-document-lifecycle dd { margin: 3px 0 0; overflow-wrap: anywhere; color: #26364d; font-size: .69rem; font-weight: 700; }
.quote-document-note h4 { margin: 0 0 4px; color: #14213d; font-size: .72rem; }
.quote-document-note p { margin: 0; color: #536171; font-size: .7rem; line-height: 1.55; white-space: pre-wrap; }
.quote-viewer-footer { justify-content: flex-end; }
.quote-viewer-footer > span { margin-right: auto; }
@keyframes chat-loading { to { background-position:-200% 0; } }

@media (max-width: 1100px) {
  .chat-workspace { grid-template-columns: minmax(230px,32%) minmax(0,1fr); }
  .chat-context-panel { position: fixed; z-index: 10010; top: 74px; right: 0; bottom: 0; width: min(340px,90vw); transform: translateX(100%); border-left: 1px solid var(--chat-line); box-shadow: -12px 0 35px rgba(20,33,61,.14); transition: transform .2s ease; }
  .chat-workspace.show-context .chat-context-panel { transform: translateX(0); }
}
@media (max-width: 700px) {
  #chat-section { margin: -4px -14px -30px; }
  .chat-workspace { grid-template-columns: minmax(0,1fr); height: calc(100vh - 74px); min-height: 520px; border-width: 1px 0 0; border-radius: 0; }
  .chat-conversations-panel { grid-column: 1; grid-row: 1; }
  .chat-main-area { display: none; grid-column: 1; grid-row: 1; }
  .chat-workspace.has-active-chat .chat-conversations-panel { display: none; }
  .chat-workspace.has-active-chat .chat-main-area { display: grid; }
  .chat-mobile-back { display: grid; }
  .chat-conversation-header { grid-template-columns: auto auto minmax(0,1fr) auto; padding-inline: 10px; }
  .chat-message-history { padding: 15px 12px; }
  .chat-message-content { max-width: 82%; }
  .chat-composer { padding-inline: 10px; }
  .chat-modal-backdrop { padding: 0; align-items: stretch; }
  .chat-modal { width: 100%; max-height: 100vh; border-radius: 0; }
  .chat-modal-body { padding: 17px 14px; }
  .chat-modal-footer { align-items: stretch; padding: 13px 14px max(13px, env(safe-area-inset-bottom)); }
  .quote-context-grid, .quote-options-grid, .quote-options-grid.is-three { grid-template-columns: minmax(0,1fr); }
  .quote-item-row { grid-template-columns: minmax(0,1fr) minmax(80px,.5fr) minmax(100px,.7fr); }
  .quote-item-row > label:first-child { grid-column: 1/-1; }
  .quote-item-row > label:nth-child(4) { grid-column: 1/3; }
  .quote-document-title { display: grid; }
  .quote-document-title > div:last-child { text-align: left; }
  .quote-document-items > div { grid-template-columns: minmax(0,1fr) 45px 75px; }
  .quote-document-items > div span:last-child, .quote-document-items > div strong:last-child { grid-column: 1/-1; text-align: right; }
}
@media (max-width: 480px) {
  .chat-modal-footer { display: grid; grid-template-columns: minmax(0,1fr); justify-content: stretch; gap: 9px; }
  .chat-modal-footer > .quote-form-status { min-height: 0; }
  .chat-modal-actions { display: grid; grid-template-columns: minmax(0,1fr); width: 100%; margin-left: 0; }
  .chat-modal-actions button { width: 100%; }
  .chat-modal-actions .chat-primary-button { order: -1; }
  .quote-viewer-footer { grid-template-columns: minmax(0,1fr); }
  .quote-viewer-footer > span { order: -2; margin: 0; }
  .quote-viewer-footer .chat-primary-button, .quote-viewer-footer .chat-secondary-button { width: 100%; }
  .quote-viewer-footer .chat-primary-button { order: -1; }
}
@media (max-width: 360px) {
  .chat-conversation-title p { font-size: .61rem; }
  .chat-conversation-header > .chat-avatar { width: 35px; height: 35px; }
  .chat-modal-header { padding: 16px 14px; }
}
@media (prefers-reduced-motion: reduce) { .chat-thread-skeleton { animation:none; } .chat-context-panel { transition:none; } .chat-message-history { scroll-behavior:auto; } }
