/* ==========================================================================
   SANCTION CREDIT DESK — INTERACTIVE CHAT ENGINE STYLES
   Theme: Official Sanction Brand Theme (Royal Blue, Slate Canvas, Sharp Cards)
   Fast, Simple, Easy • Zero Shaking • High Contrast
   ========================================================================== */

:root {
  --sw-primary: #00509E;           /* Official Sanction Brand Blue */
  --sw-primary-hover: #003D7A;     /* Sanction Deep Navy */
  --sw-primary-light: #F0F6FC;     /* Subtle Blue Tint */
  --sw-primary-glow: rgba(0, 80, 158, 0.2);
  --sw-primary-gradient: linear-gradient(135deg, #00509E 0%, #0066C8 100%);
  --sw-header-gradient: linear-gradient(135deg, #003D7A 0%, #00509E 100%);
  --sw-wa-green: #25D366;          /* WhatsApp Vibrant Green for WA Direct Action */
  --sw-bg-page: #FFFFFF;
  --sw-bg-surface: #F8FAFC;        /* Clean Modern Slate Canvas */
  --sw-bg-bubble-bot: #FFFFFF;     /* Pure White Bot Bubble */
  --sw-bg-bubble-user: linear-gradient(135deg, #00509E 0%, #0066C8 100%);
  --sw-border: #E2E8F0;
  --sw-border-focus: #00509E;
  --sw-text-main: #0F172A;         /* Slate 900 Dark High-Contrast */
  --sw-text-body: #334155;         /* Slate 700 Body */
  --sw-text-muted: #64748B;        /* Slate 500 Secondary */
  --sw-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --sw-shadow-window: 0 16px 40px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(15, 23, 42, 0.08);
  --sw-shadow-button: 0 4px 16px rgba(0, 80, 158, 0.35);
}

/* ==========================================================================
   ZERO ANIMATIONS & INSTANT SNAPPY RESPONSE
   ========================================================================== */
.sanction-chat-widget,
.sanction-chat-widget *,
.sanction-chat-widget *::before,
.sanction-chat-widget *::after {
  animation: none !important;
  transition: none !important;
}

/* ==========================================================================
   1. FLOATING LAUNCHER TOGGLE BUTTON (BOTTOM-RIGHT)
   ========================================================================== */
.sanction-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99998;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--sw-font);
}

/* Teaser / Tooltip Pill - Clean, Static, Fast */
.sanction-launcher-teaser {
  background: #FFFFFF;
  color: var(--sw-text-main);
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--sw-border);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  white-space: nowrap;
}

.sanction-launcher-teaser:hover {
  border-color: var(--sw-primary);
}

.sanction-teaser-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sw-primary);
}

/* Circular Floating Button - Sanction Royal Blue Gradient */
.sanction-launcher-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--sw-primary-gradient);
  border: none;
  box-shadow: var(--sw-shadow-button);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  position: relative;
  outline: none;
}

.sanction-launcher-btn:hover {
  opacity: 0.94;
}

.sanction-launcher-btn:active {
  transform: scale(0.97);
}

/* SVG icons inside button (chat vs close) */
.sanction-launcher-icon-open,
.sanction-launcher-icon-close {
  position: absolute;
}

.sanction-launcher-icon-open {
  opacity: 1;
}

.sanction-launcher-icon-close {
  opacity: 0;
}

/* When open, switch to close icon */
.sanction-chat-widget.is-open .sanction-launcher-icon-open {
  opacity: 0;
}

.sanction-chat-widget.is-open .sanction-launcher-icon-close {
  opacity: 1;
}

.sanction-chat-widget.is-open .sanction-launcher-teaser {
  opacity: 0;
  pointer-events: none;
}

/* Disable pulse ring */
.sanction-launcher-pulse {
  display: none !important;
}

/* ==========================================================================
   2. FLOATING CHAT POPUP WINDOW
   ========================================================================== */
