/* Securitized Bags. Built from DESIGN-NOTES.md, which was measured off the three creatives.
   Two surfaces and no third: cream paper and a graphite band. One ornament: the perforated tape.
   One object: the wax seal. Every size comes out of the scale below and nothing sits between the
   steps. Dividers are drawn lines of their own, never a border that turns a text block into a box
   that then owes padding it was never meant to have. */

:root {
  /* ---- palette, every pair checked against the surface it is used on -------------------- */
  --paper: #FBF0D5;
  --paper-sunk: #F3E6C6;
  --paper-raised: #FFF8E7;
  --ink: #1D1D1D;          /* 14.87:1 on paper */
  --ink-2: #5E5346;        /*  6.61:1 on paper */
  --ink-3: #6B6052;        /*  5.42:1 on paper, the disabled ink: a colour, never an opacity */
  --line: #D9C9A3;         /* decorative hairline */
  --line-strong: #947E52;  /*  3.45:1 on paper, the border of a control */
  --brown: #8D4302;        /*  6.31:1 on paper */
  --brown-dark: #5E2C01;
  --amber: #F9A303;        /* a FILL, never a word on cream (1.80:1) */
  --amber-ink: #B06A00;    /*  3.78:1 on paper, the accent when it has to be a mark */
  --slate: #7E8891;        /*  4.67:1 on the band, and nowhere else */
  --night: #1D1D1D;
  --night-up: #262626;
  --cream: #FCECD2;        /* 14.50:1 on the band */
  --cream-2: #C9BCA2;      /*  8.99:1 on the band */

  /* ---- type scale: 12 14 16 20 24 32 48 72, and nothing in between --------------------- */
  --t12: 12px; --t14: 14px; --t16: 16px; --t20: 20px;
  --t24: 24px; --t32: 32px; --t48: 48px; --t72: 72px;

  /* ---- spacing: 4 8 12 16 24 32 48 64, and nothing in between -------------------------- */
  --s4: 4px; --s8: 8px; --s12: 12px; --s16: 16px;
  --s24: 24px; --s32: 32px; --s48: 48px; --s64: 64px;

  --col: 1100px;           /* the one column; the measure never passes 72 characters */
  --gut: var(--s24);
  --control: 48px;         /* every control is this tall, so a field and its key agree */
  --radius: 2px;           /* one radius, everywhere */
  --tape: 28px;

  --wordmark: "Anton", "Arial Narrow", sans-serif;
  --sans: "Poppins", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t16)/1.6 var(--sans);
  font-synthesis: none;
  overflow-x: hidden;
}

.page { position: relative; }

.sheet {
  display: block;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--gut) var(--s64);
}

/* ------------------------------------------------------------------ nav -- */
/* An ordinary navigation on the graphite band: the second surface, and the only one. */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  align-items: center;
  margin: 0 calc(-1 * var(--gut));
  padding: var(--s12) var(--gut);
  background-color: var(--night);
  background-image:
    linear-gradient(to right, var(--night-up) 1px, transparent 1px),
    linear-gradient(to bottom, var(--night-up) 1px, transparent 1px);
  background-size: var(--s24) var(--s24);
}

.tabs a {
  display: inline-block;
  padding: var(--s12) var(--s16);
  font: 600 var(--t12)/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-2);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color 0.12s, background-color 0.12s;
}

