/*
 * Till screen layout (Phase A). Loaded after till.css and page.css on every
 * product page, in both homes (static/ for till-core, demo/ for the public
 * demo; demo-build copies this file). Colours come only from the tokens in
 * till.css; this file adds no colour value of its own and no motion. It wraps
 * the frozen DOM hooks of FACE SCHEMA §5 and renames none of them. The QR's
 * box is sized at run time to a whole number of device pixels per module
 * (QR_SPEC §4); the sizes below are the fallback before the script runs.
 *
 * Sections: 1 bars, 2 ring-up, 3 panel, 4 wide layout, 5 full-screen till
 * mode, 6 small hints and copy buttons, 7 reduced motion (nothing to turn off
 * here; the only transition lives in till.css).
 */

:root {
  --ribbon-h: 2.1rem;
  --bar-h: 3.5rem;
}

/* 1. The devnet ribbon stays in view; the app bar sits under it. */
.cluster-ribbon {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: var(--ribbon-h);
}

.till-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--bar-h);
  margin: 0 -1rem;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.till-mark {
  display: block;
  width: 32px;
  height: 32px;
}

.till-lockup {
  display: block;
  height: 44px;
  width: auto;
}

.till-bar .demo-label {
  margin: 0;
  justify-self: start;
  font-size: 1rem;
  white-space: nowrap;
}

.till-bar .page-name {
  margin: 0;
  font: 700 1.1rem/1.2 ui-serif, Georgia, Cambria, 'Times New Roman', serif;
}

.till-fullscreen,
.till-bar button {
  padding: 0 0.8rem;
  font: 600 0.9rem/1 ui-sans-serif, system-ui, sans-serif;
  background: var(--paper);
  white-space: nowrap;
}

/* Phones (under 40 rem): the bar wraps instead of clipping. The mark and the
   label stay on the first row; the control keeps its full label and drops to
   a second row, right-aligned, whenever the three do not fit on one. On the
   checkout, section 9.3 keeps one row instead: the tag wraps, not the
   control. Tablet and laptop keep the three-column grid above. */
@media (max-width: 40rem) {
  .till-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .till-bar .demo-label {
    flex: 0 0 auto;
  }

  .till-fullscreen {
    flex: 0 0 auto;
    margin-left: auto;
  }
}

/* The narrowest phones (under 23 rem): the label keeps its size beside the
   mark by giving up its letter spacing and some padding. */
@media (max-width: 23rem) {
  .till-bar {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .till-bar .demo-label {
    padding: 0.1rem 0.35rem;
    letter-spacing: 0;
  }
}

.till-fullscreen[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* 2. Ring-up: a price list on a counter. Rows are tap targets. */
.till-ringup h1 {
  margin-top: 1rem;
}

.till-items li {
  padding: 0.7rem 0.75rem;
  min-height: 56px;
}

/* The demo's catalog arrives with config.json: hold the room of its five rows
   (3.9 rem each) so nothing below moves when they land. */
.till-items:empty {
  min-height: 19.5rem;
}

.till-total {
  display: flex;
  justify-content: space-between;
  margin: 0.75rem 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.till-pay {
  min-height: 52px;
  font-size: 1.15rem;
}

.till-pay:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

[data-ready-problem] {
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--till-problem);
  background: var(--lift);
}

/* 3. The panel: state word, amount, QR on a plate, then the facts. */
.till-panel h2 {
  margin-top: 0;
}

.till-state {
  font-size: 1.35rem;
  scroll-margin-top: calc(var(--ribbon-h) + var(--bar-h) + 0.5rem);
}

.till-plate {
  display: inline-block;
  padding: 8px;
  background: var(--lift);
  border: 1px solid var(--ink);
  line-height: 0;
}

.till-qr {
  display: block;
  width: 340px;
  height: 340px;
  max-width: 100%;
  image-rendering: auto;
}

[data-amount] {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
}

.till-hint {
  margin: 0.25rem 0;
  font-size: 0.95rem;
}

.till-desktop-line {
  display: none;
}

@media (pointer: fine) and (min-width: 48rem) {
  .till-desktop-line {
    display: block;
  }
}

.till-facts,
[data-order-line],
[data-signature] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin: 0.5rem 0;
}

.till-resume {
  font-weight: 600;
}

.till-foot {
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ink);
  font-size: 0.95rem;
}

