/* TALK playground: recorded answers of the RNA-language model. Builds on /styles.css. */

.talk {
  width: min(1280px, calc(100vw - 2 * var(--gutter)));
  margin: 0 auto;
}

.talk-status {
  padding: 48px 0;
  color: var(--muted);
  text-align: center;
}

.talk:not(.is-ready) .talk-body {
  display: none;
}

.talk.is-ready .talk-status {
  display: none;
}

.talk-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 28px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.talk-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.talk-field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #fff;
}

.seg button {
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.seg button:hover {
  background: var(--surface);
}

.seg button[aria-pressed="true"] {
  color: #fff;
  background: var(--ink);
}

.seg button i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--c);
  vertical-align: 1px;
}

.talk-models-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.talk-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: start;
  gap: 16px;
  margin-top: 16px;
}

.talk-side {
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.talk-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.talk-col > h2 {
  margin: 8px 4px 0;
  font-size: 22px;
}

.talk-map {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--night);
}

.talk-map canvas {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.talk-map figcaption {
  padding: 0 18px 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.talk-map-legend {
  display: flex;
  padding: 14px 18px 0;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.talk-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.talk-map-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
}

.talk-map-legend i.ring {
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  background: transparent;
}

.bubble {
  padding: 18px 20px;
  border-radius: 22px;
  font-size: 15px;
  line-height: 1.6;
}

.bubble-user {
  border-bottom-right-radius: 6px;
  color: #fff;
  background: var(--blue);
}

.bubble-model {
  border-bottom-left-radius: 6px;
  background: var(--surface);
}

.bubble-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
}

.rna-token {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin: 0 3px -2px 1px;
  border-radius: 4px;
  background: var(--c);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85);
}

.talk-head,
.talk-tokens {
  display: block;
}

.talk-tokens {
  margin: 2px 0 10px;
}

.talk-codes {
  margin-top: 10px;
}

.talk-codes summary {
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.85;
}

.talk-codes p {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.9;
}

.talk-prompt-note {
  color: var(--muted);
  font-size: 13px;
}

.talk-panel {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.talk-panel h3 {
  font-size: 15px;
  font-weight: 600;
}

.talk-panel p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.talk-bars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 12px;
}

.talk-bar span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
}

.talk-bar span em {
  color: var(--muted);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.talk-bar i {
  display: block;
  height: 6px;
  margin-top: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--c) var(--w), var(--surface-2) var(--w));
}

.talk-think summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.talk-reasoning {
  max-height: 340px;
  margin-top: 10px;
  overflow-y: auto;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* A color belongs to one claim in context, never to a gene globally. */
.talk-gene-mention,
.talk-verdict {
  --claim-ink: #4b5a65;
  --claim-bg: #e4e8ec;
  color: var(--claim-ink);
  background: var(--claim-bg);
}

.talk-gene-mention.correct,
.talk-verdict.correct {
  --claim-ink: #0b5d45;
  --claim-bg: #d8f5ea;
}

.talk-gene-mention.incorrect,
.talk-verdict.incorrect {
  --claim-ink: #942d24;
  --claim-bg: #fde2dd;
}

.talk-gene-mention.rank_mismatch,
.talk-verdict.rank_mismatch {
  --claim-ink: #745100;
  --claim-bg: #ffedb3;
}

.talk-gene-mention {
  display: inline;
  margin: 0;
  padding: 1px 3px;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  line-height: inherit;
  text-align: inherit;
  cursor: pointer;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.talk-gene-mention:hover,
.talk-gene-mention[aria-expanded="true"] {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.talk-gene-mention:focus-visible,
.talk-evidence-close:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.talk-gene-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.talk-mention-count {
  margin-right: 3px;
}

.talk-verdict {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.talk-gene-evidence {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  line-height: 1.5;
}

.talk-gene-evidence[hidden] {
  display: none;
}

.talk-evidence-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.talk-evidence-heading strong {
  font-size: 15px;
}

.talk-evidence-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -7px -7px -7px auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 21px;
  cursor: pointer;
}

.talk-evidence-claim {
  margin: 10px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.talk-evidence-context {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  max-height: 120px;
  overflow-y: auto;
}

.talk-evidence-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 14px 0 0;
  font-variant-numeric: tabular-nums;
}

.talk-evidence-values dt {
  color: var(--muted);
  font-size: 11px;
}

.talk-evidence-values dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.talk-corpus-values {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.talk-evidence-reason {
  margin: 14px 0 0;
  color: var(--ink-2);
}

.talk-evidence-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.talk-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.talk-answer .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
}

.talk-answer .pill b {
  font-weight: 600;
}

.talk-answer .pill .mark {
  font-weight: 700;
}

.talk-answer .pill.ok .mark {
  color: #0e9f76;
}

.talk-answer .pill.bad .mark {
  color: #d9480f;
}

.talk-truth,
.talk-gene-key,
.talk-run {
  color: var(--muted);
  font-size: 13px;
}


.talk-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.talk-stat {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.talk-stat h3 {
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 600;
}

.talk-stat strong {
  display: block;
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.talk-stat p {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 15px;
}

.talk-stat small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.talk-table {
  margin-top: 16px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--surface);
}

.talk-table summary {
  font-weight: 500;
  cursor: pointer;
}

.talk-table table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.talk-table caption {
  padding: 12px 0 4px;
  text-align: left;
  font-weight: 600;
}

.talk-table th,
.talk-table td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.talk-table p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .talk-stage,
  .talk-stats {
    grid-template-columns: 1fr;
  }

  .talk-side {
    position: static;
  }

  .talk-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .talk-bars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seg button {
    padding: 6px 11px;
  }
}