.tabs a:hover { color: var(--cream); background-color: #2E2E2E; }
.tabs a:active { background-color: #383838; }
.tabs a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.tabs a[aria-current="page"] {
  color: var(--night);
  background-color: var(--amber);
}
/* the tab you are on is still a control: it answers the pointer like the rest of them */
.tabs a[aria-current="page"]:hover { background-color: #FFB52E; }
.tabs a[aria-current="page"]:active { background-color: #D98F00; }

/* ----------------------------------------------------------------- head -- */

.head { padding: var(--s32) 0 0; }

/* the one display element on the screen, in the wordmark's own face */
.head h1 {
  margin: 0;
  font: 400 var(--t72)/1 var(--wordmark);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
}

.head .shoulders {
  display: flex;
  justify-content: space-between;
  gap: var(--s16);
  margin-top: var(--s16);
  font: 600 var(--t12)/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ----------------------------------------------------------------- tape -- */
/* The page's one ornament: continuous feed stationery. Holes are 0.30 of the pitch and sit near
   the edges, the way they are measured on the fourth banner. */

.rule {
  height: var(--tape);
  margin: var(--s24) calc(-1 * var(--gut)) 0;
  background-color: var(--paper-raised);
  background-image:
    radial-gradient(circle at 12px 7px, var(--ink) 3.5px, rgba(0, 0, 0, 0) 3.6px),
    radial-gradient(circle at 12px 21px, var(--ink) 3.5px, rgba(0, 0, 0, 0) 3.6px);
  background-size: var(--s24) var(--tape);
  box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line);
}

/* a plain drawn line, for where a section simply has to end */
.rule.thin {
  height: 1px;
  margin: var(--s24) 0;
  background: var(--line);
  box-shadow: none;
}

/* ---------------------------------------------------------------- field -- */

/* Both columns are stretched by the grid, and whatever is in the shorter one fills it, so a short
   column never leaves a field of nothing beside a tall object. */
/* Each column is as tall as what is in it. A panel stretched to match the certificate beside it is
   a panel with a field of nothing inside it, which reads worse than a column that simply ends. */
.field {
  display: grid;
  grid-template-columns: minmax(0, 540px) minmax(0, 1fr);
  gap: var(--s32);
  margin-top: var(--s32);
  align-items: start;
}

.plate-well { position: relative; min-width: 0; }

.plate-well > canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--line);
}

.plate-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s16);
  margin-top: var(--s12);
  font: 600 var(--t12)/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.plate-caption button {
  font: 600 var(--t12)/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brown);
  background: none;
  border: 0;
  padding: var(--s4) 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--amber-ink);
  text-underline-offset: 4px;
}
.plate-caption button:hover { color: var(--ink); }
.plate-caption button:focus-visible { outline: 2px solid var(--amber-ink); outline-offset: 2px; }

/* --------------------------------------------------------------- blocks -- */

.ledger { position: relative; min-width: 0; }

h2 {
  margin: 0 0 var(--s4);
  font: 600 var(--t24)/1.3 var(--sans);
  letter-spacing: 0;
  color: var(--ink);
}

h3 {
  margin: var(--s4) 0;
  font: 600 var(--t16)/1.3 var(--sans);
  color: var(--ink);
}

.sub {
  margin: 0;
  font: 400 var(--t14)/1.6 var(--sans);
  color: var(--ink-2);
}

.note {
  margin: var(--s12) 0 0;
  font: 400 var(--t16)/1.6 var(--sans);
  color: var(--ink-2);
}
.note strong { color: var(--brown); font-weight: 600; }

.block { margin-top: var(--s48); }

/* ------------------------------------------------------------- register -- */

.rows { margin-top: var(--s16); }

/* When the only thing a register has to say is that it is empty, it says it in a well that fills
   the column, not as one orphan sentence under a field of nothing. */
.rows > .empty:only-child,
.rows > .row.rowhead + .empty:last-child {
  padding: var(--s24);
  background: var(--paper-sunk);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line);
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto 44px;
  gap: var(--s12);
  align-items: baseline;
  padding: var(--s12) var(--s8);
  margin: 0 calc(-1 * var(--s8));
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
}

/* the ruling is a drawn line under the row, not a border on it */
.row::after {
  content: "";
  position: absolute;
  left: var(--s8);
  right: var(--s8);
  bottom: 0;
  height: 1px;
  background: var(--line);
}

.row:hover { background: var(--paper-sunk); }
.row:focus-visible { outline: 2px solid var(--amber-ink); outline-offset: -2px; }

