/* Universal Basic Income Office. One check, one stub, one terminal window on a treasury desk.
   The shell, the banding and the pixel register come from the reference (Hypnospace Explorer, see
   NOTE.md > Reference teardown); the world, the inks and the two named faces come from the brief.
   Every surface here is a drawn raster (img/*.png, tools/art.mjs), never a bordered CSS rectangle. */

@font-face { font-family: Pix; src: url("/fonts/jersey10-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Sans; src: url("/fonts/publicsans-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Caslon; src: url("/fonts/librecaslontext-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Caslon; src: url("/fonts/librecaslontext-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Caslon; src: url("/fonts/librecaslontext-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Mono; src: url("/fonts/sometypemono-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  /* the brief's four inks, one meaning each */
  --paper: #e3efe6;        /* every reading surface */
  --ink: #111111;          /* every word */
  --green: #2f5d50;        /* the office furniture: chrome, bars, rules */
  --deep: #1b3831;         /* the desk the terminal stands on */
  --blue: #2a4d9b;         /* the stamp: a LIVE reading and nothing else */
  --muted: #45574f;        /* secondary words on paper: 6.4:1 on the paper, 5.4:1 on a panel */
  --dim: #3f5149;          /* a value or a key that does not exist yet: 7.1:1 on paper, 4.8:1 on a key */
  --paper-dim: #cadbd2;    /* secondary words on the green bars: 5.2:1 on --green, 8.8:1 on --deep */

  /* one scale, nothing off it */
  --t12: 12px; --t14: 14px; --t16: 16px; --t20: 20px; --t24: 24px; --t32: 32px; --t48: 48px; --t72: 72px;
  --display: var(--t72);
  --s4: 4px; --s8: 8px; --s12: 12px; --s16: 16px; --s24: 24px; --s32: 32px; --s48: 48px;

  --pix: Pix, "Courier New", monospace;
  --sans: Sans, system-ui, sans-serif;
  --serif: Caslon, Georgia, serif;
  --mono: Mono, "Courier New", monospace;

  --shell: 1440px;         /* the terminal window */
  --col: 1120px;           /* the page column inside it: every block ends on this right line */
  --pad: 32px;             /* the one padding token: every full width rule is pulled out by it */
}

* { box-sizing: border-box; }

html { background: var(--deep); }
body {
  margin: 0;
  font: 400 var(--t14) / 1.6 var(--sans);
  color: var(--ink);
  background: url("/img/desk.png") repeat;
  background-size: 120px 120px;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
img { display: block; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }

/* ---------------------------------------------------------------- the terminal window */
.shell {
  width: min(100% - var(--s16) * 2, var(--shell));
  margin: var(--s16) auto;
  border-image: url("/img/frame.png") 28 fill / 28px / 0 stretch;
  padding: 0;
}
.win { background: var(--green); }

/* bar 1: the office bar. The reference's app bar: mark, name, live readings. */
.bar-office {
  display: flex; align-items: center; gap: var(--s16);
  padding: var(--s8) var(--s24);
  background: var(--green);
  border-bottom: 2px solid var(--deep);
}
.bar-office .mark { width: 60px; height: 30px; object-fit: contain; flex: none; }
.bar-office .office-name {
  font: 400 var(--t16) / 1 var(--pix);
  color: var(--paper);
  letter-spacing: 0.02em;
}
.readings { margin-left: auto; display: flex; gap: var(--s16); flex-wrap: wrap; }
.reading { font: 400 var(--t12) / 1.4 var(--mono); color: var(--paper-dim); white-space: nowrap; }
.reading b { font-weight: 700; color: var(--paper); }
.reading.is-live b { color: #cfe0ff; }

/* bar 2: the state line. The reference's breadcrumb strip, carrying what the office is doing now. */
.bar-state {
  padding: var(--s8) var(--s24);
  background: var(--deep);
  font: 400 var(--t12) / 1.5 var(--mono);
  color: var(--paper-dim);
  border-bottom: 2px solid #122823;
}
.bar-state b { color: var(--paper); font-weight: 400; }

/* bar 3: the key bar. The reference's violet title bar with its row of keys. */
.bar-keys {
  display: flex; align-items: center; gap: var(--s8);
  padding: var(--s8) var(--s24);
  background: var(--green);
  border-bottom: 3px solid var(--deep);
}
.key {
  flex: 1 1 0; min-width: 0;
  font: 400 var(--t16) / 1 var(--pix);
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  padding: 0 var(--s12);
  height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-image: url("/img/key.png") 14 fill / 14px / 0 stretch;
  transition: transform 0.08s, filter 0.18s;
}
.key:hover { filter: brightness(1.12); }
.key:active { transform: translateY(2px); }
.key:focus-visible { outline: 3px solid #cfe0ff; outline-offset: 2px; }
.key[aria-current="page"] {
  border-image-source: url("/img/key-open.png");
  color: var(--paper);
}
.ident {
  flex: none;
  margin-left: auto;
  font: 700 var(--t16) / 1 var(--mono);
  color: var(--paper);
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------- the page: the check paper */
.page {
  background: url("/img/paper.png") repeat;
  background-size: 256px 256px;
  padding: var(--s32) 0 0;
}
.col {
  width: min(100% - var(--pad) * 2, var(--col));
  margin: 0 auto;
}

/* the masthead band: the reference's dot field with the name on it and a live reading each side */
.masthead {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s24);
  padding: var(--s48) var(--s32);
  margin-bottom: var(--s24);
  overflow: hidden;
}
/* Safety paper is printed in a band at the head and the foot of a slip. It never runs under a word:
   a reading has to be readable. One periodic tile, so both ends keep the same density. */
.masthead::before, .masthead::after {
  content: ""; position: absolute; left: 0; right: 0; height: 20px;
  background: url("/img/guilloche-2.png") repeat-x;
  background-size: 240px 20px;
  animation: drift 90s linear infinite;
}
.masthead::before { top: 0; }
.masthead::after { bottom: 0; }
@keyframes drift { from { background-position: 0 0; } to { background-position: 240px 0; } }
.masthead > * { position: relative; }
.wordmark {
  font: 400 var(--t48) / 0.98 var(--pix);
  letter-spacing: 0.01em;
  text-align: center;
  color: var(--ink);
}
.wordmark .tick { display: block; font: 700 var(--t16) / 1.4 var(--mono); color: var(--blue); letter-spacing: 0.08em; }
.flank {
  display: grid; gap: var(--s4); align-content: center;
  font: 400 var(--t12) / 18px var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.flank .v { display: block; font: 700 var(--t24) / 28px var(--mono); letter-spacing: 0; color: var(--blue); text-transform: none; font-variant-numeric: tabular-nums; }
.flank .v.is-empty { color: var(--dim); }
.flank.right { text-align: right; }

/* ---------------------------------------------------------------- the check itself */
.check { padding: 0 var(--s32) var(--s32); }
.rule { height: 2px; background: var(--ink); margin: var(--s16) 0; }
.rule.thin { height: 1px; background: var(--green); }

.check-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s24);
  padding-bottom: var(--s12);
}
.check-head .issuer { font: 400 var(--t20) / 1.3 var(--serif); }
.check-head .issuer small { display: block; font: 400 var(--t12) / 1.5 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.check-head .slot { margin-left: auto; text-align: right; }
.slot-label { display: block; font: 400 var(--t12) / 1.5 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.slot-value { display: block; font: 700 var(--t20) / 1.3 var(--mono); }
/* Two faces on the check and no more: Caslon is everything written onto it, the grotesque is
   everything the printer put there. The machine line at the foot keeps the mono it is named for. */
.check-head .slot-value { font: 700 var(--t20) / 1.3 var(--serif); font-variant-numeric: tabular-nums; }

/* the body of a check: the written lines on the left, the figure in its box on the right */
/* baseline, not top: the figure box is set on the written line, whatever the two faces do */
.check-body { display: grid; grid-template-columns: 1fr 360px; gap: var(--s32); align-items: baseline; }
/* the written lines and the figure box start on the same line of the paper */
.check-lines { padding-top: var(--s16); }
.pay-row { display: grid; grid-template-columns: auto 1fr; gap: var(--s16); align-items: baseline; }
.pay-label { font: 400 var(--t12) / 18px var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; padding-bottom: var(--s8); }
.payee {
  font: 700 var(--t48) / 1.05 var(--serif);
  padding-bottom: var(--s8);
  position: relative;
}
.payee::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ink); }

.words { margin-top: var(--s24); font: 400 var(--t20) / 1.4 var(--serif); padding-bottom: var(--s8); position: relative; }
.words::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ink); }
.words .unit { font-style: normal; font-family: var(--sans); font-size: var(--t12); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-left: var(--s8); }
.amount-box {
  min-width: 320px;
  padding: var(--s16) var(--s24) var(--s24);
  text-align: right;
  border-image: url("/img/field.png") 14 fill / 14px / 0 stretch;
}
.amount-box .label { display: block; font: 400 var(--t12) / 18px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.amount-box .figure { display: block; font: 700 var(--display) / 1.1 var(--serif); color: var(--blue); font-variant-numeric: tabular-nums; }
.amount-box .figure.is-empty { color: var(--dim); }
.amount-box .per { display: block; max-width: 34ch; margin-left: auto; font: 400 var(--t12) / 1.5 var(--sans); color: var(--muted); }

.check-foot { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s32); margin-top: var(--s32); align-items: baseline; }
.memo, .sign { display: grid; justify-content: start; min-width: 0; }
.sign { justify-content: end; text-align: right; }
.memo .line, .sign .line { display: block; min-width: 260px; max-width: 100%; padding-bottom: var(--s4); position: relative; }
.memo .line::after, .sign .line::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ink); }
.memo .slot-label, .sign .slot-label { margin-top: var(--s4); }
.memo .slot-value { font: 400 var(--t16) / 1.4 var(--serif); }
.sign .slot-value { font-size: var(--t14); overflow-wrap: anywhere; }

.micr {
  margin-top: var(--s32);
  padding: var(--s16) var(--s24);
  font: 400 var(--t16) / 1.5 var(--mono);
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  border-image: url("/img/field.png") 14 fill / 14px / 0 stretch;
}
.micr .pre, .micr .post { color: var(--green); }
.micr.is-empty { color: var(--dim); }

/* the tear line: the check ends here and the stub begins */
.tear {
  height: 14px;
  background: url("/img/perforation.png") repeat-x;
  background-size: 18px 14px;
  margin-top: var(--s24);
}
.stub { background: url("/img/paper.png") repeat; background-size: 256px 256px; padding: var(--s32) 0 var(--s48); }

/* ---------------------------------------------------------------- the queue */
.queue-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: var(--s16); }
.queue-head h2 { font: 400 var(--t24) / 1.4 var(--pix); }
.queue-head .note { font: 400 var(--t14) / 1.4 var(--sans); color: var(--muted); max-width: 72ch; }
.rank {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  margin: var(--s16) 0 0;
  padding: var(--s24);
  min-height: 96px;
  border-image: url("/img/trough.png") 8 fill / 8px / 0 stretch;
}
.rank:has(> .empty) { justify-content: center; align-items: center; }
.rank img {
  width: 32px; height: 64px;
  image-rendering: pixelated;
  max-width: none;
  animation: shuffle 2.4s steps(1, end) infinite;
}
@keyframes shuffle { 0%, 92% { transform: translateY(0); } 96% { transform: translateY(-2px); } }
.rank .tally {
  font: 700 var(--t24) / 1 var(--mono);
  color: var(--blue);
  align-self: center;
  padding-left: var(--s8);
}
.rank .empty {
  display: grid; justify-items: center; gap: var(--s8);
  text-align: center; font: 400 var(--t14) / 1.6 var(--sans); color: var(--muted);
  align-self: center; padding: var(--s8) 0;
}
.rank .empty img { width: 32px; height: 64px; image-rendering: pixelated; animation: none; }
.rank img.is-new { animation: step-in 0.6s steps(4, end) 1; }
@keyframes step-in { from { transform: translateX(56px); } to { transform: translateX(0); } }

