/* Ratio — "plate with a key" design. Vintage diagram plate:
   cream paper on dark blue, yellow inputs, pink selected, white answers.

   One-screen layout: on any window at least 980 × 600 the whole tool fits
   without page scrolling. Two columns:
     left   1 Size and ratio (largest fields), 2 Pixelmap editor (scrolls inside)
     right  preview (fills), ratio bar, then 3 Rounding · 4 Fit · 5 Print in a row
   Type and fields step up on bigger screens (see "size tiers") so large
   monitors don't get a tiny tool in a sea of paper. Smaller windows stack
   and scroll normally. */

:root {
  --page: #1f3a5f;
  --paper: #efe6d0;
  --ink: #1c1a17;
  --input: #f9e27d;
  --sel: #f7b8d4;
  --sel-border: #b0105f;
  --answer: #fffaf0;
  --muted: #4a443a;
  --hint: #3d3830;
  --accent: #e8318f;

  /* size tokens: base tier (laptops) */
  --fs: 11px;        /* body text */
  --fs-s: 10px;      /* caps labels, table heads */
  --fs-m: 13px;      /* mono answers */
  --h1: 28px;
  --h2: 16px;
  --field-h: 28px;
  --field-fs: 12px;
  --s1-h: 42px;      /* section 1 main fields */
  --s1-fs: 20px;
  --s1b-h: 34px;     /* section 1 "other resolution" fields */
  --s1b-fs: 16px;
  --btn-h: 28px;
  --fit-h: 192px;    /* fit diagram height */
  --tools-h: 184px;  /* additional tools window; scrolls past this */
  --left-w: 330px;   /* left column */
  --sec-gap: 6px;    /* inside a section */
  --col-gap: 10px;   /* between sections in a column */
  --g-gap: 18px;     /* between columns */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 16px 2vw;
  background: var(--page);
  color: var(--ink);
  font: var(--fs)/1.4 'IBM Plex Sans', system-ui, sans-serif;
}

.paper {
  max-width: none;
  margin: 0 auto;
  position: relative;
  isolation: isolate;
  padding: 18px 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

a { color: var(--ink); }
a:hover { color: var(--sel-border); }

input, select, button { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- masthead: one line ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 8px;
}

.masthead > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }

h1 {
  margin: 0;
  font-family: 'IM Fell English', Georgia, serif;
  font-weight: 400;
  font-size: var(--h1);
  line-height: 1;
}

.tagline { margin: 0; font-size: var(--fs); color: var(--hint); }

