/* Xtracksion, "Downbeat": a conductor's hand traced in light. One line of bounces, each ending in a sharp beat, is
   drawn by the page itself (app.js, trace) as the five steps, as the pieces left and beside each piece in the list.
   The numbers of the piece are the largest type. Warm orange-red is the one colour for "this needs you / stopped". */
:root { --ink: #1b2740; --soft: #44536b; --hair: #c5d0e0; --paper: #fff; --ground: #f4f7fc; --wash: #e7eef9;
  --beam: #1d5cff; --beam-soft: #a9c3ff; --mark: #b23a08; --mark-wash: #fff0e4;
  --wide: "Helvetica Neue", "Segoe UI", "Avenir Next", Avenir, "Trebuchet MS", sans-serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ground); }
body { margin: 0; font: 400 17px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--ground); overflow-x: hidden; }

header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--hair); }
h1 { font: 500 1rem/1 var(--wide); letter-spacing: .2em; text-transform: uppercase; margin: 0; white-space: nowrap; }
h1 a { color: var(--ink); text-decoration: none; }
h1 .box { border-bottom: 3px solid var(--beam); padding-bottom: 2px; }
.tag { font: 600 .68rem/1 var(--wide); text-transform: uppercase; letter-spacing: .28em; color: var(--soft); margin-left: .9rem; vertical-align: middle; }
#who { display: flex; align-items: center; gap: .6rem; min-width: 0; }
#who .soft { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#who button { min-height: 44px; padding: .3rem .8rem; font-size: .9rem; letter-spacing: .06em; white-space: nowrap; box-shadow: none; }

main { max-width: 46rem; margin: 0 auto; padding: 1.2rem 1.1rem 4rem; counter-reset: q; }

h2 { font: 600 .9rem/1.3 var(--wide); letter-spacing: .2em; text-transform: uppercase; margin: 2.6rem 0 .8rem; padding-top: 1rem; border-top: 1px solid var(--ink); }
h2.title { font: 300 clamp(1.9rem, 8vw, 3.2rem)/1.1 var(--wide); letter-spacing: .02em; text-transform: none; margin: .6rem 0 .8rem; padding: 0; border: 0; overflow-wrap: break-word; }
h2.title.promise { font-size: clamp(2.1rem, 9vw, 3.8rem); margin: 1rem 0 1rem; }
h3 { font: 600 1rem/1.3 var(--wide); letter-spacing: .05em; margin: 1.2rem 0 .3rem; }
p { margin: .6rem 0; }
a { color: var(--ink); text-decoration-color: var(--beam); text-decoration-thickness: 2px; text-underline-offset: .2em; }
.soft, .why { color: var(--soft); font-size: .94rem; }
.date { white-space: nowrap; }
.err { color: var(--mark); font-weight: 600; }
.err:empty { display: none; }
.kicker { font: 600 .78rem/1.3 var(--wide); text-transform: uppercase; letter-spacing: .26em; color: var(--soft); margin: 1.6rem 0 0; }
.state { font-size: 1.1rem; margin: 0 0 1rem; }

