/* Prop Trenches Desk. One printed sheet in two inks on black, built to his LUNAR broadsheet:
   hairline frames with cut corners, solid ink bands with the title knocked out of them, engraved
   ink masks, one grain over the whole ground. No gradient, no bevel, no shadow, no rounded corner. */

@font-face {
  font-family: "Anybody";
  src: url("font/anybody-black-italic.woff2") format("woff2");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("font/jost-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("font/jost-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Martian";
  src: url("font/martian-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Martian";
  src: url("font/martian-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #141413;
  --ink: #ee4423;
  --ink-dim: #8f2c17;
  --bone: #d3d3d5;
  --bone-dim: #7c7c7e;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  --rule: 1px;
  --cut: 22px;
  --gutter: 20px;
  --page: 1360px;

  --display: clamp(30px, 4.4vw, 84px);
  --title: clamp(26px, 2.2vw, 34px);
  --figure: clamp(28px, 2.6vw, 40px);
  --body: 18px;
  --label: 16px;
  --mono: 17px;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ground);
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--bone);
  font-family: Jost, "Trebuchet MS", sans-serif;
  font-weight: 500;
  font-size: var(--body);
  line-height: 1.45;
  letter-spacing: 0.012em;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

/* the sheet's own paper noise: one generated grain tile, even over the whole ground */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bone);
  -webkit-mask-image: url("img/grain.webp");
  mask-image: url("img/grain.webp");
  -webkit-mask-size: 280px 280px;
  mask-size: 280px 280px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

.sheet {
  position: relative;
  z-index: 1;
  max-width: var(--page);
  margin: 0 auto;
  padding: var(--s6) var(--s6) var(--s8);
}

/* ---------------------------------------------------------------- frames */

.frame {
  position: relative;
  --frame-cut: var(--cut);
}
.frame::before,
.frame::after {
  content: "";
  position: absolute;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--frame-cut)),
    calc(100% - var(--frame-cut)) 100%,
    0 100%
  );
  pointer-events: none;
}
.frame::before {
  inset: 0;
  background: var(--ink);
}
.frame::after {
  inset: var(--rule);
  background: var(--ground);
}
.frame > * {
  position: relative;
  z-index: 1;
}
.frame--bone::before {
  background: var(--bone-dim);
}
.frame--flat {
  --frame-cut: 0px;
}

/* ---------------------------------------------------------------- type */

.d {
  font-family: Anybody, "Arial Black", sans-serif;
  font-weight: 900;
  font-style: italic;
  line-height: 0.96;
  letter-spacing: 0.005em;
}

.label {
  font-family: Jost, sans-serif;
  font-weight: 700;
  font-size: var(--label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin: 0;
}

.title {
  font-family: Anybody, sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: var(--title);
  line-height: 1.02;
  letter-spacing: 0.005em;
  color: var(--ink);
  margin: 0;
}

.fig {
  font-family: Martian, ui-monospace, monospace;
  font-weight: 700;
  font-size: var(--figure);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: Martian, ui-monospace, monospace;
  font-weight: 400;
  font-size: var(--mono);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.up {
  color: var(--ink);
}
.down {
  color: var(--bone);
}
.muted {
  color: var(--bone-dim);
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  --frame-cut: 34px;
  padding: var(--s5) var(--s6) 0;
  margin-bottom: var(--s6);
}

.masthead__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--gutter);
  align-items: start;
}

.band {
  background: var(--ink);
  color: var(--ground);
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 27px 36px 29px 33px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 0.3em) 100%, 0 100%);
  font-size: var(--display);
}
.band + .band {
  margin-top: 6px;
}

.masthead__ident {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding-top: 6px;
}

