/* ============================================================
   Voxia Conversations — Professional Override
   ============================================================ */

/* Szare tło obszaru treści — chłodny szary, nie czarny (tylko widok rozmów) */
.content-area:has(.conversations-container) {
  background: linear-gradient(168deg, hsl(220 9% 38%) 0%, hsl(218 8% 34%) 45%, hsl(216 7% 31%) 100%);
  min-height: calc(100vh - var(--topbar-height));
}

.content-area:has(.conversations-container) .conversations-header h2 {
  color: #fff;
  text-shadow: 0 1px 2px hsl(220 20% 12% / 0.35);
  font-weight: 700;
}

.content-area:has(.conversations-container) .conversations-header {
  border-bottom: 1px solid hsl(220 10% 28%);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-5);
}

/* Stonowane tło nagłówka karty (niska saturacja, lekki chłodny odcień) */
.call-window:not(.active) .call-header {
  background: linear-gradient(168deg, hsl(220 14% 97.2%) 0%, hsl(215 12% 95.8%) 48%, hsl(212 10% 94.5%) 100%);
  border-bottom: 1px solid hsl(218 11% 87%);
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.65);
}

.call-window:not(.active) .call-phone {
  color: hsl(222 22% 24%);
}

.call-window:not(.active) .call-info-lead-icon {
  color: hsl(218 18% 46%);
  opacity: 1;
}

.call-window:not(.active) .call-meta-ic {
  color: hsl(218 12% 52%);
  opacity: 0.85;
}

.call-window:not(.active) .call-date-time {
  color: hsl(218 10% 46%);
}

.call-window:not(.active) .project-badge {
  background: hsl(218 14% 88%);
  color: hsl(222 16% 38%);
}

.call-window:not(.active) .call-info-main .call-duration-badge {
  background: hsl(218 14% 88%);
  color: hsl(222 16% 38%);
}

.call-window:not(.active) .call-info-main .call-duration-badge .bi {
  opacity: 0.55;
}

.call-window:not(.active) .call-header-icon {
  background: hsl(220 12% 90% / 0.85);
  color: hsl(220 14% 38%);
}

/* Wyższa specyficzność niż reguła powyżej — nagranie dostępne = czerwone tło */
.call-window:not(.active) .call-header-icon.call-recording-header-icon--available {
  background: var(--error, #dc2626);
  color: #fff;
}

.call-window:not(.active) button.call-header-icon:hover {
  background: hsl(218 14% 84%);
}

.call-window:not(.active) .copy-transcript-btn {
  color: hsl(217 38% 44%);
}

.call-window:not(.active) .status {
  background: hsl(218 10% 88%);
  color: hsl(222 12% 38%);
}

/* Wolne okno — jeszcze bardziej neutralne */
.call-window.empty .call-header {
  background: linear-gradient(168deg, hsl(220 6% 97.5%) 0%, hsl(215 5% 96%) 100%);
  border-bottom-color: hsl(220 6% 88%);
  box-shadow: none;
}

/* ---- Custom scrollbar ---- */
.chat-container::-webkit-scrollbar { width: 5px; }
.chat-container::-webkit-scrollbar-track { background: transparent; }
.chat-container::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 10px;
}
.chat-container::-webkit-scrollbar-thumb:hover { background: var(--neutral-400); }

.calls-grid::-webkit-scrollbar { width: 6px; }
.calls-grid::-webkit-scrollbar-track { background: transparent; }
.calls-grid::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 10px;
}

/* ---- Page header ---- */
.conversations-header h2 .conversations-page-icon {
  margin-right: 8px;
  opacity: 0.85;
  vertical-align: -0.1em;
}

.content-area:has(.conversations-container) .conversations-header h2 .conversations-page-icon {
  color: #fff;
  opacity: 0.95;
}

/* ---- Call header — two rows: info, then actions ---- */
.call-window .call-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 8px 12px 7px;
  gap: 0;
}

/* Single-row header: info (left) + actions (right), vertically centered */
.call-header-single-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.call-header-single-row .call-info-main {
  flex: 1 1 auto;
  min-width: 0;
}

.call-header-single-row .call-header-actions {
  flex-shrink: 0;
  margin-left: auto;
  align-self: flex-start;
  padding-top: 1px;
}

/* Kompaktowy odtwarzacz nagrania — widoczny tylko w rozszerzonym oknie / detalu rozmowy */
.call-header-recording-player {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid hsl(218 11% 87% / 0.85);
  min-width: 0;
  width: 100%;
}

.call-window.expanded .call-header-recording-player {
  display: flex;
  flex-wrap: wrap;
}

.call-header-rec-audio {
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 100%;
  height: 32px;
  border-radius: var(--radius-md);
}

.call-header-rec-rate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin: 0;
  font-size: 11px;
  color: var(--neutral-500);
}

.call-header-rec-rate-label {
  white-space: nowrap;
  font-weight: 600;
}

.call-header-rec-rate-select {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid hsl(218 11% 82%);
  background: #fff;
  color: var(--neutral-700);
  cursor: pointer;
  min-width: 4.5rem;
}

.call-header-recording-player--loading .call-header-rec-audio {
  opacity: 0.55;
  pointer-events: none;
}

