/* The Rulebook. One printed sheet of law, cut into cells.
   Everything here is measured off art/ref/ref_site.jpg: a black ground, one white ink, no colour at
   all, a hairline inside every cell, and a wordmark band that fills the sheet edge to edge. */

@font-face { font-family: "Clash"; src: url("../fonts/ClashDisplay-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nippo"; src: url("../fonts/Nippo-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nippo"; src: url("../fonts/Nippo-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Nippo"; src: url("../fonts/Nippo-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "RX"; src: url("../fonts/RX100-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ground: #080808;
  --ink: #f8f8f8;
  --rule: #4a4a4a;
  --dim: #a2a2a0;
  --gap: 10px;
  --pad: 32px;          /* cell body inset, never under 1 em */
  --headpad: 32px;      /* cell head side inset */
  --edge: 24px;         /* the sheet's own margin inside the window */
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { background: var(--ground); }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 18px/1.35 "Nippo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

/* ---- the world behind the sheet: a wall of law books, blurred, on its own clock -------------- */
.backdrop {
  position: fixed;
  inset: -8% -4%;
  z-index: 0;
  background: #060606 url("../img/wall.png") center / cover no-repeat;
  filter: blur(20px) brightness(0.52) contrast(1.2);
  opacity: 0.62;
  animation: drift 90s ease-in-out infinite alternate;
  pointer-events: none;
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 38%, rgba(8, 8, 8, 0.12) 0%, rgba(8, 8, 8, 0.72) 70%, rgba(8, 8, 8, 0.95) 100%);
}
@keyframes drift {
  from { transform: scale(1.04) translate3d(-1.2%, -0.8%, 0); }
  to   { transform: scale(1.1) translate3d(1.2%, 1%, 0); }
}

/* ---- the sheet ------------------------------------------------------------------------------ */
.sheet {
  position: relative;
  z-index: 1;
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: var(--edge) var(--edge) 72px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  align-items: stretch;
}

/* ---- a cell --------------------------------------------------------------------------------- */
.cell {
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--rule);
  background: rgba(8, 8, 8, 0.9);
}
.cell--plain { border: 0; background: none; }
.cell--invert { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.cell--invert .cell__head { border-bottom-color: var(--ground); }
.cell--invert .mark, .cell--invert .dim { color: #3a3a38; }

.cell__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 102px;
  margin: 0;
  padding: 20px var(--headpad);
  border-bottom: 1px solid var(--rule);
  font: 700 clamp(21px, 1.5vw, 29px)/1.06 "Clash", sans-serif;
  letter-spacing: 0.004em;
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
}
.cell__body {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cell__body--tight { gap: 12px; }
.cell__body--mid { justify-content: center; }

/* ---- the wordmark band: fitted to the sheet, edge to edge ------------------------------------ */
.band {
  grid-column: span 12;
  border: 0;
  padding: 10px 0 4px;
  overflow: hidden;
}
.band__word {
  display: block;
  width: max-content;
  margin: 0;
  font: 700 100px/0.82 "Clash", sans-serif;
  letter-spacing: -0.028em;
  white-space: nowrap;
  color: var(--ink);
}

/* ---- type roles ----------------------------------------------------------------------------- */
.mark {
  font: 400 16px/1.2 "RX", ui-monospace, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.dim { color: var(--dim); }
.num {
  font: 700 clamp(34px, 2.6vw, 46px)/1 "Clash", sans-serif;
  letter-spacing: -0.015em;
}
.statement {
  margin: 0;
  font: 700 clamp(24px, 2vw, 34px)/1.04 "Clash", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.002em;
}
.lede { margin: 0; font-size: 19px; line-height: 1.38; }
.body p { margin: 0 0 14px; }
.body p:last-child { margin-bottom: 0; }
.hair { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---- contents: the nav, built as one cell of the grid ---------------------------------------- */
.toc { display: flex; flex-direction: column; gap: 0; }
.toc__item {
  display: grid;
  grid-template-columns: 30px 46px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 15px 28px;
  margin: 0 -28px;
  border-bottom: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
  min-height: 64px;
}
.toc__item:last-child { border-bottom: 0; }
.toc__arrow { width: 28px; height: 11px; }
.toc__no { font: 700 22px/1 "Clash", sans-serif; letter-spacing: -0.01em; }
.toc__name { font: 500 18px/1.15 "Nippo", sans-serif; }
.toc__item[aria-current="page"] {
  background: var(--ink);
  color: var(--ground);
  border-bottom-color: var(--ink);
}
.toc__item[aria-current="page"] .toc__arrow { filter: invert(1); }
.toc__item:hover:not([aria-current="page"]) { background: #141414; }
.toc__item:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }

/* ---- the charter figure: the book with four numbered callouts -------------------------------- */
.figure { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; gap: 20px; }
.figure__top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 31%) minmax(0, 1fr); gap: 26px; align-items: center; }
.figure__frame {
  position: relative;
  aspect-ratio: 750 / 1019;
  min-height: 240px;
  background: url("../img/book-charter.png") center / contain no-repeat;
}
.figure__roundels { display: grid; grid-template-columns: repeat(auto-fit, minmax(152px, 1fr)); gap: var(--gap); }
.roundel {
  border: 1px solid var(--rule);
  padding: 16px 28px 18px;
  text-align: center;
  min-width: 0;
}
.roundel__no { font: 700 26px/1 "Clash", sans-serif; }
.roundel__txt { margin-top: 8px; font-size: 16px; line-height: 1.22; color: var(--dim); overflow-wrap: break-word; }

.callouts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; align-content: center; }
.callout { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 18px; align-items: start; }
.callout__no {
  width: 60px; height: 60px;
  display: grid; place-items: center;
  border: 1px solid var(--rule);
  font: 700 21px/1 "Clash", sans-serif;
}
.callout__txt { font-size: 16px; line-height: 1.26; padding-top: 3px; }
.callout__txt b { font-weight: 700; display: block; font-size: 18px; margin-bottom: 2px; }

/* ---- the day log: arrow, big time, line ------------------------------------------------------ */
.log { display: flex; flex-direction: column; gap: 0; }
.log__row { padding: 16px var(--pad); margin: 0 calc(var(--pad) * -1); }
.log__row:first-child { padding-top: 0; }
.log__row + .log__row { border-top: 1px solid var(--rule); }
.log__top { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; }
.log__arrow { width: 34px; height: 13px; }
.log__time { font: 700 clamp(26px, 2vw, 34px)/1 "Clash", sans-serif; letter-spacing: -0.01em; }
.log__txt { margin: 8px 0 0; font-size: 17px; line-height: 1.3; }
.log__cite { margin-top: 6px; }

/* ---- counters: the 2 by 2 grid of figures ---------------------------------------------------- */
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 0; flex: 1 1 auto; }
.counter {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  padding: 26px 32px;
  min-width: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.counter:nth-child(2n) { border-right: 0; }
.counter:nth-child(n+3) { border-bottom: 0; }
.counter__icon { height: 76px; background: center / contain no-repeat; }
.counter__no { font: 700 clamp(30px, 2.3vw, 42px)/1 "Clash", sans-serif; letter-spacing: -0.015em; }
.counter__txt { font-size: 16px; line-height: 1.2; color: var(--dim); }

/* ---- the purse: the contract article --------------------------------------------------------- */
.purse { display: flex; flex-direction: column; gap: 20px; }
.purse__line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--gap);
  align-items: stretch;
}
.addr {
  min-width: 0;
  padding: 19px 24px;
  border: 1px solid var(--rule);
  background: #0d0d0d;
  font: 400 clamp(16px, 1.1vw, 19px)/1.4 "RX", ui-monospace, monospace;
  overflow-wrap: anywhere;
  user-select: all;
  display: flex;
  align-items: center;
}
.addr[data-state="empty"] { color: var(--dim); user-select: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 1.4em;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--ground);
  font: 700 17px/1 "Nippo", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 90ms ease;
}
.btn:active { transform: translateY(2px); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { border-color: var(--ink); }
.btn[aria-disabled="true"], .btn:disabled {
  background: transparent; color: var(--dim); border-color: var(--rule); cursor: not-allowed;
}
.btn[aria-disabled="true"]:active, .btn:disabled:active { transform: none; }
.btn__mark { width: 20px; height: 20px; flex: 0 0 auto; }
/* an official mark is the platform-s own file: never recoloured, never redrawn */

.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); gap: var(--gap); }
.links .btn { width: 100%; }