.seal {
  display: block;
  width: clamp(88px, 10vw, 164px);
  aspect-ratio: 1.0031;
  background: var(--ink);
  -webkit-mask-image: url("img/seal.webp");
  mask-image: url("img/seal.webp");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.masthead__ticker {
  font-family: Martian, monospace;
  font-weight: 700;
  font-size: clamp(18px, 1.5vw, 24px);
  letter-spacing: 0.02em;
  color: var(--bone);
}

.masthead__trench {
  margin: var(--s4) calc(var(--s6) * -1) 0;
  height: clamp(78px, 8vw, 170px);
  background: var(--ink);
  -webkit-mask-image: url("img/trench-horizon.webp");
  mask-image: url("img/trench-horizon.webp");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* ---------------------------------------------------------------- the line (navigation) */

.line {
  position: relative;
  margin: 0 0 var(--s6);
  padding: 0 2px;
}

.line__rail {
  position: relative;
  height: 2px;
  background: var(--bone-dim);
}
/* the travelled part of the rail, filled to the CENTRE of the open station's marker. The width is
   measured from the markers themselves in src/main.js, so it cannot drift from where they sit. */
.line__rail::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--filled, 0px);
  background: var(--ink);
  transition: width 0.25s ease;
}

.line__marks {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--s2);
  padding-top: var(--s2);
}

/* One station. The open one is inked as a WHOLE: the fill is this element's own background, never a
   plate on the name, so it can never cover the figure under it and the row never changes height. */
.mark {
  position: relative;
  min-width: 0;
  appearance: none;
  background: none;
  border: 0;
  padding: var(--s3) 18px var(--s4);
  margin: 0;
  text-align: left;
  color: var(--bone);
  font: inherit;
  cursor: pointer;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 6px;
}
.mark::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 10px solid var(--bone-dim);
}
.mark__name {
  font-weight: 700;
  font-size: var(--label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.1;
  white-space: nowrap; /* a station name is always one line, so six columns share one top line */
  overflow: hidden;
  text-overflow: ellipsis;
}
.mark__note {
  font-family: Martian, monospace;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--bone-dim);
  line-height: 1.2;
  white-space: nowrap; /* one line under the name, in every column, whatever is open */
  overflow: hidden;
  text-overflow: ellipsis;
}
.mark:hover .mark__name,
.mark:focus-visible .mark__name {
  color: var(--ink);
}
.mark[aria-current="true"] {
  background: var(--ink);
}
.mark[aria-current="true"]::before {
  border-bottom-color: var(--ink);
}
.mark[aria-current="true"] .mark__name,
.mark[aria-current="true"] .mark__note,
.mark[aria-current="true"]:hover .mark__name,
.mark[aria-current="true"]:focus-visible .mark__name {
  color: var(--ground);
}
.mark[aria-current="true"] .mark__note {
  opacity: 0.78;
}

/* ---------------------------------------------------------------- grid */

.row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
  margin-bottom: var(--gutter);
}
.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; }

/* ---------------------------------------------------------------- cells */

.cell {
  padding: var(--s5) var(--s5) var(--s5);
  min-width: 0;
}
.cell--pad {
  padding: var(--s6);
}

.plate {
  background: var(--ink);
  color: var(--ground);
  padding: var(--s5) var(--s5) var(--s5);
}
.plate p {
  margin: 0;
  font-weight: 500;
  text-align: justify;
  text-wrap: pretty;
}
.plate p + p {
  margin-top: var(--s4);
}
.plate {
  display: flex;
  flex-direction: column;
}
.plate__facts {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  gap: var(--s2) var(--s5);
  margin: auto 0 0;
  padding-top: var(--s5);
  font-size: var(--label);
}
/* the rule over the facts is drawn, not a border: a border would make this list the text's own
   visible box and every label would read as pressed against it */