/* ---- the drawn line (shared by every svg the page builds) */
svg .line, svg .glow, svg .rest { fill: none; stroke-linecap: round; stroke-linejoin: round; }
svg .line { stroke: var(--beam); }
svg .glow { stroke: var(--beam); opacity: .16; }
svg .rest { stroke: var(--soft); opacity: .55; stroke-dasharray: 2 9; }
svg .pt.done { fill: var(--beam); }
svg .pt.todo { fill: var(--ground); stroke: var(--soft); }
svg .pt.work { fill: #fff; stroke: var(--beam); }
svg .pulse { fill: var(--beam); opacity: .18; }
svg .pt.need { fill: var(--mark); }
svg .ring { fill: var(--mark-wash); stroke: var(--mark); }
/* a stop: a cross in the warm colour where the line ends */
svg .cross { stroke: var(--mark); stroke-linecap: round; fill: none; }
/* only the steps strip of a waiting piece pulses: no page with a form to fill in has one */
@media (prefers-reduced-motion: no-preference) { .steps svg .pulse { transform-box: fill-box; transform-origin: center; animation: beat 1.6s ease-out infinite; } }
@keyframes beat { 0% { transform: scale(.7); opacity: .3; } 100% { transform: scale(1.7); opacity: 0; } }

/* ---- where a piece is up to: the line, then the names under its beats */
.steps { margin: 1.1rem 0 1rem; }
.steps .trace { display: block; width: 100%; height: auto; overflow: visible; }
.steps .names { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: .15rem; }
.steps .step { min-width: 0; text-align: center; padding: 0 .1rem; }
.steps .n { display: block; font: 300 1.8rem/1 var(--wide); color: var(--soft); }
.steps .names .name, .steps .names .says { display: none; }
.steps .played .n { color: var(--ink); }
.steps .wait .n { color: var(--beam); font-weight: 600; }
.steps .now .n, .steps .stopped .n { color: var(--mark); font-weight: 600; }
.steps .nowline { margin: .35rem 0 0; font: 400 1.15rem/1.3 var(--wide); }
.steps .nowline .nm { font-weight: 700; }
.steps .nowline.wait { color: var(--ink); }
.steps .nowline.wait .says { color: var(--beam); font-weight: 700; }
.steps .nowline.now, .steps .nowline.stopped { color: var(--mark); font-weight: 700; }
.steps .nowline.stopped .says { text-transform: uppercase; letter-spacing: .05em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) {
  .steps .names .name { display: block; font-size: 1rem; line-height: 1.25; color: var(--soft); padding-top: .2rem; overflow-wrap: normal; }
  .steps .names .says { display: block; font: 700 1rem/1.2 var(--wide); letter-spacing: .02em; min-height: 1em; margin-top: .15rem; }
  .steps .nowline { display: none; }
  .steps .played .name { color: var(--ink); }
  .steps .wait .name { color: var(--ink); font-weight: 700; }
  .steps .wait .says { color: var(--beam); }
  .steps .now .name, .steps .now .says, .steps .stopped .name, .steps .stopped .says { color: var(--mark); font-weight: 700; }
  .steps .stopped .says { text-transform: uppercase; letter-spacing: .05em; }
}

/* ---- the numbers of a piece as its face */
.figs { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem 1.8rem; margin: .4rem 0 .6rem; }
.fig { display: flex; flex-direction: column; min-width: 0; }
.fig .v { font: 200 2.1rem/1 var(--wide); }
/* a caption is the label of the large figure directly above it */
.fig .c { font: 600 .875rem/1.3 var(--wide); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); margin-top: .2rem; }
/* one time signature is a plate: figure and captions on the left, the drawing boxed on the right. Every plate is the
   same size, so several sit on a grid. */
.tsigs { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; min-width: 0; }
.fig.unit { flex-direction: row; align-items: stretch; gap: .9rem; width: 15.3rem; max-width: 100%; }
.unit .txt { display: flex; flex-direction: column; justify-content: space-between; width: 6.9rem; flex: none; min-width: 0; }
.unit .v { font: 200 2.6rem/1 var(--wide); white-space: nowrap; }
.unit .v.long { font-size: 1.2rem; font-weight: 400; line-height: 1.25; white-space: normal; }
.unit .capt { display: flex; flex-direction: column; gap: .15rem; }
.unit .how { font: 600 1rem/1.25 var(--wide); color: var(--ink); }
.unit .c { margin-top: 0; font-size: .875rem; letter-spacing: .1em; line-height: 1.25; }
.unit .asked { margin-top: .1rem; }
.unit .box { width: 7.5rem; height: 7.5rem; flex: none; border: 1px solid var(--ink); border-radius: 2px; background: var(--paper); }
.unit .pattern { display: block; width: 100%; height: 100%; overflow: hidden; }
.pattern .num { font: 600 13.5px/1 var(--wide); fill: var(--ink); }
/* the small plate in a piece page's header: the same arrangement at a smaller fixed size; on a phone it is text only */
.figs:not(.big) .fig.unit { width: 12.4rem; gap: .7rem; }
.figs:not(.big) .unit .txt { width: 5.2rem; }
.figs:not(.big) .unit .v { font-size: 1.8rem; }
.figs:not(.big) .unit .v.long { font-size: 1rem; }
.figs:not(.big) .unit .box { width: 5.6rem; height: 5.6rem; }
.figs:not(.big) .unit .how { font-size: .9rem; }
.figs:not(.big) .unit .c { font-size: .75rem; }
.fig .pattern.x { display: none; }
.figs.big { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 1rem; margin: .8rem 0 1.2rem; align-items: start; }
.figs.big > .fig, .figs.big .tsigs { border-top: 1px solid var(--ink); padding-top: .5rem; position: relative; }
.figs.big .tsigs { padding-top: .5rem; }
.figs.big > .fig:first-child { grid-column: 1 / -1; }
.figs.big > .fig .v { font-size: clamp(3.2rem, 15vw, 5.4rem); }
.figs.big > .fig:first-child .v { font-size: clamp(5rem, 28vw, 9rem); line-height: .85; margin-left: -.03em; }
.figs.big > .fig .v.long { font-size: 1.5rem; font-weight: 300; line-height: 1.2; padding: .6rem 0; }
.figs.big .tsigs { grid-column: 1 / -1; }
.figs:not(.big) .v.long { font-size: 1.2rem; }
.fig .u { font-size: 1rem; color: var(--soft); line-height: 1.3; }
.fig.ask { border-top: 4px solid var(--mark) !important; }
.fig.ask .v { color: var(--mark); }
.fig.unit.ask { border-top: 0 !important; }
.fig .asked { font: 700 1rem/1.2 var(--wide); color: var(--mark); margin-top: .3rem; }
.fig.over .v, .fig.over .u { color: var(--mark); }