.key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: var(--fs); }
.key-title { font-family: 'IM Fell English', Georgia, serif; font-style: italic; font-size: calc(var(--fs) + 1px); }
.key-row { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.key-item { display: flex; align-items: center; gap: 5px; }
.swatch { width: 16px; height: 10px; display: inline-block; }

/* sign-in and donate: quiet, never in the way */
.acct { display: flex; gap: 6px; align-items: center; }
.acct-btn {
  height: 22px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1.5px solid var(--ink);
  font-size: var(--fs-s);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.acct-btn[hidden] { display: none; }
#donate { background: var(--input); }

.dlg {
  width: min(420px, calc(100vw - 32px));
  padding: 18px 20px 16px;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.dlg::backdrop { background: rgba(31, 58, 95, 0.55); }
.dlg > div { display: flex; flex-direction: column; gap: 10px; }
.dlg > div[hidden] { display: none; }
.dlg-title { margin: 0; font: 400 24px/1.1 'IM Fell English', Georgia, serif; }
.dlg-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: 1.5px solid var(--ink);
  font-size: 16px;
  line-height: 1;
}
.dlg-email { display: flex; flex-direction: column; gap: 6px; }
.dlg-email .copybtn { height: var(--btn-h); }
.dlg-or { margin: 0; text-align: center; font-size: var(--fs-s); color: var(--muted); }
.dlg .two .lockbtn { padding: 0 6px; }
#authMsg:empty { display: none; }
#authMsg { margin-top: 8px; font-style: normal; color: var(--ink); }
.sw-input { background: var(--input); border: 1.5px solid var(--ink); }
.sw-selected { background: var(--sel); border: 1.5px solid var(--sel-border); }
.sw-answer { background: var(--answer); border: 2px solid var(--ink); }

/* ---------- grid ---------- */

.g {
  display: grid;
  grid-template-columns: var(--left-w) minmax(0, 1fr);
  gap: var(--g-gap);
}
.col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.col-l { gap: var(--col-gap); }
section { display: flex; flex-direction: column; gap: var(--sec-gap); min-width: 0; min-height: 0; }

/* one screen: nothing scrolls except the editor list */
@media (min-width: 980px) and (min-height: 600px) {
  body { height: 100vh; overflow: hidden; padding-top: 10px; padding-bottom: 10px; }
  .paper { height: 100%; padding: 10px 18px 6px; gap: 8px; }
  .g { flex: 1 1 auto; min-height: 0; }
  .editor { flex: 1 1 auto; }
  .editor-scroll { overflow-y: auto; }
  .fig-wrap { flex: 1 1 0; }
}

/* narrow windows: one column, page scrolls */
@media (max-width: 979px), (max-height: 599px) {
  .g { grid-template-columns: minmax(0, 1fr); }
  .fig-wrap { aspect-ratio: 16 / 9; }
  .tools-scroll { height: auto; overflow: visible; }
}
h2 {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'IM Fell English', Georgia, serif;
  font-weight: 400;
  font-size: var(--h2);
  line-height: 1.1;
}

.no {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--fs-s);
  font-weight: 600;
  background: var(--ink);
  color: var(--paper);
  padding: 1px 5px;
}

.hint { margin: 0; font-size: var(--fs); color: var(--hint); max-width: 62ch; }
code, .mono { font-family: 'IBM Plex Mono', monospace; }

/* ---------- fields ---------- */

label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: var(--fs-s);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input[type="number"], input[type="text"], input[type="email"], select {
  height: var(--field-h);
  width: 100%;
  min-width: 0;
  background: var(--input);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: 0 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: var(--field-fs);
  letter-spacing: 0;
  text-transform: none;
}

/* Section 1 stays large: it is where the user types. */
.s1 input[type="number"], .s1 input[type="text"] { height: var(--s1-h); font-size: var(--s1-fs); }
.s1 .wh2 input[type="number"] { height: var(--s1b-h); font-size: var(--s1b-fs); }

input.small { width: 70px; }

.wh, .wh2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px 8px;
  align-items: end;
}

#swap {
  width: 40px;
  height: var(--s1-h);
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  font-size: 18px;
}

.wh2 .times {
  width: 40px;
  height: var(--s1b-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
}

.scale {
  display: flex;
  flex-direction: column;
  gap: var(--sec-gap);
  border-top: 1px dotted var(--ink);
  padding-top: 8px;
  margin-top: 2px;
}

.sublabel {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: calc(var(--fs) + 2px);
}

.s1 {
  flex: none;
  border: 2px solid var(--ink);
  background: rgba(255, 250, 240, 0.45);
  padding: 10px 12px 12px;
}
.s1 h2 { font-size: calc(var(--h2) + 3px); }
.s1 .note { color: var(--muted); font-size: var(--fs-s); }

.ratio-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  border-top: 1px dotted var(--ink);
  padding-top: 8px;
}
.ratio-row .ratio { flex: 0 0 96px; }
.ratio-row .ratio input { height: var(--field-h); font-size: var(--field-fs); }
.ratio-row .grow { flex: 1 1 auto; min-width: 0; }
.fav { width: var(--field-h); height: var(--field-h); padding: 0; font-size: 14px; flex: none; }

/* ---------- LED wall mode ---------- */

.s1-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* a real switch, so entering LED mode is a deliberate act */
label.switch {
  flex-direction: row;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: var(--fs-s);
}
label.switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 32px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
}
label.switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  background: var(--ink);
  transition: transform 0.15s;
}
label.switch input:checked { background: var(--sel); border-color: var(--sel-border); }
label.switch input:checked::after { transform: translateX(14px); background: var(--sel-border); }

.led {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 8px 8px;
  border: 1.5px solid var(--sel-border);
  background: rgba(247, 184, 212, 0.35);
}
.led[hidden] { display: none; }
.led-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.led .note { color: var(--muted); font-size: var(--fs-s); }