.till-foot a + a {
  margin-left: 1rem;
}

/* 4. From 64 rem the ring-up and the panel sit side by side; the QR comes first. */
@media (min-width: 64rem) {
  main[data-intent="till-checkout"] {
    max-width: 72rem;
  }

  .till-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 2.5rem;
    align-items: start;
  }

  .till-panel {
    position: sticky;
    top: calc(var(--ribbon-h) + 0.75rem);
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border: 2px solid var(--ink);
  }
}

/* Phones: a little less side padding so a 340 px code fits at 390 wide. */
@media (max-width: 40rem) {
  main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .cluster-ribbon,
  .replay-ribbon,
  .till-bar {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }

  [data-amount] {
    font-size: 2rem;
  }

  /* page.css puts the deep link first on a phone; the iOS note stays under it. */
  .till-pay-ways [data-ios-note] {
    order: -1;
  }

  .till-bar {
    gap: 0.5rem;
  }

  /* 0.9 rem keeps the label at least half the mark's 32 px (H-3). */
  .till-bar .demo-label {
    font-size: 0.9rem;
  }

  .till-fullscreen {
    padding: 0 0.6rem;
    font-size: 0.85rem;
  }

  .mono {
    font-size: 0.75rem;
  }
}

/* 5. Full-screen till mode: the counter view. One control enters it, Escape
   leaves it. The ribbon and the app bar stay; the ring-up, the deep link and
   the small print go; the amount, the QR, the state word and the countdown
   fill the screen. */
main[data-till-view="screen"] {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-width: none;
  margin: 0;
  padding: 0 1rem;
  overflow: auto;
  background: var(--paper);
}

main[data-till-view="screen"] .till-grid {
  display: block;
  min-height: 0;
}

main[data-till-view="screen"] .till-rpc,
main[data-till-view="screen"] .till-about,
main[data-till-view="screen"] .till-foot,
main[data-till-view="screen"] .till-panel h2,
main[data-till-view="screen"] .deeplink,
main[data-till-view="screen"] [data-ios-note],
main[data-till-view="screen"] [data-explorer],
main[data-till-view="screen"] .till-copy,
main[data-till-view="screen"] noscript {
  display: none;
}

main[data-till-view="screen"] .till-panel {
  position: static;
  display: grid;
  grid-template-areas:
    "state"
    "amount"
    "ways"
    "count"
    "order"
    "rest";
  justify-items: center;
  align-content: center;
  gap: 0.35rem;
  min-height: 100%;
  margin: 0;
  padding: 0.75rem 0 1rem;
  border: 0;
  text-align: center;
}

main[data-till-view="screen"] .till-state {
  grid-area: state;
  font-size: clamp(1.25rem, 2.6vw, 2rem);
}

main[data-till-view="screen"] [data-amount] {
  grid-area: amount;
  margin: 0;
  font-size: clamp(56px, 18vw, 96px);
  line-height: 1.05;
  color: var(--till-amount-present);
}

main[data-till-view="screen"] .till-pay-ways {
  grid-area: ways;
  align-items: center;
}

main[data-till-view="screen"] .till-qr {
  width: 510px;
  height: 510px;
}

main[data-till-view="screen"] .till-desktop-line {
  display: block;
}

main[data-till-view="screen"] [data-countdown] {
  grid-area: count;
  margin: 0;
  font-size: 1.5rem;
}

main[data-till-view="screen"] [data-order-line] {
  grid-area: order;
  font-size: 1rem;
}

main[data-till-view="screen"] [data-verdict-problem],
main[data-till-view="screen"] [data-rpc-line],
main[data-till-view="screen"] [data-signature],
main[data-till-view="screen"] [data-verify],
main[data-till-view="screen"] [data-new-code] {
  grid-area: rest;
}

@media (max-width: 40rem) {
  main[data-till-view="screen"] .till-qr {
    width: 340px;
    height: 340px;
  }

  main[data-till-view="screen"] {
    padding: 0 0.75rem;
  }
}

