.journey-picker { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .7rem; }
.journey-picker select { min-width: 12rem; max-width: 16rem; }

.export-notes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin: 0 0 .75rem;
}
.export-notes-actions .primary-button,
.export-notes-actions .text-button {
  width: auto;
  min-height: 2.4rem;
}
.export-notes-hint {
  margin: 0;
  font-size: .72rem;
  line-height: 1.45;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Export notes → search by journey ID */
.export-notes-search-card { margin-top: 1rem; }
.export-notes-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin: 0 0 .6rem;
}
.export-notes-search-field { flex: 1 1 18rem; min-width: 12rem; }
.export-notes-search-field input {
  width: 100%;
  min-height: 2.6rem;
}
.export-notes-search-form .primary-button,
.export-notes-search-form .text-button {
  width: auto;
  min-height: 2.4rem;
}
.export-notes-search-results {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .6rem;
}
.export-notes-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.export-notes-search-row-main {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.export-notes-search-row-main small {
  font-size: .7rem;
  opacity: .75;
  overflow-wrap: anywhere;
}
.export-notes-search-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.export-notes-search-row-actions .primary-button,
.export-notes-search-row-actions .text-button {
  width: auto;
  min-height: 2.1rem;
}

/* Multi-line dynamic variables (patient_availability) span the variable grid */
.variable-grid .variable-field-wide { grid-column: 1 / -1; }
.variable-grid .variable-field-wide textarea {
  width: 100%;
  min-height: 4.4rem;
  resize: vertical;
  font-family: inherit;
  font-size: .74rem;
}

/* Export notes → notes webhook configuration */
.notes-webhook-card { margin-top: 1rem; }
.notes-webhook-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .75rem;
  align-items: end;
  margin: 0 0 .6rem;
}
.notes-webhook-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-width: 0;
}
.notes-webhook-field span {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .7;
}
.notes-webhook-field input {
  width: 100%;
  min-height: 2.6rem;
}
.notes-webhook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.notes-webhook-actions .primary-button,
.notes-webhook-actions .text-button {
  width: auto;
  min-height: 2.6rem;
}

/* Journey History → search field in the page actions row */
.history-search-field { flex: 0 1 16rem; min-width: 10rem; }
.history-search-field input {
  width: 100%;
  min-height: 2.2rem;
  padding: .4rem .65rem;
  font-size: .72rem;
  border-radius: 10px;
}

/* Longer sidebar labels (e.g. Trigger chat without voice call) */
.sidebar nav .nav-item {
  align-items: flex-start;
  line-height: 1.25;
  white-space: normal;
}
.sidebar nav .nav-item span {
  flex: 0 0 auto;
  line-height: 1.25;
}

.sim-workspace-body {
  margin-top: .35rem;
}
.sim-main-content { min-width: 0; }

/* Full-page Journey History tab (replaces the old left rail) */
.history-page-card { margin-bottom: 1rem; }
.history-page-help {
  margin: -.6rem 0 1rem;
  font-size: .72rem;
  line-height: 1.45;
  max-width: 48rem;
}
.history-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}
.history-page-actions .text-button,
.history-page-actions .primary-button {
  width: auto;
  margin: 0;
}
.history-page-actions .primary-button {
  min-height: 2.2rem;
  padding: .45rem .9rem;
  font-size: .72rem;
}
.history-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-solid) 70%, transparent);
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .72rem;
}
.history-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: .7rem .85rem;
  text-align: left;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.history-table tbody tr {
  cursor: pointer;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  transition: background .12s ease;
}
.history-table tbody tr:last-child { border-bottom: 0; }
.history-table tbody tr:hover {
  background: color-mix(in srgb, var(--teal) 6%, transparent);
}
.history-table tbody tr.active {
  background: color-mix(in srgb, var(--teal) 11%, transparent);
  box-shadow: inset 3px 0 0 var(--teal);
}
.history-table tbody tr.archived {
  opacity: .72;
  background: color-mix(in srgb, var(--muted) 8%, transparent);
}
.history-table tbody tr.archived.active {
  opacity: .88;
  background: color-mix(in srgb, var(--muted) 12%, var(--teal) 6%);
}
.history-archived-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  padding: .15rem .55rem .15rem .4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.history-archived-toggle:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--teal) 40%, var(--line));
}
.history-archived-toggle:has(input:checked) {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
  background: color-mix(in srgb, var(--teal) 10%, var(--surface-raised));
}
.history-archived-toggle input {
  /* Reset global admin.css input { width:100%; min-height:3.15rem; … } */
  width: .85rem;
  min-width: .85rem;
  height: .85rem;
  min-height: .85rem;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--line) 80%, var(--muted));
  border-radius: 3px;
  background: var(--surface-raised);
  box-shadow: none;
  accent-color: var(--teal);
  flex: 0 0 auto;
  cursor: pointer;
}
.history-archived-toggle input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 18%, transparent);
}
.history-archived-toggle > span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.auto-start-chat-toggle {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin: 0 0 .85rem;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-raised) 70%, transparent);
  color: var(--ink);
  font-size: .74rem;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease;
}
.auto-start-chat-toggle:hover {
  border-color: color-mix(in srgb, var(--teal) 40%, var(--line));
}
.auto-start-chat-toggle:has(input:checked) {
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
  background: color-mix(in srgb, var(--teal) 10%, var(--surface-raised));
}
.auto-start-chat-toggle input {
  /* Reset global admin.css input { width:100%; min-height:3.15rem; … } */
  width: 1rem;
  min-width: 1rem;
  height: 1rem;
  min-height: 1rem;
  margin: .1rem 0 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--line) 80%, var(--muted));
  border-radius: 3px;
  background: var(--surface-raised);
  box-shadow: none;
  accent-color: var(--teal);
  flex: 0 0 auto;
  cursor: pointer;
}
.auto-start-chat-toggle input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 18%, transparent);
}
.auto-start-chat-toggle > span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.ivr-agent-picker {
  display: grid;
  gap: .55rem;
  margin: 0 0 .85rem;
}
.ivr-agent-results {
  max-height: 12.5rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
}
.ivr-agent-result {
  display: grid;
  gap: .12rem;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: .55rem .75rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.ivr-agent-result:last-child {
  border-bottom: 0;
}
.ivr-agent-result:hover,
.ivr-agent-result:focus {
  background: color-mix(in srgb, var(--teal) 10%, transparent);
}
.ivr-agent-result.is-selected {
  background: color-mix(in srgb, var(--teal) 14%, var(--surface-raised));
}
.ivr-agent-result-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink);
}
.ivr-agent-result-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .66rem;
  color: var(--muted);
  word-break: break-all;
}
.ivr-version-picker {
  display: grid;
  gap: .45rem;
  margin: 0 0 .85rem;
}
.ivr-version-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  font-size: .68rem;
  color: var(--muted);
}
.ivr-version-toolbar .text-button {
  width: auto;
  margin: 0;
  color: var(--teal);
}
.ivr-version-picker {
  min-width: 0;
}
.ivr-version-picker select {
  /* Version titles are long; never let the widest option size the control past the card. */
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  text-overflow: ellipsis;
}
.ivr-version-toolbar label {
  margin: 0;
}
#ivr-agent-controls label {
  margin-bottom: .85rem;
}
.journey-archived-badge {
  display: inline-block;
  margin-left: .35rem;
  padding: .05rem .35rem;
  border-radius: 3px;
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--muted) 20%, var(--ink));
  background: color-mix(in srgb, var(--muted) 18%, transparent);
  vertical-align: middle;
}
.history-detail-card.is-archived {
  border-color: color-mix(in srgb, var(--muted) 45%, var(--line));
}
.history-detail-card.is-archived #history-detail-title::after {
  content: ' · archived';
  color: var(--muted);
  font-weight: 500;
  font-size: .85em;
}
.history-table td {
  padding: .75rem .85rem;
  vertical-align: top;
  line-height: 1.35;
}
.history-table .cell-primary {
  display: grid;
  gap: .15rem;
  min-width: 9rem;
}
.history-table .cell-primary strong {
  font-size: .78rem;
  line-height: 1.25;
}
.history-table .cell-primary small {
  color: var(--muted);
  font-size: .62rem;
}
.history-table .cell-mono {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: .62rem;
  color: var(--muted);
  white-space: nowrap;
}
.history-table .cell-outcome {
  color: color-mix(in srgb, #c9a227 75%, var(--ink));
  font-weight: 600;
}
.history-table .cell-muted { color: var(--muted); }
.history-table .cell-stack {
  display: grid;
  gap: .12rem;
}
.history-table .cell-stack small {
  color: var(--muted);
  font-size: .62rem;
}
.history-detail-card { margin-top: 0; }
.history-detail-meta {
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.history-detail-meta dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .65rem .9rem;
  margin: 0;
}
.history-detail-meta dt {
  margin: 0;
  color: var(--muted);
  font-size: .58rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.history-detail-meta dd {
  margin: .2rem 0 0;
  font-size: .74rem;
  line-height: 1.35;
  word-break: break-word;
}
.history-detail-meta dd.mono {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: .66rem;
  color: var(--muted);
}
.history-detail-events {
  display: grid;
  gap: .55rem;
}
.history-detail-events > strong { font-size: .72rem; }
.history-event-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: start;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
}
.history-event-row.active {
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
  background: color-mix(in srgb, var(--teal) 10%, var(--surface-raised));
  box-shadow: inset 3px 0 0 var(--teal);
}
.history-event-kind {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teal);
  padding-top: .15rem;
}
.history-event-main strong {
  display: block;
  font-size: .74rem;
  text-transform: capitalize;
}
.history-event-main small {
  display: block;
  margin-top: .15rem;
  color: var(--muted);
  font-size: .62rem;
  line-height: 1.35;
  word-break: break-all;
}
.history-event-summary {
  margin: .3rem 0 0;
  color: var(--ink);
  font-size: .7rem;
  line-height: 1.4;
}
.history-event-row .text-button {
  width: auto;
  margin: 0;
  font-size: .62rem;
}
.history-detail-debug-slots {
  display: grid;
  gap: .75rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px dashed color-mix(in srgb, var(--line) 85%, transparent);
}
.debug-slot {
  padding: .75rem .85rem;
  border: 1px dashed color-mix(in srgb, var(--line) 90%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
}
.debug-slot .eyebrow { margin-bottom: .25rem; }
.history-row-debug-slot {
  margin-top: .55rem;
  padding-top: .45rem;
  border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
}

@media (max-width: 1100px) {
  .journey-picker-compact { display: none; }
}

/* Two field pairs per line needs room — stack to one pair per line on narrow screens. */
@media (max-width: 980px) {
  .outcome-summary dl { grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr); }
  .analysis-table-wrap table,
  .analysis-table-wrap tbody,
  .analysis-table-wrap tr { display: block; width: 100%; }
  .analysis-table-wrap tr {
    display: grid;
    grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  }
  .analysis-table-wrap th.analysis-key,
  .analysis-table-wrap td.analysis-value { width: auto; border: 0; padding-right: .4rem; }
  .analysis-table-wrap .is-filler { display: none; }
}