/* ---- blocks */
.card { border-top: 1px solid var(--hair); padding: 1rem 0 1.1rem; margin: 1rem 0; }
.card > h3:first-child { margin-top: 0; }
.card.face { border-top: 0; padding-top: 0; }
.must { border-top: 0; border-left: 5px solid var(--mark); background: var(--mark-wash); padding: 1rem 1rem 1.1rem 1.1rem; }
.done { border-top: 0; border-left: 5px solid var(--beam); background: var(--paper); padding: 1rem 1rem 1.1rem 1.1rem; box-shadow: inset 0 0 0 1px var(--hair); }
.note { border-left: 3px solid var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--hair); padding: .8rem 1rem; margin: 1rem 0; }
.note.ask { border-left: 5px solid var(--mark); background: var(--mark-wash); box-shadow: none; }
/* each question is a beat: its number stands in the left margin */
.card.q { counter-increment: q; position: relative; padding-left: 3.4rem; }
.card.q::before { content: counter(q); position: absolute; left: .55rem; top: .85rem; font: 200 2.2rem/1 var(--wide); color: var(--soft); }
.card.q.must::before { color: var(--mark); font-weight: 400; }
.card.q.done::before { color: var(--beam); }

/* ---- forms */
label { display: block; margin: .5rem 0; }
label.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
label.row > span { flex: 1 1 12rem; min-width: 0; }
label.row > input[type=text] { flex: 1 1 100%; }
label.row:has(> input[type=text]) { flex-wrap: wrap !important; }
label.row:has(> input[type=text]) > span { flex: 1 1 10rem; }
label.row:has(> input[type=checkbox], > input[type=radio]) { flex-wrap: nowrap; align-items: flex-start; border: 1.5px solid var(--hair); background: var(--paper); padding: .65rem .8rem; min-height: 48px; }
label.row:has(> input:checked) { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--beam); }
label.row:has(> input[type=checkbox]:disabled) { background: var(--wash); }
.must label.row:has(> input[type=checkbox], > input[type=radio]) { border-color: #e7b99e; }
input[type=text], input[type=number], select, textarea { font: inherit; color: var(--ink); padding: .6rem .7rem; min-height: 46px; border: 1.5px solid var(--ink); border-radius: 2px; background: var(--paper); max-width: 100%; min-width: 0; box-shadow: inset 0 2px 0 var(--wash); }
input[type=text] { width: 100%; letter-spacing: .06em; }
input[type=file] { font: inherit; max-width: 100%; }
input[type=file]::file-selector-button { font: 600 1rem/1.2 var(--wide); letter-spacing: .06em; min-height: 48px; padding: .6rem 1.1rem; margin-right: .8rem; border: 2px solid var(--ink); border-radius: 2px; background: var(--paper); color: var(--ink); cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 1.4rem; height: 1.4rem; flex: none; position: relative; top: .1rem; accent-color: var(--ink); }
button { font: 600 1rem/1.2 var(--wide); letter-spacing: .06em; min-height: 48px; padding: .7rem 1.4rem; border-radius: 2px; border: 2px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; box-shadow: 0 4px 0 var(--beam-soft); }
button:hover { background: #2c3e63; border-color: #2c3e63; }
button:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--beam-soft); }
button.plain, button.danger { background: var(--paper); color: var(--ink); }
button.plain:hover, button.danger:hover { background: var(--wash); border-color: var(--ink); }
button.danger { font-weight: 500; box-shadow: none; }
button.small { min-height: 44px; padding: .45rem .9rem; font-size: .92rem; }
button:disabled { opacity: 1; cursor: default; background: var(--wash); color: var(--soft); border: 2px dashed var(--soft); box-shadow: none; }
button.markbtn[aria-disabled=true] { background: var(--paper); color: var(--ink); cursor: not-allowed; border-style: dashed; box-shadow: none; }
button.markbtn { font-size: 1.05rem; padding: .7rem 1.2rem; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--beam); outline-offset: 3px; box-shadow: 0 0 0 6px #fff; }
.bar { display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: center; margin: 1.1rem 0; }
.bar label { margin: 0; }
.foot { border-top: 1px solid var(--hair); margin-top: 2.5rem; padding-top: 1rem; }
details summary { cursor: pointer; font-weight: 600; text-decoration: underline; text-decoration-color: var(--beam); text-decoration-thickness: 2px; text-underline-offset: .2em; padding: .5rem 0; }
details.why summary { font-weight: 400; }
table { border-collapse: collapse; width: 100%; }
td, th { text-align: left; padding: .5rem .6rem .5rem 0; vertical-align: top; border-bottom: 1px solid var(--hair); }
th { font: 600 .78rem/1.4 var(--wide); letter-spacing: .14em; text-transform: uppercase; width: 11rem; color: var(--soft); padding-top: .75rem; }
tr:last-child td, tr:last-child th { border-bottom: 0; }
ul, ol { padding-left: 1.3rem; margin: .4rem 0; }
ol.order li { margin: .3rem 0; }

