/* prj.fatehi.dev as patent drawings: the main site's tokens (shared.css), the reference design's buttons, frames and
   labels (learning-site/src/atlas.css, edu.css), and the drawing conventions of the figures */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 40px; --s8: 64px;
  --ctl: 40px; --ctl-sm: 32px; --radius: 6px; --radius-lg: 8px;
  --frame: #2A3352; --edge: #48527A; --edge-hi: #6E78A0; --hover: #FFFFFF0D; --press: #FFFFFF17;
  --ink: #C3CAD6; --au: #D8B05A; --au2: #F6DE9C; --sig: #FFF4DA; --copper: #B8713A;
  --plate: 'Archivo', 'Atkinson Hyperlegible Next', system-ui, sans-serif;
}
html { scrollbar-gutter: stable; }
.sprite { position: absolute; }
.wrap { max-width: 1440px; }
.strip { position: sticky; top: 0; z-index: 30; border-block-end: 0; box-shadow: inset 0 -1px 0 var(--rule); }   /* the hairline inside the header's 56 px, as on edu */
/* the brand line, as on edu.fatehi.dev (learning-site/src/atlas.css, "strip"): the family's wordmark, a hairline, then
   this site with its variable on the main page's figure (x3 Projects) */
.brand { display: flex; align-items: center; gap: var(--s3); margin: 0; flex: none; font-variant-numeric: normal; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--moon); text-decoration: none; font-family: var(--serif); font-size: 1.15rem; font-weight: 420; line-height: 1.6; }
.wordmark svg { width: 28px; height: 28px; flex: none; color: var(--sodium); }
.site { color: var(--moon); text-decoration: none; font-family: var(--serif); font-size: 1.15rem; font-weight: 420; padding-inline-start: var(--s3); border-inline-start: 1px solid var(--rule); line-height: 1.3; }
.site i { color: var(--sodium); font-style: italic; font-weight: 400; }
.site sub { position: relative; font-size: 0.62em; line-height: 0; vertical-align: baseline; top: 0.3em; color: var(--sodium); margin-inline-end: 6px; }
.wordmark:hover, .site:hover { color: #fff; }

/* buttons and small labels, as on edu.fatehi.dev */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--ctl); padding: 0 var(--s4); border: 1px solid var(--edge); border-radius: var(--radius); background: #FFFFFF06; box-shadow: inset 0 1px 0 #FFFFFF0A; color: var(--moon); text-decoration: none; font-family: var(--sans); font-size: 0.875rem; font-weight: 500; line-height: 1.2; white-space: nowrap; cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s; }
.btn:hover { border-color: var(--edge-hi); background: var(--hover); color: #fff; }
.btn:active { background: var(--press); box-shadow: none; }
.btn.pri { border-color: var(--sodium); background: var(--sodium); box-shadow: inset 0 1px 0 #FFFFFF59; color: #0B1021; font-weight: 600; }
.btn.pri:hover { border-color: #F6E8C3; background: #F6E8C3; box-shadow: 0 0 18px #E9D49C40, inset 0 1px 0 #FFFFFF73; color: #0B1021; }
.btn.sm { min-height: var(--ctl-sm); padding: 0 var(--s3); font-size: 0.8125rem; }
.btn .arr { transition: transform 0.15s; } .btn:hover .arr { transform: translateX(2px); }
.btn[aria-pressed="true"] { border-color: var(--sodium); color: var(--sodium); background: #E9D49C12; }
.ucn { display: inline-block; font-family: var(--sans); font-size: 0.72rem; line-height: 1.5; letter-spacing: 0.02em; color: #8E97B6; border: 1px dashed #4A5578; border-radius: 4px; padding: 0 6px; font-style: normal; }
.kicker { margin: 0 0 var(--s2); font-family: var(--sans); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sodium); }

/* ---- the figures' line work (SVG) ---- */
svg.pk { display: block; width: 100%; height: auto; overflow: visible; }
.pk .ln:not([fill]) { fill: none; }
.pk .ln { stroke: var(--ink); stroke-width: 0.9; stroke-linejoin: round; stroke-linecap: round; }
.pk .ln.pap:not([fill]), .pk .bg { fill: var(--night); }
.pk .bg { stroke: none; }
.pk .ln.th { stroke-width: 0.55; stroke-opacity: 0.8; }
.pk .ln.hv { stroke-width: 1.8; }
.pk .ln.hid { stroke-dasharray: 3.2 2.4; stroke-width: 0.75; stroke-opacity: 0.7; }
.pk .ln.ctr { stroke-dasharray: 14 3 2 3; stroke-width: 0.55; stroke-opacity: 0.5; }
.pk .ln[class*=" h-"]:not(.pap) { fill-opacity: 1; }
.pk .ah { fill: var(--ink); }
.pk .mk { color: var(--ink); opacity: 0.85; }
.pk .tx { fill: var(--ink); font-family: var(--serif); font-size: 10px; }
.pk .tx.mono { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.16em; fill: var(--haze); }
.pk .tx.mono.big { font-size: 13px; letter-spacing: 0.3em; fill: #8E97B6; }
.pk .tx.dr2 { font-size: 9px; letter-spacing: 0.04em; }
.pk .tx.it { font-style: italic; font-size: 11px; }
.pk .nm .ld { fill: none; stroke: var(--ink); stroke-width: 0.5; stroke-opacity: 0.85; }
.pk .nm text { fill: var(--ink); font-family: var(--serif); font-style: italic; font-size: 12.5px; font-variant-numeric: lining-nums; }
.pk .nm { transition: opacity 0.2s; }
/* the gold copy: drawn in, stroke by stroke, when the figure is pointed at */
.pk .gl { fill: none; stroke: var(--au2); stroke-width: 1.1; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.3s ease-in; }
.pk .gl.hv { stroke-width: 1.8; }
.pk .gold { filter: drop-shadow(0 0 2.5px #D8B05A66); }
.on .pk .gl, .pk .gl.lit { stroke-dashoffset: 0; transition: stroke-dashoffset 0.95s cubic-bezier(0.45, 0, 0.25, 1); }
.on .pk .gl.d1 { transition-delay: 0.06s; } .on .pk .gl.d2 { transition-delay: 0.12s; } .on .pk .gl.d3 { transition-delay: 0.18s; }
.on .pk .gl.d4 { transition-delay: 0.24s; } .on .pk .gl.d5 { transition-delay: 0.3s; } .on .pk .gl.d6 { transition-delay: 0.36s; } .on .pk .gl.d7 { transition-delay: 0.42s; }
.on .pk .nm text, .pk .nm.lit text { fill: var(--sodium); }
.on .pk .nm .ld, .pk .nm.lit .ld { stroke: var(--au); stroke-opacity: 1; }
.on .pk .ah[data-p], .pk .ah.lit { fill: var(--au); }
.on .pk .mk { color: var(--au2); }
/* one part lit alone: the rest steps back, its section lining turns gold */
.pk.one .base > :not(.lit), .pk.one .nm:not(.lit) { opacity: 0.35; }
.pk.one .gl:not(.lit) { stroke-dashoffset: 1; transition-duration: 0.2s; transition-delay: 0s; }
.pk .lit.h-d { fill: url(#pk-d-g); } .pk .lit.h-b { fill: url(#pk-b-g); } .pk .lit.h-x { fill: url(#pk-x-g); }
.pk .lit.h-n { fill: url(#pk-n-g); } .pk .lit.h-h { fill: url(#pk-h-g); } .pk .lit.h-s { fill: url(#pk-s-g); }
.pk .base > *, .pk .nm { transition: opacity 0.2s; }
/* drawn in once, when the figure first comes into view */
.pk .dr { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.pk.drawn .dr { stroke-dashoffset: 0; transition: stroke-dashoffset 1.5s cubic-bezier(0.5, 0, 0.3, 1); }
.pk:not(.drawn) .ln.hid, .pk:not(.drawn) .ln.ctr, .pk:not(.drawn) .ln.th, .pk:not(.drawn) [class*=" h-"], .pk:not(.drawn) text, .pk:not(.drawn) .nums, .pk:not(.drawn) .ah, .pk:not(.drawn) .mk { opacity: 0; }
.pk.drawn .ln.hid, .pk.drawn .ln.ctr, .pk.drawn .ln.th, .pk.drawn text, .pk.drawn .nums, .pk.drawn .ah, .pk.drawn .mk { transition: opacity 0.7s 0.9s; }
.pk.drawn [class*=" h-"] { transition: opacity 0.7s 0.9s, fill 0.2s; }
.pk.still .dr, .pk.still * { transition: none !important; }

/* ---- the home: a short head, the drawing sheets, the brief description ---- */
.home-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: var(--s3) var(--s5); padding-block: var(--s6) var(--s5); }
.home-head h1 { font-size: var(--t-2xl); font-weight: 330; }
.home-head .lede-s { margin: var(--s2) 0 0; color: var(--haze); font-size: 1rem; max-width: 50ch; }
.home-head .grow { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2) var(--s3); }
.home-head .note { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--haze); }
.home-head .note.dm { color: var(--copper); }

/* a drawing sheet: the double margin line, the heading line of a patent sheet, the title block */
.sheet { position: relative; margin-block-end: var(--s6); padding: var(--s5) var(--s6) var(--s4); border: 1px solid #2E3650; outline: 1px solid #1A2036; outline-offset: 5px; border-radius: 2px; background: linear-gradient(#FFFFFF03, #FFFFFF03), var(--night); }
.sh-top { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding-block-end: var(--s3); margin-block-end: var(--s2); border-block-end: 1px solid var(--rule); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; color: var(--haze); text-transform: uppercase; }
.sh-top span:nth-child(3) { color: var(--sodium); }
.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4) var(--s7); }
.grp { grid-column: 1 / -1; display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; margin-block: var(--s4) 0; }
.grp h2 { margin: 0; font-family: var(--plate); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--moon); }
.grp h2 span { font-family: var(--mono); font-weight: 400; letter-spacing: 0.06em; text-transform: none; color: var(--haze); }
.grp .rule { flex: 1 1 4rem; height: 0; border-block-start: 1px dashed #3A4466; transform: translateY(-3px); }
.grp .figs-n { font-family: var(--serif); font-style: italic; font-size: 0.95rem; color: var(--haze); }
.grp .grp-note { flex-basis: 100%; font-family: var(--sans); font-size: 0.82rem; color: var(--haze); margin-block-start: -6px; }

/* one figure: the drawing, its number in italics, the name plate, then its text or its numbered parts */
.fg { position: relative; display: grid; grid-template-rows: auto 1fr; cursor: pointer; border-radius: var(--radius-lg); padding: var(--s2) var(--s2) var(--s3); transition: background-color 0.2s; }
.fg.on { background: #E9D49C08; }
.fg .dw { padding: var(--s2) var(--s1) 0; }
.fg .cap { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; column-gap: var(--s3); align-content: start; padding-inline: var(--s2); }
.fg .fno { grid-row: 1 / span 2; margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.35rem; line-height: 1.1; color: var(--haze); white-space: nowrap; font-variant-numeric: lining-nums; transition: color 0.2s; }
.fg.on .fno { color: var(--sodium); }
.fg .fno .dm, .brief .dm { font-family: var(--mono); font-style: normal; font-size: 0.68rem; letter-spacing: 0.08em; color: var(--copper); vertical-align: middle; }
.fg .plate { margin: 0; font-family: var(--plate); font-size: 0.95rem; font-weight: 650; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.3; }
.fg .plate .go { color: var(--moon); text-decoration: none; }
.fg .plate a.go::after { content: ' →'; letter-spacing: 0; color: var(--haze); transition: color 0.15s; }
.fg.on .plate .go { color: var(--au2); }
.fg.on .plate a.go::after { color: var(--sodium); }
.fg .tag { margin: 2px 0 0; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--haze); text-transform: uppercase; }
.fg .swap { grid-column: 1 / -1; display: grid; margin-block-start: var(--s2); }
.fg .swap > * { grid-area: 1 / 1; transition: opacity 0.2s; }
.fg .desc { margin: 0; font-size: 0.95rem; line-height: 1.5; color: var(--moon); }
.fg .refs { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px var(--s3); align-content: start; opacity: 0; visibility: hidden; }
.fg.on .desc { opacity: 0; } .fg.on .refs { opacity: 1; visibility: visible; }
.fg .refs li { font-family: var(--sans); font-size: 0.8rem; line-height: 1.35; color: var(--haze); padding: 2px 4px; border-radius: 3px; cursor: default; }
.fg .refs li b { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--sodium); margin-inline-end: 6px; font-variant-numeric: lining-nums; }
.fg .refs li.lit { background: #E9D49C14; color: var(--moon); }
.fg .refs li.none { grid-column: 1 / -1; font-style: italic; }
.fg .acts { grid-column: 1 / -1; align-self: end; margin: var(--s2) 0 0; display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.fg .study { position: relative; z-index: 2; font-family: var(--sans); font-size: 0.82rem; }
.fg.dummy .dw { opacity: 0.7; }
.fg.dummy .plate .go { color: var(--haze); }

.brief { padding-block: var(--s5) var(--s8); max-width: 62rem; }
.brief h2 { font-size: var(--t-xl); font-weight: 350; margin-block-end: var(--s4); }
.brief ol { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s2); }
.brief li { font-size: 0.95rem; line-height: 1.5; color: var(--haze); }
.brief li .fno { font-style: italic; color: var(--sodium); margin-inline-end: 4px; font-variant-numeric: lining-nums; }
.brief li b, .brief li a { font-weight: 500; }
.brief li b { color: var(--moon); }
.brief li.dummy { opacity: 0.6; }

/* the title block in the sheet's lower right corner */
.sh-block { display: flex; justify-content: end; margin-block-start: var(--s4); }
.sh-block { gap: 0; }
.sh-block > * { border: 1px solid #2E3650; border-inline-start-width: 0; padding: 4px 10px; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; color: var(--haze); text-transform: uppercase; display: flex; flex-direction: column; justify-content: center; }
.sh-block > :first-child { border-inline-start-width: 1px; }
.sh-block b { font-weight: 400; font-size: 0.6rem; color: #6E78A0; }
.sh-block svg.mk { width: 38px; height: 38px; padding: 6px; color: var(--sodium); }

/* footer: the family's links, and the colophon where the main site has it */
.foot .legal { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; font-family: var(--sans); font-size: 0.85rem; }
.foot .legal a { color: var(--haze); } .foot .legal a:hover { color: var(--moon); }
.foot .legal .copy { color: var(--haze); }

@media (max-width: 1100px) { .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .home-head { padding-block: var(--s5) var(--s4); }
  .home-head h1 { font-size: 1.75rem; }
  .sheet { padding: var(--s3) var(--s2) var(--s3); margin-inline: calc(var(--gutter) * -1 + 6px); outline-offset: 3px; }
  .figs { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .sh-top { font-size: 0.64rem; padding-inline: var(--s2); }
  .sh-top span:nth-child(2) { display: none; }
  .fg .refs { grid-template-columns: minmax(0, 1fr); }
  .grp { padding-inline: var(--s2); }
  .sh-block { padding-inline: var(--s2); }
}
@media (prefers-reduced-motion: reduce) { .btn, .btn .arr, .fg, .fg .swap > * { transition: none; } }
@media (max-width: 720px) {
  .fg .swap > * { grid-area: auto; }
  .fg .refs { display: none; }
  .fg.on .refs { display: grid; } .fg.on .desc { display: none; }
}

/* ---- a project's own sheet: the front page, the exploded view held beside the text, the running figure ---- */
.ps { padding-block-end: var(--s8); }
.ps-band { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding-block: var(--s5) var(--s2); border-block-end: 2px solid var(--au); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; color: var(--haze); text-transform: uppercase; }
.ps-band b { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 0.95rem; letter-spacing: 0; text-transform: none; color: var(--sodium); }
.front { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: var(--s5) var(--s8); padding-block: var(--s6); border-block-end: 1px solid var(--rule); align-items: end; }
.inid { margin: 0; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--haze); }
.inid span, .biblio dt span { color: var(--sodium); margin-inline-end: 6px; }
.front h1 { font-size: var(--t-3xl); font-weight: 300; line-height: 1; margin: var(--s1) 0 var(--s5); font-variation-settings: 'opsz' 72; }
.front .lede { max-width: 44ch; margin: var(--s1) 0 0; color: var(--moon); font-size: var(--t-lg); }
.biblio { margin: 0 0 var(--s4); display: grid; gap: 0; }
.biblio div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: var(--s3); padding-block: 6px; border-block-end: 1px solid var(--rule); }
.biblio dt { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--haze); padding-block-start: 3px; }
.biblio dd { margin: 0; font-family: var(--sans); font-size: 0.9rem; color: var(--moon); }
.biblio dd a { color: var(--sodium); text-decoration-color: #E9D49C77; text-underline-offset: 3px; }
.biblio dd a:hover { text-decoration-color: var(--sodium); }
.front .acts { display: flex; flex-wrap: wrap; gap: var(--s2); }
/* a code link still to come: one line in the button's own box, so it never looks like a broken button */
.front .acts .ucn { display: inline-flex; align-items: center; min-height: var(--ctl); padding: 0 var(--s3); border-radius: var(--radius); font-size: 0.8125rem; }
.ack { margin: var(--s4) 0 0; padding: var(--s3) var(--s4); border: 1px solid var(--frame); border-radius: var(--radius-lg); font-family: var(--sans); font-size: 0.88rem; color: var(--haze); line-height: 1.5; }
.ack b { display: block; margin-block-end: 2px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sodium); }

.xv-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s7); padding-block-start: var(--s6); align-items: start; }
.xv-fig { position: sticky; top: 72px; }
.xv-frame { position: relative; border: 1px solid #2E3650; outline: 1px solid #1A2036; outline-offset: 4px; border-radius: 2px; padding: var(--s4) var(--s4) var(--s2); }
.xv-cap { margin: var(--s1) 0 0; text-align: center; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--haze); }
.xv-cap .fno { font-family: var(--serif); font-style: italic; font-size: 1.15rem; letter-spacing: 0; text-transform: none; color: var(--moon); margin-inline-end: 6px; }
.xv-fig figcaption { margin-block-start: var(--s3); min-height: 3em; font-family: var(--sans); font-size: 0.92rem; color: var(--moon); max-width: none; }
.xv-fig figcaption b { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--sodium); margin-inline-end: 6px; }
.xv-fig figcaption:empty::before { content: 'Point at a numeral, here or in the text, to draw its part in gold.'; color: var(--haze); }
.xv-fig.on .pk .gl { stroke-dashoffset: 0; }
#xv .pk .nm { cursor: pointer; }

.prose section + section { margin-block-start: var(--s7); }
.prose h2 { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; font-size: var(--t-xl); font-weight: 350; margin-block-end: var(--s4); }
.prose h2 .sub { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--haze); }
.prose h3 { font-family: var(--plate); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--haze); margin: var(--s5) 0 var(--s2); }
.prose p { line-height: 1.65; }
/* a reference numeral in the text: a small italic button */
button.ref, .prose button[data-p] { display: inline; padding: 0 1px; margin: 0; border: 0; border-block-end: 1px dotted #E9D49C77; border-radius: 2px; background: none; color: var(--sodium); font-family: var(--serif); font-style: italic; font-size: 0.92em; font-variant-numeric: lining-nums; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
button.ref:hover, button.ref.lit { background: #E9D49C22; color: #fff; }
.claims { margin: 0; padding: 0; list-style: none; counter-reset: cl; display: grid; gap: var(--s3); }
.claims li { counter-increment: cl; position: relative; padding-inline-start: 2.2em; line-height: 1.6; }
.claims li::before { content: counter(cl) '.'; position: absolute; inset-inline-start: 0; font-family: var(--serif); font-variant-numeric: lining-nums; color: var(--haze); font-weight: 500; }
.refs-t { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.refs-t li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s3); align-items: baseline; border-block-end: 1px solid var(--rule); padding-block: 3px; }
.refs-t button.ref { display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: start; border: 0; padding: 3px 4px; font-style: normal; color: var(--moon); font-family: var(--sans); font-size: 0.88rem; }
.refs-t button.ref b { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--sodium); min-width: 2.2em; }
.refs-t .what { font-family: var(--sans); font-size: 0.84rem; color: var(--haze); line-height: 1.4; }
.parts-t { margin: 0; }
.parts-t div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--s3); padding-block: 7px; border-block-end: 1px solid var(--rule); }
.parts-t dt { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--haze); padding-block-start: 2px; }
.parts-t dd { margin: 0; font-family: var(--sans); font-size: 0.88rem; line-height: 1.45; }