.call-header-recording-player--loading::after {
  content: '';
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid hsl(218 11% 82%);
  border-top-color: var(--brand-primary, #2563eb);
  border-radius: 50%;
  animation: call-header-rec-spin 0.7s linear infinite;
}

@keyframes call-header-rec-spin {
  to {
    transform: rotate(360deg);
  }
}

.call-header-recording-player .call-rec-fetch-hint {
  flex: 1 1 100%;
  margin: 0;
  padding: 6px 0 0;
  font-size: 11px;
  text-align: left;
}

.call-window.active .call-header-recording-player {
  border-top-color: rgba(255, 255, 255, 0.22);
}

.call-window.active .call-header-rec-rate {
  color: rgba(255, 255, 255, 0.88);
}

.call-window.active .call-header-rec-rate-select {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.conversation-detail-page .call-header-recording-player {
  margin-top: 6px;
  padding-top: 6px;
}

@media (max-width: 640px) {
  .call-header-recording-player {
    flex-direction: column;
    align-items: stretch;
  }

  .call-header-rec-rate {
    justify-content: flex-end;
  }
}

.call-header-row--main {
  min-width: 0;
}

.call-header-row--actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  min-height: 0;
  min-width: 0;
}

.call-header-datetime {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 10px;
  line-height: 1.25;
}

.call-header-row--actions .call-header-actions {
  flex-shrink: 0;
  margin-left: auto;
}

/* Treść nagłówka (bez starego wrappera .call-info — inaczej selektory duration nie działają) */
.call-window .call-info-main {
  display: block;
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
}

.call-info-compact {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.call-info-line--phone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.call-info-line--meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: nowrap;
  width: 100%;
}

.call-info-line--meta .call-header-status {
  margin-left: auto;
  flex-shrink: 0;
}

.call-info-lead-icon {
  flex-shrink: 0;
  font-size: 0.82rem;
  opacity: 0.72;
}

.call-phone {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  min-width: 0;
}

.call-phone-with-dir {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.call-phone-with-dir .call-phone {
  flex: 1 1 auto;
}

.call-dir-icon {
  flex-shrink: 0;
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.92;
}

.call-dir-icon--out {
  color: var(--brand-primary, #2563eb);
}

.call-dir-icon--in {
  color: var(--success, #16a34a);
}

.call-info-phone-trail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  flex-shrink: 0;
  min-width: 0;
}

.call-outcome-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  font-size: 1.05rem;
}

.call-outcome-icon .bi {
  display: block;
}

.call-outcome-icon--success {
  color: hsl(152 55% 36%);
}

.call-outcome-icon--muted {
  color: var(--neutral-500);
}

.call-window.active .call-outcome-icon--success {
  color: hsl(152 62% 72%);
}

.call-window.active .call-outcome-icon--muted {
  color: rgba(255, 255, 255, 0.55);
}

.call-window.expanded .call-outcome-icon--success {
  color: hsl(152 70% 68%);
}

.call-window.expanded .call-outcome-icon--muted {
  color: rgba(255, 255, 255, 0.55);
}

.call-meta-ic {
  font-size: 0.64rem;
  opacity: 0.48;
  color: var(--neutral-500);
}

.call-window .call-date-time {
  font-size: 10px;
  color: var(--neutral-500);
  line-height: 1.25;
}

/* Czas trwania — ten sam styl co project-badge / status (spójny „pill” w nagłówku) */
.call-window .call-info-main .call-duration-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--neutral-200);
  color: var(--neutral-600);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.4px;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.4;
}

.call-window .call-info-main .call-duration-badge .bi {
  font-size: 0.58rem;
  opacity: 0.72;
}

.call-window.active .call-info-main .call-duration-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.call-window.active .call-info-main .call-duration-badge .bi {
  opacity: 0.9;
}

.call-window .call-info-main .call-waiting {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  line-height: 1.25;
  margin: 0;
  color: var(--neutral-400);
  font-style: italic;
}

/* ---- Header actions (copy, recording icon, status) ---- */
.call-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Shared icon-button style for all header action icons */
.call-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.05);
  border: none;
  font-size: 13px;
  line-height: 1;
  transition: all var(--transition-fast);
  color: var(--neutral-500);
  cursor: default;
  user-select: none;
  padding: 0;
}

.call-header-icon .bi {
  font-size: 0.85rem;
  vertical-align: middle;
}

/* Clickable variant */
button.call-header-icon {
  cursor: pointer;
}
button.call-header-icon:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.08);
}
button.call-header-icon:active {
  transform: scale(0.94);
}

/* Copy transcript — blue */
.copy-transcript-btn {
  color: var(--brand-primary);
}

