/* ============================================================================
   ISABI Systems - Ask ISABI Hybrid Copilot Styles (css/ask_isabi.css)
   Gallery-Alabaster Light & Dark Theme Parity (Zero Dark-Navy Blocks in Light)
   ============================================================================ */

#aiDrawer .ai-msg-user {
  align-self: flex-end;
  background: var(--brass-tint);
  color: var(--ink);
  border: 1px solid var(--brass-border);
  padding: 9px 14px;
  border-radius: 12px 12px 3px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.42;
  max-width: 88%;
}

:root[data-theme="dark"] #aiDrawer .ai-msg-user {
  background: #1A2C4A;
  color: #F4F2EE;
  border-color: rgba(217, 165, 74, 0.38);
}

#aiDrawer .ai-msg-bot {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--brass);
  border-radius: 4px 12px 12px 12px;
  padding: 13px 15px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.52;
  box-shadow: 0 2px 8px rgba(15, 30, 56, 0.04);
}

#aiDrawer .ai-msg-bot[dir="rtl"] {
  border-left: 1px solid var(--line-strong);
  border-right: 3px solid var(--brass);
  border-radius: 12px 4px 12px 12px;
}

:root[data-theme="dark"] #aiDrawer .ai-msg-bot {
  background: #10203D;
  border-color: rgba(255, 255, 255, 0.12);
  border-left-color: var(--brass);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] #aiDrawer .ai-msg-bot[dir="rtl"] {
  border-left-color: rgba(255, 255, 255, 0.12);
  border-right-color: var(--brass);
}

.ai-bot-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brass);
  margin-bottom: 5px;
}

.ai-bot-p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.54;
}

.ai-bot-list {
  margin: 8px 0 0;
  padding-left: 17px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.2px;
  color: var(--ink);
}

#aiDrawer .ai-msg-bot[dir="rtl"] .ai-bot-list {
  padding-left: 0;
  padding-right: 17px;
}

.ai-mini-table-wrap {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  background: var(--surface-2);
}

.ai-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.8px;
}

.ai-mini-table th {
  text-align: left;
  padding: 6px 9px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.ai-mini-table td {
  padding: 6px 9px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

:root[data-theme="dark"] .ai-mini-table td {
  background: rgba(11, 23, 48, 0.55);
}

.ai-mini-table tbody tr:last-child td {
  border-bottom: none;
}

.ai-mini-table th.num,
.ai-mini-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ai-mini-table tr.ai-mini-tot td {
  font-weight: 700;
  background: var(--brass-tint);
  border-top: 1px solid var(--brass-border);
}

.ai-bot-actions {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, transform 0.12s;
}

.ai-act-btn:hover {
  background: var(--brass-tint);
  border-color: var(--brass);
}

.ai-act-btn.is-primary {
  background: var(--brass);
  color: #0B1730;
  border-color: var(--brass);
  font-weight: 700;
}

.ai-act-btn.is-primary:hover {
  filter: brightness(1.04);
}

.ai-msg-followup {
  background: var(--surface-2);
  border: 1px dashed var(--brass-border);
  border-radius: 10px;
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

:root[data-theme="dark"] .ai-msg-followup {
  background: rgba(16, 32, 61, 0.72);
  border-color: rgba(217, 165, 74, 0.34);
}

.ai-followup-lead {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.ai-followup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-followup-chip {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s;
}

.ai-followup-chip:hover {
  background: var(--brass-tint);
  border-color: var(--brass);
}

:root[data-theme="dark"] .ai-followup-chip {
  background: #0F1E38;
  color: #F4F2EE;
  border-color: rgba(255, 255, 255, 0.16);
}

:root[data-theme="dark"] .ai-followup-chip:hover {
  border-color: var(--brass);
  background: rgba(217, 165, 74, 0.16);
}

.ai-msg-pending {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  padding: 10px 14px;
}

.ai-pending-lbl {
  font-size: 12.2px;
  font-weight: 600;
  color: var(--muted);
}

.ai-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ai-typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brass);
  opacity: 0.45;
  animation: aiDotPulse 1.1s infinite ease-in-out;
}

.ai-typing-indicator span:nth-child(2) {
  animation-delay: 0.18s;
}

.ai-typing-indicator span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes aiDotPulse {
  0%, 80%, 100% { transform: scale(0.85); opacity: 0.35; }
  40% { transform: scale(1.18); opacity: 1; }
}
