.quote-status-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 16rem;
  min-height: 1.55rem;
  padding: .18rem .62rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-family: var(--font-head);
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.18;
  text-align: center;
  box-shadow: 0 5px 14px rgba(16, 40, 84, .08);
}

.quote-status-bubble--requested {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 5px 14px rgba(29, 78, 216, .14);
}

.quote-status-bubble--generated {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
  box-shadow: 0 5px 14px rgba(4, 120, 87, .14);
}

.quote-status-bubble--failed {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  box-shadow: 0 5px 14px rgba(185, 28, 28, .14);
}

.quote-status-bubble--none {
  border-color: #d1d5db;
  background: #f8fafc;
  color: #4b5563;
  box-shadow: 0 5px 14px rgba(75, 85, 99, .12);
}

.quote-status-block {
  display: inline-grid;
  gap: .38rem;
  min-width: 0;
}

.quote-progress {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) auto;
  gap: .45rem;
  align-items: center;
  max-width: 220px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1;
}

.quote-progress__track {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: rgba(16, 40, 84, .12);
}

.quote-progress__bar {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width .24s ease;
}

.quote-progress__message {
  grid-column: 1 / -1;
  min-width: 0;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.quote-progress--notice {
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: .75rem;
  width: min(100%, 520px);
  max-width: none;
  color: var(--ink);
  font-size: .92rem;
  font-weight: 700;
}

.quote-progress--notice .quote-progress__track {
  height: 10px;
  background: rgba(16, 40, 84, .1);
}

.quote-progress--notice .quote-progress__bar {
  background: linear-gradient(90deg, var(--accent), #14b8a6, var(--accent));
  background-size: 200% 100%;
  animation: quote-progress-flow 1.1s linear infinite;
}

@keyframes quote-progress-flow {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 200% 0;
  }
}

.chat-quote-generation-notice {
  display: grid;
  gap: .8rem;
}

.chat-quote-generation-notice__title {
  margin-bottom: .18rem;
  color: var(--ink);
  font-weight: 800;
}

.chat-quote-generation-notice__progress-message {
  margin: -.2rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.chat-thread-summary--mobile {
  display: none;
}

.chat-thread-summary {
  min-width: 0;
}

.chat-composer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: end;
  margin: 0;
}

.chat-composer-send {
  min-width: 96px;
}

.chat-start-new {
  position: fixed;
  z-index: 1020;
  right: max(1.5rem, env(safe-area-inset-right));
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  margin: 0;
}

.chat-start-new .btn {
  box-shadow: 0 12px 28px rgba(16, 40, 84, .24);
}

.chat-log {
  display: grid;
  align-content: start;
  gap: .85rem;
  min-height: 320px;
  background: var(--white);
  scroll-behavior: smooth;
}

.chat-message {
  min-width: 0;
  max-width: 78%;
  padding: .8rem .95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--mist);
  box-shadow: var(--shadow-sm);
}

.chat-message p,
.chat-message-text {
  margin-bottom: 0;
}

.chat-message-text {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.chat-message-text a,
.chat-message-text code,
.chat-message-text strong {
  overflow-wrap: anywhere;
}

.chat-message-text p {
  margin: 0 0 .65rem;
}

.chat-message-text p:last-child,
.chat-md-list:last-child,
.chat-md-table-wrap:last-child,
.chat-md-heading:last-child {
  margin-bottom: 0;
}

.chat-md-heading {
  margin: .85rem 0 .45rem;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1rem;
  line-height: 1.25;
}

.chat-md-heading:first-child {
  margin-top: 0;
}

.chat-md-strong {
  color: var(--ink);
  font-weight: 700;
}

.chat-message.customer .chat-md-strong {
  color: var(--white);
}

.chat-md-emphasis {
  color: var(--ink-3);
  font-style: italic;
}

.chat-message.customer .chat-md-emphasis {
  color: rgba(255, 255, 255, .9);
}

.chat-md-code {
  padding: .08rem .28rem;
  border: 1px solid rgba(16, 40, 84, .14);
  border-radius: 4px;
  background: rgba(16, 40, 84, .06);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .92em;
}

.chat-message.customer .chat-md-code {
  border-color: rgba(255, 255, 255, .24);
  background: rgba(255, 255, 255, .12);
  color: var(--white);
}

.chat-md-bullet {
  display: inline-block;
  padding-left: .15rem;
}

.chat-md-list {
  margin: .45rem 0 .75rem;
  padding-left: 1.25rem;
}

.chat-md-list li {
  margin-bottom: .28rem;
}

.chat-md-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: .65rem 0 .85rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
}

.chat-md-table {
  width: 100%;
  min-width: 520px;
  margin: 0;
  border-collapse: collapse;
  font-size: .92rem;
}