/* ---------------------------------------------------------------- the stub's two columns */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s32); margin-top: var(--s32); align-items: stretch; }
.two > * { height: 100%; }
.panel {
  padding: var(--s24);
  border-image: url("/img/trough.png") 8 fill / 8px / 0 stretch;
}
.panel h2, .panel h3 { font: 400 var(--t20) / 1.2 var(--pix); margin-bottom: var(--s12); }
.panel p { color: var(--muted); }
.panel p + p { margin-top: var(--s8); }

.rows { display: grid; gap: var(--s8); margin-top: var(--s16); }
.row { display: grid; grid-template-columns: 1fr auto; gap: var(--s16); align-items: baseline; position: relative; padding-bottom: var(--s8); }
.row::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--green); opacity: 0.35; }
.row:last-child::after { display: none; }
.row .k { font: 400 var(--t12) / 1.5 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.row .v { font: 700 var(--t16) / 1.4 var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.row .v.is-rule { font-weight: 400; font-size: var(--t14); white-space: nowrap; }
.row .v.is-live { color: var(--blue); }
.row .v.is-empty { color: var(--dim); font-weight: 400; }

/* the pot bar */
.pot { margin-top: var(--s16); }
.pot .trough {
  height: 32px;
  border-image: url("/img/field.png") 14 fill / 14px / 0 stretch;
  padding: 5px;
}
.pot .fill {
  height: 100%;
  width: 0;
  min-width: 8px;              /* an empty pot still shows where the reading starts */
  border-image: url("/img/fill.png") 8 fill / 8px / 0 stretch;
  transition: width 0.6s ease-out;
}
.pot .legend { display: flex; justify-content: space-between; gap: var(--s16); margin-top: var(--s8); font: 400 var(--t12) / 1.5 var(--mono); color: var(--muted); }

/* the calculator */
.field-row { display: grid; grid-template-columns: 1fr; gap: var(--s4); margin-top: var(--s16); }
.field-row label { font: 400 var(--t12) / 1.5 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
input[type="number"], input[type="text"], input[type="url"] {
  font: 400 var(--t16) / 1.4 var(--mono);
  color: var(--ink);
  padding: 14px var(--s16);
  width: 100%;
  min-height: 48px;
  background: none;
  border: 0;
  border-image: url("/img/field.png") 14 fill / 14px / 0 stretch;
}
input:hover { filter: brightness(1.03); }
input:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
input:disabled, input[readonly] { color: var(--dim); cursor: not-allowed; filter: none; }
.calc-out {
  margin-top: var(--s16); padding-top: var(--s16); position: relative;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s8);
}
.calc-out::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--ink); }
.calc-out .figure { font: 700 var(--t24) / 1.2 var(--serif); color: var(--blue); font-variant-numeric: tabular-nums; }
.calc-out .per { flex: 1 1 240px; font: 400 var(--t12) / 1.5 var(--sans); color: var(--muted); }

