/* receipts. One application window, built to his pixel paint program:
   cream chrome, an electric blue headline band, a two column tool rail, a dark working
   canvas, a blue system menu over its bottom left corner, the palette strip, the status
   strip. Nothing here is a card panel: every surface is one of that window's parts. */

@font-face {
  font-family: "Departure";
  src: url("/fonts/DepartureMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Pally";
  src: url("/fonts/Pally-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Pally";
  src: url("/fonts/Pally-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Pally";
  src: url("/fonts/Pally-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "GeistMono";
  src: url("/fonts/GeistMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --cream: #fde2ce;
  --paper: #fff3e6;
  --navy: #130d2b;
  --night: #030c2b;
  --night2: #0a1231;
  --blue: #011fbd;
  --midblue: #3472d3;
  --lightblue: #88b4d8;
  --indigo: #3c54ad;
  --red: #d4535c;
  --terracotta: #dd8c63;
  --sand: #e2ca91;
  --sage: #92ac96;
  --purple: #a265bd;

  --rail: 248px;
  --menu-w: 568px;
  --frame: 3px;
  --line: 2px;
  /* One scale, everywhere. The pixel face is drawn on an 11 px grid, so its sizes are
     multiples of 11 and stay crisp; the reading face and the mono sit between them.
     Nothing on the page is smaller than 16 px (RULES/05_TYPE_AND_SURFACES.md). */
  --t-label: 16px;    /* small labels and values */
  --t-body: 18px;     /* reading text */
  --t-ui: 22px;       /* pixel interface: keys, buttons, plate heads */
  --t-sub: 26px;      /* sub heads, the ticker, the clock */
  --t-head: 33px;     /* section heads */
  --t-display: 44px;  /* the band */
  --ink: #130d2b;     /* every word on cream, one colour */
  --ink-dim: #3f3550; /* the same word, quieter, still over 9:1 on cream */
  --pix: "Departure", ui-monospace, monospace;
  --text: "Pally", "Segoe UI", system-ui, sans-serif;
  --mono: "GeistMono", ui-monospace, "Consolas", monospace;
  --shadow: 0 0 0 var(--line) var(--navy);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--night);
  color: var(--navy);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body { overflow-x: hidden; }

/* An icon is drawn at exactly the size its file is, so a pixel is a pixel. The two big
   scenes are the exception: they are never scaled UP, and when they have to shrink they
   are resampled smoothly, because nearest-neighbour at 0.9x drops whole rows of art. */
img { image-rendering: pixelated; }
.scene { image-rendering: auto; }

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* The world behind the window: the same desk, out of focus, lit by its own lamp. */
.desk {
  position: fixed; inset: -6%;
  background: var(--night) url("/img/desk-blur.jpg") center / cover no-repeat;
  filter: blur(14px) saturate(0.85) brightness(0.52);
  transform: scale(1.06);
  animation: drift 58s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes drift {
  from { transform: scale(1.06) translate3d(-1.2%, -0.8%, 0); }
  to   { transform: scale(1.1) translate3d(1.2%, 0.8%, 0); }
}

/* ------------------------------------------------------------- the window */
.app {
  position: relative;
  margin: 0 auto;
  display: grid;
  /* an auto column takes the widest min-content in the window as its width, and the
     palette's 32 slots are 1250 px of it: the column is pinned to the window instead */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(5, auto);
  background: var(--cream);
  box-shadow: 0 0 0 var(--frame) var(--navy), 0 18px 0 rgba(3, 12, 43, 0.45);
  border: 10px solid var(--cream);
  outline: var(--frame) solid var(--navy);
  outline-offset: calc(var(--frame) * -1);
  max-width: 2100px;
  inset: 0;
}
@media (min-width: 861px) {
  .app { margin: 18px auto; width: calc(100% - 36px); }
}

/* --------------------------------------------------------------- title bar */
.titlebar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 28px;
  min-height: 64px;
  background: var(--cream);
  border-bottom: var(--line) solid var(--navy);
}
.titlebar__icon { width: 40px; height: 40px; flex: none; }
.titlebar__name {
  font-family: var(--pix); font-size: var(--t-ui); line-height: 1;
  letter-spacing: 0.02em; color: var(--navy); padding-top: 4px;
  min-width: 0; overflow: hidden; text-overflow: clip; white-space: nowrap;
}
.titlebar__sub {
  font-size: var(--t-label); color: var(--ink-dim); margin-left: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.titlebar__controls { margin-left: auto; display: flex; gap: 10px; flex: none; }

.winbtn {
  width: 52px; height: 48px;
  display: grid; place-items: center;
  background: var(--paper);
  border: var(--line) solid var(--navy);
  cursor: pointer;
  padding: 0;
}
.winbtn img { width: 24px; height: 24px; }
.winbtn:hover { background: var(--sand); }
.winbtn:active { background: var(--terracotta); }
.winbtn:focus-visible, .tool:focus-visible, .menu__row:focus-visible, .btn:focus-visible,
.legend__row:focus-visible, .swatch:focus-visible, .case:focus-visible, input:focus-visible,
textarea:focus-visible, .link:focus-visible, .claim__toggle:focus-visible {
  outline: 3px solid var(--midblue); outline-offset: 2px;
}

/* --------------------------------------------------------- headline band */
.band {
  background: var(--blue);
  color: var(--paper);
  padding: 18px 28px;
  box-shadow: inset 0 0 0 var(--line) var(--paper);
  border-bottom: var(--line) solid var(--navy);
  display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap;
  min-height: 86px;
}
.band__station {
  font-family: var(--pix); font-size: var(--t-display); line-height: 1.05;
  margin: 0; letter-spacing: 0.01em; color: var(--paper);
}
.band__line { margin: 0; font-size: var(--t-body); color: var(--paper); }
.band[data-colour="sage"] { background: var(--sage); }
.band[data-colour="sand"] { background: var(--sand); }
.band[data-colour="red"] { background: var(--red); }
.band[data-colour="purple"] { background: var(--purple); }
.band[data-colour="lightblue"] { background: var(--lightblue); }
.band[data-colour="indigo"] { background: var(--indigo); }
.band[data-colour="sage"] .band__station, .band[data-colour="sand"] .band__station,
.band[data-colour="lightblue"] .band__station { color: var(--navy); }
.band[data-colour="sage"] .band__line, .band[data-colour="sand"] .band__line,
.band[data-colour="lightblue"] .band__line { color: var(--navy); }

/* ------------------------------------------------------------ the work area */
.work {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 0;
  background: var(--night);
}

/* the rail: two columns of square keys, exactly his tool palette */
.rail {
  padding: 16px;
  align-self: start;
  display: flex; flex-direction: column; gap: 16px;
  align-content: start;
  overflow: hidden;
  background: transparent;
}
.rail__tools {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr;
  border: var(--line) solid var(--navy);
  background: var(--cream);
  flex: none;
}
.rail__tools li { display: block; }
.tool {
  display: grid; justify-items: center; align-content: center; gap: 6px;
  padding: 10px 6px;
  min-height: clamp(68px, 7.4vh, 96px);
  background: var(--paper);
  border: 1px solid var(--navy);
  color: var(--navy); text-decoration: none;
  font-family: var(--pix); font-size: 16px; line-height: 1.1;
  text-align: center;
}
.tool img { width: 44px; height: 44px; }
.tool:hover { background: var(--sand); }
.tool[aria-current="true"] {
  background: var(--blue); color: var(--paper);
}
.tool[aria-current="true"] img { filter: brightness(1.12); }

.legend {
  border: var(--line) solid var(--navy);
  background: var(--paper);
  padding: 16px 16px 14px;
  flex: none;
}
.legend__head {
  margin: 0 0 12px; font-family: var(--pix); font-size: var(--t-label);
  letter-spacing: 0.04em; color: var(--ink);
}
.legend__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.legend__row {
  width: 100%; height: 100%; display: grid; justify-items: center; align-content: center; gap: 6px;
  background: var(--cream); border: 1px solid var(--navy); cursor: pointer;
  padding: 14px 8px; min-height: 100px;
  font-family: var(--pix); font-size: var(--t-label); line-height: 1; color: var(--ink);
}
.legend__row:hover { background: var(--sand); }
.legend__row[aria-pressed="true"] { background: var(--blue); color: var(--paper); }
.legend__count { font-family: var(--mono); font-size: var(--t-ui); line-height: 1; color: var(--ink); }
.legend__row img { width: 52px; height: 52px; }

.canvas {
  overflow: visible;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.028) 0 2px, transparent 2px 4px),
    var(--night);
}
/* the window's own scrollbar, in its own inks */
html { scrollbar-color: var(--cream) var(--midblue); scrollbar-width: auto; }
::-webkit-scrollbar { width: 20px; }
::-webkit-scrollbar-track { background: var(--midblue); border-left: var(--line) solid var(--navy); }
::-webkit-scrollbar-thumb { background: var(--cream); border: var(--line) solid var(--navy); }
.canvas__inner {
  padding: 32px;
  min-height: 100%;
  color: var(--cream);
  display: grid; align-content: start; gap: 28px;
}

/* --------------------------------------------------------- the system menu */
/* the dock: the system menu and the palette strip, side by side under the canvas */
.dock {
  display: grid;
  grid-template-columns: var(--menu-w) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  align-items: stretch;
  border-top: var(--line) solid var(--navy);
  background: var(--night);
  min-height: 0;
}
.menu {
  background: var(--blue);
  border: var(--line) solid var(--navy);
  box-shadow: inset 0 0 0 var(--line) var(--paper);
  padding: 20px 26px 22px;
  color: var(--paper);
  display: grid; align-content: start; gap: 12px;
  min-width: 0;
}
.menu__ticker {
  margin: 0; font-family: var(--pix); font-size: var(--t-sub); line-height: 1; color: var(--paper);
}
.menu__mint {
  margin: 0; font-family: var(--mono); font-size: var(--t-label); line-height: 1.45;
  color: var(--paper); word-break: break-all; min-width: 0;
  user-select: all; -webkit-user-select: all;
  background: #00158f; box-shadow: inset 0 2px 0 #000b57, inset 2px 0 0 #000b57;
  border: 1px solid #5f7bff; padding: 12px 16px; min-height: 52px;
  display: flex; align-items: center;
}
.menu__mint:focus-visible { outline: 3px solid var(--paper); outline-offset: 2px; }
.menu__said {
  margin: 0; min-height: 22px;
  font-family: var(--text); font-size: var(--t-label); line-height: 1.3; color: var(--paper);
}
.menu__rows {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 10px;
}
.menu__rows li { display: grid; }
.menu__row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 14px;
  width: 100%; min-height: 56px; padding: 10px 18px;
  background: #0a2ad6; border: 1px solid var(--paper);
  color: var(--paper); text-decoration: none; cursor: pointer;
  font-family: var(--pix); font-size: var(--t-label); line-height: 1.15; text-align: left;
}
.menu__row:active { background: var(--paper); color: var(--blue); transform: translateY(1px); }
.menu__row:hover { background: var(--paper); color: var(--blue); }
.menu__row[aria-disabled="true"], .menu__row:disabled {
  opacity: 0.55; cursor: not-allowed; background: #011a9c;
}
.menu__row[aria-disabled="true"]:hover, .menu__row:disabled:hover { background: #011a9c; color: var(--paper); }
/* every mark in the menu is 26 px, its own file at its own size, so the four rows read
   as one set: two official brand files and one icon of ours */
.menu__mark { width: 26px; height: 26px; flex: none; justify-self: center; align-self: center; }
.menu__label { min-width: 0; }

/* ------------------------------------------------------- the evidence strip */
.strip {
  display: flex; align-items: center; align-content: center; justify-content: center;
  align-self: center; gap: 20px; flex-wrap: wrap;
  background: var(--cream);
  border: var(--line) solid var(--navy);
  padding: 16px 20px;
  min-width: 0; overflow: hidden;
}
.strip__seal {
  width: 76px; height: 76px; flex: none; display: grid; place-items: center;
  border: var(--line) solid var(--navy); background: var(--paper);
  align-self: center;
}
.strip__seal img { width: 52px; height: 52px; }
.strip__swatches {
  list-style: none; margin: 0; padding: 0; align-self: center;
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 36px);
  grid-auto-columns: 36px; gap: 3px; min-width: 0;
  overflow: hidden; align-content: center;
  border: 1px solid var(--navy);
}
.swatch--empty { background: var(--paper); cursor: default; opacity: 0.55; }
.swatch {
  width: 36px; height: 36px; padding: 0; cursor: pointer;
  border: 1px solid var(--navy); background: var(--sand); display: block;
}
.swatch:hover { transform: scale(1.12); }
.strip__note {
  margin: 0; align-self: center; flex: 0 1 260px; min-width: 0;
  font-family: var(--text); font-size: var(--t-label); line-height: 1.4; color: var(--ink-dim);
}

/* --------------------------------------------------------- the status strip */
.status {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px 28px; min-height: 64px;
  background: var(--cream);
  border-top: var(--line) solid var(--navy);
}
.status p { margin: 0; display: flex; align-items: center; gap: 10px; }
.status__left { font-family: var(--text); font-size: var(--t-body); color: var(--ink); }
.status__left img { width: 22px; height: 22px; }
.status__right { font-family: var(--text); font-size: var(--t-body); color: var(--ink); }
.status__clock {
  font-family: var(--mono); font-size: var(--t-sub); line-height: 1;
  letter-spacing: 0.04em; padding-top: 2px; color: var(--ink);
}
.status[data-live="true"] .status__clock { color: var(--red); }

/* ------------------------------------------------------------ canvas parts */
.plate {
  background: var(--paper);
  border: var(--line) solid var(--navy);
  padding: 24px 28px;
  color: var(--navy);
}
.plate--dark {
  background: var(--night2);
  border-color: var(--midblue);
  color: var(--cream);
}
.plate__head {
  margin: 0 0 16px; font-family: var(--pix); font-size: var(--t-ui); line-height: 1.25; color: inherit;
}
.plate p { margin: 0 0 14px; font-size: var(--t-body); line-height: 1.5; }
.plate p:last-child { margin-bottom: 0; }

.lede { font-size: var(--t-sub); line-height: 1.4; margin: 0; color: var(--cream); max-width: 60ch; }
.loading { font-family: var(--pix); font-size: 22px; color: var(--cream); }

/* the quoted claim, in his speech bubble */
.bubble {
  position: relative;
  background: var(--paper);
  border: var(--line) solid var(--navy);
  padding: 26px 28px 24px;
  color: var(--navy);
  max-width: 64ch;
}
.bubble::after {
  content: ""; position: absolute; left: 46px; bottom: -22px;
  width: 26px; height: 22px;
  background: var(--paper);
  border-left: var(--line) solid var(--navy);
  border-bottom: var(--line) solid var(--navy);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.bubble__text {
  margin: 0; font-family: var(--pix); font-size: 22px; line-height: 1.5;
  overflow-wrap: anywhere;
}
.bubble__who {
  margin: 14px 0 0; font-size: var(--t-label); color: var(--ink-dim);
  display: flex; flex-wrap: wrap; gap: 8px 16px;
}

/* case rows in the feed */
.cases { display: grid; gap: 12px; }
.case {
  display: grid;
  grid-template-columns: 58px minmax(140px, 200px) minmax(0, 1fr) auto;
  align-items: center; gap: 20px;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--paper); border: var(--line) solid var(--navy);
  padding: 16px 20px; min-height: 92px; color: var(--navy);
  font: inherit; text-decoration: none;
}
.case:hover { background: var(--sand); }
.case__stamp { width: 52px; height: 52px; }
.case__coin { font-family: var(--pix); font-size: 20px; line-height: 1.2; min-width: 0; }
.case__mint { display: block; font-family: var(--mono); font-size: var(--t-label); color: var(--ink-dim); }
.case__quote {
  margin: 0; min-width: 0; font-size: 17px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.case__right { display: grid; justify-items: end; gap: 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--pix); font-size: 16px; line-height: 1;
  padding: 12px 24px; min-height: 48px;
  border: 1px solid var(--navy); background: var(--sand); color: var(--navy);
}
.chip--sage { background: var(--sage); }
.chip--sand { background: var(--sand); }
.chip--red { background: var(--red); color: var(--paper); }
.chip--purple { background: var(--purple); color: var(--paper); }
.chip--indigo { background: var(--indigo); color: var(--paper); }
.chip--lightblue { background: var(--lightblue); }
.chip--cream { background: var(--cream); }

.when { font-family: var(--mono); font-size: var(--t-label); color: var(--ink-dim); }

/* the claims table on a case */
.claims { display: grid; gap: 10px; }
.claim {
  background: var(--paper); border: var(--line) solid var(--navy); color: var(--navy);
}
.claim__toggle {
  width: 100%; display: grid;
  grid-template-columns: 26px minmax(130px, 190px) minmax(0, 1fr) auto;
  align-items: center; gap: 18px;
  background: none; border: 0; cursor: pointer; font: inherit; color: inherit;
  padding: 16px 20px; min-height: 76px; text-align: left;
}
.claim__toggle:hover { background: var(--cream); }
.claim__dot { width: 26px; height: 26px; border: 1px solid var(--navy); }
.claim__type { font-family: var(--pix); font-size: 17px; line-height: 1.2; }
.claim__said { margin: 0; font-size: 16px; min-width: 0; }
.claim__said b { font-family: var(--mono); font-weight: 400; }
.claim__body { padding: 0 20px 20px; display: none; }
.claim[open] .claim__body { display: block; }
.claim__note { margin: 0 0 14px; font-size: 17px; line-height: 1.45; max-width: 70ch; }
.evidence { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.evidence li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  background: var(--cream); border: 1px solid var(--navy); padding: 10px 16px; min-height: 48px;
  font-family: var(--mono); font-size: 16px;
}
.evidence a { color: var(--blue); }

.link { color: var(--lightblue); text-underline-offset: 3px; }
.plate .link, .claim .link, .bubble .link { color: var(--blue); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 26px;
  font-family: var(--pix); font-size: 17px; line-height: 1;
  background: var(--blue); color: var(--paper);
  border: var(--line) solid var(--navy); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--midblue); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn--quiet { background: var(--paper); color: var(--navy); }
.btn--quiet:hover { background: var(--sand); }

/* forms */
.field { display: grid; gap: 8px; margin: 0 0 18px; }
.field > label { font-family: var(--pix); font-size: 16px; color: var(--navy); }
.field input, .field textarea {
  font-family: var(--mono); font-size: 17px; line-height: 1.5;
  padding: 14px 16px; min-height: 52px;
  background: var(--cream); color: var(--navy);
  border: var(--line) solid var(--navy); width: 100%;
}
.field textarea { min-height: 148px; resize: vertical; }
.hint { margin: 0; font-size: var(--t-label); line-height: 1.5; color: var(--ink-dim); }
.rows { display: grid; gap: 10px; }
.row {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px;
  border-bottom: 1px solid rgba(19, 13, 43, 0.22); padding: 13px 20px;
}
.rows { margin: 0 -20px; }
.row:last-child { border-bottom: 0; }
.row__k { font-family: var(--pix); font-size: 16px; }
.row__v { font-family: var(--mono); font-size: 17px; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.plate--dark .row { border-bottom-color: rgba(253, 226, 206, 0.22); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 16px; align-items: start; }
.grid2 > * { min-width: 0; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.step { background: var(--paper); border: var(--line) solid var(--navy); color: var(--navy); }
.step img { width: 100%; height: auto; display: block; border-bottom: var(--line) solid var(--navy); }
.step__body { padding: 18px 20px 20px; }
.step__n { font-family: var(--pix); font-size: 16px; color: var(--blue); margin: 0 0 6px; }
.step h3 { margin: 0 0 8px; font-family: var(--pix); font-size: 19px; line-height: 1.2; }
.step p { margin: 0; font-size: 17px; line-height: 1.45; }

.stand { display: block; width: 832px; max-width: 100%; height: auto; border: var(--line) solid var(--navy); }
.standwrap { min-width: 0; }

.dlg { border: 0; padding: 0; background: none; max-width: 760px; width: calc(100% - 40px); }
.dlg::backdrop { background: rgba(3, 12, 43, 0.72); }
.dlg__inner {
  background: var(--paper); border: var(--frame) solid var(--navy);
  padding: 28px 32px 32px; color: var(--navy);
}
.dlg__title { margin: 0 0 18px; font-family: var(--pix); font-size: 26px; line-height: 1.2; }
.dlg__body p { margin: 0 0 14px; font-size: 17px; line-height: 1.5; max-width: 66ch; }

.ok { color: var(--sage); }
.bad { color: var(--red); }
.note { font-size: var(--t-label); line-height: 1.5; color: var(--ink-dim); overflow-wrap: anywhere; }
.plate--dark .note { color: var(--lightblue); }

/* ------------------------------------------------------------------ phone */
/* Under 1200 the rail lies down over the canvas instead of standing beside it: a
   column of keys next to a single column of content leaves a tall empty strip of
   ground, and the keys read just as well on their side. */
@media (max-width: 1199px) {
  .work { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .rail {
    flex-direction: row; flex-wrap: wrap; align-items: stretch;
    padding: 16px 16px 0; gap: 16px;
  }
  .rail__tools { flex: 1 1 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .legend { flex: 1 1 100%; }
  .legend__list { grid-template-columns: repeat(4, 1fr); }
  .tool {
    grid-template-columns: 44px minmax(0, 1fr);
    justify-items: start; align-items: center; text-align: left;
    gap: 14px; padding: 10px 18px; min-height: 68px;
  }
  .canvas__inner { padding-top: 24px; }
}

@media (max-width: 860px) {
  body { overflow: auto; }
  .app {
    height: auto; min-height: 100%; margin: 0; width: 100%;
    border-width: 6px;
    grid-template-rows: auto auto auto auto auto;   /* nothing stretches: the page scrolls */
  }
  .work { align-items: start; grid-template-columns: minmax(0, 1fr); }
  /* the keys lie down on a phone: the icon beside the name, four short rows, so the
     first screen is the machine and not a page of navigation */
  .tool {
    grid-template-columns: 34px minmax(0, 1fr);
    justify-items: start; align-items: center;
    text-align: left; gap: 12px; padding: 10px 18px;
    min-height: 60px;
  }
  .tool img { width: 34px; height: 34px; }
  .legend__row { min-height: 84px; padding: 14px 8px; }
  .titlebar { padding: 10px 14px; gap: 10px; }
  .titlebar__name { font-size: 18px; }
  .titlebar__icon { width: 34px; height: 34px; }
  .winbtn { width: 46px; height: 46px; }
  .titlebar__controls { gap: 6px; }
  .titlebar__sub { display: none; }
  .titlebar__controls { margin-left: auto; }
  .band { padding: 18px 28px; min-height: 0; }
  .band__station { font-size: 33px; }
  .work { grid-template-columns: minmax(0, 1fr); }
  .rail { padding: 12px 12px 0; gap: 12px; }
  .rail__tools { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); align-content: start; }
  .tool { min-height: 60px; padding: 10px 14px; gap: 12px; grid-template-columns: 34px minmax(0, 1fr); }
  .tool img { width: 34px; height: 34px; }
  .legend__list { grid-template-columns: repeat(4, 1fr); }
  .canvas { overflow: visible; }
  .canvas__inner { padding: 22px; gap: 20px; }
  .dock { grid-template-columns: minmax(0, 1fr); }
  .menu { border-right: 0; border-bottom: var(--line) solid var(--navy); }
  .menu__rows { grid-template-columns: 1fr; }
  .strip { flex-wrap: wrap; gap: 12px; }
  .strip__note { margin-left: 0; }
  .case { grid-template-columns: 44px minmax(0, 1fr); gap: 12px 14px; padding: 14px 16px; }
  .case__quote { grid-column: 1 / -1; }
  .case__right { grid-column: 1 / -1; justify-items: start; }
  .case__stamp { width: 44px; height: 44px; }
  .claim__toggle { grid-template-columns: 22px minmax(0, 1fr); gap: 10px 14px; padding: 14px 16px; }
  .claim__said { grid-column: 1 / -1; }
  .claim__state { grid-column: 1 / -1; }
  .status { padding: 16px 26px; flex-wrap: wrap; gap: 8px 16px; }
  .status__clock { font-size: 24px; }
  .plate { padding: 18px 20px; }
  .lede { font-size: var(--t-body); }
  .bubble { padding: 20px; }
  .bubble__text { font-size: 19px; }
}

/* A 320 px window cannot hold the icon, the name and three keys in one strip, and a
   control pushed off the edge is a control that does not exist. */
@media (max-width: 430px) {
  .titlebar { padding: 10px 12px; gap: 8px; }
  .titlebar__name { font-size: 17px; }
  .winbtn { width: 44px; height: 44px; }
  .titlebar__controls { gap: 6px; }
}

@media (max-width: 360px) {
  .titlebar__icon { display: none; }      /* the name is the mark when there is no room for both */
  .rail__tools { grid-template-columns: minmax(0, 1fr); }
  .band__station { font-size: 26px; }
  .strip { padding: 12px 18px; }
}

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

/* the cases station: the stand on the left, the feed beside it */
/* one column that is allowed to be narrower than the picture in it: an auto column
   takes the 832 px of the stand as its minimum and pushes the whole page sideways */
.home { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 1200px) {
  .home { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
}
.home__pic { margin: 0; min-width: 0; }
.home__pic img {
  display: block; width: 100%; max-width: 832px; height: auto;
  border: var(--line) solid var(--navy); border-bottom: 0;
}
.home__pic figcaption {
  font-family: var(--text); font-size: var(--t-body); line-height: 1.45; color: var(--cream);
  background: var(--night2);
  border: var(--line) solid var(--navy);
  padding: 16px 20px;
  max-width: 832px;
}

/* a case row answers to the width of its own column, not the window's */
.cases { container-type: inline-size; }
@container (max-width: 760px) {
  .case { grid-template-columns: 52px minmax(0, 1fr); gap: 12px 16px; }
  .case__quote { grid-column: 1 / -1; }
  .case__right { grid-column: 1 / -1; justify-items: start; }
}
@container (max-width: 420px) {
  .case__coin { font-size: 18px; }
}

/* the home station: the one object on the left, what the machine is on the right */
.home__side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.key { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.key__row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; align-items: center;
  background: var(--cream); border: 1px solid var(--navy); padding: 10px 16px; min-height: 76px;
}
.key__text { margin: 0; font-size: var(--t-label); line-height: 1.35; color: var(--ink-dim); min-width: 0; }
.key__name { font-family: var(--pix); color: var(--ink); }

/* every control says what it is doing, under the pointer and under a keyboard */
.tool:active, .legend__row:active, .btn:active, .case:active { transform: translateY(1px); }
.winbtn:active img { transform: translateY(1px); }
