/* Chat transcript */
.chat-container {
  background: white; border-radius: 5px;
  box-shadow: 0 12px 24px 0 rgba(0,0,0,0.1);
  margin-bottom: 20px; width: 100%;
  overflow: hidden;
}
.chat-messages {
  height: 360px; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-bubble {
  max-width: 80%; padding: 10px 16px;
  font-size: 14px; line-height: 1.6;
  border-radius: 16px; white-space: pre-wrap;
  word-wrap: break-word;
  animation: bubbleIn 0.2s ease;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-bubble.ai {
  background: #f0f0f0; color: #3d3d3d;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-bubble.user {
  background: #4a9af5; color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble .chat-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 4px; opacity: 0.7;
}
.chat-section-divider {
  text-align: center; font-size: 11px; font-weight: 600;
  color: #9aa0a6; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 12px 0 4px; position: relative; align-self: stretch;
  display: flex; align-items: center; gap: 12px;
}
.chat-section-divider::before, .chat-section-divider::after {
  content: ''; flex: 1; height: 1px; background: #e5e7eb;
}

.chat-bubble.ai .chat-label { color: #747474; }
.chat-bubble.user .chat-label { color: rgba(255,255,255,0.8); }
.chat-bubble.streaming::after {
  content: ''; display: inline-block;
  width: 2px; height: 16px; background: #1f7cf8;
  margin-left: 2px; vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ─── Hidden elements ───────────────────────────────────────────── */
.latency-toggle, .latency-section { display: none !important; }
.llm-toggle { display: none !important; }

/* ─── Latency Dashboard (collapsible) ────────────────────────────── */
.latency-toggle {
  font-size: 12px; color: #747474; cursor: pointer; text-decoration: underline;
  text-align: center; margin-bottom: 10px; user-select: none;
}
.latency-toggle:hover { color: #3d3d3d; }
.latency-section { display: none; }
.latency-section.open { display: block; }

.latency-settings {
  display: flex; gap: 16px; align-items: center; justify-content: center;
  margin-bottom: 12px; font-size: 13px; color: #747474;
}
.latency-settings label { cursor: pointer; }
.latency-settings input[type="radio"] { margin: 0 3px 0 0; }
.latency-settings select {
  padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 4px;
  font-size: 12px; font-family: 'DM Sans', sans-serif; background: white;
}

.latency-dashboard {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.gauge {
  background: white; border-radius: 5px; padding: 14px 10px; text-align: center;
  box-shadow: 0 12px 24px 0 rgba(0,0,0,0.1);
}
.gauge.featured { border: 2px solid #e5e7eb; }
.gauge-label {
  font-size: 10px; font-weight: 600; color: #747474; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 4px;
}
.gauge-value { font-size: 26px; font-weight: 700; color: #d1d5db; }
.gauge-value.green { color: #22c55e; }
.gauge-value.yellow { color: #f59e0b; }
.gauge-value.red { color: #ef4444; }
.gauge-sub { font-size: 9px; color: #aaa; margin-top: 3px; }

/* History table */
.history-table {
  width: 100%; border-collapse: collapse; background: white;
  border-radius: 5px; overflow: hidden;
  box-shadow: 0 12px 24px 0 rgba(0,0,0,0.1); font-size: 12px;
}
.history-table th {
  background: #f9fafb; font-size: 10px; font-weight: 600; color: #747474;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 8px 10px; text-align: left;
}
.history-table td { padding: 8px 10px; border-top: 1px solid #f0f0f0; font-size: 12px; }
.history-table tr:hover { background: #f9fafb; }
td.green { color: #22c55e; font-weight: 600; }
td.yellow { color: #f59e0b; font-weight: 600; }
td.red { color: #ef4444; font-weight: 600; }
.speaker-ai { color: #1f7cf8; font-weight: 600; }
.speaker-candidate { color: #22c55e; font-weight: 600; }
td.phrase { color: #747474; font-style: italic; max-width: 140px; }
td.phrase-close { color: #747474; font-style: italic; max-width: 140px; direction: rtl; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.phrase-open { color: #747474; font-style: italic; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.dim { color: #d1d5db; }

/* Full transcript */
.full-transcript {
  background: #f9fafb; border-radius: 8px; padding: 16px 20px;
  max-height: 500px; overflow-y: auto; font-size: 13px; line-height: 1.7;
}
.transcript-entry { margin-bottom: 12px; }
.transcript-entry .te-header {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px;
}
.transcript-entry .te-header.ai { color: #1f7cf8; }
.transcript-entry .te-header.candidate { color: #22c55e; }
.transcript-entry .te-text { color: #3d3d3d; }
.transcript-divider {
  border: none; border-top: 1px dashed #d1d5db; margin: 14px 0;
  position: relative;
}
.transcript-divider::after {
  content: attr(data-handoff);
  position: absolute; top: -8px; left: 50%;
  transform: translateX(-50%);
  background: #f9fafb; padding: 0 8px;
  font-size: 10px; color: #9aa0a6; font-weight: 600;
}