/* numbered lists as beats: the numeral stands out in light type */
ol.todo, ol.how { list-style: none; padding: 0; margin: .8rem 0; counter-reset: beat; }
ol.todo li, ol.how li { display: flex; gap: 1rem; align-items: baseline; margin: .6rem 0; counter-increment: beat; }
ol.todo li::before { content: counter(beat); font: 200 2.2rem/1 var(--wide); min-width: 1.5rem; flex: none; color: var(--beam); }
.how .n { font: 200 2.4rem/1 var(--wide); min-width: 1.6rem; flex: none; }

/* ---- agreement: the promise falls to the box where it is typed */
.drop { display: block; width: 3.2rem; height: auto; margin: .2rem 0 .2rem 1.4rem; overflow: visible; }
#agree-words { font: 300 1.7rem/1.2 var(--wide); letter-spacing: .14em; min-height: 62px; border-width: 2px; }
.terms { font-size: .96rem; margin: .6rem 0; position: relative; }
.clause { display: flex; gap: 1rem; margin: .2rem 0 1rem; padding-left: .2rem; }
.clause .n { font: 200 2.2rem/1 var(--wide); color: var(--beam); min-width: 1.6rem; flex: none; }
.clause p { margin: .2rem 0; }
details.agreed { margin-top: 2.5rem; }

/* ---- home: the count-in, and the pieces each with its own small line */
.left { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "num count" "what what"; align-items: end; gap: .2rem 1rem; margin: 1.2rem 0 .8rem; }
.left .num { grid-area: num; font: 200 clamp(8rem, 40vw, 12rem)/.8 var(--wide); margin-left: -.04em; min-width: .55em; }
.left .count { grid-area: count; min-width: 0; padding-bottom: .1rem; }
.left .count .trace { display: block; width: 100%; height: auto; overflow: visible; }
.left .count .names { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; text-align: center; font: 300 1.5rem/1 var(--wide); color: var(--ink); }
.left.none .count { max-width: 9rem; }
.left .what { grid-area: what; font-size: 1.05rem; line-height: 1.35; }
.left .what strong { display: block; font: 600 .95rem/1.3 var(--wide); letter-spacing: .18em; text-transform: uppercase; margin-bottom: .3rem; }

.pieces { border-top: 1px solid var(--ink); }
.pieces button { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; align-items: center; width: 100%; text-align: left; min-height: 68px; padding: .9rem .2rem; background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; font-weight: 400; letter-spacing: normal; box-shadow: none; }
.pieces button:hover { background: var(--paper); }
.pieces button:active { transform: none; }
.pieces .t { font: 400 1.2rem/1.25 var(--wide); letter-spacing: .01em; grid-column: 1; min-width: 0; overflow-wrap: break-word; }
.pieces .s { grid-column: 1; color: var(--soft); font: 400 .94rem/1.4 system-ui, sans-serif; letter-spacing: normal; }
h2 + .pieces { border-top: 0; margin-top: 0; }
.pieces .s .ask { display: block; }
.pieces .s.ask, .pieces .s .ask { color: var(--mark); font-weight: 700; }
.pieces .mini { grid-column: 2; grid-row: 1 / span 2; width: 7.2rem; display: block; }
.pieces .mini .trace { display: block; width: 100%; height: auto; overflow: visible; }

