/* Recording control (Zavolať menu, live call) and the conversation timeline ("Priebeh rozhovoru"). */
:root {
  --lane-0: #1663be;
  --lane-1: #9fcc2e;
  --lane-2: #fa9f1b;
  --lane-3: #00a9b3;
  --lane-4: #8e5bd6;
  --lane-5: #df5645;
}

.lane-color-0 {
  color: var(--lane-0);
}

.lane-color-1 {
  color: #5f8a0f;
}

.lane-color-2 {
  color: #c46f00;
}

.lane-color-3 {
  color: #00808a;
}

.lane-color-4 {
  color: var(--lane-4);
}

.lane-color-5 {
  color: var(--lane-5);
}

.lane-bg-0 {
  background: var(--lane-0);
}

.lane-bg-1 {
  background: var(--lane-1);
}

.lane-bg-2 {
  background: var(--lane-2);
}

.lane-bg-3 {
  background: var(--lane-3);
}

.lane-bg-4 {
  background: var(--lane-4);
}

.lane-bg-5 {
  background: var(--lane-5);
}

.call-recording-choice {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--fl-light);
  border-bottom: 1px solid var(--fl-light);
}

.dial-pad .call-recording-choice {
  border: 0;
  padding: 4px 0;
}

.call-recording-choice .switch input:checked + span {
  background: var(--fl-danger);
}

/* "Ohlásiť nahrávanie" belongs to the recording switch above it; on is the usual green, not the recording red. */
.call-recording-choice .recording-notice-choice {
  padding-left: 12px;
}

.call-recording-choice .recording-notice-choice .switch input:checked + span {
  background: var(--fl-success);
}

.call-recording-choice .switch input:focus-visible + span {
  outline: 2px solid var(--fl-link);
  outline-offset: 2px;
}

.recording-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 8px;
}

.recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fl-light);
}

.recording-dot.on {
  background: var(--fl-danger);
  animation: recording-pulse 1.4s ease-in-out infinite;
}

@keyframes recording-pulse {
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .recording-dot.on {
    animation: none;
  }
}

.recording-status .pill {
  margin-right: 4px;
}

.recording-how h3 {
  font-size: 14px;
  margin-top: 12px;
}

.conversation-timeline {
  margin: 12px 0;
}

.conversation-timeline h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.swimlanes {
  display: grid;
  gap: 6px;
}

.swimlane {
  display: grid;
  grid-template-columns: minmax(130px, 200px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.swimlane-label {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}

.swimlane-label b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.swimlane-track {
  position: relative;
  height: 22px;
  background: var(--fl-zebra);
  border-radius: 4px;
  overflow: hidden;
}

.swimlane-segment {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border: 0;
  border-radius: 3px;
  padding: 0;
  cursor: pointer;
  opacity: 0.85;
  min-width: 3px;
}

.swimlane-segment:hover,
.swimlane-segment:focus-visible {
  opacity: 1;
  outline: 2px solid var(--fl-dark);
  outline-offset: 0;
  z-index: 1;
}

.swimlane-caption {
  min-height: 2.6em;
  margin: 6px 0 10px;
}

.conversation-timeline,
.conversation-analysis > div {
  min-width: 0;
}

.conversation-analysis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 12px 20px;
}

.conversation-analysis h4 {
  font-size: 13px;
  margin: 6px 0;
}

.talk-blocks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.talk-blocks li {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.talk-block-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--fl-light);
}

.reaction-list {
  margin: 0;
  padding-left: 18px;
}

.turn-sequence,
.conversation-analysis details ul {
  max-height: 260px;
  overflow: auto;
  padding-left: 22px;
}

.conversation-analysis .seek {
  background: none;
  border: 0;
  color: var(--fl-link);
  font: inherit;
  font-family: var(--mono);
  cursor: pointer;
  padding: 0;
}

@media (max-width: 700px) {
  .swimlane {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .swimlane-label {
    flex-direction: row;
    gap: 8px;
    align-items: baseline;
  }
}

.conversation {
  grid-template-columns: minmax(0, 1fr);
}

/* Live captions ("Živý prepis", live_captions/_panel): the caller (customer) on the left in the caller's lane colour, our
   side (prompts, reps) on the right; digits marked, the phrase in progress in italics. Side labels and state messages come
   from the panel (CSS variables and :has), because the lines arrive over one stream rendered for every viewer. */
.lc-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.lc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  color: var(--fl-text);
}

.lc-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.lc-dot-customer {
  background: var(--lane-0);
}

.lc-dot-team {
  background: var(--lane-1);
}

.lc-dot-system {
  background: var(--fl-light);
  border: 1px solid var(--fl-text);
}

.lc-live-badge {
  display: none;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--fl-danger);
  font-weight: 600;
}

.lc-panel:has(.lc-state[data-state="live"]) .lc-live-badge {
  display: inline-flex;
}

.lc-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--fl-radius);
  background: #fff8e6;
  border: 1px solid #f6d58f;
}

.lc-numbers[hidden] {
  display: none;
}

