/* Knowledge editing in n-gram space: the page and its figures. Shared tokens (--bg, --fg, --muted, --line, --accent, fonts)
   come from /assets/style.css. */

:root {
  --card: #fbf9f4;
  --ink: #1a1612;
  --copper: #d9531a;
  --copper-pale: #f2e3d7;
  --slate: #3d5a80;
  --slate-pale: #dfe6ee;
}

main { max-width: 1180px; margin: 0 auto; padding: 130px clamp(16px, 4vw, 48px) 120px; }
@media (min-width: 700px) { main { zoom: 0.81; } }

.post-head { text-align: center; margin: 0 0 56px; }
.post-head h1 { display: inline-block; margin: 0; font-weight: 400; font-size: clamp(32px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.025em; }
.post-head h1::after { content: ""; display: block; height: 1px; margin-top: 24px; background: color-mix(in srgb, var(--fg) 35%, transparent); }
.post-head .tagline { max-width: 620px; margin: 18px auto 0; font-size: 17px; line-height: 1.55; color: var(--muted); text-wrap: balance; }
.post-head .meta { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 14px 0 0; font: 12px var(--mono); color: var(--muted); }

main > .prose { max-width: 700px; margin: 0 auto; }
.prose p { margin: 0 0 18px; }
.prose h2 { margin: 56px 0 12px; }
.prose .katex-display { margin: 18px 0 22px; }
.prose sup.fn { font: 500 11px var(--mono); margin-left: 1px; }
.prose sup.fn a { text-decoration: none; }

.notes { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); }
.notes ol { margin: 0; padding-left: 20px; }
.notes li { margin: 0 0 10px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.notes li a { text-decoration: none; }

/* Figures: wider than the text. */
.fig { max-width: 960px; margin: 34px auto 52px; position: relative; }
.fig .svg { position: relative; }
#fig-table { max-width: 800px; }
#fig-edit { max-width: 700px; }
.fig svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--sans); }
.fig svg text { font-family: var(--sans); }
.fig svg .mono { font-family: var(--mono); }
.fig figcaption { max-width: 700px; margin: 18px auto 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.fig figcaption b { color: var(--fg); font-weight: 500; }
.readout { max-width: 700px; margin: 14px auto 0; min-height: 1.6em; font: 12.5px/1.6 var(--mono); color: var(--muted); text-align: center; }
.readout > span { display: inline-block; margin: 0 10px; white-space: nowrap; }
.readout b { font-weight: 500; color: var(--fg); }
.readout b.c { color: var(--copper); }
.readout b.s { color: var(--slate); }

.tok { cursor: pointer; }
.tok:hover rect[rx="4"] { stroke: color-mix(in srgb, var(--fg) 45%, transparent); }


@media (max-width: 680px) {
  .prose .katex-display { font-size: 0.9em; }
}

/* Results: one question per edit, the unedited answer and the answer at each strength behind a click. */
#results { margin-top: 30px; }
.result { margin: 0 0 46px; }
.result h3 { margin: 0 0 4px; font-size: 18px; font-weight: 500; }
.result h3 .plus { color: var(--copper); }
.result .how { margin: 0 0 16px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.qa .q { margin: 0 0 10px; font: 13.5px/1.5 var(--mono); }
.ans { padding: 15px 20px 16px; background: var(--card); border: 1px solid color-mix(in srgb, var(--fg) 11%, transparent); border-radius: 10px; }
.ans.edited, .ans.slider { background: var(--card); border-color: color-mix(in srgb, var(--copper) 38%, transparent); }
.ans .who { display: block; margin-bottom: 6px; font: 11px var(--mono); letter-spacing: 0.02em; color: var(--copper); }
.ans p { margin: 0 0 8px; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.ans p:last-child { margin-bottom: 0; }
.ans.plain { background: transparent; border-style: dashed; }
.ans.plain p { font-size: 14px; color: var(--muted); }
details.more { margin-top: 10px; }
details.more > summary { display: inline-flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; font: 12px var(--mono); color: var(--muted); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
details.more[open] > summary::before { transform: translateY(-2px) rotate(45deg); }
details.more > summary:hover { color: var(--fg); }
details.more[open] > :not(summary) { margin-top: 10px; }
.slider input { width: 100%; margin: 4px 0 0; accent-color: var(--copper); }
.slider .ticks { display: flex; justify-content: space-between; margin: 2px 7px 0; font: 11px var(--mono); color: var(--muted); }
.slider .ticks span { width: 0; display: flex; justify-content: center; }
.slider .ticks span.on { color: var(--copper); font-weight: 500; }
.slider .read { display: flex; align-items: baseline; gap: 12px; margin-top: 12px; }
.slider .a { font: 500 12.5px var(--mono); }
.slider .big { font-size: 15px; font-weight: 500; color: var(--copper); }
.dial .note { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.seg button { padding: 5px 12px; border: 1px solid color-mix(in srgb, var(--fg) 14%, transparent); border-radius: 999px; background: transparent; font: 12px var(--mono); color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--fg); }
.seg button.on { border-color: color-mix(in srgb, var(--copper) 55%, transparent); background: var(--card); color: var(--copper); }
.why .ans .who { margin-bottom: 4px; font: 500 14px var(--sans); letter-spacing: 0; }