/* ---- the delivery page: one voice to a block */
.voice { border-top: 1px solid var(--ink); padding-top: .3rem; margin: 2.2rem 0; }
.voice .vno { font: 600 .875rem/1.3 var(--wide); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); margin: .6rem 0 0; }
.voice > h3 { font: 300 clamp(2rem, 8vw, 2.8rem)/1.1 var(--wide); letter-spacing: .02em; margin: .3rem 0 .8rem; overflow-wrap: break-word; }
/* the video box is taller than the picture, with blank paper under it, so the player's control bar sits on the
   paper and not on the lowest staff */
.voice video { display: block; width: 100%; aspect-ratio: 1.12; object-fit: contain; object-position: top; background: #fff; border: 1px solid var(--hair); }
.follow { display: grid; grid-template-columns: 1fr; gap: .6rem 1.2rem; align-items: center; margin: .9rem 0 .6rem; }
.readout { display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.voice .now { display: inline-flex; align-items: baseline; gap: .5rem; font-size: 1.05rem; }
.voice .now .bignum { font: 200 4.2rem/.9 var(--wide); color: var(--ink); }
.countin { display: block; width: 9rem; }
.countin:empty { display: none; }
.countin .trace { display: block; width: 100%; height: auto; overflow: visible; }
.act { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }
.act button { width: 100%; }
.track { display: grid; grid-template-columns: 2.6rem 1fr auto; grid-template-areas: "lv what dl" "au au au"; gap: .4rem 1rem; align-items: center; padding: .8rem 0; border-top: 1px solid var(--hair); }
.track .levels { grid-area: lv; width: 2.6rem; height: auto; display: block; }
.track .what { grid-area: what; font-weight: 600; line-height: 1.25; }
.track audio { grid-area: au; width: 100%; min-width: 0; height: 44px; }
.track a { grid-area: dl; }
.lv.vo { fill: var(--beam); }
.lv.ot { fill: var(--soft); opacity: .6; }
.pages { max-height: 75vh; overflow: auto; border: 1.5px solid var(--ink); background: var(--paper); }
/* wrong bars: one tidy card to a mark, then adding a bar by its number */
.marks { display: grid; grid-template-columns: 1fr; gap: .8rem; margin: .8rem 0; }
.marks > p { grid-column: 1 / -1; margin: 0; }
.card.wrongbar { display: flex; flex-direction: column; gap: .8rem; margin: 0; padding: 1rem 1rem 1rem 1.1rem; }
.wb-head { display: flex; align-items: baseline; gap: .8rem; min-width: 0; }
.wb-head .bv { font: 200 3.2rem/1 var(--wide); flex: none; }
.wb-head strong { font-size: 1.1rem; line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
.wrongbar.must .bv { color: var(--mark); font-weight: 400; }
.wrongbar.done .bv { color: var(--beam); }
.wb-field { display: flex; flex-direction: column; gap: .3rem; margin: 0; min-width: 0; font-weight: 600; }
.wb-field select, .wb-field input[type=text], .wb-field input[type=number] { width: 100%; min-height: 48px; font-weight: 400; }
.wrongbar .rm { align-self: flex-end; min-height: 44px; }
.addbar { display: flex; flex-direction: column; gap: .8rem; max-width: 30rem; margin: 1.6rem 0 1rem; }
.addbar > h3 { margin: 0; }
.addbar .pair { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.addbar > button { width: 100%; }
.said { display: block; font-size: 1rem; color: var(--soft); margin-top: .2rem; }
.said:empty { display: none; }
.said .undo { background: none; border: 0; box-shadow: none; text-decoration: underline; text-decoration-color: var(--beam); text-underline-offset: .2em; padding: .3rem .6rem; min-height: 44px; font-weight: 600; letter-spacing: 0; }
.said .undo:hover { background: var(--wash); }
/* the feedback questions as beats, numbered in order */
.fbopt > label { margin: 1.1rem 0 .3rem; }
.fbopt > label > select, .fbopt > label > input { display: block; margin-top: .35rem; }
.card.fb { counter-reset: fq; }
.fq > h3 { counter-increment: fq; display: flex; gap: .7rem; align-items: baseline; font-size: 1.05rem; margin-top: 1.6rem; }
.fq > h3::before { content: counter(fq); font: 200 2rem/1 var(--wide); color: var(--beam); min-width: 1.3rem; }

@media (min-width: 800px) {
  header { padding: 1rem 2rem; }
  main { max-width: 52rem; }
  .figs.big { grid-template-columns: repeat(3, 1fr); }
  .figs.big > .fig:first-child { grid-column: auto; }
  .figs.big .tsigs { grid-column: span 2; }
  .left { grid-template-columns: auto minmax(14rem, 26rem); grid-template-areas: "num count" "what count"; }
  .left .what { max-width: 22rem; }
  .pieces .mini { width: 10rem; }
  .voice video { aspect-ratio: 1.42; }
  .follow { grid-template-columns: 1fr auto; }
  .act { align-items: flex-start; min-width: 16rem; }
  .track { grid-template-columns: 2.6rem minmax(10rem, 17rem) 1fr auto; grid-template-areas: "lv what au dl"; }
  .marks { grid-template-columns: 1fr 1fr; max-width: 46rem; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  header { padding: .7rem .9rem; }
  h1 { font-size: .95rem; letter-spacing: .14em; }
  .tag { display: none; }
  table, tbody, tr, th, td { display: block; width: auto; }
  th { border-bottom: 0; padding-bottom: 0; }
  td { padding-top: .1rem; }
  .bar button { flex: 1 1 auto; }
  #who .soft { display: none; }
  .card.q { padding-left: 2.9rem; }
  .card.q::before { left: .4rem; font-size: 1.9rem; }
  .pieces .mini { width: 6.2rem; }
  .soft, .why, .said, .pieces .s, .terms { font-size: 1rem; }
  h2, th, .kicker { font-size: 1rem; letter-spacing: .1em; }
  h2 { text-wrap: balance; }
  th { text-transform: none; letter-spacing: .02em; font-size: 1rem; font-weight: 600; color: var(--ink); }
  h2.title.long, h2.title { letter-spacing: 0; }
  .figs.big .tsigs { padding-top: .5rem; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* the small face of a piece page: bars and tempo share a line, the signatures follow */
.figs:not(.big) .tsigs { order: 3; flex-basis: 100%; }
.figs:not(.big) { gap: .6rem 1.8rem; }

@media (min-width: 1100px) {
  .home { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 0 4rem; align-items: start; }
  .home .col.b > h2:first-child { margin-top: 2.2rem; }
  .figs.big { max-width: 52rem; }
}
.bar > input[type=text] { max-width: 30rem; }
#agree-words { max-width: 36rem; }
.act .said .undo { width: auto; }

/* ---- a piece page is one grid of areas. On a phone and a tablet it is one column, in the order of the page. */
.pg { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (max-width: 999px) { .pg.tracks > .cols, .pg.tracks .side { display: contents; } }
.pg > .band { order: 0; }
.todobox { order: 1; margin-bottom: 0; padding-bottom: .3rem; }
.togo { order: 2; margin: 0 0 1rem; }
.vox { order: 3; min-width: 0; }
.wrongs { order: 4; }
.form { order: 5; }
.more { order: 6; }
.wrongs > h2 { margin-top: 2.6rem; }
.band { display: block; }
.band .prog .state { margin-top: .4rem; }
.pbody > .next { margin-top: 1rem; }
.pfoot { margin-top: 1rem; }
.cleft, .pbody, .pfoot, .vox, .form, .more { min-width: 0; }
.form > h2 { margin-top: 2.6rem; }
/* a signature in the header of a piece page is text on a phone: the figure and what it is conducted in */
@media (max-width: 639px) {
  .figs:not(.big) .fig.unit { width: auto; }
  .figs:not(.big) .unit .box { display: none; }
  .figs:not(.big) .unit .txt { width: auto; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 0 .7rem; }
  .figs:not(.big) .unit .capt { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 0 .6rem; }
  .figs:not(.big) .fig.unit .v { font-size: 1.6rem; }
  .figs:not(.big) .unit .c, .figs:not(.big) .unit .how { font-size: .875rem; }
}

@media (min-width: 1000px) {
  main { max-width: 76rem; padding: 1.2rem 2rem 4rem; }
  main p, main .state, main .soft, main ul, main ol.order { max-width: 44rem; }
  main .pg p, main .pg .soft, main .pg ul { max-width: none; }
  .pg .vox p, .pg .pbody p, .pg .more p, .pg .pfoot p, .pg .cleft p, .pg .more ul, .pg .cleft ul { max-width: 46rem; }
  .figs.big { max-width: none; }

  /* the band: the piece on the left, where it is up to on the right, one row */
  .band .steps { max-width: 40rem; }
}
@media (min-width: 1200px) {
  .band { display: grid; grid-template-columns: minmax(0, 1fr) 34rem; gap: 0 3.5rem; align-items: start; }
  .band > .note { grid-column: 1 / -1; }
  .band .steps { margin: 0 0 .6rem; max-width: none; }
  .band .prog { padding-bottom: .6rem; }
  .band .prog .state { max-width: none; margin-bottom: 0; }
  .band h2.title { margin-bottom: .6rem; }
}
@media (min-width: 1000px) {

  /* tracks: the voices, and a side column that stays in view */
  .pg.tracks { grid-template-columns: minmax(0, 1fr); grid-template-areas: "band" "cols" "form" "more"; align-items: start; }
  /* the two columns are a block of their own: the side column can only travel as far as the voices go, never over the form */
  .pg.tracks > .cols { grid-area: cols; display: grid; grid-template-columns: minmax(0, 1fr) clamp(20rem, 28vw, 25rem); column-gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
  .pg.tracks > .band { grid-area: band; }
  .cols > .vox { grid-column: 1; grid-row: 1; }
  .cols > .side { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; overflow-x: hidden; padding: 6px; margin: -6px -6px 0; align-self: start; }
  .pg.tracks > .form { grid-area: form; order: 0; }
  .pg.tracks > .more { grid-area: more; order: 0; }
  .side .todobox { order: 1; margin: 1rem 0 0; padding-bottom: 1rem; }
  .side .wrongs { order: 2; }
  .side .togo { order: 3; margin: .6rem 0 .4rem; }
  .side .wrongs > h2 { margin-top: 1.6rem; }
  .side .marks { grid-template-columns: 1fr; max-width: none; gap: .6rem; margin: .6rem 0; }
  .side .card.wrongbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem .6rem; align-items: center; padding: .6rem .8rem .7rem .9rem; }
  .side .wrongbar .wb-head { grid-column: 1; grid-row: 1; }
  .side .wrongbar .rm { grid-column: 2; grid-row: 1; align-self: center; }
  .side .wrongbar .wb-field { grid-column: 1 / -1; }
  .side .wb-head .bv { font-size: 2.3rem; }
  .side .wb-head strong { font-size: 1rem; }
  .side .wb-field select, .side .wb-field input[type=text] { min-height: 44px; }
  .side .addbar { max-width: none; margin: 1.2rem 0 .6rem; gap: .6rem; }
  .vox .voice:first-of-type { margin-top: 1rem; }
  .voice video, .pages { max-width: none; }
  .vox .track { grid-template-columns: 2.6rem 1fr auto; grid-template-areas: "lv what dl" "au au au"; }
  .vox .follow { grid-template-columns: 1fr; }
  .vox .act { flex-direction: row; flex-wrap: wrap; align-items: center; min-width: 0; }
  .vox .act button { width: auto; }

  /* the three questions side by side, the optional ones in the same three columns beneath */
  .fbq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 2.2rem; align-items: start; }
  .fq > h3 { margin-top: .4rem; min-height: 3.5rem; }
  .fbopt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 2.2rem; align-items: start; margin-top: 1rem; border-top: 1px solid var(--hair); }
  .fbopt > label.wide { grid-column: 3; grid-row: 1 / span 2; }
  .fbopt > label:nth-child(2) { grid-column: 2; }
  .card.fb .row ~ .row { margin-top: .5rem; }
  .card.fb > .row { max-width: 46rem; }
  .more > * { max-width: 52rem; }

  /* questions: the working column on the left, what was found and the pages on the right. The two columns are one
     wrapper that ends before the foot, so the right column can only travel as far as the left one goes */
  .cwrap { display: grid; grid-template-columns: minmax(0, 1fr) clamp(20rem, 36vw, 34rem); column-gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
  .cwrap.one { grid-template-columns: minmax(0, 1fr); }
  .cwrap.one > .cleft { max-width: 52rem; }
  .cleft, .cright { display: block; min-width: 0; }
  .cwrap > .cright { position: sticky; top: 1rem; align-self: start; }
  .cwrap > .cright.loose { position: static; }
  .cright .face { margin-top: .4rem; }
  .cright .figs.big { grid-template-columns: 1fr 1fr; }
  .cright .figs.big > .fig:first-child { grid-column: 1 / -1; }
  .cright .figs.big .tsigs { grid-column: 1 / -1; }
  .cright .figs.big > .fig:first-child .v { font-size: 6rem; }
  .cright .pages { max-height: 70vh; }
  .cright .pagesbox { margin-top: .4rem; }
  .cleft .ctop > .askline { margin-top: .4rem; }

  /* pieces that have not come to tracks: what happened on the left, what it means and the way on beside it */
  .pbody.two { display: grid; grid-template-columns: minmax(0, 44rem) minmax(15rem, 22rem); gap: 0 3.5rem; align-items: start; }
  .pbody.two > .next { margin-top: .4rem; }
  .pbody:not(.two) > .note, .pbody:not(.two) > .lead { max-width: 46rem; }
  .pbody > .lead > .note:first-child { margin-top: .4rem; }

  /* the terms: the heading and the way on on the left, the clauses on the right */
  .split.terms-page { display: grid; grid-template-columns: minmax(15rem, 22rem) minmax(0, 44rem); gap: 0 clamp(2rem, 5vw, 4.5rem); grid-template-rows: auto auto 1fr; align-items: start; }
  .terms-page > h2.title { grid-column: 1; grid-row: 1; }
  .terms-page > .terms { grid-column: 2; grid-row: 1 / span 3; margin-top: 1.2rem; }
  .terms-page > .soft { grid-column: 1; grid-row: 2; }
  .terms-page > .bar { grid-column: 1; grid-row: 3; align-self: start; }
}

/* ---- the questions page. On a phone it is one column and the blocks follow `order`: what to do and the questions, what
   was found, the rest of the questions, the pages, the buttons. From 1000px the left and right wrappers are real. */
.cwrap { min-width: 0; }
@media (max-width: 999px) { .cwrap { display: flex; flex-direction: column; } .cleft, .cright { display: contents; } }
.ctop { order: 1; min-width: 0; }
.cright > .face { order: 2; }
.crest { order: 3; min-width: 0; }
.cright > .pagesbox { order: 4; }
.cact { order: 5; min-width: 0; }
.askline p { margin: .3rem 0; font-size: 1.1rem; }
.askline .need { color: var(--mark); font-weight: 700; }
.ctop > h2:first-child { margin-top: 1.4rem; }
.err.refusal { margin: 0 0 .7rem; padding: .5rem .7rem; background: #fff; border: 2px solid var(--mark); }
.seepages { margin: .1rem 0 .3rem; }
button.linkbtn { background: none; border: 0; box-shadow: none; color: var(--ink); min-height: 44px; padding: .4rem .2rem; font-weight: 600; letter-spacing: .02em; text-decoration: underline; text-decoration-color: var(--beam); text-decoration-thickness: 2px; text-underline-offset: .2em; }
button.linkbtn:hover { background: var(--wash); border: 0; }
.pgitem { padding: .3rem .3rem .2rem; border-bottom: 1px solid var(--hair); }
.pgitem:last-child { border-bottom: 0; }
.pagecap { margin: .2rem 0 .4rem; text-align: right; font-size: .95rem; color: var(--soft); }
.enlarge { margin: .5rem 0; width: 100%; }
img.zoomable { cursor: zoom-in; }
img.zoomable:focus-visible { outline-offset: -3px; }
.cact { margin-top: 1.4rem; border-top: 1px solid var(--ink); padding-top: 1rem; }
.savebar { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; margin: 0 0 1rem; }
.savebar button.small { min-height: 44px; font-size: .92rem; font-weight: 600; box-shadow: none; padding: .45rem 1rem; }
.savebar .soft { flex: 1 1 10rem; margin: 0; }
.mainbar { margin: 0 0 .3rem; }
.mainbar button.main { width: 100%; min-height: 56px; font-size: 1.1rem; }
@media (min-width: 1000px) { .mainbar button.main { width: auto; min-width: 18rem; } }

/* ---- a page full-screen */
html.viewing, html.viewing body { overflow: hidden; }
dialog.viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #fff; color: var(--ink); }
dialog.viewer[open] { display: flex; flex-direction: column; }
dialog.viewer::backdrop { background: #fff; }
.vbar { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; background: var(--ground); border-bottom: 1px solid var(--hair); flex: none; }
.vbar.vnav { border-bottom: 0; border-top: 1px solid var(--hair); justify-content: space-between; padding-bottom: max(.5rem, env(safe-area-inset-bottom)); }
.vbar button { min-height: 48px; box-shadow: none; letter-spacing: .02em; padding: .5rem .9rem; }
.vbar button.vclose { min-width: 6rem; font-size: 1.05rem; }
.vsp { flex: 1; }
.vlabel { font-weight: 600; text-align: center; flex: 1; }
.vscroll { flex: 1; min-height: 0; overflow: auto; background: #fff; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.vimg { display: block; max-width: none; height: auto; }