/* Recording — available: czerwony „pill”, biała ikona */
.call-header-icon.call-recording-header-icon--available {
  background: var(--error, #dc2626);
  color: #fff;
  border: none;
}
.call-recording-header-icon--available .bi {
  color: inherit;
}

/* Recording — muted (dimmed) */
.call-recording-header-icon--muted {
  opacity: 0.35;
}

/* Recording — pending (amber) */
.call-recording-header-icon--pending {
  color: var(--warning);
  opacity: 0.7;
}

/* Recording — diagnostic warning (account / start error) */
.call-recording-header-icon--warn {
  color: var(--warning, #d97706);
  opacity: 0.95;
}

/* ---- Active call header — blue ---- */
.call-window.active .call-header {
  background: var(--brand-primary);
  color: white;
  border-bottom-color: var(--brand-primary-hover);
}
.call-window.active .call-phone,
.call-window.active .call-info-lead-icon { color: #fff; opacity: 1; }
.call-window.active .call-date-time { color: rgba(255,255,255,0.88); }
.call-window.active .call-meta-ic { color: rgba(255,255,255,0.65); opacity: 1; }
.call-window.active .call-header-icon {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
}
.call-window.active button.call-header-icon:hover {
  background: rgba(255,255,255,0.28);
}
.call-window.active .call-recording-header-icon--available {
  background: var(--error);
  color: #fff;
}
.call-window.active .status {
  background: rgba(255,255,255,0.22);
  color: white;
}

/* ---- Messages — light, clean ---- */
.call-window .chat-container {
  background: var(--surface-default);
  border-top: 1px solid var(--neutral-200);
}

.call-window .chat-container > * {
  overflow-anchor: none;
}

.call-window .chat-scroll-anchor {
  overflow-anchor: auto;
  height: 1px;
  flex-shrink: 0;
  pointer-events: none;
}

.call-window .message {
  margin: 3px 0;
  padding: 6px 10px;
  border-radius: 14px;
  max-width: 92%;
  word-wrap: break-word;
  font-size: 10px;
  line-height: 1.35;
  box-shadow: 0 1px 1px rgba(0,0,0,0.03);
}

.call-window .message.user {
  background: var(--brand-primary);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.call-window .message.agent {
  background: var(--neutral-100);
  color: var(--neutral-800);
  margin-right: auto;
  border: 1px solid var(--neutral-200);
  border-bottom-left-radius: 4px;
}

.call-window .message.system {
  background: var(--neutral-50);
  color: var(--neutral-500);
  text-align: center;
  font-style: italic;
  margin: 6px auto;
  max-width: 80%;
  font-size: 9px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.call-window .message.system.message-mhh {
  font-style: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--neutral-600);
  text-align: left;
  margin: 2px 0;
  margin-right: auto;
  padding: 1px 6px;
  max-width: min(100%, 28rem);
  font-size: 7px;
  line-height: 1.15;
  border-radius: 6px;
}

.call-window .message-mhh-one-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.call-window .message-mhh-trail {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 400;
  color: var(--neutral-500);
}

.call-window .message.system.message-halo {
  font-style: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--neutral-600);
  text-align: center;
  background: var(--neutral-50);
  border-color: #e0d8f5;
}

.call-window .message-halo-meta {
  margin-top: 4px;
  font-size: 8px;
  line-height: 1.35;
  color: var(--neutral-500);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.call-window .message-halo-time {
  font-weight: 500;
}

.call-window .message-mhh-meta {
  margin-top: 4px;
  font-size: 8px;
  line-height: 1.35;
  color: var(--neutral-500);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 500;
}

.call-window .message-mhh-phase-label {
  font-style: italic;
  color: var(--neutral-400);
  font-weight: 400;
  margin-right: 2px;
}

.call-window .message-mhh-phase-id {
  color: var(--neutral-700);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.call-window .message .timestamp {
  font-size: 8px;
  color: var(--neutral-400);
  margin-top: 2px;
  opacity: 0.85;
}

.call-window .message.user .timestamp {
  color: rgba(255,255,255,0.78);
}

.call-window .message-latency-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
  font-size: 8px;
  line-height: 1.2;
  color: var(--neutral-500);
}

.call-window .message-latency-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-full);
  background: var(--surface-default);
  white-space: nowrap;
}

.call-window .message-latency-label {
  color: var(--neutral-600);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.call-window .no-messages {
  color: var(--neutral-400);
  font-size: 10px;
}

/* ---- Project badge ---- */
.project-badge {
  display: inline-block;
  background: var(--neutral-200);
  color: var(--neutral-600);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.call-window.active .project-badge {
  background: rgba(255,255,255,0.22);
  color: white;
}

/* ---- Recording playback (modal only) ---- */
.call-window .call-recording-block .conversations-audio {
  max-width: 100%;
  height: 32px;
  vertical-align: middle;
  border-radius: var(--radius-md);
}

.call-window:not(.expanded) .call-recording-playback {
  display: none;
}

.call-window:not(.expanded) .call-recording-hint {
  display: none;
}

.call-recording-playback--row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.call-recording-playback--row .conversations-audio {
  flex: 1;
  min-width: 160px;
}

.call-recording-download-btn {
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 500;
  text-decoration: none;
}

/* ---- Modal overlay ---- */
.conversations-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 9998;
  display: none;
  backdrop-filter: blur(6px);
  transition: opacity var(--transition-normal);
}

.conversations-modal-overlay.active {
  display: block;
}

/* ---- Expanded window (modal) ---- */
.call-window.expanded {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 680px;
  max-width: 92vw;
  height: 86vh;
  z-index: 9999;
  box-shadow: 0 24px 64px -12px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.04);
  opacity: 1;
  background: var(--surface-default);
  border: none;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.call-window.expanded .call-header {
  background: var(--brand-primary);
  color: white;
  position: relative;
  padding: 14px 20px;
  border-bottom: none;
  border-radius: 0;
}

.call-window.expanded .call-phone {
  font-size: 17px;
  color: white;
}

.call-window.expanded .call-info-lead-icon {
  color: rgba(255,255,255,0.9);
  opacity: 1;
  font-size: 1rem;
}

.call-window.expanded .call-header-datetime {
  font-size: 12px;
}

.call-window.expanded .call-header-date {
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
}

.call-window.expanded .call-date-time {
  color: rgba(255,255,255,0.82);
}

.call-window.expanded .call-meta-ic {
  color: rgba(255,255,255,0.68);
  opacity: 1;
}

.call-window.expanded .call-info-main .call-duration-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 2px 8px;
}

.call-window.expanded .project-badge {
  background: rgba(255,255,255,0.22);
  color: white;
  font-size: 10px;
  padding: 2px 8px;
}

.call-window.expanded .status {
  background: rgba(255,255,255,0.2);
  color: white;
  font-size: 10px;
}

.call-window.expanded .call-header-icon {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  width: 30px;
  height: 28px;
  font-size: 14px;
}

.call-window.expanded button.call-header-icon:hover {
  background: rgba(255,255,255,0.28);
}

.call-window.expanded .call-recording-header-icon--available {
  background: var(--error);
  color: #fff;
}

.call-header-close-btn {
  display: none;
  box-sizing: border-box;
}

.call-window.expanded .call-header-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  margin: 0;
  padding: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.88);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.call-window.expanded .call-header-close-btn:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.call-window.expanded .call-header-close-btn:focus-visible {
  outline: 2px solid rgba(255,255,255,0.9);
  outline-offset: 2px;
}

.call-window.expanded .call-header-row--main {
  padding-right: 40px;
}

/* Treść pod nagłówkiem: ElevenLabs + zakładki + panele */
.call-window-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.call-window:not(.expanded) .call-window-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.call-modal-tabbar {
  display: none;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 4px;
  border-bottom: 1px solid var(--neutral-200);
  background: var(--neutral-50);
}

.call-window.expanded .call-modal-tabbar {
  display: flex;
}

.call-modal-tabbar-tabs {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: stretch;
  flex-wrap: nowrap;
}

.call-modal-export-btn {
  flex-shrink: 0;
  align-self: center;
  margin: 4px 0 4px auto;
  padding: 8px 12px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  background: var(--surface-default);
  color: var(--neutral-700);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}

.call-modal-export-btn:hover:not(:disabled) {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: hsl(220 45% 99%);
}

.call-modal-export-btn:disabled {
  opacity: 0.85;
  cursor: default;
}

.call-modal-tab-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.call-modal-tab-btn:hover {
  color: var(--neutral-800);
  background: rgba(0, 0, 0, 0.03);
}

.call-modal-tab-btn--active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  background: var(--surface-default);
}