.sanction-chat-popup {
  position: fixed;
  bottom: 94px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 610px;
  max-height: calc(100vh - 116px);
  z-index: 99999;
  background: var(--sw-bg-surface);
  border: 1px solid rgba(0, 80, 158, 0.15);
  border-radius: 16px;
  box-shadow: var(--sw-shadow-window);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--sw-font);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.sanction-chat-widget.is-open .sanction-chat-popup {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

/* ==========================================================================
   3. SANCTION BRAND HEADER
   ========================================================================== */
.ai-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: var(--sw-header-gradient);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  color: #FFFFFF;
}

.ai-header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ai-avatar-orb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  overflow: visible;
  padding: 2px;
}
.ai-avatar-orb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.ai-avatar-orb svg {
  color: var(--sw-primary);
}

.ai-avatar-pulse {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #25D366;
  border: 2px solid #FFFFFF;
}

.ai-header-titles h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ai-badge-live {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border: none;
}

.ai-header-sub {
  font-size: 0.72rem;
  color: #E2E8F0;
  margin-top: 0.15rem;
  font-weight: 400;
}

/* Header Action Buttons */
.ai-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ai-ctrl-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #FFFFFF;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  font-size: 0.725rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  transition: background 0.15s ease;
  text-decoration: none;
  line-height: 1;
  min-height: 30px;
  box-sizing: border-box;
}

.ai-ctrl-btn svg {
  display: block;
  flex-shrink: 0;
  stroke: #FFFFFF;
}

.ai-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.ai-ctrl-btn.active {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.ai-ctrl-call {
  background: var(--sw-wa-green);
  color: #FFFFFF;
}

.ai-ctrl-call:hover {
  background: #20BA5C;
  color: #FFFFFF;
}

.ai-ctrl-close {
  background: transparent;
  border: none;
  color: #FFFFFF;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.ai-ctrl-close svg {
  display: block;
  stroke: #FFFFFF;
}

.ai-ctrl-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* ==========================================================================
   4. PROGRESS STEP TRACKER (SUBTLE SANCTION NAVY STRIP)
   ========================================================================== */
.ai-progress-strip {
  background: #003366;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: #E2E8F0;
  flex-shrink: 0;
}

.ai-progress-bar-wrap {
  width: 90px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.ai-progress-bar-fill {
  height: 100%;
  width: 10%;
  background: #38BDF8;
  border-radius: 3px;
  transition: width 0.2s ease;
}

/* ==========================================================================
   5. CHAT STREAM (CLEAN SANCTION SLATE CANVAS • NO WOBBLE)
   ========================================================================== */
.ai-chat-stream {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  overflow-y: auto;
  overflow-x: hidden !important;
  padding: 0.95rem 0.95rem 3rem 0.95rem !important;
  background-color: #F8FAFC !important;
  background-image: none !important;
  scroll-behavior: auto !important;
  overscroll-behavior: contain !important;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Breathing room for last active item */
.ai-chat-stream > *:last-child {
  margin-bottom: 2rem !important;
}

/* Minimal Scrollbar */
.ai-chat-stream::-webkit-scrollbar {
  width: 5px;
}
.ai-chat-stream::-webkit-scrollbar-track {
  background: transparent;
}
.ai-chat-stream::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
.ai-chat-stream::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Message Rows - Simple and Fast */
.ai-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  flex-shrink: 0 !important;
}

.ai-msg-row.bot {
  align-self: flex-start;
}

.ai-msg-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.ai-msg-avatar.bot {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  padding: 2px;
}
.ai-msg-avatar.bot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.ai-msg-avatar.user {
  display: none !important; /* WhatsApp doesn't display user avatar in chat stream */
}

.ai-msg-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: calc(100% - 34px);
  width: auto;
  min-width: 0;
  box-sizing: border-box;
}

.ai-msg-row.user .ai-msg-content {
  max-width: 85%;
  align-items: flex-end;
}

/* BUBBLES - Sanction Institutional Theme */
.ai-bubble {
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

.ai-bubble.bot {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: var(--sw-text-main);
  border-top-left-radius: 3px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.ai-bubble.bot p {
  margin: 0 0 0.35rem 0;
  color: var(--sw-text-main);
}
.ai-bubble.bot p:last-child {
  margin-bottom: 0;
}

.ai-bubble.bot strong {
  color: #0F172A;
  font-weight: 700;
}

.ai-bubble.user {
  background: var(--sw-primary-gradient);
  color: #FFFFFF;
  font-weight: 500;
  border-top-right-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 80, 158, 0.2);
}

.ai-bubble.user strong {
  color: #FFFFFF;
  font-weight: 700;
}

.ai-msg-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  color: var(--sw-text-muted);
  padding: 0 2px;
}

.ai-msg-row.user .ai-msg-meta {
  justify-content: flex-end;
}

.ai-wa-ticks {
  color: var(--sw-wa-ticks);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: -1.5px;
  display: inline-block;
}

.ai-edit-btn {
  background: none;
  border: none;
  color: var(--sw-primary);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  opacity: 0.9;
}
.ai-edit-btn:hover {
  color: var(--sw-primary-hover);
}

/* Typing Indicator */
.ai-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.85rem;
  background: #FFFFFF;
  border-radius: 8px;
  border-top-left-radius: 2px;
  box-shadow: 0 1px 1.5px rgba(11, 20, 26, 0.12);
}

