/* ── ASANMOD Chat Bubble: layout, min-height guard, role variants ── */

/* ── Bubble container ── */

.conversation-item {
  width: min(var(--chat-bubble-w), var(--chat-max-w));
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.conversation-item.user {
  justify-self: end;
  grid-template-columns: minmax(0, 1fr) 32px;
}

.conversation-item.asanmod {
  justify-self: start;
}

.conversation-item.error {
  width: 100%;
}

/* ── Avatar ── */

.conversation-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(5, 12, 15, 0.92);
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 760;
}

.conversation-item.user .conversation-avatar {
  order: 2;
  border-color: rgba(57, 192, 127, 0.4);
  color: #a9edc7;
}

.conversation-item.asanmod .conversation-avatar {
  border-color: rgba(75, 215, 232, 0.44);
  color: #b8f6ff;
}

.conversation-item.error .conversation-avatar {
  border-color: rgba(227, 95, 95, 0.5);
  color: #f0a0a0;
}

/* ── Focus-visible outline for conversation items ── */

.conversation-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--chat-bubble-radius);
}

/* ── Bubble content ── */

.conversation-content {
  min-width: 0;
  min-height: var(--chat-bubble-min-height);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(75, 215, 232, 0.13);
  border-radius: var(--chat-bubble-radius);
  background: rgba(14, 27, 32, 0.88);
  padding: 10px 14px;
  font-size: var(--chat-font);
}

.conversation-item.user .conversation-content {
  order: 1;
  border-color: rgba(57, 192, 127, 0.28);
  background: rgba(25, 78, 74, 0.84);
}

.conversation-item.asanmod .conversation-content {
  border-color: rgba(75, 215, 232, 0.24);
  background: rgba(14, 24, 33, 0.92);
}

.conversation-item.error .conversation-content {
  border-color: rgba(227, 95, 95, 0.48);
  background: rgba(75, 24, 27, 0.76);
}

/* ── Commentary surface variant ── */

.conversation-item.asanmod[data-voice-chat-surface="commentary"] {
  width: min(74%, 680px);
  font-size: var(--chat-font-s);
}

.conversation-item.asanmod[data-voice-chat-surface="commentary"]
  .conversation-content {
  border-color: rgba(142, 170, 181, 0.22);
  background: rgba(10, 18, 23, 0.72);
}

.conversation-item.asanmod[data-voice-chat-surface="commentary"]
  .conversation-role::after {
  content: " durum";
  color: var(--text-muted);
  font-weight: 650;
}

.conversation-item.asanmod[data-voice-chat-surface="commentary"]
  .conversation-text {
  color: var(--text-soft);
  font-size: var(--chat-font-s);
}

/* ── Meta row ── */

.conversation-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversation-role {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.conversation-meta time {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: none;
  white-space: nowrap;
}

/* ── Text body ── */

.conversation-text {
  margin: 4px 0 0;
  font-size: var(--chat-font);
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.conversation-text p {
  margin: 0;
}

.conversation-text p + p,
.conversation-text p + .conversation-bullet,
.conversation-text .conversation-bullet + p {
  margin-top: 8px;
}

.conversation-bullet {
  margin: 6px 0 0 18px;
  padding-left: 2px;
}