/* Landscape with room: QR left, words right. */
@media (orientation: landscape) and (min-width: 60rem) {
  main[data-till-view="screen"] .till-panel {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "ways state"
      "ways amount"
      "ways count"
      "ways order"
      "ways rest";
    align-content: center;
    justify-items: start;
    column-gap: 3rem;
    text-align: left;
  }

  main[data-till-view="screen"] .till-pay-ways {
    align-self: center;
  }
}

/* 6. Copy buttons and small print. */
.till-copy {
  padding: 0 0.6rem;
  min-height: 44px;
  font: 600 0.8rem/1 ui-sans-serif, system-ui, sans-serif;
  vertical-align: middle;
}

.till-copy[data-copied] {
  background: var(--ink);
  color: var(--paper);
}

/* Verify page: the 64-hex fingerprint, the check sentences that carry a
   reference, a token account or a wallet address, and the mode S merchant
   line with the wallet address wrap inside a 390 px viewport (page.css is
   frozen, so the wrap lives here). */
.hash,
.checks li,
[data-merchant-line] {
  overflow-wrap: anywhere;
}

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

/* 7. Reduced motion: this file animates nothing but the devnet-line pulse
   of section 8, which is off under reduced motion. The 200 ms state colour
   change lives in till.css and is already removed there under reduced motion. */

/* 8. Hotfix 2026-10-06 (fsfix): full screen is never empty, and the devnet
   line sits centred above the QR in both views. CSS and markup order only.
   The ring-up stays in full screen until a QR exists; then the customer panel
   takes the screen. A browser without :has() keeps both visible (never blank). */
main[data-till-view="screen"] .till-grid:has(> .till-panel:not([hidden])) > .till-ringup {
  display: none;
}

main[data-till-view="screen"] .till-ringup {
  width: min(100%, 64rem);
  margin: 0 auto;
  padding: 0.5rem 0 2rem;
  font-size: clamp(1.05rem, 0.7rem + 0.9vw, 1.6rem);
}

main[data-till-view="screen"] .till-ringup h1 {
  font-size: clamp(1.9rem, 1.1rem + 2.4vw, 3.4rem);
}

main[data-till-view="screen"] .till-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 0.75rem;
  border-top: 0;
}

main[data-till-view="screen"] .till-items li {
  min-height: 5rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
}

main[data-till-view="screen"] .till-items .qty button {
  min-width: 3.25rem;
  min-height: 3.25rem;
  font-size: 1.4em;
}

main[data-till-view="screen"] .till-total {
  font-size: 1.5em;
}

main[data-till-view="screen"] .till-pay {
  min-height: 4.5rem;
  font-size: 1.5em;
}

/* The QR column is centred in both views, so the devnet line centres on the code. */
.till-panel .till-pay-ways {
  align-items: center;
  text-align: center;
}

/* --till-problem is 7.8:1 on paper and 8.6:1 on lift; the pulse floor of 0.8
   opacity keeps it at or above 5:1 on paper, so it clears AA at every frame. */
.till-devnet-hint {
  margin: 0;
  color: var(--till-problem);
  font-weight: 700;
  animation: till-devnet-pulse 1s ease-in-out infinite alternate;
}

@keyframes till-devnet-pulse {
  from { opacity: 1; }
  to { opacity: 0.8; }
}

main[data-till-view="screen"] .till-devnet-hint {
  font-size: clamp(1rem, 0.8rem + 0.6vw, 1.4rem);
}

@media (prefers-reduced-motion: reduce) {
  .till-devnet-hint {
    animation: none;
    opacity: 1;
  }
}

/* One quiet devnet tag on the checkout: the bordered "Demo merchant · devnet"
   box becomes a small unboxed muted tag at the top right, beside Full screen,
   and the devnet ribbon folds into it (kept in the DOM for the walk rail's
   anchor, not shown). The red line over the QR is a safety prompt, not a tag. */
main[data-intent="till-checkout"] {
  --ribbon-h: 0px;
}

main[data-intent="till-checkout"] > .cluster-ribbon {
  display: none;
}