.ai-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sw-text-muted);
  opacity: 0.6;
}

/* ==========================================================================
   6. INTERACTIVE CHIPS & BUTTONS (WHATSAPP QUICK REPLIES)
   ========================================================================== */
.ai-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0 !important;
}

.ai-chip {
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  color: var(--sw-text-main);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: all 0.12s ease;
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  flex-shrink: 0 !important;
}

.ai-chip:hover:not(:disabled) {
  background: var(--sw-primary-light);
  border-color: var(--sw-primary);
  color: var(--sw-primary);
}

.ai-chip:disabled {
  opacity: 0.55;
  cursor: default;
}

.ai-chip.selected {
  background: var(--sw-primary);
  color: #FFFFFF;
  border-color: var(--sw-primary);
}

/* Language Selection Chip Special Styling */
.ai-chip-lang {
  padding: 0.6rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 12px;
}

/* ==========================================================================
   7. INTERACTIVE ACTION CARDS & FORMS WITHIN CHAT
   ========================================================================== */
.ai-action-card {
  background: #FFFFFF;
  border: 1px solid var(--sw-border);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  margin-top: 0.35rem;
  margin-bottom: 1.25rem !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  flex-shrink: 0 !important;
}

.ai-card-title {
  font-size: 0.825rem;
  font-weight: 800;
  color: var(--sw-text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  word-break: break-word;
  flex-shrink: 0 !important;
}

.ai-card-title svg {
  color: var(--sw-primary);
  flex-shrink: 0;
}

/* Inputs & Form Groups inside Chat */
.ai-input-row {
  display: flex;
  gap: 0.4rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  flex-shrink: 0 !important;
}

.ai-input {
  flex: 1;
  min-width: 0 !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #F0F2F5;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  color: var(--sw-text-main);
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  min-height: 38px;
  font-family: inherit;
  transition: border-color 0.12s ease;
}

.ai-input:focus {
  outline: none;
  background: #FFFFFF;
  border-color: var(--sw-primary);
  box-shadow: 0 0 0 2px var(--sw-primary-glow);
}

.ai-input::placeholder {
  color: #64748B !important;
  opacity: 1 !important;
}

.ai-input::-webkit-input-placeholder {
  color: #64748B !important;
  opacity: 1 !important;
}

.ai-input::-moz-placeholder {
  color: #64748B !important;
  opacity: 1 !important;
}

.ai-input:-ms-input-placeholder {
  color: #64748B !important;
  opacity: 1 !important;
}

.ai-input-select {
  background: #F0F2F5;
  color: var(--sw-text-main);
}

.ai-submit-btn {
  background: var(--sw-primary);
  color: #FFFFFF;
  font-size: 0.825rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  min-height: 38px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0 !important;
  white-space: nowrap;
  transition: background 0.12s ease;
}

.ai-submit-btn:hover {
  background: var(--sw-primary-hover);
}

/* 3 Months Dynamic Salary Grid */
.salary-month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.salary-month-col {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.salary-month-col label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--sw-primary);
  display: block;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.salary-month-col .ai-input {
  padding: 0.55rem 0.3rem;
  font-size: 0.8rem;
  text-align: center;
  min-width: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

.salary-avg-preview {
  background: var(--sw-primary-light);
  border: 1px dashed rgba(5, 150, 105, 0.35);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--sw-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

/* Existing Active Loan Repeater */
.loan-repeater-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.loan-item-box {
  background: var(--sw-bg-surface);
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  padding: 0.6rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 0.4rem;
  align-items: center;
}

@media (max-width: 480px) {
  .loan-item-box {
    grid-template-columns: 1fr 1fr;
  }
}

/* City Search Autocomplete Box */
.city-search-box {
  position: relative;
}

.city-suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  max-height: 160px;
  overflow-y: auto;
  z-index: 25;
  margin-top: 4px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  display: none;
}

.city-suggestion-item {
  padding: 0.55rem 0.8rem;
  font-size: 0.8rem;
  color: var(--sw-text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #F1F5F9;
}

.city-suggestion-item:hover {
  background: var(--sw-primary-light);
  color: var(--sw-primary);
}

.city-tier-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #E2E8F0;
  color: var(--sw-text-muted);
}

/* Email OTP Verification Card */
.otp-card {
  text-align: center;
  padding: 1.15rem 0.75rem;
}

.otp-digit-inputs {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.75rem 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.otp-digit {
  width: 36px;
  height: 44px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  color: var(--sw-primary);
  min-width: 0;
  box-sizing: border-box;
}

.otp-digit:focus {
  outline: none;
  border-color: var(--sw-primary);
  box-shadow: 0 0 0 3px var(--sw-primary-glow);
}

.otp-timer {
  font-size: 0.75rem;
  color: var(--sw-text-muted);
  margin-bottom: 0.85rem;
}

/* Underwriting Simulation Spinner */
.underwriting-eval-card {
  padding: 1.35rem;
  text-align: center;
  background: #FFFFFF;
  border: 1px solid var(--sw-border);
  border-radius: 14px;
  margin-top: 0.65rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  flex-shrink: 0 !important;
}

.eval-spinner-ring {
  width: 40px;
  height: 40px;
  border: 3px solid #E2E8F0;
  border-top-color: var(--sw-primary);
  border-radius: 50%;
  animation: swSpin 0.8s linear infinite;
  margin: 0 auto 0.85rem;
}

@keyframes swSpin {
  to { transform: rotate(360deg); }
}

.eval-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.85rem;
  text-align: left;
  font-size: 0.775rem;
  color: var(--sw-text-muted);
}

.eval-step-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.eval-step-item.done {
  color: var(--sw-text-main);
  font-weight: 700;
}

.eval-step-item.done svg {
  color: var(--sw-primary);
}

/* ==========================================================================
   8. FINAL RESULT CARDS (CLEAN LIGHT THEME)
   ========================================================================== */
.ai-result-card {
  border-radius: 16px;
  padding: 1.15rem;
  background: #FFFFFF;
  border: 1.5px solid #BAE6FD;
  box-shadow: 0 8px 24px rgba(0, 80, 158, 0.08);
  margin-top: 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  flex-shrink: 0 !important;
}

.ai-result-card.rejected {
  background: #FFFFFF;
  border-color: #FECACA;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.08);
}

.ai-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: 16px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.ai-result-badge.success {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

.ai-result-badge.warning {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.ai-result-hero-amount {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--sw-primary);
  letter-spacing: -0.02em;
  margin: 0.2rem 0 0.65rem;
  word-break: break-all;
}

.ai-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.75rem 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .ai-breakdown-grid {
    grid-template-columns: 1fr;
  }
}

.ai-breakdown-item {
  background: #FFFFFF;
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
}

.ai-breakdown-item span {
  font-size: 0.68rem;
  color: var(--sw-text-muted);
}

.ai-breakdown-item strong {
  font-size: 0.875rem;
  color: var(--sw-text-main);
}

.ai-disclaimer-box {
  background: #F8FAFC;
  border-left: 3px solid var(--sw-primary);
  padding: 0.65rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.7rem;
  line-height: 1.45;
  color: var(--sw-text-muted);
  margin-top: 0.85rem;
}

.ai-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 420px) {
  .ai-result-actions {
    grid-template-columns: 1fr;
  }
}

.ai-btn-call,
.ai-btn-whatsapp,
.ai-btn-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
  cursor: pointer;
  border: none;
  line-height: 1.3;
  width: 100%;
  min-height: 44px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  transition: all 0.12s ease;
}