.call-modal-tab-panes {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.call-tab-pane {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.call-window:not(.expanded) .call-tab-pane--summary {
  display: none !important;
}

.call-window:not(.expanded) .call-tab-pane--recording {
  display: none !important;
}

.call-window:not(.expanded) .call-tab-pane--chat {
  display: flex !important;
}

.call-window.expanded .call-tab-pane.is-active {
  display: flex;
}

.call-window.expanded .call-tab-pane--chat .chat-container {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  background: var(--surface-default);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.call-window:not(.expanded) .call-tab-pane--chat .chat-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.call-summary-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 20px;
  background: var(--surface-default);
}

.call-summary-inner {
  max-width: 100%;
}

.call-summary-empty,
.call-summary-hint {
  font-size: 12px;
  color: var(--neutral-500);
  margin: 8px 0 0;
}

.el-crit-rationale-box {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: hsl(220 18% 97%);
  border: 1px solid var(--neutral-200);
}

.el-crit-rationale-box--call-wide {
  margin-top: 12px;
}

.el-dc-rationale-box {
  margin-top: 8px;
}

.el-info-section {
  margin-bottom: 18px;
}

.el-info-section h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neutral-500);
  margin: 0 0 10px;
  font-weight: 700;
}

.el-info-section--highlight {
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
}

.el-info-section--highlight h4 {
  color: var(--neutral-600);
}

.el-info-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.el-info-row {
  display: grid;
  grid-template-columns: minmax(72px, 24%) 1fr;
  gap: 8px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--neutral-100);
  font-size: 12px;
  align-items: start;
}

.el-info-row:last-child {
  border-bottom: none;
}

.el-info-label {
  font-weight: 600;
  color: var(--neutral-600);
  word-break: break-word;
}

.el-info-value {
  color: var(--neutral-800);
  line-height: 1.45;
  word-break: break-word;
}

.el-info-mono {
  font-family: ui-monospace, monospace;
  font-size: 11px;
}

.el-el-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-bottom: 4px;
}

/* Pasek: Status API + Wynik rozmowy (bez ramki / paddingu) */
.el-info-section--highlight .el-el-head-bar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px 20px;
  padding: 0;
  margin: 0 0 12px;
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.el-info-section--highlight .el-el-head-bar .el-el-head-row {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 20px 28px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.el-el-head-item {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}

.el-info-section--highlight .el-el-head-item {
  gap: 14px;
}

.el-el-head-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neutral-500);
  flex-shrink: 0;
  white-space: nowrap;
}

.el-info-section--highlight .el-el-head-label {
  font-size: 11px;
  letter-spacing: 0.055em;
  color: var(--neutral-600);
}

.el-info-section--highlight .el-el-head-item .el-badge--status,
.el-info-section--highlight .el-el-head-item .el-badge--result {
  padding: 5px 14px;
  font-size: 11px;
  line-height: 1.35;
  border-radius: var(--radius-md);
}

.el-crit-rationale-box--after-head {
  margin-top: 10px;
}

.el-crit-rationale--lead {
  margin-top: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--neutral-800);
}

.el-summary-narrative {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--neutral-800);
}

.el-summary-narrative--compact {
  margin-top: 6px;
  font-size: 12px;
}

.el-summary-secondary {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--neutral-200);
}

.el-summary-secondary-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
  margin-bottom: 4px;
}

.el-crit-result {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 700;
  background: var(--neutral-200);
  color: var(--neutral-800);
}

.el-crit-result--success,
.el-crit-result--tak {
  background: hsl(152 45% 88%);
  color: hsl(152 40% 22%);
}

.el-crit-result--failure,
.el-crit-result--nie {
  background: hsl(0 70% 92%);
  color: hsl(0 50% 30%);
}

.el-crit-result--unknown,
.el-crit-result--neutral {
  background: var(--neutral-200);
}

.el-crit-rationale {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--neutral-700);
  line-height: 1.45;
}

.el-crit-fallback {
  margin: 0;
  font-size: 12px;
}

.el-dc-value {
  font-weight: 500;
}

.call-window.expanded .message {
  font-size: 13px;
  padding: 10px 14px;
  margin: 5px 0;
  max-width: min(92%, 620px);
  line-height: 1.45;
  border-radius: 16px;
}

.call-window.expanded .message.user {
  align-self: flex-end;
  margin-left: auto;
  margin-right: 0;
  border-bottom-right-radius: 4px;
}

.call-window.expanded .message.agent {
  align-self: flex-start;
  margin-right: auto;
  margin-left: 0;
  border-bottom-left-radius: 4px;
}

.call-window.expanded .message.system {
  align-self: center;
  margin-left: auto;
  margin-right: auto;
  font-size: 11px;
}