.lc-numbers b {
  color: var(--fl-dark);
}

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

.chip.lc-chip {
  font-size: 15px;
  font-weight: 700;
  color: var(--fl-primary);
  cursor: pointer;
  gap: 8px;
  padding: 4px 12px;
}

.chip.lc-chip .ic {
  width: 14px;
  height: 14px;
}

.chip.lc-chip.copied {
  background: var(--fl-success);
  border-color: var(--fl-success);
}

.lc-scroll {
  max-height: 360px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
  overscroll-behavior: contain;
}

.lc-lines {
  display: grid;
  gap: 4px;
}

.lc-partial:empty {
  display: none;
}

.lc-line {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
  padding: 4px 8px;
  border-radius: var(--fl-radius);
  max-width: 88%;
  color: var(--fl-dark);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.lc-line.lc-customer {
  justify-self: start;
  background: #eaf2fc;
  border-left: 3px solid var(--lane-0);
}

.lc-line.lc-team {
  justify-self: end;
  background: #f2f8e3;
  border-left: 3px solid var(--lane-1);
}

.lc-line.lc-pending .lc-text {
  font-style: italic;
  opacity: 0.75;
}

/* Known system speech (a prompt, an AI answer) on our side: muted, with its "hlas systému" label as a small badge. */
.lc-line.lc-system {
  justify-self: end;
  background: var(--fl-zebra);
  border-left: 3px solid var(--fl-light);
  color: var(--fl-text);
}

/* The caller's answer to the AI assistant's question (live_caption_answer?): what the assistant understood and answered. */
.lc-line.lc-answer {
  box-shadow: inset 0 0 0 2px var(--fl-primary);
}

.lc-answer-mark {
  margin-left: 6px;
  color: var(--fl-primary);
  vertical-align: -2px;
}

.lc-answer-mark .ic,
.lc-legend .ic {
  width: 13px;
  height: 13px;
}

.lc-time {
  font-size: 11px;
  color: var(--fl-text);
}

.lc-who {
  font-size: 11px;
  font-weight: 600;
  color: var(--fl-text);
  white-space: nowrap;
}

.lc-customer .lc-who::before {
  content: var(--lc-label-customer, "");
}

.lc-team .lc-who::before {
  content: var(--lc-label-team, "");
}

.lc-system .lc-who::before {
  content: var(--lc-label-system, "");
}

.lc-line.lc-system .lc-who {
  font-weight: 500;
  font-size: 10.5px;
  padding: 0 6px;
  border: 1px solid var(--fl-light);
  border-radius: var(--fl-pill);
  background: #fff;
}

mark.lc-digits {
  background: #ffe8a3;
  color: var(--fl-primary);
  font-weight: 700;
  padding: 0 2px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lc-msg {
  display: none;
  margin: 0;
}

.lc-msg .ic {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

.lc-panel:has(.lc-state[data-state="live"]):not(:has(.lc-line)) .lc-msg[data-for="empty"],
.lc-panel:has(.lc-state[data-state="unavailable"]) .lc-msg[data-for="unavailable"],
.lc-panel:has(.lc-state[data-state="opted_out"]) .lc-msg[data-for="opted_out"],
.lc-panel:has(.lc-state[data-state="ended"]):has(.lc-line) .lc-msg[data-for="ended"] {
  display: block;
}

.lc-panel:has(.lc-state[data-state="unavailable"]) .lc-msg[data-for="unavailable"] {
  color: var(--fl-danger);
}

.lc-compact .lc-scroll {
  max-height: 150px;
}

.lc-compact .lc-line {
  max-width: 100%;
  padding: 3px 6px;
  font-size: 12px;
}

.lc-softphone {
  border-top: 1px solid var(--fl-light);
  padding-top: 6px;
}

.lc-softphone summary {
  cursor: pointer;
  color: var(--fl-dark);
  margin-bottom: 6px;
}

.lc-softphone summary .ic {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

#softphone-captions:empty {
  display: none;
}

.lc-latest:empty {
  display: none;
}

/* One line on Prehľad and Telefón: the newest phrase, cut with an ellipsis (max-width: 0 lets a table cell shrink to it). */
.lc-latest-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fl-dark);
}

.lc-latest-line .lc-who {
  margin-right: 6px;
}

.lc-latest-line.lc-customer {
  border-left: 3px solid var(--lane-0);
  padding-left: 6px;
}

.lc-latest-line.lc-team {
  border-left: 3px solid var(--lane-1);
  padding-left: 6px;
}

.lc-latest-line.lc-system {
  border-left: 3px solid var(--fl-light);
  padding-left: 6px;
  color: var(--fl-text);
}

tr.lc-latest-row td {
  padding-top: 0;
  border-top: 0;
  max-width: 0;
}

tr.lc-latest-row:has(.lc-latest:empty) {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .lc-live-badge .recording-dot.on {
    animation: none;
  }
}

@media (max-width: 700px) {
  .lc-line {
    max-width: 100%;
  }

  .lc-scroll {
    max-height: 50vh;
  }
}

.phone-live-caption {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--fl-light);
}