/* the steps */
.steps ol { margin: var(--s16) 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: var(--s12); }
.steps li { display: grid; grid-template-columns: 24px 1fr; gap: var(--s12); align-items: start; counter-increment: step; }
.steps li::before {
  content: counter(step);
  font: 400 var(--t16) / 24px var(--pix);
  text-align: center;
  color: var(--paper);
  background: var(--green);
  width: 24px; height: 24px;
}
.steps li p { color: var(--ink); }
.steps li p small { display: block; color: var(--muted); font-size: var(--t12); }

/* ---------------------------------------------------------------- buttons */
.btn {
  font: 400 var(--t16) / 1.2 var(--pix);
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  padding: var(--s8) var(--s24);
  min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s8);
  border: 0;
  cursor: pointer;
  background: none;
  border-image: url("/img/key.png") 14 fill / 14px / 0 stretch;
  transition: transform 0.08s, filter 0.18s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.btn.primary { border-image-source: url("/img/key-open.png"); color: var(--paper); }
/* A key with nothing behind it yet drops to the plain plate and the dim ink: it still reads
   (4.7:1), and it never pretends to be the lit primary. */
.btn[disabled], .btn[aria-disabled="true"], .btn.primary[disabled], .btn.primary[aria-disabled="true"] {
  color: var(--dim);
  cursor: not-allowed;
  border-image-source: url("/img/key.png");
  transform: none;
}
.btn[disabled]:hover, .btn[aria-disabled="true"]:hover { filter: none; }
.btn[disabled] img, .btn[aria-disabled="true"] img { filter: none; opacity: 0.74; }
.btn img { width: 20px; height: 20px; }
.btn.primary img { filter: invert(1); }