.call-window.expanded .message.system.message-mhh {
  font-size: 11px;
  align-self: flex-start;
  margin-left: 0;
  margin-right: auto;
  text-align: left;
}

.call-window.expanded .message.system.message-halo {
  font-size: 11px;
}

.call-window.expanded .message-halo-meta {
  font-size: 10px;
  margin-top: 6px;
}

.call-window.expanded .message-mhh-meta {
  font-size: 10px;
  margin-top: 6px;
}

.call-window.expanded .message .timestamp {
  font-size: 10px;
}

.call-window.expanded .call-header-actions {
  gap: 8px;
}

/* ---- Recording in modal ---- */
.call-window.expanded .call-recording-playback {
  display: block;
  margin-top: 22px;
}

.call-window.expanded .call-recording-block .conversations-audio {
  height: 36px;
}

.call-window.expanded .call-recording-download-btn {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  font-size: 12px;
  padding: 6px 12px;
  box-shadow: none;
}

.call-window.expanded .call-recording-download-btn:hover {
  background: rgba(255, 255, 255, 0.32);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.el-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.el-badge--status {
  background: hsl(218 14% 88%);
  color: hsl(222 16% 32%);
}

.el-badge--result {
  background: hsl(152 40% 88%);
  color: hsl(152 35% 22%);
}

.el-badge--result-positive {
  background: hsl(152 40% 88%);
  color: hsl(152 35% 22%);
}

.el-badge--result-negative {
  background: hsl(0 70% 92%);
  color: hsl(0 50% 30%);
}

.el-badge--result-neutral {
  background: var(--neutral-200);
  color: var(--neutral-700);
}

.el-badge--result-nie {
  background: hsl(0 70% 92%);
  color: hsl(0 50% 30%);
}

.el-badge--dc {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
  padding: 3px 8px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 600;
  background: hsl(248 40% 96%);
  color: hsl(258 30% 28%);
  border: 1px solid hsl(248 28% 90%);
  vertical-align: top;
}

.el-dc-empty {
  font-size: 12px;
  color: var(--neutral-400);
}

/* ---- Call header date (in meta line) ---- */
.call-header-date {
  font-size: 10px;
  color: var(--neutral-400);
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-header-gender {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.call-header-gender--M {
  color: hsl(213 70% 38%);
  background: hsl(213 80% 95%);
  border: 1px solid hsl(213 55% 82%);
}

.call-header-gender--K {
  color: hsl(338 60% 40%);
  background: hsl(338 80% 96%);
  border: 1px solid hsl(338 50% 84%);
}

.call-info-line--meta .call-duration-badge,
.call-info-line--meta .call-header-status {
  flex-shrink: 0;
}

/* ---- Recording tab ---- */
.call-tab-pane--recording {
  background: var(--surface-default);
}

.call-rec-tab-inner {
  flex: 1;
  min-height: 0;
  padding: 32px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.call-rec-tab-hint {
  margin: 0;
  padding: 32px 24px;
  font-size: 13px;
  color: var(--neutral-400);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  max-width: 400px;
}

.call-rec-tab-hint .bi {
  font-size: 1rem;
}

.call-rec-tab-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.call-rec-player-stack {
  width: 100%;
  max-width: 480px;
  margin: 36px auto 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}

.call-rec-audio {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  display: block;
}

.call-rec-duration-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-500);
}

.call-rec-duration-caption .bi {
  font-size: 0.95rem;
  opacity: 0.75;
}

.call-rec-tab-download {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: var(--brand-primary);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.call-rec-tab-download:hover {
  color: #fff;
  background: var(--brand-primary-hover, var(--brand-primary));
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.call-rec-tab-download:active {
  transform: scale(0.98);
}

/* ---- AI section (OpenAI) — tytuł + status w jednym wierszu ---- */
.el-info-section--ai {
  background: hsl(258 32% 98%);
  border: 1px solid hsl(258 20% 91%);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}

.el-ai-section-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.el-ai-section-head h4 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(258 30% 40%);
}

.el-ai-section-head-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-left: auto;
}

.el-ai-el-status-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.el-ai-el-status-item .el-el-head-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(258 18% 46%);
}

.el-badge--el-dc-status-success {
  background: hsl(152 45% 88%);
  color: hsl(152 40% 22%);
}

.el-badge--el-dc-status-failure {
  background: hsl(0 70% 92%);
  color: hsl(0 50% 30%);
}

.el-badge--el-dc-status-transfer {
  background: hsl(217 55% 90%);
  color: hsl(217 45% 28%);
}

.el-badge--el-dc-status-disconnected,
.el-badge--el-dc-status-brak-statusu {
  background: var(--neutral-200);
  color: var(--neutral-600);
}

.el-info-section--connection {
  border-left: 3px solid hsl(217 78% 55%);
  padding-left: 12px;
}

.el-info-section--webhook {
  border-left: 3px solid hsl(217 78% 55%);
  padding-left: 12px;
}

.el-badge--webhook-status {
  background: hsl(217 55% 90%);
  color: hsl(217 45% 28%);
}

.el-badge--webhook-status-success {
  background: hsl(152 45% 88%);
  color: hsl(152 40% 22%);
}

.el-badge--webhook-status-failure {
  background: hsl(0 70% 92%);
  color: hsl(0 50% 30%);
}

.el-badge--webhook-status-transfer {
  background: hsl(217 55% 90%);
  color: hsl(217 45% 28%);
}

.el-badge--webhook-status-car-disposed {
  background: hsl(32 82% 90%);
  color: hsl(28 58% 28%);
}

.el-badge--webhook-status-disconnected,
.el-badge--webhook-status-empty {
  background: var(--neutral-200);
  color: var(--neutral-600);
}

.el-badge--webhook-status-request-to-delete-data {
  background: hsl(280 40% 90%);
  color: hsl(280 35% 30%);
}

.el-badge--webhook-true {
  background: hsl(152 45% 88%);
  color: hsl(152 40% 22%);
}

.el-badge--webhook-false {
  background: var(--neutral-200);
  color: var(--neutral-600);
}

.el-webhook-compact {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid hsl(217 45% 86%);
  border-radius: var(--radius-md);
  background: hsl(217 100% 97%);
}

.el-webhook-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 6px;
}

