/* Loan AI chat — light theme, homepage-style results */
.loan-chat-page {
  padding: 1rem 0 2.75rem;
}

.loan-chat-page__inner {
  max-width: 760px;
}

/* Focus layout — full viewport chat, no page scroll */
body.layout--loan-chat {
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.layout--loan-chat .site-top-bar {
  flex-shrink: 0;
}

body.layout--loan-chat main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

body.layout--loan-chat .loan-chat-page {
  flex: 1;
  min-height: 0;
  padding: .65rem 0 .5rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

body.layout--loan-chat .loan-chat-page__inner {
  max-width: 920px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: .5rem;
}

body.layout--loan-chat .loan-chat {
  flex: 1;
  height: auto;
  min-height: 0;
  max-height: none;
}

body.layout--loan-chat .support-fab {
  display: none !important;
}

.loan-chat {
  display: flex;
  flex-direction: column;
  height: min(84vh, 820px);
  min-height: 560px;
  background: #fff;
  border-radius: 24px;
  border: 1px solid rgba(226, 232, 240, 1);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, .04),
    0 16px 48px rgba(35, 75, 140, .1);
  overflow: hidden;
}

/* Header — compact, subtle */
.loan-chat__header {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .85rem;
  background: #fff;
  color: #334155;
  border-bottom: 1px solid rgba(226, 232, 240, 1);
  flex-shrink: 0;
}

.loan-chat__header-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: visible;
  flex-shrink: 0;
  position: relative;
}

.loan-chat__header-avatar svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scale(1.18);
  transform-origin: center center;
}

.loan-chat__header-title {
  font-size: .84rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.loan-chat__header-status {
  font-size: .68rem;
  font-weight: 700;
  color: #059669;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
}

.loan-chat__header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #34d399;
}

/* Messages */
.loan-chat__messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.1rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: #f8fafc;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.loan-chat__row {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  animation: loanChatMsgIn .32s ease both;
}

.loan-chat__row--user {
  justify-content: flex-end;
}

.loan-chat__row--ai {
  justify-content: flex-start;
}

.loan-chat__row--answer {
  width: 100%;
  align-items: flex-start;
  flex-shrink: 0;
}

.loan-chat__row--answer .loan-chat__avatar {
  display: none;
}

.loan-chat__row--answer .loan-chat__ai-panel {
  width: 100%;
}

@keyframes loanChatMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.loan-chat__avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .9rem;
  flex-shrink: 0;
  margin-top: .15rem;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .22);
}

.loan-chat__avatar--system {
  background: linear-gradient(135deg, #64748b, #475569);
  box-shadow: 0 4px 14px rgba(71, 85, 105, .2);
}

.loan-chat__row--user .loan-chat__avatar {
  display: none;
}


/* Bubbles */
.loan-chat__bubble--user {
  max-width: min(82%, 460px);
  padding: .75rem 1rem;
  border-radius: 18px 18px 4px 18px;
  background: linear-gradient(135deg, #2563eb, #4338ca);
  color: #fff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .2);
  font-size: .9rem;
  line-height: 1.8;
}

.loan-chat__bubble--user p {
  margin: 0;
}

.loan-chat__bubble--ai {
  max-width: min(88%, 500px);
  padding: .85rem 1rem;
  border-radius: 18px 18px 18px 4px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 1);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
  color: #334155;
  font-size: .9rem;
  line-height: 1.8;
}

.loan-chat__welcome-text {
  margin: .55rem 0 0;
  color: #475569;
}

/* AI answer panel */
.loan-chat__ai-panel {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.loan-chat__answer-card {
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 1);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
}

.loan-chat__ai-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 800;
  color: #1d4ed8;
  padding: .24rem .6rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, .07);
  border: 1px solid rgba(37, 99, 235, .12);
}

.loan-chat__ai-badge i {
  font-size: .74rem;
  color: #6366f1;
}

.loan-chat__quality-badge {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  font-weight: 700;
  padding: .22rem .55rem;
  border-radius: 999px;
  margin-inline-start: .35rem;
}

.loan-chat__quality-badge--exact {
  color: #047857;
  background: rgba(16, 185, 129, .1);
  border: 1px solid rgba(16, 185, 129, .2);
}

