
:root {
  --paper: #fafafa;
  --ink: #202020;
  --secondary: #454545;
  --line: #e5e5e5;
  --blue: #376987;
  --blue-light: #e4f0f8;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Arial, sans-serif;
  /* Five type sizes shared by desktop and mobile. */
  --small: 14px;
  --body: 16px;
  --lead: 18px;
  --heading: 22px;
  --title: 28px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: var(--body)/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button, select, input[type=range] { cursor: pointer; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--blue); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 5px; }
::selection { background: var(--blue-light); }
h1, h2, h3, blockquote { font-family: var(--serif); font-weight: 400; }
h1 { font-size: var(--title); line-height: 1.3; letter-spacing: -.7px; margin: 0 0 21px; }
h1, h2, h3 { font-family: var(--sans); font-style: normal; font-weight: 600; }
h2 { font-size: var(--heading); line-height: 1.25; letter-spacing: -.35px; margin: 0 0 22px; }
h3 { font-size: var(--lead); line-height: 1.3; margin: 0 0 12px; }
p { margin: 0 0 16px; }
sup { font-size: var(--small); line-height: 0; margin-left: 3px; }
sup a { color: var(--blue); text-decoration: none; padding: 3px; }
.skip { position: fixed; top: -100px; left: 24px; padding: 10px 16px; background: white; z-index: 10; font-size: var(--small); }
.skip:focus { top: 12px; }
.reading-layout { max-width: 1400px; margin: auto; padding: 62px 32px 48px; display: grid; grid-template-columns: 170px minmax(0, 1fr) 210px; gap: 0 40px; }
.contents { position: fixed; top: 50%; left: max(32px, calc((100vw - 1400px) / 2 + 32px)); width: 170px; transform: translateY(-50%); max-height: calc(100dvh - 48px); overflow-y: auto; }
.contents a { position: relative; display: block; padding: 8px 0 8px 14px; font-size: var(--small); line-height: 1.4; color: var(--secondary); text-decoration: none; }
.contents a::before { content: ''; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); transform: translateY(-50%); opacity: 0; }
.contents a.active { color: var(--blue); }
.contents a.active::before { opacity: 1; }
.hero, .article-section { grid-column: 2; min-width: 0; }
.hero { grid-row: 1; position: relative; isolation: isolate; padding-bottom: 58px; }
.hero::before { content: ''; position: absolute; inset: -32px -32px 24px; z-index: -1; border-radius: 6px; background: linear-gradient(135deg, #e3eff9 0%, #eff6fc 60%, var(--paper) 100%); pointer-events: none; }
.deck { color: var(--secondary); margin-bottom: 17px; }
.authors { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px 20px; list-style: none; padding: 0; margin: 0; font-size: var(--small); line-height: 1.4; }
.author-name { display: block; font-weight: 500; }
.author-affiliation { display: block; margin-top: 4px; color: var(--secondary); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 27px; }
.action { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 42px; padding: 8px 13px; border: 1px solid #d9d9d9; border-radius: 3px; background: white; font-size: var(--small); line-height: 1.4; text-decoration: none; }
.action:hover { border-color: var(--blue); color: var(--blue); }
#conference { font-weight: 700; }
.action svg { width: 16px; height: 16px; }
.narration-play { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.narration-play[aria-pressed=true] { border-color: #bfd4e2; color: var(--blue); }
.article-section { padding-bottom: 52px; }
.article-section + .margin-note { margin-bottom: 35px; }
.highlight { font-family: var(--serif); background: var(--blue-light); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.prompt { padding: 17px 20px; background: #f6f6f6; border-radius: 3px; margin: 26px 0; }
.prompt h3 { font-family: var(--sans); font-size: var(--small); margin-bottom: 7px; }
.prompt p { margin: 0; }
.margin-note { grid-column: 3; align-self: start; padding-top: 9px; font-size: var(--small); line-height: 1.55; color: var(--secondary); }
.margin-note h3 { font-size: var(--body); color: var(--ink); margin-bottom: 9px; }
.margin-note p { margin: 0; }
.figure { margin: 28px 0; padding: 25px; border: 1px solid var(--line); border-radius: 3px; }
.figure, .chat-comparison { background: white; }
.figure > p { font-size: var(--small); line-height: 1.55; color: var(--secondary); margin-bottom: 23px; }
.control-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: var(--small); line-height: 1.4; margin-bottom: 16px; }
.figure-controls { border-top: 1px solid var(--line); padding-top: 22px; }
#coefficient { font-variant-numeric: tabular-nums; }
.range { display: block; width: 100%; height: 6px; margin: 15px 0; accent-color: var(--blue); }
.range-labels { display: flex; justify-content: space-between; gap: 12px; font-size: var(--small); line-height: 1.4; margin-bottom: 24px; }
.range-labels span:nth-child(2) { color: var(--secondary); }
.scenario { font-size: var(--small); padding: 8px; background: white; border: 1px solid #d9d9d9; border-radius: 3px; max-width: 100%; }
.response { margin: 0; padding: 0; }
.response-label { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: var(--small); line-height: 1.4; color: var(--secondary); }
.response blockquote { margin: 12px 0 0; font-size: var(--lead); line-height: 1.45; min-height: 98px; }
.figure figcaption { margin-top: 23px; font-size: var(--small); line-height: 1.5; color: var(--secondary); }
.extraction-flow { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1.4fr) 18px minmax(0, 1.4fr) 18px minmax(0, 1.2fr); align-items: center; gap: 10px; font-size: var(--small); line-height: 1.4; }
.extraction-source { padding: 18px 12px; background: #f6f6f6; border-radius: 6px; text-align: center; font-family: var(--serif); font-size: var(--body); }
.extraction-arrow { text-align: center; color: var(--secondary); font-size: var(--lead); }
.extraction-arrow::before { content: '→'; }
.extraction-stage { display: grid; gap: 8px; text-align: center; }
.extraction-role { padding: 9px 8px; border-radius: 6px; }
.extraction-user { background: #e8f1fa; }
.extraction-assistant { background: #f8eae7; }
.extraction-note { color: var(--secondary); }
.extraction-result { display: grid; gap: 8px; padding: 16px 10px; border: 1px solid #d5e5ef; border-radius: 6px; text-align: center; }
.extraction-result strong { font-family: var(--serif); font-size: var(--body); font-weight: 500; }
@media (max-width: 1100px) {
  .extraction-flow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .extraction-source { padding: 8px; }
  .extraction-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .extraction-role { padding: 6px 8px; }
  .extraction-note { grid-column: 1 / -1; }
  .extraction-arrow::before { content: '↓'; }
  .extraction-arrow { line-height: 1; }
  .extraction-result { padding: 8px; gap: 4px; }
}
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 11px 18px; background: var(--ink); color: white; border-radius: 3px; font-size: var(--small); z-index: 20; }
.toast:empty { display: none; }
dialog { border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--ink); padding: 28px; max-width: 450px; width: calc(100% - 40px); }
dialog::backdrop { background: #00000040; }
dialog h2 { margin-top: 0; padding-right: 26px; }
dialog p { margin-bottom: 0; }
dialog input { display: block; width: 100%; margin-top: 18px; padding: 10px; font-size: var(--small); border: 1px solid #d9d9d9; border-radius: 3px; background: white; }
dialog input[hidden] { display: none; }
.dialog-close { float: right; width: 30px; height: 30px; padding: 0; font-size: var(--lead); line-height: 1; background: white; border: 0; }
@media (max-width: 1100px) {
  .reading-layout { grid-template-columns: 155px minmax(0, 1fr) 185px; gap: 0 28px; padding: 48px 28px; }
  .contents { left: 28px; width: 155px; }
  .hero::before { left: -28px; right: -28px; }
}
@media (max-width: 900px) {
  .reading-layout { grid-template-columns: 150px minmax(0, 1fr); max-width: 800px; }
  .contents { left: max(28px, calc((100vw - 800px) / 2 + 28px)); width: 150px; }
  .hero, .article-section, .margin-note { grid-row: auto !important; }
  .margin-note { grid-column: 2; padding: 0 0 0 15px; border-left: 1px solid var(--line); margin-bottom: 38px; }
  .article-section { padding-bottom: 20px; }
  .hero { padding-bottom: 46px; }
}
@media (max-width: 600px) {
  .reading-layout { display: flex; flex-direction: column; padding: 48px 30px 38px; }
  .contents { display: none; }
  .hero { padding-top: 20px; padding-bottom: 40px; }
  .hero::before { inset: -20px -18px 16px; }
  .narration-play { margin-left: 0; }
  .figure { padding: 20px 17px; }
  .range-labels span:nth-child(2):not(:last-child) { display: none; }
  .margin-note { align-self: stretch; }
  .response blockquote { min-height: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *:before, *:after { transition: none !important; }
}

/* Article rows retain the template’s article-and-margin composition. */
#problem, #note-problem { grid-row: 2; }
#method, #note-method { grid-row: 3; }
#direction, #note-direction { grid-row: 4; }
#realism, #note-realism { grid-row: 5; }
#activation, #note-activation { grid-row: 6; }
#citation, #note-citation { grid-row: 7; }

.article-section > :last-child { margin-bottom: 0; }
.margin-note a { text-decoration-color: #b8b8b8; }
.margin-note .note-entry + .note-entry, .margin-note > .note-entry { margin-top: 24px; }
.margin-note .note-entry p + p, .margin-note > p + p { margin-top: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; }
.pill { padding: 6px 12px; border: 1px solid #dedede; border-radius: 999px; background: white; font-size: var(--small); line-height: 1.4; }
.pill[aria-pressed=true] { background: var(--blue-light); border-color: #bfd4e2; color: var(--blue); }
.pill:hover { border-color: var(--blue); }
button:disabled, input:disabled, select:disabled { cursor: default; opacity: .55; }
.caption, .data-link { font-size: var(--small); line-height: 1.5; color: var(--secondary); }
.caption { margin: 12px 0 0; }
.table-wrap { overflow-x: auto; max-width: 100%; margin: 24px 0; }
table { border-collapse: collapse; width: 100%; font-size: var(--small); line-height: 1.55; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-size: var(--small); color: var(--secondary); line-height: 1.5; margin: 0 0 12px; }
th, td { padding: 11px 10px; text-align: right; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-weight: 500; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
thead th { border-bottom-color: #bfbfbf; }
tbody th { text-align: left; font-weight: 400; padding-left: 0; }
tbody tr[data-selected=true] { background: #f0f7fb; }
.direction-label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; background: #f6f6f6; }
.chat-comparison { margin: 24px 0; padding: 25px; border: 1px solid var(--line); border-radius: 3px; }
.chat-thread { display: flex; min-width: 0; flex-direction: column; gap: 12px; }
.chat-bubble { width: fit-content; padding: 14px 16px; margin: 0; line-height: 1.55; border-radius: 12px; }
.chat-instruction { align-self: flex-end; max-width: 72%; background: #f1f3f5; border-bottom-right-radius: 3px; font-size: var(--body); }
.chat-response-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: start; gap: 10px; }
.chat-avatar { display: block; width: 56px; height: 56px; object-fit: contain; }
.chat-response { justify-self: start; max-width: 84%; border-bottom-left-radius: 3px; font-size: var(--small); }
.chat-response .direction-label { display: inline; font-family: var(--serif); line-height: inherit; padding: 0 8px; margin-right: 6px; white-space: nowrap; }
.user-response { background: #f2f7fc; }
.unsteered-response { background: #f6f6f6; }
.assistant-response { background: #fcf4f3; }
.user-response .direction-label { background: #dceaf7; }
.unsteered-response .direction-label { background: #e7e7e7; }
.assistant-response .direction-label { background: #f3deda; }
.chat-comparison figcaption { margin-top: 2px; font-size: var(--small); line-height: 1.5; color: var(--secondary); }
details.explanation { margin: 25px 0; }
details.explanation > summary { font-size: var(--small); cursor: pointer; text-underline-offset: 4px; }
details.explanation[open] > summary { margin-bottom: 18px; }
.topic-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 20px; font-size: var(--small); }
.topic-controls .pills { align-items: center; margin: 0; }
.response-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.response-text { width: fit-content; max-width: 94%; padding: 14px 16px; border-radius: 12px 12px 12px 3px; background: #f6f6f6; font-size: var(--body); line-height: 1.6; white-space: pre-wrap; margin: 12px 0 0; }
.response[data-direction="user"] .response-text { background: #f2f7fc; }
.response[data-direction="assistant"] .response-text { background: #fcf4f3; }
.response[data-direction="user"] .direction-label { background: #dceaf7; }
.response[data-direction="assistant"] .direction-label { background: #f3deda; }
.response-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: var(--small); color: var(--secondary); margin: 10px 0 0; }
.check-control { display: flex; align-items: center; gap: 9px; font-size: var(--small); line-height: 1.4; }
.check-control input { width: 16px; height: 16px; accent-color: var(--blue); margin: 0; }
.response[hidden], [hidden] { display: none !important; }
.realism-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 23px 0; }
.realism-summary dt { font-size: var(--small); color: var(--secondary); line-height: 1.4; }
.realism-summary dd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; font-family: var(--serif); font-size: var(--lead); }
.score-change { font-family: var(--sans); font-size: var(--small); color: var(--secondary); font-variant-numeric: tabular-nums; }
.score-change[data-increased=true] { color: #527761; }
.behavior-value { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.real-user-pill { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; background: #f1f2f3; color: var(--secondary); white-space: nowrap; }
.behavior-heading { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 24px; }
.behavior-bars { margin-top: 20px; }
.behavior-row { margin-bottom: 19px; }
.behavior-label { display: flex; justify-content: space-between; gap: 15px; font-size: var(--small); line-height: 1.4; margin-bottom: 9px; }
.behavior-rail { position: relative; height: 12px; background: #f0f0f0; border-radius: 2px; }
.behavior-fill { display: block; height: 100%; border-radius: 2px; background: #9bb5a9; transition: width .2s; }
.behavior-reference { position: absolute; top: -4px; height: 20px; border-left: 2px solid var(--ink); }
.behavior-row:nth-child(2) .behavior-fill { background: #b2a6c5; }
.behavior-row:nth-child(3) .behavior-fill { background: #c6a397; }
.behavior-row:nth-child(4) .behavior-fill { background: #94b2c5; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--small); color: var(--secondary); line-height: 1.4; margin-top: 22px; }
.chart-legend span { display: flex; align-items: center; gap: 7px; }
.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #9bb5a9; }
.reference-swatch { display: inline-block; height: 14px; width: 2px; background: var(--ink); }
.select-control { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: var(--small); margin: 0 0 18px; padding: 0; }
.select-control > .check-control { margin-left: auto; }
.select-control select { max-width: 100%; min-width: 0; font-size: var(--small); padding: 7px; background: white; border: 1px solid #d9d9d9; border-radius: 3px; }
.plot-wrap { position: relative; margin-top: 20px; }
#activation-plot { display: block; width: 100%; height: 300px; touch-action: pan-y; }
.plot-axis-label { font-size: var(--small); line-height: 1.4; color: var(--secondary); margin: 14px 0 4px; }
.plot-axis-label.x { text-align: center; margin-top: 4px; }
.plot-tooltip { position: absolute; padding: 10px 12px; max-width: 230px; font-size: var(--small); line-height: 1.4; background: white; border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 4px 15px #00000012; pointer-events: none; z-index: 2; }
.plot-tooltip span { display: block; margin-top: 4px; color: var(--secondary); }
.figure > .point-description { margin: 10px 0 0; }
.condition-key { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; font-size: var(--small); line-height: 1.4; }
.condition-key span { display: inline-flex; align-items: center; gap: 6px; }
.condition-key i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.correlation-table { min-width: 510px; }
.correlation-table caption::before { content: ''; display: block; width: 48px; height: 1px; background: var(--line); margin-bottom: 12px; }
.correlation-table .controlled { color: var(--secondary); }
.correlation-table.length-controlled .controlled { background: #f0f7fb; color: var(--ink); }
.citation-box { position: relative; margin: 23px 0 20px; background: white; }
.bibtex { padding: 18px 20px; white-space: pre-wrap; overflow-wrap: anywhere; font: var(--small)/1.55 var(--sans); margin: 0; }
.bibtex-start { display: inline-block; max-width: 100%; padding-right: 70px; box-sizing: border-box; }
.citation-copy { position: absolute; top: 12px; right: 12px; min-height: 30px; padding: 4px 10px; }
.figure .error { margin: 16px 0; font-size: var(--small); color: var(--secondary); }
.not-found { max-width: 600px; padding: 70px 30px; margin: auto; }
@media (max-width: 600px) {
  .chat-comparison { padding: 20px 17px; }
  .chat-instruction { max-width: 90%; }
  .chat-response-row { grid-template-columns: 48px minmax(0, 1fr); gap: 8px; }
  .chat-avatar { width: 48px; height: 48px; }
  .chat-response { max-width: 100%; }
  .realism-summary { gap: 8px; }
  .select-control > .check-control { margin-left: 0; }
  #activation-plot { height: 280px; }
  .pills { gap: 7px; }
  .pill { padding: 6px 10px; }
  .figure .range-labels { gap: 10px; }
  .behavior-label { flex-wrap: wrap; gap: 6px; }
  .table-wrap { margin: 20px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .behavior-fill { transition: none; }
}