.el-webhook-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid hsl(220 22% 88%);
  border-radius: var(--radius-md);
  background: var(--neutral-100);
  color: var(--neutral-700);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.el-webhook-pill-label {
  color: var(--neutral-500);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.el-webhook-pill-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: hsl(220 18% 92%);
  color: var(--neutral-700);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.el-webhook-pill--status {
  background: hsl(217 55% 90%);
  color: hsl(217 45% 28%);
}

.el-webhook-pill--yes {
  background: hsl(152 50% 96%);
  border-color: hsl(152 45% 78%);
  color: hsl(152 40% 22%);
}

.el-webhook-pill--yes .el-webhook-pill-value {
  background: hsl(152 45% 82%);
  color: hsl(152 44% 20%);
}

.el-webhook-pill--no {
  background: hsl(220 18% 97%);
  border-color: hsl(220 18% 88%);
  color: var(--neutral-600);
}

.el-webhook-pill--no .el-webhook-pill-value {
  background: hsl(0 70% 88%);
  color: hsl(0 54% 28%);
}

.el-webhook-pill--error {
  background: hsl(0 70% 97%);
  border-color: hsl(0 70% 84%);
  color: hsl(0 50% 30%);
}

.el-webhook-pill--error .el-webhook-pill-value {
  background: hsl(0 70% 88%);
  color: hsl(0 54% 28%);
}

.el-webhook-pill--time {
  background: hsl(217 100% 97%);
  border-color: hsl(217 55% 82%);
  color: hsl(217 45% 28%);
}

.el-webhook-pill--time .el-webhook-pill-value {
  background: hsl(217 55% 88%);
  color: hsl(217 45% 26%);
  font-size: 11px;
  text-transform: none;
}

.el-webhook-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  color: var(--neutral-700);
  font-size: 12px;
  line-height: 1.35;
}

.el-webhook-detail {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.el-webhook-detail-label {
  color: var(--neutral-500);
  font-weight: 700;
}

html[data-theme="dark"] .el-webhook-compact {
  background: hsl(222 34% 16%);
  border-color: hsl(217 38% 34%);
}

html[data-theme="dark"] .el-webhook-pill {
  background: hsl(222 28% 22%);
  border-color: hsl(220 26% 32%);
  color: hsl(214 28% 88%);
}

html[data-theme="dark"] .el-webhook-pill-value {
  background: hsl(222 20% 30%);
  color: hsl(214 28% 88%);
}

html[data-theme="dark"] .el-webhook-pill-label,
html[data-theme="dark"] .el-webhook-detail-label {
  color: hsl(215 18% 68%);
}

html[data-theme="dark"] .el-webhook-pill--status {
  background: hsl(217 45% 24%);
  color: hsl(214 80% 88%);
}

html[data-theme="dark"] .el-webhook-pill--yes {
  background: hsl(152 38% 20%);
  border-color: hsl(152 38% 34%);
  color: hsl(152 58% 82%);
}

html[data-theme="dark"] .el-webhook-pill--yes .el-webhook-pill-value {
  background: hsl(152 42% 30%);
  color: hsl(152 68% 88%);
}

html[data-theme="dark"] .el-webhook-pill--no {
  background: hsl(222 24% 20%);
  border-color: hsl(220 22% 30%);
  color: hsl(215 20% 72%);
}

html[data-theme="dark"] .el-webhook-pill--no .el-webhook-pill-value {
  background: hsl(0 48% 34%);
  color: hsl(0 78% 90%);
}

html[data-theme="dark"] .el-webhook-pill--error {
  background: hsl(0 45% 24%);
  border-color: hsl(0 46% 36%);
  color: hsl(0 72% 86%);
}

html[data-theme="dark"] .el-webhook-pill--error .el-webhook-pill-value {
  background: hsl(0 48% 34%);
  color: hsl(0 78% 90%);
}

html[data-theme="dark"] .el-webhook-pill--time {
  background: hsl(217 45% 24%);
  border-color: hsl(217 38% 34%);
  color: hsl(214 80% 88%);
}

html[data-theme="dark"] .el-webhook-pill--time .el-webhook-pill-value {
  background: hsl(217 42% 32%);
  color: hsl(214 88% 90%);
}

html[data-theme="dark"] .el-badge--webhook-status-success {
  background: hsl(152 38% 20%);
  color: hsl(152 58% 82%);
}

html[data-theme="dark"] .el-badge--webhook-status-failure {
  background: hsl(0 45% 24%);
  color: hsl(0 72% 86%);
}

html[data-theme="dark"] .el-badge--webhook-status-transfer {
  background: hsl(217 45% 24%);
  color: hsl(214 80% 88%);
}

html[data-theme="dark"] .el-badge--webhook-status-car-disposed {
  background: hsl(32 46% 22%);
  color: hsl(32 82% 84%);
}

html[data-theme="dark"] .el-badge--webhook-status-disconnected,
html[data-theme="dark"] .el-badge--webhook-status-empty {
  background: hsl(222 24% 20%);
  color: hsl(215 20% 72%);
}

html[data-theme="dark"] .el-badge--webhook-status-request-to-delete-data {
  background: hsl(280 34% 22%);
  color: hsl(280 54% 84%);
}

html[data-theme="dark"] .el-webhook-details {
  color: hsl(214 24% 82%);
}

.el-webhook-metrics {
  margin-top: 10px;
}

.el-webhook-note {
  margin-top: 12px;
}

.el-summary-narrative--webhook {
  margin-top: 6px;
}

.el-info-section--context-signals {
  border-left: 3px solid hsl(38 92% 50%);
  padding-left: 12px;
}

.el-context-off-topic {
  margin-top: 4px;
}

.el-context-off-topic--inline {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: hsl(38 100% 96%);
  border: 1px solid hsl(38 80% 82%);
}

.el-context-off-topic-text {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--neutral-800);
}