/* ---- the split: ghost numerals under the text ------------------------------------------------ */
.split { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 26px; align-items: start; }
.split__dial { aspect-ratio: 1; background: url("../img/fig-split.png") center / contain no-repeat; }
.split__rows { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.split__row {
  position: relative;
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 94px;
  padding: 14px var(--pad);
  margin: 0 calc(var(--pad) * -1);
  overflow: hidden;
}
.split__row + .split__row { border-top: 1px solid var(--rule); }
.split__pct { font: 700 32px/1 "Clash", sans-serif; letter-spacing: -0.02em; }
.split__what { font-size: 17px; line-height: 1.25; }
.split__ghost {
  position: absolute;
  right: var(--pad); top: 50%;
  transform: translateY(-50%);
  font: 700 44px/1 "Clash", sans-serif;
  color: var(--ink);
  opacity: 0.1;
  pointer-events: none;
  user-select: none;
}

/* ---- comparison table ------------------------------------------------------------------------ */
.compare { width: 100%; border-collapse: collapse; }
.compare th, .compare td {
  padding: 15px 19px;
  border: 1px solid var(--rule);
  text-align: left;
  font-size: 17px;
  line-height: 1.26;
  vertical-align: top;
}
.compare th {
  font: 400 16px/1.2 "RX", ui-monospace, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.compare td:first-child { color: var(--dim); }

/* ---- steps ----------------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(224px, 1fr)); gap: var(--gap); }
.step { border: 1px solid var(--rule); padding: 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.step__fig { height: 110px; background: center / contain no-repeat; }
.step__no { font: 400 16px/1.2 "RX", ui-monospace, monospace; letter-spacing: 0.1em; color: var(--dim); }
.step__t { font: 700 20px/1.1 "Clash", sans-serif; text-transform: uppercase; }
.step__p { font-size: 16px; line-height: 1.28; }

/* ---- the seal cell --------------------------------------------------------------------------- */
.seal { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); gap: 24px; align-items: center; }
.seal__img { aspect-ratio: 1; background: url("../img/seal.png") center / contain no-repeat; }
.cell--invert .seal__img, .cell--invert .plate, .cell--invert .empty__fig { filter: invert(1); }
.seal__rows { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.seal__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: baseline; }
.seal__k { font: 400 16px/1.3 "RX", ui-monospace, monospace; letter-spacing: 0.08em; text-transform: uppercase; }
.seal__v { font: 400 17px/1.3 "RX", ui-monospace, monospace; overflow-wrap: anywhere; text-align: right; }

/* ---- the articles ---------------------------------------------------------------------------- */
.articles { display: flex; flex-direction: column; gap: 0; }
.article { padding: 26px var(--pad); margin: 0 calc(var(--pad) * -1); }
.article:first-child { padding-top: 0; }
.article + .article { border-top: 1px solid var(--rule); }
.article__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.article__no { font: 700 24px/1.05 "Clash", sans-serif; text-transform: uppercase; }
.chip {
  display: inline-block;
  padding: 9px 17px;
  border: 1px solid var(--rule);
  font: 400 16px/1 "RX", ui-monospace, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.chip--solid { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.section { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 18px; padding: 9px 0; }
.section__k { font: 400 16px/1.45 "RX", ui-monospace, monospace; color: var(--dim); }
.section__t { font-size: 18px; line-height: 1.38; }

/* ---- lists of records (days, amendments, cases) ---------------------------------------------- */
.record { border: 1px solid var(--rule); }
.record + .record { margin-top: var(--gap); }
.record__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px var(--headpad);
  border-bottom: 1px solid var(--rule);
}
.record__title { font: 700 24px/1.05 "Clash", sans-serif; text-transform: uppercase; }
.record__body { padding: var(--pad); display: flex; flex-direction: column; gap: 18px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 19px; border: 1px solid var(--rule); text-align: left; font-size: 17px; line-height: 1.25; vertical-align: top; }
.table th { font: 400 16px/1.2 "RX", ui-monospace, monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.table td.n { font-family: "RX", ui-monospace, monospace; white-space: nowrap; }
.wrap-scroll { overflow-x: auto; }

.verdict { display: flex; align-items: flex-start; gap: 18px; padding: 20px 24px; border: 1px solid var(--rule); }
.verdict__fig { width: 52px; height: 52px; flex: 0 0 auto; background: center / contain no-repeat; }
.verdict--pass { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.verdict--pass .verdict__fig { filter: invert(1); }
.verdict__t { font: 700 19px/1.2 "Nippo", sans-serif; text-transform: uppercase; letter-spacing: 0.02em; }
.verdict__p { margin: 7px 0 0; font-size: 17px; line-height: 1.3; }
.verdict ul { margin: 8px 0 0; padding-left: 22px; }
.verdict li { font-size: 17px; line-height: 1.35; margin-bottom: 5px; }

/* ---- forms ----------------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.field > label { font: 400 16px/1.2 "RX", ui-monospace, monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.input, .textarea {
  width: 100%;
  padding: 17px 22px;
  border: 1px solid var(--rule);
  background: #0d0d0d;
  color: var(--ink);
  font: 400 18px/1.4 "Nippo", sans-serif;
}
.textarea { min-height: 190px; resize: vertical; font-family: "RX", ui-monospace, monospace; font-size: 16px; }
.input:focus, .textarea:focus { outline: 2px solid var(--ink); outline-offset: -2px; border-color: var(--ink); }
.row-btns { display: flex; flex-wrap: wrap; gap: var(--gap); }

.result { min-height: 56px; display: flex; align-items: center; padding: 17px 22px; border: 1px solid var(--rule); font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.result[data-tone="ok"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.result:empty { color: var(--dim); }
.result:empty::before { content: attr(data-idle); }

/* ---- the tally bar, built from ink blocks ----------------------------------------------------- */
.tally { display: flex; flex-direction: column; gap: 10px; }
.tally__bar { display: flex; height: 26px; border: 1px solid var(--rule); }
.tally__for { background: var(--ink); }
.tally__against { background: repeating-linear-gradient(135deg, var(--rule) 0 3px, transparent 3px 7px); }
.tally__legend { display: flex; flex-wrap: wrap; gap: 22px; }

/* ---- empty states ----------------------------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 30px 0; text-align: center; }
.empty__fig { width: 124px; height: 124px; background: center / contain no-repeat; }
.empty__t { font: 700 21px/1.2 "Clash", sans-serif; text-transform: uppercase; }
.empty__p { margin: 0; max-width: 46ch; font-size: 17px; line-height: 1.35; color: var(--dim); }

/* ---- the risk line ----------------------------------------------------------------------------- */
.risk { font-size: 17px; line-height: 1.35; color: var(--dim); }

/* ---- column spans ------------------------------------------------------------------------------ */
.c3 { grid-column: span 3; }
.c4 { grid-column: span 4; }
.c5 { grid-column: span 5; }
.c6 { grid-column: span 6; }
.c7 { grid-column: span 7; }
.c8 { grid-column: span 8; }
.c9 { grid-column: span 9; }
.c12 { grid-column: span 12; }

/* the three column figure needs a wide cell; below that the book moves to the side */
@media (max-width: 1560px) {
  .figure__top { grid-template-columns: minmax(160px, 32%) minmax(0, 1fr); gap: 24px; align-items: start; }
  .figure__frame { grid-row: span 2; order: -1; align-self: center; }
}

/* the three column figure needs a wide cell; the book moves above its callouts on a narrow one */
@media (max-width: 1000px) {
  .figure__top { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .figure__frame { grid-row: auto; order: -1; max-width: 240px; margin: 0 auto; }
  .callouts { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
}

/* the dial beside its rows needs a wide cell */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .split__dial { max-width: 200px; margin: 0 auto; }
}

/* ---- 1366 and under ----------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  :root { --pad: 32px; --headpad: 32px; }
  .c3 { grid-column: span 4; }
  .c4 { grid-column: span 4; }
  .c5 { grid-column: span 6; }
  .c6 { grid-column: span 6; }
  .c7 { grid-column: span 8; }
  .c8 { grid-column: span 8; }
  .c9 { grid-column: span 12; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  :root { --edge: 16px; --pad: 32px; --headpad: 28px; --gap: 8px; }
  .sheet { padding-bottom: 52px; }
  .c3, .c4, .c5, .c6, .c7, .c8, .c9 { grid-column: span 12; }
  .links { grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); }
  .purse__line { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .split__dial { max-width: 190px; margin: 0 auto; }
  .seal { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .seal__img { max-width: 140px; margin: 0 auto; }
  .seal__row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .seal__v { text-align: left; }
  .figure__top { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .figure__frame { max-width: 260px; margin: 0 auto; }
  .cell__head { min-height: 0; }
  .figure__frame { min-height: 220px; }
  .counters { grid-template-columns: minmax(0, 1fr); }
  .counter { border-right: 0; border-bottom: 1px solid var(--rule); }
  .counter:last-child { border-bottom: 0; }
  .section { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .figure__roundels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell__head { font-size: clamp(20px, 5.2vw, 26px); }
}

@media (max-width: 420px) {
  :root { --edge: 10px; --pad: 32px; --headpad: 26px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .figure__roundels { grid-template-columns: minmax(0, 1fr); }
  .roundel { padding: 14px 22px 16px; }
  .links { grid-template-columns: minmax(0, 1fr); }
  .toc__item { grid-template-columns: 24px 38px minmax(0, 1fr); gap: 10px; padding: 15px var(--pad); margin: 0 calc(var(--pad) * -1); }
  .split__ghost { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop { animation: none; }
  .btn { transition: none; }
}

/* ---- the hour the executor runs ------------------------------------------------------------- */
.whenbox { padding-bottom: 22px; }
.whenbox + .hair + .log { padding-top: 22px; }
.whenbox__t { font: 700 30px/1 "Clash", sans-serif; letter-spacing: -0.015em; }
.whenbox__p { margin: 10px 0 10px; font-size: 16px; line-height: 1.26; }

/* ---- the facts at the foot of the contents cell -------------------------------------------- */
.toc__foot { display: flex; flex-direction: column; gap: 12px; padding: 24px var(--pad); margin: 4px calc(var(--pad) * -1) calc(var(--pad) * -1); border-top: 1px solid var(--rule); }

.log { flex: 1 1 auto; }
.log .empty { padding: 30px 0 10px; }

/* ---- the numbered plate that closes an inner page's first row -------------------------------- */
.plate { flex: 1 1 auto; min-height: 190px; background: center / contain no-repeat; }
.plate__cap { margin: 18px 0 0; font-size: 16px; line-height: 1.3; color: var(--dim); }

/* a class that sets display beats [hidden] on its own, so say it here */
.btn[hidden] { display: none; }

/* ---- the three things the live audit found at 320 and 375 ------------------------------------ */

/* The band clips sideways, never downwards: overflow:hidden cut 7 px off the bottom of the
   wordmark at phone sizes. overflow-x: clip does not force the other axis to become scrollable. */
.band { overflow: visible; overflow-x: clip; }

/* A button label longer than the screen pushed the page sideways on the two pages with forms. */
@media (max-width: 560px) {
  .btn { white-space: normal; text-align: center; line-height: 1.2; padding: 14px 1.2em; }
  .row-btns .btn, .links .btn { width: 100%; }
}

/* The contract and rulebook table is prose, not data: on a phone it stacks instead of scrolling. */
@media (max-width: 700px) {
  .compare, .compare tbody, .compare tr, .compare td, .compare th { display: block; width: 100%; }
  .compare thead { display: none; }
  .compare tr { margin-bottom: var(--gap); border: 1px solid var(--rule); }
  .compare td { border: 0; border-top: 1px solid var(--rule); padding: 14px 19px; }
  .compare td:first-child {
    border-top: 0;
    font: 400 16px/1.2 "RX", ui-monospace, monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .compare td:nth-child(2)::before { content: "Smart contract: "; color: var(--dim); }
  .compare td:nth-child(3)::before { content: "The Rulebook: "; color: var(--dim); }
}

/* On a phone the sheet opens on its own name, then the way around it, then the law. A first screen
   that is nothing but a table of contents tells a visitor nothing about the coin. */
@media (max-width: 860px) {
  .band { order: -2; padding-top: 2px; }
  .toc-cell { order: -1; }
  .toc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc__item { margin: 0; padding: 14px var(--pad); border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); min-height: 62px; }
  .toc__item:nth-child(2n) { border-right: 0; }
  .toc__item:nth-last-child(-n+2) { border-bottom: 0; }
  .toc__item[aria-current="page"] { border-right-color: var(--ink); }
  .toc-cell .cell__head { min-height: 0; }
  .toc__foot { display: none; }
}

/* Two columns of contents need the room for the longest section name, and a 32 px numeral needs
   32 px of padding: below 560 px both go back to one column and a smaller numeral. */
@media (max-width: 560px) {
  .toc { grid-template-columns: minmax(0, 1fr); }
  .toc__item { border-right: 0; }
  .toc__item:nth-last-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .toc__item:last-child { border-bottom: 0; }
  .whenbox__t { font-size: 28px; }
  .split__pct { font-size: 28px; }
  .num { font-size: clamp(28px, 7vw, 32px); }
  .counter__no { font-size: clamp(28px, 8vw, 34px); }
  .log__time { font-size: 26px; }
  .record__title { font-size: 21px; }
  .article__no { font-size: 21px; }
  .statement { font-size: clamp(21px, 5.6vw, 26px); }
}

/* Below 700 px the contents row has no room for the arrow as well as the numeral and the longest
   section name, and the name is the part a thumb needs. The numeral carries the list there. */
@media (max-width: 700px) {
  .toc__item { grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
  .toc__arrow { display: none; }
}

/* The four roundels are a complete row or two complete rows, never three and one: a half empty
   row is the asymmetry the look rules forbid. */
.figure__roundels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1561px) { .figure__roundels { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* The contents rows run cell edge to cell edge on a phone, as they do on the desktop sheet. */
@media (max-width: 860px) {
  .toc__item { margin: 0 calc(var(--pad) * -1); }
}

/* At the narrowest widths two roundels side by side cannot hold their longest line. */
@media (max-width: 430px) {
  .figure__roundels { grid-template-columns: minmax(0, 1fr); }
}
