/* ── Message rows ────────────────────────────────────────────────────── */
.row      { display: flex; }
.row.user { justify-content: flex-end; }
.row.bot  { justify-content: flex-start; }

.bubble-wrap            { display: flex; flex-direction: column; max-width: 76%; }
.row.user .bubble-wrap  { align-items: flex-end; }
.row.bot  .bubble-wrap  { align-items: flex-start; }

/* ── Bubbles ─────────────────────────────────────────────────────────── */
.bubble {
  padding: 10px 15px 9px;
  border-radius: var(--r-lg);
  font-size: 14.5px;
  line-height: 1.65;
  word-break: break-word;
}
.bubble.user {
  background: var(--user-bub-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.bubble.bot {
  background: var(--surface);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 2px 10px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
}

/* ── Rich rendering inside bot bubbles ──────────────────────────────── */
.bubble.bot .section-head {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--brand);
  margin: 12px 0 3px;
}
.bubble.bot .section-head:first-child { margin-top: 2px; }

.bubble.bot .divider {
  height: 0;
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 0 8px;
}

.bubble.bot .comp-header {
  display: block;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  margin: 12px 0 2px;
}
.bubble.bot .comp-header:first-child { margin-top: 2px; }

.tip-line {
  display: block;
  background: var(--tip-bg);
  border-left: 3px solid var(--tip-bd);
  padding: 5px 10px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: 5px 0;
  font-size: 13.5px;
  color: #78350f;
}
.warn-line {
  display: block;
  background: var(--warn-bg);
  border-left: 3px solid var(--warn-bd);
  padding: 5px 10px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: 5px 0;
  font-size: 13.5px;
  color: #7c2d12;
}

/* ── Salary numbers block ────────────────────────────────────────────── */
.nums-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin: 8px 0 4px;
  font-size: 14px;
  line-height: 2;
  font-variant-numeric: tabular-nums;
}
.nums-block .net-row {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
  padding-top: 7px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

/* ── Timestamp ───────────────────────────────────────────────────────── */
.ts {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  padding: 0 2px;
}

/* ── Typing indicator ────────────────────────────────────────────────── */
.typing {
  display: inline-flex;
  gap: 5px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--r-lg);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 2px 10px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
}
.typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #b0bec5;
  animation: bop 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }

@keyframes bop {
  0%,60%,100% { transform: translateY(0); opacity: .35; }
  30%          { transform: translateY(-6px); opacity: 1; }
}