.ai-btn-call {
  background: var(--sw-primary);
  color: #FFFFFF !important;
}
.ai-btn-call:hover {
  background: var(--sw-primary-hover);
  color: #FFFFFF !important;
}

.ai-btn-whatsapp {
  background: #25D366;
  color: #FFFFFF !important;
}
.ai-btn-whatsapp:hover {
  background: #1EBE5D;
  color: #FFFFFF !important;
}

.ai-btn-alt {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: var(--sw-text-main) !important;
}
.ai-btn-alt:hover {
  background: #E2E8F0;
}

/* ==========================================================================
   9. MOBILE FULLSCREEN SHEET (< 480px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Floating chat launcher is hidden on mobile: replaced by app sticky bottom nav & more drawer */
  .sanction-chat-launcher {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .sanction-chat-launcher {
    display: none !important;
  }
  
  .sanction-launcher-teaser {
    display: none;
  }

  .sanction-launcher-btn {
    width: 52px;
    height: 52px;
  }

  .sanction-chat-popup {
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
  }

  .ai-terminal-header {
    padding: 0.75rem 1rem;
  }

  .ai-chat-stream {
    padding: 1rem 0.85rem;
  }
}

/* ==========================================================================
   9. SENIOR ADVISOR DISPATCH & REQUIRED DOCUMENTS (LOD) STYLES
   ========================================================================== */
