/* The task pages (/s, /a, /code), after base.css. */
/* biome-ignore-all lint/suspicious/noDuplicateProperties: 100vh is the fallback for browsers without 100dvh */
/* biome-ignore-all lint/style/noDescendingSpecificity: the file is ordered by page, not by selector weight */
.nojs {
  padding: var(--pad);
  font-size: 21px;
}
.small {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.btn.secondary {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--hairline);
}
.btn.text {
  min-height: 44px;
  padding: 0 12px;
}
.rose.rose {
  background: var(--rose);
  color: var(--rose-ink);
}
.framed:active {
  transform: scale(0.97);
}
.framed:disabled {
  opacity: 0.38;
  cursor: default;
  transform: none;
}
@media (hover: hover) {
  .btn.secondary:not(:disabled):hover,
  button.framed:not(:disabled):hover,
  a.framed:hover {
    box-shadow: 0 0 0 1px var(--g2);
  }
  .btn.text:hover {
    text-decoration: underline;
  }
}
.btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* The house frame, design.md section 6. */
.framed {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: var(--frame-h);
  height: var(--frame-h);
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms var(--ease-ui);
}
/* A leading glyph sits concentric with the frame's rounded end: start padding (frame - glyph) / 2. */
.framed:not(.square):has(> .icon:first-child) {
  padding-left: calc((var(--frame-h) - 24px) / 2);
}
#b-home {
  padding-left: calc((var(--frame-h) - var(--mark)) / 2);
}
.framed.square {
  padding: 0;
}
.framed:disabled .icon {
  animation: spin 0.8s linear infinite;
}

.bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--inset) var(--inset) 0;
}
.bar :is(#b-here, #b-end) {
  margin-left: auto;
}
.leave {
  width: min(100% - 2 * var(--pad), 420px);
  padding: 24px;
  border: 0;
  border-radius: var(--r-stage);
  background: var(--surface);
  box-shadow: var(--sh-pill);
  color: inherit;
  text-align: center;
}
.leave h2 {
  font-size: 22px;
  line-height: 1.2;
}
.leave p {
  margin-top: 8px;
  color: var(--muted);
}
.leave::backdrop {
  background: rgba(0, 0, 0, 0.18);
}
/* Stacked (the .buttons default, the rose primary on top) until two columns hold "End Session" with its 16 padding. */
.leave .buttons {
  margin-top: 24px;
}
@media (min-width: 480px) {
  .leave .buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.leave .btn {
  padding: 0 16px;
}
#b-home {
  font-size: var(--wordmark);
  letter-spacing: -0.03em;
}