/* width and height become answers while LED mode drives them */
.s1.led-on .wh input[readonly] { background: var(--answer); border-width: 2px; }
.s1.led-on #swap:disabled,
.s1.led-on .lockbtn:disabled,
.s1.led-on .ratio-row input:disabled,
.s1.led-on .ratio-row select:disabled { opacity: 0.45; cursor: not-allowed; }

/* not built yet: visible so the plan is clear, greyed so nobody expects it to work */
.soon { opacity: 0.45; }
.soon, .soon * { cursor: not-allowed; }
.soon-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border: 1px solid var(--muted);
  font: 600 9px/1.4 'IBM Plex Mono', monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: middle;
}
.caps { display: block; margin-bottom: 4px; font-size: var(--fs-s); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

button { border-radius: 0; color: var(--ink); }

.lockbtn {
  height: var(--btn-h);
  background: transparent;
  border: 1.5px solid var(--ink);
  font-size: var(--fs);
}

.lockbtn.on {
  background: var(--sel);
  border-color: var(--sel-border);
  font-weight: 600;
}

/* ---------- preview figure ---------- */

/* Fills the free space; the preview sits inside at its own ratio.
   The spare room shows faint graph paper instead of a grey block. */
.fig-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  width: 100%;
  background-color: transparent;
  background-image:
    linear-gradient(to right, rgba(28, 26, 23, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(28, 26, 23, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center;
  border: 1.5px solid var(--ink);
  border-bottom: 0;
}

#fig {
  position: relative;
  overflow: hidden;
  outline: 1.5px solid var(--ink);
  background: #d6d0c0;
}

/* Extreme ratios: the honest strip. Decorations would be mush; caption moves below. */
#fig.extreme { overflow: visible; margin-bottom: 22px; }
#fig.extreme canvas { display: none; }
#fig.extreme .figcap { top: calc(100% + 6px); bottom: auto; left: 0; }

/* Generative artwork canvas; the frame stays blank without WebGL. */
#fig canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#fig.gl { cursor: pointer; }

.figcap {
  position: absolute;
  left: 8px;
  bottom: 6px;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 1px 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--fs-s);
}

/* Paper sheet that feathers out across the page margin into the artwork. */
.paper::before {
  --fx: 1.8vw;
  --fy: 10px;
  content: '';
  position: absolute;
  inset: calc(-1 * var(--fy)) calc(-1 * var(--fx));
  z-index: -1;
  pointer-events: none;
  background: var(--paper);
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 var(--fx), #000 calc(100% - var(--fx)), transparent),
    linear-gradient(to bottom, transparent, #000 var(--fy), #000 calc(100% - var(--fy)), transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 var(--fx), #000 calc(100% - var(--fx)), transparent),
    linear-gradient(to bottom, transparent, #000 var(--fy), #000 calc(100% - var(--fy)), transparent);
  mask-composite: intersect;
}

/* ---------- page background artwork ---------- */

#pageArt {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
  pointer-events: none;
  display: none;
}

body.page-art #pageArt { display: block; }

/* ---------- 2 pixelmap editor ---------- */

.editor { border-top: 1.5px solid var(--ink); padding-top: 8px; }
.editor-scroll { display: flex; flex-direction: column; gap: 4px; padding-right: 4px; min-height: 0; }

details { border: 1.5px solid var(--ink); background: rgba(255, 250, 240, 0.35); }
details[open] { background: rgba(255, 250, 240, 0.7); }
summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  font-weight: 600;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '▾'; margin-left: auto; font-size: 11px; transition: transform 0.15s; }
details:not([open]) summary::after { transform: rotate(-90deg); }
summary .sum {
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 400 var(--fs-s) 'IBM Plex Mono', monospace;
  color: var(--muted);
}
summary:has(.sum)::after { margin-left: 0; }

.dbody { display: flex; flex-direction: column; gap: 7px; padding: 6px 8px 9px; border-top: 1px dotted var(--ink); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }
.checks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 8px; }

label.check {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: var(--fs);
}

label.check input { width: 14px; height: 14px; margin: 0; accent-color: var(--ink); }

.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.swatches span { width: 22px; height: 22px; border: 1.5px solid var(--ink); }

.proj { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 5px; }
.proj[hidden] { display: none; }
.proj select, .proj input { height: var(--btn-h); }
.proj input[hidden], .proj select[hidden] { display: none; }
.proj .lockbtn { padding: 0 7px; }
.proj .lockbtn:disabled { opacity: 0.4; cursor: not-allowed; }