.row .no { font: 500 var(--t12)/1.45 var(--mono); color: var(--ink-2); }
.row .what { font: 500 var(--t14)/1.45 var(--sans); color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.row .amt { font: 400 var(--t14)/1.45 var(--mono); color: var(--ink); white-space: nowrap; }
.row .act {
  font: 600 var(--t12)/1.45 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brown);
  text-align: right;
}
.row.out .act { color: var(--ink-2); }
.row .act.dim { color: var(--ink-3); }     /* read failed: the word says so too */
.row .act.warn { color: var(--brown); }    /* the vault holds less than the sheet promises */

.row.rowhead { padding-top: 0; }
.row.rowhead:hover { background: none; }
.row.rowhead span {
  font: 600 var(--t12)/1.45 var(--sans) !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2) !important;
}

/* An empty register is said once, in a sunken well, with the number the first entry will carry.
   Fourteen identical ruled lines reading "open / 0 / free" is not an empty state, it is a list of
   repeats that looks like data. */
.nothing {
  padding: var(--s24);
  background: var(--paper-sunk);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line);
}
.nothing .big {
  display: block;
  font: 400 var(--t32)/1 var(--wordmark);
  letter-spacing: 0.02em;
  color: var(--ink);
}
.nothing .what {
  display: block;
  margin-top: var(--s4);
  font: 600 var(--t12)/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.nothing p {
  margin: var(--s16) 0 0;
  max-width: 54ch;
  font: 400 var(--t14)/1.6 var(--sans);
  color: var(--ink-2);
}

.empty {
  padding: var(--s16) 0 0;
  margin: 0;
  font: 400 var(--t14)/1.6 var(--sans);
  color: var(--ink-2);
}

/* -------------------------------------------------------------- readouts -- */
/* Four equal columns on one baseline: same width, same height, same padding, whatever is in them. */

.readouts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s16);
  margin-top: var(--s32);
  align-items: stretch;
}

.readout { display: flex; min-width: 0; }

.readout .inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s8);
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--s16);
  background: var(--paper-sunk);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line);
}

.readout .k {
  display: block;
  font: 600 var(--t12)/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.readout .v {
  display: block;
  font: 500 var(--t20)/1.3 var(--mono);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* a value that is not there yet is dimmed by its own colour, never by opacity */
.readout .v.none { color: var(--ink-3); }
.readouts.waiting .v { font-family: var(--sans); }

.readouts-note {
  margin: var(--s12) 0 0;
  font: 400 var(--t14)/1.6 var(--sans);
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ band -- */

.band {
  margin-top: var(--s32);
  padding: var(--s16) var(--s24);
  background-color: var(--night);
  background-image:
    linear-gradient(to right, var(--night-up) 1px, transparent 1px),
    linear-gradient(to bottom, var(--night-up) 1px, transparent 1px);
  background-size: var(--s24) var(--s24);
  border-radius: var(--radius);
  text-align: center;
  font: 600 var(--t12)/1.5 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-2);
}

/* ------------------------------------------------------ the contract box -- */

.cart { margin-top: var(--s24); }

.cart .inner {
  padding: var(--s16);
  background: var(--paper-sunk);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line);
}

.cart .strip {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s12);
  font: 600 var(--t12)/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.addr-line, .cart .line {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s8);
  align-items: stretch;
  margin-top: var(--s12);
}

.addr {
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  min-width: 0;
  min-height: var(--control);
  padding: var(--s12) var(--s16);
  background: var(--paper-raised);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font: 400 var(--t14)/1.5 var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
  user-select: all;
}

