/* Dr. Bean study page.
   Dark and monochrome: graphite surfaces, white type, a white primary button. The only
   color is in the charts, where it means something (the curve outside the claim).
   Math is typeset by KaTeX. Radius scale: 4 small, 6 controls, 10 surfaces. 4px grid. */

@font-face { font-family: "Atkinson Hyperlegible Next"; src: url(fonts/atkinson-next-latin.woff2) format("woff2"); font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url(fonts/atkinson-next-latin-ext.woff2) format("woff2"); font-weight: 200 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible Mono"; src: url(fonts/atkinson-mono-latin.woff2) format("woff2"); font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: dark;
  --bg: #121315;
  --surface: #1a1c1f;
  --raised: #24272b;
  --raised-hover: #2c3035;
  --line: rgba(233, 236, 240, 0.1);
  --line-strong: rgba(233, 236, 240, 0.2);
  --text: #e9ecf0;
  --text-2: #acb2bb;
  --text-3: #8e959f;
  --primary: #e9ecf0;
  --primary-hover: #ffffff;
  --on-primary: #121315;
  --series: #7fb0ff;
  --series-2: #c3c9d1;
  --ok: #8cc7a1;
  --bad: #ee9585;
  --radius-s: 4px;
  --radius-c: 6px;
  --radius-p: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, Menlo, monospace;
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: rgba(127, 176, 255, 0.3); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; max-width: 34ch; }
h2 { font-size: 20px; line-height: 1.3; font-weight: 600; }
h3 { font-size: 17px; line-height: 1.4; font-weight: 600; }
a { color: var(--text); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 10; background: var(--raised); padding: 12px 16px; border-radius: var(--radius-c); }

/* Math */
.katex { font-size: 1.08em; color: inherit; }
h1 .katex { font-size: 1em; }
.katex-display { margin: 0; text-align: left; }
.katex-display > .katex { text-align: left; }

