/* Training (public/training.js): models, comparisons with the base model, and the stories read side by side. */
.tn-page { display: grid; gap: 22px; min-width: 0; }
.tn-page > .head { margin-bottom: -4px; }
.tn-sec { min-width: 0; }
.tn-sec > h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tn-sec .panel { margin-bottom: 0; }
.tn-page table.cards td.num, .tn-page table.cards th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tn-page table.cards td .sub { color: var(--ink-3); font-size: 12.5px; }
.tn-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 0; }
.tn-fact { display: grid; gap: 4px; min-width: 0; }
.tn-fact-k { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 4px; }
.tn-fact b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* A criterion's mean margin: a bar from the middle, left for the reference, right for the model compared. */
.tn-criteria td:nth-child(2) { width: 40%; min-width: 140px; }
.tn-bar { position: relative; height: 8px; border-radius: 4px; background: var(--field); }
.tn-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.tn-bar-fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.tn-bar-fill.a { background: var(--ink-3); }
.tn-bar-fill.b { background: var(--accent); }
/* An opened prompt: the prompt folded, the stories in columns, the judge's words folded under them. */
.tn-prompts tr.open > td { background: var(--field); }
.tn-prompts tr.tn-open-row > td.tn-open { padding: 4px 18px 20px; background: var(--field); cursor: default; }
.tn-reading { display: grid; gap: 14px; min-width: 0; }
.tn-stories { display: grid; gap: 16px; min-width: 0; }
.tn-stories.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tn-story { min-width: 0; background: var(--surface); border-radius: 12px; box-shadow: var(--ring); padding: 14px 16px; }
.tn-story-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tn-prose { font-size: 14.5px; line-height: 1.6; max-width: 70ch; overflow-wrap: anywhere; }
.tn-prose.small { font-size: 13.5px; }
.tn-brief > summary, .tn-thinking > summary, .tn-judge > summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tn-brief[open] > summary, .tn-thinking[open] > summary, .tn-judge[open] > summary { margin-bottom: 8px; }
.tn-thinking { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.tn-judge-order + .tn-judge-order { margin-top: 12px; }
@media (max-width: 760px) {
  .tn-page table.cards td.num { text-align: left; }
  .tn-facts { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .tn-stories.n2 { grid-template-columns: minmax(0, 1fr); }
  /* On a phone a row is a card of stacked cells: the whole card is tinted, not each cell. */
  .tn-prompts tr.open, .tn-prompts tr.tn-open-row { background: var(--field); }
  .tn-prompts tr.open > td, .tn-prompts tr.tn-open-row > td.tn-open { background: none; }
  .tn-prompts tr.tn-open-row > td.tn-open { padding: 0 0 4px; }
  .tn-criteria td:nth-child(2) { display: none; }
  .tn-criteria th:nth-child(2) { display: none; }
}

/* A chat with one model (#/training/models/ID): its settings in a line, the conversation, and the box to write in under it. */
.tn-chat-cue { margin-left: auto; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.tn-models tr.click:hover .tn-chat-cue { color: var(--ink); }
.tn-chat { gap: 10px; }
.tn-chat-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tn-chat-set { width: auto; min-width: 0; font-size: 13px; padding: 6px 28px 6px 10px; }
.tn-chat-panel { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 12px; margin: 0; min-height: 320px; height: calc(100vh - 250px); max-height: 900px; }
.tn-chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 2px 2px 4px; }
.tn-chat-empty { margin: auto; }
.tn-msg { max-width: min(78ch, 92%); min-width: 0; }
.tn-msg.user { align-self: flex-end; background: var(--field); border-radius: 14px 14px 4px 14px; padding: 9px 13px; }
.tn-msg.user .tn-msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.5; }
.tn-msg.model { align-self: flex-start; }
.tn-msg.model .tn-prose { max-width: none; }
.tn-msg-facts { margin-top: 4px; }
.tn-msg.waiting { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; }
.tn-chat-compose { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.tn-chat-box { width: 100%; min-height: 46px; max-height: 220px; resize: vertical; font: inherit; color: inherit; background: var(--field); border: 1px solid transparent; border-radius: 12px; padding: 11px 13px; line-height: 1.45; }
.tn-chat-note { margin: -2px 0 0; }
@media (max-width: 760px) {
  /* The settings and New chat on one line; the panel ends above the lab's own button at the window's corner. */
  .tn-chat-bar { flex-wrap: nowrap; gap: 6px; }
  .tn-chat-set { font-size: 12.5px; padding: 6px 24px 6px 8px; flex: 0 1 auto; }
  .tn-chat-bar .rb-quiet { white-space: nowrap; margin-left: auto; }
  .tn-chat-panel { padding: 12px 12px 10px; height: calc(100vh - 372px); min-height: 300px; }
  .tn-chat-compose { padding-right: 52px; }
  .tn-msg { max-width: 100%; }
}

/* Reasons beside the scores: what the experiment found, in words; the public benchmark by criterion; what a judge's reasons speak of. */
.tn-findings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; padding: 16px 18px; margin: 0; }
.tn-finding h3 { margin: 0 0 3px; font-size: 14.5px; font-weight: 600; }
.tn-finding p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); max-width: 68ch; }
.tn-stack { display: grid; gap: 10px; min-width: 0; }
/* A panel's own name, inside it and in line with its table's first column, with a quiet note beside it. */
/* All of its rows are shown: it is not one of the lab's long lists that scroll inside their panel. */
.tn-crit-panel { margin: 0; max-height: none; overflow: visible; }
.tn-page .tn-crit-panel table.tn-crit th, .tn-page .tn-crit-panel table.tn-crit td { padding-top: 6px; padding-bottom: 6px; }
.tn-page .tn-crit-panel table.tn-crit { margin-bottom: 6px; }
.tn-panel-title { margin: 0; padding: 14px 20px 2px; font-size: 14.5px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.tn-panel-note { font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.tn-crit td .sub { color: var(--ink-3); font-size: 12.5px; }
.tn-crit td.tn-worse { color: #b3261e; }
.tn-crit td.tn-better { color: #1a7f4b; }
.tn-said { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 760px) {
  .tn-findings { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .tn-panel-title { padding: 12px 16px 2px; }
  .tn-page .tn-crit-panel table.cards.list tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; padding: 7px 16px; }
  .tn-page .tn-crit-panel table.cards.list td { display: block; padding: 0; font-size: 13px; text-align: left; }
  .tn-page .tn-crit-panel table.cards.list td.primary { flex: 1 1 100%; font-size: 14.5px; }
}