.plate__facts::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--ground);
}
.plate__facts dt {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.plate__facts dd {
  margin: 0;
  text-align: right;
  font-family: Martian, monospace;
  font-weight: 700;
}
.plate .label {
  color: var(--ground);
  opacity: 0.72;
  margin-bottom: var(--s3);
}

.figcell {
  display: grid;
  align-content: space-between;
  gap: var(--s4);
  min-height: 150px;
}
.figcell__value {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  flex-wrap: wrap;
}
.figcell__unit {
  font-family: Martian, monospace;
  font-weight: 400;
  font-size: var(--label);
  color: var(--bone-dim);
}
.figcell__note {
  font-size: var(--label);
  color: var(--bone-dim);
  margin: 0;
}

.engraving {
  display: block;
  width: 100%;
  background: var(--ink);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.engraving--hero {
  aspect-ratio: 1.5;
}

/* ---------------------------------------------------------------- the wicket (links) */

.wicket {
  display: grid;
  gap: var(--s4);
  padding: var(--s5);
}
.wicket__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
}
.wicket__ticker {
  font-family: Anybody, sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: clamp(32px, 3vw, 46px);
  color: var(--ink);
  line-height: 1;
}
.wicket__mint {
  background: #0b0b0a;
  border: var(--rule) solid var(--ink-dim);
  padding: var(--s3) var(--s4);
  color: var(--bone);
  word-break: break-all;
  overflow-wrap: anywhere;
  min-width: 0;
  font-size: 17px;
  line-height: 1.5;
  user-select: all;
}
.wicket__keys {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
}

.key {
  appearance: none;
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 52px;
  padding: var(--s3) var(--s4);
  background: transparent;
  border: var(--rule) solid var(--ink);
  color: var(--bone);
  font-family: Jost, sans-serif;
  font-weight: 700;
  font-size: var(--label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.key img {
  width: 24px;
  height: 24px;
  flex: none;
  object-fit: contain;
}
.key:hover:not([aria-disabled="true"]),
.key:focus-visible:not([aria-disabled="true"]) {
  background: var(--ink);
  color: var(--ground);
}
.key[aria-disabled="true"] {
  border-color: var(--ink-dim);
  color: var(--bone-dim);
  cursor: not-allowed;
}
.key[aria-disabled="true"] img {
  opacity: 0.45;
}
.key--wide {
  grid-column: span 2;
}

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

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  min-height: 52px;
  padding: var(--s3) var(--s5);
  background: var(--ink);
  color: var(--ground);
  border: var(--rule) solid var(--ink);
  font-family: Jost, sans-serif;
  font-weight: 700;
  font-size: var(--label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:hover:not(:disabled),
.btn:focus-visible:not(:disabled) {
  background: var(--ground);
  color: var(--ink);
}
.btn:disabled {
  background: transparent;
  border-color: var(--ink-dim);
  color: var(--bone-dim);
  cursor: not-allowed;
}
.btn--ghost {
  background: transparent;
  color: var(--bone);
}
.btn--ghost:hover:not(:disabled),
.btn--ghost:focus-visible:not(:disabled) {
  background: var(--ink);
  color: var(--ground);
}

input[type="text"],
input[type="number"],
input[type="search"],
select {
  width: 100%;
  min-height: 52px;
  padding: var(--s3) var(--s4);
  background: #0b0b0a;
  border: var(--rule) solid var(--ink-dim);
  color: var(--bone);
  font-family: Martian, monospace;
  font-size: var(--mono);
}
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- tables */

.sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--label);
}
.sheet th,
.sheet td {
  padding: var(--s3) var(--s4);
  text-align: left;
  border-bottom: var(--rule) solid var(--ink-dim);
  vertical-align: baseline;
  overflow-wrap: anywhere;
}
.sheet th {
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-dim);
  border-bottom-color: var(--ink);
}
.sheet td.num,
.sheet th.num {
  text-align: right;
  font-family: Martian, monospace;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- stations */

.station[hidden] {
  display: none;
}

.empty {
  color: var(--bone-dim);
  font-size: var(--label);
  margin: 0;
}

/* ---------------------------------------------------------------- the four steps */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s6);
}
.step {
  display: grid;
  grid-template-rows: auto auto;
  gap: var(--s4);
  align-content: start;
}
.step__img {
  display: block;
  width: 100%;
  aspect-ratio: 1.35;
  background: var(--ink);
}
.step__n {
  font-family: Martian, monospace;
  font-size: 16px;
  color: var(--bone-dim);
  margin: 0 0 2px;
}
.step__title {
  margin: 0 0 var(--s2);
  font-weight: 700;
  font-size: var(--label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}
.step__line {
  margin: 0;
  font-size: var(--label);
  color: var(--bone);
  line-height: 1.4;
}

.split + .split { margin-top: var(--s5); }
.split__title {
  margin: 0 0 var(--s3);
  font-weight: 700;
  font-size: var(--label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.risks dt {
  font-weight: 700;
  font-size: var(--label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: var(--s4);
}
.risks dt:first-child {
  margin-top: 0;
}
.risks dd {
  margin: var(--s2) 0 0;
  font-size: var(--label);
  color: var(--bone);
  line-height: 1.45;
}

/* ---------------------------------------------------------------- the card */

.card {
  border: var(--rule) solid var(--ink);
  padding: var(--s5);
  display: grid;
  gap: var(--s3);
  justify-items: center;
  text-align: center;
}
.card__seal {
  width: 92px;
}
.card__head {
  margin: 0;
  font-weight: 700;
  font-size: var(--label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.card__name {
  margin: 0;
  font-size: 20px;
  color: var(--bone);
}
.card__rows {
  display: grid;
  grid-template-columns: auto auto;
  gap: var(--s2) var(--s5);
  margin: var(--s2) 0 0;
  font-size: var(--label);
  width: 100%;
}
.card__rows dt {
  color: var(--bone-dim);
  text-align: left;
}
.card__rows dd {
  margin: 0;
  text-align: right;
  color: var(--bone);
}
.card__note {
  margin: var(--s2) 0 0;
  font-size: 17px;
  color: var(--bone-dim);
  max-width: 34ch;
}

/* ---------------------------------------------------------------- terminal */

.strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--s4);
  margin-bottom: var(--s5);
}
.strip__cell .label {
  margin-bottom: var(--s2);
}
.strip__value {
  margin: 0;
  font-weight: 700;
  font-size: clamp(17px, 1.5vw, 21px);
  color: var(--bone);
}

.gauge {
  margin-top: var(--s4);
}
.gauge__rail {
  position: relative;
  height: 2px;
  background: var(--bone-dim);
  margin: 26px 0 var(--s4);
}
.gauge__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--ink);
}
.gauge__tick {
  position: absolute;
  top: -5px;
  width: 1px;
  height: 12px;
  background: var(--bone-dim);
}
.gauge__mark {
  position: absolute;
  top: -13px;
  width: 0;
  height: 0;
  margin-left: -6px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid var(--bone);
}
.gauge__mark--peak {
  top: 6px;
  border-top: 0;
  border-bottom: 9px solid var(--ink);
}
.gauge__labels {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  color: var(--bone-dim);
}

.search__list {
  display: grid;
  gap: var(--s2);
  margin-top: var(--s3);
}
.coin {
  appearance: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s4);
  width: 100%;
  min-height: 48px;
  padding: var(--s3) var(--s4);
  background: transparent;
  border: var(--rule) solid var(--ink-dim);
  color: var(--bone);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.coin:hover,
.coin:focus-visible {
  border-color: var(--ink);
  background: #1d0f0a;
}
.coin__name {
  font-weight: 700;
  font-size: var(--label);
  min-width: 0;
  overflow-wrap: anywhere;
}
.coin__facts {
  font-size: 16px;
  color: var(--bone-dim);
  min-width: 0;
  overflow-wrap: anywhere;
}

.facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s2) var(--s5);
  margin: var(--s3) 0 0;
  font-size: var(--label);
}
.facts dt {
  color: var(--bone-dim);
}
.facts dd {
  margin: 0;
  text-align: right;
  color: var(--bone);
  overflow-wrap: anywhere;
}