.addr.none {
  color: var(--ink-3);
  user-select: none;
  font-family: var(--sans);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* ------------------------------------------------------------- controls -- */

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: var(--control);
  padding: 0 var(--s24);
  font: 600 var(--t12)/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--brown);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.12s;
}
.key:hover { background: var(--brown-dark); }
.key:active { background: #431F00; }
.key:focus-visible { outline: 2px solid var(--amber-ink); outline-offset: 2px; }
.key[disabled] {
  color: var(--ink-3);
  background: var(--paper-sunk);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: not-allowed;
}
.key.wide { width: 100%; margin-top: var(--s24); }

/* the four marks: one row, equal columns, one icon size */
.marks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s8);
  margin-top: var(--s12);
  flex: 1 1 100%;        /* inside a control line: its own row, the full width of the panel */
  width: 100%;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s8);
  min-width: 0;
  min-height: var(--control);
  padding: 0 var(--s12);
  white-space: nowrap;
  background: var(--paper-raised);
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font: 600 var(--t12)/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.12s, box-shadow 0.12s;
}
.mark img { width: 18px; height: 18px; object-fit: contain; display: block; flex: 0 0 auto; }
.mark:hover { background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--brown); }
.mark:active { background: var(--paper-sunk); }
.mark:focus-visible { outline: 2px solid var(--amber-ink); outline-offset: 2px; }
.mark[aria-disabled="true"] {
  color: var(--ink-3);
  background: var(--paper-sunk);
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
}
.mark[aria-disabled="true"] img { filter: grayscale(1); opacity: 0.85; }

/* ----------------------------------------------------------------- form -- */

.form { margin-top: var(--s16); }
.frow { margin-top: var(--s24); }

.flabel {
  display: block;
  margin-bottom: var(--s8);
  font: 600 var(--t12)/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.field-input {
  width: 100%;
  min-width: 0;
  min-height: var(--control);
  padding: var(--s12) var(--s16);
  background: var(--paper-raised);
  color: var(--ink);
  font: 400 var(--t16)/1.4 var(--mono);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.field-input::placeholder { color: var(--ink-3); opacity: 1; }
.field-input:hover { border-color: var(--brown); }
.field-input:focus-visible { outline: 2px solid var(--amber-ink); outline-offset: 1px; }
.field-input[disabled] {
  color: var(--ink-3);
  background: var(--paper-sunk);
  border-color: var(--line);
  cursor: not-allowed;
}
select.field-input { font-family: var(--sans); appearance: none; cursor: pointer; }
select.field-input option { color: var(--ink); background: var(--paper-raised); }
/* a disabled control keeps its own ink: Chrome otherwise paints the text in a grey of its own
   (measured at 2.77:1) and the attribute, not the stylesheet, decides what the visitor reads */
select.field-input[disabled],
select.field-input[disabled] option {
  color: var(--ink-3);
  -webkit-text-fill-color: var(--ink-3);
  opacity: 1;
}

.addr-line .field-input { width: auto; flex: 1 1 240px; }

.hint { margin: var(--s8) 0 0; font: 400 var(--t14)/1.6 var(--sans); color: var(--ink-2); }
.danger { color: var(--brown); }
.mono-i { font: 400 var(--t14)/1.4 var(--mono); color: var(--brown); }

/* ---------------------------------------------------------------- steps -- */
/* Four equal columns. The line over each heading is the full width of its own column, so the four
   lines are the same length whatever the text under them does. */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s24);
  margin-top: var(--s24);
  align-items: stretch;
}

.step {
  position: relative;
  min-width: 0;
  padding-top: var(--s16);
  display: flex;
  flex-direction: column;
}
.step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brown);
}
.step .n {
  font: 600 var(--t12)/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brown);           /* 6.31:1; amber-ink is a mark, never a word */
}
.step h3 { margin: var(--s4) 0 var(--s8); }
.step p { margin: 0; font: 400 var(--t14)/1.6 var(--sans); color: var(--ink-2); }

/* ------------------------------------------------------------ two column -- */
/* Both columns are stretched by the grid and both close on a drawn line at the bottom of the row,
   so a short column ends deliberately instead of leaving a hole under itself. */

.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s48);
  margin-top: var(--s24);
  align-items: stretch;
}

.two > div { min-width: 0; }

/* the section closes on ONE line across the whole column; a short rule under each half is a mark
   attached to nothing */
.two::after {
  content: "";
  display: block;
  grid-column: 1 / -1;
  height: 1px;
  margin-top: var(--s24);
  background: var(--line);
}

/* ---------------------------------------------------------------- terms -- */