/* ---- /s, the room screen ---- */
/* The page never scrolls: the bar is fixed, and only the side list scrolls inside its own box. */
.page-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.page-screen .bar {
  position: fixed;
}
.page-screen main {
  --top: calc(var(--inset) + var(--frame-h) + 16px);
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: var(--top) var(--pad);
}
/* The fitted card leaves no slack, so the title would sit 16 under the corner pills; fitQr reads this padding. */
.page-screen main:is([data-mode="waiting"], [data-mode="scanned"]) {
  padding-block: calc(var(--top) + 8px);
}
.pane {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1136px;
  text-align: center;
}
.pane h1 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
:is([data-mode="waiting"], [data-mode="scanned"], [data-mode="ended"]) h1,
.is-ended .title,
.narrow-title,
.title {
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.line {
  margin-top: 8px;
  font-size: 19px;
  color: var(--muted);
}
[data-mode="ended"] .line {
  margin-top: 16px;
}
.line:empty {
  display: none;
}
:is([data-mode="waiting"], [data-mode="scanned"]) .pane {
  gap: 24px;
}
main:has(> .side:not([hidden])) #stage {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* The QR's quiet zone is the card's padding. */
.qr-card {
  grid-area: qr;
  position: relative;
  border-radius: var(--r-stage);
  background: var(--surface);
  box-shadow: var(--sh-frame);
  line-height: 0;
}
#qr {
  display: block;
  border-radius: inherit;
  transition: opacity 150ms linear;
}
.is-swapping #qr {
  opacity: 0;
}
/* A reloaded claim cannot redraw its code, so a live one hides its QR too: one look. */
:is(.is-empty, .is-scanned) :is(#qr, .ring) {
  visibility: hidden;
}
.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.ring rect {
  fill: none;
  stroke: var(--robin-deep);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dasharray 1s linear;
}
.ring.is-out rect {
  visibility: hidden;
}
.ring.snap rect {
  transition: none;
}
/* Claimed: the card, blank of its QR, shows the digits to compare, sized by the card (fitQr sets --qr). */
.match {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: calc(var(--qr) * 0.4);
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}
.code-row,
[data-mode="scanned"] #controls {
  grid-area: code;
}
.code-row {
  display: flex;
  gap: 12px;
}
/* New Code comes first, so the card's own width never moves it. */
#b-copy {
  padding: 0 16px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.code {
  letter-spacing: 0.06em;
}
.code-card .done,
.code-card.is-copied .icon:not(.done) {
  display: none;
}
.code-card.is-copied .done {
  display: block;
}
.hint {
  grid-area: hint;
}
/* The longest line (about 23 em) holds one line within the QR card (fitQr sets --qr). */
:is(.hint, .awaiting) {
  font-size: clamp(13px, calc(var(--qr, 360px) / 24), 15px);
  color: var(--muted);
}
[data-mode="idle"] .pane,
.page-screen main:not([data-mode]) .pane {
  visibility: hidden;
}
.page-screen main:not([data-mode="waiting"], [data-mode="scanned"]) :is(.code-row, .hint, .qr-card) {
  display: none;
}
/* A scan moves nothing: the code row keeps its height, under Continue or empty. */
[data-mode="scanned"] :is(.code-row, .hint) {
  visibility: hidden;
}
:is([data-mode="waiting"], [data-mode="scanned"]) .pane {
  display: grid;
  grid-template-areas: "stage" "qr" "hint" "code";
  justify-items: center;
}
:is([data-mode="waiting"], [data-mode="scanned"]) #stage {
  grid-area: stage;
}
/* A claim shows the title and the match number alone; the line keeps the status for screen readers. */
.is-claimed #line {
  position: absolute;
  clip-path: inset(50%);
}
@media (min-width: 900px) and (min-aspect-ratio: 1 / 1) {
  :is([data-mode="waiting"], [data-mode="scanned"]) .pane {
    grid-template: 1fr auto auto auto 1fr / auto fit-content(600px);
    grid-template-areas: "qr ." "qr stage" "qr hint" "qr code" "qr .";
    column-gap: clamp(48px, 6vw, 112px);
    row-gap: 24px;
    justify-content: center;
    justify-items: stretch;
    text-align: left;
  }
  :is([data-mode="waiting"], [data-mode="scanned"]) .qr-card {
    align-self: center;
  }
  :is([data-mode="waiting"], [data-mode="scanned"]) :is(.hint, .awaiting) {
    font-size: 22px;
    line-height: 1.35;
    color: var(--ink-2);
  }
  [data-mode="scanned"] #controls {
    justify-content: start;
  }
  /* Another phone's claim: the title alone, centered on the card. The hidden hint and code row share its cell, so
     the column keeps its width and the card never moves. */
  .is-pending .pane {
    grid-template-rows: 1fr auto 1fr;
    grid-template-areas: "qr ." "qr stage" "qr .";
  }
  .is-pending :is(#stage, .hint, .code-row) {
    grid-area: stage;
    align-self: center;
  }
  :is([data-mode="waiting"], [data-mode="scanned"], [data-mode="ended"]) h1 {
    font-size: var(--display);
  }
}
/* Session Ended sits at the true center of the viewport, whatever the bar and footer take. */
[data-mode="ended"] .pane {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  max-width: none;
  padding: var(--pad);
  text-align: center;
}
/* A result centers title, line and Done as one group; where the band shows, Done keeps it. */
.is-ended .column {
  text-align: center;
}
[data-mode="ended"] .pane {
  gap: 24px;
}
.actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.actions-row:not(:has(.btn:not([hidden]))) {
  display: none;
}
[data-mode="viewer"] #controls .btn {
  min-height: 44px;
}
/* Unseen until the first paint: no live footer in the demo, no Back in a session. */
.is-booting:not(.is-ready) :is(.bar > *, .foot) {
  visibility: hidden;
}
/* Over the blank hint, so the card keeps its place and the status sits under it. */
.awaiting {
  grid-area: hint;
  align-self: center;
}
.foot {
  padding: 0 var(--pad) calc(24px + env(safe-area-inset-bottom));
  color: var(--muted);
  text-align: center;
}
/* The footer line is the live room's way out; a demo visitor has no PC to sign in to. */
.is-demo > .foot {
  display: none;
}
.narrow,
.phone-way {
  display: none;
}
.narrow {
  text-align: center;
}
.narrow-title {
  font-weight: 600;
  text-wrap: balance;
}
.narrow .line {
  margin-top: 16px;
}
.narrow .btn {
  margin-top: 24px;
}
@media (max-width: 599.98px) {
  .page-screen:not(.is-demo) :is(.pane, .bar > *, .foot) {
    display: none;
  }
  .page-screen:not(.is-demo) .narrow {
    display: block;
  }
  /* A phone can be the share screen: the QR, lines and code row stay, and Approve on This Phone sits under them (the
     corner has no room for it beside Back at 360). */
  .is-demo #b-here {
    display: none;
  }
  /* Claimed, the button's 52 stays empty, so the card never moves. A flex row has no line box, so the inline
     button adds no strut below its 52. */
  .is-demo :is([data-mode="waiting"], [data-mode="scanned"]) .phone-way {
    display: flex;
    justify-content: center;
    min-height: 52px;
  }
}