.screens { display: flex; flex-direction: column; }
.screens .scr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px dotted var(--ink); }
.screens .scr.on { background: var(--sel); margin: 0 -8px; padding: 3px 8px; }
.screens .scr input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: var(--ink); }
.screens .scr-name { height: calc(var(--field-h) - 4px); font-size: var(--fs); }
.scr-size { background: none; border: 0; padding: 0 2px; font-size: var(--fs-s); font-weight: 600; text-decoration: underline dotted; }
.scr-del { width: 20px; height: 20px; padding: 0; background: none; border: 1px solid var(--ink); line-height: 1; }
.dbody > .copybtn { height: var(--btn-h); }
.dbody > label.switch { text-transform: none; letter-spacing: 0; font-size: var(--fs); font-weight: 400; }
.copybtn:disabled { opacity: 0.45; cursor: not-allowed; }

.future { margin: 0; font-size: var(--fs-s); color: var(--muted); font-style: italic; }

.export { display: flex; gap: 6px; border-top: 1.5px solid var(--ink); padding-top: 8px; }
.export select { width: 72px; flex: none; }
.export .copybtn { flex: 1 1 auto; height: var(--field-h); }

.copybtn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Test card shows its own labels; the plate caption would cover the corner. */
#fig.gl:not(.extreme) .figcap { display: none; }
#fig.busy canvas { opacity: 0.55; transition: opacity 0.2s; }

/* ---------- answer boxes ---------- */

.answer {
  background: var(--answer);
  border: 2px solid var(--ink);
  padding: 8px 10px;
}

/* ratio bar: attached under the preview */
.ratiobar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 22px;
  padding: 7px 12px;
}
.ratiobar .formula { font-size: var(--fs); color: var(--hint); }
.ratiobar .copybtn { margin-left: auto; }

.results {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}
.results > div { display: flex; align-items: baseline; gap: 7px; }