.loan-chat__quality-badge--near {
  color: #b45309;
  background: rgba(245, 158, 11, .1);
  border: 1px solid rgba(245, 158, 11, .22);
}

.loan-chat__quality-badge--broad {
  color: #6d28d9;
  background: rgba(139, 92, 246, .1);
  border: 1px solid rgba(139, 92, 246, .2);
}

.loan-chat__answer-text {
  margin: .6rem 0 0;
  font-size: .92rem;
  line-height: 1.9;
  color: #334155;
  white-space: pre-line;
}

.loan-chat__bubble--ai p,
.loan-chat__welcome-text {
  white-space: pre-line;
}

.loan-chat__answer-text--compact {
  line-height: 1.75;
  max-width: 42rem;
}

.loan-chat__results-wrap--first {
  margin-bottom: .75rem;
}

.loan-chat__criteria {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .75rem;
  padding-top: .7rem;
  border-top: 1px solid rgba(226, 232, 240, 1);
}

.loan-chat__criteria-chip {
  font-size: .72rem;
  font-weight: 700;
  padding: .28rem .62rem;
  border-radius: 999px;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid rgba(37, 99, 235, .14);
  white-space: nowrap;
}

.loan-chat__confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .85rem;
}

.loan-chat__confirm-block {
  margin-top: .55rem;
}

.loan-chat__confirm-lead {
  margin: 0;
  font-size: .88rem;
  font-weight: 800;
  color: #0f172a;
}

.loan-chat__confirm-list {
  margin: .45rem 0 .65rem;
  padding: 0 1.1rem 0 0;
  list-style: disc;
  font-size: .86rem;
  line-height: 1.85;
  color: #334155;
}

.loan-chat__confirm-ask {
  margin: 0;
  font-size: .88rem;
  line-height: 1.75;
  color: #475569;
  font-weight: 600;
}

.loan-chat__confirm-btn {
  flex: 1 1 auto;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .55rem .85rem;
  border-radius: 12px;
  font-size: .82rem;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.loan-chat__confirm-btn--yes {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .25);
}

.loan-chat__confirm-btn--no {
  background: #fff;
  color: #475569;
  border-color: rgba(148, 163, 184, .45);
}

.loan-chat__confirm-btn:hover {
  transform: translateY(-1px);
}

.loan-chat__quota-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-top: .75rem;
  padding: .65rem .75rem;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid rgba(234, 88, 12, .25);
  font-size: .8rem;
  font-weight: 700;
  color: #9a3412;
}

.loan-chat__quota-notice i {
  font-size: 1rem;
  flex-shrink: 0;
}

.loan-chat__quota-pay-btn {
  border: none;
  border-radius: 10px;
  padding: .4rem .7rem;
  font-size: .75rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  cursor: pointer;
}

.loan-chat__history-divider {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: .5rem 0 .75rem;
  color: #94a3b8;
  font-size: .72rem;
  font-weight: 700;
}

.loan-chat__history-divider::before,
.loan-chat__history-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, .45), transparent);
}

.loan-chat__row--history {
  opacity: .92;
}

.loan-chat__bubble--system {
  background: #f8fafc !important;
  border: 1px dashed rgba(148, 163, 184, .4);
  color: #64748b;
}

.loan-chat__packs-wrap {
  min-width: 0;
  flex: 1;
  max-width: 100%;
}

.loan-chat__packs {
  width: 100%;
  padding: .85rem;
  border-radius: 16px;
  background: linear-gradient(145deg, #f8fafc 0%, #fff 55%, #eff6ff 100%);
  border: 1px solid rgba(148, 163, 184, .28);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.loan-chat__packs--compact {
  margin-top: .75rem;
  padding: .75rem;
}

.loan-chat__packs-hero {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .85rem;
}

.loan-chat__packs-lottie {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.loan-chat__packs-hero-text strong {
  display: block;
  font-size: .88rem;
  color: #0f172a;
  margin-bottom: .2rem;
}

.loan-chat__packs-hero-text p {
  margin: 0;
  font-size: .78rem;
  line-height: 1.7;
  color: #64748b;
  font-weight: 600;
}

.loan-chat__packs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
}

.loan-chat__pack-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .25rem;
  padding: .7rem .55rem .6rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .32);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.loan-chat__pack-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, .12);
  border-color: rgba(37, 99, 235, .35);
}