/* ---------------------------------------------------------------- the paying office panel */
.office-panel { margin-top: var(--s32); }
.office-panel .title {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s16);
  padding: 10px var(--s24);
  background: var(--green);
  font: 400 var(--t16) / 1.4 var(--pix);
  color: var(--paper);
}
.office-panel .title .state { font: 400 var(--t12) / 1.4 var(--mono); color: var(--paper-dim); }
.office-panel .body {
  padding: var(--s24);
  border-image: url("/img/trough.png") 8 fill / 8px / 0 stretch;
}
.mint-field {
  font: 400 var(--t16) / 1.5 var(--mono);
  padding: var(--s16) var(--s24);
  overflow-wrap: anywhere;
  user-select: all;
  border-image: url("/img/field.png") 14 fill / 14px / 0 stretch;
}
.mint-field.is-empty { color: var(--dim); user-select: none; }
.office-keys { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--s12); margin-top: var(--s16); }
.copy-state { font: 400 var(--t12) / 1.5 var(--mono); color: var(--blue); margin-top: var(--s12); min-height: 18px; }
.copy-state.bad { color: #9b2a2a; }

/* ---------------------------------------------------------------- tables (the line, my checks) */
table { border-collapse: collapse; width: 100%; margin-top: var(--s16); }
th, td { text-align: left; padding: var(--s12) var(--s16); font: 400 var(--t14) / 1.5 var(--sans); }
th { font: 400 var(--t12) / 1.5 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); }
td { border-bottom: 1px solid rgba(47, 93, 80, 0.35); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
td a { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- status notices */
.notice {
  margin-top: var(--s16);
  padding: var(--s16) var(--s24);
  font: 400 var(--t14) / 1.6 var(--sans);
  border-image: url("/img/field.png") 14 fill / 14px / 0 stretch;
}
.notice.good { color: var(--blue); }
.notice.bad { color: #9b2a2a; }
.notice code { font: 400 var(--t16) / 1.4 var(--mono); user-select: all; }

.post-text {
  margin-top: var(--s12);
  padding: var(--s16) var(--s24);
  font: 400 var(--t14) / 1.7 var(--mono);
  white-space: pre-wrap;
  user-select: all;
  border-image: url("/img/field.png") 14 fill / 14px / 0 stretch;
}

.lede { font: 400 var(--t20) / 1.5 var(--serif); max-width: 62ch; }
.prose { max-width: 70ch; }
.prose h3 { font: 400 var(--t20) / 1.3 var(--pix); margin-top: var(--s24); }
.prose p { margin-top: var(--s8); color: var(--ink); }
.prose ul { margin: var(--s8) 0 0; padding-left: var(--s24); color: var(--ink); }
.prose li { margin-top: var(--s4); }

.sr { font-size: inherit; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- widths */
@media (max-width: 1100px) {
  .masthead { grid-template-columns: 1fr; text-align: center; }
  .flank, .flank.right { text-align: center; justify-items: center; }
  .check-body { grid-template-columns: 1fr; }
  .check-lines { padding-top: 0; }
  .amount-box { min-width: 0; text-align: left; }
  .amount-box .per { margin-left: 0; }
  /* four keys never squeeze into four columns under 1100: two rows of two, still equal */
  .office-keys { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  :root { --display: var(--t48); --pad: 24px; }
  .two { grid-template-columns: 1fr; }
  .check-foot { grid-template-columns: 1fr; gap: var(--s24); }
  .sign { text-align: left; justify-content: start; }
  .queue-head { grid-template-columns: 1fr; gap: var(--s4); }
  .payee { font-size: var(--t32); }
  .wordmark { font-size: var(--t32); }
  /* the masthead folds: the name over its two readings, which stay side by side */
  .masthead { grid-template-columns: 1fr 1fr; gap: var(--s12) var(--s24); text-align: left; padding: var(--s32) var(--s24); align-items: end; }
  .wordmark { grid-column: 1 / -1; order: -1; text-align: left; }
  .flank { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s8); text-align: left; }
  .flank .v { display: inline; line-height: 1.2; }
  .flank.right { text-align: right; }
}
@media (max-width: 560px) {
  :root { --display: var(--t32); --pad: 32px; }
  .shell { width: 100%; margin: 0; border-image-width: 12px; }
  .bar-office, .bar-state, .bar-keys, .check, .masthead { padding-left: var(--s16); padding-right: var(--s16); }
  /* the office bar keeps one row for the office and one for its readings, and nothing taller */
  .bar-office { flex-wrap: wrap; gap: var(--s8); padding-top: var(--s8); padding-bottom: var(--s8); }
  .bar-office .mark { width: 44px; height: 22px; }
  .readings { width: 100%; margin: 0; justify-content: space-between; gap: var(--s8); }
  .bar-state { padding-top: 6px; padding-bottom: 6px; }
  .bar-keys { flex-wrap: wrap; gap: 6px; padding-top: 6px; padding-bottom: 6px; }
  /* three keys, then two: every key in a row is the same width as its neighbour */
  .key { flex: 1 1 28%; justify-content: center; height: 40px; padding: 0 var(--s8); }
  .ident { margin: 0 0 0 auto; align-self: center; }
  .pay-row { grid-template-columns: 1fr; gap: var(--s4); }
  /* at this width the flank labels wrap, and a value between two label lines reads as a mistake */
  .flank { display: block; }
  .flank .v { display: block; }
  .rank { gap: var(--s8); padding: var(--s16); }
  .rank img { width: 16px; height: 32px; }
  .rank .empty img { width: 24px; height: 48px; }
  .check-head { gap: var(--s16); }
  .office-keys { grid-template-columns: 1fr; }
  .memo .line, .sign .line { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .masthead::before, .masthead::after { animation: none; }
  .rank img, .rank img.is-new { animation: none; }
  .pot .fill { transition: none; }
  * { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------- the office's two movements */
/* The check prints line by line and the stub tears off, but only when a check is really paid. */
.check.is-printing { animation: print 1.4s steps(14, end) 1; }
@keyframes print {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}
.tear.is-tearing { animation: tear 0.5s ease-out 1.3s 1; }
@keyframes tear {
  0% { transform: translateY(0); }
  40% { transform: translateY(3px) scaleY(1.3); }
  100% { transform: translateY(0); }
}
.rank.is-stepping img { animation: step-forward 0.5s steps(2, end) 1.5s 1; }
@keyframes step-forward {
  from { transform: translateX(14px); }
  to { transform: translateX(0); }
}
/* A live amount is re-inked when it changes, which is the one thing on the check that moves. */
.is-reprinting { animation: reink 0.5s ease-out 1; }
@keyframes reink {
  0% { opacity: 0.25; }
  40% { opacity: 1; }
  100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .check.is-printing, .tear.is-tearing, .rank.is-stepping img, .is-reprinting { animation: none; }
}
