/* Each round pairs the customer-facing conversation with its saved business evidence. */
.sj-work {
  --sj-ink: #192a3a;
  --sj-muted: #4d6071;
  --sj-line: #d8e1e7;
  --sj-agent: #164e77;
  --sj-stage: 84px;
  --sj-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  min-width: 0;
  container-type: inline-size;
  color: var(--sj-ink);
  border: 1px solid #cbd6df;
  border-radius: 10px;
  background: #fff;
}

.sj-head, .sj-head-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.sj-head { padding: 10px 16px; }
.sj-round-jump { display: none; }
.sj-head h2, .sj-head p, .sj-round h3, .sj-empty h3 { margin: 0; }
.sj-head h2 { font-size: 18px; line-height: 1.4; }
.sj-head p { margin-top: 1px; font-size: 12px; color: var(--sj-muted); }
.sj-outcome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  padding: 4px 9px;
  border-radius: 5px;
  color: #3f5263;
  background: #f0f3f5;
}
.sj-outcome span { font-size: 12px; font-weight: 600; }
.sj-outcome b { font-size: 14px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.sj-outcome.sj-verified { background: #e9f3ed; color: #215c42; }

.sj-columns, .sj-round, .sj-pair { display: grid; }
.sj-columns {
  grid-template-columns: var(--sj-stage) var(--sj-columns);
  background: #f5f7f9;
  border-block: 1px solid var(--sj-line);
  color: #475d6e;
  font-size: 12px;
  font-weight: 650;
}
.sj-columns > span { padding: 4px 12px; }
.sj-thread, .sj-changes { margin: 0; padding: 0; list-style: none; }
.sj-round {
  grid-template-columns: var(--sj-stage) minmax(0, 1fr);
  overflow-wrap: anywhere;
  scroll-margin-top: 108px;
}
.sj-round + .sj-round, .sj-pair + .sj-pair { border-top: 1px solid var(--sj-line); }
.sj-round-head {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px 0 6px 12px;
}
.sj-index {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #cbd6dc;
  border-radius: 50%;
  color: #485e6d;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.sj-round-head h3 { font-size: 13px; line-height: 1.45; font-weight: 650; }
.sj-round-body { display: flex; flex-direction: column; min-width: 0; }
.sj-pair { grid-template-columns: var(--sj-columns); flex: 1; }

.sj-exchange {
  display: flex;
  flex-direction: column;
  align-self: center;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
  padding: 6px 14px 6px 10px;
  gap: 4px;
}
.sj-pair:has(> .sj-after) > .sj-exchange:first-child { padding-bottom: 0; align-self: end; }
.sj-exchange.sj-after { grid-row: 2; padding-top: 4px; align-self: start; }
.sj-message {
  display: flex;
  align-items: baseline;
  gap: 6px;
  align-self: flex-start;
  width: fit-content;
  max-width: min(93%, 46em);
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}
.sj-message.sj-agent { align-self: flex-end; flex-direction: row-reverse; }
.sj-role { flex: none; font-size: 12px; color: #66563d; font-weight: 650; }
.sj-agent .sj-role { color: #235980; }
.sj-text {
  min-width: 0;
  padding: 3px 9px 4px;
  border-radius: 2px 10px 10px 10px;
  color: #312e27;
  background: #f3efe6;
  box-shadow: inset 0 0 0 1px #e8e1d5;
}
.sj-agent .sj-text { border-radius: 10px 2px 10px 10px; background: #e4f0f9; color: #153e5e; box-shadow: inset 0 0 0 1px #d5e6f3; }

.sj-action {
  align-content: center;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 7px 14px;
  border-inline-start: 1px solid var(--sj-line);
  background: #f8fafb;
}
.sj-round:last-child .sj-pair:last-child > .sj-action { border-bottom-right-radius: 9px; }
.sj-pair:has(> .sj-after) > .sj-action { grid-row: 1 / span 2; }
.sj-action-label { color: #3f5969; font-size: 12px; font-weight: 650; }
.sj-action-body { min-width: 0; color: var(--sj-muted); font-size: 13px; line-height: 1.45; }
.sj-action-text, .sj-source, .sj-retained, .sj-actions { margin: 0; }
.sj-action-text { color: #344b5d; }
.sj-changes { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 2px 0; }
.sj-changes li { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; }
.sj-field { color: #475e6e; }
.sj-value { color: var(--sj-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.sj-former { color: #5a6c79; font-weight: 450; }
.sj-replaced .sj-value strong { background: #dcecf9; color: #173f62; border-radius: 3px; padding-inline: 3px; }
.sj-source { display: inline; margin-right: 8px; }
.sj-actions { padding-inline-start: 16px; }
.sj-actions li::marker { color: #667785; font-size: 11px; }
.sj-actions b { margin-right: 6px; color: var(--sj-ink); font-weight: 600; }
.sj-receipt { font-variant-numeric: tabular-nums; }
.sj-receipt.sj-attention { color: #804c09; font-weight: 600; }
.sj-receipt.sj-unsuccessful { color: #933c36; font-weight: 600; }
.sj-evidence {
  display: inline;
  margin: 0;
  padding: 1px 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--sj-agent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #a7c0d4;
  text-underline-offset: 3px;
}
.sj-evidence:hover, .sj-evidence:focus-visible { color: #0e3a5c; text-decoration-color: currentColor; }
.sj-empty { padding: 16px; border: 1px solid #dbe2eb; border-radius: 8px; background: white; }
.sj-empty p { margin: 3px 0 0; }

@container (min-width: 641px) {
  .sj-action-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@container (min-width: 641px) and (max-width: 840px) {
  .sj-columns, .sj-round { --sj-stage: 70px; --sj-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
  .sj-round-head, .sj-columns > span, .sj-exchange, .sj-action { padding-inline: 8px; }
}
@container (max-width: 640px) {
  .sj-head { padding: 9px 10px; gap: 6px; }
  .sj-head-main { gap: 5px 10px; }
  .sj-head-main .sj-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
  .sj-round-jump {
    display: inline-block;
    width: auto;
    max-width: 100%;
    min-height: 36px;
    margin: 0;
    padding: 4px 5px;
    border: 1px solid #adbfcc;
    border-radius: 4px;
    background-color: #fff;
    color: #174a6a;
    font: inherit;
    font-size: 13px;
  }
  .sj-columns { display: none; }
  .sj-round { display: block; padding: 8px 10px; }
  .sj-round:first-child { border-top: 1px solid var(--sj-line); }
  .sj-round-head { display: flex; align-items: center; gap: 6px; padding: 0 0 5px; }
  .sj-round-head h3 { font-size: 13px; }
  .sj-pair { display: block; }
  .sj-pair + .sj-pair { margin-top: 6px; padding-top: 6px; }
  .sj-exchange, .sj-exchange.sj-after { padding: 0; }
  .sj-exchange.sj-after { margin-top: 4px; }
  .sj-role { font-size: 12px; }
  .sj-message { max-width: 94%; }
  .sj-action {
    margin-top: 5px;
    padding: 4px 7px;
    border-inline-start: 2px solid #a7bac6;
    border-radius: 0;
  }
  .sj-round:last-child .sj-pair:last-child > .sj-action { border-radius: 0; }
  .sj-action-label { margin-right: 6px; }
  .sj-action-label, .sj-action-body, .sj-action-text { display: inline; }
  .sj-action-body > .sj-actions:first-child { display: inline-block; vertical-align: top; }
  .sj-evidence { display: inline-flex; align-items: center; min-height: 26px; }
}

@container (min-width: 960px) {
  .sj-message { font-size: 15px; line-height: 1.48; }
  .sj-action-body { font-size: 14px; line-height: 1.5; }
}

@media (min-width: 1000px) and (max-height: 800px) {
  @container (min-width: 850px) {
    .sj-head { padding-block: 5px; }
    .sj-head .sj-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; }
    .sj-columns > span { padding-block: 2px; }
    .sj-round-head { padding-block: 6px; }
    .sj-exchange { padding-block: 3px; gap: 3px; }
    .sj-exchange.sj-after { padding-top: 3px; }
    .sj-text { padding-block: 2px; }
    .sj-action { padding-block: 3px; }
    .sj-changes { margin-block: 1px; }
  }
}