.loan-chat__pack-card--popular {
  border-color: rgba(37, 99, 235, .45);
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .1);
}

.loan-chat__pack-badge {
  position: absolute;
  top: -.45rem;
  left: 50%;
  transform: translateX(-50%);
  padding: .12rem .45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  white-space: nowrap;
}

.loan-chat__pack-tier {
  font-size: .78rem;
  font-weight: 800;
  color: #1e293b;
  text-align: center;
}

.loan-chat__pack-sub {
  font-size: .68rem;
  font-weight: 600;
  color: #94a3b8;
  text-align: center;
}

.loan-chat__pack-searches {
  font-size: .72rem;
  font-weight: 700;
  color: #475569;
  text-align: center;
  margin-top: .15rem;
}

.loan-chat__pack-price {
  font-size: .82rem;
  font-weight: 900;
  color: #1d4ed8;
  text-align: center;
  margin: .2rem 0 .35rem;
}

.loan-chat__pack-price small {
  font-size: .62rem;
  font-weight: 700;
  color: #64748b;
}

.loan-chat__pack-buy {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: .45rem .35rem;
  font-size: .72rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  cursor: pointer;
  transition: opacity .15s ease;
}

.loan-chat__pack-card--popular .loan-chat__pack-buy {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.loan-chat__pack-buy:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.loan-chat__packs-fallback {
  margin: 0;
  font-size: .8rem;
  font-weight: 700;
  color: #64748b;
  text-align: center;
}

@media (max-width: 640px) {
  .loan-chat__packs-grid {
    grid-template-columns: 1fr;
  }

  .loan-chat__pack-card--popular {
    order: -1;
  }
}

.loan-chat__consult-offer {
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px dashed rgba(148, 163, 184, .45);
}

.loan-chat__consult-text {
  margin: 0 0 .65rem;
  font-size: .82rem;
  line-height: 1.85;
  color: #475569;
}

.loan-chat__consult-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem .85rem;
  border: 1px solid rgba(5, 150, 105, .35);
  border-radius: 12px;
  background: #ecfdf5;
  color: #047857;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.loan-chat__consult-btn:hover {
  background: #d1fae5;
  transform: translateY(-1px);
}

.loan-chat__consult-done {
  margin: 0;
  font-size: .8rem;
  font-weight: 700;
  color: #059669;
}

/* Results — collapsed by default, compact list */
.loan-chat__results-wrap {
  min-width: 0;
  width: 100%;
}

.loan-chat__results-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .62rem .75rem;
  border: 1px solid rgba(37, 99, 235, .2);
  border-radius: 12px;
  background: #fff;
  color: #1e40af;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.loan-chat__results-toggle:hover {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, .35);
}

.loan-chat__results-toggle-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(37, 99, 235, .08);
  display: grid;
  place-items: center;
  font-size: .85rem;
  flex-shrink: 0;
}

.loan-chat__results-toggle-text {
  flex: 1;
  text-align: start;
}

.loan-chat__results-toggle-chevron {
  font-size: .75rem;
  transition: transform .2s ease;
  flex-shrink: 0;
}

.loan-chat__results-toggle.is-open .loan-chat__results-toggle-chevron {
  transform: rotate(180deg);
}

.loan-chat__results-body {
  margin-top: .5rem;
}

.loan-chat__results-body[hidden] {
  display: none !important;
}

.loan-chat__results-list {
  max-height: min(420px, 52vh);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 0;
  width: 100%;
}

.loan-chat__results-list::-webkit-scrollbar {
  width: 5px;
}

.loan-chat__results-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, .45);
  border-radius: 999px;
}

.loan-chat__loan {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .6rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 1);
  text-decoration: none;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.loan-chat__loan:hover {
  border-color: rgba(37, 99, 235, .25);
  box-shadow: 0 2px 8px rgba(37, 99, 235, .08);
}

.loan-chat__loan-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 1);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.loan-chat__loan-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.loan-chat__loan-logo i {
  font-size: .9rem;
  color: #64748b;
}

.loan-chat__loan-info {
  flex: 1;
  min-width: 0;
}