.sides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s2);
}
.side {
  appearance: none;
  min-height: 52px;
  padding: var(--s3) var(--s4);
  background: transparent;
  border: var(--rule) solid var(--ink-dim);
  color: var(--bone);
  font-family: Jost, sans-serif;
  font-weight: 700;
  font-size: var(--label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.side--on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}

.field {
  display: block;
  margin-top: var(--s4);
}
.field .label {
  display: block;
  margin-bottom: var(--s2);
}

.quote {
  margin-top: var(--s4);
  min-height: 112px;
}
.quote__note {
  margin: var(--s3) 0 0;
  font-size: 16px;
  color: var(--bone-dim);
  line-height: 1.4;
}

.tape {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tape__cell {
  width: 14px;
  height: 14px;
  border: var(--rule) solid var(--ink);
}
.tape__cell--win {
  background: var(--ink);
}
.tape__cell--buy {
  border-color: var(--bone-dim);
}
.tape__cell--loss {
  border-color: var(--bone);
}

.dial {
  display: block;
  width: 100%;
  margin: 0 auto;
}

.gate {
  display: grid;
  align-content: start;
  gap: var(--s3);
}
.gate__line {
  margin: 0;
  font-size: var(--label);
  line-height: 1.4;
}
.gate__price {
  margin: var(--s2) 0 0;
}
.gate .btn {
  width: 100%;
  margin-top: var(--s2);
}

.notice {
  margin: 0 0 var(--s3);
  padding: var(--s3) var(--s4);
  border: var(--rule) solid var(--ink-dim);
  font-size: var(--label);
  line-height: 1.4;
  color: var(--bone);
}
.notice.good {
  border-color: var(--ink);
  color: var(--ink);
}
.notice.bad {
  border-color: var(--bone);
  color: var(--bone);
}

.txlink {
  color: var(--ink);
  text-decoration: none;
  border-bottom: var(--rule) solid var(--ink-dim);
}
.txlink:hover,
.txlink:focus-visible {
  border-bottom-color: var(--ink);
}

/* ---------------------------------------------------------------- responsive (always last) */

@media (max-width: 1100px) {
  .c3, .c4, .c5 { grid-column: span 6; }
  .c7, .c8, .c9 { grid-column: span 12; }
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Six names no longer fit one row at their own size, so the line breaks into one ruled segment
     per station: a single rail over two rows would leave the lower row's markers on nothing. */
  .line__rail {
    display: none;
  }
  .line__marks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s2) var(--s3);
    padding-top: 0;
  }
  .mark {
    border-top: 2px solid var(--bone-dim);
    padding: var(--s4) 18px var(--s3);
  }
  .mark[aria-current="true"] {
    border-top-color: var(--ink);
  }
  .mark::before {
    top: -12px;
  }
}