/* Top bar and steps */
.top { display: flex; align-items: center; gap: 24px; height: 64px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 600; }
.brand svg { width: 40px; height: 40px; }
.study { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-links { margin-left: auto; display: flex; align-items: center; gap: 20px; flex: none; }
.steps { border-bottom: 1px solid var(--line); padding: 0 var(--gutter); }
.steps ol { display: flex; gap: 40px; list-style: none; margin: 0 auto; padding: 0; max-width: var(--max); }
.steps a { display: flex; align-items: center; gap: 12px; height: 56px; color: var(--text-3); font-size: 16px; white-space: nowrap; transition: color 0.15s var(--ease); }
.steps a:hover { color: var(--text); }
.steps .num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 14px; font-weight: 600; flex: none; }
.steps .num svg { display: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.steps a.done { color: var(--text-2); }
.steps a.done .num { border-color: transparent; background: var(--raised); }
.steps a.done .num b { display: none; }
.steps a.done .num svg { display: block; }
.steps a[aria-current] { color: var(--text); font-weight: 600; }
.steps a[aria-current] .num { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.steps a[aria-current] .num b { display: block; }
.steps a[aria-current] .num svg { display: none; }
.steps a[aria-disabled] { cursor: not-allowed; opacity: 0.5; }
.steps a[aria-disabled]:hover { color: var(--text-3); }

/* Frame: as tall as the window when content is short, so short steps never scroll. */
main { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 32px var(--gutter) 24px; }
main:focus { outline: none; }
/* Steps are addressed by #fragment. The large margin keeps the browser from scrolling to
   a step when its fragment changes, so every step opens at the top of the page. */
main > section, #result-answer, #result-readings, #result-files { scroll-margin-top: 100vh; }
main > section, #editor, #cmp-editor, #start, .pane, #next-settings, #next-review, #next-answer { flex: 1; display: flex; flex-direction: column; }
.actions { margin-top: auto; padding-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.go { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.lead { color: var(--text-2); font-size: 17px; max-width: 72ch; margin-top: 8px; }
.meta { color: var(--text-3); font-size: 15px; }
.meta.bad, .status.bad, .problem { color: var(--bad); }
.hint { color: var(--text-3); font-size: 15px; margin-top: 12px; max-width: 64ch; }
.unit { color: var(--text-3); font-weight: 400; font-size: 14px; }
.problem { font-size: 15px; margin-top: 12px; max-width: 72ch; }
.status { font-size: 15px; color: var(--text-2); max-width: 46ch; text-align: right; }
.status.busy::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border: 2px solid var(--line-strong); border-top-color: var(--text); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { display: grid; place-items: center; min-height: 240px; color: var(--text-3); margin: 0; }
.quiet { color: var(--text-3); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }

/* Controls */
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--radius-c);
  font: 600 16px var(--font); cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.1s var(--ease); }
.primary { background: var(--primary); color: var(--on-primary); border: 0; }
.primary:hover { background: var(--primary-hover); }
.primary:active, .secondary:active { transform: scale(0.98); }
.primary:disabled { background: var(--raised); color: var(--text-3); cursor: not-allowed; transform: none; }
.secondary { background: var(--raised); color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.secondary:hover { background: var(--raised-hover); border-color: var(--line-strong); }
.small { min-height: 36px; padding: 0 14px; font-size: 15px; }
.primary svg, .secondary svg, .icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.quiet-button { background: none; border: 0; padding: 8px 0; color: var(--text-2); cursor: pointer; font-size: 15px; transition: color 0.15s var(--ease); }
.quiet-button:hover { color: var(--text); }
.back { color: var(--text-2); padding: 10px 0; transition: color 0.15s var(--ease); }
.back:hover { color: var(--text); }
.icon { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--radius-c); background: none; color: var(--text-3); cursor: pointer; }
.icon:hover { background: var(--raised); color: var(--text); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--text); margin: 0; }
.field { display: grid; gap: 6px; color: var(--text-2); font-size: 15px; }
.field input, .field textarea, .field select { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-c); }
.field select { appearance: none; padding-right: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23acb2bb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.field input:focus, .field textarea:focus, .field select:focus, .readings input:focus, .limits input:focus, .claim-input:focus { outline: 2px solid var(--text); outline-offset: 0; border-color: transparent; }
::placeholder { color: var(--text-3); opacity: 1; }

/* Connection problems: what happened and the way forward, above every step. */
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-p); }
.notice p { max-width: 72ch; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Step 1: a question, files, and what Dr. Bean found in them. */
.question-field { margin: 20px 0; max-width: 920px; }
.question-field textarea { min-height: 64px; resize: vertical; font: inherit; line-height: 1.45; }
.link { padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; transition: color 0.15s var(--ease); }
.link:hover { color: var(--primary-hover); }
.examples { margin: 0 0 0 8px; }
.sources li { align-items: flex-start; }
.sources h3 { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.file-add { position: relative; overflow: hidden; }
.file-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-add:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.can-do { list-style: none; margin: 8px 0 0; padding: 0; max-width: 960px; }
.can-do li { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.can-do h3 { font-size: 17px; font-weight: 600; }
.can-do p { margin-top: 4px; color: var(--text-2); max-width: 64ch; }
.can-do .off p { color: var(--text-3); }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li + li { margin-top: 4px; }
#ai-label { margin: 12px 0 0; }
.manual-body { display: grid; gap: 12px; margin-top: 12px; max-width: 640px; }
.consent { margin-top: 20px; white-space: normal; align-items: flex-start; max-width: 72ch; }
.consent input { margin-top: 4px; }
.answer-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; }
ol.claims { list-style: none; padding: 0; margin: 4px 0 0; }
.claims li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.claims .kind { display: inline-block; margin-right: 10px; color: var(--text-3); font-size: 14px; }
.claims .meta { margin-top: 4px; }
.quote { margin: 8px 0 0; padding: 8px 12px; border-left: 2px solid var(--line-strong); background: var(--surface); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.quote p { color: var(--text-2); font-size: 15px; overflow-wrap: anywhere; }
.quote cite { display: block; margin-top: 4px; color: var(--text-3); font-size: 13px; font-style: normal; }
.quote.unverified { border-left-color: var(--bad); }
.found-table { margin-top: 32px; max-width: 1100px; }
.found-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.found-head h3 { font-size: 17px; font-weight: 600; }
.table-scroll { position: relative; overflow-x: auto; margin-top: 12px; }
.source-group { margin-top: 24px; max-width: 920px; }
.source-group h3 { font-size: 16px; font-weight: 600; }

/* Step 1, empty: the drop target is the page. */
.start .lead { margin-bottom: 28px; }
.drop { position: relative; display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 200px; padding: 32px; text-align: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-p); transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease); }
.drop:hover, .drop.over { background: var(--raised); border-color: var(--text-2); }
.drop:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop svg { width: 32px; height: 32px; fill: none; stroke: var(--text-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.drop-title { font-size: 20px; font-weight: 600; }
.start-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.start-actions .quiet-button { margin-left: 8px; }
.start .status { text-align: left; margin-top: 16px; max-width: 72ch; }

/* Step 1, editing: the claim is the heading; readings and their chart side by side. */
.claim { font-size: clamp(26px, 3vw, 38px); line-height: 1.35; max-width: none; font-weight: 600; }
.claim-input { width: 5ch; field-sizing: content; min-width: 4ch; max-width: 9ch; padding: 0 8px; margin: 0 2px; text-align: center; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-c); }
.mapping { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin-top: 16px; padding: 12px 16px; background: var(--surface); border-radius: var(--radius-p); }
.mapping .field { flex: 1 1 180px; min-width: 0; }
.mapping .field select, .mapping .field input { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.mapping .wide { flex-basis: 100%; max-width: none; margin-top: 0; }
.mapping .field.narrow { flex: 0 1 112px; }
.work { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: start; margin-top: 24px; }
.readings { width: 100%; border-collapse: collapse; }
.readings th { padding: 0 8px 10px 0; text-align: left; font-size: 15px; font-weight: 500; color: var(--text-2); border-bottom: 1px solid var(--line); vertical-align: bottom; }
.readings th .unit { display: block; }
.readings td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); }
.readings td:first-child, .readings th:first-child { width: 32px; }
.readings td:last-child { width: 40px; padding-right: 0; text-align: right; }
.readings input:not([type=checkbox]) { width: 100%; max-width: 124px; min-height: 38px; padding: 6px 10px; background: rgba(233, 236, 240, 0.03); border: 1px solid transparent; border-radius: var(--radius-c); }
.readings input:not([type=checkbox]):hover { border-color: var(--line-strong); }
.readings tr.unused input:not([type=checkbox]) { color: var(--text-3); text-decoration: line-through; }
.table-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.table-actions .meta { margin-left: auto; }
.chart-col { display: grid; gap: 20px; align-content: start; }
.chart-area { margin: 0; padding: 16px 16px 12px; background: var(--surface); border-radius: var(--radius-p); }
.chart { display: block; width: 100%; height: auto; }
.chart .grid { stroke: var(--line); }
.chart .tick, .chart .axis, .chart .slot-label { fill: var(--text-3); font: 14px var(--font); }
.chart .curve { fill: none; stroke-width: 2; stroke-linecap: round; }
.chart .curve.inside { stroke: var(--series-2); }
.chart .curve.outside { stroke: var(--series); stroke-width: 2.5; }
.chart .reading path { fill: none; stroke: var(--text); stroke-width: 1.5; }
.chart .reading circle { fill: var(--text); stroke: var(--surface); stroke-width: 2; }
.chart .slot-line { stroke: var(--line-strong); }
.chart .slot-label.sub { font-size: 12px; }
.chart .slot-fill { fill: var(--raised); }
.chart .mark { stroke-width: 3; stroke-linecap: round; }
.chart .mark.iso { stroke: var(--series-2); }
.chart .mark.bi { stroke: var(--series); }
.chart .range.iso { fill: var(--series-2); }
.chart .range.bi { fill: var(--series); }
.chart .range.inside { fill: var(--series-2); }
.chart .range.outside { fill: var(--series); }
.chart .selected .slot-label { fill: var(--text); font-weight: 600; }
.key { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 8px; color: var(--text-2); font-size: 15px; }
.key span::before { content: ""; display: inline-block; width: 18px; height: 3px; margin-right: 8px; vertical-align: middle; background: var(--series-2); }
.key .k-outside::before, .key .k-bi::before { background: var(--series); }
.key .k-reading::before { width: 3px; height: 14px; background: var(--text); }
.about-data { margin: 16px 0 0; padding: 0; border: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr) minmax(0, 1.6fr); gap: 16px 24px; align-items: end; }
.cmp-about { grid-template-columns: max-content minmax(0, 2fr) minmax(0, 1fr) minmax(0, 0.7fr); }
.check-line { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text); cursor: pointer; white-space: nowrap; }
.field input[type=checkbox], .field input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; }
.cmp-work { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.cmp-work .readings input:not([type=checkbox]) { max-width: 96px; }
.cmp-work .readings input[data-ckey="current"] { max-width: 176px; }
#cmp-mapping .field { flex-basis: 136px; }
#cmp-mapping .field.narrow { flex: 0 1 92px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.settings-grid .wide { grid-column: 1 / -1; }
.settings-grid .field input { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.settings-table caption { caption-side: top; text-align: left; color: var(--text-2); padding: 4px 0 8px; }
.choice { display: flex; gap: 20px; min-height: 44px; align-items: center; }
.choice label { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); white-space: nowrap; }
#limits summary { cursor: pointer; color: var(--text-2); width: fit-content; padding: 6px 0; }
#limits summary:hover { color: var(--text); }
.limits-body { display: grid; gap: 16px; margin-top: 12px; }
.equation .meta { margin-top: 6px; }
.limits { border-collapse: collapse; }
.limits th { text-align: left; padding: 6px 16px 6px 0; font-weight: 400; color: var(--text-2); }
.limits thead th { font-size: 14px; color: var(--text-3); }
.limits td { padding: 4px 8px 4px 0; }
.limits input { width: 104px; min-height: 40px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-c); }