.loan-chat__loan-info strong,
.loan-chat__loan-title {
  display: block;
  font-size: .78rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loan-chat__loan-info span {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  color: #2563eb;
  line-height: 1.3;
}

.loan-chat__loan-stats {
  display: none;
}

.loan-chat__loan-arrow {
  font-size: .72rem;
  color: #94a3b8;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .loan-chat__loan {
    padding: .5rem .65rem;
    gap: .65rem;
  }

  .loan-chat__loan-info {
    flex: 0 1 38%;
  }

  .loan-chat__loan-stats {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: .25rem .55rem;
    justify-content: flex-start;
    min-width: 0;
  }

  .loan-chat__loan-stats span {
    font-size: .68rem;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .loan-chat__loan-stats em {
    font-style: normal;
    font-weight: 600;
    color: #94a3b8;
    margin-inline-end: .15rem;
  }
}

/* Loading */
.loan-chat__loading-panel {
  flex: 1;
  min-width: 0;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 1);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
}

.loan-chat__loading-steps {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: .9rem;
}

.loan-chat__loading-step {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .8rem;
  color: #94a3b8;
  font-weight: 600;
}

.loan-chat__loading-step.is-active {
  color: #0f172a;
  font-weight: 800;
}

.loan-chat__loading-step.is-done {
  color: #059669;
}

.loan-chat__loading-step.is-active i {
  animation: loanChatSpin .85s linear infinite;
}

.loan-chat__loading-skeletons {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.loan-chat__loading-sk {
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(237, 244, 255, 1), rgba(249, 251, 255, 1));
  border: 1px solid rgba(226, 232, 240, 1);
  position: relative;
  overflow: hidden;
}

.loan-chat__loading-sk::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .65) 50%, transparent 60%);
  animation: loanChatShimmer 1.6s infinite;
}

@keyframes loanChatShimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@keyframes loanChatSpin {
  to { transform: rotate(360deg); }
}

.loan-chat__bubble--error {
  background: #fef2f2;
  border: 1px solid rgba(239, 68, 68, .22);
  color: #991b1b;
  padding: .8rem 1rem;
  border-radius: 18px;
}

.loan-chat__bubble--error p {
  margin: 0;
}

/* Quick examples + composer */
.loan-chat__quick {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  padding: .65rem 1rem 0;
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid rgba(226, 232, 240, 1);
}

.loan-chat__quick-btn {
  border: 1px solid rgba(37, 99, 235, .18);
  background: #f8fafc;
  color: #1e40af;
  border-radius: 999px;
  padding: .38rem .78rem;
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.loan-chat__quick-btn:hover {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, .32);
}

.loan-chat__quick-btn:active {
  transform: scale(.98);
}

.loan-chat__composer {
  display: flex;
  align-items: flex-end;
  gap: .6rem;
  padding: .75rem 1rem 1rem;
  background: #fff;
  border-top: 1px solid rgba(226, 232, 240, 1);
  flex-shrink: 0;
  direction: rtl;
}

.loan-chat__composer-wrap {
  flex: 1;
  min-width: 0;
  border-radius: 16px;
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .45), rgba(99, 102, 241, .35), rgba(16, 185, 129, .35));
}

.loan-chat__composer textarea {
  width: 100%;
  resize: none;
  border: none;
  border-radius: 14.5px;
  padding: .72rem .9rem;
  font-size: .9rem;
  line-height: 1.6;
  min-height: 48px;
  max-height: 120px;
  background: #f8fafc;
  color: #0f172a;
  display: block;
  transition: background .15s ease;
  direction: rtl;
  text-align: right;
}

.loan-chat__composer textarea::placeholder {
  color: #94a3b8;
}

.loan-chat__composer textarea:focus {
  outline: none;
  background: #fff;
}

.loan-chat__send {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  direction: ltr;
  background: linear-gradient(135deg, #2563eb, #4338ca);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .26);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.loan-chat__send i {
  font-size: 1.35rem;
  line-height: 1;
  display: block;
}

.loan-chat__send.is-sending i {
  animation: none;
  opacity: 0.35;
}

.loan-chat__send.is-sending {
  position: relative;
}

.loan-chat__send.is-sending::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  animation: loanChatSendPulse 1s ease-in-out infinite;
}

@keyframes loanChatSendPulse {
  0%, 100% { opacity: .35; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1); }
}

.loan-chat__composer--busy .loan-chat__composer-wrap {
  opacity: .72;
}