.chat-md-table th,
.chat-md-table td {
  padding: .58rem .68rem;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.chat-md-table th:first-child,
.chat-md-table td:first-child {
  border-left: 0;
}

.chat-md-table tbody tr:last-child td {
  border-bottom: 0;
}

.chat-md-table th {
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
}

.chat-md-image {
  max-width: min(100%, 560px);
  margin: .7rem 0 .85rem;
}

.chat-md-image-trigger {
  position: relative;
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}

.chat-md-image-trigger img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.chat-md-image-zoom {
  position: absolute;
  top: .55rem;
  right: .55rem;
  display: inline-flex;
  width: 2.1rem;
  height: 2.1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 999px;
  background: rgba(16, 40, 84, .78);
  color: var(--white);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}

.chat-md-image-trigger:hover .chat-md-image-zoom,
.chat-md-image-trigger:focus-visible .chat-md-image-zoom {
  opacity: 1;
  transform: translateY(0);
}

.chat-md-image figcaption {
  margin-top: .35rem;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}

.chat-image-viewer-modal {
  border: 0;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.chat-image-viewer-body {
  display: grid;
  gap: .75rem;
}

.chat-image-viewer-stage {
  overflow: auto;
  display: grid;
  min-height: min(62vh, 640px);
  max-height: 70vh;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
}

.chat-image-viewer-img {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  transform-origin: center center;
  transition: transform .12s ease;
}

.chat-image-viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  justify-content: flex-end;
}

.chat-image-viewer-zoom-label {
  min-width: 3.5rem;
  color: var(--muted);
  font-family: var(--font-head);
  font-size: .82rem;
  font-weight: 700;
  text-align: center;
}

.chat-image-viewer-caption {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.4;
}

.chat-message.customer {
  margin-left: auto;
  border-color: rgba(16, 40, 84, .16);
  background: var(--ink);
  color: var(--white);
}

.chat-message.bot {
  background: var(--white);
}

.chat-message.customer .chat-md-heading,
.chat-message.customer .chat-md-list,
.chat-message.customer .chat-md-image figcaption,
.chat-message.customer .chat-md-table th,
.chat-message.customer .chat-md-table td {
  color: var(--text);
}

.chat-actions {
  margin-top: .45rem;
}

.chat-open-btn {
  min-width: 88px;
}

.chat-multi-choice-question {
  margin-bottom: .4rem;
  color: var(--ink);
  font-weight: 700;
}

.chat-multi-choice-options {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}

.chat-multi-choice-options form {
  margin: 0;
}

.chat-choice-btn {
  min-width: 132px;
  min-height: 44px;
  padding: .55rem .95rem;
  white-space: normal;
  text-align: left;
  line-height: 1.2;
}

.chat-other-answer {
  margin-top: .65rem;
}

.chat-list-tabs {
  margin-bottom: 1rem;
}

.chat-list-filters {
  margin-bottom: 1rem;
}

.chat-list-filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) auto;
  gap: .75rem;
  align-items: end;
}

.chat-list-filter-form .form-label {
  margin-bottom: .3rem;
}

.chat-list-filter-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.chat-customer-picker {
  display: grid;
  gap: .55rem;
  margin-top: .45rem;
}

.chat-customer-picker__controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: .6rem;
  align-items: start;
}

.chat-customer-picker__controls .btn {
  min-height: 42px;
  white-space: nowrap;
}

.chat-spreadsheet-composer {
  display: grid;
  gap: .7rem;
}

.chat-spreadsheet-composer.has-table-preview textarea {
  min-height: 76px;
}

.chat-spreadsheet-preview {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.chat-spreadsheet-preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .62rem .72rem;
  border-bottom: 1px solid var(--line);
  background: var(--mist);
  color: var(--ink);
}

.chat-spreadsheet-preview__header strong {
  font-family: var(--font-head);
  font-size: .95rem;
}

.chat-spreadsheet-preview__table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.chat-spreadsheet-preview__table {
  width: 100%;
  min-width: 420px;
  margin: 0;
  border-collapse: collapse;
  font-size: .92rem;
}

.chat-spreadsheet-preview__table th,
.chat-spreadsheet-preview__table td {
  padding: .58rem .68rem;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  vertical-align: top;
}

.chat-spreadsheet-preview__table th:first-child,
.chat-spreadsheet-preview__table td:first-child {
  border-left: 0;
}

.chat-spreadsheet-preview__table tbody tr:last-child td {
  border-bottom: 0;
}

.chat-spreadsheet-preview__table th {
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 700;
}

.chat-message.systemaction {
  border-color: rgba(244, 144, 188, .48);
  background: var(--pink-soft);
}

.chat-waiting {
  border-color: rgba(16, 40, 84, .12);
  background: var(--mist);
}

.chat-waiting-content {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  color: var(--ink);
  font-weight: 700;
}

.chat-waiting-dots {
  display: inline-flex;
  gap: .2rem;
  align-items: center;
}

.chat-waiting-dots span {
  width: .35rem;
  height: .35rem;
  border-radius: 999px;
  background: var(--pink);
  animation: chat-waiting-pulse 1s infinite ease-in-out;
}

.chat-waiting-dots span:nth-child(2) {
  animation-delay: .16s;
}

.chat-waiting-dots span:nth-child(3) {
  animation-delay: .32s;
}

@keyframes chat-waiting-pulse {
  0%,
  80%,
  100% {
    opacity: .35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.chat-meta {
  margin-bottom: .28rem;
  color: var(--muted);
  font-size: .82rem;
}

.chat-message.customer .chat-meta {
  color: rgba(255, 255, 255, .72);
}