/* Step 2 */
.facts { width: 100%; max-width: 920px; border-collapse: collapse; margin-top: 24px; }
.facts th { width: 200px; padding: 14px 24px 14px 0; text-align: left; vertical-align: top; font-weight: 400; color: var(--text-2); border-bottom: 1px solid var(--line); }
.facts td { padding: 14px 0; border-bottom: 1px solid var(--line); }
.technical { margin-top: 20px; }
.technical summary { cursor: pointer; color: var(--text-2); width: fit-content; }
.technical summary:hover { color: var(--text); }
.command { margin: 12px 0; padding: 12px 16px; background: var(--surface); border-radius: var(--radius-c); font: 14px/1.6 var(--mono); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow: auto; }

/* Step 3 */
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.views { display: flex; gap: 2px; padding: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-c); }
.views a { padding: 6px 14px; border-radius: var(--radius-s); color: var(--text-2); font-size: 15px; white-space: nowrap; transition: color 0.15s var(--ease), background-color 0.15s var(--ease); }
.views a:hover { color: var(--text); }
.views a[aria-current] { background: var(--raised); color: var(--text); }
.views button { padding: 6px 14px; border: 0; border-radius: var(--radius-s); background: none; color: var(--text-2); font: 15px var(--font); white-space: nowrap; cursor: pointer; transition: color 0.15s var(--ease), background-color 0.15s var(--ease); }
.views button:hover { color: var(--text); }
.views button[aria-pressed="true"] { background: var(--raised); color: var(--text); }
.status.left { text-align: left; max-width: 72ch; margin-top: 12px; }
.raw-json { margin: 0; font: 13px/1.5 var(--mono); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
#cmp-check-facts .katex-display { margin: 8px 0; text-align: left; }
#cmp-check-facts .katex-display > .katex { text-align: left; }
#result-title { font-size: clamp(28px, 3vw, 40px); max-width: 40ch; }
.result-work { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.data { width: 100%; border-collapse: collapse; }
.data caption { caption-side: top; text-align: left; color: var(--text-2); padding-bottom: 12px; }
.data th { text-align: left; padding: 0 12px 10px 0; font-size: 15px; font-weight: 500; color: var(--text-2); border-bottom: 1px solid var(--line); vertical-align: bottom; }
.data th .unit { display: block; }
.data tbody th { font-weight: 500; color: var(--text); padding-top: 12px; vertical-align: top; }
.data td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.data tr.chosen td { color: var(--text); font-weight: 600; }
.exact { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.exact .katex { font-size: 1.35em; }
.swatch { display: inline-block; width: 14px; height: 3px; margin-right: 8px; vertical-align: middle; background: var(--series-2); }
tr.outside .swatch, tr.bi .swatch { background: var(--series); }
.data tr.pick th, .data tr.pick td { color: var(--text); font-weight: 600; }
.data tr.unused th, .data tr.unused td { color: var(--text-3); }
#cmp-readings .data { max-width: 960px; margin-top: 24px; }
h2.sub { font-size: 18px; font-weight: 600; margin: 32px 0 8px; }
.limit-list { margin: 8px 0 0; padding-left: 20px; max-width: 72ch; color: var(--text-2); }
.limit-list li { margin: 6px 0; }
.notice-line { margin: -8px 0 20px; color: var(--text-2); font-size: 15px; max-width: 72ch; }
#result-readings .data, #next-table .data { max-width: 960px; margin-top: 24px; }
.files { list-style: none; margin: 24px 0 0; padding: 0; max-width: 960px; }
.files li { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.files p { margin-top: 4px; color: var(--text-2); }
.file-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
#result-files > .secondary { margin-top: 20px; width: fit-content; }

/* Step 4 */
.next-form { display: grid; gap: 16px; align-content: start; }
#next-table .data { margin-top: 0; }

/* Dialogs */
dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 24px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-p); overscroll-behavior: contain; }
dialog.wide { width: min(920px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(6, 7, 8, 0.7); }
dialog h2 { margin: 0 0 12px; }
dialog p { color: var(--text-2); margin-top: 8px; }
dialog .field { margin-top: 16px; }
dialog textarea { font-family: var(--mono); resize: vertical; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.dialog-head h2 { margin: 0; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.file-body { margin-top: 12px; overflow: auto; max-height: calc(100dvh - 240px); padding-right: 4px; }
.file-body h3 { margin-top: 24px; }
.file-body ul { margin: 8px 0 0; padding-left: 20px; color: var(--text-2); }
.file-body .facts { margin-top: 12px; }
.file-body .data { margin-top: 20px; }
.mono { font: 14px var(--mono); overflow-wrap: anywhere; }
.raw summary { margin-top: 16px; cursor: pointer; color: var(--text-2); }
.raw summary:hover { color: var(--text); }
.raw pre { max-height: 360px; overflow: auto; margin: 8px 0 0; padding: 12px; background: var(--bg); border-radius: var(--radius-c); font: 13px/1.5 var(--mono); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Narrow screens */
@media (min-width: 641px) {
  main { padding-bottom: 0; }
  .actions { position: sticky; bottom: 0; z-index: 2; padding: 24px 0; background: var(--bg); transition: box-shadow 0.15s var(--ease); }
  .actions.stuck { box-shadow: 0 -1px 0 var(--line); }
}
@media (max-width: 920px) {
  .work, .result-work { grid-template-columns: 1fr; }
  .about-data, .cmp-about, .answer-grid { grid-template-columns: 1fr; }
  /* Seven columns do not fit a phone: the currents table scrolls sideways inside its box. */
  .cmp-work { grid-template-columns: minmax(0, 1fr); }
  .cmp-work .table-area { position: relative; min-width: 0; overflow-x: auto; }
  .cmp-work .table-area .readings { min-width: 560px; }
  .steps ol { gap: 24px; }
}
@media (max-width: 640px) {
  .top { gap: 12px; height: 56px; }
  .study, #connection { display: none; }
  .brand svg { width: 32px; height: 32px; }
  .steps ol { gap: 16px; }
  .steps a:not([aria-current]) .label { display: none; }
  main { padding-top: 24px; }
  .go { flex-direction: column-reverse; align-items: stretch; width: 100%; }
  .status { text-align: left; max-width: none; }
  .actions .primary { width: 100%; }
  .actions { flex-direction: column-reverse; align-items: stretch; }
  .actions .back, .actions .quiet-button { text-align: center; }
  .files li, .can-do li { flex-direction: column; align-items: stretch; }
  .facts th { width: auto; display: block; padding-bottom: 0; border: 0; }
  .facts td { display: block; padding-top: 4px; }
  .readings input:not([type=checkbox]) { padding: 8px 6px; }
  .drop { min-height: 200px; }
}
/* Short laptop screens: the same layout, tighter, so short steps still fit without scrolling. */
@media (max-height: 820px) and (min-width: 641px) {
  .top { height: 56px; }
  .steps a { height: 48px; }
  main { padding-top: 20px; }
  h1 { font-size: 28px; }
  .claim { font-size: 30px; }
  #result-title { font-size: 30px; }
  .lead { font-size: 16px; margin-top: 4px; }
  .work { margin-top: 16px; }
  .actions { padding: 16px 0; }
  .readings input:not([type=checkbox]) { min-height: 34px; padding-top: 4px; padding-bottom: 4px; }
  .result-head { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