body:has(.loan-chat-page #loanChatInput:focus) .support-fab,
body:has(.loan-chat-page .loan-chat__composer:focus-within) .support-fab,
body:has(.loan-chat-page .loan-chat__composer:hover) .support-fab {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.88);
}

body:has(.loan-chat-page) .support-fab {
  transition: opacity .22s ease, visibility .22s ease, transform .22s ease, box-shadow .2s ease;
}

.loan-chat__send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .32);
}

.loan-chat__send:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Mobile loan stats as second row */
@media (max-width: 639px) {
  .loan-chat__loan {
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
  }

  .loan-chat__loan-info {
    flex: 1;
    min-width: 0;
  }

  .loan-chat__loan-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .45rem;
    width: 100%;
    padding: 0;
    margin-top: .35rem;
  }

  .loan-chat__loan-stats span {
    font-size: .66rem;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    padding: .15rem .4rem;
    border-radius: 6px;
  }

  .loan-chat__loan-stats em {
    font-style: normal;
    color: #94a3b8;
    margin-inline-end: .1rem;
  }

  .loan-chat__loan-arrow {
    flex-shrink: 0;
  }
}

@media (max-width: 576px) {
  body.layout--loan-chat .loan-chat-page {
    padding: .35rem 0 .25rem;
  }

  body.layout--loan-chat .loan-chat-page__inner {
    padding-left: .5rem;
    padding-right: .5rem;
  }

  body.layout--loan-chat .loan-chat {
    border-radius: 16px;
  }

  .loan-chat {
    height: min(88vh, 760px);
    min-height: 480px;
    border-radius: 18px;
  }

  .loan-chat__messages {
    padding: .9rem .75rem 1rem;
  }

  .loan-chat__bubble--user {
    max-width: 94%;
  }

  .loan-chat__quick {
    padding-inline: .75rem;
  }

  .loan-chat__composer {
    padding-inline: .75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loan-chat__loading-sk::after,
  .loan-chat__loading-step.is-active i,
  .loan-chat__send.is-sending i,
  .loan-chat__row {
    animation: none;
  }

  .loan-chat__messages {
    scroll-behavior: auto;
  }
}

/* OTP gate — modal desktop / bottomsheet mobile */
.loan-otp-sheet .modal-content {
  border: none;
  overflow: hidden;
  background: #fff;
}

.loan-otp-sheet.bottomsheet .modal-dialog {
  margin: 0 !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  max-width: 100% !important;
  width: 100% !important;
  transform: translateY(105%) !important;
  transition: transform .38s cubic-bezier(.22, .61, .36, 1) !important;
  pointer-events: none;
}

.loan-otp-sheet.bottomsheet.show .modal-dialog {
  transform: translateY(0) !important;
  pointer-events: auto;
}

.loan-otp-sheet.bottomsheet .modal-content {
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, .14);
}

.loan-otp-sheet:not(.bottomsheet) .modal-content {
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .16);
}

.loan-otp-sheet:not(.bottomsheet) .modal-dialog {
  max-width: 420px;
}

.loan-otp-sheet__top {
  position: relative;
  padding: 12px 18px 0;
  min-height: 28px;
}

.loan-otp-sheet__grabber {
  display: none;
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: #d1d5db;
  margin: 2px auto 0;
}

.loan-otp-sheet.bottomsheet .loan-otp-sheet__grabber {
  display: block;
}

.loan-otp-sheet__close {
  position: absolute;
  top: 8px;
  left: 16px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: #f3f4f6;
  color: #64748b;
  display: grid;
  place-items: center;
}

.loan-otp-sheet__body {
  padding: .5rem 1.25rem 1.35rem;
  text-align: center;
}

.loan-otp-sheet__hero {
  margin-bottom: 1rem;
}

.loan-otp-sheet__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto .65rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(99, 102, 241, .08));
  color: #2563eb;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
}

.loan-otp-sheet__icon--warn {
  background: #fff7ed;
  color: #ea580c;
}

.loan-otp-sheet__title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 .35rem;
}

.loan-otp-sheet__lead {
  margin: 0;
  font-size: .82rem;
  line-height: 1.75;
  color: #64748b;
}

.loan-otp-sheet__step {
  text-align: start;
}