.terms { margin: var(--s16) 0 0; padding: 0; list-style: none; }
.terms li {
  position: relative;
  padding: var(--s12) 0;
  font: 400 var(--t14)/1.6 var(--sans);
  color: var(--ink-2);
}
.terms li::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line);
}
.terms b {
  display: block;
  margin-bottom: var(--s4);
  font: 600 var(--t12)/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

/* --------------------------------------------------------------- dialog -- */

dialog.sheetdlg {
  border: 0;
  padding: 0;
  max-width: min(94vw, 1180px);
  width: min(94vw, 1180px);
  background: var(--paper);
  border-radius: var(--radius);
}
dialog.sheetdlg::backdrop { background: rgba(29, 29, 29, 0.82); }
dialog.sheetdlg .dlg-body { padding: var(--s16) var(--s24) var(--s24); }
dialog.sheetdlg canvas { display: block; width: 100%; height: auto; border-radius: var(--radius); }
dialog.sheetdlg .dlg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s16);
  padding-bottom: var(--s16);
  font: 600 var(--t12)/1.4 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ----------------------------------------------------------------- misc -- */

.vis-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wide-rows .row { grid-template-columns: 64px minmax(0, 1.2fr) minmax(0, 1fr) auto auto; }
.wide-rows .row .vault { font: 400 var(--t12)/1.45 var(--mono); color: var(--ink-2); }

/* ---------------------------------------------------------------- motion -- */
/* From the brief and nowhere else: the card draws itself in, a register line is written left to
   right the way a pen writes it, and the seal comes down when a bag is packed. Nothing moves with
   the pointer. */

@keyframes write-line { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.row.written { animation: write-line 420ms cubic-bezier(.2,.7,.3,1) both; }

@keyframes seal-down {
  0%   { transform: translate(-50%, -150%) scale(1.8) rotate(-12deg); opacity: 0; }
  62%  { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
  74%  { transform: translate(-50%, -50%) scale(0.97) rotate(0deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}
.plate-well .seal {
  position: absolute;
  width: 15%;
  aspect-ratio: 1;
  left: 84.9%;
  top: 73.5%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}
.plate-well.sealing .seal { animation: seal-down 900ms cubic-bezier(.3,1.5,.5,1) both; }

/* ------------------------------------------------------------ 1280/1024 -- */

@media (max-width: 1180px) {
  .head h1 { font-size: var(--t48); }
}

@media (max-width: 1024px) {
  /* one column: the certificate is the one object on the screen, so it takes the whole column
     rather than sitting in half of it with a field of nothing beside it */
  .field { grid-template-columns: minmax(0, 1fr); }
  .two { gap: var(--s32); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); gap: var(--s24); }
}

@media (max-width: 680px) {
  :root { --gut: var(--s16); }
  /* the line stacks, so every basis has to go: in a column container flex-basis is a HEIGHT, and
     "flex: 1 1 240px" turns a 48 px field into a 240 px one */
  .addr-line, .cart .line { flex-direction: column; }
  .addr-line .addr, .addr-line .key, .addr-line .field-input, .addr-line .marks,
  .cart .line .addr, .cart .line .key, .cart .line .marks { flex: 0 0 auto; width: 100%; }
  .cart .line .marks { margin-top: 0; }
  .head { padding-top: var(--s32); }
  .head h1 { font-size: var(--t32); }
  .head .shoulders { flex-direction: column; gap: var(--s4); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .marks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .block { margin-top: var(--s32); }
  .plate-caption { flex-direction: column; align-items: flex-start; gap: var(--s4); }
  .row { grid-template-columns: 48px minmax(0, 1fr) auto 40px; gap: var(--s8); }
  .wide-rows .row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .wide-rows .row .vault { display: none; }
}

@media (max-width: 420px) {
  .tabs { gap: 0; }
  .tabs a { padding: var(--s16) var(--s8); letter-spacing: 0.04em; }
  .readouts { grid-template-columns: minmax(0, 1fr); }
  .marks { grid-template-columns: minmax(0, 1fr); }
  .head h1 { font-size: var(--t24); }
  .nothing .big { font-size: var(--t32); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .plate-well .seal { opacity: 0; }
}
