/* Layout: a lab record. A plain statement of the result, a table of attempts, then before-and-after pairs read like a diff. */
:root {
  --bg: #eef1ee; --sheet: #fbfcfa; --fg: #17211d; --muted: #566660; --line: #cdd6d1;
  --before: #1d5f8a; --after: #a8421f; --warn-bg: #f6ead2; --warn-fg: #694a0c; --tint: #e5ebe7;
  --display: "Fraunces", Georgia, serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #111815; --sheet: #18211d; --fg: #e8efeb; --muted: #9dafa7; --line: #2d3a34;
  --before: #7fbde6; --after: #f09a76; --warn-bg: #3a2e12; --warn-fg: #ecd18c; --tint: #212c27; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #111815; --sheet: #18211d; --fg: #e8efeb; --muted: #9dafa7; --line: #2d3a34;
  --before: #7fbde6; --after: #f09a76; --warn-bg: #3a2e12; --warn-fg: #ecd18c; --tint: #212c27; color-scheme: dark;
}
/* Three text levels. --fg, the brightest, is only for headings, bold lead-ins, panel titles and each example's prompt.
   --text is for primary reading text: paragraphs, table cells and the model's replies. --muted is for secondary material:
   the side panels, captions, the formula guide and explanatory lists. */
:root { --text: #2c3a34; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --text: #c3d1ca; } }
:root[data-theme="dark"] { --text: #c3d1ca; }
body { background: var(--bg); color: var(--text); font: 400 1rem/1.5 var(--body); }
h1, h2, h3, strong, b, summary, dt, .prompt, tr.final td, .formula { color: var(--fg); }
.wrap { box-sizing: border-box; max-width: 900px; margin: 0 auto; padding-block: 32px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 28px; }
h1 { margin: 0; font: 600 clamp(2rem, 6vw, 3.1rem)/1.05 var(--display); text-wrap: balance; }
h2 { margin: 0; font: 600 1.35rem/1.2 var(--display); text-wrap: balance; }
p { margin: 0; max-width: 68ch; }
section { display: grid; gap: 12px; min-width: 0; }
/* The reading column: headings and paragraphs sit in one column, centred on the same axis as the full-width panels, tables
   and examples, so all their left edges line up. Text inside panels uses the panel's full width. */
:root { --measure: 40rem; }
header > *, section > :is(h2, p) { max-width: var(--measure); margin-inline: auto; width: 100%; }
.fold p { max-width: none; }
.lede { font-size: 1.08rem; margin-top: 10px; }
.notice { background: var(--warn-bg); color: var(--warn-fg); padding: 10px 14px; font-weight: 600; max-width: none; }
.muted { color: var(--muted); }
.table-box { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 .72rem var(--mono); letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
tr.final td { background: var(--tint); font-weight: 600; }
code { font: 400 .88em var(--mono); }
.formula { font: 400 .92rem var(--mono); background: var(--tint); padding: 10px 14px; overflow-x: auto; white-space: nowrap; }
.pairs { display: grid; gap: 10px; }
.pair { background: var(--sheet); border: 1px solid var(--line); padding: 10px 14px; display: grid; gap: 8px; min-width: 0; }
.prompt { font: 500 .86rem var(--mono); overflow-wrap: anywhere; }
.prompt small { font: 400 .72rem var(--mono); color: var(--muted); margin-left: 6px; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .columns { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.side { min-width: 0; font-size: .92rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.side b { display: block; font: 500 .7rem var(--mono); letter-spacing: .04em; margin-bottom: 2px; }
.side.before b { color: var(--before); }
.side.after b { color: var(--after); }
mark { background: none; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; color: inherit; }
.flag { font-size: .84rem; background: var(--warn-bg); color: var(--warn-fg); padding: 6px 10px; }
details { background: var(--sheet); border: 1px solid var(--line); padding: 10px 14px; }
summary { cursor: pointer; font-weight: 600; }
summary:focus-visible { outline: 2px solid var(--before); outline-offset: 2px; }
details[open] .pairs { margin-top: 12px; }
details .pair { background: var(--bg); }
a { color: var(--before); }
#attempts th[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.column-key { margin: 8px 0 14px; font-size: .9rem; }
.column-key summary { cursor: pointer; color: var(--muted); }
.column-key dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0 0; }
.column-key dt { font-weight: 600; }
.column-key dd { margin: 0; color: var(--muted); }
@media (max-width: 640px) { .column-key dl { grid-template-columns: 1fr; gap: 2px; } .column-key dd { margin-bottom: 8px; } }
.aside { background: var(--sheet); border: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 6px; min-width: 0; }
.aside h3 { margin: 0; font: 600 1rem/1.3 var(--body); }
.aside p, .aside li { color: var(--muted); }
.aside p { max-width: none; }
.aside strong { color: var(--fg); }
.aside ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.formula-key { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.formula-key strong { color: var(--fg); font-family: var(--mono); font-weight: 500; }
.formula-key li:last-child strong { font-family: inherit; font-weight: 600; }
.steps-list { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.steps-list li { color: var(--muted); }
/* The folded explanation of how attempt 5's edit is built. */
.fold { padding: 12px 16px; min-width: 0; }
.fold > summary { font: 600 1rem/1.3 var(--body); }
.fold[open] > summary { margin-bottom: 12px; }
.fold > :not(summary) + :not(summary) { margin-top: 12px; }
.formula { white-space: normal; }
.formula math { font-size: 1.35rem; }
.formula-key .sym { color: var(--fg); }
.formula-key .sym math { font-size: 1.1rem; }
.formula math, .formula-key .sym math { font-family: "STIX Two Math", "Cambria Math", math; }
.formula msup > :last-child, .formula-key .sym msup > :last-child { padding-left: .12em; }