main[data-intent="till-checkout"] .till-bar .demo-label {
  justify-self: end;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--till-open);
  font: 500 0.8rem/1.2 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.02em;
}

@media (max-width: 40rem) {
  main[data-intent="till-checkout"] .till-bar .demo-label {
    margin-left: auto;
    padding: 0;
    font-size: 0.75rem;
  }

  main[data-intent="till-checkout"] .till-bar .till-fullscreen {
    margin-left: 0;
  }
}

main[data-intent="till-checkout"][data-till-view="screen"] {
  grid-template-rows: auto minmax(0, 1fr);
}

/* With the ribbon folded away, the walk rail's rows move up one so it stays
   beside the till (not under it) from 64 rem. */
@media (min-width: 64rem) {
  body[data-walk] main[data-intent="till-checkout"] > .walk-now {
    grid-row: 1;
  }

  body[data-walk] main[data-intent="till-checkout"] > .walk-rail {
    grid-row: 2 / span 12;
  }
}

/* Full screen inside the walk: the rail steps aside, so its column goes too. */
body[data-walk] main[data-intent="till-checkout"][data-till-view="screen"] {
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
}

body[data-walk] main[data-intent="till-checkout"][data-till-view="screen"] > * {
  grid-column: 1;
}

/* Full-screen item cards: name and price on top, the quantity control below,
   so a card never clips its + button. */
main[data-till-view="screen"] .till-items li {
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
}

main[data-till-view="screen"] .till-items .qty {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

/* 9. QoL pass (2026-10): the walk scales up on wide and full screens, the
   counter view is centred, and each step shows what it needs. It builds on
   section 8 and undoes none of it. Hooks it reads: data-qty on each item row
   (checkout.js refresh), the payment details toggle and the two link-line
   classes (checkout.html). */

/* 9.1 Type and controls grow with the screen from 1366 px: 18 px there,
   about 21 px at 1920, 24 px at 2560. Media queries in rem still read 16 px. */
html {
  font-size: clamp(1.125rem, 0.7rem + 0.5vw, 1.5rem);
}

button,
.deeplink,
.till-copy {
  min-height: max(44px, 2.45rem);
}

button {
  min-width: max(44px, 2.45rem);
}

.till-pay {
  min-height: max(52px, 2.9rem);
}

.till-items li {
  min-height: max(56px, 3.1rem);
}

.till-mark {
  width: clamp(32px, 1.8rem, 44px);
  height: clamp(32px, 1.8rem, 44px);
}

/* 9.2 From 64 rem: a wider till, and the ring-up takes the whole width until
   there is an order; then the panel (the code) gets three fifths. */
@media (min-width: 64rem) {
  main[data-intent="till-checkout"] {
    max-width: 80rem;
  }

  .till-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    column-gap: clamp(2rem, 3vw, 4rem);
  }

  .till-grid:has(> .till-panel[hidden]) {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The ring-up alone: the menu as cards, then the total and Pay on one row. */
  .till-grid:has(> .till-panel[hidden]) .till-ringup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 24rem);
    column-gap: 1.5rem;
    align-items: center;
  }

  .till-grid:has(> .till-panel[hidden]) .till-ringup > * {
    grid-column: 1 / -1;
  }

  .till-grid:has(> .till-panel[hidden]) .till-ringup > .till-total {
    grid-column: 1;
    margin: 0;
  }

  .till-grid:has(> .till-panel[hidden]) .till-ringup > .till-pay {
    grid-column: 2;
  }

  .till-grid:has(> .till-panel[hidden]) .till-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    border-top: 0;
  }

  .till-grid:has(> .till-panel[hidden]) .till-items li {
    flex: 0 1 calc((100% - 1.5rem) / 3);
    grid-template-columns: minmax(0, 1fr) auto;
    align-content: center;
    min-height: 6rem;
    border: 2px solid var(--ink);
    border-radius: 6px;
  }

  .till-grid:has(> .till-panel[hidden]) .till-items .qty {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  /* The five cards make two rows (13.2 rem measured): hold that room, not the
     list's 19.5 rem, so nothing moves when the catalog lands. */
  .till-grid:has(> .till-panel[hidden]) .till-items:empty {
    min-height: 13.25rem;
  }
}