.el-context-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.el-badge--offer-channel {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.el-badge--offer-sms {
  background: hsl(217 55% 90%);
  color: hsl(217 45% 28%);
}

.el-badge--offer-email {
  background: hsl(280 40% 90%);
  color: hsl(280 35% 30%);
}

.el-badge--off-topic-flag {
  background: hsl(38 92% 88%);
  color: hsl(32 70% 28%);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.el-badge--dc-bool {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.el-badge--dc-bool-yes {
  background: hsl(152 45% 88%);
  color: hsl(152 40% 22%);
}

.el-badge--dc-bool-no {
  background: var(--neutral-200);
  color: var(--neutral-600);
}

.el-dc-text-block {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.el-info-row--off-topic .el-info-value {
  flex: 1;
  min-width: 0;
}

html[data-theme="dark"] .el-context-off-topic--inline {
  background: hsl(38 30% 16%);
  border-color: hsl(38 40% 28%);
}

html[data-theme="dark"] .el-context-off-topic-text {
  color: var(--neutral-200);
}

html[data-theme="dark"] .el-badge--offer-sms {
  background: hsl(217 35% 22%);
  color: hsl(217 60% 82%);
}

html[data-theme="dark"] .el-badge--offer-email {
  background: hsl(280 30% 22%);
  color: hsl(280 50% 85%);
}

html[data-theme="dark"] .el-badge--off-topic-flag {
  background: hsl(38 40% 22%);
  color: hsl(38 80% 78%);
}

.el-badge--ai-status {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.el-badge--ai-status-sfinalizowana {
  background: hsl(152 45% 88%);
  color: hsl(152 40% 22%);
}

.el-badge--ai-status-przerwana {
  background: hsl(0 70% 92%);
  color: hsl(0 50% 30%);
}

.el-badge--ai-status-porzucona {
  background: hsl(36 80% 92%);
  color: hsl(34 55% 30%);
}

.el-badge--ai-status-unknown {
  background: var(--neutral-200);
  color: var(--neutral-600);
}

.el-summary-narrative--ai {
  margin-top: 0;
  font-size: 13px;
  color: hsl(258 15% 28%);
}

/* ---- expanded header tweaks ---- */
.call-window.expanded .call-header-single-row {
  padding-right: 40px;
}

/* ---- Historia rozmów: modal nad overlay (reuse .call-window.expanded) ---- */
.history-modal-surface {
  position: relative;
  min-height: 100%;
  padding: 20px 16px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- Pełnoekranowy widok szczegółów rozmowy (/#/conversation/:id) ---- */
.conversation-detail-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height, 64px) - 2rem);
  min-height: 480px;
  max-height: none;
  margin: -0.5rem 0 0;
}

.conversation-detail-toolbar {
  flex-shrink: 0;
  margin-bottom: 12px;
}

.conversation-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.conversation-detail-surface {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.conversation-detail-page .call-window.expanded {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  z-index: auto;
  box-shadow: none;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
}

.conversation-detail-page .call-window.expanded .call-header {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.conversation-detail-page .call-window-body {
  flex: 1;
  min-height: 0;
}

.conversation-detail-page .call-window.expanded .call-tab-pane--chat .chat-container {
  max-height: none;
}

.conversation-history-page .truncate {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   Dark theme — widok rozmów i sekcje podsumowań
   ============================================================ */
html[data-theme="dark"] .content-area:has(.conversations-container) {
  background: linear-gradient(168deg, hsl(222 18% 14%) 0%, hsl(220 16% 11%) 48%, hsl(218 14% 9%) 100%);
}

html[data-theme="dark"] .content-area:has(.conversations-container) .conversations-header {
  border-bottom-color: hsl(220 14% 22%);
}

html[data-theme="dark"] .call-window:not(.active) .call-header {
  background: linear-gradient(168deg, hsl(222 16% 18%) 0%, hsl(220 14% 16%) 48%, hsl(218 12% 14%) 100%);
  border-bottom: 1px solid hsl(220 12% 26%);
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.06);
}

html[data-theme="dark"] .call-window:not(.active) .call-phone {
  color: var(--neutral-800);
}

html[data-theme="dark"] .call-window:not(.active) .call-info-lead-icon {
  color: var(--neutral-500);
}

html[data-theme="dark"] .call-window:not(.active) .call-meta-ic {
  color: var(--neutral-500);
}

html[data-theme="dark"] .call-window:not(.active) .call-date-time {
  color: var(--neutral-500);
}

html[data-theme="dark"] .call-window:not(.active) .project-badge,
html[data-theme="dark"] .call-window:not(.active) .call-info-main .call-duration-badge {
  background: var(--neutral-200);
  color: var(--neutral-700);
}

html[data-theme="dark"] .call-window:not(.active) .call-header-icon {
  background: hsl(220 12% 22% / 0.95);
  color: var(--neutral-600);
}

html[data-theme="dark"] .call-window:not(.active) .call-header-icon.call-recording-header-icon--available {
  color: var(--text-on-primary);
}

html[data-theme="dark"] .call-window:not(.active) button.call-header-icon:hover {
  background: hsl(218 14% 28%);
}

html[data-theme="dark"] .call-window:not(.active) .call-header-recording-player {
  border-top-color: hsl(220 12% 28%);
}

html[data-theme="dark"] .call-window:not(.active) .call-header-rec-rate-select {
  background: hsl(220 14% 18%);
  border-color: hsl(220 12% 28%);
  color: hsl(210 20% 92%);
}

html[data-theme="dark"] .call-window:not(.active) .copy-transcript-btn {
  color: var(--info);
}

html[data-theme="dark"] .call-window:not(.active) .status {
  background: var(--neutral-200);
  color: var(--neutral-700);
}

html[data-theme="dark"] .call-window.empty .call-header {
  background: linear-gradient(168deg, hsl(222 14% 16%) 0%, hsl(220 12% 14%) 100%);
  border-bottom-color: hsl(220 10% 24%);
}

html[data-theme="dark"] .call-outcome-icon--success {
  color: hsl(152 50% 42%);
}

html[data-theme="dark"] .call-window.expanded .call-outcome-icon--success {
  color: hsl(152 62% 72%);
}

html[data-theme="dark"] .call-window .message {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .call-window .message.user {
  color: var(--text-on-primary);
}

html[data-theme="dark"] .call-window .message.system.message-halo {
  background: hsl(260 18% 14%);
  border-color: hsl(260 22% 26%);
  color: hsl(260 12% 78%);
}

html[data-theme="dark"] .el-crit-result--success,
html[data-theme="dark"] .el-crit-result--tak {
  background: hsl(152 25% 18%);
  color: hsl(152 45% 78%);
}

html[data-theme="dark"] .el-crit-result--failure,
html[data-theme="dark"] .el-crit-result--nie {
  background: hsl(0 35% 18%);
  color: hsl(0 65% 78%);
}

html[data-theme="dark"] .el-badge--status {
  background: var(--neutral-200);
  color: var(--neutral-800);
}

html[data-theme="dark"] .el-badge--status.el-badge--webhook-status-success {
  background: hsl(152 38% 20%);
  color: hsl(152 58% 82%);
}

html[data-theme="dark"] .el-badge--status.el-badge--webhook-status-failure {
  background: hsl(0 45% 24%);
  color: hsl(0 72% 86%);
}

html[data-theme="dark"] .el-badge--status.el-badge--webhook-status-transfer {
  background: hsl(217 45% 24%);
  color: hsl(214 80% 88%);
}

html[data-theme="dark"] .el-badge--status.el-badge--webhook-status-car-disposed {
  background: hsl(32 46% 22%);
  color: hsl(32 82% 84%);
}

html[data-theme="dark"] .el-badge--status.el-badge--webhook-status-disconnected,
html[data-theme="dark"] .el-badge--status.el-badge--webhook-status-empty {
  background: hsl(222 24% 20%);
  color: hsl(215 20% 72%);
}

html[data-theme="dark"] .el-badge--status.el-badge--webhook-status-request-to-delete-data {
  background: hsl(280 34% 22%);
  color: hsl(280 54% 84%);
}

html[data-theme="dark"] .el-badge--result,
html[data-theme="dark"] .el-badge--result-positive {
  background: hsl(152 25% 18%);
  color: hsl(152 45% 78%);
}

html[data-theme="dark"] .el-badge--result-negative,
html[data-theme="dark"] .el-badge--result-nie {
  background: hsl(0 35% 18%);
  color: hsl(0 65% 78%);
}

html[data-theme="dark"] .el-badge--dc {
  background: hsl(258 22% 18%);
  color: hsl(258 35% 82%);
  border-color: hsl(258 18% 28%);
}

html[data-theme="dark"] .el-info-section--ai {
  background: hsl(258 22% 14%);
  border-color: hsl(258 16% 24%);
}

html[data-theme="dark"] .el-ai-section-head h4 {
  color: hsl(258 35% 78%);
}

html[data-theme="dark"] .el-badge--ai-status-sfinalizowana {
  background: hsl(152 25% 18%);
  color: hsl(152 45% 78%);
}

html[data-theme="dark"] .el-badge--ai-status-przerwana {
  background: hsl(0 35% 18%);
  color: hsl(0 65% 78%);
}

html[data-theme="dark"] .el-badge--ai-status-porzucona {
  background: hsl(36 35% 18%);
  color: hsl(36 55% 78%);
}

html[data-theme="dark"] .el-ai-el-status-item .el-el-head-label {
  color: hsl(258 25% 62%);
}

html[data-theme="dark"] .el-badge--el-dc-status-success {
  background: hsl(152 25% 18%);
  color: hsl(152 45% 78%);
}

html[data-theme="dark"] .el-badge--el-dc-status-failure {
  background: hsl(0 35% 18%);
  color: hsl(0 65% 78%);
}

html[data-theme="dark"] .el-badge--el-dc-status-transfer {
  background: hsl(217 35% 18%);
  color: hsl(217 55% 78%);
}

html[data-theme="dark"] .el-summary-narrative--ai {
  color: var(--neutral-600);
}

html[data-theme="dark"] .call-header-gender--M {
  color: hsl(213 70% 72%);
  background: hsl(213 35% 18%);
  border-color: hsl(213 30% 32%);
}

html[data-theme="dark"] .call-header-gender--K {
  color: hsl(338 55% 72%);
  background: hsl(338 28% 18%);
  border-color: hsl(338 25% 32%);
}

html[data-theme="dark"] .call-window.expanded {
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .conversations-modal-overlay {
  background: rgba(2, 6, 23, 0.72);
}

html[data-theme="dark"] .call-modal-export-btn:hover:not(:disabled) {
  background: var(--neutral-200);
}

html[data-theme="dark"] .call-modal-tab-btn:hover {
  color: var(--neutral-800);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .el-crit-rationale-box {
  background: var(--neutral-100);
  border-color: var(--neutral-200);
}