.loan-otp-sheet__label {
  display: block;
  font-size: .78rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: .35rem;
}

.loan-otp-sheet__input {
  width: 100%;
  border: 1px solid rgba(226, 232, 240, 1);
  border-radius: 12px;
  padding: .72rem .85rem;
  font-size: .95rem;
  background: #f8fafc;
  color: #0f172a;
  margin-bottom: .75rem;
  text-align: center;
  letter-spacing: .04em;
}

.loan-otp-sheet__input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, .35);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.loan-otp-sheet__input--code {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: .35em;
}

.loan-otp-sheet__btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: .78rem 1rem;
  font-size: .88rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #4338ca);
  box-shadow: 0 8px 22px rgba(37, 99, 235, .24);
  cursor: pointer;
}

.loan-otp-sheet__btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.loan-otp-sheet__btn--primary {
  background: linear-gradient(135deg, #2563eb, #4338ca);
}

.loan-otp-sheet__btn--outline {
  color: #1e40af;
  background: #fff;
  border: 1.5px solid rgba(37, 99, 235, .35);
  box-shadow: none;
}

.loan-otp-sheet__icon--chat {
  color: #2563eb;
  background: rgba(37, 99, 235, .1);
}

.loan-chat-resume__preview {
  margin: .65rem 0 0;
  padding: .55rem .75rem;
  border-radius: 12px;
  background: rgba(241, 245, 249, 1);
  color: #475569;
  font-size: .82rem;
  line-height: 1.7;
}

.loan-chat-resume__note {
  margin: .85rem 0 0;
  font-size: .72rem;
  line-height: 1.65;
  color: #64748b;
  text-align: center;
}

.loan-otp-sheet__link {
  width: 100%;
  margin-top: .55rem;
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.loan-otp-sheet__link:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.loan-otp-sheet__sent-to {
  font-size: .78rem;
  color: #475569;
  margin: 0 0 .65rem;
  text-align: center;
}

.loan-otp-sheet__message {
  min-height: 1.2rem;
  margin: .75rem 0 0;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
}

.loan-otp-sheet__message.is-error {
  color: #dc2626;
}

.loan-otp-sheet__message.is-success {
  color: #059669;
}

.loan-otp-sheet__privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin: 1rem 0 0;
  font-size: .7rem;
  color: #94a3b8;
}

body:has(#loanChatOtpGate.show) .support-fab,
body:has(#loanChatOtpGate.show) .support-panel,
body:has(#loanChatLimitGate.show) .support-fab,
body:has(#loanChatLimitGate.show) .support-panel {
  z-index: 1040 !important;
  pointer-events: none;
}

#loanChatOtpGate.show {
  z-index: 1060;
}

body:has(#loanChatOtpGate.show) .modal-backdrop.show {
  opacity: .52;
}

.loan-chat__results-wrap--open .loan-chat__results-body {
  display: block;
}

/* Loan offer cards (chat results) */
.loan-chat__offer {
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e8edf3;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.loan-chat__offer[open] {
  border-color: rgba(37, 99, 235, .22);
  box-shadow: 0 4px 16px rgba(15, 23, 42, .07);
}

.loan-chat__offer--featured {
  border-color: rgba(5, 150, 105, .35);
  background: linear-gradient(180deg, #f0fdf9 0%, #fff 42%);
  box-shadow: 0 2px 12px rgba(5, 150, 105, .12);
}

.loan-chat__offer--featured[open] {
  border-color: rgba(5, 150, 105, .45);
  box-shadow: 0 6px 22px rgba(5, 150, 105, .16);
}

.loan-chat__offer--strong {
  border-color: rgba(37, 99, 235, .28);
  background: linear-gradient(180deg, #f8fbff 0%, #fff 40%);
}

.loan-chat__offer--extra {
  display: none;
}

.loan-chat__offer-summary {
  list-style: none;
  cursor: pointer;
  padding: .8rem .85rem;
  user-select: none;
}

.loan-chat__offer-summary::-webkit-details-marker {
  display: none;
}

.loan-chat__offer-summary::marker {
  content: '';
}

.loan-chat__offer-ribbon {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  margin-bottom: .45rem;
  font-size: .64rem;
  font-weight: 800;
  color: #047857;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: .16rem .5rem;
}

.loan-chat__offer-ribbon i {
  font-size: .62rem;
}

.loan-chat__offer-ribbon--strong {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #bfdbfe;
}

.loan-chat__offer-head {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
}

.loan-chat__offer-chevron {
  flex-shrink: 0;
  margin-top: .55rem;
  font-size: .85rem;
  color: #cbd5e1;
  transition: transform .2s ease, color .2s ease;
}

.loan-chat__offer[open] .loan-chat__offer-chevron {
  transform: rotate(180deg);
  color: #2563eb;
}

.loan-chat__offer--featured .loan-chat__offer-chevron {
  color: #6ee7b7;
}

.loan-chat__offer--featured[open] .loan-chat__offer-chevron {
  color: #059669;
}

.loan-chat__offer-body {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding: 0 .85rem .85rem;
  border-top: 1px solid #f1f5f9;
  animation: loanOfferReveal .2s ease;
}

@keyframes loanOfferReveal {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.loan-chat__offer--featured .loan-chat__offer-score {
  width: 2.85rem;
  height: 2.85rem;
  font-size: .9rem;
  box-shadow: 0 0 0 3px rgba(167, 243, 208, .55);
}

.loan-chat__offer--strong .loan-chat__offer-score {
  box-shadow: 0 0 0 2px rgba(191, 219, 254, .7);
}

.loan-chat__offer-brand {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  min-width: 0;
  flex: 1;
}

.loan-chat__offer-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e8edf3;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.loan-chat__offer-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.loan-chat__offer-logo i {
  font-size: 1rem;
  color: #64748b;
}

.loan-chat__offer-copy {
  min-width: 0;
  flex: 1;
}

.loan-chat__offer-title {
  margin: 0;
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.45;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.loan-chat__offer-sub {
  margin: .28rem 0 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.3;
}

.loan-chat__offer-tier {
  font-size: .62rem;
  font-weight: 800;
  padding: .12rem .4rem;
  border-radius: 999px;
  white-space: nowrap;
}

.loan-chat__offer-tier--best { background: #ecfdf5; color: #047857; }
.loan-chat__offer-tier--near { background: #eff6ff; color: #1d4ed8; }
.loan-chat__offer-tier--warn { background: #fffbeb; color: #b45309; }
.loan-chat__offer-tier--muted { background: #f1f5f9; color: #64748b; }

.loan-chat__offer-score {
  flex-shrink: 0;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 800;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  border: 2px solid transparent;
}

.loan-chat__offer-score small {
  font-size: .52rem;
  font-weight: 700;
  opacity: .8;
  margin-top: .05rem;
}

.loan-chat__offer-score--best {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.loan-chat__offer-score--near {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.loan-chat__offer-score--warn {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.loan-chat__offer-score--muted {
  color: #64748b;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.loan-chat__offer-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
  padding-top: .65rem;
}

.loan-chat__offer-metric {
  text-align: center;
  min-width: 0;
}

.loan-chat__offer-metric span {
  display: block;
  font-size: .64rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: .15rem;
}

.loan-chat__offer-metric strong {
  display: block;
  font-size: .86rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.loan-chat__offer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

.loan-chat__offer-tags span {
  font-size: .66rem;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e8edf3;
  border-radius: 999px;
  padding: .2rem .5rem;
  white-space: nowrap;
}

.loan-chat__offer-tags span.is-muted {
  color: #94a3b8;
}

.loan-chat__offer-note {
  margin: 0;
  font-size: .68rem;
  line-height: 1.55;
  color: #64748b;
  padding: .45rem .55rem;
  background: #fafbfc;
  border-radius: 8px;
  border-right: 3px solid #f59e0b;
}

.loan-chat__offer-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  width: 100%;
  padding: .5rem .75rem;
  font-size: .74rem;
  font-weight: 800;
  color: #1d4ed8;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}

.loan-chat__offer-action:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}

.loan-chat__offer-action i {
  font-size: .85rem;
}

.loan-chat__results-more {
  width: 100%;
  margin-top: .55rem;
  border: 1px dashed rgba(148, 163, 184, .55);
  background: #f8fafc;
  border-radius: 12px;
  padding: .55rem;
  font-size: .78rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  transition: background .15s ease, border-color .15s ease;
}

.loan-chat__results-more:hover {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, .35);
  color: #1e40af;
}