/* From 64 rem the demo panel reads state, amount, then the code, in the page
   view only (full screen has its own grid, 9.6). Scoped to the demo: the
   till-core panel carries more lines and gets its own pass. */
@media (min-width: 64rem) {
  main[data-till-mode="static"][data-till-view="page"] .till-panel {
    display: flex;
    flex-direction: column;
  }

  main[data-till-mode="static"][data-till-view="page"] .till-panel > h2,
  main[data-till-mode="static"][data-till-view="page"] .till-panel > .till-resume {
    order: -3;
  }

  main[data-till-mode="static"][data-till-view="page"] .till-panel > .till-state {
    order: -2;
  }

  main[data-till-mode="static"][data-till-view="page"] .till-panel > [data-amount] {
    order: -1;
    margin: 0 0 0.5rem;
  }
}

/* 9.3 With an order on screen the ring-up is its summary: only the items in
   it, no quantity buttons and no Pay (the panel carries the rest). */
.till-grid:has(> .till-panel:not([hidden])) .till-items li[data-qty="0"],
.till-grid:has(> .till-panel:not([hidden])) .till-items .qty button,
.till-grid:has(> .till-panel:not([hidden])) .till-pay {
  display: none;
}

.till-grid:has(> .till-panel:not([hidden])) .till-items li {
  min-height: 0;
}

.till-grid:has(> .till-panel:not([hidden])) .till-items .qty output::before {
  content: "× ";
}

/* Phones: the panel's heading stays for screen readers (and focus) only, the
   panel starts higher, and the bar keeps one row (the tag wraps, not the control). */
@media (max-width: 40rem) {
  .till-panel h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .till-panel {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }

  .till-panel .till-state {
    margin: 0.25rem 0 0.5rem;
  }

  .till-pay-ways {
    gap: 0.5rem;
  }

  .till-items li {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  main[data-intent="till-checkout"] .till-bar {
    flex-wrap: nowrap;
  }

  main[data-intent="till-checkout"] .till-bar .demo-label {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    text-align: right;
  }
}

/* Phones and tablets: once there is an order, the panel comes first. */
@media (max-width: 63.98rem) {
  .till-grid:has(> .till-panel:not([hidden])) {
    display: flex;
    flex-direction: column;
  }

  .till-grid > .till-panel {
    order: -1;
  }
}

/* A guard: if a column is ever narrower than the code, the code stays square. */
.till-qr {
  object-fit: contain;
}

/* 9.4 The order line: the short code, and the full reference (and later the
   signature) behind a small toggle. Display only: the reference stays in the
   pay URL and the DOM. */
[data-order-line].till-order {
  display: grid;
  justify-items: start;
  gap: 0.15rem;
}

.till-order-short {
  font: 700 1.05rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}

.till-order-more {
  font-size: 0.9rem;
}

.till-order-more > summary {
  padding: 0.5rem 0;
  cursor: pointer;
}

.till-order-more > p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin: 0.35rem 0;
}

/* Empty link lines take no room; the verify link is the primary action. */
.till-explorer-line:has(> [hidden]),
.till-verify-line:has(> [hidden]) {
  display: none;
}

.till-verify-line a {
  display: inline-flex;
  align-items: center;
  min-height: max(48px, 2.7rem);
  padding: 0 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
}

/* 9.5 What each step shows (QoL note 1): the RPC box only once there is a
   chain to watch (it still opens itself on a failure); the about line not in
   the walk, and outside it only before an order. */
main[data-intent="till-checkout"]:not(:has(.till-panel:not([hidden]))) .till-rpc,
body[data-walk] main[data-intent="till-checkout"] .till-about,
body[data-walk] main[data-intent="till-board"] > .till-about,
main[data-intent="till-checkout"]:has(.till-panel:not([hidden])) .till-about {
  display: none;
}

/* On a phone the safety line comes before Open in wallet as well as the code. */
@media (max-width: 40rem) {
  .till-pay-ways .till-devnet-hint {
    order: -2;
  }
}