.results dt {
  font-size: var(--fs-s);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.results dd {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: calc(var(--fs-m) + 2px);
}

/* ---------- additional tools: 3 · 4 · 5 in a row, 6 full width below ----------
   Fixed-height window that scrolls, so opening a tool never squeezes the preview. */

.tools {
  flex: none;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1.5px solid var(--ink);
}
.tools-scroll {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px 10px;
  align-content: start;
  align-items: start;
  height: var(--tools-h);
  overflow-y: auto;
  padding-right: 4px;
  transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
/* the fit diagram needs room: grow the window while that tool is open */
@media (min-width: 980px) and (min-height: 600px) {
  .tools-scroll:has(.tool.s3[open]) { height: calc(var(--tools-h) + var(--fit-h)); }
}
@media (prefers-reduced-motion: reduce) {
  .tools-scroll { transition: none; }
}
.tool.ff { grid-column: 1 / -1; }
details.tool summary { padding: 4px 8px; }
.tool-title { font: 400 var(--h2)/1.1 'IM Fell English', Georgia, serif; }
.tool-body {
  display: flex;
  flex-direction: column;
  gap: var(--sec-gap);
  padding: 6px 8px 8px;
  border-top: 1px dotted var(--ink);
}

/* 6 ffmpeg */
.ff-fields { display: grid; grid-template-columns: minmax(140px, 1.6fr) repeat(5, minmax(0, 1fr)); gap: 6px; }
.ff-out { display: flex; gap: 8px; align-items: stretch; }
.ff-cmd {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 9px;
  font-size: var(--fs);
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
}
.ff-out .copybtn { flex: none; height: auto; }
@media (max-width: 1100px) { .ff-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.copybtn {
  height: var(--btn-h);
  padding: 0 12px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  font-size: var(--fs);
  font-weight: 600;
}

/* ---------- 4 rounding table ---------- */

.table-wrap { padding: 0; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: var(--fs); }

thead tr { border-bottom: 1.5px solid var(--ink); }

th {
  padding: 5px 8px;
  text-align: left;
  font-size: var(--fs-s);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

td { padding: 5px 8px; border-bottom: 1px dotted var(--ink); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td.mono { font-weight: 600; white-space: nowrap; }
tr.sel { background: var(--sel); }
tr.sel td:first-child { font-weight: 600; }

/* ---------- 5 fit ---------- */

.fit-controls { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: flex-end; }
.grow { flex: 1 1 160px; }

.modes { display: flex; }

.modebtn {
  height: var(--field-h);
  padding: 0 10px;
  background: transparent;
  border: 1.5px solid var(--ink);
  font-size: var(--fs);
}

.modebtn + .modebtn { border-left: 0; }

.modebtn.on {
  background: var(--sel);
  border-color: var(--sel-border);
  font-weight: 600;
}

/* diagram beside its answer: saves a whole row of height */
.fit-body { display: flex; flex-wrap: nowrap; gap: 10px; align-items: stretch; }

#fitFig {
  flex: none;
  height: var(--fit-h);
  max-width: 55%;
  outline: 1.5px solid var(--ink);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--answer);
}

#fitFig.row { flex-direction: row; }
#fitFig.cover #fitPic { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
#fitFig.cover .hatch { display: none; }

.hatch {
  flex: 1;
  background-image: repeating-linear-gradient(45deg, transparent 0 5px, var(--ink) 5px 6px);
}

#fitPic { position: relative; overflow: hidden; }
#fitPic canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
#fitPic.gl { cursor: pointer; }

.fit-answer {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 6px 10px;
  font-size: var(--fs);
}

.fit-answer .big, .print-answer .big {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: var(--fs-m);
}

/* ---------- 5 print ---------- */

.print-body { display: flex; gap: 8px; align-items: stretch; }
.dpi { flex: none; }
.dpi input { width: 70px; }

.print-answer {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
}

/* ---------- footer ---------- */

.platefoot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 16px;
  border-top: 1.5px solid var(--ink);
  padding-top: 6px;
  font-size: var(--fs);
}

.fell-i { font-family: 'IM Fell English', Georgia, serif; font-style: italic; font-size: calc(var(--fs) + 1px); }

/* ---------- method / privacy pages ---------- */

.prose main {
  max-width: 760px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 26px 30px;
}

.prose h1 { font-size: 40px; margin: 0 0 10px; }

.prose h2 {
  display: block;
  font-size: 24px;
  margin: 26px 0 8px;
}

.prose p, .prose li { max-width: 62ch; font-size: 15px; }

.prose footer {
  max-width: 760px;
  margin: 14px auto 20px;
  color: var(--paper);
  font-size: 14px;
  padding: 0 16px;
}

.prose footer a { color: var(--paper); }

/* ---------- size tiers (one-screen layout only) ----------
   Last in the file so they override the tokens above. */

/* short windows: drop the explanations, tighten section 1.
   The colour key stays: it is how the page explains itself. */
@media (max-height: 800px) {
  .hint.long, .tagline { display: none; }
  :root {
    --s1-h: 36px; --s1-fs: 18px;
    --s1b-h: 30px; --s1b-fs: 15px;
    --col-gap: 7px; --sec-gap: 5px;
    --tools-h: 160px;
  }
  .s1 { padding: 8px 10px 10px; }
  th, td { padding: 3px 6px; }
}

/* roomy screens, e.g. 1680 × 1050 */
@media (min-width: 1500px) and (min-height: 880px) {
  :root {
    --fs: 12px; --fs-s: 10.5px; --fs-m: 14px;
    --h1: 32px; --h2: 18px;
    --field-h: 30px; --field-fs: 13px;
    --s1-h: 50px; --s1-fs: 24px;
    --s1b-h: 40px; --s1b-fs: 19px;
    --btn-h: 30px;
    --fit-h: 240px; --left-w: 370px; --tools-h: 232px;
    --col-gap: 12px; --sec-gap: 7px; --g-gap: 22px;
  }
}

/* big monitors, e.g. 1920 × 1080 */
@media (min-width: 1800px) and (min-height: 1000px) {
  :root {
    --fs: 13px; --fs-s: 11px; --fs-m: 15px;
    --h1: 36px; --h2: 20px;
    --field-h: 32px; --field-fs: 14px;
    --s1-h: 56px; --s1-fs: 27px;
    --s1b-h: 44px; --s1b-fs: 21px;
    --btn-h: 32px;
    --fit-h: 288px; --left-w: 410px; --tools-h: 272px;
    --col-gap: 14px; --sec-gap: 8px; --g-gap: 26px;
  }
}