/* the running figure: a frame with a lamp, as on the reference design */
.run-sec { padding-block-start: var(--s8); }
.run-sec h2 { display: flex; align-items: baseline; gap: var(--s3); font-size: var(--t-xl); font-weight: 350; margin-block-end: var(--s4); }
.run-sec h2 .fno { font-style: italic; color: var(--sodium); font-size: 0.8em; }
.run { border: 1px solid var(--frame); border-radius: var(--radius-lg); background: #0A0E1A; overflow: hidden; }
.run-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2) var(--s3); min-height: 40px; padding: var(--s2) var(--s4); border-block-end: 1px solid var(--rule); background: #0D1222; }
.run-bar .lamp { width: 8px; height: 8px; border-radius: 50%; background: var(--au); box-shadow: 0 0 8px #D8B05A; }
.run-bar .lbl { font-family: var(--sans); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--moon); }
.run-bar .tagm { margin-inline-start: auto; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--haze); }
.run-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s5); padding: var(--s4); align-items: start; }
.run label, .run .k { display: block; margin: 0 0 var(--s2); font-family: var(--sans); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--haze); }
.run .row .k { margin: 0; }
.run textarea { width: 100%; min-height: 84px; resize: vertical; padding: var(--s2) var(--s3); border: 1px solid var(--edge); border-radius: var(--radius); background: #070A14; color: var(--moon); font-family: var(--mono); font-size: 0.85rem; line-height: 1.5; }
.run textarea:focus-visible { outline: 2px solid var(--sodium); outline-offset: 2px; }
.run .row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-block: var(--s3); }
.seg { display: inline-flex; border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; }
.seg button { min-height: var(--ctl-sm); padding: 0 var(--s3); border: 0; border-inline-end: 1px solid var(--edge); background: none; color: var(--haze); font-family: var(--mono); font-size: 0.78rem; cursor: pointer; }
.seg button:last-child { border-inline-end: 0; }
.seg button[aria-pressed="true"] { background: #E9D49C1A; color: var(--sodium); }
.run canvas { display: block; width: 100%; height: auto; }
.msgs { list-style: none; margin: 0; padding: 0 var(--s4) var(--s3); display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 6px var(--s3); }
.msgs li { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: var(--s2); align-items: center; padding: 5px var(--s2); border: 1px solid var(--rule); border-radius: 6px; background: #0D1222; font-family: var(--mono); font-size: 0.7rem; color: var(--haze); }
.msgs li code { color: var(--moon); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs li code b { color: #E0876A; font-weight: 600; }
.msgs li .crc { color: var(--copper); }
.msgs li.ok .crc::after { content: ' ✓'; color: var(--sodium); }
.msgs li.bad { border-color: #E0876A; } .msgs li.bad .crc::after { content: ' ✗'; color: #E0876A; }
.run-out { margin: 0; padding: var(--s3) var(--s4); border-block-start: 1px solid var(--rule); font-family: var(--sans); font-size: 0.9rem; color: var(--haze); min-height: 3em; }
.run-out b { color: var(--sodium); font-weight: 600; } .run-out .fail b, .run-out .fail { color: #E0876A; }
.measures { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s4); font-family: var(--sans); }
.measures div { border-block-start: 1px solid var(--rule); padding-block-start: 6px; }
.measures dt { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--haze); }
.measures dd { margin: 0; font-family: var(--serif); font-size: 1.25rem; font-variant-numeric: lining-nums tabular-nums; color: var(--moon); }
.steps { margin: 0 0 var(--s3); padding: 0; list-style: none; counter-reset: st; display: grid; gap: 6px; font-family: var(--sans); font-size: 0.88rem; color: var(--haze); }
.steps li { counter-increment: st; display: flex; align-items: center; gap: var(--s2); }
.steps li::before { content: counter(st); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.2px solid #4A5578; font-family: var(--serif); font-size: 0.72rem; font-weight: 600; font-variant-numeric: lining-nums; }
.steps li.on { color: var(--moon); } .steps li.on::before { border-color: var(--sodium); background: var(--sodium); color: #0B1021; }
.steps li.done::before { border-color: var(--sodium); color: var(--sodium); }
/* AMAP-APP in the browser (Fig. 7B and the tool sheet): a file button, a hint, a view switch over the figure */
.btn.file { position: relative; overflow: hidden; }
.run label.btn { display: inline-flex; margin: 0; font-family: var(--sans); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--moon); max-width: 100%; }
.run label.btn span { overflow: hidden; text-overflow: ellipsis; }
.measures dt .u { text-transform: none; letter-spacing: 0; font-weight: 400; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn.file:focus-within { outline: 2px solid var(--sodium); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.run .hint { margin: 0 0 var(--s3); font-family: var(--sans); font-size: 0.82rem; color: var(--haze); }
.run .hint a, .tool a.inl { color: var(--moon); }
/* the view switch over the figure: three equal parts on one row, whatever the column's width */
.seg.views { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.12fr) minmax(0, 1fr); margin-block-end: var(--s2); }
.seg.views button { padding: 4px var(--s2); line-height: 1.25; white-space: normal; text-align: center; }
/* the measures: each value on the same line as its neighbour's, however many lines the labels take */
.measures div { display: flex; flex-direction: column; }
.measures dt { flex: 1 0 auto; }
canvas.drop { border-radius: 6px; }
.run canvas.drop { display: block; width: 100%; height: auto; aspect-ratio: 1; touch-action: pan-y; cursor: zoom-in; }
.run canvas.drop:focus-visible { outline: 2px solid var(--sodium); outline-offset: 2px; }
.run canvas.drop.zoomed { touch-action: none; cursor: grab; }
.run canvas.drop.zoomed.grab { cursor: grabbing; }
/* the zoom controls, on the figure's lower right corner */
.vw { position: relative; }
.zoom { position: absolute; inset-inline-end: var(--s2); inset-block-end: var(--s2); display: flex; align-items: center; border: 1px solid var(--edge); border-radius: var(--radius); background: #0B1021E6; font-family: var(--mono); font-size: 0.75rem; }
.zoom button { min-width: 32px; min-height: 30px; padding: 0 var(--s2); border: 0; border-inline-start: 1px solid var(--edge); background: none; color: var(--moon); font: inherit; cursor: pointer; }
.zoom button:first-child { border-inline-start: 0; }
.zoom button:hover:not(:disabled) { background: var(--hover); }
.zoom button:disabled { color: #4A5578; cursor: default; }
.zoom .zl { min-width: 4.2em; padding: 0 var(--s1); text-align: center; color: var(--haze); border-inline-start: 1px solid var(--edge); }
.zoom .zl:empty { display: none; }
/* the image is square: its column is at most as wide as 72% of the screen's height, so the switch over it, the
   image and the caption under it share one width and the whole figure stays in view */
.run-body.tl > .cv-fig { width: 100%; max-width: max(18rem, calc(100vh - 412px)); justify-self: center; }   /* the project bar, the wizard and the whole viewer (switch, square image, ‹ ›, caption) on one screen */
canvas.drop.over { outline: 2px dashed var(--sodium); outline-offset: -2px; }
/* the app's project bar: the project in hand, New, Rename, Delete, and its counts */
.proj { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s3) var(--s4); border-block-end: 1px solid var(--rule); background: #0B1021; }
.proj > .k { margin: 0; }
.tool .proj select.ctl { width: auto; min-width: 14rem; max-width: 100%; margin: 0; font-family: var(--sans); font-size: 0.9rem; }
.proj .acts, .proj .pform { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.proj .pform .ctl { width: 16rem; }
.proj .pq { font-family: var(--sans); font-size: 0.86rem; color: var(--moon); }
.proj .pq:empty { display: none; }
.proj .pstat { margin: 0 0 0 auto; font-family: var(--mono); font-size: 0.72rem; color: var(--haze); }
/* the list of images once it is long: a line to add more, a filter, chips by state, each image removable */
.dz.mini { grid-auto-flow: column; justify-content: start; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); text-align: start; }
.dz.mini svg { width: 22px; height: 22px; }
.dz.mini p:first-of-type b { font-weight: 500; font-size: 0.86rem; }
.dz.mini .hint { display: none; }
.lf { display: grid; gap: var(--s2); margin-block-start: var(--s3); }
.lf .ctl { margin: 0; }
.seg.chips { flex-wrap: wrap; justify-self: start; }
.seg.chips button { font-size: 0.72rem; padding: 0 var(--s2); }
.seg.chips button b { font-weight: 400; color: var(--haze); margin-inline-start: 2px; }
.tool .files { max-height: max(14rem, calc(100vh - 470px)); }   /* the list uses the screen's height beside the viewer */
.tool .files li { grid-template-columns: minmax(0, 1fr) auto auto auto; }   /* name, size, state, remove */
.files .rm { padding: 0 4px; border: 0; background: none; color: var(--haze); font: inherit; font-size: 0.9rem; line-height: 1; cursor: pointer; }
.files .rm:hover:not(:disabled) { color: #E0876A; }
.files .rm:disabled { opacity: 0.3; cursor: default; }
.files .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s3); font-size: 0.66rem; color: var(--haze); }
.files .meta .how { margin-inline-start: auto; }
.files .meta select.ch { min-height: 20px; padding: 0 2px; border: 1px solid var(--edge); border-radius: 4px; background: #070A14; color: var(--moon); font: inherit; }
.tool .files li { cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.tool .files li:hover { border-color: var(--edge-hi); }
.files li.stale { border-color: #8A6A1A; } .files li.stale .st { color: #C9A44A; }
.files li.stale .pb b { background: #8A6A1A; }
/* the results table scrolls in its frame, its head kept in view */
.res-in .tbl-wrap { overflow-x: auto; }   /* every measured image, the page grows with them */
/* the quick look at a row */
.peek { position: fixed; z-index: 30; width: 260px; padding: var(--s2); border: 1px solid var(--edge); border-radius: var(--radius-lg); background: #0B1021; box-shadow: 0 12px 32px #00000080; pointer-events: none; animation: pane-in 0.15s ease-out; }
.peek canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 4px; background: #070A14; }
.peek .pk-n { margin: var(--s2) 0 var(--s1); font-family: var(--mono); font-size: 0.72rem; color: var(--moon); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peek .pk-m { margin: 0; display: grid; gap: 2px; font-family: var(--sans); font-size: 0.76rem; }
.peek .pk-m div { display: flex; justify-content: space-between; gap: var(--s2); }
.peek .pk-m dt { color: var(--haze); } .peek .pk-m dd { margin: 0; color: var(--moon); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .peek { animation: none; } }
table.res thead th { position: sticky; top: 0; z-index: 1; background: #0D1222; }
@media (max-width: 720px) {
  .proj .pstat { margin: 0; width: 100%; }
  .tool .proj select.ctl { min-width: 0; flex: 1; }
}

/* the app's wizard: four steps, each a numbered stop with its own state under its name */
.wiz { list-style: none; margin: 0; padding: var(--s3) var(--s4); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); border-block-end: 1px solid var(--rule); counter-reset: none; }
.wiz li { position: relative; }
.wiz button { width: 100%; display: flex; align-items: center; gap: var(--s2); padding: var(--s2); border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--haze); font-family: var(--sans); font-size: 0.9rem; text-align: start; cursor: pointer; transition: background-color 0.15s, border-color 0.15s; }
.wiz button:hover:not(:disabled) { background: var(--hover); }
.wiz button:disabled { opacity: 0.45; cursor: default; }
.wiz i { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.2px solid #4A5578; font-family: var(--serif); font-style: normal; font-size: 0.82rem; font-weight: 600; font-variant-numeric: lining-nums; }
.wiz span { display: grid; min-width: 0; color: var(--moon); }
.wiz small { font-family: var(--mono); font-size: 0.68rem; color: var(--haze); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz button[aria-current="step"] { border-color: var(--edge); background: #E9D49C0D; }
.wiz button[aria-current="step"] i { border-color: var(--sodium); background: var(--sodium); color: #0B1021; }
.wiz button.done i { border-color: var(--sodium); color: transparent; position: relative; }
.wiz button.done i::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--sodium); }
.tool .pane { animation: pane-in 0.25s ease-out; }
@keyframes pane-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tool .row.nav { justify-content: space-between; margin-block-start: var(--s4); }
/* the drop zone */
.dz { display: grid; justify-items: center; gap: var(--s1); padding: var(--s5) var(--s4); border: 1.5px dashed var(--edge); border-radius: var(--radius-lg); background: #070A14; text-align: center; transition: border-color 0.15s, background-color 0.15s; }
.dz.over { border-color: var(--sodium); background: #E9D49C0F; }
.dz svg { width: 40px; height: 40px; fill: none; stroke: var(--sodium); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dz p { margin: 0; font-family: var(--sans); color: var(--moon); }
.dz p b { font-weight: 600; }
.dz .hint { margin-block-start: var(--s2); max-width: 34ch; }
.tool .files { margin-block-start: var(--s3); }
.files li { grid-template-columns: minmax(0, 1fr) auto auto; position: relative; overflow: hidden; }
.files .sz { color: var(--haze); }
.files .st:empty { display: none; }
.files .pb { position: absolute; inset-inline: 0; inset-block-end: 0; height: 2px; }
.files .pb b { display: block; height: 100%; background: var(--sodium); transform-origin: left; transform: scaleX(var(--f, 0)); transition: transform 0.3s; }
.files li.done .pb b { background: #6E78A0; }
/* progress bars */
.bar { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--s2); margin-block: var(--s2); font-family: var(--sans); font-size: 0.8rem; }
.bar .lbl { color: var(--moon); font-weight: 500; }
.bar .val { justify-self: end; font-family: var(--mono); font-size: 0.72rem; color: var(--haze); }
.bar i { grid-column: 1 / -1; display: block; height: 6px; border-radius: 3px; background: #1A2036; overflow: hidden; }
.bar b { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #B8913A, var(--sodium)); transform-origin: left; transform: scaleX(var(--f, 0)); }
.bar.big b { transition: transform 0.35s ease-out; }   /* only the images bar slides: the others change many times a second */
.bar.busy b { background: repeating-linear-gradient(-45deg, #E9D49C55 0 8px, #E9D49C22 8px 16px); background-size: 200% 100%; animation: bar-busy 1s linear infinite; }
@keyframes bar-busy { to { background-position: 45px 0; } }
.bar.big i { height: 10px; border-radius: 5px; }
.bar.big .lbl { font-size: 0.9rem; }
.bar.mini { display: inline-block; width: 6rem; margin: 0 0 0 var(--s2); vertical-align: middle; }
.bar.mini i { height: 4px; }
.prep { padding: var(--s3); margin-block-end: var(--s3); border: 1px solid var(--rule); border-radius: var(--radius); background: #070A14; }
.prep .k { margin-block-end: 0; }
.tool .now { margin: 0 0 var(--s2); font-family: var(--mono); font-size: 0.75rem; color: var(--moon); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.2em; }
/* the stages of the image at hand */
.pipe { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-family: var(--sans); font-size: 0.86rem; color: var(--haze); }
.pipe li { display: flex; align-items: center; gap: var(--s2); padding: 4px 0; }
.pipe li::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.2px solid #4A5578; }
.pipe li.on { color: var(--moon); } .pipe li.on::before { border-color: var(--sodium); background: var(--sodium); box-shadow: 0 0 0 0 #E9D49C88; animation: pulse 1.2s ease-out infinite; }
.pipe li.done::before { border-color: var(--sodium); background: #E9D49C55; }
@keyframes pulse { to { box-shadow: 0 0 0 7px #E9D49C00; } }
/* the results in brief */
.cards { margin: 0 0 var(--s3); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.cards div { padding: var(--s3); border: 1px solid var(--rule); border-radius: var(--radius); background: #0D1222; animation: pane-in 0.3s ease-out backwards; }
.cards div:nth-child(2) { animation-delay: 0.05s; } .cards div:nth-child(3) { animation-delay: 0.1s; } .cards div:nth-child(4) { animation-delay: 0.15s; } .cards div:nth-child(5) { animation-delay: 0.2s; } .cards div:nth-child(6) { animation-delay: 0.25s; }
.cards dt { font-family: var(--sans); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--haze); }
.cards dd { margin: 2px 0 0; font-family: var(--serif); font-size: 1.5rem; font-variant-numeric: lining-nums tabular-nums; color: var(--moon); }
.cards dd.u { margin: 0; font-family: var(--sans); font-size: 0.72rem; color: var(--haze); }
@media (max-width: 720px) {
  .wiz { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .tool .pane, .cards div { animation: none; }
  .bar b, .files .pb b { transition: none; }
  .bar.busy b, .pipe li.on::before { animation: none; }
}

/* a sheet that is an app (app: true, AMAP-APP): the app under the front page, the rest behind "More" */
.wrap-more { margin: var(--s6) 0 0; display: flex; justify-content: center; }
.btn.more { gap: var(--s2); }
.btn.more .sub { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--haze); font-weight: 400; }
#more { border-block-start: 1px solid var(--rule); margin-block-start: var(--s6); }
.is-app .front { padding-block: var(--s4) var(--s5); align-items: start; }
.is-app .front h1 { font-size: var(--t-2xl, 2.6rem); margin-block-end: var(--s3); }
.is-app .front .lede { font-size: var(--t-md); max-width: 60ch; }
.is-app .front .biblio { margin-block-end: var(--s3); }
.is-app .run-sec { padding-block-start: var(--s5); }
/* the tool sheet (/amap-app/tool) */
.run-body.tl { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.tool .ctl { width: 100%; min-height: var(--ctl-sm); padding: 0 var(--s2); border: 1px solid var(--edge); border-radius: var(--radius); background: #070A14; color: var(--moon); font-family: var(--mono); font-size: 0.82rem; }
.tool .ctl:focus-visible { outline: 2px solid var(--sodium); outline-offset: 2px; }
.tool .ctl:disabled { opacity: 0.55; }
.tool select.ctl { margin-block-end: var(--s4); }
.tool fieldset.roi { margin: 0 0 var(--s2); padding: 0; border: 0; min-width: 0; }
.tool fieldset.roi legend { padding: 0; }
.tool .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); margin-block: var(--s3) var(--s2); }
.tool .nums label { display: grid; gap: 4px; margin: 0; font-family: var(--sans); font-size: 0.72rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--haze); }
.tool .nums.off { opacity: 0.45; }
.tool .lnk { padding: 0; border: 0; background: none; color: var(--sodium); font: inherit; text-decoration: underline; cursor: pointer; }
.tool [hidden] { display: none !important; }   /* hidden means hidden, whatever the element's own display (.btn is inline-flex) */
.files { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: 4px; max-height: 15rem; overflow: auto; }
.files li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); align-items: center; padding: 3px var(--s2); border: 1px solid var(--rule); border-radius: 6px; background: #0D1222; font-family: var(--mono); font-size: 0.72rem; color: var(--haze); }
.files .nm { min-width: 0; padding: 0; border: 0; background: none; color: var(--moon); font: inherit; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.files li.running { border-color: var(--sodium); } .files li.running .st { color: var(--sodium); }
.files li.done .st { color: var(--moon); } .files li.failed { border-color: #E0876A; } .files li.failed .st { color: #E0876A; }
.files li.sel { background: #E9D49C14; }
/* under the viewer: the image before and after, and where this one is */
.vnav { display: flex; align-items: center; gap: var(--s2); margin-block-start: var(--s2); font-family: var(--mono); font-size: 0.75rem; color: var(--haze); }
.vnav .btn { min-width: 34px; font-size: 1rem; }
/* on a wide screen the viewer stays in view while the list beside it scrolls */
@media (min-width: 1001px) {
  .run-body.tl > .cv-fig { position: sticky; top: 72px; }
  /* the steps' column is as tall as the viewer's, no taller: the panes fill it, and the image list takes the room
     between the filter and the buttons, so its bottom lines up with the viewer's */
  .run-body.tl { align-items: stretch; }
  .run-body.tl > .run-ctl { position: relative; min-height: 0; }
  .run-body.tl > .run-ctl > .pane { position: absolute; inset: 0 0 var(--below, 0px) 0; display: flex; flex-direction: column; overflow-y: auto; }
  .run-body.tl > .run-ctl > .pane > * { flex: none; }
  .run-body.tl > .run-ctl > .pane > .files { flex: 1 1 auto; min-height: 6rem; max-height: none; margin-block-end: 0; grid-auto-rows: max-content; align-content: start; }   /* cards keep their height and the list scrolls */
  .run-body.tl > .run-ctl > .pane > .row.nav { margin-block: var(--s2) 0; }   /* level with ‹ › under the image */
}
.tool .cap { overflow-wrap: anywhere; margin: var(--s2) 0 0; font-family: var(--serif); font-style: italic; font-size: 0.88rem; color: var(--haze); min-height: 1.4em; }
.res-in { padding: var(--s4); border-block-start: 1px solid var(--rule); }
.res-in h3 { margin: 0 0 var(--s3); font-family: var(--serif); font-size: var(--t-lg, 1.3rem); font-weight: 400; color: var(--moon); }
.res-in h3 .sub { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--haze); margin-inline-start: var(--s2); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--frame); border-radius: var(--radius-lg); }
table.res { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.84rem; font-variant-numeric: lining-nums tabular-nums; }
table.res th, table.res td { padding: 7px var(--s3); border-block-end: 1px solid var(--rule); text-align: end; white-space: nowrap; }
table.res thead th { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--haze); vertical-align: top; }   /* every title on one line, its unit, when it has one, under it */
table.res thead th small { display: inline; margin-inline-start: 4px; font-weight: 400; letter-spacing: 0; text-transform: none; }   /* the unit beside its title, kept lowercase (µm, not ΜM) */
table.res th[scope="row"], table.res thead th:first-child { text-align: start; font-family: var(--mono); font-size: 0.76rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--moon); max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }
table.res thead th:first-child { font-family: var(--sans); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--haze); }
table.res tbody tr { cursor: pointer; } table.res tbody tr:hover, table.res tbody tr.sel { background: #E9D49C10; }
table.res tbody tr:focus-visible { outline: 2px solid var(--sodium); outline-offset: -2px; }
table.res tbody:empty::after { content: 'Nothing measured yet.'; display: block; padding: var(--s3); color: var(--haze); font-style: italic; }
.res-in .row.dl { display: flex; flex-wrap: wrap; gap: var(--s2); margin-block: var(--s4) var(--s2); }
.res-in .hint { margin-block-start: var(--s3); font-family: var(--sans); font-size: 0.84rem; color: var(--haze); max-width: 60rem; }
.res-in code { font-family: var(--mono); font-size: 0.8rem; color: var(--moon); }
@media (max-width: 1000px) { .run-body.tl { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 1000px) {
  .front { grid-template-columns: minmax(0, 1fr); }
  .xv-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .xv-fig { top: 56px; z-index: 4; background: var(--night); padding-block: var(--s2) 0; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); border-block-end: 1px solid var(--rule); }
  .xv-frame { padding: var(--s1) var(--s1) 0; outline: 0; }
  .xv-fig figcaption { margin-block: var(--s1) var(--s2); min-height: 2.6em; font-size: 0.84rem; }
  .run-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .front h1 { font-size: 3rem; }
  .front .lede { font-size: var(--t-md); }
  .xv-cap { display: none; }
  .refs-t li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .refs-t .what { padding-inline-start: calc(2.2em + 12px); padding-block-end: 4px; }
  .run { margin-inline: calc(var(--gutter) * -1 + 8px); }
  .msgs { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { button.ref { transition: none; } }

/* the exploded view is drawn larger than a home figure: heavier lines and numerals, more so on a phone */
#xv .pk .ln { stroke-width: 1.05; } #xv .pk .ln.th { stroke-width: 0.65; } #xv .pk .ln.hv { stroke-width: 2; }
#xv .pk .nm text { font-size: 15px; fill: #DCE1E8; }
@media (max-width: 720px) {
  #xv .pk .nm text { font-size: 24px; }
  #xv .pk .ln { stroke-width: 1.5; } #xv .pk .ln.hv { stroke-width: 2.6; } #xv .pk .gl { stroke-width: 2.2; }
}
/* a sheet whose exploded view is not drawn yet shows its home figure (400 wide, half the units): the same weights */
#xv.half .pk .ln { stroke-width: 0.55; } #xv.half .pk .ln.th { stroke-width: 0.35; } #xv.half .pk .ln.hv { stroke-width: 1; }
#xv.half .pk .nm text { font-size: 8px; }
@media (max-width: 720px) {
  #xv.half .pk .nm text { font-size: 12px; }
  #xv.half .pk .ln { stroke-width: 0.8; } #xv.half .pk .ln.hv { stroke-width: 1.3; } #xv.half .pk .gl { stroke-width: 1.1; }
}
.nw { white-space: nowrap; }

/* more than one sheet: a row of sheet numbers to jump to */
.sheet-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-block-end: var(--s4); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--haze); text-transform: uppercase; }
.sheet-nav a { display: inline-flex; align-items: baseline; gap: 6px; min-height: var(--ctl-sm); align-items: center; padding: 0 var(--s3); border: 1px solid var(--edge); border-radius: var(--radius); color: var(--moon); text-decoration: none; }
.sheet-nav a:hover { border-color: var(--edge-hi); background: var(--hover); }
.sheet-nav small { font-family: var(--serif); font-style: italic; font-size: 0.8rem; letter-spacing: 0; text-transform: none; color: var(--haze); }
.sheet { scroll-margin-top: 72px; }

/* on a phone the running figure fits the screen (each -run.js folds or narrows its drawing: PK.stage in kit.js) and
   stands above its controls, so that what a button changes is in view */
.cv-fig { min-width: 0; scroll-margin-block: 72px 16px; }
@media (max-width: 720px) {
  .run-body > .cv-fig { order: -1; }
}

/* the not-found page (404.html) */
.nf { padding-block: 64px 80px; }
.nf .acts { margin-block-start: 24px; }

/* a sheet's foot: the previous and the next figure, and the way back to all of them */
.pager { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--s3); align-items: center; margin-block: var(--s8) var(--s6); }
.pager .next { justify-self: end; }
.pager .prev { justify-self: start; }
.pager .btn { white-space: normal; text-align: center; }
.pager .fno { font-family: var(--serif); font-style: italic; color: var(--haze); white-space: nowrap; }
@media (max-width: 720px) {
  .pager { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pager > .btn:not(.prev):not(.next) { grid-column: 1 / -1; grid-row: 2; }
  .pager > span:empty { display: none; }
}

/* on a phone the exploded view (800 wide) keeps a readable size and slides sideways in its frame; its lettering grows */
.xv-hint { display: none; }
@media (max-width: 720px) {
  #xv:not(.half) { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #4A5578 transparent; }
  #xv:not(.half) svg.pk { min-width: 520px; }
  #xv:not(.half) .pk .tx { font-size: 15px; }
  #xv:not(.half) .pk .tx.mono { font-size: 12.5px; }
  #xv:not(.half) .pk .tx.mono.big { font-size: 16px; }
  #xv:not(.half) .pk .tx.it { font-size: 16px; }
  #xv:not(.half) .pk .tx.dr2 { font-size: 13px; }
  #xv:not(.half) .pk .nm text { font-size: 22px; }
  .xv-hint { display: block; margin: 4px 0 0; font-family: var(--sans); font-size: 0.75rem; color: var(--haze); }
}

/* the home's figures come one after another (kit.js drawIn): a waiting card is hidden, then fades and rises in as its
   drawing starts (2026-11-22) */
.fg { transition: opacity 0.6s ease, transform 0.6s ease; }
.fg.wait { opacity: 0; transform: translateY(10px); }
@media (prefers-reduced-motion: reduce) { .fg, .fg.wait { opacity: 1; transform: none; transition: none; } }