@media (max-width: 720px) {
  :root {
    --cut: 16px;
    --gutter: 14px;
  }
  .sheet {
    padding: var(--s4) var(--s4) var(--s7);
  }
  .masthead {
    --frame-cut: 22px;
    padding: var(--s4) var(--s4) 0;
  }
  .masthead__top {
    grid-template-columns: minmax(0, 1fr);
  }
  .masthead__ident {
    align-items: center;
    justify-content: flex-start;
    gap: var(--s4);
    padding-top: var(--s3);
  }
  .seal {
    width: 72px;
  }
  .band {
    padding: 18px 32px 20px 30px;
  }
  .masthead__trench {
    margin: var(--s4) calc(var(--s4) * -1) 0;
  }
  .row > * {
    grid-column: span 12;
  }
  .line__marks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mark__name {
    letter-spacing: 0.04em;
    /* Two columns on a phone cannot hold "02 Evaluation" on one line at the 16 px floor: it needs
       136 px and the cell gives 128. So here the name wraps rather than being cut, always the same
       way, whatever station is open: the row still never changes height when you switch. */
    white-space: normal;
    overflow: visible;
  }
  .mark__note {
    display: none; /* the figure lives on its own station; two columns have no room for it */
  }
  .wicket__keys {
    grid-template-columns: minmax(0, 1fr);
  }
  .key--wide {
    grid-column: span 1;
  }
  .strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s5);
  }
  .sheet table {
    font-size: 16px;
    table-layout: fixed;
  }
  .sheet th,
  .sheet td {
    padding: 10px var(--s4);
  }
}

@media (max-width: 430px) {
  .line__marks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* at 320 one station name is wider than half the screen minus its own padding, so the line runs
   down the page instead of across it */
@media (max-width: 360px) {
  .line__marks {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
