/* ── AI Chat Widget ──────────────────────────────────────────── */
.ai-chat-shell {
  position: fixed;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 1600;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .9rem;
  pointer-events: none; /* shell bounding box must never block underlying touches */
}
@media (max-width: 768px) {
  .ai-chat-shell {
    bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 0.75rem);
  }
  body.modal-scroll-lock #bottom-nav,
  body.modal-scroll-lock .ai-chat-shell {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
.ai-chat-shell.is-open {
  gap: 0;
}
.ai-chat-shell.is-open .ai-chat-launcher {
  opacity: 0;
  pointer-events: none;
}

/* Intercom-style compact icon launcher */
.ai-chat-launcher {
  cursor: pointer;
  display: inline-flex;
  position: relative;
  width: 58px;
  height: 58px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: linear-gradient(155deg, #0d3e38 0%, #0f5f56 68%, #c57230 100%);
  color: #fff;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 40px rgba(15,95,86,0.28), 0 4px 14px rgba(14,30,27,0.12);
  transition: transform .18s ease, box-shadow .18s ease;
  pointer-events: auto; /* override shell's pointer-events: none */
  appearance: none;
  -webkit-appearance: none;
}
.ai-chat-launcher:hover {
  transform: scale(1.07);
  box-shadow: 0 12px 38px rgba(15,95,86,0.48), 0 3px 10px rgba(0,0,0,0.2);
}
.ai-chat-launcher:active { transform: scale(.97); }

/* Online ping dot */
.ai-chat-launcher-ping {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #6ef5d0;
  border: 2px solid rgba(15,95,86,0.6);
  animation: ai-chat-pulse 2.4s infinite;
}

/* Chat icon */
.ai-chat-launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ai-chat-launcher-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* Hide text label entirely — icon-only style */
.ai-chat-launcher-copy { display: none; }

/* Unread badge (shown when panel is closed and there's history) */
.ai-chat-launcher-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e44;
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.ai-chat-shell.has-unread .ai-chat-launcher-badge { display: inline-flex; }
.ai-chat-launcher-close {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #14342f;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(14,30,27,0.18);
  z-index: 2;
  cursor: pointer;
}
.ai-chat-shell.is-launcher-hidden { display: none; }

/* Panel */
.ai-chat-panel {
  position: fixed;
  right: 0.75rem;
  bottom: calc(58px + 0.75rem + 0.5rem); /* above launcher: launcher + shell-bottom + gap */
  width: min(380px, calc(100vw - 1.5rem));
  max-height: min(680px, calc(100svh - 58px - 0.75rem - 0.5rem - 0.75rem)); /* leaves 0.75rem at top */
  min-height: 460px;
  height: auto;
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto auto;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 28px 72px rgba(14,30,27,0.26), 0 4px 18px rgba(14,30,27,0.10);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(.5rem) scale(.985);
  transform-origin: bottom right;
  transition: width .28s cubic-bezier(.22,1,.36,1), opacity .18s ease, box-shadow .18s ease, transform .22s ease, visibility 0s linear .22s;
}
.ai-chat-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
.ai-chat-panel > * {
  transition: opacity .14s ease;
}
.ai-chat-shell.is-open .ai-chat-panel {
  bottom: 0.75rem;
  height: min(680px, calc(100svh - 1.5rem));
  max-height: min(680px, calc(100svh - 1.5rem));
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}
.ai-chat-shell.is-resizing .ai-chat-panel::after {
  opacity: .18;
}
.ai-chat-shell.is-resizing .ai-chat-panel > * {
  opacity: 0;
}

/* Panel header */
.ai-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .82rem .9rem .82rem 1rem;
  color: #fff;
  background: radial-gradient(ellipse at top left, rgba(255,255,255,0.18), transparent 60%),
              linear-gradient(140deg, #0d3e38 0%, #0f5f56 55%, #c57230 100%);
}
.ai-chat-head-left {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
}
.ai-chat-head-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-chat-head-copy,
.ai-chat-head-kicker,
.ai-chat-head-sub {
  display: none !important;
}
.ai-chat-head-mode {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: none;
  color: rgba(255,255,255,.92);
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Header action buttons (clear + close) */
.ai-chat-head-actions {
  display: flex;
  align-items: center;
  gap: .34rem;
  flex-shrink: 0;
}
.ai-chat-head-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: rgba(255,255,255,0.88);
  font-size: .78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.ai-chat-head-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.ai-chat-expand-close { display: none; }
.ai-chat-shell.is-maximized .ai-chat-expand-open { display: none; }
.ai-chat-shell.is-maximized .ai-chat-expand-close { display: block; }
.ai-chat-close,
.ai-chat-minimize {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: rgba(255,255,255,0.9);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.ai-chat-close:hover,
.ai-chat-minimize:hover { background: rgba(255,255,255,0.14); }

/* Messages area */
.ai-chat-messages {
  overflow-y: auto;
  overflow-x: hidden;
  padding: .8rem .85rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  background: #f5f7fa;
  scroll-behavior: smooth;
}
.ai-chat-bubble {
  max-width: 84%;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.ai-chat-bubble--user { align-self: flex-end; }
.ai-chat-bubble--assistant { align-self: flex-start; }
.ai-chat-bubble-meta {
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(20,33,29,0.34);
  padding: 0 .35rem;
}
.ai-chat-bubble--user .ai-chat-bubble-meta { text-align: right; }
.ai-chat-bubble-body {
  padding: .82rem 1rem;
  border-radius: 18px;
  font-size: .8rem;
  line-height: 1.52;
  color: #1a2820;
  box-shadow: 0 2px 10px rgba(20,33,29,0.06);
}
.ai-chat-bubble--assistant .ai-chat-bubble-body {
  min-height: 72px;
  border-top-left-radius: 5px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(20,33,29,0.08);
}
.ai-chat-bubble--reasoning {
  max-width: 82%;
  opacity: 0.56;
}
.ai-chat-bubble-body--reasoning {
  padding: .54rem .72rem;
  background: linear-gradient(180deg, rgba(245, 250, 248, 0.62) 0%, rgba(238, 246, 243, 0.52) 100%);
  border: 1px solid rgba(15,95,86,0.06);
  color: rgba(47, 78, 69, 0.66);
  font-size: .69rem;
  line-height: 1.35;
  white-space: pre-wrap;
  position: relative;
  height: 72px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.ai-chat-reasoning-placeholder {
  color: rgba(47, 78, 69, 0.62);
}
.ai-chat-bubble-body--streaming {
  white-space: pre-wrap;
}
.ai-chat-bubble--user .ai-chat-bubble-body {
  border-top-right-radius: 5px;
  color: #fff;
  background: linear-gradient(140deg, #0d3e38 0%, #0f5f56 65%, #1a7065 100%);
  box-shadow: 0 4px 16px rgba(15,95,86,0.28);
}
.ai-chat-bubble--typing .ai-chat-bubble-body { display: none; }

/* Status bubble — shown while AI is searching for data before first token */
.ai-chat-bubble-body--status {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .82rem;
  color: rgba(29,78,216,0.72);
  font-style: italic;
  padding: .1rem 0;
  min-height: 1.4rem;
}
.ai-chat-status-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 1px;
}
.ai-chat-status-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(29,78,216,0.55);
  animation: ai-status-pulse 1.4s ease-in-out infinite both;
}
.ai-chat-status-dots span:nth-child(1) { animation-delay: 0s; }
.ai-chat-status-dots span:nth-child(2) { animation-delay: 0.18s; }
.ai-chat-status-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes ai-status-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.35; }
  40% { transform: scale(1); opacity: 1; }
}

.ai-chat-bubble--streaming { /* no special layout needed, inherits assistant bubble styles */ }
.ai-chat-typing {
  display: inline-flex;
  gap: .34rem;
  padding: .78rem .9rem;
  border-radius: 18px;
  border-top-left-radius: 5px;
  background: #fff;
  border: 1px solid rgba(20,33,29,0.07);
  box-shadow: 0 2px 10px rgba(20,33,29,0.06);
}
.ai-chat-typing span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15,95,86,0.45);
  animation: ai-chat-bounce 1.1s infinite ease-in-out;
}
.ai-chat-typing span:nth-child(2) { animation-delay: .14s; }
.ai-chat-typing span:nth-child(3) { animation-delay: .28s; }

/* Quick reply chips (Continue pagination) */
.ai-chat-quick-chips {
  display: flex;
  gap: .46rem;
  flex-wrap: wrap;
  padding: .18rem .88rem .62rem;
}
.ai-chat-quick-chip {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  border: none;
  border-radius: 999px;
  padding: .52rem 1rem;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .13s, box-shadow .13s, opacity .13s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.ai-chat-quick-chip--continue {
  background: linear-gradient(130deg, #0d3e38 0%, #0f5f56 60%, #c47230 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(15,95,86,0.22);
  letter-spacing: .01em;
}
.ai-chat-quick-chip--continue:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(15,95,86,0.30);
}
.ai-chat-quick-chip--continue:active { transform: scale(.96); }
.ai-chat-chip-count {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: .1rem .48rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
}

/* ─── Bubble entrance animation ─────────────────────────────────────────── */
@keyframes ai-bubble-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-chat-bubble--new {
  animation: ai-bubble-in .28s cubic-bezier(.22,.68,0,1.3) both;
}

/* ─── Rich markdown body ─────────────────────────────────────────────────── */
.ai-chat-bubble-body--md {
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Spacing helper between block elements */
.ai-chat-bubble-body--md .md-spacer { height: .55rem; }

/* Paragraphs */
.ai-chat-bubble-body--md .md-p {
  margin: 0 0 .45rem;
  line-height: 1.6;
}
.ai-chat-bubble-body--md .md-p:last-child { margin-bottom: 0; }

/* Headings */
.ai-chat-bubble-body--md .md-h3 {
  font-size: .85rem;
  font-weight: 800;
  color: #0a4a42;
  margin: .6rem 0 .3rem;
  letter-spacing: .01em;
  padding-bottom: .22rem;
  border-bottom: 2px solid rgba(15,95,86,0.12);
}
.ai-chat-bubble-body--md .md-h4 {
  font-size: .8rem;
  font-weight: 700;
  color: #0f5f56;
  margin: .5rem 0 .22rem;
}
.ai-chat-bubble-body--md .md-h5 {
  font-size: .76rem;
  font-weight: 700;
  color: #0f5f56;
  margin: .4rem 0 .18rem;
}

/* Bold & italic */
.ai-chat-bubble-body--md strong { font-weight: 800; color: #0a3830; }
.ai-chat-bubble-body--md em { font-style: italic; color: #2c5c54; }
.ai-chat-bubble-body--md del { opacity: .55; text-decoration: line-through; }

/* Inline code */
.ai-chat-bubble-body--md .md-icode {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: .74rem;
  background: rgba(15,95,86,0.08);
  color: #0a4a42;
  border-radius: 4px;
  padding: .08em .32em;
}

/* Code block */
.ai-chat-bubble-body--md .md-code {
  background: #0d1f1c;
  color: #a8e4d4;
  border-radius: 8px;
  padding: .72rem .9rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .72rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: .4rem 0;
  white-space: pre;
}
.ai-chat-bubble-body--md .md-code code { background: none; color: inherit; padding: 0; }

/* Horizontal rule */
.ai-chat-bubble-body--md .md-hr {
  border: none;
  border-top: 1.5px solid rgba(15,95,86,0.13);
  margin: .55rem 0;
}

/* Lists */
.ai-chat-bubble-body--md .md-ul,
.ai-chat-bubble-body--md .md-ol {
  margin: .25rem 0 .45rem;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .22rem;
}
.ai-chat-bubble-body--md .md-ul li { list-style: disc; }
.ai-chat-bubble-body--md .md-ol li { list-style: decimal; }
.ai-chat-bubble-body--md li { line-height: 1.52; }

/* Blockquote */
.ai-chat-bubble-body--md .md-bq {
  border-left: 3px solid #0f5f56;
  background: rgba(15,95,86,0.05);
  margin: .35rem 0;
  padding: .5rem .75rem;
  border-radius: 0 6px 6px 0;
  color: #1a4a42;
  font-size: .79rem;
  line-height: 1.55;
}

/* ─── Table card ─────────────────────────────────────────────────────────── */
@keyframes md-table-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-chat-bubble-body--md .md-table-wrap {
  overflow-x: auto;
  margin: .45rem -1rem;
  padding: 0 1rem .1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(15,95,86,0.18) transparent;
  animation: md-table-in .32s ease both;
}
.ai-chat-bubble-body--md .md-table-wrap::-webkit-scrollbar {
  height: 4px;
}
.ai-chat-bubble-body--md .md-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(15,95,86,0.2);
  border-radius: 99px;
}
.ai-chat-bubble-body--md .md-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: .75rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15,95,86,0.09);
}
.ai-chat-bubble-body--md .md-table thead tr {
  background: linear-gradient(90deg, #0a3830 0%, #0f5f56 100%);
  color: #fff;
}
.ai-chat-bubble-body--md .md-table th {
  padding: .5rem .7rem;
  text-align: left;
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .04em;
  white-space: nowrap;
}
.ai-chat-bubble-body--md .md-table tbody tr {
  border-bottom: 1px solid rgba(15,95,86,0.07);
  transition: background .12s;
}
.ai-chat-bubble-body--md .md-table tbody tr:nth-child(even) {
  background: rgba(15,95,86,0.035);
}
.ai-chat-bubble-body--md .md-table tbody tr:hover {
  background: rgba(15,95,86,0.075);
}
.ai-chat-bubble-body--md .md-table td {
  padding: .45rem .7rem;
  vertical-align: top;
  line-height: 1.45;
  color: #1a2820;
}
.ai-chat-bubble-body--md .md-table td strong { color: #0a3830; }
/* ─── AI Chat Welcome / Empty State ─────────────────────────────────────── */
.ai-chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding: 28px 18px 20px;
  text-align: center;
  animation: ai-welcome-in 0.38s ease both;
}
@keyframes ai-welcome-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-chat-welcome-hero {
  margin-bottom: 18px;
  animation: ai-welcome-in 0.38s 0.04s ease both;
}
.ai-chat-welcome-orb {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f9e8b 0%, #0a7563 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  animation: ai-orb-pulse 2.6s ease-in-out infinite;
  box-shadow: 0 4px 18px rgba(15,158,139,0.25);
}
@keyframes ai-orb-pulse {
  0%, 100% { box-shadow: 0 4px 18px rgba(15,158,139,0.25), 0 0 0 0 rgba(15,158,139,0.3); }
  50%       { box-shadow: 0 4px 18px rgba(15,158,139,0.25), 0 0 0 12px rgba(15,158,139,0); }
}
.ai-chat-welcome-greeting {
  font-size: 14px;
  color: #8b9ab4;
  margin: 0 0 5px;
  animation: ai-welcome-in 0.38s 0.09s ease both;
}
.ai-chat-welcome-title {
  font-size: 17px;
  font-weight: 700;
  color: #0e1a1a;
  margin: 0 0 9px;
  line-height: 1.3;
  animation: ai-welcome-in 0.38s 0.14s ease both;
}
.ai-chat-welcome-sub {
  font-size: 13px;
  color: #8b9ab4;
  line-height: 1.6;
  margin: 0 0 22px;
  max-width: 255px;
  animation: ai-welcome-in 0.38s 0.18s ease both;
}
.ai-chat-welcome-chips {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  animation: ai-welcome-in 0.38s 0.22s ease both;
}
/* Chips header row (label + refresh btn) */
.ai-chat-welcome-chips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 4px;
  padding: 0 2px;
}
.ai-chat-welcome-chips-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #b0b9c8;
}
.ai-chat-welcome-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid #e4e9f0;
  background: #fff;
  color: #8b9ab4;
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s, transform .2s;
  -webkit-tap-highlight-color: transparent;
}
.ai-chat-welcome-refresh:hover {
  background: rgba(15,158,139,0.07);
  border-color: rgba(15,158,139,0.38);
  color: #0a8a7a;
}
.ai-chat-welcome-refresh:active { transform: rotate(180deg); }
/* Resume previous session */
.ai-chat-welcome-resume {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(15,158,139,0.08);
  border: 1.5px solid rgba(15,158,139,0.25);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: #0a7563;
  cursor: pointer;
  margin-bottom: 14px;
  transition: background .14s, border-color .14s, transform .14s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  animation: ai-welcome-in 0.32s 0.16s ease both;
}
.ai-chat-welcome-resume:hover {
  background: rgba(15,158,139,0.14);
  border-color: rgba(15,158,139,0.45);
  transform: translateX(-2px);
}
/* Welcome action row: Continue Conversation + New Chat + History */
.ai-welcome-action-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.ai-welcome-action-row .ai-chat-welcome-resume {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.ai-chat-welcome-newchat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(15,158,139,0.05);
  border: 1.5px solid rgba(15,158,139,0.18);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  color: #0a7563;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .14s, border-color .14s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.ai-chat-welcome-newchat:hover {
  background: rgba(15,158,139,0.12);
  border-color: rgba(15,158,139,0.40);
}
.ai-chat-welcome-history-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  height: 32px;
  background: rgba(15,158,139,0.05);
  border: 1.5px solid rgba(15,158,139,0.18);
  border-radius: 8px;
  color: #0a7563;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .14s, border-color .14s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  flex: 1 1 100%;
  width: 100%;
}
.ai-chat-welcome-history-btn:hover {
  background: rgba(15,158,139,0.12);
  border-color: rgba(15,158,139,0.40);
}
.ai-history-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0a7563;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 99px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 2px;
  line-height: 1;
}
.ai-history-icon {
  flex-shrink: 0;
  opacity: 0.85;
}
.ai-history-label {
  flex-shrink: 0;
}
/* Chat history panel */
.ai-chat-history-panel {
  padding: 12px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-chat-history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.ai-chat-history-panel-title {
  font-size: 12px;
  font-weight: 700;
  color: #1a2820;
  letter-spacing: .01em;
  text-transform: uppercase;
  opacity: .65;
}
.ai-chat-history-back-btn {
  font-size: 12px;
  font-weight: 600;
  color: #0a7563;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.ai-chat-history-back-btn:hover { text-decoration: underline; }
.ai-chat-history-item {
  background: #fff;
  border: 1.5px solid rgba(15,95,86,0.10);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-chat-history-meta {
  font-size: 10.5px;
  color: rgba(20,33,29,0.50);
  font-weight: 500;
}
.ai-chat-history-preview {
  font-size: 12.5px;
  color: #1a2820;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ai-chat-history-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.ai-chat-history-resume-btn {
  font-size: 11.5px;
  font-weight: 600;
  color: #0a7563;
  background: rgba(15,158,139,0.08);
  border: 1px solid rgba(15,158,139,0.22);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background .13s;
}
.ai-chat-history-resume-btn:hover { background: rgba(15,158,139,0.16); }
.ai-chat-history-delete-btn {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(20,33,29,0.45);
  background: none;
  border: 1px solid rgba(20,33,29,0.12);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: color .13s, border-color .13s;
}
.ai-chat-history-delete-btn:hover { color: #dc2626; border-color: rgba(220,38,38,0.30); }
.ai-chat-history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px 24px;
  gap: 8px;
  text-align: center;
}
.ai-chat-history-empty-icon { opacity: .35; color: #0a7563; }
.ai-chat-history-empty-title { font-size: 14px; font-weight: 700; color: #1a2820; }
.ai-chat-history-empty-sub { font-size: 12px; color: rgba(20,33,29,0.52); line-height: 1.5; max-width: 220px; }

/* Home button in header (house icon) */
.ai-chat-home-btn {
  color: inherit;
}
.ai-chat-shell.is-open .ai-chat-home-btn {
  opacity: .65;
}
.ai-chat-shell.is-open .ai-chat-home-btn:hover {
  opacity: 1;
  color: #0f9e8b;
}
.ai-chat-home-btn:disabled {
  opacity: .28 !important;
  pointer-events: none;
  cursor: default;
}
/* Follow-up contextual chips after AI recommendation */
.ai-chat-follow-chips {
  padding: .1rem .88rem .7rem;
  gap: .4rem;
  flex-wrap: wrap;
  animation: ai-follow-chips-in 0.26s ease both;
}
@keyframes ai-follow-chips-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-chat-follow-chip {
  background: rgba(15,95,86,0.08);
  color: #0a5c52;
  border: 1.5px solid rgba(15,95,86,0.2);
  font-size: .75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: .46rem .9rem;
  cursor: pointer;
  transition: background .13s, border-color .13s, transform .12s;
  font-family: inherit;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.ai-chat-follow-chip:hover {
  background: rgba(15,95,86,0.15);
  border-color: rgba(15,95,86,0.4);
  transform: translateY(-1px);
}
.ai-chat-follow-chip:active { transform: scale(.96); }
.ai-chat-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(161,98,7,0.07);
  border: 1px solid rgba(161,98,7,0.18);
  border-radius: 8px;
  font-size: 10.5px;
  line-height: 1.5;
  color: #7d8b83;
}
.ai-chat-disclaimer svg {
  flex-shrink: 0;
  color: #a16207;
  margin-top: 1px;
}
.ai-chat-welcome-chip {
  background: #f5f7fa;
  border: 1.5px solid #e4e9f0;
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 12.5px;
  color: #1a2035;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, transform 0.14s, box-shadow 0.14s, color 0.14s;
  font-family: inherit;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
.ai-chat-welcome-chip:hover {
  background: rgba(15,158,139,0.07);
  border-color: rgba(15,158,139,0.38);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(15,158,139,0.1);
  color: #0a6e62;
}
.ai-chat-welcome-chip:active {
  transform: translateY(0);
  box-shadow: none;
}
/* Stagger chip entrance — use forwards so chips are visible at rest before animation starts */
.ai-chat-welcome-chip:nth-child(1) { animation: ai-chip-in 0.28s 0.10s ease forwards; }
.ai-chat-welcome-chip:nth-child(2) { animation: ai-chip-in 0.28s 0.16s ease forwards; }
.ai-chat-welcome-chip:nth-child(3) { animation: ai-chip-in 0.28s 0.22s ease forwards; }
.ai-chat-welcome-chip:nth-child(4) { animation: ai-chip-in 0.28s 0.28s ease forwards; }
.ai-chat-welcome-chip:nth-child(5) { animation: ai-chip-in 0.28s 0.34s ease forwards; }
.ai-chat-welcome-chip:nth-child(6) { animation: ai-chip-in 0.28s 0.40s ease forwards; }
@keyframes ai-chip-in {
  from { opacity: .45; transform: translateX(-5px); }
  to   { opacity: 1; transform: translateX(0); }
}

.ai-chat-suggestions {
  display: none !important;
  gap: .42rem;
  overflow-x: auto;
  padding: .42rem .85rem .58rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-top: 1px solid rgba(20,33,29,0.05);
  background: rgba(255,255,255,0.6);
}
.ai-chat-suggestions::-webkit-scrollbar { display: none; }
.ai-chat-suggestion {
  flex: 0 0 auto;
  border: 1.5px solid rgba(15,95,86,0.14);
  border-radius: 999px;
  padding: .48rem .88rem;
  background: #fff;
  color: #1a2820;
  font-size: .74rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.ai-chat-suggestion:hover {
  border-color: rgba(15,95,86,0.36);
  background: rgba(15,95,86,0.05);
}
.ai-chat-suggestion:active { transform: scale(.96); }

/* Input form */
.ai-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .44rem;
  align-items: end;
  padding: .54rem .74rem .68rem;
  border-top: 1px solid #e8ecf0;
  background: #ffffff;
}
.ai-chat-reason-toggle {
  grid-column: 1 / -1;
  justify-self: start;
  padding: .28rem .62rem;
  border-radius: 999px;
  border: 1px solid rgba(15,95,86,0.14);
  background: rgba(15,95,86,0.05);
  color: rgba(20,33,29,0.72);
  font: inherit;
  font-size: .68rem;
  line-height: 1.1;
  cursor: pointer;
}
.ai-chat-reason-toggle.is-active {
  border-color: rgba(15,95,86,0.28);
  background: rgba(15,95,86,0.1);
  color: #0f5f56;
}
.ai-chat-input {
  min-height: 46px;
  max-height: 144px;
  resize: none;
  border: 1.5px solid rgba(15,95,86,0.13);
  border-radius: 18px;
  padding: .72rem .88rem;
  background: #f5f7fa;
  color: #1a2820;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  transition: border-color .15s, box-shadow .15s;
  -webkit-text-size-adjust: 100%;
}
.ai-chat-input::placeholder { color: rgba(20,33,29,0.36); }
.ai-chat-input:focus {
  outline: none;
  border-color: rgba(15,95,86,0.34);
  box-shadow: 0 0 0 3px rgba(15,95,86,0.09);
  background: #ffffff;
}
.ai-chat-send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 13px;
  background: linear-gradient(145deg, #0d3e38 0%, #0f5f56 65%, #c57230 100%);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  box-shadow: 0 4px 14px rgba(15,95,86,0.2);
  transition: transform .15s, box-shadow .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.ai-chat-send:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,95,86,0.26); }
.ai-chat-send:active { transform: scale(.95); }
.ai-chat-send:disabled { opacity: .48; cursor: default; box-shadow: none; transform: none; }
.ai-chat-send svg { display: block; }
.ai-chat-send.is-stop {
  background: linear-gradient(145deg, #6f2c2c 0%, #9c3d3d 65%, #cc6a3a 100%);
}

.ai-chat-shell.is-wide .ai-chat-panel {
  width: min(760px, calc(100vw - 2rem));
  height: min(680px, calc(100svh - 1.5rem));
  max-height: min(680px, calc(100svh - 1.5rem));
}

.ai-chat-shell.is-wide .ai-chat-messages {
  padding: 1rem 1.1rem;
}

.ai-chat-shell.is-wide .ai-chat-bubble {
  max-width: min(72%, 760px);
}

.ai-chat-shell.is-wide .ai-chat-bubble-body {
  font-size: .82rem;
}

.ai-chat-shell.is-maximized .ai-chat-panel {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  transform: none;
}

.ai-chat-shell.is-maximized .ai-chat-messages {
  padding: 1.05rem 1.2rem;
}

.ai-chat-shell.is-maximized .ai-chat-bubble {
  max-width: min(72%, 760px);
}

.ai-chat-shell.is-maximized .ai-chat-bubble-body {
  font-size: .82rem;
}
.ai-chat-shell.is-maximized {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
}
.ai-chat-shell.is-maximized .ai-chat-head-mode {
  display: inline-flex;
}
.ai-chat-shell.is-maximized .ai-chat-head {
  padding-top: max(.82rem, env(safe-area-inset-top, 0px));
}

@keyframes ai-chat-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(110,245,208,0.6); }
  70%  { box-shadow: 0 0 0 9px rgba(110,245,208,0); }
  100% { box-shadow: 0 0 0 0 rgba(110,245,208,0); }
}
@keyframes ai-chat-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .4; }
  40%           { transform: translateY(-4px); opacity: 1; }
}

/* Mobile: shell + panel go fullscreen when open */
@media (max-width: 1024px) {
  /* Shell expands to cover full viewport — already position:fixed so just reset offsets */
  .ai-chat-shell.is-open {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    align-items: stretch;   /* panel fills width */
    justify-content: stretch;
    gap: 0;
    overflow: hidden;
    transform: none;
  }

  /* Panel fills the shell — no fixed-inside-fixed tricks */
  .ai-chat-shell.is-open .ai-chat-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    min-width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: none;
    transform: none;
    box-shadow: none;
    overflow: hidden;
  }

  /* Tighten internal gutters on mobile so the layout feels edge-to-edge */
  .ai-chat-shell.is-open .ai-chat-head {
    gap: .4rem;
    padding: env(safe-area-inset-top, 0px) .7rem .36rem;
  }
  .ai-chat-shell.is-open .ai-chat-head-avatar { display: none; }
  .ai-chat-shell.is-open .ai-chat-head-left {
    gap: .5rem;
  }
  .ai-chat-shell.is-open .ai-chat-head-btn,
  .ai-chat-shell.is-open .ai-chat-close,
  .ai-chat-shell.is-open .ai-chat-minimize {
    width: 30px;
    height: 30px;
  }
  .ai-chat-shell.is-open .ai-chat-messages {
    padding: .7rem;
    gap: .65rem;
  }
  .ai-chat-shell.is-open .ai-chat-bubble {
    max-width: 92%;
  }
  .ai-chat-shell.is-open .ai-chat-bubble-body {
    padding: .76rem .88rem;
  }
  .ai-chat-shell.is-open .ai-chat-suggestions {
    gap: .42rem;
    padding: .45rem .7rem .55rem;
  }
  .ai-chat-shell.is-open .ai-chat-suggestion {
    padding: .42rem .72rem;
  }
  .ai-chat-shell.is-open .ai-chat-form {
    gap: .44rem;
    padding: .5rem .68rem max(.68rem, env(safe-area-inset-bottom, 0px));
  }
  .ai-chat-shell.is-open .ai-chat-input {
    padding: .68rem .8rem;
  }
  /* Prevent iOS Safari auto-zoom on focus (requires font-size ≥ 16px) */
  .ai-chat-input {
    font-size: 16px;
  }

  .ai-chat-expand { display: none; }
  .ai-chat-launcher-close {
    width: 20px;
    height: 20px;
    font-size: 13px;
  }
  .ai-chat-launcher {
    width: 54px;
    height: 54px;
    border-radius: 999px;
  }

  /* Safe area: header clears notch, form clears home indicator */
  .ai-chat-head {
    padding-top: env(safe-area-inset-top, 0px);
  }
  .ai-chat-form {
    padding-bottom: max(.9rem, env(safe-area-inset-bottom, 0px));
  }
}

/* Backdrop overlay — shown on mobile when chat is open */
.ai-chat-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1599;
  background: rgba(14,30,27,0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
@media (max-width: 1024px) {
  .ai-chat-backdrop { display: block; }
  .ai-chat-backdrop.is-visible { opacity: 1; pointer-events: none; }
  body.ai-chat-maximized .ai-chat-backdrop.is-visible { pointer-events: auto; }
}

/* AI Chat — custom confirm dialog */
.ai-confirm-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: rgba(14,30,27,0.24);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: ai-confirm-fadein .18s ease;
}
.ai-confirm-box {
  background: #fff;
  border-radius: 18px;
  padding: 1.15rem 1rem 1rem;
  max-width: 280px;
  width: 100%;
  box-shadow: 0 18px 42px rgba(14,30,27,0.18), 0 4px 14px rgba(14,30,27,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .82rem;
  text-align: center;
  animation: ai-confirm-scalein .22s cubic-bezier(.34,1.56,.64,1);
}
.ai-confirm-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(196,114,48,0.10);
  color: #c47230;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-confirm-msg {
  font-size: .84rem;
  line-height: 1.46;
  color: var(--text-primary);
  font-weight: 500;
}
.ai-confirm-actions {
  display: flex;
  gap: .58rem;
  width: 100%;
}
.ai-confirm-btn {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 11px;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .14s, box-shadow .14s;
}
.ai-confirm-btn:hover { transform: scale(1.02); }
.ai-confirm-btn:active { transform: scale(.97); }
.ai-confirm-btn--cancel {
  background: rgba(20,33,29,0.07);
  color: var(--text-secondary);
}
.ai-confirm-btn--cancel:hover { background: rgba(20,33,29,0.11); }
.ai-confirm-btn--ok {
  background: linear-gradient(140deg, #c24133 0%, #e05545 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(194,65,51,0.26);
}
.ai-confirm-btn--ok:hover { box-shadow: 0 8px 22px rgba(194,65,51,0.34); }
@keyframes ai-confirm-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ai-confirm-scalein {
  from { transform: scale(.88); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}


/* ── Detail page override: no bottom nav, keep FAB at normal position ── */
@media (max-width: 768px) {
  body:not(.has-bottom-nav) .ai-chat-shell {
    bottom: 0.75rem;
  }
}
/* ── FAB CHAT LAUNCHER: blue theme to match site ─────────────────────────── */
.ai-chat-launcher {
  background: linear-gradient(140deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%) !important;
  box-shadow: 0 8px 28px rgba(29,78,216,0.35), 0 2px 8px rgba(29,78,216,0.20) !important;
  border-radius: 999px !important;
  width: 54px !important;
  height: 54px !important;
}
.ai-chat-launcher:hover {
  background: linear-gradient(140deg, #1e3a8a 0%, #1d4ed8 55%, #3b82f6 100%) !important;
  box-shadow: 0 12px 36px rgba(29,78,216,0.45), 0 3px 10px rgba(29,78,216,0.25) !important;
  transform: scale(1.06) !important;
}
/* Ping dot: blue */
.ai-chat-launcher-ping {
  background: #60a5fa !important;
  border-color: rgba(29,78,216,0.5) !important;
}
/* Panel header: blue */
.ai-chat-head {
  background: linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 100%) !important;
  border-bottom: none !important;
}
.ai-chat-head-avatar {
  background: rgba(255,255,255,0.15) !important;
  border-color: rgba(255,255,255,0.2) !important;
  color: #fff !important;
}
.ai-chat-close {
  color: rgba(255,255,255,0.8) !important;
  background: rgba(255,255,255,0.1) !important;
  border-color: rgba(255,255,255,0.15) !important;
}
.ai-chat-close:hover {
  background: rgba(255,255,255,0.2) !important;
  color: #fff !important;
}
/* Send button: blue */
.ai-chat-send {
  background: #1d4ed8 !important;
  box-shadow: none !important;
}
.ai-chat-send:hover {
  background: #1e3a8a !important;
}
/* ═══════════════════════════════════════════════════════════════════════════
   v40 — Chat redesign: full blue theme + reasoning polish
   ═══════════════════════════════════════════════════════════════════════════ */

/* Panel + messages area: light blue-tinted background */
.ai-chat-panel {
  background: #eef3ff !important;
  border: 1px solid rgba(15,23,42,.09) !important;
  box-shadow: 0 20px 60px rgba(15,23,42,0.18) !important;
}
.ai-chat-messages { background: #eef3ff !important; }

/* Meta role labels */
.ai-chat-bubble-meta {
  font-size: .58rem !important;
  font-weight: 700 !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
  color: rgba(30,58,138,0.42) !important;
  padding: 0 .4rem !important;
}
.ai-chat-bubble--user .ai-chat-bubble-meta {
  text-align: right !important;
  color: rgba(30,58,138,0.5) !important;
}

/* User bubble: brand blue gradient */
.ai-chat-bubble--user .ai-chat-bubble-body {
  background: linear-gradient(140deg, #1e3a8a 0%, #1d4ed8 65%, #3b82f6 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 18px rgba(29,78,216,0.28) !important;
  border-radius: 18px !important;
  border-top-right-radius: 5px !important;
}

/* Assistant bubble text */
.ai-chat-bubble--assistant .ai-chat-bubble-body {
  color: #1e2d4a !important;
  border: 1px solid rgba(29,78,216,0.1) !important;
  background: rgba(255,255,255,0.96) !important;
}

/* Reasoning / thinking bubble */
.ai-chat-bubble--reasoning {
  max-width: 90% !important;
  opacity: 1 !important;
}
.ai-chat-bubble--reasoning .ai-chat-bubble-meta {
  display: inline-flex !important;
  align-items: center !important;
  gap: .28rem !important;
  color: #3b82f6 !important;
  font-size: .58rem !important;
  font-weight: 800 !important;
  letter-spacing: .12em !important;
}
.ai-chat-bubble--reasoning .ai-chat-bubble-meta::before {
  content: '◈';
  font-size: .6rem !important;
  opacity: .7 !important;
}
.ai-chat-bubble-body--reasoning {
  background: rgba(219,234,254,0.45) !important;
  border: 1px solid rgba(59,130,246,0.18) !important;
  border-radius: 14px !important;
  color: rgba(30,58,138,0.7) !important;
  font-size: .7rem !important;
  height: 80px !important;
}

/* Typing dots: blue tint */
.ai-chat-typing {
  background: rgba(255,255,255,0.9) !important;
  border: 1px solid rgba(29,78,216,0.1) !important;
}
.ai-chat-typing span {
  background: #3b82f6 !important;
}

/* Reason toggle: blue */
.ai-chat-reason-toggle {
  border: 1px solid rgba(29,78,216,0.18) !important;
  background: rgba(29,78,216,0.05) !important;
  color: rgba(30,58,138,0.72) !important;
}
.ai-chat-reason-toggle.is-active {
  border-color: rgba(29,78,216,0.32) !important;
  background: rgba(29,78,216,0.1) !important;
  color: #1d4ed8 !important;
}

/* Input bar */
.ai-chat-input-bar, .ai-chat-form {
  background: #eef3ff !important;
  border-top: 1px solid rgba(29,78,216,0.08) !important;
}
.ai-chat-input {
  background: #fff !important;
  border: 1.5px solid rgba(29,78,216,0.13) !important;
  color: #0f172a !important;
}
.ai-chat-input:focus {
  border-color: rgba(29,78,216,0.38) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(29,78,216,0.08) !important;
}
.ai-chat-input::placeholder { color: #94a3b8 !important; }

/* Markdown assistant: blue-toned strong/em/code/blockquote */
.ai-chat-bubble-body--md strong { color: #1e3a8a !important; font-weight: 800 !important; }
.ai-chat-bubble-body--md em { color: #1d4ed8 !important; font-style: italic !important; }
.ai-chat-bubble-body--md .md-icode { background: rgba(29,78,216,0.08) !important; color: #1d4ed8 !important; }
.ai-chat-bubble-body--md .md-bq {
  border-left-color: rgba(29,78,216,0.25) !important;
  background: rgba(29,78,216,0.04) !important;
  color: rgba(30,58,138,0.72) !important;
}