/* The pulse runs four times (4 s) and then holds steady (WCAG 2.2.2). */
.till-devnet-hint {
  animation-iteration-count: 4;
}

/* 9.6 Full-screen counter view. The ring-up (no code yet) is centred on the
   screen, its cards in centred rows; on a phone it keeps the list. */
main[data-till-view="screen"] .till-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-content: safe center;
}

main[data-till-view="screen"] .till-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

main[data-till-view="screen"] .till-items li {
  flex: 0 1 20rem;
}

@media (max-width: 40rem) {
  main[data-till-view="screen"] .till-ringup {
    font-size: 1.05rem;
    padding-bottom: 1rem;
  }

  main[data-till-view="screen"] .till-items {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--ink);
  }

  main[data-till-view="screen"] .till-items li {
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: max(56px, 3.1rem);
    border: 0;
    border-bottom: 1px solid var(--ink);
    border-radius: 0;
  }

  main[data-till-view="screen"] .till-items .qty {
    grid-column: auto;
  }

  main[data-till-view="screen"] .till-items .qty button {
    min-width: max(44px, 2.45rem);
    min-height: max(44px, 2.45rem);
    font-size: 1em;
  }
}

/* The demo panel: every child has its own row (nothing shares "rest" any
   more); portrait and phones stack, centred. The till-core panel keeps
   section 5 until its own pass. */
main[data-till-mode="static"][data-till-view="screen"] .till-panel {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "resume"
    "state"
    "problem"
    "amount"
    "ways"
    "count"
    "order"
    "rpc"
    "verify"
    "newcode";
  row-gap: 0;
}

main[data-till-mode="static"][data-till-view="screen"] .till-panel > * {
  margin-block: clamp(0.2rem, 0.9vh, 0.6rem);
}

main[data-till-mode="static"][data-till-view="screen"] .till-resume { grid-area: resume; }
main[data-till-mode="static"][data-till-view="screen"] [data-verdict-problem] { grid-area: problem; }
main[data-till-mode="static"][data-till-view="screen"] [data-rpc-line] { grid-area: rpc; }
main[data-till-mode="static"][data-till-view="screen"] .till-verify-line { grid-area: verify; }
main[data-till-mode="static"][data-till-view="screen"] [data-new-code] { grid-area: newcode; }

main[data-till-mode="static"][data-till-view="screen"] .till-explorer-line {
  display: none;
}

main[data-till-mode="static"][data-till-view="screen"] .till-state {
  font-size: clamp(1.4rem, 1rem + 1.4vw, 2.6rem);
}

main[data-till-mode="static"][data-till-view="screen"] [data-amount] {
  font-size: clamp(56px, 18vw, max(96px, 5.2vw));
}

main[data-till-mode="static"][data-till-view="screen"] [data-countdown] {
  font-size: clamp(1.25rem, 0.75rem + 1vw, 2.2rem);
}

main[data-till-mode="static"][data-till-view="screen"] .till-desktop-line {
  font-size: clamp(0.95rem, 0.7rem + 0.4vw, 1.3rem);
}

main[data-till-mode="static"][data-till-view="screen"] [data-order-line] {
  justify-items: inherit;
  font-size: clamp(1.1rem, 0.8rem + 0.6vw, 1.8rem);
}

main[data-till-mode="static"][data-till-view="screen"] .till-order-short {
  font-size: 1em;
}

main[data-till-mode="static"][data-till-view="screen"] .till-order-more {
  font-size: 0.6em;
}

main[data-till-mode="static"][data-till-view="screen"] .till-order-more .till-copy {
  display: inline-block;
}

/* Landscape with room: the code left, the words in one centred column to its
   right, the pair centred on the screen and the words centred on the code. */
