/* Content-led notebook encounters. Existing room tokens own every colour. */
html body #chapters .notebook-encounter {
  width: calc(100% - 48px); max-width: var(--layout-max,1440px);
  margin: 32px auto 48px; color: var(--room-ink); background: var(--room-ground);
  font-family: var(--body); font-size: 1.375rem; line-height: 1.5;
  display: grid; gap: 24px; min-width: 0;
}
html body #chapters .notebook-encounter p { color: inherit; }
html body #chapters .notebook-label { font-size: 1rem; margin: 0 0 16px; }
html body #chapters .notebook-context h3 { font: 600 2rem/1.15 var(--body); color: inherit; margin: 0 0 16px; }
html body #chapters .notebook-bridge { font-size: 1.375rem; max-width: 42ch; margin: 0; }
html body #chapters .notebook-story { min-width: 0; align-self: start; }
html body #chapters .notebook-story > summary { cursor: pointer; padding: 16px 0; font-size: 1rem; color: inherit; display: flex; justify-content: space-between; gap: 16px; min-height: 48px; }
html body #chapters .notebook-story > summary::marker { content: ''; }
html body #chapters .notebook-story[open] > summary > span:last-child { transform: rotate(45deg); }
html body #chapters .notebook-story-body { padding: 24px; background: var(--study-field); color: var(--study-ink); }
html body #chapters .notebook-passage { margin: 0 0 24px; font-size: 1.375rem; max-width: 48ch; }
html body #chapters .notebook-source, html body #chapters .notebook-cinema, html body #chapters .notebook-voice-label { font-size: 1rem; line-height: 1.55; margin: 24px 0 0; overflow-wrap: anywhere; }
html body #chapters .notebook-source a { color: inherit; text-decoration: underline; text-underline-offset: .2em; }
html body #chapters .notebook-film-margin { margin-top: 32px; }
html body #chapters .notebook-story audio { width: 100%; max-width: 100%; margin-top: 16px; }
html body #chapters .notebook-experiment { grid-column: 1 / -1; margin: 0; min-width: 0; }
html body #chapters .experiment-stage { min-height: 180px; margin-bottom: 16px; overflow: hidden; }
html body #chapters .notebook-experiment figcaption { font-size: 1.375rem; max-width: 48ch; }
html body #chapters .experiment-toggle { border: 0; border-radius: 0; box-shadow: none; background: var(--room-ink); color: var(--room-ground); font: inherit; font-size: 1rem; min-height: 48px; padding: 12px 20px; margin-top: 16px; cursor: pointer; }
html body #chapters .experiment-result, html body #chapters .experiment-fact { font-size: 1rem; margin: 16px 0 0; }
html body #chapters .experiment-result:empty { margin: 0; }
html body #chapters .context-plates { display: grid; grid-template-columns: 3fr 4fr; }
html body #chapters .context-plates > div { display: grid; place-items: center; background: var(--pair-field); padding: 48px 24px; }
html body #chapters .context-plates > div + div { background: var(--artifact-field); }
html body #chapters .context-plates i { width: 64px; height: 64px; background: var(--experiment-chip); }
html body #chapters .experiment-context.is-changed .context-plates > div { background: var(--room-ground); }
html body #chapters .serial-plates { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; }
html body #chapters .serial-plates > span { padding: 16px 8px; min-width: 0; overflow-wrap: anywhere; font: 600 2rem/1.2 var(--body); background: var(--pair-field); color: var(--pair-ink); }
html body #chapters .serial-plates > span:nth-child(3n+2) { background: var(--study-field); color: var(--study-ink); }
html body #chapters .serial-plates > span:nth-child(3n) { background: var(--artifact-field); color: var(--artifact-ink); }
html body #chapters .experiment-repeat.is-changed .serial-plates > span:not(:first-child),
html body #chapters .experiment-subtract.is-changed .serial-plates > span:not(:first-child) { visibility: hidden; }
html body #chapters .experiment-subtract .serial-plates { grid-template-columns: repeat(7,minmax(0,1fr)); min-height: 200px; }
html body #chapters .experiment-subtract .serial-plates > span { font-size: 1rem; writing-mode: vertical-rl; padding: 24px 8px; }
html body #chapters .label-plates { display: grid; grid-template-columns: 2fr 5fr; background: var(--pair-field); color: var(--pair-ink); }
html body #chapters .label-plates p { margin: 0; padding: 24px 16px; display: grid; align-content: center; font-size: 2rem; }
html body #chapters .label-plates .frame-person { background: var(--study-field); color: var(--study-ink); visibility: hidden; }
html body #chapters .experiment-frame.is-changed .frame-person { visibility: visible; }
html body #chapters .fragment-plates { display: grid; grid-template-columns: 3fr 2fr; }
html body #chapters .fragment-plates p { margin: 0; padding: 24px 16px; background: var(--study-field); color: var(--study-ink); font-size: 1rem; }
html body #chapters .fragment-plates p:nth-child(2) { background: var(--artifact-field); color: var(--artifact-ink); visibility: hidden; }
html body #chapters .fragment-plates p:nth-child(3) { grid-column: 1 / -1; background: var(--pair-field); color: var(--pair-ink); visibility: hidden; }
html body #chapters .experiment-fragment.is-changed .fragment-plates p { visibility: visible; }
html body #chapters .yield-plates { display: grid; grid-template-columns: 2fr 3fr; background: var(--pair-field); color: var(--pair-ink); }
html body #chapters .yield-plates p { padding: 24px 16px; margin: 0; font-size: 1.375rem; }
html body #chapters .yield-plates > span { background: var(--pair-companion); }
html body #chapters .experiment-yield.is-changed .yield-plates { grid-template-columns: 6fr 1fr; }
html body #chapters .notebook-encounter [data-lang="th"] { font-family: 'IBM Plex Sans Thai',sans-serif; letter-spacing: 0; }
html body #chapters .notebook-encounter [data-lang="cn"] { font-family: 'Noto Sans SC',sans-serif; letter-spacing: 0; }
html body #chapters .notebook-encounter :focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
@media (min-width:768px) {
  html body #chapters .notebook-encounter { width: calc(100% - 80px); grid-template-columns: minmax(0,3fr) minmax(0,2fr); gap: 32px; margin-top: 48px; }
  html body #chapters [data-composition="current"] .notebook-encounter { grid-template-columns: minmax(0,2fr) minmax(0,3fr); }
  html body #chapters [data-composition="stillness"] .notebook-encounter { max-width: 58ch; grid-template-columns: 1fr; }
  html body #chapters .experiment-stage { min-height: 220px; }
  html body #chapters .serial-plates { grid-template-columns: repeat(4,minmax(0,1fr)); }
  html body #chapters .serial-plates > span { padding: 24px; }
  html body #chapters .experiment-subtract .serial-plates > span { padding: 24px 16px; }
  html body #chapters .context-plates i { width: 96px; height: 96px; }
}
@media print {
  html body #chapters .experiment-toggle, html body #chapters .notebook-audio-slot { display: none; }
  html body #chapters .notebook-encounter { break-inside: avoid; }
}