@media (max-width: 980px) {
  .desk-grid-sim { grid-template-columns: 1fr; }
  .history-event-row { grid-template-columns: 1fr; }
  .history-table thead { display: none; }
  .history-table tbody tr {
    display: grid;
    gap: .35rem;
    padding: .85rem;
  }
  .history-table td {
    padding: 0;
    display: flex;
    gap: .4rem;
  }
  .history-table td::before {
    content: attr(data-label);
    flex: 0 0 5.5rem;
    color: var(--muted);
    font-size: .58rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
}

.journey-path-banner {
  margin: 0 0 1.1rem;
  padding: 1.05rem 1.2rem 1.25rem;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 16px;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 10%, transparent),
      transparent 42%),
    color-mix(in srgb, var(--teal) 8%, var(--surface-raised));
  box-shadow: 0 10px 28px color-mix(in srgb, #000 22%, transparent);
}
.journey-path-banner-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: .85rem;
}
.journey-path-banner-titles {
  display: grid;
  gap: .35rem;
  min-width: 0;
}
.journey-path-eyebrow {
  margin: 0;
  color: var(--accent);
  font: 600 .68rem/1.2 'DM Mono', monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.journey-path-copy {
  margin: 0;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.4;
  max-width: 36rem;
}

/* Prominent journey ID chip — path banner, chat thread, history detail */
.journey-id-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  max-width: 100%;
  min-width: 0;
  margin-top: .2rem;
  padding: .35rem .55rem;
  border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--teal) 10%, var(--surface-solid));
}
.journey-id-badge-lg {
  margin-top: .45rem;
  padding: .45rem .7rem;
}
.journey-id-badge.is-empty {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-raised) 80%, transparent);
}
.journey-id-kicker {
  flex: 0 0 auto;
  color: var(--teal);
  font: 700 .58rem/1 'DM Mono', ui-monospace, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.journey-id-value {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  color: var(--ink);
  font: 600 .78rem/1.35 'DM Mono', ui-monospace, monospace;
  letter-spacing: .01em;
}
.journey-id-badge-lg .journey-id-value {
  font-size: .88rem;
}
.journey-id-empty {
  color: var(--muted);
  font: 500 .72rem/1.2 'DM Mono', ui-monospace, monospace;
}
.journey-id-copy {
  flex: 0 0 auto;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: .15rem .4rem;
  font-size: .58rem;
}
.card-heading .journey-id-badge {
  display: flex;
  width: fit-content;
}
.journey-path-map {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  width: 100%;
}
.journey-path-node {
  display: flex;
  flex-direction: column;
  gap: .32rem;
  min-width: 0;
  min-height: 5.5rem;
  padding: .85rem 1rem;
  border: 1.5px solid color-mix(in srgb, var(--line) 85%, var(--ink));
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  box-shadow: 0 4px 14px color-mix(in srgb, #000 18%, transparent);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.journey-path-node.voice,
.journey-path-node.outcome {
  flex: 1 1 0;
}
.journey-path-node.chat {
  flex: 2.1 1 0; /* stretch chat further as path continuation */
}
.journey-path-node-label {
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.journey-path-node-title {
  color: var(--ink);
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}
.journey-path-node-meta {
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.35;
  word-break: break-word;
}
.journey-path-node-meta strong {
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
  font-weight: 600;
}
.journey-path-connector {
  flex: 0 0 2rem;
  align-self: center;
  height: 3px;
  margin: 0 .15rem;
  border-radius: 3px;
  background: color-mix(in srgb, var(--muted) 45%, var(--line));
  position: relative;
}
.journey-path-connector::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2.5px solid color-mix(in srgb, var(--muted) 55%, var(--line));
  border-top: 2.5px solid color-mix(in srgb, var(--muted) 55%, var(--line));
  transform: translateY(-50%) rotate(45deg);
}
.journey-path-connector.is-lit {
  background: color-mix(in srgb, var(--accent) 70%, var(--teal));
}
.journey-path-connector.is-lit::after {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--teal));
}
.journey-path-node.is-pending {
  opacity: .78;
}
.journey-path-node.is-active {
  opacity: 1;
  border-color: color-mix(in srgb, var(--teal) 60%, var(--line));
  background: color-mix(in srgb, var(--teal) 14%, var(--surface-solid));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--teal) 22%, transparent),
    0 6px 18px color-mix(in srgb, var(--teal) 12%, transparent);
}
.journey-path-node.is-analyzing {
  opacity: 1;
  border-color: color-mix(in srgb, #c9a227 60%, var(--line));
  background: color-mix(in srgb, #c9a227 14%, var(--surface-solid));
}
.journey-path-node.is-completed {
  opacity: 1;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: color-mix(in srgb, var(--accent) 11%, var(--surface-solid));
}
.journey-path-node.is-failed {
  opacity: 1;
  border-color: color-mix(in srgb, #e07070 55%, var(--line));
  background: color-mix(in srgb, #e07070 12%, var(--surface-solid));
}
.journey-path-node.voice.is-completed,
.journey-path-node.voice.is-active {
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
}
.journey-path-node.chat.is-active,
.journey-path-node.chat.is-completed {
  border-color: color-mix(in srgb, #5b8def 55%, var(--line));
  background: color-mix(in srgb, #5b8def 12%, var(--surface-solid));
}
.journey-path-node-cta {
  margin-top: .2rem;
  color: var(--teal);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.journey-path-node.chat.is-clickable {
  cursor: pointer;
  opacity: 1;
}
.journey-path-node.chat.is-clickable.is-suggested {
  border-color: color-mix(in srgb, #5b8def 48%, var(--line));
  background: color-mix(in srgb, #5b8def 10%, var(--surface-solid));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #5b8def 16%, transparent),
    0 6px 18px color-mix(in srgb, #5b8def 10%, transparent);
}
.journey-path-node.chat.is-clickable:hover,
.journey-path-node.chat.is-clickable:focus-visible {
  border-color: color-mix(in srgb, #5b8def 72%, var(--line));
  background: color-mix(in srgb, #5b8def 16%, var(--surface-solid));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #5b8def 28%, transparent),
    0 8px 22px color-mix(in srgb, #5b8def 16%, transparent);
  outline: none;
}
.journey-path-node.chat.is-clickable:hover .journey-path-node-cta,
.journey-path-node.chat.is-clickable:focus-visible .journey-path-node-cta {
  color: color-mix(in srgb, var(--teal) 70%, var(--ink));
}
.journey-path-node.chat:not(.is-clickable) {
  cursor: default;
}
.journey-path-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  width: fit-content;
  margin-top: .05rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--surface-raised) 78%, transparent);
  color: var(--ink);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: capitalize;
}
.journey-path-status::before {
  content: '';
  width: .48rem;
  height: .48rem;
  border-radius: 50%;
  background: var(--muted);
}
.journey-path-node.is-active .journey-path-status::before,
.journey-path-node.is-analyzing .journey-path-status::before {
  background: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent);
}
.journey-path-node.is-analyzing .journey-path-status::before { background: #c9a227; }
.journey-path-node.is-completed .journey-path-status::before { background: var(--accent-strong); }
.journey-path-node.is-failed .journey-path-status::before { background: #e07070; }

@media (max-width: 820px) {
  .journey-path-map {
    flex-direction: column;
    gap: .4rem;
  }
  .journey-path-node.voice,
  .journey-path-node.outcome,
  .journey-path-node.chat {
    flex: 1 1 auto;
    min-height: 0;
  }
  .journey-path-connector {
    flex: 0 0 1rem;
    width: 3px;
    height: 1rem;
    margin: 0 auto;
  }
  .journey-path-connector::after {
    right: 50%;
    top: auto;
    bottom: -2px;
    transform: translateX(50%) rotate(135deg);
  }
}

.journey-timeline {
  display: grid;
  gap: .55rem;
  margin-bottom: 1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}
.journey-timeline-item {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: .55rem;
  align-items: center;
  font-size: .7rem;
}
.journey-timeline-kind {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-size: .62rem;
}
.journey-timeline-main strong { display: block; text-transform: capitalize; }
.journey-timeline-main small { color: var(--muted); }
.journey-timeline-item .text-button { width: auto; margin: 0; }

.variable-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin: 1rem 0 .35rem;
}
.variable-toolbar-label {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.variable-toolbar .text-button {
  width: auto;
  margin: 0;
  color: var(--teal);
}
.variable-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .8rem; margin: .35rem 0 1rem; }
.variable-grid label { display: grid; gap: .3rem; font-size: .68rem; color: var(--muted); }
.variable-grid input,
.variable-grid select { font-size: .74rem; }

.suggestion-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; padding: .8rem 1rem; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--teal) 30%, var(--line)); background: color-mix(in srgb, var(--teal) 8%, transparent); font-size: .72rem; }
.suggestion-banner .text-button { color: var(--teal); }
.suggestion-banner.unavailable { border-color: var(--line); background: transparent; color: var(--muted); }
.suggestion-banner .suggestion-failure {
  display: block;
  width: 100%;
  margin-top: .15rem;
  color: var(--ink);
  font-size: .7rem;
}
.outcome-summary {
  margin: 0 0 .9rem;
  padding: .9rem 1rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, #b45309 35%, var(--line));
  background: color-mix(in srgb, #b45309 8%, transparent);
}
.outcome-summary.success {
  border-color: color-mix(in srgb, var(--teal) 35%, var(--line));
  background: color-mix(in srgb, var(--teal) 8%, transparent);
}
.outcome-summary h3 {
  margin: 0 0 .45rem;
  font-size: .82rem;
  font-weight: 700;
}
.outcome-summary .outcome-narrative {
  margin: 0 0 .6rem;
  color: var(--ink);
  font-size: .84rem;
  line-height: 1.45;
}
.outcome-facts {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .45rem;
  margin: 0 0 .7rem;
}
.outcome-fact {
  display: inline-flex;
  gap: .35rem;
  align-items: baseline;
  padding: .22rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: .66rem;
  font-weight: 600;
}
.outcome-fact strong { color: var(--ink); font-weight: 700; }
.outcome-fact.is-yes { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
.outcome-fact.is-yes strong { color: var(--teal); }
.outcome-summary dl {
  display: grid;
  grid-template-columns: minmax(6.5rem, 9.5rem) minmax(6rem, 1fr) minmax(6.5rem, 9.5rem) minmax(6rem, 1fr);
  gap: .3rem .75rem;
  margin: 0;
  font-size: .76rem;
}
.outcome-summary dt { color: var(--muted); margin: 0; }
.outcome-summary dd { margin: 0; color: var(--ink); word-break: break-word; }
.outcome-summary .outcome-reason {
  grid-column: 1 / -1;
  margin-top: .35rem;
  padding-top: .45rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  font-size: .78rem;
  line-height: 1.35;
}
.history-row-analysis .status-pill.reason-pill {
  border-color: color-mix(in srgb, #b45309 40%, var(--line));
  background: color-mix(in srgb, #b45309 10%, transparent);
}

.analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, auto)); gap: .5rem; margin: 1rem 0; }
.analysis-grid .status-pill { width: fit-content; }
/* Summary tab reads at full height — no inner scrollbar. Wide tables still scroll sideways. */
.analysis-table-wrap { max-height: none; overflow-y: visible; overflow-x: auto; }
.analysis-table-wrap table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.analysis-table-wrap col.analysis-col-key { width: 11rem; }
.analysis-table-wrap col.analysis-col-value { width: auto; }
.analysis-table-wrap tr { border-bottom: 1px solid var(--line); }
.analysis-table-wrap tr:last-child { border-bottom: 0; }
/* Override admin.css's uppercase mono `th` — sentence-case labels read as prose here. */
.analysis-table-wrap th.analysis-key {
  padding: .34rem .6rem .34rem 0;
  border-bottom: 0;
  color: var(--muted);
  font: 600 .72rem/1.4 'DM Sans', sans-serif;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  vertical-align: top;
  white-space: normal;
}
.analysis-table-wrap td.analysis-value {
  padding: .34rem 1.4rem .34rem 0;
  border-bottom: 0;
  color: var(--ink);
  font-size: .76rem;
  line-height: 1.4;
  vertical-align: top;
  word-break: break-word;
}
.analysis-table-wrap td.analysis-value.is-empty { color: var(--muted); }
.analysis-table-wrap td.analysis-value.is-yes { color: var(--teal); font-weight: 600; }
.analysis-table-wrap td.analysis-value.is-no { color: var(--muted); }
.analysis-table-wrap td.analysis-value-long {
  padding-right: 0;
  white-space: pre-wrap;
}
.analysis-table-wrap tr.analysis-row-long td.analysis-value-long {
  color: var(--ink);
  font-size: .76rem;
}

.analysis-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: .85rem 0 .7rem;
}
.analysis-tab {
  width: auto;
  min-height: 2rem;
  margin: 0;
  padding: .35rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 600 .68rem 'DM Sans', sans-serif;
  cursor: pointer;
}
.analysis-tab.active {
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
  background: color-mix(in srgb, var(--teal) 12%, var(--surface-raised));
  color: var(--ink);
}
.analysis-tab-panel { margin-top: .15rem; }
.raw-json-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: .55rem .65rem;
  margin-bottom: .35rem;
}
.raw-json-toolbar .text-button { width: auto; margin: 0; }
.raw-json-webhook-field {
  display: grid;
  gap: .2rem;
  flex: 1 1 14rem;
  min-width: min(100%, 12rem);
  margin: 0;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 600;
}
.raw-json-webhook-field .analysis-webhook-url {
  width: 100%;
  min-height: 2.1rem;
  margin: 0;
  padding: .4rem .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--ink);
  font: 500 .68rem/1.3 'DM Mono', monospace;
}
.raw-json-webhook-status {
  margin: 0 0 .45rem;
  min-height: 1em;
}
.raw-json-pre {
  max-height: 22rem;
  margin: 0;
  overflow: auto;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-solid) 70%, var(--bg));
  color: var(--ink);
  font: 500 .62rem/1.5 'DM Mono', monospace;
  white-space: pre;
  word-break: normal;
}

.desk-grid-sim { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(18rem, .8fr); gap: 1rem; margin-top: 1rem; align-items: start; }

/* Chat thread: phone + notes stacked above full-width outcome (not side-by-side). */
.chat-thread-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}
.chat-thread-outcome-panel {
  width: 100%;
  min-width: 0;
}

.chat-sms-demo-note {
  margin: 0 0 1rem;
  max-width: 36rem;
}
.chat-sms-demo-note code {
  font: 500 .68em/1.4 'DM Mono', monospace;
  color: var(--ink);
}

.phone-mock {
  display: flex;
  flex-direction: column;
  width: min(100%, 23rem);
  height: min(85vh, 48rem);
  margin: 0 auto;
  border: 10px solid var(--ink);
  border-radius: 2.2rem;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.phone-mock-notch {
  display: flex;
  flex: 0 0 auto;
  height: 1.4rem;
  align-items: center;
  justify-content: center;
}
.phone-mock-notch::before { content: ''; width: 5rem; height: .6rem; border-radius: 999px; background: var(--ink); }
.phone-mock-header {
  display: grid;
  flex: 0 0 auto;
  justify-items: stretch;
  gap: .35rem;
  padding: .45rem .75rem .75rem;
  border-bottom: 1px solid var(--line);
}
.phone-mock-meta { display: grid; gap: .3rem; }
.phone-mock-meta-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: .45rem;
  text-align: left;
}
.phone-mock-meta-label {
  color: var(--muted);
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: none;
}
.phone-mock-header strong { font-size: .82rem; line-height: 1.25; }
.phone-mock-header small { color: var(--muted); font-size: .62rem; text-align: center; }
.phone-mock-screen {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: .5rem;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem .8rem;
  background: color-mix(in srgb, var(--surface-solid) 60%, var(--bg));
}
.phone-mock-placeholder {
  align-self: center;
  justify-self: center;
  max-width: 85%;
  margin-top: 3rem;
  color: var(--faint);
  font-size: .72rem;
  line-height: 1.45;
  text-align: center;
}
.phone-mock-message {
  display: grid;
  gap: .2rem;
  max-width: 78%;
}
.phone-mock-message.agent { justify-self: start; }
.phone-mock-message.member { justify-self: end; }
.phone-mock-message.tool { justify-self: center; max-width: 92%; }
.phone-mock-role {
  color: var(--muted);
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.2;
}
.phone-mock-message.member .phone-mock-role { text-align: right; }
.phone-mock-message.tool .phone-mock-role { text-align: center; }
.phone-mock-bubble { max-width: 100%; padding: .55rem .8rem; border-radius: 1.1rem; font-size: .72rem; line-height: 1.4; white-space: pre-wrap; }
.phone-mock-bubble.agent { border: 1px solid var(--line); border-bottom-left-radius: .3rem; background: var(--surface-raised); }
.phone-mock-bubble.member { border-bottom-right-radius: .3rem; background: var(--teal); color: #fff; }
.phone-mock-bubble.tool { max-width: 100%; padding: .35rem .6rem; border-radius: .6rem; background: transparent; color: var(--faint); font: 500 .6rem 'DM Mono', monospace; text-align: center; }
.phone-mock-bubble.sms-multipart { position: relative; padding-top: .75rem; }
.phone-mock-sms-index {
  position: absolute;
  top: .18rem;
  right: .45rem;
  font-size: .52rem;
  letter-spacing: .02em;
  opacity: .5;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.phone-mock-bubble.member .phone-mock-sms-index { color: #fff; opacity: .65; }
.phone-mock-compose {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: .5rem;
  padding: .7rem .8rem;
  border-top: 1px solid var(--line);
  background: var(--surface-raised);
}
.phone-mock-compose textarea {
  flex: 1;
  width: auto;
  min-height: 2.4rem;
  max-height: 5.2rem;
  margin: 0;
  border-radius: 1.1rem;
  padding: .55rem .85rem;
  font-size: .72rem;
  line-height: 1.35;
  resize: none;
  field-sizing: content;
}
.phone-mock-compose button {
  width: auto;
  min-width: 4.5rem;
  min-height: 2.4rem;
  margin: 0;
  border-radius: 999px;
}
.chat-end-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem 1rem;
  margin-top: .85rem;
}
.chat-end-actions .primary-button {
  width: auto;
  min-height: 2.4rem;
}
.primary-button.danger-button {
  background: #c23b3b;
  color: #fff;
}
.primary-button.danger-button:hover:not(:disabled) {
  background: #a83232;
}
.chat-end-actions #end-chat-status {
  margin: 0;
  flex: 1 1 12rem;
}

.mapping-help { margin: 0 0 1rem; font-size: .72rem; line-height: 1.45; }
.webhook-forward-card { max-width: 46rem; }
.webhook-forward-teaser .primary-button {
  width: auto;
  min-height: 2.2rem;
  padding: .45rem .9rem;
  font-size: .72rem;
}
.custom-webhook-form {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto auto;
  gap: .7rem;
  align-items: end;
  margin-bottom: .4rem;
}
.custom-webhook-form label {
  display: grid;
  gap: .3rem;
  font-size: .68rem;
  color: var(--muted);
}
.custom-webhook-form .primary-button { width: auto; min-height: 2.4rem; }
.custom-webhook-status { margin: 0 0 .4rem; font-size: .7rem; }
@media (max-width: 720px) {
  .custom-webhook-form { grid-template-columns: 1fr; }
}
.add-mapping-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-bottom: .6rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.add-mapping-form label {
  display: grid;
  gap: .3rem;
  margin-bottom: 0;
  font-size: .68rem;
  color: var(--muted);
  min-width: 0;
}
.add-mapping-form input,
.add-mapping-form select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-size: .74rem;
}
.add-mapping-form .add-mapping-desc { grid-column: 1 / -1; }
.add-mapping-form .primary-button { width: auto; align-self: end; min-height: 2.4rem; }
@media (max-width: 720px) {
  .add-mapping-form { grid-template-columns: 1fr; }
}
.outcome-mapping-list {
  display: grid;
  gap: 0;
  min-width: 0;
}
.mapping-row {
  display: grid;
  grid-template-columns:
    minmax(12rem, 1.15fr)
    minmax(7.5rem, 0.7fr)
    minmax(10rem, 0.95fr)
    minmax(12rem, 1.4fr)
    auto;
  column-gap: 1rem;
  row-gap: .45rem;
  align-items: center;
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.mapping-row > * { min-width: 0; }
.mapping-row:last-child { border-bottom: 0; }
.mapping-row-header {
  padding-top: .35rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--line);
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .01em;
}
.mapping-row-header span { line-height: 1.2; }
.mapping-meta {
  display: grid;
  gap: .15rem;
  align-content: center;
  padding-right: .25rem;
}
.mapping-meta strong {
  font-size: .78rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.mapping-meta .muted {
  display: block;
  font-size: .68rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.mapping-match {
  font-size: .62rem;
  color: var(--muted);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.mapping-row select,
.mapping-row .mapping-description {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.mapping-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  align-items: center;
  justify-content: flex-end;
  min-width: max-content;
}
.mapping-actions-header { text-align: right; }
.mapping-row .text-button { width: auto; margin: 0; }
@media (max-width: 1100px) {
  .mapping-row {
    grid-template-columns:
      minmax(10rem, 1fr)
      minmax(7rem, 0.65fr)
      minmax(9rem, 0.85fr)
      minmax(10rem, 1.2fr)
      auto;
    column-gap: .85rem;
  }
}
@media (max-width: 860px) {
  .mapping-row,
  .mapping-row-header {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .mapping-meta,
  .mapping-description,
  .mapping-actions,
  .mapping-actions-header {
    grid-column: 1 / -1;
  }
  .mapping-actions { justify-content: flex-start; }
  .mapping-actions-header { text-align: left; }
  .mapping-row-header span:nth-child(2),
  .mapping-row-header span:nth-child(3) { display: none; }
}

.history-list { display: grid; gap: .8rem; max-height: 34rem; overflow-y: auto; }
.history-row { border: 1px solid var(--line); border-radius: 13px; padding: .9rem 1rem; background: var(--surface-raised); }
.history-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.history-row-head strong { text-transform: capitalize; }
.history-row-head .muted { color: var(--muted); font-size: .68rem; }
.history-row-head .text-button { margin-left: auto; width: auto; }
.history-row-analysis { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.history-row-analysis .status-pill { width: fit-content; }
.history-row-suggestion { margin-top: .7rem; }
.history-row-details { margin-top: .7rem; }
.history-row-details .text-button { width: auto; margin: 0; }
.history-row-details .analysis-detail-tabs { margin-top: 0; }

.session-notes {
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}
.session-notes-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .55rem;
}
.session-notes-head strong { font-size: .72rem; }
.session-notes-head .muted { font-size: .62rem; }
.session-note-list { display: grid; gap: .45rem; margin-bottom: .55rem; }
.session-note {
  display: grid;
  gap: .35rem;
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-solid) 70%, transparent);
}
.session-note.is-reply {
  margin-left: 1.1rem;
  border-left: 2px solid color-mix(in srgb, var(--teal) 45%, var(--line));
  background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
}
.session-note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  font-size: .62rem;
  color: var(--muted);
}
.session-note-meta .text-button { width: auto; margin: 0; font-size: .62rem; }
.session-note-time {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .25rem;
  align-items: baseline;
}
.session-note-time time { color: var(--ink); font-weight: 600; }
.session-note-time .abs-time { opacity: .75; font-weight: 400; }
.session-note-body {
  margin: 0;
  font-size: .72rem;
  line-height: 1.4;
  white-space: pre-wrap;
}
.session-note-body .note-mention {
  color: var(--teal);
  font-weight: 700;
}
.session-note-edit-compose {
  display: grid;
  gap: .35rem;
}
.note-compose-field {
  position: relative;
}
.note-compose-field textarea {
  width: 100%;
  min-height: 2.8rem;
  resize: vertical;
  font: inherit;
  font-size: .72rem;
  padding: .4rem .5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--ink);
}
.note-mention-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + .25rem);
  z-index: 20;
  display: grid;
  gap: .15rem;
  max-height: 10rem;
  overflow: auto;
  padding: .3rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  box-shadow: 0 10px 28px color-mix(in srgb, #000 28%, transparent);
}
.note-mention-menu[hidden] { display: none !important; }
.note-mention-option {
  width: 100%;
  margin: 0;
  padding: .4rem .55rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: 600 .72rem 'DM Sans', sans-serif;
  text-align: left;
  cursor: pointer;
}
.note-mention-option:hover,
.note-mention-option.active {
  background: color-mix(in srgb, var(--teal) 14%, transparent);
}
.session-note-reply-compose {
  display: grid;
  gap: .35rem;
  margin-top: .15rem;
}
.session-note-reply-compose textarea {
  min-height: 2.4rem;
  resize: vertical;
  font: inherit;
  font-size: .72rem;
  padding: .4rem .5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--ink);
}
.session-note-reply-compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: flex-end;
}
.note-notifications {
  position: relative;
}
.note-notifications-button {
  position: relative;
}
.note-notifications-icon {
  font-size: .95rem;
  line-height: 1;
  font-weight: 700;
}
.note-notifications-badge {
  position: absolute;
  top: -.15rem;
  right: -.15rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 .28rem;
  border-radius: 999px;
  background: color-mix(in srgb, #c45c26 85%, #000);
  color: #fff;
  font-size: .58rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
}
.note-notifications-dropdown {
  position: absolute;
  top: calc(100% + .45rem);
  right: 0;
  z-index: 40;
  width: min(22rem, 78vw);
  max-height: min(22rem, 60vh);
  overflow: auto;
  padding: .65rem .7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  box-shadow: 0 12px 28px color-mix(in srgb, #000 18%, transparent);
}
.note-notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
}
.note-notifications-head strong { font-size: .75rem; }
.note-notifications-head .text-button { width: auto; margin: 0; font-size: .62rem; }
.note-notifications-list { display: grid; gap: .35rem; }
.note-notification-item {
  display: grid;
  gap: .2rem;
  width: 100%;
  padding: .5rem .55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.note-notification-item:hover {
  border-color: color-mix(in srgb, var(--teal) 40%, var(--line));
  background: color-mix(in srgb, var(--teal) 8%, transparent);
}
.note-notification-item.is-unread {
  border-color: color-mix(in srgb, #c45c26 40%, var(--line));
  background: color-mix(in srgb, #c45c26 8%, transparent);
}
.note-notification-item strong { font-size: .7rem; }
.note-notification-item .muted { font-size: .62rem; margin: 0; }
.note-notifications-empty { margin: .35rem 0 0; font-size: .68rem; }
.team-tag {
  display: inline-flex;
  align-items: center;
  padding: .12rem .45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.team-tag.retell {
  border-color: color-mix(in srgb, #5b8def 50%, var(--line));
  background: color-mix(in srgb, #5b8def 14%, transparent);
  color: color-mix(in srgb, #5b8def 80%, var(--ink));
}
.team-tag.cvs_aetna {
  border-color: color-mix(in srgb, #c45c26 50%, var(--line));
  background: color-mix(in srgb, #c45c26 14%, transparent);
  color: color-mix(in srgb, #c45c26 85%, var(--ink));
}
.session-note-compose {
  display: grid;
  gap: .45rem;
}
.session-note-compose textarea {
  min-height: 3.2rem;
  resize: vertical;
  font-size: .72rem;
  line-height: 1.4;
}
.session-note-compose-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.session-note-compose-actions .text-button,
.session-note-compose-actions .primary-button {
  width: auto;
  margin: 0;
  min-height: 2.1rem;
}
.team-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-solid);
}
.team-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: .35rem .65rem;
  cursor: pointer;
}
.team-toggle button.active.retell {
  background: color-mix(in srgb, #5b8def 18%, transparent);
  color: color-mix(in srgb, #5b8def 85%, var(--ink));
}
.team-toggle button.active.cvs_aetna {
  background: color-mix(in srgb, #c45c26 18%, transparent);
  color: color-mix(in srgb, #c45c26 90%, var(--ink));
}
.journey-timeline-item .note-count {
  font-size: .58rem;
  color: var(--muted);
  margin-left: .25rem;
}
.timeline-notes {
  margin: -.15rem 0 .35rem;
  padding: .55rem .65rem;
  border: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
}
.timeline-notes .session-notes-head { margin-bottom: .4rem; }
#chat-session-notes { margin-top: 1rem; }
.topbar-actions .text-button { width: auto; }

/* Dedicated voice call detail (synced recording + transcript) */
.voice-detail-card { margin-top: 0; }
.voice-detail-media {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.15rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}
.voice-detail-media .recording-player {
  margin: 0;
}
.voice-detail-media .recording-media {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.voice-detail-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: .45rem .85rem;
  border: 1px solid color-mix(in srgb, var(--teal) 45%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--teal) 10%, transparent);
  color: var(--teal);
  font: 600 .68rem 'DM Sans', sans-serif;
  text-decoration: none;
  white-space: nowrap;
}
.voice-detail-download:hover {
  background: color-mix(in srgb, var(--teal) 18%, transparent);
}
.voice-detail-media .synced-transcript {
  max-height: min(42vh, 28rem);
}
.voice-detail-media .transcript-utterance {
  cursor: default;
}
.voice-detail-media .transcript-utterance.seekable {
  cursor: pointer;
}
.voice-detail-media .transcript-utterance.seekable:hover {
  background: color-mix(in srgb, var(--teal) 6%, transparent);
}
.voice-detail-empty {
  display: grid;
  justify-items: center;
  gap: .35rem;
  padding: 2rem 1.25rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}
.voice-detail-empty strong {
  color: var(--ink);
  font-size: .78rem;
}
.voice-detail-empty p {
  max-width: 28rem;
  margin: 0;
  font-size: .67rem;
  line-height: 1.55;
}
.voice-detail-analysis { margin-bottom: 1rem; }

/* Post-chat analysis transcript (mirrors voice call detail layout) */
.chat-analysis-transcript {
  margin: 0 0 1rem;
}
.chat-analysis-transcript .synced-transcript {
  max-height: min(42vh, 28rem);
}
.chat-analysis-transcript .transcript-utterance {
  cursor: default;
}
.chat-analysis-transcript .plain-transcript {
  margin: 0;
  padding: .75rem .8rem;
  color: var(--ink);
  font-size: .73rem;
  line-height: 1.65;
  white-space: pre-wrap;
}
.history-event-row[data-kind="voice"] {
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.history-event-row[data-kind="voice"]:hover {
  border-color: color-mix(in srgb, var(--teal) 45%, var(--line));
  background: color-mix(in srgb, var(--teal) 6%, var(--surface-raised));
}
@media (max-width: 720px) {
  .voice-detail-media .recording-media {
    grid-template-columns: 1fr;
  }
}

/* Changelog tab — live git commits */
.changelog-page-card { margin-bottom: 1rem; }
.changelog-meta {
  margin: -.35rem 0 1rem;
  font-size: .68rem;
}
.changelog-list {
  display: grid;
  gap: .55rem;
}
.changelog-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-solid) 70%, transparent);
  padding: .75rem .9rem;
}
.changelog-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}
.changelog-item-main {
  display: grid;
  gap: .2rem;
  min-width: 0;
}
.changelog-item-main strong {
  font-size: .78rem;
  color: var(--ink);
  line-height: 1.35;
}
.changelog-item-main small {
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.4;
}
.changelog-item .changelog-toggle {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}
.changelog-body {
  margin: .65rem 0 0;
  padding: .65rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-raised) 80%, transparent);
  color: var(--ink);
  font-size: .68rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 680px) {
  /* Keep every destination a single, horizontally scrollable tap target. */
  .sidebar nav .nav-item {
    align-items: center;
    white-space: nowrap;
  }
}

/* ---- Simulation calls tab (scheduling-sim-simulations.js) ---- */
.sim-view { display: grid; gap: 1.2rem; }
.sim-view .mono, .sim-view code { font-family: 'DM Mono', ui-monospace, monospace; }
.sim-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; }
.sim-subnav {
  display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .3rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.sim-subnav-item {
  display: inline-flex; align-items: center; gap: .4rem; border: 0; border-radius: 999px;
  padding: .55rem .95rem; background: none; color: var(--muted); cursor: pointer; font-size: .76rem; font-weight: 700;
}
.sim-subnav-item:hover { color: var(--ink); }
.sim-subnav-item.active { background: var(--ink); color: var(--surface-solid); }
.sim-count:empty { display: none; }
.sim-count {
  min-width: 1.25rem; border-radius: 999px; padding: .1rem .38rem; text-align: center;
  background: color-mix(in srgb, var(--muted) 16%, transparent); font-size: .62rem;
}
.sim-subnav-item.active .sim-count { background: color-mix(in srgb, var(--surface-solid) 22%, transparent); }
.sim-status-chip {
  display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--line); border-radius: 999px;
  padding: .5rem .85rem; background: var(--surface); color: var(--muted); cursor: pointer; font-size: .7rem;
  font-weight: 600;
}
.sim-status-chip i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--teal); }
.sim-status-chip.warn i { background: var(--coral); }

.sim-panel[hidden] { display: none !important; }
.sim-split { display: grid; grid-template-columns: minmax(16rem, 21rem) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.sim-split-runs { grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr); }
.sim-split-voices { grid-template-columns: minmax(0, 1.25fr) minmax(19rem, 1fr); }
.sim-split-even { grid-template-columns: 1fr 1fr; }
.sim-card { min-width: 0; }
.sim-card .card-heading { margin-bottom: 1.2rem; }
.sim-heading-actions { display: flex; align-items: center; gap: .6rem; }

/* forms */
.sim-form { display: grid; gap: 1rem; }
.sim-form label { margin-bottom: 0; }
.sim-field { display: grid; gap: .4rem; min-width: 0; font-size: .74rem; font-weight: 600; color: var(--ink); }
.sim-field small, .sim-label small, .sim-section-title small { color: var(--faint); font-weight: 500; font-size: .66rem; }
.sim-field input, .sim-field textarea, .sim-kv-row input, .sim-inline-form input, .sim-variant input,
.sim-variant textarea, .sim-search {
  min-height: 2.6rem; padding: .55rem .75rem; border-radius: 10px; font-size: .78rem;
}
.sim-field select, .sim-inline-form select, .sim-voice-controls select { width: 100%; font-size: .76rem; }
.sim-field input[readonly] { color: var(--muted); background: color-mix(in srgb, var(--muted) 6%, transparent); }
.sim-field-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.sim-label { display: block; font-size: .74rem; font-weight: 600; color: var(--ink); }
.sim-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.sim-hint { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.sim-hint-top { margin: -.4rem 0 1rem; }
.sim-hint.warn { color: var(--coral); font-weight: 600; }
.sim-hint code, .sim-section-title code { font-size: .66rem; }
.sim-toggle { margin: 0; }
.sim-button-auto { width: auto; margin-top: 0; gap: 1.2rem; min-height: 2.9rem; }
.sim-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
.sim-new-button, .sim-add-button {
  border: 1px solid color-mix(in srgb, var(--teal) 40%, var(--line)); border-radius: 999px; padding: .45rem .85rem;
  background: color-mix(in srgb, var(--teal) 9%, transparent); color: var(--teal); cursor: pointer;
  font-size: .7rem; font-weight: 700; white-space: nowrap;
}
.sim-new-button:hover, .sim-add-button:hover { background: color-mix(in srgb, var(--teal) 16%, transparent); }
.sim-new-button:disabled, .sim-add-button:disabled { opacity: .55; cursor: wait; }
.sim-icon-button {
  flex: none; width: 2rem; height: 2rem; border: 1px solid var(--line); border-radius: 50%; background: none;
  color: var(--faint); cursor: pointer; font-size: 1rem; line-height: 1;
}
.sim-icon-button:hover { border-color: var(--coral); color: var(--coral); }
.danger-text { color: var(--coral); }
.danger-text:hover { color: color-mix(in srgb, var(--coral) 70%, var(--ink)); }
.sim-add { justify-self: start; color: var(--teal); }
.sim-inline-form { display: flex; gap: .5rem; align-items: center; margin: 0 0 .8rem; }
.sim-inline-form input { flex: 1; min-width: 0; }
.sim-inline-form select { width: auto; flex: none; }
.sim-filter-bar select { max-width: 9rem; }

/* sections inside editors */
.sim-section { display: grid; gap: .75rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.sim-form > .sim-section:first-child { padding-top: 0; border-top: 0; }
.sim-section-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .55rem; margin: 0; font-size: .86rem; }
.sim-section-title > span {
  display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: var(--accent); color: #17201a; font-size: .66rem; font-weight: 800;
}
.sim-matchup { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: .7rem; }
.sim-matchup-arrow { padding-bottom: .65rem; color: var(--teal); font-size: 1.1rem; font-weight: 700; }
.sim-variable-grid { margin: 0; }
.sim-variable-grid input, .sim-variable-grid textarea { min-height: 2.4rem; padding: .5rem .65rem; border-radius: 9px; }
.sim-kv { display: grid; gap: .45rem; }
.sim-kv:empty { display: none; }
.sim-kv-row { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr) auto; gap: .45rem; align-items: center; }
.sim-variants { display: grid; gap: .7rem; }
.sim-variant {
  display: grid; gap: .5rem; padding: .75rem; border: 1px solid var(--line); border-radius: 14px;
  background: color-mix(in srgb, var(--surface-raised) 60%, transparent);
}
.sim-variant-head { display: flex; align-items: center; gap: .6rem; }
.sim-variant-head input[data-variant-name] { flex: 1; font-weight: 700; }
.sim-variant-head .checkbox-control { min-height: 0; margin: 0; white-space: nowrap; }
.sim-variant textarea { min-height: 5rem; }
.sim-editor-footer {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin: .4rem calc(-1 * clamp(1.2rem, 2.1vw, 2rem)) calc(-1 * clamp(1.2rem, 2.1vw, 2rem));
  padding: .9rem clamp(1.2rem, 2.1vw, 2rem); border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius); background: var(--surface-solid);
}
.sim-editor-footer .form-error { flex: 1; min-height: 0; margin: 0; text-align: right; }
.sim-delete-group { display: flex; align-items: center; gap: .6rem; }
.sim-delete-group .checkbox-control { min-height: 0; margin: 0; color: var(--muted); }
.sim-advanced { border: 1px dashed var(--line); border-radius: 12px; padding: .6rem .8rem; }
.sim-advanced summary { cursor: pointer; color: var(--muted); font-size: .72rem; font-weight: 600; }
.sim-advanced[open] { display: grid; gap: .7rem; }
.sim-prompt { min-height: 18rem; font-size: .74rem !important; line-height: 1.55; }
.sim-var-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.sim-var-chip {
  border: 1px solid var(--line); border-radius: 6px; padding: .2rem .4rem; background: none; color: var(--muted);
  cursor: pointer; font: 500 .62rem 'DM Mono', monospace;
}
.sim-var-chip.injected { border-color: color-mix(in srgb, var(--teal) 40%, var(--line)); color: var(--teal); }
.sim-var-chip:hover { border-color: var(--ink); color: var(--ink); }
.sim-meta-badge {
  border: 1px solid var(--line); border-radius: 999px; padding: .35rem .65rem; color: var(--muted); font-size: .62rem;
}

/* segmented controls */
.sim-segmented {
  display: inline-flex; gap: .2rem; padding: .22rem; border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 60%, transparent);
}
.sim-segmented button, .sim-segmented label > span {
  display: inline-block; border: 0; border-radius: 999px; padding: .38rem .75rem; background: none;
  color: var(--muted); cursor: pointer; font-size: .7rem; font-weight: 700;
}
.sim-segmented label { margin: 0; display: inline-flex; }
.sim-segmented label input { position: absolute; opacity: 0; pointer-events: none; }
.sim-segmented button.active, .sim-segmented label input:checked + span { background: var(--ink); color: var(--surface-solid); }
.sim-segmented label input:disabled + span { opacity: .4; cursor: not-allowed; }
.sim-segmented-wide { display: flex; margin-bottom: 1rem; }
.sim-segmented-wide button, .sim-segmented-wide label { flex: 1; justify-content: center; text-align: center; }
.sim-segmented-wide label > span { width: 100%; }

/* lists (scenarios / agents) */
.sim-list-card { padding: 1rem; position: sticky; top: 1rem; }
.sim-list-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .8rem; }
.sim-search { flex: 1; min-width: 0; }
.sim-list { display: grid; gap: .35rem; max-height: 70vh; overflow-y: auto; }
.sim-list-item {
  display: grid; gap: .35rem; width: 100%; border: 1px solid transparent; border-radius: 14px; padding: .75rem .8rem;
  background: none; color: var(--ink); cursor: pointer; text-align: left;
}
.sim-list-item strong { font-size: .78rem; }
.sim-list-item small { color: var(--faint); font-size: .64rem; }
.sim-list-item:hover { background: color-mix(in srgb, var(--surface-raised) 80%, transparent); }
.sim-list-item.active {
  border-color: color-mix(in srgb, var(--teal) 45%, var(--line));
  background: color-mix(in srgb, var(--teal) 8%, var(--surface-raised));
}
.sim-list-item.muted-item { opacity: .6; }
.sim-tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.sim-tag {
  display: inline-flex; align-items: center; border-radius: 6px; padding: .14rem .4rem;
  background: color-mix(in srgb, var(--muted) 11%, transparent); color: var(--muted); font-size: .6rem; font-weight: 700;
  white-space: nowrap;
}
.sim-tag.teal, .sim-tag.agent-scheduler { background: color-mix(in srgb, var(--teal) 13%, transparent); color: var(--teal); }
.sim-tag.agent-reschedule { background: color-mix(in srgb, #7b61ff 14%, transparent); color: #7b61ff; }
.sim-tag.agent-cancel { background: color-mix(in srgb, var(--coral) 14%, transparent); color: var(--coral); }
.sim-tag.agent-ivr_holding { background: color-mix(in srgb, #d48a00 16%, transparent); color: #b87600; }
.sim-tag.outcome { background: none; border: 1px solid var(--line); font-weight: 600; }
.sim-tag.off, .sim-tag.warn { background: color-mix(in srgb, var(--coral) 12%, transparent); color: var(--coral); }
.sim-tag.mono { font-family: 'DM Mono', monospace; font-weight: 500; }
.sim-empty { padding: 2.2rem 1rem; gap: .2rem; }
.sim-empty p { max-width: 26rem; margin-bottom: .8rem; }

/* run launcher */
.sim-pick-list { display: grid; gap: .4rem; max-height: 22rem; overflow-y: auto; }
.sim-pick {
  display: flex; align-items: flex-start; gap: .65rem; margin: 0; padding: .65rem .75rem; border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; font-weight: 500;
}
.sim-pick:has(input:checked) {
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
  background: color-mix(in srgb, var(--teal) 8%, var(--surface-raised));
}
.sim-pick input, .sim-switch input, .sim-variant-head input[type="checkbox"], .sim-delete-group input {
  width: 1rem; min-width: 1rem; height: 1rem; min-height: 1rem; margin: .1rem 0 0; padding: 0; accent-color: var(--teal);
}
.sim-pick-body { display: grid; gap: .3rem; font-size: .76rem; }
.sim-chip-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.sim-chip-wrap { display: inline-flex; align-items: center; gap: .15rem; }
.sim-chip {
  display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem .7rem; background: none; color: var(--muted); cursor: pointer; font-size: .7rem; font-weight: 600;
}
.sim-chip small { color: var(--faint); }
.sim-chip.on { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--teal); }
.sim-chip.off { opacity: .5; }

/* play buttons */
.sim-play {
  position: relative; flex: none; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%;
  background: var(--ink); color: var(--surface-solid); cursor: pointer;
}
.sim-chip-wrap .sim-play { width: 1.7rem; height: 1.7rem; }
.sim-play::before {
  content: ''; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%);
  border-style: solid; border-width: .32rem 0 .32rem .52rem; border-color: transparent transparent transparent currentColor;
}
.sim-play.playing { background: var(--teal); }
.sim-play.playing::before { left: 50%; width: .5rem; height: .55rem; border: 0; border-left: .17rem solid; border-right: .17rem solid; }
.sim-play:hover { transform: scale(1.06); }
.sim-play-empty { display: inline-grid; place-items: center; background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--faint); cursor: default; font-size: .75rem; }
.sim-play-empty::before { display: none; }

/* voice catalog */
.sim-voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: .6rem; }
.sim-voice {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7rem; align-items: start; padding: .8rem;
  border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--surface-raised) 70%, transparent);
}
.sim-voice.off { opacity: .55; }
.sim-voice-main { display: grid; gap: .25rem; min-width: 0; }
.sim-voice-main strong, .sim-voice-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-voice-main strong { font-size: .8rem; }
.sim-voice-main small { color: var(--faint); font-size: .6rem; }
.sim-voice-controls { grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem; }
.sim-voice-controls select { min-height: 2rem; padding: .25rem .5rem; flex: 1; }
.sim-switch { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.sim-switch input { position: absolute; opacity: 0; }
.sim-switch span {
  width: 2.3rem; height: 1.3rem; border-radius: 999px; background: color-mix(in srgb, var(--muted) 30%, transparent);
  transition: background .2s;
}
.sim-switch span::after {
  content: ''; position: absolute; top: .15rem; left: .15rem; width: 1rem; height: 1rem; border-radius: 50%;
  background: var(--surface-solid); transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.sim-switch input:checked + span { background: var(--teal); }
.sim-switch input:checked + span::after { transform: translateX(1rem); }

/* voice sources */
.sim-source-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; color: var(--muted); font-size: .72rem; font-weight: 600; }
.sim-result-list { display: grid; gap: .1rem; max-height: 34rem; overflow-y: auto; }
.sim-result { display: flex; align-items: center; gap: .7rem; padding: .55rem .2rem; border-bottom: 1px solid var(--line); }
.sim-result-tall { align-items: flex-start; }
.sim-result-main { display: grid; flex: 1; gap: .25rem; min-width: 0; }
.sim-result-main strong { font-size: .76rem; }
.sim-result-main small { color: var(--faint); font-size: .64rem; line-height: 1.45; }
.sim-done { color: var(--teal); font-size: .66rem; font-weight: 700; white-space: nowrap; }
.sim-import { display: flex; gap: .35rem; align-items: center; }
.sim-import select { min-height: 1.9rem; padding: .2rem .4rem; font-size: .66rem; }

/* runs */
.sim-runs { display: grid; gap: .5rem; }
.sim-run { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.sim-run.expanded { border-color: color-mix(in srgb, var(--teal) 40%, var(--line)); }
.sim-run-head {
  display: grid; grid-template-columns: minmax(0, 1fr) 6rem auto auto; align-items: center; gap: 1rem; width: 100%;
  border: 0; padding: .85rem 1rem; background: none; color: var(--ink); cursor: pointer; text-align: left;
}
.sim-run-head:hover { background: color-mix(in srgb, var(--surface-raised) 70%, transparent); }
.sim-run-title { display: grid; gap: .2rem; min-width: 0; }
.sim-run-title strong { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-run-title small { color: var(--faint); font-size: .64rem; }
.sim-run-progress { height: .35rem; border-radius: 999px; background: color-mix(in srgb, var(--muted) 15%, transparent); overflow: hidden; }
.sim-run-progress i { display: block; height: 100%; background: var(--teal); }
.sim-run-score { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.sim-run-score b { color: var(--ink); }
.sim-run-score em { color: var(--coral); font-style: normal; }
.sim-run-body { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--teal) 3%, transparent); }
.sim-run-tools { display: flex; justify-content: flex-end; padding: .5rem 1rem 0; }
.sim-item {
  display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto auto 3.5rem auto; align-items: center; gap: .8rem;
  padding: .75rem 1rem; border-bottom: 1px solid var(--line);
}
.sim-item:last-child { border-bottom: 0; }
.sim-item-seq {
  display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--muted); font-size: .64rem; font-weight: 700;
}
.sim-item-main { display: grid; gap: .3rem; min-width: 0; font-size: .76rem; }
.sim-item-note { color: var(--coral); font-size: .64rem; line-height: 1.4; }
.sim-item-outcome code { font-size: .62rem; color: var(--muted); }
.sim-verdict { justify-self: center; font-size: .66rem; font-weight: 800; color: var(--faint); }
.sim-verdict.pass { color: var(--teal); }
.sim-verdict.fail { color: var(--coral); }
.status-pill.queued, .status-pill.cancelled { background: color-mix(in srgb, var(--muted) 10%, transparent); color: var(--muted); }
.status-pill.completed { background: color-mix(in srgb, var(--teal) 10%, transparent); color: var(--teal); }

/* settings */
.sim-number-list { display: grid; gap: .45rem; margin-bottom: .8rem; }
.sim-number { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; }
.sim-number-main { display: grid; flex: 1; gap: .2rem; min-width: 0; }
.sim-number-main strong { font-size: .86rem; }
.sim-number-main small { overflow: hidden; color: var(--faint); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.sim-meta-list { display: grid; gap: .1rem; }
.sim-meta-list > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .72rem; }
.sim-meta-list > div:last-child { border-bottom: 0; }
.sim-meta-list span { color: var(--faint); font-weight: 600; }
.sim-meta-list code { overflow-wrap: anywhere; font-size: .66rem; }

@media (max-width: 1100px) {
  .sim-split, .sim-split-runs, .sim-split-voices, .sim-split-even { grid-template-columns: minmax(0, 1fr); }
  .sim-list-card { position: static; }
  .sim-list { max-height: 18rem; }
}
@media (max-width: 640px) {
  .sim-row-2, .sim-matchup { grid-template-columns: minmax(0, 1fr); }
  .sim-matchup-arrow { display: none; }
  .sim-kv-row { grid-template-columns: minmax(0, 1fr) auto; }
  .sim-kv-row input:first-child { grid-column: 1 / -1; }
  .sim-run-head { grid-template-columns: minmax(0, 1fr) auto; }
  .sim-run-progress, .sim-run-score { display: none; }
  .sim-item { grid-template-columns: 1.6rem minmax(0, 1fr) auto; }
  .sim-item-outcome, .sim-verdict { display: none; }
  .sim-subnav { border-radius: 16px; }
}
.sim-view input::placeholder, .sim-view textarea::placeholder { font-weight: 400; font-style: italic; }
.sim-voice-controls { justify-content: flex-end; }
.sim-voice-controls select { flex: 0 0 7.5rem; }
.sim-pick-body strong { color: var(--ink); }
.sim-view .sim-hint { font-weight: 400; }
.sim-missing { color: var(--coral); font-size: .62rem; font-weight: 700; white-space: nowrap; }

/* v2v: IVR, exact payloads, evidence */
.sim-panel[data-sim-panel="settings"] { display: grid; gap: 1.2rem; }
.sim-ivr-box { display: grid; gap: .6rem; padding: .8rem; border: 1px dashed color-mix(in srgb, #d48a00 45%, var(--line)); border-radius: 12px; }
.sim-ivr-box[hidden] { display: none; }
.warn-text { color: var(--coral); }
.sim-var-head { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.sim-blank-toggle {
  border: 1px solid var(--line); border-radius: 6px; padding: 0 .3rem; background: none; color: var(--faint);
  cursor: pointer; font-size: .66rem; line-height: 1.3;
}
.sim-blank-toggle:hover { border-color: var(--ink); color: var(--ink); }
.variable-grid label.is-blank .sim-blank-toggle { border-color: var(--coral); background: color-mix(in srgb, var(--coral) 12%, transparent); color: var(--coral); }
.variable-grid label.is-blank input, .variable-grid label.is-blank textarea { border-style: dashed; }
.sim-tag.ivr, .sim-tag.agent-swapchain { background: color-mix(in srgb, #d48a00 16%, transparent); color: #b87600; }
.sim-tag.agent-swapchain { background: color-mix(in srgb, #2f7bf6 14%, transparent); color: #2f6fd6; }
.sim-item-wrap { border-bottom: 1px solid var(--line); }
.sim-item-wrap:last-child { border-bottom: 0; }
.sim-item-wrap .sim-item { border-bottom: 0; }
.sim-evidence-row { display: flex; flex-wrap: wrap; gap: .4rem .9rem; padding: 0 1rem .7rem 3.4rem; }
.sim-evidence { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem; font-size: .64rem; }
.sim-evidence b { margin-right: .2rem; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .56rem; }
.sim-evidence code { padding: .1rem .35rem; border-radius: 5px; background: color-mix(in srgb, var(--muted) 10%, transparent); font-size: .6rem; }
.sim-evidence i { color: var(--faint); font-style: normal; }
.sim-evidence kbd {
  display: inline-grid; place-items: center; min-width: 1.2rem; height: 1.2rem; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 4px; font: 700 .62rem 'DM Mono', monospace;
}
.sim-failures { display: grid; gap: .45rem; padding: 0 1rem .8rem 3.4rem; }
.sim-failure { display: grid; gap: .25rem; padding: .5rem .65rem; border-left: 3px solid var(--coral); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--coral) 6%, transparent); font-size: .66rem; }
.sim-failure strong { color: var(--coral); }
.sim-failure code { font-size: .62rem; overflow-wrap: anywhere; }
.sim-failure pre { margin: .2rem 0 0; white-space: pre-wrap; color: var(--muted); font: .6rem/1.45 'DM Mono', monospace; }
.sim-meta-actions { border-bottom: 0 !important; display: flex !important; justify-content: flex-end; }
.sim-meta-list .sim-tag { margin-left: .3rem; }
@media (max-width: 640px) {
  .sim-evidence-row, .sim-failures { padding-left: 1rem; }
}
.sim-meta-list .sim-tag { white-space: normal; }
.sim-tag.model { background: color-mix(in srgb, #8a4dd6 14%, transparent); color: #7a3fc4; font-family: 'DM Mono', monospace; font-weight: 500; }
.sim-meta-value { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0; min-width: 0; }
.sim-meta-value .sim-tag { margin-left: 0; }
.sim-version-rows { display: grid; gap: .4rem; }
.sim-version-row { grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr); align-items: center; font-weight: 500; }
.sim-version-row span { color: var(--muted); font-size: .7rem; }
.sim-view select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.sim-tag.agent-swapchain_cancel { background: color-mix(in srgb, var(--coral) 14%, transparent); color: var(--coral); }