.ai-agent-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #F0F6FC;
  border: 1px solid #BAE6FD;
  border-left: 4px solid var(--sw-primary);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  margin: 0.65rem 0;
  text-align: left;
}

.ai-agent-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.ai-agent-text strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  color: #003D7A;
  margin-bottom: 0.2rem;
}

.ai-agent-text p {
  font-size: 0.76rem;
  line-height: 1.45;
  color: #1E293B;
  margin: 0;
}

.ai-lod-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 0.85rem;
  margin: 0.65rem 0;
  text-align: left;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.ai-lod-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #E2E8F0;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.ai-lod-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.825rem;
  font-weight: 800;
  color: #0F172A;
}

.ai-lod-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--sw-primary);
  border: none;
  color: #FFFFFF;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ai-lod-copy-btn:hover {
  background: var(--sw-primary-hover);
}

.ai-lod-copy-btn.copied {
  background: #25D366 !important;
  color: #FFFFFF !important;
}

.ai-lod-content {
  font-size: 0.76rem;
  color: #334155;
  line-height: 1.55;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.ai-lod-content::-webkit-scrollbar {
  width: 4px;
}

.ai-lod-content::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

.ai-lod-section {
  margin-bottom: 0.65rem;
}

.ai-lod-section:last-child {
  margin-bottom: 0;
}

.ai-lod-section-title {
  font-weight: 800;
  color: #0F172A;
  font-size: 0.76rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ai-lod-items {
  margin: 0;
  padding-left: 1.15rem;
  list-style-type: disc;
}

.ai-lod-items li {
  margin-bottom: 0.2rem;
  font-size: 0.73rem;
  color: #334155;
}

.ai-lod-footer {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #E2E8F0;
  font-size: 0.72rem;
  color: #64748B;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