/* /s?mode=demo, the viewer */
/* Outranks `.page-screen main`'s padding, so the stage ends --inset above the bottom with no page scroll. */
.page-screen main[data-mode="viewer"] {
  --pill: 60px;
  --stack: 140px;
  /* One inset all round: the bar's corner, the list's edge, the stage's edges, and the gaps between them. */
  --top: calc(var(--inset) * 2 + var(--frame-h));
  padding-bottom: var(--inset);
  /* A glide past the window's edge never scrolls the page. */
  overflow: clip;
}
[data-mode="viewer"] .pane {
  height: calc(100dvh - var(--top) - var(--inset));
}
[data-mode="viewer"] .pane h1 {
  max-width: 100%;
  font-size: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.view {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}
/* At its own ratio, as large as fits, clear of the control pill: never cut. */
.frame {
  min-height: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
}
.pane.is-under .frame {
  padding-bottom: calc(var(--pill) + var(--inset));
}
/* A portrait document scrolls as one column at a readable width. */
.frame.is-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  overflow: auto;
  overscroll-behavior: contain;
}
.frame.is-scroll img {
  width: min(100%, 860px);
  max-height: none;
}
/* Invisible halves of the slide's box (viewer.js places them) that page the slides; a fine pointer sees which way. */
.zone {
  position: absolute;
  display: grid;
  align-items: center;
  justify-items: start;
  padding: 0 16px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: w-resize;
}
#next {
  justify-items: end;
  cursor: e-resize;
}
/* The disc's fill is the one glass recipe (.glass in the markup), so reduced transparency reaches it. */
.zone .icon {
  box-sizing: content-box;
  padding: 8px;
  border-radius: 50%;
  box-shadow: var(--glass-edge), var(--sh-pill);
  opacity: 0;
  transition: opacity 150ms var(--ease-ui);
}
.zone:disabled {
  visibility: hidden;
  cursor: default;
}
@media (hover: hover) and (pointer: fine) {
  .zone:hover .icon {
    opacity: 1;
  }
}
.frame picture {
  display: contents;
}
/* A photo or video and its loader: one box, as large as fits at --ratio (viewer.js), so nothing jumps. */
.frame:has(> :is(.stand-in, canvas, video)) {
  container-type: size;
}
.frame > :is(.stand-in, canvas, video) {
  width: min(100cqw, 100cqh * var(--ratio, 1.5));
  aspect-ratio: var(--ratio, 1.5);
}
.frame > .stand-in,
.frame :is(picture img, canvas, video) {
  grid-area: 1 / 1;
  border-radius: var(--r-list);
  box-shadow: var(--sh-frame);
}
.frame :is(picture img, canvas, video) {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: var(--surface);
}
/* Presenting (viewer.js present): the item on pure black (the body too, for the strip a phone tints) in the safe area. */
.is-presenting :is(.bar, .side, .handle, #controls, .foot) {
  display: none;
}
.is-presenting,
.is-presenting .view {
  background: #000;
}
.is-presenting .view {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  touch-action: pan-y;
}
.is-presenting .view .frame {
  padding: 0;
}
/* Contained in the whole window, so a small picture grows to two opposite edges; a scrolling document keeps its column. */
.is-presenting .view .frame:not(.is-scroll) :is(picture img, canvas, video) {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
#b-stop {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  z-index: 6;
  min-height: 44px;
  translate: -50%;
  /* Neutral over any slide: the saturating blur would tint it with the picture. */
  background: var(--glass-solid);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: var(--glass-edge), var(--sh-pill);
  /* --stop-o: viewer.js sets it from the pointer's distance to the top. */
  opacity: var(--stop-o, 0);
  pointer-events: none;
  transition: opacity 300ms var(--ease-ui);
}
.is-reach #b-stop {
  pointer-events: auto;
  transition-duration: 200ms;
}
.is-awake #b-stop,
#b-stop:focus-visible {
  opacity: 1;
  pointer-events: auto;
}
.is-presenting .view.is-idle {
  cursor: none;
}
@media (prefers-reduced-motion: reduce) {
  #b-stop {
    transition: none;
  }
}
.parked {
  place-self: center;
  font-size: 22px;
  font-weight: 600;
  color: var(--surface);
}
.view.is-card {
  flex: none;
  margin: auto 0;
  width: min(100%, 440px);
}
.item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 32px;
  border-radius: var(--r-card);
  background: var(--surface);
}
.item-title {
  margin-top: 12px;
  font-size: 22px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.item-card .btn {
  margin-top: 20px;
}
/* Present and Download in one glass pill, `--inset` under the item (viewer.js sets its top). */
[data-mode="viewer"] #controls {
  position: absolute;
  width: max-content;
  bottom: 0;
  left: 50%;
  z-index: 5;
  flex-wrap: nowrap;
  align-items: center;
  height: var(--pill);
  padding: 8px;
  border-radius: var(--r-pill);
  box-shadow: var(--glass-edge), var(--sh-pill);
  /* `translate`, not `transform`: viewer.js glides the pill with the same property. */
  translate: -50% 0;
}
/* A --stack wide column (viewer.js fit): at the stage's bottom right, or under the side list. */
.pane.is-stacked #controls {
  bottom: auto;
  flex-direction: column;
  align-items: stretch;
  width: var(--stack);
  height: auto;
  border-radius: var(--r-stage);
  translate: none;
}
.dots {
  padding: 0 8px;
  text-align: center;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* The one loading part (core/loader.js, design.md section 6). Under reduced transparency the glass is --surface, so
   the fill and the sheen's band (--tint, --band) turn ink. */
.loader {
  --tint: var(--glass);
  --band: rgba(255, 255, 255, 0.7);
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  background: var(--g1);
}
@media (prefers-reduced-transparency: reduce) {
  .loader {
    --tint: rgba(30, 30, 28, 0.1);
    --band: rgba(30, 30, 28, 0.08);
  }
}
.loader > *,
.loader::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.loader-thumb {
  object-fit: cover;
}
.loader-fill {
  background: var(--tint);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  transition: transform 250ms var(--ease-out);
}
.loader::after {
  content: "";
  background: linear-gradient(100deg, transparent 32%, var(--band) 50%, transparent 68%) 100% 0 / 300% 100% no-repeat;
  animation: sheen 2.2s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .loader::after {
    content: none;
  }
}

/* One list row, concentric in a --r-list box padded --list-pad (design.md section 6). The 2 px border is
   transparent until focus, so focus never moves the layout. */
.item,
.handle,
.row {
  --r-row: calc(var(--r-list) - var(--list-pad));
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--row);
  padding: 6px;
  border: 2px solid transparent;
  border-radius: var(--r-row);
  color: inherit;
  text-align: left;
  text-decoration: none;
}
.item,
.handle,
:is(label, button).row {
  cursor: pointer;
}
.item,
.row {
  background: none;
}
.item:focus-visible {
  outline: none;
  border-color: var(--ink);
}
.thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: calc(var(--r-row) - 8px);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--hairline);
  object-fit: cover;
}
.thumb.fit {
  object-fit: contain;
}
/* The file on its way (phone.js): the loader under the row's face, over its border box, rounded as the row. */
.row.upload {
  isolation: isolate;
}
.row.upload > .loader {
  position: absolute;
  z-index: -1;
  inset: -2px;
  border-radius: inherit;
}
.row-text .small {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.row-name {
  display: flex;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.row-name .head {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-name .tail {
  flex: none;
  white-space: pre;
}
.side {
  z-index: 10;
  inset: var(--top) auto auto var(--inset);
  width: var(--side);
  height: auto;
  max-height: calc(100dvh - var(--top) - var(--inset));
  margin: 0;
  padding: var(--list-pad);
  border: 0;
  border-radius: var(--r-list);
  box-shadow: var(--sh-pill);
  color: inherit;
}
.side:not(:popover-open) {
  position: fixed;
  display: block;
  overflow: auto;
}
.items,
.list {
  display: grid;
  gap: 2px;
}
.items {
  margin: 0;
  padding: 0;
  list-style: none;
}
/* The links under one inset rule, 8 clear of the rows on both sides (the grid gap 2 + 6 above; 1 for the rule + 9
   below). */
.split {
  margin-top: 6px;
  padding-top: 9px;
  box-shadow: inset 0 1px var(--hairline);
}
/* Selected and hover are a light fill, never ink: a link row is never selected, only hovered. */
.item[aria-current] {
  background: var(--g-select);
}
@media (hover: hover) and (pointer: fine) {
  .item:not([aria-current]):hover,
  :is(label, button).row:hover {
    background: var(--wash);
  }
}
.item > .icon:last-of-type {
  color: var(--muted);
}
.handle {
  display: none;
  order: 9;
  box-shadow: var(--sh-pill);
}
/* Wide, with the list a side panel: a left rail (logo, list, End at the foot) beside the stage. */
@media (min-width: 760px) {
  .page-screen main[data-mode="viewer"]:has(> .side:not([hidden])) {
    padding: var(--inset) var(--inset) var(--inset) calc(var(--side) + var(--inset) * 2);
  }
  .page-screen main[data-mode="viewer"]:has(> .side:not([hidden])) .pane {
    height: calc(100dvh - var(--inset) * 2);
  }
  .page-screen:has(main[data-mode="viewer"] > .side:not([hidden])) #b-end {
    position: fixed;
    bottom: var(--inset);
    left: var(--inset);
    margin: 0;
  }
  /* --reserve: the rail's stack (viewer.js fit). */
  .side {
    max-height: calc(100dvh - var(--top) - var(--inset) * 2 - max(var(--frame-h), var(--reserve, 0px)));
  }
}
@media (max-width: 759.98px) {
  .side:not(:popover-open) {
    display: none;
  }
  .side {
    inset: auto 0 0;
    width: 100%;
    max-height: min(72dvh, 600px);
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    transition: transform 350ms cubic-bezier(0, 0, 0, 1);
  }
  @starting-style {
    .side:popover-open {
      transform: translateY(100%);
    }
  }
  .side::before {
    content: "";
    position: absolute;
    top: 8px;
    left: calc(50% - 18px);
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--g1);
  }
  .side::backdrop {
    background: rgba(0, 0, 0, 0.18);
  }
  .handle:not([hidden]) {
    display: flex;
  }
}
/* No forwards fill: it would keep containing the presenting view's fixed box. */
.pane.enter {
  animation: in 380ms var(--ease-out) backwards;
}
.is-presenting .pane.enter {
  animation: none;
}
@keyframes in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ---- /a and /code ---- */
.column {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(var(--inset) + var(--frame-h) + 24px) max(var(--pad), env(safe-area-inset-right))
    calc(var(--inset) + env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
}
.flow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.title {
  font-size: 34px;
}
.flow > .title + :is(.body, .sub) {
  margin-top: -8px;
}
.skel {
  background: var(--g1);
  border-radius: var(--r-chip);
}
.skel-title {
  height: 36px;
  width: 70%;
}
.body,
.ends,
.sub,
.scope {
  color: var(--muted);
}
.body {
  text-wrap: pretty;
}
.body:empty {
  display: none;
}
.warn {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-radius: var(--r-card);
  background: var(--surface);
  font-weight: 600;
}
.scope {
  margin-top: 12px;
  font-size: 14px;
}
.ends {
  display: flex;
  align-items: center;
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.ends.soon {
  color: var(--robin-ink);
}
/* core/toast.js: a .glass card, bottom center; --toast-lift clears the band. */
.toast {
  position: fixed;
  z-index: 60;
  right: 0;
  bottom: calc(var(--inset) + env(safe-area-inset-bottom) + var(--toast-lift, 0px));
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(calc(100% - 2 * var(--pad)), 360px);
  margin: 0 auto;
  padding: 16px 20px;
  border-radius: var(--r-sheet);
  box-shadow: var(--glass-edge), var(--sh-pill);
  animation: toast-in 250ms var(--ease-out) both;
}
.toast span {
  color: var(--muted);
  font-size: 15px;
}
.toast .btn {
  margin-top: 8px;
}
.toast.out {
  animation: toast-out 200ms var(--ease-out) both;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}
/* The card's width, so a long name ellipsizes. */
.list {
  grid-template-columns: minmax(0, 1fr);
  margin: 16px 0 0;
  padding: var(--list-pad);
  list-style: none;
  border-radius: var(--r-list);
  background: var(--surface);
}
.list > li.skel {
  height: var(--row);
  border-radius: calc(var(--r-list) - var(--list-pad));
}
:is(label, button).row:active {
  background: var(--wash);
}
.row input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.row:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
.tick {
  flex: none;
  display: grid;
  visibility: hidden;
}
.row:has(input:checked) .tick {
  visibility: visible;
}
/* Side by side the primary is last; stacked, first. The countdown is status, so it reads above them. */
.actions,
.buttons {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}
.actions {
  flex: none;
  flex-direction: column;
  margin-top: 24px;
}
/* The band (pages.test.ts pins both queries): /a's buttons stay in reach, a result above Done is centered. */
@media (max-width: 639.98px), (max-height: 599.98px) and (max-width: 899.98px) {
  .is-ended .flow {
    position: fixed;
    inset: 0;
    display: grid;
    place-content: center;
    padding: var(--pad);
  }
  /* A floating glass panel like the viewer's controls: inset from the sides and the bottom, its radius a button's (26)
     plus its padding (8). The spacer keeps it 24 under the content once the page is scrolled to the end. */
  .column > .actions {
    position: sticky;
    z-index: 5;
    order: 2;
    bottom: calc(var(--inset) + env(safe-area-inset-bottom));
    margin: auto 0 0;
    padding: 8px;
    border-radius: 34px;
    box-shadow: var(--glass-edge), var(--sh-pill);
  }
  .column > .actions:has(> .buttons:empty) {
    display: none;
  }
  .page-phone .column::after {
    content: "";
    order: 1;
    flex: none;
    height: 24px;
  }
  .page-phone:has(.actions .btn) {
    --toast-lift: 80px;
  }
}
@media (max-width: 639.98px) {
  .page-phone:has(.actions .btn + .btn) {
    --toast-lift: 140px;
  }
}
/* A file dragged over /a, from 640 wide (core/drag.js); it never takes the pointer. */
.drop-hint {
  display: none;
}
@media (min-width: 640px) {
  .drop-hint:not([hidden]) {
    position: fixed;
    z-index: 55;
    inset: var(--inset);
    display: grid;
    place-content: center;
    border: 2px dashed var(--ink);
    border-radius: var(--r-sheet);
    background: var(--glass-firm);
    font-size: 22px;
    font-weight: 600;
    pointer-events: none;
  }
}
/* Approved hides Back: the title at --inset, mirroring the panel. */
@media (max-width: 899.98px) {
  .page-phone:not(.is-ended):has(#back[hidden]) .column {
    justify-content: flex-start;
    padding-top: var(--inset);
  }
}
/* Its complement: buttons on the page, no fill, the column centered (in a short window that would push them past the fold). */
@media (min-width: 640px) and (min-height: 600px), (min-width: 900px) {
  .page-phone .column {
    justify-content: center;
    padding-bottom: calc(var(--inset) + var(--frame-h) + 24px);
  }
  .column > .actions.glass {
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
.actions .btn {
  flex: 1;
  min-height: 52px;
}
.actions .btn.text {
  min-height: 44px;
}
@media (min-width: 640px) {
  .buttons {
    flex-direction: row;
    align-items: center;
  }
  .actions .btn.text {
    flex: none;
  }
  .buttons > .btn.text:first-child {
    margin-left: -12px;
  }
}
@media (min-width: 900px) {
  .column:has(> .list:not([hidden])) {
    display: grid;
    height: 100vh;
    height: 100dvh;
    max-width: 1040px;
    padding-bottom: calc(var(--inset) + var(--frame-h) + 24px);
    grid-template: 1fr auto auto auto 1fr / minmax(0, 400px) minmax(0, 1fr);
    grid-template-areas: ". list" "flow list" "scope list" "actions list" ". list";
    column-gap: 64px;
  }
  .column:has(> .list:not([hidden])) .title {
    font-size: 48px;
  }
  .column > .flow {
    grid-area: flow;
  }
  .column > .list {
    grid-area: list;
    align-self: center;
    max-height: 100%;
    margin: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }
  .column > .scope {
    grid-area: scope;
  }
  .column > .actions {
    grid-area: actions;
  }
  .code-form {
    flex: none;
  }
}
/* A short window spends no bar-height of paper under the list, so it shows more rows. */
@media (min-width: 900px) and (max-height: 599.98px) {
  .column:has(> .list:not([hidden])) {
    padding-bottom: var(--inset);
  }
}
.code-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-top: 24px;
}
.field-label {
  margin-bottom: 8px;
  font-weight: 600;
}
.field {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-field);
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--g2);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}
.field:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ink);
}
.field-error:not(.is-on) {
  visibility: hidden;
}
.field-error {
  display: flex;
  min-height: 24px;
  line-height: 24px;
  gap: 8px;
  margin-top: 12px;
  font-weight: 600;
}