@media (orientation: landscape) and (min-width: 60rem) {
  main[data-till-mode="static"][data-till-view="screen"] .till-panel {
    grid-template-columns: max-content fit-content(34rem);
    grid-template-rows: 1fr repeat(9, auto) 1fr;
    grid-template-areas:
      "ways ."
      "ways resume"
      "ways state"
      "ways problem"
      "ways amount"
      "ways count"
      "ways order"
      "ways rpc"
      "ways verify"
      "ways newcode"
      "ways .";
    justify-content: center;
    column-gap: clamp(2rem, 5vw, 6rem);
  }

  /* No code on screen (paid, expired): one centred column. */
  main[data-till-mode="static"][data-till-view="screen"] .till-panel:has(> .till-pay-ways[hidden]) {
    grid-template-columns: minmax(0, 44rem);
    grid-template-rows: none;
    grid-template-areas:
      "resume"
      "state"
      "problem"
      "amount"
      "count"
      "order"
      "rpc"
      "verify"
      "newcode";
    justify-items: center;
    text-align: center;
  }
}


/* 9.7 One quiet network tag on every product page (QoL note 2). The dark
   devnet band becomes a small muted line at the top right on the verify page;
   on the walkthrough and the board the quiet bar tag carries it, as on the
   checkout (the band stays in the DOM: the walk rail anchors after it). The
   REPLAY ribbon stays as it is. */
main.verify,
main.walk-intro,
main[data-intent="till-board"] {
  --ribbon-h: 0px;
}

main.verify > .cluster-ribbon {
  position: static;
  min-height: 0;
  margin: 0;
  padding: 0.35rem 0 0;
  background: none;
  color: var(--till-open);
  font: 500 0.8rem/1.2 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-align: right;
}

main.walk-intro > .cluster-ribbon,
main[data-intent="till-board"] > .cluster-ribbon {
  display: none;
}

main.walk-intro .till-bar .demo-label,
main[data-intent="till-board"] .till-bar .demo-label {
  justify-self: end;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--till-open);
  font: 500 0.8rem/1.2 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.02em;
}

/* With the board's devnet band folded away, its rail rows move up one. */
@media (min-width: 64rem) {
  body[data-walk] main[data-intent="till-board"][data-replay] > .walk-now {
    grid-row: 2;
  }

  body[data-walk] main[data-intent="till-board"][data-replay] > .walk-rail {
    grid-row: 3 / span 12;
  }

  body[data-walk] main[data-intent="till-board"]:not([data-replay]) > .walk-now {
    grid-row: 1;
  }

  body[data-walk] main[data-intent="till-board"]:not([data-replay]) > .walk-rail {
    grid-row: 2 / span 12;
  }
}

/* 9.8 Adaptations proven by the build's own checks (QoL build, 2026-10).
   A short phone in full screen keeps the panel's first lines clear of the bar:
   the centring is safe, so a panel taller than the screen starts at the top
   and the view scrolls (section 5's plain centre pushed the amount under the
   control at 320 x 568), and a 360 x 740 phone fits it with closer lines.
   The counter view takes the whole screen again off the walk (9.2's 80 rem
   had capped it). Under 360 px the checkout bar may wrap again, so the
   label is never squeezed over the picker or the control; from 360 px it
   keeps the one row of 9.3. */
main[data-till-mode="static"][data-till-view="screen"] .till-panel {
  align-content: start;
  align-content: safe center;
}

/* The counter view is the whole screen. 9.2's wider page (80 rem) comes after
   section 5 at the same weight, so without this the full-screen checkout off
   the walk stopped at 80 rem and sat left (1664 of 1920 px, 1920 of 2560). */
main[data-intent="till-checkout"][data-till-view="screen"] {
  max-width: none;
}

@media (max-width: 22.4rem) {
  main[data-intent="till-checkout"] .till-bar {
    flex-wrap: wrap;
  }

  main[data-intent="till-checkout"] .till-bar .till-fullscreen {
    margin-left: auto;
  }
}

/* A short phone (under 760 px tall, so 360 x 740) fits the code view without
   scrolling: the panel's lines sit closer, and the amount scales with the
   width so a two-digit total stays on one line. */
@media (max-width: 40rem) and (max-height: 47.5rem) {
  main[data-till-mode="static"][data-till-view="screen"] .till-panel > * {
    margin-block: 0.15rem;
  }

  main[data-till-mode="static"][data-till-view="screen"] [data-amount] {
    font-size: clamp(2.25rem, 12vw, 96px);
  }
}
