/* ============================================================
   Episquire Web Design System — CYANOTYPE REGISTER · components
   EPQ-REG · REV A · 2026-11-15
   Requires tokens.css. Appearance only comes from tokens.
   Square corners everywhere except drawn objects (balloons,
   registration marks), which are circles because they are
   circles in a drawing, not because a container got soft.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* ---------- GROUND ---------- */
.reg-ground {
  margin: 0;
  background-color: var(--reg-ground);
  background-image:
    linear-gradient(var(--reg-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--reg-grid-major) 1px, transparent 1px),
    linear-gradient(var(--reg-grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--reg-grid-minor) 1px, transparent 1px);
  background-size:
    calc(var(--reg-grid-step) * 5) calc(var(--reg-grid-step) * 5),
    calc(var(--reg-grid-step) * 5) calc(var(--reg-grid-step) * 5),
    var(--reg-grid-step) var(--reg-grid-step),
    var(--reg-grid-step) var(--reg-grid-step);
  color: var(--reg-pencil);
  font-family: var(--reg-font-body);
  font-size: var(--reg-t-body);
  font-weight: var(--reg-w-body);
  line-height: 1.5;
  letter-spacing: .006em;
  -webkit-font-smoothing: antialiased;
}
.reg-ground ::selection { background: var(--reg-pencil); color: var(--reg-ground); }
.reg-ground :focus-visible { outline: 3px solid var(--reg-focus); outline-offset: 3px; }
.reg-ground input:focus-visible { outline-offset: -3px; }
.reg-ground a { color: var(--reg-pencil); text-decoration-line: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
.reg-ground a:hover { text-decoration-thickness: 2px; }

/* ---------- SHEET: the unit of a page ----------
   A page is a stack of sheets. Each sheet carries the drawing-office
   furniture: ruled border, zone letters/numbers, registration marks,
   a title block. */
.reg-sheet {
  position: relative;
  width: calc(100% - 2 * var(--reg-sheet-gap));
  max-width: var(--reg-page-max);
  min-height: min(900px, calc(100svh - 2 * var(--reg-sheet-gap)));
  margin: var(--reg-sheet-gap) auto;
  padding: var(--reg-zone);
  border: var(--reg-hair) solid var(--reg-pencil-faint);
  display: grid;
}
.reg-frame {
  position: relative;
  border: var(--reg-rule) solid var(--reg-pencil);
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

/* zone letters and numbers: top/bottom 1-8, left/right A-E */
.reg-zones {
  position: absolute;
  display: grid;
  font: var(--reg-w-label) var(--reg-t-label)/1 var(--reg-font-mono);
  letter-spacing: var(--reg-track-label);
  color: var(--reg-pencil-70);
  pointer-events: none;
}
.reg-zones > span { display: grid; place-items: center; border-color: var(--reg-pencil-faint); border-style: solid; border-width: 0; }
.reg-zones--top, .reg-zones--bottom { left: var(--reg-zone); right: var(--reg-zone); height: var(--reg-zone); grid-template-columns: repeat(8, 1fr); }
.reg-zones--top { top: 0; }
.reg-zones--bottom { bottom: 0; }
.reg-zones--top > span + span, .reg-zones--bottom > span + span { border-left-width: var(--reg-hair); }
.reg-zones--left, .reg-zones--right { top: var(--reg-zone); bottom: var(--reg-zone); width: var(--reg-zone); grid-template-rows: repeat(5, 1fr); }
.reg-zones--left { left: 0; }
.reg-zones--right { right: 0; }
.reg-zones--left > span + span, .reg-zones--right > span + span { border-top-width: var(--reg-hair); }

/* registration marks: crosshair in a circle, one per frame corner */
.reg-mark {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  border: var(--reg-hair) solid var(--reg-pencil);
  background:
    linear-gradient(var(--reg-pencil), var(--reg-pencil)) center / var(--reg-hair) 160% no-repeat,
    linear-gradient(var(--reg-pencil), var(--reg-pencil)) center / 160% var(--reg-hair) no-repeat;
  pointer-events: none;
}
.reg-mark--tl { top: 14px; left: 14px; }
.reg-mark--tr { top: 14px; right: 14px; }
.reg-mark--bl { bottom: 14px; left: 14px; }
.reg-mark--br { bottom: 14px; right: 14px; }

/* ---------- HEAD BAND (clause line, or nav) ---------- */
.reg-head {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px;
  min-height: 72px; padding: 14px var(--reg-pad);
  border-bottom: var(--reg-rule) solid var(--reg-pencil);
  font: var(--reg-w-label) var(--reg-t-label)/1.2 var(--reg-font-mono);
  letter-spacing: var(--reg-track-label); text-transform: uppercase;
}
.reg-head--nav { grid-template-columns: 1fr auto 1fr; padding: 14px 52px; }
.reg-head--nav > :last-child { justify-self: end; }
.reg-head-note { color: var(--reg-pencil-70); text-align: right; }

/* clause line: "2.0  THE SUITE" */
.reg-clause { font: var(--reg-w-label) var(--reg-t-label)/1.2 var(--reg-font-mono); letter-spacing: var(--reg-track-label); text-transform: uppercase; display: inline-flex; gap: 18px; align-items: baseline; color: var(--reg-pencil); font-weight: var(--reg-w-strong); }
.reg-clause > i { font-style: normal; font-weight: var(--reg-w-label); color: var(--reg-pencil-70); }

.reg-body { padding: var(--reg-pad); min-width: 0; }
.reg-foot {
  display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-end;
  padding: 0 var(--reg-pad) 0 var(--reg-pad);
}
.reg-foot > .reg-notes { padding-bottom: 28px; }
.reg-foot > .reg-tb { margin-right: calc(-1 * var(--reg-pad)); margin-left: auto; }

/* ---------- TITLE BLOCK ---------- */
.reg-tb {
  display: grid; width: min(760px, 100%);
  grid-template-columns: 290px 1fr 180px;
  gap: var(--reg-hair); background: var(--reg-pencil-faint);
  border-top: var(--reg-rule) solid var(--reg-pencil); border-left: var(--reg-rule) solid var(--reg-pencil);
  font: var(--reg-w-label) var(--reg-t-label)/1.3 var(--reg-font-mono);
  letter-spacing: var(--reg-track-label); text-transform: uppercase;
}
.reg-tb > * { background: var(--reg-ground-deep); padding: 10px 14px; min-width: 0; }
.reg-tb small { display: block; font-size: var(--reg-t-label); color: var(--reg-pencil-70); margin-bottom: 4px; }
.reg-tb strong { font-weight: var(--reg-w-strong); color: var(--reg-pencil); overflow-wrap: anywhere; }
.reg-tb-mark { white-space: nowrap; grid-row: span 2; display: grid; align-content: center; gap: 14px; }
.reg-tb-wide { grid-column: span 2; color: var(--reg-pencil-70); }
.reg-tb-row { grid-column: 1 / -1; display: grid; grid-template-columns: 1.2fr .6fr .6fr 1fr; gap: var(--reg-hair); padding: 0; background: var(--reg-pencil-faint); }
.reg-tb-row > * { background: var(--reg-ground-deep); padding: 10px 14px; }

/* ---------- WORDMARK ---------- */
.reg-wm {
  display: inline-block; color: var(--reg-pencil); text-decoration: none;
  font-family: var(--reg-font-display); font-size: var(--reg-t-title);
  font-variation-settings: "wdth" 125, "wght" 800; font-weight: var(--reg-w-hero);
  letter-spacing: -.012em; line-height: 1; text-transform: uppercase;
}
.reg-ground a.reg-wm:hover { text-decoration: none; }
.reg-wm-axis { position: relative; display: inline-block; padding-bottom: .2em; }
.reg-wm-axis::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: .15em;
  border: calc(var(--reg-rule) * .8) solid var(--reg-pencil); border-top: 0;
}
.reg-wm-tick { display: none; } /* ticks are the ::after's end borders; element kept for markup parity */

/* ---------- TYPE ROLES ---------- */
.reg-eyebrow, .reg-label {
  font: var(--reg-w-label) var(--reg-t-label)/1.4 var(--reg-font-mono);
  letter-spacing: var(--reg-track-label); text-transform: uppercase; color: var(--reg-pencil-70);
}
.reg-eyebrow--wide { letter-spacing: .5em; color: var(--reg-pencil); font-size: var(--reg-t-body); font-weight: var(--reg-w-strong); }

/* outlined lettering: drawn, with its construction showing. Hatched fill = tone by density. */
.reg-outline {
  margin: 0; font-family: var(--reg-font-display); text-transform: uppercase;
  font-variation-settings: "wdth" 125, "wght" 800; font-weight: var(--reg-w-hero);
  letter-spacing: .01em; line-height: .94;
  font-size: clamp(56px, 16cqw, var(--reg-t-mark));
  color: transparent; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 2px var(--reg-pencil);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M0 6L6 0M-1.5 1.5L1.5-1.5M4.5 7.5L7.5 4.5' stroke='%23F3F7FB' stroke-opacity='.34' stroke-width='1'/%3E%3C/svg%3E");
  -webkit-background-clip: text; background-clip: text;
}
[data-reg-theme="whiteprint"] .reg-outline {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M0 6L6 0M-1.5 1.5L1.5-1.5M4.5 7.5L7.5 4.5' stroke='%23174A84' stroke-opacity='.4' stroke-width='1'/%3E%3C/svg%3E");
}
.reg-outline--md { font-size: clamp(40px, 7cqw, var(--reg-t-display)); }
.reg-hero { container-type: inline-size; }

/* chalk lettering: filled pencil with graphite tooth (needs register-defs.svg inlined) */
.reg-chalk {
  margin: 0; color: var(--reg-pencil); filter: url(#reg-chalk);
  font-family: var(--reg-font-display); text-transform: uppercase;
  font-variation-settings: "wdth" 125, "wght" 800; font-weight: var(--reg-w-hero);
  letter-spacing: .01em; line-height: 1.12;
  font-size: var(--reg-t-statement);
}
.reg-chalk--title { font-size: var(--reg-t-title); }

.reg-lede { max-width: var(--reg-measure); margin: 0; font-size: var(--reg-t-body); color: var(--reg-pencil); }
.reg-prose { max-width: var(--reg-measure); }
.reg-prose p { margin: 0 0 1em; }

/* ---------- HATCH: identity by pattern, never by hue ---------- */
:root {
  --reg-hatch-capture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M0 8L8 0M-2 2L2-2M6 10L10 6' stroke='%23F3F7FB' stroke-opacity='.8'/%3E%3C/svg%3E");
  --reg-hatch-extract: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='5'%3E%3Ccircle cx='2.5' cy='2.5' r='.9' fill='%23F3F7FB' fill-opacity='.85'/%3E%3C/svg%3E");
  --reg-hatch-queue: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M0 3H6' stroke='%23F3F7FB' stroke-opacity='.8'/%3E%3C/svg%3E");
  --reg-hatch-ratify: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M0 8L8 0M-2 2L2-2M6 10L10 6M0 0L8 8M-2 6L2 10M6-2L10 2' stroke='%23F3F7FB' stroke-opacity='.8'/%3E%3C/svg%3E");
  --reg-hatch-keep: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 .5H12M0 4.5H12M.5 0V4M6.5 4V8' stroke='%23F3F7FB' stroke-opacity='.8'/%3E%3C/svg%3E");
  --reg-hatch-canon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Cpath d='M0 0L10 10M-2.5 7.5L2.5 12.5M7.5-2.5L12.5 2.5' stroke='%23F3F7FB' stroke-opacity='.8'/%3E%3C/svg%3E");
  --reg-hatch-recall: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='6'%3E%3Cpath d='M0 3H7' stroke='%23F3F7FB' stroke-opacity='.8'/%3E%3Cpath d='M9 3H10' stroke='%23F3F7FB' stroke-opacity='.8'/%3E%3C/svg%3E");
}
[data-reg-theme="whiteprint"] {
  /* re-pointed by swapping the stroke colour in the data URIs */
  --reg-hatch-capture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M0 8L8 0M-2 2L2-2M6 10L10 6' stroke='%23174A84' stroke-opacity='.8'/%3E%3C/svg%3E");
  --reg-hatch-extract: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='5'%3E%3Ccircle cx='2.5' cy='2.5' r='.9' fill='%23174A84' fill-opacity='.85'/%3E%3C/svg%3E");
  --reg-hatch-queue: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M0 3H6' stroke='%23174A84' stroke-opacity='.8'/%3E%3C/svg%3E");
  --reg-hatch-ratify: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M0 8L8 0M-2 2L2-2M6 10L10 6M0 0L8 8M-2 6L2 10M6-2L10 2' stroke='%23174A84' stroke-opacity='.8'/%3E%3C/svg%3E");
  --reg-hatch-keep: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 .5H12M0 4.5H12M.5 0V4M6.5 4V8' stroke='%23174A84' stroke-opacity='.8'/%3E%3C/svg%3E");
  --reg-hatch-canon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Cpath d='M0 0L10 10M-2.5 7.5L2.5 12.5M7.5-2.5L12.5 2.5' stroke='%23174A84' stroke-opacity='.8'/%3E%3C/svg%3E");
  --reg-hatch-recall: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='6'%3E%3Cpath d='M0 3H7' stroke='%23174A84' stroke-opacity='.8'/%3E%3Cpath d='M9 3H10' stroke='%23174A84' stroke-opacity='.8'/%3E%3C/svg%3E");
}
.reg-hatch-capture { background-image: var(--reg-hatch-capture); }
.reg-hatch-extract { background-image: var(--reg-hatch-extract); }
.reg-hatch-queue   { background-image: var(--reg-hatch-queue); }
.reg-hatch-ratify  { background-image: var(--reg-hatch-ratify); }
.reg-hatch-keep    { background-image: var(--reg-hatch-keep); }
.reg-hatch-canon   { background-image: var(--reg-hatch-canon); }
.reg-hatch-recall  { background-image: var(--reg-hatch-recall); }

.reg-swatch { display: block; width: 68px; height: 44px; border: var(--reg-rule) solid var(--reg-pencil); background-color: var(--reg-fill); flex: none; }

/* hatch key: swatch · number+name · one line of meaning */
.reg-hatchkey { list-style: none; margin: 0; padding: 0; border-top: var(--reg-rule) solid var(--reg-pencil); }
.reg-hatchkey > li { display: grid; grid-template-columns: 68px 1fr; gap: 22px; align-items: center; padding: 14px 0; border-bottom: var(--reg-hair) solid var(--reg-pencil-faint); }
.reg-hatchkey b { display: block; font: var(--reg-w-strong) var(--reg-t-body)/1.2 var(--reg-font-mono); letter-spacing: .2em; text-transform: uppercase; }
.reg-hatchkey b i { font-style: normal; font-weight: var(--reg-w-label); color: var(--reg-pencil-70); margin-right: 18px; font-size: var(--reg-t-label); letter-spacing: var(--reg-track-label); }
.reg-hatchkey span { display: block; margin-top: 4px; font: var(--reg-w-label) var(--reg-t-label)/1.35 var(--reg-font-mono); letter-spacing: var(--reg-track-label); text-transform: uppercase; color: var(--reg-pencil-70); }

/* ---------- LINE KEY ---------- */
.reg-linekey { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 32px; margin: 0; padding: 0; list-style: none; }
.reg-linekey li { display: flex; align-items: center; gap: 22px; font: var(--reg-w-label) var(--reg-t-label)/1.2 var(--reg-font-mono); letter-spacing: var(--reg-track-label); text-transform: uppercase; color: var(--reg-pencil-70); }
.reg-line { display: block; width: 96px; height: var(--reg-rule); flex: none; position: relative; }
.reg-line--visible { background: var(--reg-pencil); }
.reg-line--hidden { height: var(--reg-hair); background: repeating-linear-gradient(90deg, var(--reg-pencil) 0 7px, transparent 7px 12px); }
.reg-line--centre { height: var(--reg-hair); background: repeating-linear-gradient(90deg, var(--reg-pencil) 0 16px, transparent 16px 21px, var(--reg-pencil) 21px 24px, transparent 24px 29px); }
.reg-line--flow { height: var(--reg-hair); background: repeating-linear-gradient(90deg, var(--reg-pencil) 0 7px, transparent 7px 12px); }
.reg-line--flow::after { content: ""; position: absolute; right: -2px; top: -4px; border: 4.5px solid transparent; border-left: 10px solid var(--reg-pencil); border-right: 0; }

/* ---------- BALLOONS, LEADERS, NOTES ---------- */
.reg-balloon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none;
  border: var(--reg-hair) solid var(--reg-pencil); background: var(--reg-ground);
  font: var(--reg-w-label) var(--reg-t-label)/1 var(--reg-font-mono); letter-spacing: .04em; color: var(--reg-pencil);
}
.reg-seq { list-style: none; margin: 0; padding: 0; border-top: var(--reg-rule) solid var(--reg-pencil); }
.reg-seq li { display: flex; align-items: center; gap: 18px; padding: 12px 0; border-bottom: var(--reg-hair) solid var(--reg-pencil-faint); font: var(--reg-w-label) var(--reg-t-label)/1.3 var(--reg-font-mono); letter-spacing: var(--reg-track-label); text-transform: uppercase; }

.reg-notes { margin: 0; padding: 0; list-style: none; counter-reset: reg-note; font: var(--reg-w-label) var(--reg-t-label)/1.7 var(--reg-font-mono); letter-spacing: var(--reg-track-label); text-transform: uppercase; color: var(--reg-pencil-70); max-width: 62ch; }
.reg-notes::before { content: "Notes"; display: block; margin-bottom: 6px; color: var(--reg-pencil-70); }
.reg-notes li { counter-increment: reg-note; }
.reg-notes li::before { content: counter(reg-note) "  "; color: var(--reg-pencil); }

/* ---------- TABLE: the parts list ---------- */
.reg-tbl { width: 100%; border-collapse: collapse; border: var(--reg-rule) solid var(--reg-pencil); font: var(--reg-w-label) var(--reg-t-label)/1.35 var(--reg-font-mono); letter-spacing: var(--reg-track-label); text-transform: uppercase; font-variant-numeric: tabular-nums; }
.reg-tbl caption { caption-side: top; text-align: left; padding: 0 0 10px; color: var(--reg-pencil-70); }
.reg-tbl th { text-align: left; font-weight: var(--reg-w-label); color: var(--reg-pencil-70); padding: 12px 16px; border-bottom: var(--reg-hair) solid var(--reg-pencil); }
.reg-tbl td { padding: 14px 16px; border-bottom: var(--reg-hair) solid var(--reg-pencil-faint); }
.reg-tbl tr:last-child td { border-bottom: 0; }
.reg-tbl th + th, .reg-tbl td + td { border-left: var(--reg-hair) solid var(--reg-pencil-faint); }
.reg-tbl-wrap { overflow-x: auto; }

/* ---------- KEY (the pressable control) and the PRESS ----------
   Rest: stands proud, 5px hard offset, plates in register (all 0,0).
   Contact: plates splay on hard offsets, zero blur, key travels.
   Recovery, then seated: back in register, travel 5px, offset 0.
   Four frames at 0 / 96 / 208 / 320 ms, stepped. See README §Press. */
.reg-key {
  --tr: 0px; --sh: var(--reg-ghost);
  --cx: 0px; --cy: 0px; --mx: 0px; --my: 0px; --yx: 0px; --yy: 0px;
  appearance: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  min-height: 48px; min-width: 48px; padding: 0 30px; margin: 0;
  background: var(--reg-ground); color: var(--reg-pencil);
  border: var(--reg-rule) solid var(--reg-pencil); border-radius: 0; cursor: pointer;
  font: var(--reg-w-label) var(--reg-t-body)/1 var(--reg-font-mono);
  letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  transform: translate(var(--tr), var(--tr));
  box-shadow:
    var(--cx) var(--cy) 0 0 color-mix(in srgb, var(--reg-plate-c) var(--reg-plate-a), transparent),
    var(--mx) var(--my) 0 0 color-mix(in srgb, var(--reg-plate-m) var(--reg-plate-a), transparent),
    var(--yx) var(--yy) 0 0 color-mix(in srgb, var(--reg-plate-y) var(--reg-plate-a), transparent),
    var(--sh) var(--sh) 0 0 var(--reg-pencil-faint);
}
.reg-ground a.reg-key, .reg-ground a.reg-key:hover { text-decoration: none; }
.reg-key:active, .reg-key.is-pressing { animation: reg-press var(--reg-press-ms) steps(1, end) forwards; }
@keyframes reg-press {
  0%   { --tr: 0px; --sh: 5px; --cx: 0px;  --cy: 0px; --mx: 0px; --my: 0px;  --yx: 0px; --yy: 0px; }
  30%  { --tr: 3px; --sh: 2px; --cx: -7px; --cy: 5px; --mx: 7px; --my: -4px; --yx: 3px; --yy: 8px; }
  65%  { --tr: 4px; --sh: 0px; --cx: -3px; --cy: 2px; --mx: 3px; --my: -2px; --yx: 1px; --yy: 3px; }
  100% { --tr: 5px; --sh: 0px; --cx: 0px;  --cy: 0px; --mx: 0px; --my: 0px;  --yx: 0px; --yy: 0px; }
}
/* a frozen frame, for a static composition or the spec sheet. One per sheet outside the spec. */
.reg-key[data-frame="1"] { --tr: 3px; --sh: 2px; --cx: -7px; --cy: 5px; --mx: 7px; --my: -4px; --yx: 3px; --yy: 8px; }
.reg-key[data-frame="2"] { --tr: 4px; --sh: 0px; --cx: -3px; --cy: 2px; --mx: 3px; --my: -2px; --yx: 1px; --yy: 3px; }
.reg-key[data-frame="3"] { --tr: 5px; --sh: 0px; }
.reg-key[data-frame] { animation: none; cursor: default; }

/* ---------- FORM ---------- */
.reg-field { display: grid; gap: 8px; }
.reg-input {
  appearance: none; width: 100%; min-height: 56px; padding: 0 18px; border-radius: 0;
  background: var(--reg-fill); color: var(--reg-pencil);
  border: var(--reg-rule) solid var(--reg-pencil);
  font: var(--reg-w-body) var(--reg-t-body)/1 var(--reg-font-mono); letter-spacing: .04em;
}
.reg-input::placeholder { color: var(--reg-pencil-70); opacity: 1; }
.reg-tag {
  display: inline-block; padding: 5px 12px; border: var(--reg-hair) solid var(--reg-pencil);
  font: var(--reg-w-label) var(--reg-t-label)/1.2 var(--reg-font-mono); letter-spacing: var(--reg-track-label); text-transform: uppercase;
}

/* ---------- FIGURES ---------- */
.reg-fig { margin: 0; }
.reg-fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.reg-fig figcaption { margin-top: 10px; font: var(--reg-w-label) var(--reg-t-label)/1.4 var(--reg-font-mono); letter-spacing: var(--reg-track-label); text-transform: uppercase; color: var(--reg-pencil-70); }
.reg-svg { fill: none; stroke: var(--reg-pencil); stroke-width: 1.4; stroke-linejoin: miter; stroke-linecap: butt; }
.reg-svg .hid { stroke-dasharray: 5 4; stroke-opacity: .6; stroke-width: 1; }
.reg-svg .ctr { stroke-dasharray: 14 4 3 4; stroke-opacity: .7; stroke-width: 1; }
.reg-svg .fine { stroke-opacity: .55; stroke-width: 1; }
.reg-svg .plate-fill { fill: var(--reg-fill); }
.reg-svg text { fill: var(--reg-pencil-70); stroke: none; font: var(--reg-w-label) var(--reg-t-label) var(--reg-font-mono); letter-spacing: .16em; text-transform: uppercase; }
.reg-pencil { filter: url(#reg-pencil); }

/* ---------- LAYOUT HELPERS (layout only; no appearance) ---------- */
.reg-cols { display: grid; gap: 56px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.reg-stack { display: grid; gap: 28px; align-content: start; }
.reg-row { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }

/* ---------- SMALL SCREENS ----------
   Zones and corner marks go; the ruled frame and title block stay. */
@media (max-width: 900px) {
  :root { --reg-sheet-gap: 12px; --reg-zone: 0px; --reg-pad: 22px; }
  .reg-zones, .reg-mark { display: none; }
  .reg-sheet { padding: 0; }
  .reg-head, .reg-head--nav { padding: 12px 18px; grid-template-columns: 1fr auto; }
  .reg-head--nav > :nth-child(2) { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .reg-head-note { display: none; }
  .reg-cols { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .reg-cols > * { grid-column: 1 / -1 !important; }
  .reg-foot > .reg-tb { margin-right: calc(-1 * var(--reg-pad)); width: calc(100% + var(--reg-pad)); }
  .reg-tb { grid-template-columns: 1fr 1fr; }
  .reg-tb-mark { grid-column: 1 / -1; grid-row: auto; }
  .reg-tb-wide { grid-column: 1 / -1; }
  .reg-tb-row { grid-template-columns: 1fr 1fr; }
  .reg-linekey { grid-template-columns: 1fr; }
  .reg-key { padding: 0 20px; letter-spacing: .08em; }
  .reg-chalk { font-size: var(--reg-t-title); }
}

/* ============================================================
   LONG-FORM (A6) · one continuous sheet
   A document that reads, not a stack of screens. One sheet, one frame:
   zone numbers top and bottom, registration marks at the four corners,
   a contents rail, a measured prose column, margin notes, and the title
   block once, at the end. No zone letters: they would repeat down a tall
   frame and mean nothing. Sheet number is "1 / 1".
   ============================================================ */
.reg-sheet--flow { min-height: 0; }
.reg-sheet--flow > .reg-zones--left, .reg-sheet--flow > .reg-zones--right { display: none; }
.reg-sheet--flow .reg-frame { grid-template-rows: auto auto auto; }

.reg-doc {
  display: grid; gap: 56px; padding: var(--reg-pad); align-items: start;
  grid-template-columns: 240px minmax(0, 1fr);
}
.reg-doc-main { min-width: 0; display: grid; gap: 72px; }

/* contents rail: sticky, hairline between entries, current entry takes the 2px rule */
.reg-toc { position: sticky; top: 24px; display: grid; gap: 0; align-content: start; }
.reg-toc > .reg-label { margin: 0 0 12px; }
.reg-toc ol { list-style: none; margin: 0; padding: 0; border-top: var(--reg-rule) solid var(--reg-pencil); }
.reg-toc li { border-bottom: var(--reg-hair) solid var(--reg-pencil-faint); }
.reg-toc a {
  display: grid; grid-template-columns: 44px 1fr; gap: 6px; align-items: baseline; min-height: 48px; padding: 12px 0;
  font: var(--reg-w-label) var(--reg-t-label)/1.3 var(--reg-font-mono); letter-spacing: var(--reg-track-label); text-transform: uppercase;
  text-decoration: none; color: var(--reg-pencil-70);
}
.reg-toc a i { font-style: normal; color: var(--reg-pencil-70); }
.reg-toc a[aria-current="true"] { color: var(--reg-pencil); font-weight: var(--reg-w-strong); box-shadow: inset var(--reg-rule) 0 0 0 var(--reg-pencil); padding-left: 12px; grid-template-columns: 32px 1fr; }
.reg-ground .reg-toc a:hover { text-decoration: none; color: var(--reg-pencil); }

/* a section: clause line, title, then prose beside margin notes */
.reg-sec { display: grid; gap: 28px; min-width: 0; scroll-margin-top: 24px; }
.reg-sec > header { display: grid; gap: 18px; padding-top: 18px; border-top: var(--reg-rule) solid var(--reg-pencil); }
.reg-sec h2 { margin: 0; }
.reg-sec h3 { margin: 12px 0 0; font: var(--reg-w-strong) var(--reg-t-body)/1.3 var(--reg-font-mono); letter-spacing: .12em; text-transform: uppercase; }
.reg-pair { display: grid; grid-template-columns: minmax(0, var(--reg-measure)) minmax(160px, 240px); gap: 48px; align-items: start; }
.reg-pair > :first-child { min-width: 0; }
.reg-pair p, .reg-sec > p { margin: 0 0 1em; max-width: var(--reg-measure); line-height: 1.6; }
.reg-pair p:last-child { margin-bottom: 0; }
.reg-sec ul:not([class]), .reg-sec ol:not([class]) { max-width: var(--reg-measure); padding-left: 1.2em; line-height: 1.6; margin: 0 0 1em; }
.reg-sec li::marker { color: var(--reg-pencil-70); }
.reg-sec code { font: var(--reg-w-body) .85em var(--reg-font-mono); letter-spacing: .02em; border-bottom: var(--reg-hair) dashed var(--reg-pencil-faint); }

/* margin note: drawn like a drawing note, hairline on the prose side */
.reg-margin {
  margin: 0; padding: 4px 0 4px 16px; border-left: var(--reg-hair) solid var(--reg-pencil-faint);
  font: var(--reg-w-label) var(--reg-t-label)/1.6 var(--reg-font-mono); letter-spacing: var(--reg-track-label); text-transform: uppercase; color: var(--reg-pencil-70);
}
.reg-margin b { display: block; color: var(--reg-pencil); font-weight: var(--reg-w-strong); }

/* pulled statement: outline rule, no quote marks */
.reg-statement { margin: 0; max-width: var(--reg-measure); padding: 6px 0 6px 28px; border-left: var(--reg-rule) solid var(--reg-pencil); font-size: var(--reg-t-title); line-height: 1.25; font-family: var(--reg-font-body); font-weight: var(--reg-w-strong); letter-spacing: -.004em; }
.reg-statement cite { display: block; margin-top: 14px; font: var(--reg-w-label) var(--reg-t-label)/1.4 var(--reg-font-mono); letter-spacing: var(--reg-track-label); text-transform: uppercase; color: var(--reg-pencil-70); font-style: normal; }

/* detail: a boxed excerpt, labelled like a drawing detail */
.reg-detail { border: var(--reg-rule) solid var(--reg-pencil); max-width: calc(var(--reg-measure) + 288px); }
.reg-detail > header { padding: 10px 16px; border-bottom: var(--reg-hair) solid var(--reg-pencil); font: var(--reg-w-label) var(--reg-t-label)/1.3 var(--reg-font-mono); letter-spacing: var(--reg-track-label); text-transform: uppercase; color: var(--reg-pencil-70); display: flex; justify-content: space-between; gap: 16px; }
.reg-detail > div { padding: 18px 16px; font: var(--reg-w-body) var(--reg-t-label)/1.7 var(--reg-font-mono); letter-spacing: .04em; overflow-x: auto; }

@media (max-width: 1100px) {
  .reg-doc { grid-template-columns: minmax(0, 1fr); }
  .reg-toc { position: static; }
  .reg-pair { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .reg-margin { border-left: 0; border-top: var(--reg-hair) solid var(--reg-pencil-faint); padding: 12px 0 0; }
}
@media (max-width: 900px) {
  .reg-doc { padding: var(--reg-pad) 18px; gap: 36px; }
  .reg-statement { font-size: var(--reg-t-body); padding-left: 18px; }
}
