/* Self-hosted type (visual-design-system.md §2). Subsets of Source Serif 4
   and Bravura Text renamed for their Reserved Font Names, and Libre Franklin;
   the OFL texts and provenance are in fonts/. No font comes from a CDN. */
@font-face { font-family: "FR Serif"; src: url("fonts/fr-serif-roman.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "FR Serif"; src: url("fonts/fr-serif-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "FR Sans"; src: url("fonts/fr-sans.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
/* §2.3 accidental check (Chromium, 14/16/18px and 100px, both faces): at its
   natural size Bravura's flat rose 36% above the serif's cap height and had
   no left side bearing, so it touched the letter before it. The shipped cut
   adds 70 units of left and 40 of right bearing (fonts/README.txt); 73%
   brings the flat's top to the serif cap height (67 of 67 at 100px; sans 67
   of 75) with its bowl on the baseline, 0.09em clear of the "E". The ascent
   and descent overrides keep the glyph from opening a taller line. */
@font-face { font-family: "FR Accidentals"; src: url("fonts/fr-accidentals.woff2") format("woff2"); unicode-range: U+266D-266F; font-display: block; size-adjust: 73%; ascent-override: 90%; descent-override: 22%; }

/* -- tokens (visual-design-system.md §3-§5) -------------------------------
   Ink on paper, one second colour (rubric). These are the existing token
   names, so every page section below already draws in the new palette;
   score-contrast.test.mjs resolves exactly these two selectors. */
:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --paper-deep: #eeece6;
  --surface: #ffffff;
  --surface-soft: #f2f1ec;
  --ink: #181715;
  --ink-soft: #3e3c37;
  --muted: #64615a;
  --line: #e0ddd5;
  --line-strong: #c9c5bb;
  --field-line: #8a867c;
  --accent: #a62a1b;
  --accent-strong: #86200f;
  --accent-soft: #f7e6e1;
  --on-accent: #ffffff;
  --on-ink: #f7f6f2;
  --focus: #a62a1b;
  --evergreen: #285f45;
  --evergreen-soft: #e3efe7;
  --success-bg: #e3efe7;
  --brass: #7f5300;
  --warning-bg: #f6ecd4;
  --warning-line: #c99a3c;
  --danger: #a62a1b;
  --sheet-paper: #fffef9;
  --sheet-edge: #d6d3cb;
  --shadow: none;
  --shadow-raised: none;
  --shadow-float: 0 1px 2px rgb(24 23 21 / 6%), 0 12px 32px rgb(24 23 21 / 12%);
  --radius: 4px;
  --radius-small: 3px;
  --serif: "FR Accidentals", "FR Serif", Georgia, serif;
  --sans: "FR Accidentals", "FR Sans", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --page-max: 78rem;
  --content: var(--page-max);
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 38rem;
  --header-height: 4rem;
  --control-h: 2.5rem;
  --step--2: 0.8125rem;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.25rem;
  --step-3: 1.5625rem;
  --step-4: 1.9375rem;
  --step-5: 2.4375rem;
  --step-6: clamp(2.4375rem, 1.6rem + 2.6vw, 3.25rem);
  --ui: 0.9375rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --section-gap: var(--space-8);
  --ease: 120ms ease;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364615a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 9.5L12 15l5.5-5.5'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121211;
  --paper-deep: #1f1e1c;
  --surface: #1a1a18;
  --surface-soft: #222120;
  --ink: #ecebe6;
  --ink-soft: #c8c5be;
  --muted: #a5a198;
  --line: #2b2a27;
  --line-strong: #3f3d39;
  --field-line: #77736a;
  --accent: #f59e88;
  --accent-strong: #f9bcad;
  --accent-soft: #3a1f19;
  --on-accent: #121211;
  --on-ink: #121211;
  --focus: #f59e88;
  --evergreen: #7ec49e;
  --evergreen-soft: #18291f;
  --success-bg: #18291f;
  --brass: #e0b260;
  --warning-bg: #2e2513;
  --warning-line: #7d6230;
  --danger: #f59e88;
  --sheet-paper: #f1ece1;
  --sheet-edge: transparent;
  --shadow: none;
  --shadow-raised: none;
  --shadow-float: 0 1px 2px rgb(0 0 0 / 40%), 0 16px 40px rgb(0 0 0 / 50%);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5a198' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 9.5L12 15l5.5-5.5'/%3E%3C/svg%3E");
}

/* Phones (two-row header, 44px targets) and coarse pointers (44px targets). */
@media (max-width: 48rem) {
  :root {
    --header-height: 6.25rem;
    --control-h: 2.75rem;
    --section-gap: var(--space-7);
  }
}

@media (pointer: coarse) {
  :root {
    --control-h: 2.75rem;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* One state rule: an element the markup hides stays hidden whatever display
   a component class gives it (.field, .button, .primary-nav a ...). */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Flat paper: no ruled lines, no texture (§5). */
body {
  margin: 0;
  min-width: 20rem;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--sans);
  font-kerning: normal;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.dialog-open {
  overflow: hidden;
}

/* Links are ink with an underline; rubric marks the hover (§3.3). */
a {
  color: var(--ink);
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--ease), text-decoration-color var(--ease);
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

a:active {
  color: var(--accent-strong);
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  min-height: var(--control-h);
}

button,
[role="button"] {
  touch-action: manipulation;
}

img,
svg,
object {
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

/* Serif for what is read (§4): steps on a 1.25 ratio from 16px. */
h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-5);
  line-height: 1.1;
  letter-spacing: -0.012em;
}

h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-4);
  letter-spacing: -0.008em;
}

h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--step-2);
  line-height: 1.25;
}

h4 {
  margin: 0 0 var(--space-2);
  font-size: var(--step-1);
  line-height: 1.3;
}

::selection {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

::placeholder {
  color: var(--muted);
  opacity: 1;
}

/* One focus ring site-wide (§7): it sits on the paper, never on a fill. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

kbd {
  display: inline-block;
  min-width: 1.25rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-small);
  background: var(--surface);
  padding: 0.1rem 0.3rem;
  color: var(--muted);
  font: 500 var(--step--2)/1 var(--sans);
  text-align: center;
}

code,
pre {
  font-family: var(--mono);
}

/* -- utilities --------------------------------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 100;
  transform: translateY(-180%);
  border-radius: var(--radius-small);
  background: var(--ink);
  color: var(--on-ink);
  padding: var(--space-3) var(--space-4);
  font: 500 var(--ui)/1 var(--sans);
}

.skip-link:focus {
  transform: translateY(0);
}

.skip-link:hover {
  color: var(--on-ink);
}

/* An icon from icons.mjs: currentColor strokes, sized by its attributes. */
.icon {
  flex: none;
  vertical-align: -0.2em;
}

/* .label replaces every tracked-caps eyebrow (§10 deletes the eyebrow
   recipe): the book face's own small caps, never uppercase, never
   synthesised (§4). */
.label {
  display: block;
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font: 600 var(--step-0)/1.3 var(--serif);
  font-variant-caps: all-small-caps;
  font-variant-numeric: lining-nums;
  font-synthesis-small-caps: none;
  letter-spacing: 0.05em;
}

/* Aligned figures: the serif's lining tabular numbers (Libre Franklin has
   no tnum on the shipped file, §2.3). */
.num {
  font-family: var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: var(--step--1);
}

.spaced {
  margin-top: var(--space-4);
}

/* A meta line: "Hymn · G major · 3/4 · Beginner" (§7: static metadata is
   never a chip). Children are separated by a middle dot. */
.meta,
.meta-list {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.45em;
  margin: 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.5 var(--sans);
  font-variant-numeric: lining-nums;
}

/* The dot ends the item before it, so a wrapped line never opens with one. */
.meta > :not(:last-child)::after,
.meta-list > :not(:last-child)::after {
  content: "·";
  margin-left: 0.45em;
  color: var(--line-strong);
}

.meta cite,
.meta-list cite {
  color: var(--ink-soft);
  font-family: var(--serif);
}

/* The lede: one serif line under the H1 (§4). */
.page-heading > p:not(.label),
.lede {
  max-width: var(--measure);
  margin: 0;
  color: var(--ink-soft);
  font: 400 var(--step-1)/1.55 var(--serif);
}

/* Prose (§4): serif reading text at the measure, left-aligned, with
   oldstyle figures; section heads open on an ink rule. */
.prose {
  max-width: var(--measure);
  font: 400 var(--step-1)/1.55 var(--serif);
  font-variant-numeric: oldstyle-nums proportional-nums;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 var(--space-4);
}

.prose h2 {
  margin: var(--space-7) 0 var(--space-3);
  border-top: 1px solid var(--ink);
  padding-top: var(--space-3);
}

.prose h3 {
  margin: var(--space-6) 0 var(--space-2);
}

.prose li + li {
  margin-top: var(--space-2);
}

/* -- layout (§5): one container for header, main and footer ----------------- */
.page,
.page-narrow {
  width: 100%;
}

/* No centred narrow column: a narrow page sits on the container's left
   edge with the brand and the H1. */
.page-narrow {
  max-width: 46rem;
}

#main-content {
  min-height: calc(100vh - var(--header-height));
  padding: var(--space-7) max(var(--gutter), calc((100% - var(--page-max)) / 2)) var(--space-8);
}

/* The home page ends where its content does: the footer follows it rather
   than leaving a screen of blank paper above itself. */
#main-content:has(> .home) {
  min-height: 0;
}

#main-content:focus {
  outline: none;
}

.page-heading {
  margin-bottom: var(--space-6);
}

.page-heading h1 {
  margin-bottom: var(--space-2);
}

.section {
  margin-top: var(--section-gap);
}

/* A major section opens on a 1px ink rule with its label or H2 (§5). */
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  margin-bottom: var(--space-5);
  border-top: 1px solid var(--ink);
  padding-top: var(--space-3);
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.section-heading .label {
  margin: 0;
}

.button-row,
.dialog-actions,
.toolbar,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* a labelled field beside its button: one bottom edge (§7 input groups) */
.inline-actions:has(> .field),
.button-row:has(> .field) {
  align-items: flex-end;
}

/* .panel is a section, not a box: an ink rule and a head (§7). */
.panel {
  border-top: 1px solid var(--ink);
  padding-top: var(--space-4);
}

.panel > h2,
.panel > header h2 {
  font-size: var(--step-2);
}

/* .card: a hairline-framed surface for one-off grouped content. */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--space-5);
}

:is(.card, .panel) > :last-child {
  margin-bottom: 0;
}

/* A row whose first link is stretched over it; its other controls sit above
   the stretched link. No lift, no shadow on hover (§5). */
.linked-card {
  position: relative;
  transition: border-color var(--ease), background-color var(--ease);
}

.linked-card:hover {
  border-color: var(--line-strong);
}

.linked-card > a:first-child::after {
  content: "";
  position: absolute;
  inset: 0;
}

.linked-card :is(button, select, input) {
  position: relative;
  z-index: 2;
}

/* -- header (§7) ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.header-inner {
  width: min(100% - 2 * var(--gutter), var(--page-max));
  height: var(--header-height);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

/* The mark: ink bracket and staff, one rubric notehead (§6). */
.brand-mark {
  --mark-note: var(--accent);
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--ink);
}

.wordmark {
  font: 600 1.375rem/1 var(--serif);
  font-variation-settings: "opsz" 36;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.primary-nav {
  align-self: stretch;
  display: flex;
  gap: var(--space-5);
  min-width: 0;
}

.primary-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-inline: -0.25rem;
  padding-inline: 0.25rem;
  color: var(--ink-soft);
  font: 500 var(--ui)/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
}

.primary-nav a:hover {
  color: var(--ink);
}

/* "You are here": ink at 600 on a straight rubric rule that sits on the
   header's own rule. No pill, no fill. */
.primary-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.primary-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 0.25rem;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

/* The links run the header's full height from its top edge: an outward
   ring would leave the viewport, so it is drawn inside the link, clear of
   the letters (0.25rem padding), at every width. */
.primary-nav a:focus-visible {
  outline-offset: -4px;
}

/* The narrow screens' nav strip rests with its current item whole
   (revealNavItem, dom.mjs): --nav-tail is room after the last link. */
.primary-nav::after {
  content: "";
  flex: none;
  width: var(--nav-tail, 0px);
}

.header-actions {
  flex: none;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Search is the main act: a visible field from 64rem up (§7). */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: var(--space-2);
}

.header-search .icon {
  position: absolute;
  left: 0.625rem;
  color: var(--muted);
  pointer-events: none;
}

.header-search input[type="search"] {
  width: 15rem;
  min-height: 2.25rem;
  height: 2.25rem;
  padding: 0 3.5rem 0 2.25rem;
  font-size: var(--step--1);
}

.header-search kbd {
  position: absolute;
  right: 0.5rem;
  pointer-events: none;
}

.header-search input:focus ~ kbd,
.header-search input:not(:placeholder-shown) ~ kbd {
  visibility: hidden;
}

.icon-button.header-search-link {
  display: none;
}

.account-link,
.premium-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  max-width: 14rem;
  border-radius: var(--radius-small);
  padding: 0 var(--space-3);
  color: var(--ink);
  font: 500 var(--ui)/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--ease), color var(--ease);
}

.account-link:hover,
.premium-link:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.premium-link[aria-current="page"] {
  font-weight: 600;
}

.account-link [data-account-label] {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A ghost icon button: 40px (44px on phones), the label on the control. */
.icon-button {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--control-h);
  height: var(--control-h);
  min-height: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  background: transparent;
  padding: 0;
  color: var(--ink-soft);
  font: 500 var(--step-1)/1 var(--sans);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease);
}

.icon-button:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.icon-button[aria-pressed="true"] {
  border-color: var(--field-line);
  background: var(--paper-deep);
  color: var(--ink);
}

/* the header's theme switch is a toggle for assistive tech; its picture
   already says which theme it switches to, so it stays a ghost */
.site-header .icon-button[aria-pressed] {
  border-color: transparent;
  background: transparent;
}

.site-header .icon-button[aria-pressed]:hover {
  background: var(--paper-deep);
}

/* -- route progress and loading ------------------------------------------------ */
.route-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: width 180ms ease, opacity 180ms ease;
}

.route-progress.loading {
  width: 70%;
  opacity: 1;
}

.route-progress.done {
  width: 100%;
  opacity: 0;
}

.route-loading {
  min-height: 14rem;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--muted);
  font: 400 var(--step-0)/1.5 var(--sans);
}

.loader {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* -- empty states (§7) ----------------------------------------------------------- */
/* Inline: one serif sentence with an inline link, no card. */
.empty-inline {
  margin: 0;
  color: var(--ink-soft);
  font: 400 var(--step-0)/1.5 var(--serif);
}

/* Block (a whole page or region): serif title, one sentence, at most one
   button, left-aligned above a hairline. Error and 404 take a bigger title. */
.empty-state,
.error-state {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: var(--space-3);
  max-width: var(--measure);
  border-top: 1px solid var(--line);
  padding-top: var(--space-5);
  color: var(--ink-soft);
  text-align: left;
}

.empty-state :is(h1, h2, h3) {
  margin: 0;
  font-size: var(--step-2);
  line-height: 1.25;
}

.error-state h1 {
  margin: 0;
  font-size: var(--step-4);
}

/* The rule divides an empty state from content above it. Directly under
   the page heading, the tab baseline or nothing at all, it would be a
   second hairline with nothing to divide. */
.page-heading + .empty-state,
.instrument-tabs + .empty-state,
.page-narrow > .empty-state:first-child,
#main-content > .error-state:first-child {
  border-top: 0;
  padding-top: 0;
}

.empty-state p:not(.label),
.error-state p:not(.label) {
  margin: 0;
  font: 400 var(--step-0)/1.5 var(--serif);
}

.empty-state > .label,
.error-state > .label {
  margin: 0;
}

/* -- buttons (§7) ---------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-small);
  background: var(--surface);
  padding: 0 var(--space-4);
  color: var(--ink);
  font: 500 var(--ui)/1.2 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}

.button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.button .icon {
  width: 1rem;
  height: 1rem;
}

/* Primary is ink, never accent (§3.3). */
.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}

.button.primary:hover {
  border-color: var(--ink-soft);
  background: var(--ink-soft);
  color: var(--on-ink);
}

.button.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}

.button.quiet:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.button.danger:hover {
  background: var(--accent-soft);
  color: var(--danger);
}

.button.block {
  width: 100%;
}

/* A pressed toggle (Save, count-in): neutral, never the verified green. */
.button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--paper-deep);
  color: var(--ink);
}

/* Disabled by colour, never opacity, so the focus ring survives (§7). */
.button[aria-disabled="true"],
.button:disabled {
  border-color: color-mix(in srgb, var(--field-line) 45%, var(--paper));
  background: var(--paper);
  color: color-mix(in srgb, var(--ink) 45%, var(--paper));
  cursor: default;
}

.button.primary[aria-disabled="true"],
.button.primary:disabled {
  border-color: color-mix(in srgb, var(--ink) 45%, var(--paper));
  background: color-mix(in srgb, var(--ink) 45%, var(--paper));
  color: var(--on-ink);
}

/* A button that reads as a link (the dialog's mode switch). */
.link-button {
  min-height: 0;
  border: 0;
  background: none;
  padding: 0;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.link-button:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* The favourite heart: a ghost icon button at the row end, above the
   row's stretched link (§7 index table). */
.favorite-button {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: var(--control-h);
  height: var(--control-h);
  min-height: 0;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  padding: 0;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease);
}

.favorite-button:hover {
  background: var(--paper-deep);
  color: var(--accent);
}

.favorite-button[aria-pressed="true"] {
  color: var(--accent);
}

/* -- fields (§7) ----------------------------------------------------------------- */
.field {
  display: grid;
  gap: 0.375rem;
  align-content: start;
}

.field > label,
.field-label {
  color: var(--ink-soft);
  font: 500 var(--step--1)/1.3 var(--sans);
}

.hint,
.field-hint {
  margin: 0;
  color: var(--muted);
  font: 400 var(--step--2)/1.45 var(--sans);
}

input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="hidden"], [type="image"], [type="submit"], [type="button"], [type="reset"]),
select,
textarea {
  width: 100%;
  min-height: var(--control-h);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-small);
  background-color: var(--surface);
  padding: 0.5rem 0.75rem;
  color: var(--ink);
  font: 400 var(--step-0)/1.4 var(--sans);
  transition: border-color var(--ease);
}

select {
  appearance: none;
  background-image: var(--select-chevron);
  background-position: right 0.6rem center;
  background-repeat: no-repeat;
  background-size: 1.1rem;
  padding-right: 2.25rem;
  cursor: pointer;
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
  font: 400 var(--step-1)/1.5 var(--serif);
}

input:not([type="checkbox"], [type="radio"]):hover,
select:hover,
textarea:hover {
  border-color: var(--ink-soft);
}

/* Fields: an ink edge plus the ring at a 1px offset (§7). */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--ink);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.15rem 0 0;
  accent-color: var(--ink);
}

/* The whole label is the target. */
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--ink-soft);
  font: 400 var(--step--1)/1.45 var(--sans);
  cursor: pointer;
}

.field.has-error :is(input, select, textarea),
[aria-invalid="true"] {
  border-color: var(--danger);
}

/* A search box: a leading 20px icon. */
.search-field {
  position: relative;
}

.search-field > .icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-field input[type="search"],
.search-field input[type="text"] {
  padding-left: 2.5rem;
}

/* Input plus button on one height and baseline. */
.input-group {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
}

.input-group > :is(input, select) {
  flex: 1 1 auto;
  min-width: 0;
}

.input-group > .button {
  flex: none;
}

.form-error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0;
  color: var(--danger);
  font: 500 var(--step--1)/1.45 var(--sans);
}

.form-error::before {
  content: "";
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.4 4.6L3.2 17.3a1.85 1.85 0 0 0 1.6 2.7h14.4a1.85 1.85 0 0 0 1.6-2.7L13.6 4.6a1.85 1.85 0 0 0-3.2 0z'/%3E%3Cpath d='M12 9.5v4'/%3E%3Cpath d='M12 16.75h.01' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.4 4.6L3.2 17.3a1.85 1.85 0 0 0 1.6 2.7h14.4a1.85 1.85 0 0 0 1.6-2.7L13.6 4.6a1.85 1.85 0 0 0-3.2 0z'/%3E%3Cpath d='M12 9.5v4'/%3E%3Cpath d='M12 16.75h.01' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.form-error:empty {
  display: none;
}

/* -- chips (§7): interactive only, square-cornered ------------------------------- */
.chips,
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-chips {
  margin: 0 0 var(--space-5);
}

.chip,
.filter-chip,
.layer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-small);
  background: var(--surface);
  padding: 0 0.75rem;
  color: var(--ink-soft);
  font: 500 var(--step--1)/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}

.chip:hover,
.filter-chip:hover,
.layer-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* the count slot */
.chip .count,
.filter-chip > span {
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
}

/* Selected filter or choice: an ink fill (§3.3). */
.chip[aria-current="true"],
.chip[aria-pressed="true"]:not(.is-toggle),
.layer-chip[aria-pressed="true"]:not(.is-toggle),
.filter-chip[aria-current="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}

.chip[aria-current="true"] .count,
.chip[aria-pressed="true"]:not(.is-toggle) .count,
.layer-chip[aria-pressed="true"]:not(.is-toggle) .count,
.filter-chip[aria-current="true"] > span {
  color: color-mix(in srgb, var(--on-ink) 78%, var(--ink));
}

/* On/off toggle (sheet layers): a 14px tick box; on is a filled tick and an
   ink edge, with no fill change on the chip. */
.chip.is-toggle::before {
  content: "";
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  border: 1px solid var(--field-line);
  border-radius: 2px;
  background: var(--surface);
}

.chip.is-toggle[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--surface);
  color: var(--ink);
}

.chip.is-toggle[aria-pressed="true"]::before {
  border-color: var(--ink);
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7.2'/%3E%3C/svg%3E") center / 0.7rem no-repeat;
}

:root[data-theme="dark"] .chip.is-toggle[aria-pressed="true"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121211' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7.2'/%3E%3C/svg%3E");
}

/* Locked (only while Premium is on sale): dashed edge, muted text, a
   trailing line lock. */
.chip[aria-disabled="true"],
.layer-chip[aria-disabled="true"] {
  border-style: dashed;
  color: var(--muted);
  cursor: default;
}

.chip[aria-disabled="true"]::after,
.layer-chip[aria-disabled="true"]::after {
  content: "";
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='10' rx='2'/%3E%3Cpath d='M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='10' rx='2'/%3E%3Cpath d='M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* -- segmented (§7): one choice of a few -------------------------------------------- */
.segmented {
  display: inline-flex;
  flex: none;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.segmented > :is(button, a, span, label) {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0 0.75rem;
  color: var(--ink-soft);
  font: 500 var(--step--1)/1 var(--sans);
  font-variant-numeric: lining-nums;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease);
}

.segmented > :first-child {
  border-left: 0;
  border-radius: 2px 0 0 2px;
}

.segmented > :last-child {
  border-radius: 0 2px 2px 0;
}

.segmented > :is(button, a, label):hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.segmented > :focus-visible {
  z-index: 1;
}

.segmented > [aria-pressed="true"],
.segmented > [aria-checked="true"],
.segmented > [aria-current="page"],
.segmented > [aria-current="true"] {
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
}

/* the key stepper's value cell: [- | G | +] */
.segmented > .value {
  min-width: 2.75rem;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  cursor: default;
}

/* -- tabs (§7): instrument tabs, review sub-nav -------------------------------------- */
.tabs,
.instrument-tabs {
  display: flex;
  gap: var(--space-5);
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: inset 0 -1px var(--line);
}

.tabs::-webkit-scrollbar,
.instrument-tabs::-webkit-scrollbar {
  display: none;
}

.tabs > :is(a, button),
.instrument-tabs a {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  border: 0;
  background: none;
  padding: 0;
  color: var(--ink-soft);
  font: 500 var(--step-0)/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.tabs > :is(a, button):hover,
.instrument-tabs a:hover {
  color: var(--ink);
}

.tabs > [aria-current="page"],
.tabs > [aria-selected="true"],
.instrument-tabs a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.tabs > [aria-current="page"]::after,
.tabs > [aria-selected="true"]::after,
.instrument-tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

.tabs > :focus-visible,
.instrument-tabs a:focus-visible {
  outline-offset: -2px;
}

/* the optional qualifier ("in D", "not yet") */
.tab-note {
  color: var(--muted);
  font: 400 var(--step--1)/1 var(--sans);
}

.tabs .is-unavailable,
.instrument-tabs .is-unavailable {
  color: var(--muted);
}

/* -- status (§7): a shape, a word, one colour per job ------------------------------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font: 500 var(--step--1)/1.2 var(--sans);
  white-space: nowrap;
}

.status .icon {
  width: 1rem;
  height: 1rem;
}

.status.is-verified {
  color: var(--evergreen);
}

.status.is-progress {
  color: var(--brass);
}

.status.is-neutral {
  color: var(--muted);
}

.status.is-error {
  color: var(--danger);
}

.status.boxed {
  border-radius: 2px;
  background: var(--surface-soft);
  padding: 0.3rem 0.55rem;
}

.status.boxed.is-verified {
  background: var(--evergreen-soft);
}

.status.boxed.is-progress {
  background: var(--warning-bg);
}

.status.boxed.is-error {
  background: var(--accent-soft);
}

/* Older badges read as quiet meta text until their pages move to .status
   and meta lines; a level is neutral, never the verified green (§3.3).
   The status-badge pill is deleted (§10): status is .status. */
.badge,
.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 2px;
  background: var(--surface-soft);
  padding: 0.15rem 0.45rem;
  color: var(--ink-soft);
  font: 500 var(--step--2)/1.3 var(--sans);
  font-variant-numeric: lining-nums;
}

.premium-badge {
  background: var(--paper-deep);
  color: var(--ink);
}

.badge.beginner,
.badge.intermediate,
.badge.advanced {
  background: transparent;
  padding-inline: 0;
  color: var(--muted);
}

/* -- notice (§7): one per region, an icon, no stripe ------------------------------- */
.notice {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  color: var(--ink-soft);
  font: 400 var(--step--1)/1.5 var(--sans);
}

.notice::before {
  content: "";
  position: absolute;
  top: 0.8rem;
  left: 0.875rem;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.25'/%3E%3Cpath d='M12 11v5.25'/%3E%3Cpath d='M12 7.75h.01' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.25'/%3E%3Cpath d='M12 11v5.25'/%3E%3Cpath d='M12 7.75h.01' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.notice.warning,
.notice.error {
  border-color: color-mix(in srgb, var(--warning-line) 55%, transparent);
  background: var(--warning-bg);
}

.notice.warning::before,
.notice.error::before {
  background: var(--brass);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.4 4.6L3.2 17.3a1.85 1.85 0 0 0 1.6 2.7h14.4a1.85 1.85 0 0 0 1.6-2.7L13.6 4.6a1.85 1.85 0 0 0-3.2 0z'/%3E%3Cpath d='M12 9.5v4'/%3E%3Cpath d='M12 16.75h.01' stroke-width='2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.4 4.6L3.2 17.3a1.85 1.85 0 0 0 1.6 2.7h14.4a1.85 1.85 0 0 0 1.6-2.7L13.6 4.6a1.85 1.85 0 0 0-3.2 0z'/%3E%3Cpath d='M12 9.5v4'/%3E%3Cpath d='M12 16.75h.01' stroke-width='2'/%3E%3C/svg%3E");
}

.notice.error {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--accent-soft);
  color: var(--danger);
}

.notice.error::before {
  background: var(--danger);
}

.notice.success {
  border-color: color-mix(in srgb, var(--evergreen) 35%, transparent);
  background: var(--success-bg);
}

.notice.success::before {
  background: var(--evergreen);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.25'/%3E%3Cpath d='M8.25 12.25l2.6 2.6 5-5.35'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.25'/%3E%3Cpath d='M8.25 12.25l2.6 2.6 5-5.35'/%3E%3C/svg%3E");
}

.notice a {
  color: inherit;
}

/* -- breadcrumbs and pagination -------------------------------------------------------- */
.breadcrumbs {
  margin-bottom: var(--space-3);
  color: var(--muted);
  font: 400 var(--step--1)/1.4 var(--sans);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs a {
  color: var(--ink-soft);
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.4rem;
  color: var(--line-strong);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-6);
  color: var(--ink-soft);
  font: 500 var(--step--1)/1 var(--sans);
  font-variant-numeric: lining-nums tabular-nums;
}

.pagination > a:not(.button),
.pagination > span {
  display: inline-grid;
  place-items: center;
  min-width: var(--control-h);
  height: var(--control-h);
  border-radius: var(--radius-small);
  padding: 0 0.6rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.pagination > a:not(.button):hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.pagination [aria-current="page"] {
  background: var(--ink);
  color: var(--on-ink);
}

/* -- index table (§7): the register's lists ------------------------------------------- */
.index-table {
  width: 100%;
  border-collapse: collapse;
}

.index-table th {
  border-bottom: 1px solid var(--ink);
  padding: 0 var(--space-3) var(--space-2) 0;
  color: var(--muted);
  font: 600 var(--step-0)/1.3 var(--serif);
  font-variant-caps: all-small-caps;
  font-synthesis-small-caps: none;
  letter-spacing: 0.05em;
  text-align: left;
  vertical-align: bottom;
}

.index-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.8rem var(--space-3) 0.8rem 0;
  color: var(--ink-soft);
  font: 400 var(--step--1)/1.4 var(--sans);
  font-variant-numeric: lining-nums tabular-nums;
  vertical-align: baseline;
}

.index-table tbody tr {
  position: relative;
}

.index-table tbody tr:hover td {
  background: var(--paper-deep);
}

/* the title cell: serif 600, the link stretched over the row */
.index-table .index-title {
  color: var(--ink);
  font: 600 var(--step-1)/1.3 var(--serif);
}

.index-table .index-title a {
  text-decoration: none;
}

.index-table .index-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.index-table .index-title a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.index-table .index-title .alias {
  margin-left: 0.4rem;
  color: var(--muted);
  font: italic 400 var(--step-0)/1.3 var(--serif);
}

.index-table .index-num {
  font-family: var(--serif);
  white-space: nowrap;
}

.index-table cite {
  color: var(--ink-soft);
  font-family: var(--serif);
}

/* controls in a row sit above its stretched link */
.index-table .index-action {
  width: 2.5rem;
  padding-right: 0;
  text-align: right;
}

.index-table .index-action > * {
  position: relative;
  z-index: 1;
}

/* -- definition list and plain lists ------------------------------------------------- */
.definition-list {
  display: grid;
  grid-template-columns: minmax(6rem, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 0;
  margin: 0;
}

.definition-list dt,
.definition-list dd {
  border-top: 1px solid var(--line);
  padding: 0.45rem 0;
}

.definition-list dt:first-of-type,
.definition-list dt:first-of-type + dd {
  border-top: 0;
}

.definition-list dt {
  padding-right: var(--space-4);
  color: var(--muted);
  font: 400 var(--step--1)/1.4 var(--sans);
}

.definition-list dd {
  margin: 0;
  color: var(--ink);
  font: 400 var(--step-0)/1.4 var(--serif);
  font-variant-numeric: lining-nums;
}

.source-list,
.comment-list,
.simple-list,
.check-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-list li,
.comment,
.simple-list > li {
  border-top: 1px solid var(--line);
  padding: var(--space-3) 0;
}

.source-list li:first-child,
.comment:first-child,
.simple-list > li:first-child {
  border-top: 0;
}

.check-list {
  display: grid;
  gap: var(--space-2);
  margin-block: var(--space-4);
}

.check-list li {
  position: relative;
  padding-left: 1.75rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0;
  width: 1.125rem;
  height: 1.125rem;
  background: var(--ink-soft);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7.2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7.2'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* -- sheet panel (§7): the engraved page is paper, square, unshadowed ------------------ */
.notation-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.notation-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) var(--space-4);
}

.notation-panel > header h2,
.notation-panel > header h3 {
  margin: 0;
  font-size: var(--step-1);
}

/* The sheet itself: the panel is no box; its surface is the paper. */
.notation-panel.sheet-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.sheet-panel .sheet-surface {
  border: 1px solid var(--sheet-edge);
  border-radius: 0;
  background: var(--sheet-paper);
  padding: 2.25rem 2.5rem 1.5rem;
}

/* The server engraves on white: multiply makes that white the paper. */
.sheet-image,
.sheet-frame {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  background: var(--sheet-paper);
}

img.sheet-image,
.sheet-inline > svg {
  mix-blend-mode: multiply;
}

.sheet-frame {
  min-height: 32rem;
  border: 0;
}

.sheet-panel .sheet-image {
  background: transparent;
}

.artifact-attribution {
  margin: 0;
  padding-top: var(--space-2);
  color: var(--muted);
  font: 400 var(--step--1)/1.45 var(--sans);
}

/* -- dialog (§7) ------------------------------------------------------------------------ */
.dialog {
  width: min(100% - 2rem, 26rem);
  max-height: min(90vh, 48rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--space-5);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  overflow: auto;
}

.dialog-wide {
  width: min(100% - 2rem, 36rem);
}

.dialog::backdrop {
  background: rgb(18 18 17 / 45%);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.dialog-heading h2 {
  margin: 0;
  font-size: var(--step-3);
  line-height: 1.2;
}

.dialog-heading p {
  margin-bottom: 0;
}

.dialog-heading .icon-button {
  margin: -0.4rem -0.6rem 0 0;
}

.dialog form {
  display: grid;
  gap: var(--space-4);
}

/* the line under the title: what the dialog is for, in this mode */
.dialog-context {
  margin: calc(-1 * var(--space-2)) 0 0;
  color: var(--ink-soft);
  font: 400 var(--step-0)/1.5 var(--serif);
}

/* the mode switch: one text line under the submit */
.dialog-switch {
  margin: 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.5 var(--sans);
  text-align: center;
}

.dialog-switch .link-button {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h);
  padding-inline: var(--space-1);
}

/* the register-mode password hint */
.field-hint {
  margin: 0;
  color: var(--muted);
  font: 400 var(--step--2)/1.45 var(--sans);
}

/* Below 40rem a dialog is a bottom sheet. */
@media (max-width: 40rem) {
  .dialog,
  .dialog-wide {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: var(--space-5) var(--gutter) max(var(--space-5), env(safe-area-inset-bottom));
  }
}

/* -- toast -------------------------------------------------------------------------------- */
.toast {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 80;
  max-width: min(26rem, calc(100vw - 2rem));
  border-radius: var(--radius);
  background: var(--ink);
  padding: var(--space-3) var(--space-4);
  color: var(--on-ink);
  font: 400 var(--step--1)/1.45 var(--sans);
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.toast.show {
  opacity: 1;
}

/* -- footer (§7) -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--ink);
  background: var(--paper);
}

.footer-inner {
  width: min(100% - 2 * var(--gutter), var(--page-max));
  margin-inline: auto;
  padding: var(--space-6) 0 var(--space-7);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  text-decoration: none;
}

.footer-brand:hover {
  color: var(--ink);
}

.footer-brand .wordmark {
  font-size: var(--step-2);
}

.footer-tagline {
  margin: var(--space-3) 0 0;
  color: var(--ink-soft);
  font: italic 400 var(--step-1)/1.4 var(--serif);
}

.footer-blurb {
  max-width: 26rem;
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.5 var(--sans);
}

.footer-grid nav {
  display: grid;
  align-content: start;
}

.footer-grid nav .label {
  margin-bottom: var(--space-1);
}

.footer-grid nav a {
  justify-self: start;
  padding: 0.35rem 0;
  color: var(--ink-soft);
  font: 400 var(--step--1)/1.3 var(--sans);
  text-decoration: none;
}

.footer-grid nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.footer-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-6);
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
  color: var(--muted);
  font: 400 var(--step--2)/1.5 var(--sans);
}

.footer-note p {
  max-width: 34rem;
  margin: 0;
}

.footer-note .colophon {
  font: italic 400 var(--step--1)/1.5 var(--serif);
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  background: var(--paper);
  padding: var(--space-6);
}

/* -- global responsive layer ----------------------------------------------------------- */
/* 64rem: the header search becomes an icon; a signed-in name becomes the
   user icon, so a staff header (one more link) still fits on one row. */
@media (max-width: 64rem) {
  .header-inner {
    gap: var(--space-4);
  }

  .primary-nav {
    gap: var(--space-4);
  }

  .header-search {
    display: none;
  }

  .icon-button.header-search-link {
    display: inline-grid;
  }

  .account-link {
    width: var(--control-h);
    justify-content: center;
    padding: 0;
  }

  .account-link [data-account-label] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

/* 48rem: two rows. Row 1 (56px) is the mark and the whole wordmark, then
   44px search, theme and account buttons; row 2 (44px) is the four nav
   items as full-width tabs. Labels go to sr-only, never display:none. */
@media (max-width: 48rem) {
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 0;
  }

  .brand {
    height: 3.5rem;
    margin-right: auto;
  }

  .brand-mark {
    width: 1.625rem;
    height: 1.625rem;
  }

  .wordmark {
    font-size: var(--step-2);
  }

  .header-actions {
    gap: 0;
    margin-right: -0.375rem;
  }

  .primary-nav {
    order: 3;
    flex: 1 0 100%;
    align-self: auto;
    height: calc(2.75rem + 1px);
    gap: 0;
    margin-inline: calc(-1 * var(--gutter));
    border-top: 1px solid var(--line);
    padding-inline: calc(var(--gutter) - 0.5rem);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .primary-nav a {
    flex: 1 0 auto;
    justify-content: center;
    margin-inline: 0;
    padding-inline: 0.5rem;
  }

  .primary-nav a[aria-current="page"]::after {
    inset-inline: 0.5rem;
    bottom: 0;
  }


  .chip,
  .filter-chip,
  .layer-chip,
  .segmented > :is(button, a, span, label) {
    min-height: 2.75rem;
    min-width: 2.75rem;
  }

  .chip,
  .filter-chip,
  .layer-chip {
    padding-inline: 0.9rem;
  }

  .breadcrumbs a,
  .footer-grid nav a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding-block: 0;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
  }

  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }

  .sheet-panel .sheet-surface {
    margin-inline: calc(-1 * var(--gutter) + 0.5rem);
    padding: 1.25rem 0.75rem;
  }

  /* The tune index folds its cells into the title's meta line. Other index
     tables (collections, moderation) keep the columns that carry their facts
     and controls. */
  .tune-index thead {
    display: none;
  }

  .tune-index td {
    display: none;
  }

  .tune-index :is(td.index-title, td.index-action, td.index-mobile) {
    display: table-cell;
  }

  .admin-table .admin-member {
    display: none;
  }

  #main-content {
    padding-top: var(--space-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .primary-nav a[aria-current="page"]::after,
  .tabs > [aria-current="page"]::after,
  .instrument-tabs a[aria-current="page"]::after {
    background: Highlight;
  }

  .notice::before,
  .form-error::before,
  .check-list li::before,
  .chip[aria-disabled="true"]::after,
  .layer-chip[aria-disabled="true"]::after {
    background: CanvasText;
  }

  .chip.is-toggle[aria-pressed="true"]::before {
    background: Highlight;
    forced-color-adjust: none;
  }
}

/* ==== end of the global layer ==========================================================
   Everything below is page- or area-specific. It draws with the tokens and
   primitives above (.button, .field, .chip, .segmented, .tabs, .status,
   .notice, .empty-state, .dialog, .index-table, .sheet-panel, .label, .meta,
   .num, .prose, .panel) and must not redefine them. */

/* ==== public pages (visual-design-system.md §8) =========================================
   Home, the tunes index, a tune and its arrangements, collections, the
   account and staff pages. Page code only: it composes the primitives above
   and adds the page-specific pieces (the plate, the instrument row, the A-Z
   rail, the rubric index initials, the apparatus). */

/* -- shared: a heading's live count, the compact tune head -------------------------------- */
.heading-count {
  margin-left: 0.35em;
  color: var(--muted);
  font: 400 var(--step-2)/1 var(--serif);
  letter-spacing: 0;
  white-space: nowrap;
}

.tune-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
  margin-bottom: var(--space-5);
}

.tune-head-text {
  flex: 1 1 28rem;
  min-width: 0;
}

.tune-head h1 {
  margin: 0 0 var(--space-2);
  font-size: var(--step-4);
  line-height: 1.15;
  letter-spacing: -0.008em;
}

.tune-head h1 .alias {
  margin-left: 0.3em;
  color: var(--muted);
  font: italic 400 var(--step-2)/1 var(--serif);
  letter-spacing: 0;
}

.tune-meta {
  margin: 0;
  color: var(--muted);
  font: 400 var(--step-0)/1.5 var(--sans);
  font-variant-numeric: lining-nums;
}

.tune-meta cite {
  color: var(--ink-soft);
  font-family: var(--serif);
}

.tune-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.tune-head-actions .button .icon {
  width: 1rem;
  height: 1rem;
}

.tunebook-add select {
  min-width: 12rem;
}

.tune-lede {
  margin: calc(-1 * var(--space-2)) 0 var(--space-5);
}

.instrument-tabs {
  margin-bottom: var(--space-5);
}

/* -- home: the display line, the search, Plate 1, the instrument row --------------------- */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-7);
  align-items: start;
}

.home-display {
  margin: 0 0 var(--space-5);
  font: 500 var(--step-6)/1.02 var(--serif);
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.022em;
}

.home-intro .lede {
  margin: 0 0 var(--space-6);
  text-wrap: pretty;
}

.home-search {
  display: flex;
  gap: var(--space-2);
  max-width: 30rem;
}

.home-search .search-field {
  flex: 1 1 auto;
  min-width: 0;
}

.home-search input[type="search"] {
  height: 3rem;
}

.home-search .button {
  min-height: 3rem;
  padding-inline: var(--space-5);
}

.home-try {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.6 var(--sans);
}

.home-try a {
  color: var(--ink-soft);
}

.home-aside {
  display: grid;
  gap: var(--space-5);
  padding-top: var(--space-3);
}

/* Plate 1: an excerpt of the engraver's own sheet on its paper, with
   printer's crop marks and small-caps layer labels in the margin. The paper
   does not invert in dark, so the labels use the on-paper ink. */
.plate {
  --plate-muted: #5c5850;
  margin: 0;
}

.plate-paper {
  position: relative;
  border: 1px solid var(--sheet-edge);
  background: var(--sheet-paper);
  padding: var(--space-5) var(--space-5) var(--space-5) 7.25rem;
}

/* Printer's crop marks: 12px ticks on the lines of the trim, standing 6px
   off the paper's corner (the paper's outer edge is 18px into this box). */
.plate-crop {
  --crop-tick: 12px;
  --crop-edge: calc(var(--crop-tick) + 6px);
  position: absolute;
  inset: calc(-1px - var(--crop-edge));
  pointer-events: none;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) left 0 top var(--crop-edge) / var(--crop-tick) 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) left var(--crop-edge) top 0 / 1px var(--crop-tick) no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) right 0 top var(--crop-edge) / var(--crop-tick) 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) right var(--crop-edge) top 0 / 1px var(--crop-tick) no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) left 0 bottom var(--crop-edge) / var(--crop-tick) 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) left var(--crop-edge) bottom 0 / 1px var(--crop-tick) no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) right 0 bottom var(--crop-edge) / var(--crop-tick) 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) right var(--crop-edge) bottom 0 / 1px var(--crop-tick) no-repeat;
}

/* the gutter is 16px on a phone: shorter ticks, still 6px off the paper */
@media (max-width: 48rem) {
  .plate-crop {
    --crop-tick: 8px;
  }
}

/* The paper never darkens, so a ring in the site's dark --focus (salmon,
   1.8:1 on this paper) would vanish: on paper the ring is the on-paper
   rubric (6.0:1 on the dark theme's #f1ece1, 7.0:1 on light). */
.plate-paper :focus-visible,
.tune-preview :focus-visible {
  outline-color: #a62a1b;
}

.plate-labels {
  position: absolute;
  top: var(--space-5);
  bottom: var(--space-5);
  left: var(--space-5);
  width: 6rem;
}

.plate-labels span {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  color: var(--plate-muted);
  font: 600 var(--step--1)/1 var(--serif);
  font-variant-caps: all-small-caps;
  font-synthesis-small-caps: none;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.plate-excerpt {
  display: block;
  min-height: 6rem;
}

/* Once drawn, the excerpt is its picture's own height, so the margin labels
   (placed as fractions of it) sit on their bands at every width. */
.plate.is-drawn .plate-excerpt {
  min-height: 0;
}

.plate-excerpt svg,
.tune-preview-sheet svg {
  mix-blend-mode: multiply;
}

.plate figcaption {
  margin-top: var(--space-3);
  padding-left: 7.25rem;
  color: var(--ink-soft);
  font: italic 400 var(--step--1)/1.5 var(--serif);
}

.plate-number {
  margin-right: 0.35em;
  color: var(--ink);
  font-style: normal;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  font-synthesis-small-caps: none;
  letter-spacing: 0.06em;
}

.plate figcaption cite {
  font-style: italic;
}

.home-register {
  max-width: var(--measure);
  margin: 0;
  color: var(--ink-soft);
  font: 400 var(--step-0)/1.55 var(--serif);
}

.home-instruments {
  border-top: 1px solid var(--ink);
  padding-top: var(--space-3);
}

.home-instruments > .label {
  margin-bottom: var(--space-3);
}

.instrument-row {
  display: grid;
  grid-template-columns: repeat(var(--instrument-count, 5), minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.instrument-row li + li {
  border-left: 1px solid var(--line);
}

.instrument-row a,
.instrument-row .is-empty {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-4) var(--space-4) var(--space-5);
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--ease);
}

.instrument-row li:first-child :is(a, .is-empty) {
  padding-left: 0;
}

.instrument-row a:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.instrument-row li:first-child a:hover {
  padding-left: var(--space-4);
}

/* The notation samples share one 40px band, bottoms on one line. */
.instrument-sample {
  display: block;
  width: auto;
  height: 2.5rem;
  margin-bottom: var(--space-2);
  color: var(--ink-soft);
}

.instrument-pending {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.5 var(--sans);
}

.home-index {
  border-top: 1px solid var(--ink);
  padding-top: var(--space-3);
}

.home-index .section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-2);
}

.home-index .section-heading a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--ink-soft);
  font: 500 var(--step--1)/1.3 var(--sans);
}

.instrument-name {
  font: 600 var(--ui)/1.25 var(--sans);
}

.instrument-count {
  color: var(--muted);
  font: 400 var(--step--1)/1.3 var(--sans);
}


/* -- the tunes index: toolbar, A-Z rail, result line --------------------------------------- */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-4);
}

.catalog-toolbar .field {
  flex: 0 1 11rem;
  margin: 0;
}

.catalog-toolbar .catalog-search {
  flex: 1 1 18rem;
}

/* No-JS submit: the selects apply on change and Enter submits the search, so
   the button is only for a keyboard user who tabs to it. */
.catalog-submit:not(:focus-visible) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.catalog-view {
  margin-left: auto;
}

.catalog-view > a {
  min-height: calc(var(--control-h) - 2px);
}

.az-rail ol {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.az-rail a,
.az-rail .az-empty {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: var(--radius-small);
  padding: 0 0.3rem;
  color: var(--ink-soft);
  font: 500 var(--step--1)/1 var(--sans);
  text-decoration: none;
}

.az-rail a:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.az-rail a[aria-current="true"] {
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
}

/* inert: there is no tune under this letter. Readable (--muted, 5.7:1),
   set lighter than the live letters; the words "no tunes" are in the
   accessible text (app.mjs). */
.az-rail .az-empty {
  position: relative; /* holds its sr-only words inside the scrolling rail */
  color: var(--muted);
  font-weight: 400;
  cursor: default;
}

.catalog-result {
  margin: var(--space-4) 0 var(--space-3);
}

.catalog-result a {
  color: var(--ink-soft);
}

.catalog-empty {
  margin-top: var(--space-5);
}

.pagination-pages {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}

.pagination-pages > a,
.pagination-pages > span {
  display: inline-grid;
  place-items: center;
  min-width: var(--control-h);
  height: var(--control-h);
  border-radius: var(--radius-small);
  padding: 0 0.6rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.pagination-pages > a:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.pagination-pages > [aria-current="page"] {
  background: var(--ink);
  color: var(--on-ink);
}

.pagination-pages > .pagination-label {
  min-width: 0;
  color: var(--muted);
}

.pagination-pages > .pagination-of {
  display: none;
  white-space: nowrap;
}

.pagination .pagination-step:last-child {
  margin-left: auto;
}

.pagination .pagination-step .icon {
  width: 1rem;
  height: 1rem;
}

/* -- the register's table: rubric initials, folded rows on narrow screens ----------------- */
.tune-index th.index-initial,
.tune-index td.index-initial {
  width: 4rem;
  padding-right: var(--space-3);
}

.tune-index td.index-initial {
  border-bottom-color: transparent;
  color: var(--accent);
  font: 500 var(--step-4)/0.75 var(--serif);
  font-variant-numeric: lining-nums;
}

/* the figures group reads "0–9", as the A-Z rail labels it (never a "#",
   which beside a Key column reads as a sharp) */
.tune-index td.index-initial .index-figures {
  font-size: var(--step-2);
  white-space: nowrap;
}

.tune-index tbody tr:hover td.index-initial {
  background: transparent;
}

.tune-index tr.index-group-start:not(:first-child) td:not(.index-initial) {
  padding-top: var(--space-5);
}

.tune-index .index-title a {
  color: var(--ink);
}

.tune-index .index-sub {
  display: none;
}

.tune-index :is(.index-key, .index-meter) {
  width: 5.5rem;
  white-space: nowrap;
}

.tune-index .index-instruments {
  color: var(--muted);
  white-space: nowrap;
}

.tune-index th.index-instruments {
  width: 17.5rem;
}

.tune-index .index-action .favorite-button {
  width: var(--control-h);
  height: var(--control-h);
  margin-block: -0.5rem;
}

/* -- cards view: the incipit on its paper, the title, one meta line ------------------------ */
.tune-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: var(--space-6) var(--space-5);
}

.tune-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  align-items: start;
}

/* The title anchor stretches over the whole card, so clicking anywhere
   opens the tune; the heart sits in the card's flow above it. */
.tune-card .card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.tune-card .favorite-button {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 2;
  margin: var(--space-2) 0 0 var(--space-2);
}

.tune-card-media {
  grid-column: 1 / -1;
  aspect-ratio: 5 / 2;
  border: 1px solid var(--sheet-edge);
  background: var(--sheet-paper);
  overflow: hidden;
}

.card-sheet {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
  background: var(--sheet-paper);
  mix-blend-mode: multiply;
}

/* No sheet to show: a faint five-line staff, never a white slab. */
.card-sheet-placeholder {
  height: 100%;
  background:
    repeating-linear-gradient(180deg, var(--line-strong) 0 1px, transparent 1px 0.5rem) 0 50% / 100% 2.0625rem no-repeat,
    var(--surface-soft);
}

.tune-card-body {
  display: grid;
  gap: var(--space-1);
  padding-top: var(--space-3);
}

.tune-card h2 {
  margin: 0;
  font: 600 var(--step-1)/1.3 var(--serif);
}

.tune-card-meta {
  margin: 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.45 var(--sans);
  font-variant-numeric: lining-nums;
}

.tune-card .card-link {
  color: var(--ink);
  text-decoration: none;
}

.tune-card:hover .card-link {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

/* -- a tune: the sheet preview and the apparatus ------------------------------------------- */
.tune-preview {
  margin: 0 0 var(--space-7);
}

.tune-preview-sheet {
  display: block;
  border: 1px solid var(--sheet-edge);
  background: var(--sheet-paper);
  padding: var(--space-5) var(--space-6);
}

.tune-preview-sheet:hover {
  border-color: var(--line-strong);
}

.tune-preview-sheet:empty {
  min-height: 7rem;
}

.tune-preview figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-2);
  color: var(--muted);
  font: 400 var(--step--1)/1.5 var(--sans);
}

.tune-preview figcaption a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--ink);
  font-weight: 500;
}

.apparatus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-7);
}

.apparatus-grid .apparatus-note {
  border-top: 1px solid var(--ink);
  padding: var(--space-3) 0 var(--space-6);
}

/* The note heads are labels: the book face's small caps. */
.apparatus-note > h2 {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font: 600 var(--step-0)/1.3 var(--serif);
  font-variant-caps: all-small-caps;
  font-variant-numeric: lining-nums;
  font-synthesis-small-caps: none;
  letter-spacing: 0.05em;
}

.apparatus-note .status.boxed {
  white-space: normal;
}

.apparatus-text,
.citation {
  max-width: var(--measure);
  margin: var(--space-3) 0 0;
  color: var(--ink-soft);
  font: 400 var(--step-0)/1.55 var(--serif);
}

.citation {
  margin: 0;
  color: var(--ink);
}

.apparatus-meta {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.5 var(--sans);
}

.apparatus-meta a {
  color: var(--ink-soft);
}

.apparatus-sources li {
  padding-block: 0 var(--space-3);
}

.apparatus-sources li + li {
  padding-top: var(--space-3);
}

.apparatus-more {
  margin-top: var(--space-3);
}

.apparatus-more summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--control-h);
  color: var(--ink-soft);
  font: 500 var(--step--1)/1.3 var(--sans);
  list-style: none;
  cursor: pointer;
}

.apparatus-more summary::-webkit-details-marker {
  display: none;
}

.apparatus-more summary::before {
  content: "";
  width: 1rem;
  height: 1rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 6.5L15 12l-5.5 5.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 6.5L15 12l-5.5 5.5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--ease);
}

.apparatus-more[open] summary::before {
  transform: rotate(90deg);
}

.apparatus-more summary:hover {
  color: var(--ink);
}

.apparatus-more p {
  margin: var(--space-2) 0 0;
  color: var(--ink-soft);
  font: 400 var(--step--1)/1.55 var(--serif);
}

.related-tunes .section-heading a {
  color: var(--ink-soft);
  font: 500 var(--step--1)/1.3 var(--sans);
}

/* -- an arrangement: the sheet as hero, the apparatus beside it ---------------------------- */
/* The overview, an arrangement and the compare view share one header
   (breadcrumb, H1, meta, tabs): it starts at the same height on all three,
   so a tab click never moves it. */
.arrangement-page,
.tune-page,
.review-page {
  margin-top: calc(var(--space-5) - var(--space-7));
}

.arrangement-page .breadcrumbs,
.tune-page .breadcrumbs,
.review-page .breadcrumbs {
  margin-bottom: var(--space-2);
}

.arrangement-page .tune-head,
.review-page .tune-head {
  margin-bottom: var(--space-3);
}

.arrangement-page .instrument-tabs,
.review-page .instrument-tabs {
  margin-bottom: var(--space-3);
}

.review-lede {
  margin-top: var(--space-1);
}

.arrangement-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16.5rem;
  gap: var(--space-7);
  align-items: start;
}

.arrangement-main {
  min-width: 0;
}

.apparatus {
  border-top: 1px solid var(--ink);
}

.apparatus .apparatus-note {
  padding: var(--space-3) 0 var(--space-4);
}

.apparatus .apparatus-note + .apparatus-note {
  border-top: 1px solid var(--line);
}

.apparatus .apparatus-note > h2 {
  margin-bottom: var(--space-2);
}

.apparatus .apparatus-text {
  font-size: var(--step--1);
}

.apparatus .citation {
  font-size: var(--step-0);
  line-height: 1.5;
}

.apparatus .definition-list {
  grid-template-columns: 4.75rem minmax(0, 1fr);
}

.apparatus .definition-list dd {
  font: 400 var(--step--1)/1.4 var(--sans);
}

.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.5 var(--sans);
}

.sheet-foot-files {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.sheet-foot-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5);
}

.sheet-foot a {
  color: var(--ink-soft);
}

.download-item a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.download-item .artifact-attribution {
  display: block;
  padding-top: var(--space-1);
  font-size: var(--step--2);
}

.arrangement-missing {
  margin-top: var(--space-2);
}

.arrangement-missing cite {
  font-style: italic;
}

/* Premium practice settings (only while Premium is on sale). */
.practice-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

/* Premium practice tools (only while Premium is on sale): one plain row. */
.practice-toolbar {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-3);
}

.premium-control .chip-lock,
.layer-chip .chip-lock {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--muted);
}

.notation-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

.notation-stack[data-layout-mode="split"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notation-stack[data-layout-mode="split"] [data-layout-panel="chords"],
.notation-stack[data-chord-placement="separate_strip"] [data-layout-panel="chords"] {
  grid-column: 1 / -1;
}

.notation-stack[data-chord-placement="hidden"] [data-layout-panel="chords"] {
  display: none;
}

.notation-stack[data-layout-scale="compact"] :is(.notation-text, .tab-text, .chord-text, .lyrics-text, .hymn-stanzas, .whistle-tab) {
  font-size: var(--step--2);
}

.notation-stack[data-layout-scale="large"] :is(.notation-text, .tab-text, .chord-text, .lyrics-text, .hymn-stanzas, .whistle-tab) {
  font-size: var(--step-1);
}

/* compose.mjs still opens its pages with this head */
.arrangement-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-5);
  align-items: start;
  margin-bottom: var(--space-5);
}

/* -- collections, account, staff ------------------------------------------------------------ */
.collections-page > .notice,
.collection-page > .notice {
  max-width: var(--measure);
  margin-bottom: var(--space-6);
}

.collection-index {
  max-width: var(--measure);
}

.index-table .index-count {
  width: 6rem;
  text-align: right;
}

.account-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

.account-head h1 {
  font-size: var(--step-4);
}

.account-section {
  margin-top: var(--space-7);
}

.account-section .section-heading h2 {
  font-size: var(--step-2);
}

.account-access {
  max-width: var(--measure);
  margin: 0 0 var(--space-2);
  color: var(--ink-soft);
  font: 400 var(--step-0)/1.55 var(--serif);
}

.tunebook-form {
  display: grid;
  gap: 0.375rem;
  max-width: 30rem;
  margin-bottom: var(--space-5);
}

.tunebook-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tunebook-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  border-top: 1px solid var(--line);
  padding: var(--space-3) 0;
}

.tunebook-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
  font: 600 var(--step-1)/1.3 var(--serif);
}

.tunebook-content {
  grid-column: 1 / -1;
}

.tunebook-content:empty {
  display: none;
}

.practice-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
  font: 600 var(--step-0)/1.4 var(--serif);
}

.admin-stats {
  margin-bottom: var(--space-2);
  font-size: var(--step-0);
}

.admin-table td {
  vertical-align: middle;
}

.admin-table .index-title {
  font-size: var(--step-0);
}

.admin-table .admin-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.admin-table .admin-actions .inline-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* the Premium practice panel's part order (only while Premium is on sale) */
.admin-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-top: 1px solid var(--line);
  padding: var(--space-2) 0;
}

.admin-row .inline-actions {
  margin-left: auto;
}

/* -- about and the policy pages ------------------------------------------------------------ */
.about-page .prose,
.policy-page .prose {
  margin-top: var(--space-2);
}

.policy-page > .notice {
  max-width: var(--measure);
  margin-bottom: var(--space-6);
}

.policy-date {
  color: var(--muted);
  font: 400 var(--step--1)/1.5 var(--sans);
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-6);
}

/* -- supporter page (only while Premium is on sale) ---------------------------------------- */
.comparison-wrap {
  max-width: 48rem;
  margin-top: var(--space-5);
}

.comparison {
  width: 100%;
  border-collapse: collapse;
}

.comparison th,
.comparison td {
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) var(--space-3) var(--space-3) 0;
  text-align: left;
  vertical-align: top;
  font: 400 var(--step--1)/1.45 var(--sans);
}

.comparison thead th {
  border-bottom-color: var(--ink);
  color: var(--muted);
  font: 600 var(--step-0)/1.3 var(--serif);
  font-variant-caps: all-small-caps;
  font-synthesis-small-caps: none;
  letter-spacing: 0.05em;
}

.comparison th:not(:first-child),
.comparison td:not(:first-child) {
  width: 7.5rem;
  text-align: center;
}

.profile-selector {
  max-width: 23rem;
}

/* -- responsive: 80, 64, 48, 40rem ---------------------------------------------------------- */
@media (max-width: 80rem) {
  .tune-index th.index-instruments {
    width: 12rem;
  }
}

@media (max-width: 64rem) {
  .home-hero,
  .apparatus-grid,
  .arrangement-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-hero {
    gap: var(--space-6);
  }

  .arrangement-grid {
    gap: var(--space-6);
  }

  .instrument-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .instrument-row li:nth-child(3n + 1) {
    border-left: 0;
  }

  .instrument-row li:nth-child(3n + 1) :is(a, .is-empty) {
    padding-left: 0;
  }

  .instrument-row li:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  /* The index folds: the title, one meta line and the heart. */
  .tune-index :is(.index-key, .index-meter, .index-instruments, .index-type) {
    display: none;
  }

  .tune-index .index-sub {
    display: block;
    margin-top: 0.15rem;
    color: var(--muted);
    font: 400 var(--step--1)/1.45 var(--sans);
    font-variant-numeric: lining-nums;
  }

  /* A letter group opens with a full-width band over an ink rule. */
  .tune-index.is-grouped,
  .tune-index.is-grouped tbody {
    display: block;
  }

  .tune-index.is-grouped thead {
    display: none;
  }

  .tune-index.is-grouped tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
  }

  .tune-index.is-grouped td.index-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .tune-index.is-grouped td.index-initial:empty {
    display: none;
  }

  .tune-index.is-grouped td.index-initial {
    display: block;
    grid-column: 1 / -1;
    width: auto;
    border-bottom: 1px solid var(--ink);
    padding: var(--space-5) 0 var(--space-2);
    font-size: var(--step-3);
    line-height: 1;
  }

  .tune-index.is-grouped tr.index-group-start:not(:first-child) td:not(.index-initial) {
    padding-top: 0.8rem;
  }

  .tune-index.is-grouped td {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 48rem) {
  .home-display {
    margin-bottom: var(--space-4);
  }

  .plate-paper {
    padding: var(--space-4) var(--space-3) var(--space-4) 5.25rem;
  }

  .plate-labels {
    top: var(--space-4);
    bottom: var(--space-4);
    left: var(--space-3);
    width: 4.75rem;
  }

  .plate-labels span {
    font-size: var(--step--2);
  }

  .plate figcaption {
    padding-left: 0;
  }

  .instrument-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .instrument-row li:nth-child(3n + 1) {
    border-left: 1px solid var(--line);
  }

  .instrument-row li:nth-child(3n + 1) :is(a, .is-empty) {
    padding-left: var(--space-4);
  }

  .instrument-row li:nth-child(2n + 1) {
    border-left: 0;
  }

  .instrument-row li:nth-child(2n + 1) :is(a, .is-empty) {
    padding-left: 0;
  }

  .instrument-row li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  /* an odd last instrument takes the whole row, never an orphan cell */
  .instrument-row li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .catalog-toolbar .field,
  .catalog-toolbar .catalog-search {
    flex: 1 1 calc(50% - var(--space-3));
  }

  .catalog-toolbar .catalog-search {
    flex-basis: 100%;
  }

  .catalog-view {
    margin-left: 0;
  }

  .catalog-view > a {
    min-height: var(--control-h);
  }

  /* every instrument stays in view: the tabs wrap rather than scroll */
  .tabs.instrument-tabs {
    flex-wrap: wrap;
    gap: 0 var(--space-4);
    overflow-x: visible;
  }

  .az-rail ol {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .az-rail a,
  .az-rail .az-empty {
    min-width: 2.75rem;
    height: 2.75rem;
  }

  .pagination-pages:has(> .pagination-of) > :not(.pagination-of),
  .pagination-pages > :not([aria-current="page"]):not(.pagination-label) {
    display: none;
  }

  .pagination-pages > .pagination-of {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
  }

  .tune-head-actions {
    width: 100%;
  }

  .tune-preview-sheet {
    padding: var(--space-3);
  }

  .notation-stack[data-layout-mode="split"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .tunebook-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-table .admin-actions .inline-actions {
    flex-wrap: wrap;
  }

  .comparison-wrap {
    overflow-x: auto;
  }

  .comparison {
    min-width: 34rem;
  }
}

/* Addressable engraved sheet. The inline SVG wraps every drawn note, rest and
   barline in a <g> carrying its event address, and music-ui.mjs marks the one
   under the pointer and the one a member has picked; these rules are the only
   thing that makes "click what you see" visible at all. Recolour only what the
   engraver already painted -- a rule that set fill on the sheet's unfilled
   slur and tie paths would flood them into blobs -- leave the geometry alone
   so the notation itself never shifts under the pointer, and stay still: a
   moving notehead is a worse affordance than a coloured one, and nothing here
   needs a prefers-reduced-motion escape. */
.sheet-inline {
  /* Not --accent: the engraved page is paper in both themes, so the markers
     are the studio's fixed on-paper colours (§3.3): the selection blue for
     the pointer, the rubric for the picked note. */
  --sheet-hit: color-mix(in srgb, var(--op-select, #1d5fc4) 55%, transparent);
  --sheet-hit-picked: var(--op-rubric, #a62a1b);
}

.sheet-inline [data-ev] {
  cursor: pointer;
}

/* The addressed clusters are real tab stops (music-ui.mjs gives each one
   tabindex and a name), so keyboard focus has to be as visible as the
   pointer marker. An outline sits outside the glyph and paints nothing over
   the notation, so the engraving is unchanged under the ring. */
.sheet-inline [data-ev]:focus-visible {
  outline: 2px solid var(--sheet-hit-picked);
  outline-offset: 2px;
}

.sheet-inline .wt-ev-hover [stroke]:not([stroke="none"]) {
  stroke: var(--sheet-hit);
}

.sheet-inline .wt-ev-hover [fill]:not([fill="none"]) {
  fill: var(--sheet-hit);
}

.sheet-inline .wt-ev-selected [stroke]:not([stroke="none"]) {
  stroke: var(--sheet-hit-picked);
}

.sheet-inline .wt-ev-selected [fill]:not([fill="none"]) {
  fill: var(--sheet-hit-picked);
}

/* Sheet-first hero: the engraved sheet with its tools in a compact toolbar
   (the sheet panel itself is a global primitive, above). One row on a
   hairline: Show (layers) · Whistle key · Key stepper · icon buttons. Sticky
   from 48rem up only. */
.sheet-panel > .sheet-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2) var(--space-5);
  min-height: 3rem;
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: var(--space-2) 0;
}

.sheet-show {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.sheet-group-label,
.key-ref {
  color: var(--muted);
  font: 500 var(--step--1)/1 var(--sans);
  white-space: nowrap;
}

.key-ref strong {
  color: var(--ink);
  font-weight: 600;
}

.sheet-layers {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* the verse modes are one of two: a segmented pair */
.sheet-verses {
  flex-wrap: nowrap;
  gap: 0;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-small);
}

.sheet-verses > .layer-chip {
  border: 0;
  border-radius: 0;
}

.sheet-verses > .layer-chip + .layer-chip {
  border-left: 1px solid var(--line);
}

.key-presets {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.key-preset-set {
  display: inline-flex;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-small);
  overflow: hidden;
}

.key-preset-set > .layer-chip {
  min-width: 2.25rem;
  justify-content: center;
  border: 0;
  border-radius: 0;
}

.key-preset-set > .layer-chip + .layer-chip {
  border-left: 1px solid var(--line);
}

.key-presets .key-mode {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}

.key-presets .key-mode:hover,
.key-presets .key-mode[aria-pressed="true"] {
  border-color: var(--field-line);
  background: var(--surface);
  color: var(--ink);
}

/* [− | G | +], labelled once: "Key". The reference key stays in the
   markup for assistive technology and the stepper's arithmetic. */
.key-stepper {
  display: inline-flex;
  align-items: center;
}

.key-stepper .key-ref {
  margin-right: var(--space-2);
}

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

.key-stepper .key-step {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-small) 0 0 var(--radius-small);
  background: var(--surface);
  color: var(--ink-soft);
  font: 500 var(--step-0)/1 var(--sans);
}

.key-stepper .key-target + .key-step {
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

.key-stepper .key-step:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.key-target {
  display: inline-grid;
  place-items: center;
  min-width: 3rem;
  height: 2.25rem;
  border-block: 1px solid var(--field-line);
  background: var(--surface);
  padding: 0 var(--space-2);
  color: var(--ink);
  font: 600 var(--step--1)/1 var(--sans);
  font-variant-numeric: lining-nums;
  white-space: nowrap;
}

.key-target.changed {
  color: var(--accent-strong);
}

.sheet-icons {
  display: inline-flex;
  gap: var(--space-1);
  margin-left: auto;
}

/* Nothing to set (Premium off, not entitled): the icon buttons alone, on
   the right, in a slimmer band. */
.sheet-panel > .sheet-toolbar.is-icons-only {
  min-height: 0;
  margin-bottom: var(--space-1);
  padding: var(--space-1) 0;
}

.sheet-toolbar-note {
  margin: calc(-1 * var(--space-2)) 0 var(--space-3);
  color: var(--muted);
  font: 400 var(--step--2)/1.45 var(--sans);
}

/* The engraved page carries its own margins: the paper is the page. */
.arrangement-page .sheet-panel .sheet-surface,
.review-page .sheet-panel .sheet-surface {
  padding: 0;
}

.sheet-panel > .artifact-attribution {
  padding-top: var(--space-2);
  font-size: var(--step--2);
}

.notation-text,
.tab-text,
.chord-text,
.lyrics-text {
  margin: 0;
  padding: var(--space-4);
  white-space: pre-wrap;
  overflow-x: auto;
  color: var(--ink);
  font: 400 var(--step--1)/1.65 var(--mono);
}

.lyrics-text {
  font-family: var(--serif);
  font-size: var(--step-0);
}

.hymn-lyrics .hymn-stanzas {
  max-width: var(--measure);
  margin: 0;
  padding: var(--space-5) var(--space-5);
  color: var(--ink);
  font: 400 var(--step-1)/1.6 var(--serif);
}

.hymn-stanza {
  position: relative;
  margin: 0 0 var(--space-4);
  padding-left: 2rem;
}

.hymn-stanza:last-child {
  margin-bottom: 0;
}

.hymn-verse-number {
  position: absolute;
  left: 0;
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
}

.holes {
  display: inline-grid;
  gap: 0.2rem;
  margin-top: 0.45rem;
}

.hole {
  width: 0.8rem;
  height: 0.8rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}

.hole.closed {
  background: var(--ink);
}

/* Vertical tin-whistle tablature: one fingering column per note, holes
   stacked top-to-bottom as the whistle is held. Columns wrap like text.
   Every size is em-based so the saved layout scale applies to the diagram. */
.whistle-tab {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.55em 0.4em;
  padding: 0.6em 0.2em;
}

.wtab-note {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15em;
  break-inside: avoid;
}

.whistle-tab .holes {
  gap: 0.2em;
  margin-top: 0;
  min-height: calc(6 * 0.8em + 5 * 0.2em);
}

.whistle-tab .hole {
  width: 0.8em;
  height: 0.8em;
}

.wtab-letter {
  font-size: 0.78em;
  font-weight: 600;
  min-height: 1.1em;
  line-height: 1.1;
}

.wtab-register {
  font-size: 0.7em;
  font-weight: 700;
  min-height: 1em;
  line-height: 1;
}

.wtab-technique {
  font-size: 0.7em;
  min-height: 1em;
  line-height: 1;
}

@media print {
  .whistle-tab {
    gap: 0.45em 0.3em;
  }

  .wtab-note {
    page-break-inside: avoid;
  }

  /* Browsers commonly skip background paint when printing; a thick border
     fills the circle from the foreground so covered holes stay covered. */
  .whistle-tab .hole.closed {
    border-width: 0.4em;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

[data-event-id].current-event {
  border-radius: 0.2rem;
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Below 48rem the toolbar sits still: a sticky row would cover a phone's
   sheet. */
@media (max-width: 48rem) {
  .sheet-panel > .sheet-toolbar {
    position: static;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: transparent;
  }

  .sheet-show {
    flex-wrap: wrap;
  }

  .sheet-frame {
    min-height: 23rem;
  }

  /* Never a shrunk letter page: the sheet keeps a readable fixed scale and
     pans sideways until the engraver can set a narrow page (§8). */
  .arrangement-page .sheet-panel .sheet-surface,
  .review-page .sheet-panel .sheet-surface {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .arrangement-page .sheet-panel :is(.sheet-inline > svg, img.sheet-image),
  .review-page .sheet-panel :is(.sheet-inline > svg, img.sheet-image) {
    min-width: 42rem;
  }
}

@media print {
  .hymn-verse-number {
    color: inherit;
  }

  /* A picked note is a screen affordance, not part of the engraving: a
     printed sheet is the black-on-white artifact Folk Register published. */
  .sheet-inline .wt-ev-hover [stroke]:not([stroke="none"]),
  .sheet-inline .wt-ev-selected [stroke]:not([stroke="none"]) {
    stroke: #000;
  }

  .sheet-inline .wt-ev-hover [fill]:not([fill="none"]),
  .sheet-inline .wt-ev-selected [fill]:not([fill="none"]) {
    fill: #000;
  }

  .site-header,
  .site-footer,
  .practice-toolbar,
  .breadcrumbs,
  .button,
  .premium-control,
  .instrument-tabs,
  .sheet-toolbar,
  .sheet-toolbar-note,
  .sheet-foot,
  .apparatus,
  .toast {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  #main-content {
    padding: 0;
  }

  .arrangement-grid {
    display: block;
  }

  .notation-panel,
  .sheet-frame {
    border: 0;
    box-shadow: none;
  }

  .hymn-lyrics .hymn-stanzas {
    color: #000;
  }

  .hymn-stanza {
    break-inside: avoid;
  }
}

/* Full-screen sheet: the engraving takes the viewport and the tools collapse
   behind a disclosure, so the music is not competing with its own controls. */
.sheet-panel.sheet-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 50;
  margin: 0;
  border-radius: 0;
  overflow: auto;
  background: var(--paper);
  padding: 0 var(--gutter) var(--space-6);
}

body.sheet-fullscreen-open {
  overflow: hidden;
}

.sheet-panel.sheet-fullscreen .sheet-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
}

.sheet-panel.sheet-fullscreen .sheet-surface {
  max-width: 60rem;
  margin-inline: auto;
}

/* Collapsed tools: only the icon row survives, and the disclosure that
   brings the rest back. */
.sheet-panel.sheet-tools-collapsed .sheet-layers,
.sheet-panel.sheet-tools-collapsed .key-stepper,
.sheet-panel.sheet-tools-collapsed .sheet-toolbar-note {
  display: none;
}

/* The tools disclosure is only meaningful in full screen; elsewhere the
   toolbar is always visible and the button would be a dead control. */
.sheet-tools-toggle {
  display: none;
}

.sheet-panel.sheet-fullscreen .sheet-tools-toggle {
  display: inline-grid;
  place-items: center;
}

@media print {
  .sheet-panel.sheet-fullscreen {
    position: static;
    overflow: visible;
  }
}

/* Review view: the transcription and the original page, side by side.
   Two equal columns because neither half is the subordinate one -- the point
   of the view is reading them against each other. Below the wide breakpoint
   they stack, scan first, since that is the thing being checked. */
.review-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 68.01rem) {
  /* The paper stays put while the reader scrolls the transcription past it. */
  .review-pane-scan {
    position: sticky;
    top: calc(var(--header-height) + 0.75rem);
  }
}

@media (max-width: 68rem) {
  .review-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.scan-panel {
  display: grid;
  gap: var(--space-3);
  border-top: 1px solid var(--ink);
  padding-top: var(--space-3);
}

.scan-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
}

.scan-panel-head h2 {
  margin: 0;
  font-size: var(--step-1);
}

/* Which representation is on screen, riding inside the heading so it is read
   with it rather than after it, and set quieter so the heading still reads as
   a heading. It is never the claim itself -- the caption under the picture is
   -- but it is the first place a reader could be misled, so it repaints with
   the page. */
.scan-panel-head h2 .scan-panel-representation {
  font-weight: 400;
  color: var(--ink-soft);
}

.scan-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.scan-toolbar-gap {
  flex: 0 0 0.5rem;
}

.scan-pan-pad .icon-up {
  transform: rotate(-90deg);
}

.scan-pan-pad .icon-down {
  transform: rotate(90deg);
}

/* No page to look at yet (loading, or none captured or permitted): the
   viewer controls and their key help wait until there is one (§8). */
.scan-panel:has(.scan-body-message:not([data-scan-reason="no_derivative"]):not([data-scan-reason="image_error"])) :is(.scan-toolbar, .scan-thumbs, #scan-keys-hint) {
  display: none;
}

.scan-zoom {
  min-width: 3.4rem;
  text-align: center;
  font: 500 var(--step--1)/1 var(--sans);
  font-variant-numeric: lining-nums;
  color: var(--ink-soft);
}

/* The page chooser's pictures.

   A horizontal rail rather than a grid: it sits under the toolbar in a pane
   that is already tall, and a hymnal has hundreds of leaves, so it scrolls in
   one direction and takes one line of height. It is a *second* route to a
   page; the labelled <select> above it is the first, and the rail is emitted
   only when `/thumb` derivatives actually exist, so a reader never meets a row
   of broken frames. */
.scan-thumbs {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0.15rem 0;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.scan-thumb-item {
  flex: 0 0 auto;
}

.scan-thumb {
  position: relative;
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--sheet-paper);
  cursor: pointer;
  overflow: hidden;
}

.scan-thumb img {
  display: block;
  width: 3.4rem;
  height: 4.4rem;
  object-fit: contain;
  background: var(--sheet-paper);
}

/* The page number rides on the thumbnail so the rail is still usable when the
   pictures are a wall of similar-looking hymnal pages. */
.scan-thumb-number {
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: 0;
  padding: 0 0.25rem;
  font: 500 var(--step--2)/1.4 var(--sans);
  font-variant-numeric: lining-nums;
  color: #fff;
  background: rgb(24 23 21 / 78%);
  border-start-end-radius: var(--radius-small);
}

.scan-thumb.is-current {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: -2px;
}

.scan-thumb:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* A preserved page with no viewing copy yet keeps its slot in the rail, so the
   numbering runs 1, 2, 3, 4 with the gap marked rather than silently reading
   1, 2, 4. It is not a button: there is no picture behind it to show. */
.scan-thumb.is-unviewable {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 4.4rem;
  cursor: default;
  background: repeating-linear-gradient(
    45deg,
    var(--surface-soft),
    var(--surface-soft) 4px,
    transparent 4px,
    transparent 8px
  );
  border-style: dashed;
}

/* A viewable page whose thumbnail has not been rendered -- a `--variant web`
   run, or a thumb that failed to encode -- keeps its slot too, and keeps being
   a button, because the page behind it does open. Deliberately not hatched:
   the hatching above means "there is nothing to show", and this slot means
   "there is something to show, just not a picture of it here". */
.scan-thumb.is-unpictured {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 4.4rem;
  background: var(--surface-soft);
}

/* No page to show: the block empty state (§7), not a frame. The panel's
   own ink rule and heading already open the region, so there is no second
   rule; a dashed box would read as an upload drop zone. */
.scan-body-message {
  display: grid;
  justify-items: start;
  gap: var(--space-2);
  max-width: var(--measure);
  padding: var(--space-2) 0 0;
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  font: 400 var(--step-0)/1.5 var(--serif);
}

.scan-body-message h3 {
  margin: 0;
  font-size: var(--step-2);
  line-height: 1.25;
}

.scan-body-message p {
  margin: 0;
}

.scan-body-message .muted.small {
  font: 400 var(--step--1)/1.5 var(--sans);
}

/* The pane the page is read through. `overflow: hidden` is what makes the
   transform a viewport rather than a page-stretching element.

   `touch-action: pan-y` is the compromise a tall sticky pane needs: a
   horizontal drag is ours (that is the pan gesture), while a vertical swipe
   stays the article's own scroll. `none` here would trap a phone reader whose
   finger lands on the paper -- the pane is 60vh on a narrow screen -- with no
   way to scroll past it. */
.scan-viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  max-height: 78vh;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  touch-action: pan-y;
  cursor: grab;
}

.scan-viewport:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.scan-viewport.is-dragging {
  cursor: grabbing;
}

.scan-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 50%;
}

/* The page box, in the two regimes the payload can put it in.

   Default: the payload declares no pixel size (which is every page the
   preservation API sends today), so the box is simply the pane. It is given
   an explicit width and height because `.scan-stage` is absolutely positioned
   and the image inside carries no intrinsic size until it loads -- without
   them the box collapses to nothing and the pane shows blank paper while the
   scan is arriving, or forever if it never does. `object-fit: contain` on the
   image letterboxes the paper inside it.

   `has-page-size`: the payload declared the page's pixel size, so the box
   takes the page's own proportions from an inline `aspect-ratio` and shrinks
   to wrap the image, clamped to the pane. Both dimensions are `auto` on
   purpose: that is the condition under which the declared ratio survives the
   `max-*` clamp instead of being flattened by it, and it is what makes a
   region drawn as a fraction of this box land on the ink rather than on the
   letterboxing. Reachable as soon as a page has a `web` derivative:
   `v1_scan_pages` publishes that derivative's pixel size, which is the size of
   the picture in the <img>, so the declared ratio and the ink agree. Regions
   are still empty -- nothing populates `scan_page_regions` yet -- so the
   alignment this enables has nothing to align to today. */
.scan-page {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.scan-page.has-page-size {
  width: auto;
  height: auto;
}

/* A historical page is paper: it keeps its own white ground in both themes
   rather than being tinted by ours. */
.scan-page-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--sheet-paper);
  user-select: none;
  -webkit-user-drag: none;
}

.scan-regions {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Regions are invisible until one is chosen: an overlay of boxes over a
   historical page would compete with the ink it is there to point at. */
.scan-region {
  position: absolute;
  border: 1px solid transparent;
  border-radius: 2px;
}

.scan-region.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  outline: 2px solid color-mix(in srgb, var(--accent) 34%, transparent);
}

/* The pointer-free pan control: four nudge buttons in reading order
   (left, up, down, right), so panning is not something only a mouse or an
   un-intercepted arrow key can do. A row rather than a d-pad, because the
   toolbar is a strip and a three-row cross would push the page down. */
.scan-pan-pad {
  display: inline-flex;
  gap: 0.15rem;
  align-items: center;
}

.scan-hint,
.scan-citation,
.scan-digest {
  margin: 0;
}

/* Which representation is on screen, said under the picture where a reader
   looking at it will see it. A viewing copy is a resized, re-encoded WebP and
   is never presented as the preserved page; this line is what keeps the panel
   from implying otherwise. */
.scan-representation {
  margin: 0.5rem 0 0;
  text-align: center;
}

/* The preservation record of the page on screen: which exact bytes these are.
   Monospace because it is a digest and it is meant to be compared. */
.scan-digest {
  font-family: var(--mono);
  font-size: var(--step--2);
  overflow-wrap: anywhere;
}

@media (max-width: 46rem) {
  .scan-viewport {
    aspect-ratio: 4 / 5;
    max-height: 60vh;
  }
}

@media print {
  /* The review view is a working surface. Printing one prints the music. */
  .scan-panel {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   The editor, the review queue and the drafts space
   ---------------------------------------------------------------------------
   The gestures live in editor.mjs; these are the surfaces they act on. Three
   things are load-bearing rather than decorative:

   * The ghost notehead is drawn inside the engraved SVG, so it is styled here
     rather than by an inline attribute — the sheet is sanitized on the way in
     and the module sets only geometry on the ghost.
   * The context menu is positioned in viewport coordinates because that is
     what a pointer event reports, and it is a `position: fixed` layer so a
     menu opened near the bottom of a long score is not clipped by a scrolling
     ancestor.
   * Every focusable control in here has a visible focus ring. The editor is
     keyboard-first by covenant, and a keyboard path nobody can see is not a
     keyboard path.
   --------------------------------------------------------------------------- */

/* The region is a section under an ink rule, not a box (§7 .panel). */
.editor-region {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-6);
  border-top: 1px solid var(--ink);
  padding-top: var(--space-4);
}

.editor-region-head {
  display: grid;
  gap: var(--space-3);
}

.editor-region-head h2 {
  margin: 0;
  font-size: var(--step-2);
}

.editor-region-head > p {
  margin: 0;
}

.editor-candidate-note {
  margin: 0;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.editor-palette {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* the durations read as one segmented control: one edge, hairline seams */
.editor-palette-group {
  display: inline-flex;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.editor-palette-button {
  display: inline-grid;
  place-items: center;
  min-width: var(--control-h);
  min-height: var(--control-h);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-small);
  background: var(--surface);
  padding: 0 var(--space-2);
  color: var(--ink-soft);
  font: 500 var(--step--1)/1 var(--sans);
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease);
}

.editor-palette-group > .editor-palette-button {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
}

.editor-palette-group > .editor-palette-button:first-child {
  border-left: 0;
  border-radius: 2px 0 0 2px;
}

.editor-palette-group > .editor-palette-button:last-child {
  border-radius: 0 2px 2px 0;
}

.editor-palette-button:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.editor-palette-button:focus-visible {
  position: relative;
  z-index: 1;
}

.editor-palette-button[aria-checked="true"],
.editor-palette-button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}

.editor-palette-icon {
  display: block;
}

.editor-palette-hint {
  margin: 0 0 0 var(--space-2);
}

.editor-history {
  display: flex;
  gap: var(--space-1);
}

/* a quiet button that cannot act yet stays frameless */
.editor-history .button.quiet:disabled {
  border-color: transparent;
  background: transparent;
}

.editor-key-help summary {
  padding-block: 0.7rem;
  color: var(--ink-soft);
  font: 500 var(--step--1)/1.2 var(--sans);
  cursor: pointer;
}

.editor-key-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-2);
  color: var(--ink-soft);
  font: 400 var(--step--1)/1.45 var(--sans);
}

.editor-key-row {
  display: contents;
}

.editor-key-row kbd {
  justify-self: start;
  white-space: nowrap;
}

/* The context menu. Fixed, because it is placed from a pointer event's own
   viewport coordinates and must not be clipped by the scrolling score pane.
   A floating layer, so it alone carries the float shadow. */
.editor-menu {
  position: fixed;
  z-index: 60;
  min-width: 14rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--space-1);
  box-shadow: var(--shadow-float);
}

.editor-menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.editor-menu-separator {
  height: 1px;
  margin: var(--space-1) var(--space-2);
  background: var(--line);
}

.editor-menu-item {
  display: block;
  width: 100%;
  min-height: 2.25rem;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  padding: var(--space-2) var(--space-3);
  color: var(--ink);
  font: 400 var(--step--1)/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
}

.editor-menu-item:hover:not([disabled]) {
  background: var(--paper-deep);
}

.editor-menu-item:focus-visible {
  outline-offset: -2px;
}

.editor-menu-item[disabled] {
  color: color-mix(in srgb, var(--ink) 45%, var(--surface));
  cursor: default;
}

.editor-status {
  margin: 0;
  color: var(--ink-soft);
  font: 400 var(--step--1)/1.45 var(--sans);
}

.editor-status:empty {
  display: none;
}

/* checks on the change: hairline notes, no stripes; the place first */
.editor-diagnostics {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.editor-diagnostic {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: var(--space-2) var(--space-3);
  color: var(--ink-soft);
  font: 400 var(--step--1)/1.45 var(--sans);
}

.editor-diagnostic.is-error {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--accent-soft);
  color: var(--danger);
}

.editor-diagnostic.is-warning {
  border-color: color-mix(in srgb, var(--warning-line) 55%, transparent);
  background: var(--warning-bg);
}

.editor-diagnostic-badge {
  color: var(--ink);
  font-weight: 600;
}

.editor-diagnostic.is-error .editor-diagnostic-badge {
  color: inherit;
}

.editor-change-list,
.queue-change-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink);
  font: 400 var(--step--1)/1.5 var(--sans);
}

.editor-change-list li + li,
.queue-change-list li + li {
  margin-top: var(--space-1);
}

.editor-changes h3 {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font: 600 var(--step-0)/1.3 var(--serif);
  font-variant-caps: all-small-caps;
  font-synthesis-small-caps: none;
  letter-spacing: 0.05em;
}

.editor-change-empty {
  margin: 0;
}

.editor-actions {
  margin-top: 0;
}

/* The submit and report forms. A real form in the region rather than a stack
   of native prompts, so the fields are labelled, the error is a live region,
   and a browser that suppresses dialogs still has the path. */
.editor-submit-form {
  display: grid;
  gap: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--space-4);
}

.editor-submit-form h3 {
  margin: 0;
  font-size: var(--step-1);
}

.editor-submit-form > p {
  margin: 0;
}

.editor-submit-form input,
.editor-submit-form textarea {
  width: 100%;
}

.editor-submit-form textarea {
  min-height: 5rem;
  font-size: var(--step-0);
}

.editor-submit-form .field-error {
  color: var(--danger);
  font: 500 var(--step--1)/1.45 var(--sans);
}

/* The drag ghost, drawn inside the engraved page. It is a hint about where a
   note is going, so it is unmistakably not ink: rubric, translucent, and out
   of the accessibility tree (the drag announces itself in words). The page
   is paper in both themes, so the ghost is the on-paper rubric. */
.sheet-inline .wt-editor-ghost {
  fill: #a62a1b;
  fill-opacity: 0.55;
  stroke: #86200f;
  stroke-width: 0.2;
  pointer-events: none;
}

/* A sheet that is being edited says so with the cursor, and stops the browser
   turning a vertical drag on a note into a page scroll. */
[data-editor-host] .sheet-inline [data-ev] {
  cursor: grab;
  touch-action: none;
}

@media (max-width: 48rem) {
  .editor-toolbar {
    align-items: flex-start;
  }

  .editor-palette-group {
    flex-wrap: wrap;
  }

  .editor-key-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
  }

  .editor-key-row kbd {
    margin-top: var(--space-2);
  }
}

/* ---- the review queue --------------------------------------------------- */
/* /community/queue (visual-design-system.md §8): status filters as tabs,
   kind as a small segmented control, items as hairline index rows that open
   in place. Every status is a .status (shape, word, one colour per job); the
   .queue-chip classes only carry the tone the tests and app.mjs name. */

.page-heading.queue-heading > p.queue-rule {
  max-width: var(--measure);
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.5 var(--sans);
}

.queue-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  margin-bottom: var(--space-5);
}

.queue-filter {
  min-width: 0;
}

.queue-status-tabs {
  flex: 1 1 32rem;
}

/* the tabs primitive marks aria-current; these are pressed buttons */
.queue-status-tabs > [aria-pressed="true"] {
  color: var(--ink);
  font-weight: 600;
}

.queue-status-tabs > [aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}

.queue-kind {
  margin-bottom: var(--space-1);
}

.queue-empty {
  max-width: var(--measure);
}

/* the rows */
.queue-list {
  border-top: 1px solid var(--ink);
}

.queue-item {
  border-bottom: 1px solid var(--line);
}

.queue-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem 12rem;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  padding: var(--space-3) var(--space-2);
  transition: background-color var(--ease);
}

.queue-item-head:hover,
.queue-item.is-open > .queue-item-head {
  background: var(--paper-deep);
}

.queue-item-main {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.queue-item-head h3 {
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.3;
}

.queue-item-title {
  text-decoration: none;
}

.queue-item-title:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

/* A meta line that wraps keeps its middle dot at the end of the line it
   leaves, never at the start of the next. */
.queue-item-meta > * + *::before,
.draft-meta > * + *::before,
.scan-review-row .meta-list > * + *::before {
  content: none;
}

.queue-item-meta > :not(:last-child)::after,
.draft-meta > :not(:last-child)::after,
.scan-review-row .meta-list > :not(:last-child)::after {
  content: "·";
  margin-left: 0.45em;
  color: var(--line-strong);
}

.queue-item-tune {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
}

.queue-item-votes {
  margin: 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.2 var(--sans);
  text-align: right;
  white-space: nowrap;
}

.queue-item-votes .num {
  color: var(--ink);
  font-size: var(--step-1);
}

.queue-chip {
  justify-self: start;
  white-space: normal;
}

.queue-chip-warning {
  color: var(--brass);
}

/* an open item: its sections in two columns under the row */
.queue-item-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--space-6) var(--space-7);
  padding: var(--space-5) var(--space-2) var(--space-7);
}

.queue-item-body > :is(.queue-diff, .queue-rebase, .queue-steward, .queue-report) {
  grid-column: 1 / -1;
}

.queue-section {
  min-width: 0;
}

.queue-section > h4 {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font: 600 var(--step-0)/1.3 var(--serif);
  font-variant-caps: all-small-caps;
  font-variant-numeric: lining-nums;
  font-synthesis-small-caps: none;
  letter-spacing: 0.05em;
}

.queue-report-body,
.queue-note {
  max-width: var(--measure);
  margin: var(--space-2) 0 0;
  color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--serif);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* A proposal the register moved out from under: one warning notice, because
   the contributor has to do something about it and nothing is happening
   automatically. */
.queue-rebase.notice > h4 {
  margin: 0;
  color: var(--ink);
  font: 600 var(--step--1)/1.45 var(--sans);
  font-variant-caps: normal;
  letter-spacing: 0;
}

.queue-rebase p {
  max-width: var(--measure);
  margin: var(--space-2) 0 0;
}

/* Before and after, side by side, each on its own sheet paper, and stacked
   once there is no room for two pages across. */
.queue-diff {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.queue-diff-pane {
  min-width: 0;
  margin: 0;
}

.queue-diff-pane figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.queue-diff-pane figcaption .label {
  margin: 0;
}

.queue-diff-pane .sheet-surface {
  min-height: 8rem;
  overflow-x: auto;
  border: 1px solid var(--sheet-edge);
  background: var(--sheet-paper);
  padding: var(--space-4);
}

.queue-diff-status {
  margin: var(--space-2) 0 0;
}

/* A diff pane that says something other than "engraving failed" -- the tune
   moved on, the proposal is already in the register, sign in to see it -- is
   information, not an error, and is not coloured as one. */
.queue-diff-status.is-note {
  color: var(--muted);
  font-style: italic;
}

.queue-checks {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font: 400 var(--step--1)/1.45 var(--sans);
}

.queue-check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  color: var(--ink-soft);
}

.queue-check-name {
  color: var(--ink);
}

.queue-check.is-passed .icon {
  color: var(--evergreen);
}

.queue-check.is-failed,
.queue-check.is-failed .queue-check-name {
  color: var(--danger);
}

.queue-check.is-inconclusive .icon,
.queue-check.is-info .icon {
  color: var(--muted);
}

.queue-votes {
  display: grid;
  justify-items: start;
  gap: var(--space-2);
}

.queue-vote-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.queue-vote-tally {
  margin: 0;
  color: var(--ink);
  font-size: var(--step-0);
}

.queue-votes .muted,
.queue-steward .muted {
  margin: 0;
}

.queue-thread {
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

.queue-comment {
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) 0;
}

.queue-comment:first-child {
  padding-top: 0;
}

.queue-comment-head,
.queue-comment-body {
  margin: 0;
}

.queue-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  font: 400 var(--step--1)/1.4 var(--sans);
}

.queue-comment-body {
  margin-top: var(--space-1);
  font: 400 var(--step-0)/1.55 var(--serif);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.queue-steward-mark {
  color: var(--muted);
  font: 600 var(--step--1)/1 var(--serif);
  font-variant-caps: all-small-caps;
  font-synthesis-small-caps: none;
  letter-spacing: 0.05em;
}

.queue-comment-form {
  display: grid;
  gap: var(--space-2);
  max-width: 34rem;
}

.queue-comment-form textarea {
  min-height: 5rem;
  font-size: var(--step-0);
}

.queue-comment-form input[name="measure"] {
  max-width: 12rem;
}

.queue-comment-form .button {
  justify-self: start;
  margin-top: var(--space-2);
}

/* The steward's controls close the item under an ink rule. The editorial
   note is required and is recorded in the audit trail, so it gets a full row
   rather than being squeezed beside the button it gates. */
.queue-steward {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  border-top: 1px solid var(--ink);
  padding-top: var(--space-4);
}

.queue-steward p {
  flex: 1 1 100%;
  max-width: var(--measure);
}

.queue-steward .field {
  flex: 1 1 100%;
  max-width: 40rem;
  margin: 0;
}

.queue-steward textarea {
  min-height: 4rem;
  font-size: var(--step-0);
}

@media (max-width: 48rem) {
  .queue-filters {
    align-items: stretch;
  }

  .queue-status-tabs {
    flex-basis: 100%;
  }

  .queue-item-head {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-inline: 0;
  }

  .queue-item-main {
    grid-column: 1 / -1;
  }

  .queue-item-votes {
    grid-column: 2;
    grid-row: 2;
  }

  .queue-item-head > .status {
    grid-column: 1;
    grid-row: 2;
  }

  .queue-item-body {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 0;
  }
}

/* ---- compose ------------------------------------------------------------ */
/* /compose, /compose/new, a draft, and New Folk (visual-design-system.md §8):
   drafts and published tunes as hairline index rows, the new-tune form
   beside a live preview of the staff it will open on, and the publish panel
   as an ink-ruled section. */

.compose-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
}

.compose-heading .button-row {
  flex: 0 1 auto;
}

.compose-new-grid {
  display: grid;
  grid-template-columns: minmax(0, 32rem) minmax(0, 1fr);
  align-items: start;
  gap: var(--space-6) var(--space-8);
}

.compose-wizard {
  display: grid;
  gap: var(--space-4);
  border-top: 1px solid var(--ink);
  padding-top: var(--space-5);
}

.compose-wizard .button-row {
  margin-top: var(--space-2);
}

.field-error {
  margin: 0;
}

/* the live preview: the opening of the staff, on sheet paper */
.compose-preview {
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
  border-top: 1px solid var(--ink);
  padding-top: var(--space-3);
}

.compose-preview > .label {
  margin-bottom: var(--space-3);
}

.compose-preview-sheet {
  margin: 0;
}

.compose-preview-paper {
  border: 1px solid var(--sheet-edge);
  background: var(--sheet-paper);
  padding: var(--space-6) var(--space-6) var(--space-5);
  color: #1b1917; /* ink on paper in both themes, as the engraved sheet */
}

.compose-preview-title {
  margin: 0 0 var(--space-5);
  color: #1b1917;
  font: 600 var(--step-3)/1.2 var(--serif);
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.compose-preview-staff {
  display: block;
  min-height: 4.5rem;
}

.compose-preview-staff svg {
  display: block;
  width: 100%;
  height: auto;
}

.compose-preview-staff .wb-measure-number {
  display: none;
}

/* The preview scales to its column, so staff lines land between pixels;
   snapped to whole pixels they draw at one even weight (curves stay smooth). */
.compose-preview-staff :is(.wb-lines, .wb-bar) {
  shape-rendering: crispEdges;
}

.compose-preview-sheet figcaption {
  margin-top: var(--space-2);
}

/* drafts and New Folk: hairline rows, the title the row's link */
.draft-list {
  margin: 0;
  border-top: 1px solid var(--ink);
  padding: 0;
  list-style: none;
}

.draft-list > li {
  border-bottom: 1px solid var(--line);
}

.draft-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 18rem) 8.5rem;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  padding: var(--space-3) var(--space-2);
  transition: background-color var(--ease);
}

.draft-card:hover {
  background: var(--paper-deep);
}

.draft-main,
.draft-where {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.draft-title {
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.3;
}

.draft-title a {
  text-decoration: none;
}

.draft-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.draft-title a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.draft-note,
.draft-published {
  margin: 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.45 var(--sans);
}

.draft-published a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--ink-soft);
  font-weight: 500;
}

/* New Folk rows are title and licence only; nothing marks them but the
   section they are in and its words. */
.new-folk-card {
  grid-template-columns: minmax(0, 1fr);
}

.draft-empty {
  max-width: var(--measure);
}

/* a draft's or a New Folk tune's own page */
.compose-work-heading {
  display: grid;
  gap: var(--space-2);
  max-width: 46rem;
  margin-bottom: var(--space-6);
}

.compose-work-heading h1 {
  margin: 0;
  font-size: var(--step-4);
  line-height: 1.15;
}

.compose-licence {
  margin: 0;
  color: var(--ink-soft);
  font: 400 var(--step--1)/1.5 var(--sans);
}

.compose-work-heading .notice {
  margin-top: var(--space-2);
}

.compose-split {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: start;
  gap: var(--space-6);
}

.compose-pane {
  min-width: 0;
}

/* the publish panel: a section under an ink rule */
.publish-panel {
  display: grid;
  gap: var(--space-4);
  max-width: 46rem;
  margin-top: var(--section-gap);
}

.publish-panel h2 {
  margin: 0;
}

.publish-licenses {
  display: grid;
  margin: 0;
  border: 0;
  padding: 0;
}

.publish-licenses legend {
  margin-bottom: var(--space-1);
  padding: 0;
  color: var(--muted);
  font: 600 var(--step-0)/1.3 var(--serif);
  font-variant-caps: all-small-caps;
  font-synthesis-small-caps: none;
  letter-spacing: 0.05em;
}

.publish-licenses > p {
  margin: 0 0 var(--space-2);
}

.publish-license {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0.1rem var(--space-3);
  border-top: 1px solid var(--line);
  padding: var(--space-3) 0;
  cursor: pointer;
}

.publish-license input {
  grid-row: span 2;
}

.publish-license-label {
  color: var(--ink);
  font: 600 var(--step-0)/1.35 var(--serif);
}

.publish-encouraged {
  margin-left: var(--space-2);
  color: var(--muted);
  font: 600 var(--step--1)/1 var(--serif);
  font-variant-caps: all-small-caps;
  font-synthesis-small-caps: none;
  letter-spacing: 0.05em;
}

.publish-license-summary,
.publish-check-note {
  grid-column: 2;
  color: var(--muted);
  font: 400 var(--step--1)/1.45 var(--sans);
}

.publish-training,
.publish-acknowledge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0.1rem 0.6rem;
}

.publish-training input,
.publish-acknowledge input {
  grid-row: span 2;
}

.publish-matches {
  display: grid;
  gap: var(--space-2);
}

.publish-matches ul {
  margin: 0;
  padding-left: 1.2rem;
}

@media (max-width: 64rem) {
  .queue-diff,
  .compose-split,
  .compose-new-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .compose-preview {
    position: static;
  }
}

@media (max-width: 48rem) {
  .draft-card {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-inline: 0;
  }

  .draft-where {
    grid-column: 1;
    grid-row: 2;
  }

  .draft-card > .status {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    margin-top: 0.2rem;
  }

  .compose-preview-paper {
    padding: var(--space-5) var(--space-4) var(--space-4);
  }

}

@media print {
  /* Working surfaces. Printing a draft prints the music, not the palette. */
  .editor-region,
  .queue-filters,
  .queue-steward,
  .queue-comment-form,
  .publish-panel {
    display: none;
  }
}

/* -- scan transcription (staff): /scans, /scans/{source}, the workbench page -- */
/* The shelf (/scans) and a book's pages (/scans/{source}), drawn with the
   global layer's tokens and primitives (visual-design-system.md §3.4, §8):
   a book is its cover scan or a flat typographic title page; no cloth,
   gilt, ledge, ring or cast shadow. The --scan-* tokens are the only names
   of this area's own, and every value maps onto the site's palette. */
:root {
  /* a text field's edge and a progress line's track: 3:1 non-text (§3.4) */
  --scan-field-line: var(--field-line);
  --scan-track: var(--field-line);
  /* the 1px frame around a scan (§3.1): sheet edge in light, line-strong
     in dark, where the scan's own paper is the step */
  --scan-frame: var(--sheet-edge);
  --scan-paper-edge: 0 0 0 1px var(--sheet-edge);
  /* status discs on a scan's corner */
  --scan-badge-done: var(--evergreen);
  --scan-badge-started: var(--brass);
  --scan-badge-draft: var(--muted);
}

:root[data-theme="dark"] {
  --scan-frame: var(--line-strong);
  --scan-paper-edge: 0 0 0 1px var(--line-strong);
  /* the discs sit on the scan, which stays light paper in every theme
     (§1.6): they keep the light theme's inks */
  --scan-badge-done: #285f45;
  --scan-badge-started: #7f5300;
  --scan-badge-draft: #64615a;
}

html:has(.scan-source) {
  scroll-padding-top: calc(var(--header-height) + var(--scan-filterbar-h, 5rem) + 0.75rem);
}

.scan-lib,
.scan-source {
  font-variant-numeric: lining-nums;
}

.scan-icon {
  flex: none;
}

/* The area's meta lines ("1921 · 166 pages · Staff notation"): each part
   carries its dot in its own left margin, and the line is drawn one dot to
   the left with that strip clipped, so a part that wraps never starts its
   line with a dot - and the first part's dot is never seen. */
:is(.scan-lib-sum, .scan-book-meta, .scan-bookhead-meta, .scan-bookhead-caption, .scan-resume-when) {
  --scan-dot: 0.9em;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-left: calc(-1 * var(--scan-dot));
  clip-path: inset(-0.5em 0 -0.5em var(--scan-dot));
}

:is(.scan-lib-sum, .scan-book-meta, .scan-bookhead-meta, .scan-bookhead-caption, .scan-resume-when) > * {
  position: relative;
  padding-left: var(--scan-dot);
}

:is(.scan-lib-sum, .scan-book-meta, .scan-bookhead-meta, .scan-bookhead-caption, .scan-resume-when) > *::before {
  content: "·";
  position: absolute;
  left: 0;
  width: var(--scan-dot);
  margin: 0;
  color: var(--muted);
  text-align: center;
}

/* these lines draw their own leading dot (above), not the meta line's */
:is(.scan-lib-sum, .scan-book-meta, .scan-bookhead-meta, .scan-bookhead-caption, .scan-resume-when) > *::after {
  content: none;
}

/* the two pages' blocks */
.scan-block {
  margin-top: var(--space-7);
}

.scan-block .section-heading {
  align-items: center;
  margin-bottom: var(--space-4);
}

.scan-block .section-heading h2 {
  margin: 0;
  font-size: var(--step-2);
  line-height: 1.25;
}

/* -- the shelf page --------------------------------------------------------- */
/* H1 "Scans", then one sentence of live numbers (§8): "22 books · 12,884
   pages · 77 done, 12 under way". */
.scan-lib-head {
  margin-bottom: 0;
}

.scan-lib-head h1 {
  margin-bottom: var(--space-3);
}

/* (the lede's own margin is the page heading's: this line keeps its dots) */
.page-heading.scan-lib-head > p.scan-lib-sum {
  margin-left: calc(-1 * var(--scan-dot));
}

.page-heading.scan-lib-head > p.scan-lib-note {
  margin-top: var(--space-3);
  font: 500 var(--step--1)/1.4 var(--sans);
}

.scan-lib-drafts {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
}

/* "Pick up where you left off": hairline rows, the first with the page's
   one ink button. Each row is its link (stretched); Discard sits above. */
.scan-resume {
  margin: 0;
  padding: 0;
  list-style: none;
}

.scan-resume-card {
  position: relative;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) 0;
  transition: background-color var(--ease);
}

.scan-resume-card:hover {
  background: var(--paper-deep);
}

.scan-resume-thumb {
  width: 3rem;
  align-self: start;
}

.scan-resume-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  display: block;
  background: var(--sheet-paper);
  object-fit: cover;
  object-position: top;
  outline: 1px solid var(--scan-frame);
  outline-offset: -1px;
}

/* a page with no scan to show: its number in a recessed slot (a scan on
   its way looks the same on the book page) */
.scan-page-slot {
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: var(--step--1);
}

.scan-resume-body {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.scan-resume-title {
  margin: 0;
  color: var(--ink);
  font: 600 var(--step-1)/1.3 var(--serif);
}

.scan-resume-title cite {
  font-style: italic;
}

.scan-resume-piece {
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font: 400 var(--step-0)/1.4 var(--serif);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-resume-kind {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.scan-resume-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
}

.scan-resume-go::after {
  content: "";
  position: absolute;
  inset: 0;
}

.scan-discard {
  position: relative;
  z-index: 1;
}

/* the books: a heading with the Covers | List choice, then the filters */
.scan-shelf-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-3);
}

.scan-shelf-views > button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.scan-shelf-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  margin-bottom: var(--space-6);
}

.scan-shelf-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.scan-sort {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.scan-sort select {
  width: auto;
  min-width: 8.5rem;
}

.scan-search {
  width: 15rem;
}

/* filter chips (the global .chip): a status shape before the word, in its
   colour until the chip is pressed (ink) */
.scan-fchip .n {
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
}

.scan-fchip[aria-pressed="true"] .n {
  color: color-mix(in srgb, var(--on-ink) 78%, var(--ink));
}

.scan-fchip[data-empty]:not([aria-pressed="true"]) {
  color: var(--muted);
}

.scan-fchip:is([data-show="started"]):not([aria-pressed="true"]) .scan-icon {
  color: var(--brass);
}

.scan-fchip:is([data-show="done"]):not([aria-pressed="true"]) .scan-icon {
  color: var(--evergreen);
}

.scan-fchip:is([data-show="todo"], [data-show="rights"]):not([aria-pressed="true"]) .scan-icon {
  color: var(--muted);
}

/* covers: rows of title pages and cover scans; the whole tile is the link */
.scan-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.75rem), 1fr));
  gap: var(--space-7) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.scan-book {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* content-visibility clips a book's painting to its box: the margin lets
   the tile's focus ring (2px, 4px out) show whole */
.scan-shelf.is-long .scan-book {
  content-visibility: auto;
  contain-intrinsic-size: auto 25rem;
  overflow-clip-margin: 0.5rem;
}

.scan-book:has(.scan-book-title a:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.scan-book-title {
  margin: var(--space-2) 0 0;
  font: 600 var(--step-0)/1.3 var(--serif);
  letter-spacing: 0;
}

.scan-book-title a {
  color: var(--ink);
  text-decoration: none;
}

.scan-book-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.scan-book-title a:focus-visible {
  outline: none;
}

.scan-book:hover .scan-book-title a {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.scan-book-meta {
  font-size: var(--step--2);
}

/* the notation is a line of its own under a narrow tile */
.scan-book-meta > .is-notation {
  flex-basis: 100%;
}

.scan-book-progress {
  order: 2;
  display: grid;
  gap: var(--space-1);
  margin-top: auto;
  padding-top: var(--space-2);
}

.scan-book-flags {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-3);
}

.scan-book-cell,
.scan-shelf-cols {
  display: none;
}

.scan-book-draft {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  color: var(--ink);
  font: 500 var(--step--2)/1.3 var(--sans);
}

/* "Rights review": the one control among a book's facts; it opens "Why is
   it locked?" */
.scan-rights {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  padding: 0;
  color: var(--brass);
  font: 500 var(--step--2)/1.3 var(--sans);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.scan-rights:hover {
  text-decoration-color: currentColor;
}

/* the progress line: 2px on a 1px track, evergreen done, brass under way */
.scan-prog {
  position: relative;
  height: 2px;
  display: flex;
}

.scan-prog::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--scan-track);
  transform: translateY(-50%);
}

.scan-prog i {
  position: relative;
  display: block;
  height: 100%;
}

.scan-prog .d {
  background: var(--evergreen);
}

.scan-prog .p {
  background: var(--brass);
}

.scan-prog-legend {
  margin: 0;
  color: var(--muted);
  font: 400 var(--step--2)/1.4 var(--sans);
  font-variant-numeric: lining-nums tabular-nums;
}

/* the cover: a flat typographic title page - the title, one hairline, the
   year - with a 4px spine edge; a cover scan, when there is one, lies over
   it untouched in a square hairline frame */
.scan-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  container-type: inline-size;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  background: var(--surface-soft);
  padding: 17% 9% 9%;
  color: var(--ink);
  text-align: center;
  transition: border-color var(--ease);
}

.scan-book:hover .scan-cover {
  border-color: var(--field-line);
}

/* One type size for every title page; a long title is clamped at five
   lines rather than set smaller (data-length no longer steps the size). */
.scan-cover-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  max-width: 100%;
  overflow: hidden;
  font: 600 max(0.875rem, 11cqi)/1.18 var(--serif);
  letter-spacing: -0.005em;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: manual;
}

/* the one hairline, under the title */
.scan-cover-rule {
  flex: none;
  width: 22cqi;
  height: 1px;
  margin-top: 0.75rem;
  background: color-mix(in srgb, var(--ink) 40%, transparent);
}

.scan-cover-title small {
  display: block;
  margin-top: 0.45em;
  color: var(--ink-soft);
  font-size: 0.8em;
  font-style: italic;
  font-weight: 400;
}

.scan-cover-year {
  margin-top: auto;
  color: var(--muted);
  font: 400 max(0.8125rem, 7cqi)/1 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0.08em;
}

.scan-cover-lock {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: grid;
  color: var(--muted);
}

.scan-cover.has-image {
  border: 1px solid var(--scan-frame);
}

.scan-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--sheet-paper);
  object-fit: cover;
  object-position: top;
}

/* "Why is it locked?" (a popover: a floating layer, §5) */
.scan-why {
  width: min(26rem, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--space-5);
  color: var(--ink-soft);
  font: 400 var(--step--1)/1.5 var(--sans);
  box-shadow: var(--shadow-float);
}

.scan-why::backdrop {
  background: rgb(24 23 21 / 24%);
}

.scan-why p {
  margin: 0 0 var(--space-3);
}

.scan-why .scan-why-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
  font: 600 var(--step-2)/1.25 var(--serif);
}

.scan-why-title .scan-icon {
  color: var(--brass);
}

.scan-why details,
.scan-operators {
  margin: 0 0 var(--space-4);
  color: var(--muted);
  font: 400 var(--step--2)/1.5 var(--sans);
}

.scan-why summary,
.scan-operators summary {
  width: max-content;
  color: var(--ink-soft);
  font-weight: 500;
  cursor: pointer;
}

.scan-why details p,
.scan-operators p {
  margin: var(--space-2) 0 0;
}

/* no book matches the filters: an inline empty state */
.scan-nomatch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
}

/* the list: an index table of the same books (Title, Year, Pages, Done,
   Status), one hairline row each, the title's link stretched over it */
.scan-lib[data-view="list"] .scan-shelf {
  display: block;
}

.scan-lib[data-view="list"] :is(.scan-book, .scan-shelf-cols) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem 5rem 5rem 8.5rem;
  grid-template-areas:
    "title year pages done status"
    "flags flags flags flags flags";
  align-items: baseline;
  column-gap: var(--space-4);
}

.scan-lib[data-view="list"] .scan-shelf-cols {
  grid-template-areas: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: var(--space-2);
  color: var(--muted);
  font: 600 var(--step-0)/1.3 var(--serif);
  font-variant-caps: all-small-caps;
  font-synthesis-small-caps: none;
  letter-spacing: 0.05em;
}

.scan-lib[data-view="list"] .scan-book {
  gap: 0 var(--space-4);
  border-bottom: 1px solid var(--line);
  padding-block: var(--space-3);
  transition: background-color var(--ease);
}

.scan-lib[data-view="list"] .scan-book:hover {
  background: var(--paper-deep);
}

.scan-lib[data-view="list"] .scan-shelf.is-long .scan-book {
  contain-intrinsic-size: auto 3.25rem;
}

.scan-lib[data-view="list"] :is(.scan-cover, .scan-book-meta, .scan-book-progress) {
  display: none;
}

.scan-lib[data-view="list"] .scan-book-title {
  grid-area: title;
  margin: 0;
  font-size: var(--step-1);
}

.scan-lib[data-view="list"] .scan-book-cell {
  display: block;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.scan-lib[data-view="list"] .scan-book-cell.is-year {
  grid-area: year;
}

.scan-lib[data-view="list"] .scan-book-cell.is-pages {
  grid-area: pages;
}

.scan-lib[data-view="list"] .scan-book-cell.is-done {
  grid-area: done;
}

.scan-lib[data-view="list"] .scan-book-cell.is-status {
  grid-area: status;
  font-family: var(--sans);
}

.scan-lib[data-view="list"] .scan-book-flags {
  grid-area: flags;
}

.scan-lib[data-view="list"] .scan-book:has(.scan-book-title a:focus-visible) {
  outline-offset: -2px;
}

/* -- empty shelf, missing book or page, sign-in gate ------------------------- */
/* The block empty state (§7): left-aligned, one sentence, at most one ink
   button, a hairline above; the missing pages keep their small drawing of
   book spines, which stand on that hairline. */
.scan-empty {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: var(--space-3);
  max-width: var(--measure);
  border-top: 1px solid var(--line);
  padding-top: var(--space-5);
  color: var(--ink-soft);
}

.scan-empty:has(> .scan-empty-shelf) {
  border-top: 0;
  padding-top: 0;
}

.scan-empty :is(h1, h2) {
  margin: 0;
}

.scan-empty h1 {
  font-size: var(--step-4);
  line-height: 1.15;
}

.scan-empty h2 {
  font-size: var(--step-2);
  line-height: 1.25;
}

.scan-empty p {
  margin: 0;
  font: 400 var(--step-0)/1.5 var(--serif);
}

.scan-empty .scan-slug {
  white-space: nowrap;
}

.scan-empty .button-row {
  margin-top: var(--space-2);
}

.scan-missing .breadcrumbs {
  margin-bottom: var(--space-6);
}

.scan-empty-shelf {
  width: 100%;
  height: 4.75rem;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--line-strong);
  padding-left: var(--space-1);
}

.scan-empty-shelf span {
  width: 1rem;
  height: 3.75rem;
  border: 1px solid var(--field-line);
  border-bottom: 0;
  background:
    linear-gradient(var(--field-line) 0 0) 0 18% / 100% 1px no-repeat,
    linear-gradient(var(--field-line) 0 0) 0 82% / 100% 1px no-repeat;
}

.scan-empty-shelf span:nth-child(2) {
  width: 1.2rem;
  height: 4.25rem;
}

.scan-empty-shelf span:nth-child(3) {
  height: 3.4rem;
  margin-left: 0.75rem;
  transform: rotate(-14deg);
  transform-origin: 0 100%;
}

/* -- a book's pages ----------------------------------------------------------- */
/* A plain band: the title, its facts and the way in on the left; a thin
   progress line with "17 of 166 pages done" on the right (§8). */
.scan-bookhead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 19rem);
  align-items: end;
  gap: var(--space-5) var(--space-7);
  margin-bottom: var(--space-6);
}

.scan-bookhead h1 {
  margin: 0 0 var(--space-2);
  font-size: var(--step-4);
  line-height: 1.15;
}

.scan-bookhead-meta {
  font-size: var(--step--1);
}

.scan-bookhead .scan-book-flags {
  margin-top: var(--space-1);
}

.scan-bookhead-actions {
  margin-top: var(--space-4);
}

.scan-bookhead-progress {
  display: grid;
  gap: var(--space-2);
  padding-bottom: 0.6rem;
}

.scan-bookhead-caption {
  margin: 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.45 var(--sans);
}

.scan-bookhead-caption b {
  color: var(--ink);
  font-weight: 600;
}

.scan-bookhead-bar {
  height: 3px;
}

/* the filter bar sticks under the site header, opened by an ink rule */
.scan-filterbar-sentinel {
  height: 1px;
  margin-bottom: -1px;
}

.scan-filterbar {
  position: sticky;
  top: var(--header-height);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  margin: 0 0 var(--space-2);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  padding: var(--space-3) 0;
  backdrop-filter: blur(6px);
  transition: border-color var(--ease);
}

/* stuck under the header, the header's own rule is enough above it */
.scan-filterbar.is-stuck {
  border-top-color: transparent;
  border-bottom-color: var(--line-strong);
}

/* on a short screen (attachSource measures it) the bar scrolls with the
   page, so the site header and the bar never take most of it */
.scan-filterbar.is-static {
  position: static;
}

/* go to page and the page size stay together, and wrap together */
.scan-filterbar-tools {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
}

.scan-goto {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.scan-goto label {
  color: var(--ink-soft);
  font: 500 var(--step--1)/1.3 var(--sans);
  white-space: nowrap;
}

.scan-goto-short {
  display: none;
}

.scan-goto-field {
  gap: var(--space-1);
}

.scan-goto input {
  width: 4.5rem;
  padding-inline: 0.5rem;
  text-align: center;
}

.scan-goto-hint:empty {
  display: none;
}

.scan-goto-hint {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 3;
  border: 1px solid var(--danger);
  border-radius: var(--radius-small);
  background: var(--surface);
  padding: 0.4rem 0.65rem;
  color: var(--danger);
  font: 500 var(--step--2)/1.35 var(--sans);
  white-space: nowrap;
  box-shadow: var(--shadow-float);
}

.scan-views > button {
  min-width: 2.5rem;
  padding-inline: 0.5rem;
}

.scan-views > [aria-disabled="true"] {
  color: color-mix(in srgb, var(--ink) 40%, var(--surface));
  cursor: default;
}

.scan-views > [aria-disabled="true"]:hover {
  background: transparent;
  color: color-mix(in srgb, var(--ink) 40%, var(--surface));
}

/* sections of 48 pages: a head with its counts and a hairline */
.scan-section {
  margin-top: var(--space-6);
}

.scan-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
}

.scan-section-head::after {
  content: "";
  height: 1px;
  flex: 1 1 2rem;
  align-self: center;
  background: var(--line);
}

.scan-section-head h2 {
  margin: 0;
  font: 600 var(--step-1)/1.3 var(--serif);
  font-variant-numeric: lining-nums;
  white-space: nowrap;
}

.scan-section-head p {
  margin: 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.3 var(--sans);
  white-space: nowrap;
}

/* a run of pages nobody has started, folded to one row: "Pages 49–96 ·
   Not started ——— Open p. 49  Show the 48 pages" */
.scan-section-more {
  order: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-3);
}

.scan-section-more .button {
  min-height: 2rem;
  padding-inline: var(--space-3);
  font-size: var(--step--1);
}

.scan-section-more .link-button {
  min-height: 2rem;
  color: var(--ink-soft);
  font: 400 var(--step--1)/1.3 var(--sans);
}

.scan-section.is-folded {
  margin-top: var(--space-3);
}

.scan-section.is-folded:has(> .scan-leaves[hidden]) .scan-section-head {
  margin-bottom: 0;
}

.scan-section:not(.is-folded) + .scan-section.is-folded {
  margin-top: var(--space-6);
}

/* the leaves: each page's scan in a square hairline frame */
.scan-leaves {
  --leaf: 8.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--leaf), 1fr));
  gap: var(--space-5) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.scan-source[data-view="small"] .scan-leaves {
  --leaf: 6.25rem;
  gap: var(--space-4) var(--space-3);
}

.scan-leaf {
  position: relative;
  min-width: 0;
  container: scan-leaf / inline-size;
}

.scan-leaf-link {
  display: grid;
  gap: var(--space-2);
  color: inherit;
  text-decoration: none;
}

.scan-leaf-link:hover {
  color: inherit;
}

/* A scan on its way (or none to show) is a recessed slot: no fill, a
   dashed edge, its page number. Once the scan has come it is framed in a
   solid hairline on the sheet paper, untouched in every theme. */
.scan-leaf-sheet {
  position: relative;
  aspect-ratio: 0.65;
  display: block;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  transition: border-color var(--ease);
}

.scan-leaf[data-shown] .scan-leaf-sheet {
  border-style: solid;
  border-color: var(--scan-frame);
  background: var(--sheet-paper);
}

.scan-leaf-link:hover .scan-leaf-sheet {
  border-color: var(--ink-soft);
}

.scan-leaf-ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: var(--step-1);
}

.scan-leaf-sheet img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.scan-leaf-nocopy {
  position: absolute;
  inset: auto 0.5rem 22%;
  color: var(--muted);
  font: 400 var(--step--2)/1.3 var(--sans);
  text-align: center;
}

/* the page opened last: rubric marks where you are */
.scan-leaf[data-current] .scan-leaf-sheet {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.scan-leaf[data-current] .scan-leaf-label b {
  color: var(--accent);
}

/* status discs on the scan's corner: a shape each (a tick, a half disc, a
   pencil), readable without the colour */
.scan-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 1.375rem;
  height: 1.375rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  box-shadow: 0 0 0 1.5px var(--sheet-paper);
}

.scan-leaf[data-state="done"] .scan-badge {
  background: var(--scan-badge-done);
  color: #fff;
}

.scan-leaf[data-state="done"] .scan-badge .scan-icon {
  stroke-width: 2.5;
}

.scan-leaf[data-state="started"] .scan-badge {
  background: var(--sheet-paper);
  color: var(--scan-badge-started);
}

.scan-leaf[data-state="started"] .scan-badge .scan-icon {
  width: 1.375rem;
  height: 1.375rem;
  stroke-width: 2;
}

.scan-badge.is-draft,
.scan-leaf[data-state] .scan-badge.is-draft {
  right: auto;
  left: 6px;
  background: var(--scan-badge-draft);
  color: #fff;
}

.scan-leaf-label {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  color: var(--ink-soft);
  font-size: var(--step--1);
  line-height: 1.4;
  white-space: nowrap;
}

.scan-leaf-label b {
  flex: none;
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
}

.scan-leaf-icon {
  display: none;
}

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

.scan-leaf-flag {
  color: var(--muted);
  font-style: italic;
}

.scan-leaf-note {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font: italic 400 var(--step--2)/1.3 var(--serif);
  text-overflow: ellipsis;
}

.scan-leaf-note .scan-icon {
  margin-right: 0.25em;
  vertical-align: -0.15em;
  font-style: normal;
}

.scan-leaf[data-draft] .scan-leaf-note {
  color: var(--ink);
}

.scan-leaf-go {
  display: none;
}

/* the pause between two parts of a leaf link's name (scan-transcribe.mjs
   LEAF_PAUSE, P4R5A-03): a comma screen readers read and the eye never
   sees. It stays in its part's run of text - an sr-only box of its own
   would put a space before it - so it has no size instead; browsers leave a
   0 font size alone whatever their minimum. The pause before Open is the
   list's only, as Open is */
.scan-leaf-comma {
  font-size: 0;
}

.scan-leaf-comma.is-go {
  display: none;
}

/* the piece and the last save, under the page number - only when the server
   names them. The piece takes up to two balanced lines ("No. 29" holds
   together; only a title longer than that ends in an ellipsis, and the
   tooltip has it whole), and the saver's name has a line of its own in the
   large grid. The small grid leaves the name to the tooltip; the list keeps
   it on the save's line. */
.scan-leaf-meta {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
  margin-top: calc(-1 * var(--space-1));
}

.scan-leaf-piece {
  position: relative;
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font: italic 400 var(--step--1)/1.3 var(--serif);
  text-wrap: balance;
  overflow-wrap: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.scan-leaf-no {
  white-space: nowrap;
}

/* "No. 29 · Sweet By and By", and never "No. 29 ·" at the end of a line
   with the title below it (P4R4V-04): the number keeps the room for " ·"
   unseen, so the lines break just as they would with the dot there, and
   the dot drawn is the title's, set just before its first word. While the
   title goes on on the number's line the dot sits in that room; when the
   title starts a line of its own, the dot falls outside the piece's left
   edge, where the piece (its containing block) cuts it off. */
.scan-leaf-no.has-title::after {
  content: "\00a0\00b7";
  content: "\00a0\00b7" / "";
  visibility: hidden;
}

.scan-leaf-sep {
  position: absolute;
  transform: translateX(-100%);
}

.scan-leaf-when {
  min-width: 0;
  color: var(--muted);
  font: 400 var(--step--2)/1.3 var(--sans);
  font-variant-numeric: lining-nums tabular-nums;
}

.scan-leaf-when > time,
.scan-leaf-by {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

.scan-source:not([data-view="list"]) .scan-leaf-by {
  display: block;
}

.scan-source[data-view="small"] .scan-leaf-by {
  display: none;
}

/* narrow leaves (the small grid, phones): the piece's number takes a line
   of its own (no dot) above two lines of title, and in the narrowest the
   save reads "10 h ago" ("Saved" stays for screen readers), so it is never
   cut (.scan-leaf is the container) */
@container scan-leaf (max-width: 8rem) {
  .scan-leaf-piece {
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .scan-leaf-no {
    display: block;
  }

  .scan-leaf-no.has-title::after,
  .scan-leaf-sep {
    display: none;
  }
}

@container scan-leaf (max-width: 7rem) {
  .scan-leaf-saved {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .scan-leaf-note {
    display: none;
  }
}

/* a scan that didn't load: the slot keeps its page number, and a Retry over
   it (the whole slot is the target) while it waits for the server's budget
   to allow another try; a leaf being tried again pulses its page number */
.scan-leaf[data-failed] .scan-leaf-sheet img,
.scan-leaf[data-retrying] .scan-leaf-sheet img {
  visibility: hidden;
}

.scan-leaf[data-failed] .scan-leaf-sheet,
.scan-leaf[data-retrying] .scan-leaf-sheet {
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
}

.scan-leaf[data-retrying] .scan-leaf-ph {
  animation: scan-leaf-wait 1.1s ease-in-out infinite alternate;
}

@keyframes scan-leaf-wait {
  to { opacity: 0.35; }
}

.scan-leaf-retry {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  min-height: 0;
  aspect-ratio: 0.65;
  display: grid;
  place-items: end center;
  border: 0;
  background: transparent;
  padding: 0 0 18%;
  color: var(--ink);
  font: 500 var(--step--2)/1 var(--sans);
  cursor: pointer;
}

.scan-leaf-retry-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2rem;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-small);
  background: var(--surface);
  padding: 0 0.65rem 0 0.5rem;
  transition: border-color var(--ease), color var(--ease);
}

.scan-leaf-retry:hover .scan-leaf-retry-pill {
  border-color: var(--ink);
}

/* while it will be tried again anyway, a quiet refresh mark (the word on
   hover and focus): a refused screenful is not a wall of buttons */
.scan-leaf[data-waiting] .scan-leaf-retry-pill {
  border-color: transparent;
  background: transparent;
  padding: 0 0.45rem;
  color: var(--muted);
}

.scan-leaf[data-waiting] .scan-leaf-retry-pill > span {
  display: none;
}

.scan-leaf[data-waiting] .scan-leaf-retry:is(:hover, :focus-visible) .scan-leaf-retry-pill {
  border-color: var(--ink);
  background: var(--surface);
  padding: 0 0.65rem 0 0.5rem;
  color: var(--ink);
}

.scan-leaf[data-waiting] .scan-leaf-retry:is(:hover, :focus-visible) .scan-leaf-retry-pill > span {
  display: inline;
}

/* several in a section: "Didn't load. Trying again shortly. [Retry N pages]"
   after the head's rule */
.scan-section-retry {
  order: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

.scan-section-retry-note {
  color: var(--muted);
  font: 400 var(--step--2)/1.3 var(--sans);
}

.scan-section-retry-note span {
  white-space: nowrap;
}

.scan-section-retry-btn {
  min-height: 2rem;
  padding-inline: 0.65rem 0.75rem;
  font-size: var(--step--1);
  white-space: nowrap;
}

/* the list: one 32px hairline row per page - a status shape, the page, its
   state, the piece and the save - the whole row the link, its chevron on
   hover only */
.scan-source[data-view="list"] .scan-leaves {
  display: block;
}

.scan-source[data-view="list"] .scan-leaf-sheet,
.scan-source[data-view="list"] .scan-leaf-retry,
.scan-source[data-view="list"] .scan-section-retry {
  display: none;
}

.scan-source[data-view="list"] .scan-leaf-link {
  --scan-row: 2rem;
  height: 100%;
  min-height: var(--scan-row);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: start;
  gap: 0 var(--space-3);
  border-bottom: 1px solid var(--line);
  padding: calc((var(--scan-row) - 1px - var(--step--1) * 1.4) / 2) 0;
  transition: background-color var(--ease);
}

.scan-source[data-view="list"] .scan-leaf-link:hover {
  background: var(--paper-deep);
}

.scan-source[data-view="list"] .scan-leaf-link:focus-visible {
  outline-offset: -2px;
}

/* the label's parts take their places in the row */
.scan-source[data-view="list"] .scan-leaf-label {
  display: contents;
}

.scan-source[data-view="list"] .scan-leaf-icon {
  display: inline-grid;
  align-self: center;
  color: var(--muted);
}

.scan-source[data-view="list"] .scan-leaf[data-state="done"] .scan-leaf-icon {
  color: var(--evergreen);
}

.scan-source[data-view="list"] .scan-leaf[data-state="started"] .scan-leaf-icon {
  color: var(--brass);
}

.scan-source[data-view="list"] .scan-leaf-label b {
  min-width: 3.5rem;
  font-size: var(--step--1);
  line-height: 1.4;
}

.scan-source[data-view="list"] .scan-leaf-state {
  position: static;
  width: auto;
  min-width: 6.5rem;
  height: auto;
  overflow: visible;
  clip: auto;
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.4;
}

.scan-source[data-view="list"] .scan-leaf[data-state="started"] .scan-leaf-state {
  color: var(--brass);
  font-weight: 500;
}

.scan-source[data-view="list"] .scan-leaf[data-state="done"] .scan-leaf-state {
  color: var(--evergreen);
  font-weight: 500;
}

.scan-source[data-view="list"] .scan-leaf[data-state="skip"] .scan-leaf-state {
  font-style: italic;
}

.scan-source[data-view="list"] .scan-leaf-flag {
  display: none;
}

/* "Last opened", "Draft here": a quiet sans note, so the piece's italic
   title beside it reads as the music's */
.scan-source[data-view="list"] .scan-leaf-note {
  color: var(--ink-soft);
  font: 500 var(--step--2)/1.4 var(--sans);
  white-space: nowrap;
}

.scan-source[data-view="list"] .scan-leaf-meta {
  order: 5;
  flex: 1 1 14rem;
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin: 0;
}

.scan-source[data-view="list"] .scan-leaf-piece {
  flex: 1 1 auto;
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.scan-source[data-view="list"] .scan-leaf-when {
  flex: none;
  margin-left: auto;
  font-size: var(--step--1);
  white-space: nowrap;
}

.scan-source[data-view="list"] .scan-leaf-go {
  order: 9;
  display: inline-flex;
  align-items: center;
  align-self: center;
  margin-left: auto;
  color: var(--ink-soft);
  font-size: var(--step--1);
  opacity: 0;
  transition: opacity var(--ease);
}

.scan-source[data-view="list"] .scan-leaf-go > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.scan-source[data-view="list"] .scan-leaf-link:is(:hover, :focus-visible) .scan-leaf-go {
  opacity: 1;
}

.scan-source[data-view="list"] .scan-leaf-comma.is-go {
  display: inline;
}

/* -- tablets and narrow windows ------------------------------------------------ */
@media (max-width: 64rem) {
  .scan-bookhead {
    grid-template-columns: minmax(0, 1fr);
  }

  .scan-bookhead-progress {
    max-width: 24rem;
    padding-bottom: 0;
  }

  .scan-lib[data-view="list"] :is(.scan-book, .scan-shelf-cols) {
    grid-template-columns: minmax(0, 1fr) 4rem 4.5rem 4.5rem 8rem;
  }
}

/* -- phones ----------------------------------------------------------------------- */
@media (max-width: 48rem) {
  .scan-block {
    margin-top: var(--space-6);
  }

  .scan-resume-card {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: var(--space-2) var(--space-3);
  }

  .scan-resume-thumb {
    width: 2.5rem;
  }

  .scan-resume-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .scan-resume-piece {
    white-space: normal;
  }

  .scan-resume-when > * {
    flex-basis: 100%;
  }

  .scan-shelf-bar {
    margin-bottom: var(--space-5);
  }

  .scan-shelf-tools,
  .scan-search {
    width: 100%;
  }

  .scan-shelf-tools .scan-search {
    flex: 1 1 12rem;
  }

  .scan-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6) var(--space-4);
  }

  .scan-book-draft,
  .scan-rights,
  .scan-section-more :is(.button, .link-button),
  .scan-section-retry-btn,
  .scan-why summary,
  .scan-operators summary {
    min-height: 2.75rem;
  }

  .scan-why summary,
  .scan-operators summary {
    display: flex;
    align-items: center;
  }

  /* the list: the title and the status; the counts are in the title's row
     on covers */
  .scan-lib[data-view="list"] :is(.scan-book, .scan-shelf-cols) {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title status"
      "flags flags";
  }

  .scan-lib[data-view="list"] .scan-shelf-cols {
    display: none;
  }

  .scan-lib[data-view="list"] .scan-book-cell:is(.is-year, .is-pages, .is-done) {
    display: none;
  }

  .scan-lib[data-view="list"] .scan-book-title {
    font-size: var(--step-0);
  }

  .scan-bookhead-actions .button {
    flex: 1 1 auto;
  }

  .scan-filterbar {
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
  }

  .scan-filterbar-tools {
    position: relative;
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-3);
  }

  /* Go to page opens this row (space-between), so its error hangs from the
     row's start, under the whole row, and wraps within it */
  .scan-goto {
    position: static;
  }

  .scan-goto-hint {
    top: calc(100% + 0.25rem);
    right: auto;
    left: 0;
    max-width: 100%;
    white-space: normal;
  }

  .scan-section-head {
    row-gap: 0;
  }

  .scan-section-more {
    flex-basis: 100%;
    margin-left: calc(-1 * var(--space-3));
  }

  .scan-leaves,
  .scan-source[data-view="small"] .scan-leaves {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4) var(--space-3);
  }

  .scan-source[data-view="small"] .scan-leaves {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .scan-source:not([data-view="list"]) .scan-leaf-by {
    display: none;
  }

  /* the list on a phone: the save without its name (the tooltip has it),
     so a row stays one line where it can */
  .scan-source[data-view="list"] .scan-leaf-state {
    min-width: 5.5rem;
  }

  .scan-source[data-view="list"] .scan-leaf-meta {
    flex-basis: 6rem;
  }

  .scan-source[data-view="list"] .scan-leaf-by {
    display: none;
  }
}

/* phones: "Page [26] [Open]", so the page size fits beside it; the full
   label stays the field's name */
@media (max-width: 30rem) {
  .scan-goto-full {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .scan-goto-short {
    display: inline;
  }

  .scan-goto input {
    width: 3.75rem;
  }
}

/* Forced colours paint every chip and segment the same (Canvas, CanvasText),
   which would leave the chosen filter, view and page size unmarked: the
   pressed one takes the system's selection colours. */
@media (forced-colors: active) {
  /* forced-color-adjust: none, or the text's Canvas backplate hides it */
  .scan-fchip[aria-pressed="true"],
  :is(.scan-views, .scan-shelf-views) > [aria-pressed="true"] {
    forced-color-adjust: none;
    border-color: Highlight;
    background: Highlight;
    color: HighlightText;
  }

  .scan-fchip[aria-pressed="true"] .n {
    color: HighlightText;
  }

  /* a progress line keeps its track and its fills: forced to Canvas, the
     track and both fills vanish */
  .scan-prog::before,
  .scan-prog i {
    forced-color-adjust: none;
  }

  .scan-prog::before {
    background: CanvasText;
  }

  .scan-prog .d {
    background: Highlight;
  }

  .scan-prog .p {
    background: GrayText;
  }

  /* a leaf's status disc keeps its look: forced to Canvas, the done disc is
     a blank circle. It sits on the scan, which keeps its own light paper,
     so it wears a Canvas ring and the system colours read against it. */
  .scan-badge {
    forced-color-adjust: none;
  }

  .scan-leaf[data-state] .scan-badge,
  .scan-leaf[data-state] .scan-badge.is-draft {
    border: 2px solid CanvasText;
    background: Canvas;
    box-shadow: 0 0 0 2px Canvas;
    color: CanvasText;
  }

  .scan-leaf[data-state="done"] .scan-badge:not(.is-draft) {
    border-color: Highlight;
    background: Highlight;
    color: HighlightText;
  }

  .scan-leaf[data-current] .scan-leaf-sheet {
    outline-color: Highlight;
  }
}

/* -- the transcribe route: the studio takes the whole screen (spec §2.8) ---- */
/* html.fr-studio goes on before a transcribe page first paints - index.html
   on a load or a refresh, app.mjs renderRoute as a link opens one, and
   renderScanTranscribe keeps it - and the page's teardown takes it off once
   the route leaves the transcribe pages (never between two of them), so
   neither opening the studio nor moving from page to page flashes the site
   header. The
   studio's app bar carries the site's mark as the way home, and its ⋯ menu
   the theme, the account and the way back to the shelf. */
/* the studio's canvas is the workbench's (score-workbench.css --st-canvas):
   the sunk paper in light, the page itself in dark */
html.fr-studio {
  --scan-studio-canvas: var(--paper-deep);
  scroll-behavior: auto;
}

html.fr-studio[data-theme="dark"] {
  --scan-studio-canvas: var(--paper);
}

html.fr-studio body {
  overflow: hidden;
  background: var(--scan-studio-canvas);
}

html.fr-studio .site-header,
html.fr-studio .site-footer {
  display: none;
}

html.fr-studio #main-content {
  height: 100dvh;
  min-height: 0;
  padding: 0;
}

html.fr-studio .transcribe-page {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
}

/* The workbench itself holds the keyboard when a page opens (its keys work,
   and "Skip to the score" is the next Tab stop): a ring around the whole
   screen would say nothing. */
html.fr-studio [data-transcribe-workbench]:focus {
  outline: none;
}

/* The banner whose Compare is open - the unsaved work's, the set-aside
   work's - steps aside while that compare is up: the compare bar carries
   its answers (Restore, Keep for later) beside Done, so the stage keeps the
   height for the changed measures (spec 4.15: one Compare banner). It comes
   back when the compare closes unanswered (scan-transcribe.mjs compareFrom). */
html.fr-studio [data-scan-banner-aside="draft"] .wb-banner[data-banner="draft"],
html.fr-studio [data-scan-banner-aside="aside"] .wb-banner[data-banner="aside"] {
  display: none;
}

/* The first page's skeleton while it loads (a direct load, a refresh, a link
   from the book): the studio's own grid at this width - the app bar, the
   palette row, the navigator and inspector columns, the status bar and the
   keypad dock, as the workbench's tiers set them (score-workbench.css §3) -
   with the shapes of what each will hold (the site's mark, the book and the
   pager, the tools, the page and its systems, the inspector's tabs and
   checklist), and two cards where the stage's cards sit: a head, then the
   scan (a printed system, at a system's usual shape) and the score (a grand
   staff) on the frame's paper. A light passes over the shapes and the paper
   (1.2 s; still when motion is reduced). No words: the page on its way is
   named for assistive tech alone (renderScanTranscribe), and #main-content
   is aria-busy meanwhile. So the first thing seen is the studio, and little
   moves when the page comes. The navigator folded to a rail and the
   inspector closed, choices only the workbench's stored preferences know,
   are read before the load (data-studio-nav, data-studio-insp on the root).
   A page turn never shows it: the page being left stays until the next is
   in (holdStill). */
html.fr-studio .route-loading {
  --sk-bar: 52px;
  --sk-pal: 48px;
  --sk-status: 30px;
  --sk-nav: clamp(232px, 17vw, 320px);
  --sk-insp: 304px;
  --sk-pad-top: 16px;
  --sk-pad-x: 20px;
  --sk-radius: 4px;
  --sk-top: calc(var(--sk-bar) + var(--sk-pal));
  --sk-card-top: calc(var(--sk-top) + var(--sk-pad-top));
  --sk-gap: 16px;
  --sk-dock: 0px;
  /* a card: its head (44), the frame - the scan strip at a system's usual
     shape (3.6:1), the ruler (24), the score - and its padding (13) */
  --sk-sw: calc(100vw - var(--sk-nav) - var(--sk-insp) - 2 * var(--sk-pad-x) - 48px);
  --sk-strip-h: clamp(92px, var(--sk-sw) / 3.6, 360px);
  --sk-sheet-h: clamp(132px, var(--sk-sw) * 0.23, 280px);
  --sk-frame-h: calc(var(--sk-strip-h) + 24px + var(--sk-sheet-h));
  --sk-card-h: calc(57px + var(--sk-frame-h));
  --sk-second: 1; /* the second card (phones show one) */
  --sk-head-w: min(470px, 100% - 150px); /* the head's left end, cut before the switch */
  /* the navigator as a panel (1) or a rail (1), or neither */
  --sk-navp: 1;
  --sk-navr: 0;
  /* the page in the panel is as tall as its width allows (a hymnal page) */
  --sk-pvh: calc((var(--sk-nav) - 24px) * 1.4136);
  /* the palette's pieces: the tools start where Select/Input end */
  --sk-pal-h: min(var(--sk-pal), 48px);
  --sk-pal-y: calc(var(--sk-bar) + (var(--sk-pal) - var(--sk-pal-h)) / 2);
  --sk-pal-x: 195px;
  --sk-pal-select: var(--sk-pal-select-full);
  --sk-pal-kit: var(--sk-pal-tools);
  --sk-pal-transport: var(--sk-pal-transport-full);
  --sk-pal-transport-w: 160px;
  --sk-bar-left: var(--sk-bar-left-xl);
  --sk-bar-right: var(--sk-bar-right-d);
  --sk-bar-art: 52px;
  --sk-bar-y: calc((var(--sk-bar) - var(--sk-bar-art)) / 2);
  --sk-brand-x: 12px;
  --sk-keys: var(--sk-dock-keys);
  /* ink: the shapes, the light passing over them; the paper and what is
     printed and engraved on it stay paper-light in both themes */
  --sk-shape: color-mix(in srgb, var(--line) 58%, var(--surface));
  --sk-shine: rgb(255 255 255 / 70%);
  --sk-brand: var(--sk-brand-light);
  --sk-head-left: var(--sk-head-left-light);
  --sk-head-right: var(--sk-head-right-light);
  --sk-paper: #fffef9;
  --sk-scan: #ebe9e3;
  --sk-print: rgb(24 23 21 / 28%);
  --sk-print-soft: rgb(24 23 21 / 10%);
  --sk-ink: rgb(27 25 23 / 24%);
  --sk-ink-soft: rgb(27 25 23 / 9%);
  --sk-sg: calc(var(--sk-strip-h) * 0.057);
  --sk-sg2: calc(var(--sk-sheet-h) * 0.06);
  position: relative;
  isolation: isolate;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  /* the stage keeps a scrollbar's gutter: so does this, so the cards are as
     wide as the stage's */
  overflow: hidden;
  scrollbar-gutter: stable;
  font-size: 0;
  color: transparent;
  /* rows: the app bar, the palette, the stage between the navigator and the
     inspector, the status bar, the keypad dock (phones, touch tablets); the
     site's mark where the app bar has it */
  background:
    var(--sk-brand) var(--sk-brand-x) calc((var(--sk-bar) - 24px) / 2) / 28px 24px no-repeat,
    linear-gradient(var(--line) 0 0) 0 calc(var(--sk-bar) - 1px) / 100% 1px no-repeat,
    linear-gradient(var(--line) 0 0) 0 calc(var(--sk-top) - 1px) / 100% 1px no-repeat,
    linear-gradient(var(--line) 0 0) left 0 bottom calc(var(--sk-dock) + var(--sk-status) - 1px) / 100% 1px no-repeat,
    linear-gradient(var(--line) 0 0) left 0 bottom calc(var(--sk-dock) - 1px) / 100% 1px no-repeat,
    linear-gradient(var(--line) 0 0) calc(var(--sk-nav) - 1px) var(--sk-top) / 1px calc(100% - var(--sk-top) - var(--sk-status) - var(--sk-dock)) no-repeat,
    linear-gradient(var(--line) 0 0) right calc(var(--sk-insp) - 1px) top var(--sk-top) / 1px calc(100% - var(--sk-top) - var(--sk-status) - var(--sk-dock)) no-repeat,
    linear-gradient(var(--surface) 0 0) 0 0 / 100% var(--sk-top) no-repeat,
    linear-gradient(var(--surface) 0 0) left 0 bottom 0 / 100% calc(var(--sk-status) + var(--sk-dock)) no-repeat,
    linear-gradient(var(--surface) 0 0) 0 0 / var(--sk-nav) 100% no-repeat,
    linear-gradient(var(--surface) 0 0) 100% 0 / var(--sk-insp) 100% no-repeat,
    var(--scan-studio-canvas);
  /* the right-hand column is measured from the edge of the screen, past the gutter */
  background-origin: border-box;
}

html.fr-studio[data-theme="dark"] .route-loading {
  --sk-shine: rgb(255 255 255 / 7%);
  --sk-paper: #f1ece1;
  --sk-scan: #e2dfd8;
  --sk-brand: var(--sk-brand-dark);
  --sk-head-left: var(--sk-head-left-dark);
  --sk-head-right: var(--sk-head-right-dark);
}

/* the two cards */
html.fr-studio .route-loading::before,
html.fr-studio .route-loading::after {
  --sk-y: var(--sk-card-top);
  --sk-score: calc(68px + var(--sk-strip-h));
  position: absolute;
  z-index: -1;
  top: var(--sk-y);
  right: calc(var(--sk-insp) + var(--sk-pad-x));
  left: calc(var(--sk-nav) + var(--sk-pad-x));
  height: var(--sk-card-h);
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--sk-radius);
  content: "";
  background:
    /* the head: the system's number and name, three chips; the Done switch
       and ⋯ at its right */
    var(--sk-head-left) 0 0 / var(--sk-head-w) 44px no-repeat,
    var(--sk-head-right) right 0 top 0 / 150px 44px no-repeat,
    /* (the frame is paper: square, no corners to round) */
    /* the gutter: its edge, and its words on end, "Scan" and "Transcription" */
    linear-gradient(rgb(27 25 23 / 8%) 0 0) 33px 44px / 1px var(--sk-frame-h) no-repeat,
    linear-gradient(var(--sk-ink-soft) 0 0) 20px calc(28px + var(--sk-strip-h) / 2) / 5px 32px no-repeat,
    linear-gradient(var(--sk-ink-soft) 0 0) 20px calc(var(--sk-score) + var(--sk-sheet-h) / 2 - 44px) / 5px 88px no-repeat,
    /* the score: a grand staff, its staves joined at the left */
    linear-gradient(var(--sk-ink) 0 0) 58px calc(var(--sk-score) + var(--sk-sheet-h) * 0.18) / 1.5px calc(var(--sk-sheet-h) * 0.49 + var(--sk-sg2) * 4 + 1px) no-repeat,
    repeating-linear-gradient(var(--sk-ink) 0 1px, transparent 1px var(--sk-sg2)) 58px calc(var(--sk-score) + var(--sk-sheet-h) * 0.18) / calc(100% - 94px) calc(var(--sk-sg2) * 4 + 1px) no-repeat,
    repeating-linear-gradient(var(--sk-ink) 0 1px, transparent 1px var(--sk-sg2)) 58px calc(var(--sk-score) + var(--sk-sheet-h) * 0.67) / calc(100% - 94px) calc(var(--sk-sg2) * 4 + 1px) no-repeat,
    /* the ruler's line */
    linear-gradient(rgb(27 25 23 / 7%) 0 0) 34px calc(67px + var(--sk-strip-h)) / calc(100% - 46px) 1px no-repeat,
    /* the scan: a printed system - two staves, the verses between them */
    repeating-linear-gradient(90deg, var(--sk-print-soft) 0 34px, transparent 34px 42px, var(--sk-print-soft) 42px 58px, transparent 58px 66px, var(--sk-print-soft) 66px 90px, transparent 90px 98px) 70px calc(44px + var(--sk-strip-h) * 0.38) / calc(100% - 110px) calc(var(--sk-strip-h) * 0.05) no-repeat,
    repeating-linear-gradient(90deg, var(--sk-print-soft) 0 22px, transparent 22px 30px, var(--sk-print-soft) 30px 62px, transparent 62px 70px, var(--sk-print-soft) 70px 84px, transparent 84px 92px) 70px calc(44px + var(--sk-strip-h) * 0.465) / calc(100% - 110px) calc(var(--sk-strip-h) * 0.05) no-repeat,
    repeating-linear-gradient(90deg, var(--sk-print-soft) 0 28px, transparent 28px 36px, var(--sk-print-soft) 36px 46px, transparent 46px 54px, var(--sk-print-soft) 54px 86px, transparent 86px 94px) 70px calc(44px + var(--sk-strip-h) * 0.55) / calc(100% - 110px) calc(var(--sk-strip-h) * 0.05) no-repeat,
    linear-gradient(var(--sk-print) 0 0) 58px calc(44px + var(--sk-strip-h) * 0.07) / 1.5px calc(var(--sk-strip-h) * 0.6 + var(--sk-sg) * 4 + 1px) no-repeat,
    repeating-linear-gradient(var(--sk-print) 0 1px, transparent 1px var(--sk-sg)) 58px calc(44px + var(--sk-strip-h) * 0.07) / calc(100% - 80px) calc(var(--sk-sg) * 4 + 1px) no-repeat,
    repeating-linear-gradient(var(--sk-print) 0 1px, transparent 1px var(--sk-sg)) 58px calc(44px + var(--sk-strip-h) * 0.67) / calc(100% - 80px) calc(var(--sk-sg) * 4 + 1px) no-repeat,
    linear-gradient(var(--sk-scan) 0 0) 34px 44px / calc(100% - 46px) var(--sk-strip-h) no-repeat,
    /* the frame's paper */
    linear-gradient(var(--sk-paper) 0 0) 12px 44px / calc(100% - 24px) var(--sk-frame-h) no-repeat,
    var(--surface);
  /* a card reaching past the stage goes on under the status bar and dock */
  -webkit-mask: linear-gradient(#000 0 0) 0 0 / 100% calc(100dvh - var(--sk-y) - var(--sk-status) - var(--sk-dock)) no-repeat;
  mask: linear-gradient(#000 0 0) 0 0 / 100% calc(100dvh - var(--sk-y) - var(--sk-status) - var(--sk-dock)) no-repeat;
}

html.fr-studio .route-loading::after {
  --sk-y: calc(var(--sk-card-top) + var(--sk-card-h) + var(--sk-gap));
}

/* The site's loader, a holder here: the shapes of the app bar, the palette,
   the navigator, the inspector, the status bar and the dock (::before,
   measured from the screen's edges), and the light over the cards' paper
   (::after, measured as the cards are, inside the gutter). Each is one
   surface drawn through a mask of shapes (the drawings below). */
html.fr-studio .route-loading .loader {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  animation: none;
  pointer-events: none;
}

html.fr-studio .route-loading .loader::before,
html.fr-studio .route-loading .loader::after {
  content: "";
  animation: fr-studio-skeleton-light 1.2s linear infinite;
}

html.fr-studio .route-loading .loader::before {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(100deg, transparent 40%, var(--sk-shine) 50%, transparent 60%) 150% 0 / 200% 100% no-repeat,
    var(--sk-shape);
  /* the status bar's and the dock's shapes, then everything above them cut
     at the status bar (a panel's shapes reaching past the stage go on
     under it, as its cards do) */
  mask:
    var(--sk-status-left) left 0 bottom var(--sk-dock) / auto var(--sk-status) no-repeat,
    var(--sk-status-right) right 0 bottom var(--sk-dock) / auto var(--sk-status) no-repeat,
    var(--sk-keys) 0 100% / 100% var(--sk-dock) no-repeat,
    linear-gradient(#000 0 0) 0 0 / 100% calc(100% - var(--sk-status) - var(--sk-dock)) no-repeat,
    var(--sk-bar-left) 0 var(--sk-bar-y) / auto var(--sk-bar-art) no-repeat,
    var(--sk-bar-right) right 0 top var(--sk-bar-y) / auto var(--sk-bar-art) no-repeat,
    var(--sk-pal-select) 0 var(--sk-pal-y) / auto var(--sk-pal-h) no-repeat,
    var(--sk-pal-kit) var(--sk-pal-x) var(--sk-pal-y) / max(0px, 100% - var(--sk-pal-x) - var(--sk-pal-transport-w) - 16px) var(--sk-pal-h) no-repeat,
    var(--sk-pal-transport) right 8px top var(--sk-pal-y) / auto var(--sk-pal-h) no-repeat,
    var(--sk-nav-head) 0 var(--sk-top) / calc(80px * var(--sk-navp)) auto no-repeat,
    var(--sk-nav-icons) calc(var(--sk-nav) - 70px) calc(var(--sk-top) + 13px) / calc(54px * var(--sk-navp)) auto no-repeat,
    var(--sk-nav-page) 12px calc(var(--sk-top) + 46px) / calc((var(--sk-nav) - 24px) * var(--sk-navp)) auto no-repeat,
    linear-gradient(rgb(0 0 0 / 30%) 0 0) 12px calc(var(--sk-top) + 58px + var(--sk-pvh)) / calc((var(--sk-nav) - 24px) * var(--sk-navp)) 34px no-repeat,
    var(--sk-nav-rows) 12px calc(var(--sk-top) + 108px + var(--sk-pvh)) / calc(150px * var(--sk-navp)) auto no-repeat,
    var(--sk-nav-rings) calc(var(--sk-nav) - 42px) calc(var(--sk-top) + 108px + var(--sk-pvh)) / calc(20px * var(--sk-navp)) auto no-repeat,
    var(--sk-rail) 0 var(--sk-top) / calc(60px * var(--sk-navr)) auto no-repeat,
    var(--sk-insp-art) right 0 top var(--sk-top) / var(--sk-insp) auto no-repeat;
  mask-composite: add, add, add, intersect, add, add, add, add, add, add, add, add, add, add, add, add, add;
}

html.fr-studio .route-loading .loader::after {
  --sk-paper-x: calc(var(--sk-nav) + var(--sk-pad-x) + 13px);
  --sk-paper-w: calc(100% - var(--sk-nav) - var(--sk-insp) - 2 * var(--sk-pad-x) - 26px);
  position: absolute;
  top: var(--sk-top);
  right: 0;
  bottom: calc(var(--sk-status) + var(--sk-dock));
  left: 0;
  background: linear-gradient(100deg, transparent 40%, rgb(255 255 255 / 62%) 50%, transparent 60%) 150% 0 / 200% 100% no-repeat;
  mask:
    linear-gradient(#000 0 0) var(--sk-paper-x) calc(var(--sk-pad-top) + 45px) / var(--sk-paper-w) var(--sk-frame-h) no-repeat,
    linear-gradient(#000 0 0) var(--sk-paper-x) calc(var(--sk-pad-top) + var(--sk-card-h) + var(--sk-gap) + 45px) / var(--sk-paper-w) calc(var(--sk-frame-h) * var(--sk-second)) no-repeat;
}

@keyframes fr-studio-skeleton-light {
  to { background-position: -50% 0, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html.fr-studio .route-loading .loader::before,
  html.fr-studio .route-loading .loader::after {
    animation: none;
  }
}

/* forced colours: the shapes in the system's quiet ink, lightly, no light
   passing */
@media (forced-colors: active) {
  html.fr-studio .route-loading .loader::before {
    background: color-mix(in srgb, GrayText 45%, Canvas);
    forced-color-adjust: none;
  }

  html.fr-studio .route-loading .loader::after {
    display: none;
  }
}

/* the workbench's tiers (score-workbench.css §3), by the screen's width: the
   studio has the whole of it */
@media (pointer: coarse) {
  html.fr-studio .route-loading {
    --sk-pal: 52px;
  }
}

@media (max-width: 1439.98px) {
  html.fr-studio .route-loading {
    --sk-nav: 60px;
    --sk-insp: 288px;
    --sk-navp: 0;
    --sk-navr: 1;
  }
}

@media (min-width: 1440px) {
  html.fr-studio[data-studio-nav="rail"] .route-loading {
    --sk-nav: 60px;
    --sk-navp: 0;
    --sk-navr: 1;
  }
}

@media (min-width: 1180px) {
  html.fr-studio[data-studio-insp="closed"] .route-loading {
    --sk-insp: 0px;
  }
}

@media (max-width: 1179.98px) {
  html.fr-studio .route-loading {
    --sk-insp: 0px;
  }
}

@media (max-width: 899.98px) {
  html.fr-studio .route-loading {
    --sk-nav: 0px;
    --sk-bar: 48px;
    --sk-pad-x: 12px;
    --sk-navp: 0;
    --sk-navr: 0;
  }
}

@media (max-width: 599.98px) {
  html.fr-studio .route-loading {
    --sk-pad-x: 0px;
    --sk-pad-top: 10px;
    --sk-gap: 10px;
    --sk-radius: 0px;
  }

  html.fr-studio .route-loading::before,
  html.fr-studio .route-loading::after {
    border-inline-width: 0;
  }
}

@media (max-height: 560px) {
  html.fr-studio .route-loading {
    --sk-bar: 44px;
    --sk-pal: 42px;
    --sk-status: 0px;
    --sk-pad-top: 8px;
  }
}

/* a short touch screen keeps the 52 px touch palette row */
@media (pointer: coarse) and (max-height: 560px) {
  html.fr-studio .route-loading {
    --sk-pal: 52px;
  }
}

@media (max-width: 599.98px) {
  html.fr-studio .route-loading {
    --sk-pal: 0px;
    --sk-status: 0px;
  }
}

@media (pointer: coarse) and (max-width: 899.98px) {
  html.fr-studio .route-loading {
    --sk-pal: 0px;
  }
}

/* the palette's captions when it is wide */
@media (min-width: 1600px) {
  html.fr-studio .route-loading {
    --sk-pal: 60px;
  }
}

@media (min-width: 1600px) and (pointer: coarse) {
  html.fr-studio .route-loading {
    --sk-pal: 74px;
  }
}

/* which app bar and palette the workbench lays out at this width and
   pointer (score-appbar.css, the palette's groups as they fold): the
   drawings below */
@media (max-width: 1439.98px) {
  html.fr-studio .route-loading {
    --sk-bar-left: var(--sk-bar-left-l);
  }
}

@media (max-width: 1365.98px) {
  html.fr-studio .route-loading {
    --sk-pal-select: var(--sk-pal-select-compact);
    --sk-pal-x: 98px;
  }
}

@media (max-width: 1279.98px) {
  html.fr-studio .route-loading {
    --sk-pal-kit: var(--sk-pal-tools-narrow);
  }
}

@media (max-width: 1099.98px) {
  html.fr-studio .route-loading {
    --sk-bar-left: var(--sk-bar-left-m);
    --sk-pal-transport: var(--sk-pal-transport-compact);
    --sk-pal-transport-w: 88px;
  }
}

@media (max-width: 1023.98px) {
  html.fr-studio .route-loading {
    --sk-pal-kit: var(--sk-pal-tools-tiny);
  }
}

@media (pointer: coarse) {
  html.fr-studio .route-loading {
    --sk-bar-left: var(--sk-bar-left-t);
    --sk-bar-right: var(--sk-bar-right-t);
    --sk-brand-x: 16px;
    --sk-pal-select: var(--sk-pal-select-compact);
    --sk-pal-x: 98px;
  }
}

@media (max-width: 899.98px) {
  html.fr-studio .route-loading {
    --sk-bar-left: var(--sk-bar-left-s);
    --sk-bar-right: var(--sk-bar-right-sf);
    --sk-brand-x: 12px;
  }
}

@media (pointer: coarse) and (max-width: 899.98px) {
  html.fr-studio .route-loading {
    --sk-bar-left: var(--sk-bar-left-sc);
    --sk-bar-right: var(--sk-bar-right-sc);
    --sk-brand-x: 16px;
  }
}

/* (phones: the stage shows its active card alone, the scan at a readable
   height) */
@media (max-width: 599.98px) {
  html.fr-studio .route-loading {
    --sk-bar-left: var(--sk-bar-left-xs);
    --sk-bar-right: var(--sk-bar-right-xs);
    --sk-brand-x: 12px;
    --sk-strip-h: 258px;
    --sk-sheet-h: 220px;
    --sk-second: 0;
    --sk-head-w: 124px;
  }

  html.fr-studio .route-loading::after {
    display: none;
  }
}

@media (max-width: 379.98px) {
  html.fr-studio .route-loading {
    --sk-bar-right: var(--sk-bar-right-xxs);
  }
}

/* (short screens: the bar's buttons are lower) */
@media (max-height: 560px) {
  html.fr-studio .route-loading {
    --sk-bar-art: 47px;
  }
}

/* the keypad dock: one row of 44 px keys in Select mode, three in Input
   mode, the short row on short screens (score-workbench.css §11); on
   phones and touch tablets, or everywhere when the corrector keeps it
   ("always"), never when they turned it off */
html.fr-studio .route-loading {
  --sk-dock-h: calc(61px + env(safe-area-inset-bottom));
}

html.fr-studio[data-studio-mode="input"] .route-loading {
  --sk-dock-h: calc(159px + env(safe-area-inset-bottom));
  --sk-keys: var(--sk-dock-keys-input);
}

@media (max-height: 560px) {
  html.fr-studio .route-loading,
  html.fr-studio[data-studio-mode="input"] .route-loading {
    --sk-dock-h: calc(57px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 599.98px), (pointer: coarse) and (max-width: 899.98px) {
  html.fr-studio .route-loading {
    --sk-dock: var(--sk-dock-h);
  }
}

html.fr-studio[data-studio-keypad="always"] .route-loading {
  --sk-dock: var(--sk-dock-h);
}

html.fr-studio[data-studio-keypad="never"] .route-loading {
  --sk-dock: 0px;
}

/* The skeleton's drawings, masks for its shapes (black is drawn, fainter is
   fainter), as the studio lays its parts out (measured from it at each
   tier): the app bar's two ends (-xl ... -xs by tier), the palette's
   Select/Input, tools and transport, the navigator's head, page, systems
   and their rings, the rail, the inspector (drawn 304 wide, scaled to its
   column), the status bar's two ends, the dock's keys (in % of its width);
   a card's head in the shapes' ink (light, dark) and the site's mark as the
   app bar draws it (scan-transcribe.mjs BRAND_MARK). */
html.fr-studio .route-loading {
  --sk-bar-left-xl: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='560' height='52' viewBox='0 0 560 52'><g opacity='.85'><rect x='63' y='21' width='38' height='10' rx='5'/><rect x='316' y='21' width='62' height='10' rx='5'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.6'><path d='M113 20l-3 12' stroke-width='1.4'/></g><rect x='121' y='16' width='14' height='20' rx='2.5'/><rect x='143' y='20' width='108' height='12' rx='6'/><rect x='475' y='19' width='64' height='14' rx='7'/><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M289.5 21l-5 5 5 5' stroke-width='1.8'/><rect x='305.75' y='10.75' width='119.5' height='30.5' rx='5.25'/><path d='M442.5 21l5 5-5 5' stroke-width='1.8'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.85'><path d='M408 24l4 4 4-4' stroke-width='1.6'/></g></svg>");
  --sk-bar-left-l: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='540' height='52' viewBox='0 0 540 52'><g opacity='.85'><rect x='63' y='21' width='38' height='10' rx='5'/><rect x='294' y='21' width='62' height='10' rx='5'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.6'><path d='M113 20l-3 12' stroke-width='1.4'/></g><rect x='121' y='20' width='108' height='12' rx='6'/><rect x='453' y='19' width='64' height='14' rx='7'/><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M267.5 21l-5 5 5 5' stroke-width='1.8'/><rect x='283.75' y='10.75' width='119.5' height='30.5' rx='5.25'/><path d='M420.5 21l5 5-5 5' stroke-width='1.8'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.85'><path d='M386 24l4 4 4-4' stroke-width='1.6'/></g></svg>");
  --sk-bar-left-m: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='480' height='52' viewBox='0 0 480 52'><rect x='63' y='20' width='108' height='12' rx='6'/><rect x='395' y='19' width='64' height='14' rx='7'/><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M209.5 21l-5 5 5 5' stroke-width='1.8'/><rect x='225.75' y='10.75' width='119.5' height='30.5' rx='5.25'/><path d='M362.5 21l5 5-5 5' stroke-width='1.8'/></g><g opacity='.85'><rect x='236' y='21' width='62' height='10' rx='5'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.85'><path d='M328 24l4 4 4-4' stroke-width='1.6'/></g></svg>");
  --sk-bar-left-t: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='570' height='52' viewBox='0 0 570 52'><g opacity='.85'><rect x='71' y='21' width='38' height='10' rx='5'/><rect x='314' y='21' width='62' height='10' rx='5'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.6'><path d='M121 20l-3 12' stroke-width='1.4'/></g><rect x='129' y='20' width='108' height='12' rx='6'/><rect x='485' y='19' width='64' height='14' rx='7'/><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M281.5 21l-5 5 5 5' stroke-width='1.8'/><rect x='303.75' y='4.75' width='119.5' height='42.5' rx='5.25'/><path d='M446.5 21l5 5-5 5' stroke-width='1.8'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.85'><path d='M406 24l4 4 4-4' stroke-width='1.6'/></g></svg>");
  --sk-bar-left-s: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='52' viewBox='0 0 300 52'><rect x='92' y='18' width='10' height='16' rx='2.5'/><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M136.5 21l-5 5 5 5' stroke-width='1.8'/><rect x='152.75' y='10.75' width='75.5' height='30.5' rx='5.25'/><path d='M244.5 21l5 5-5 5' stroke-width='1.8'/></g><g opacity='.85'><rect x='163' y='21' width='34' height='10' rx='5'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.85'><path d='M211 24l4 4 4-4' stroke-width='1.6'/></g></svg>");
  --sk-bar-left-sc: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='52' viewBox='0 0 300 52'><rect x='98' y='18' width='10' height='16' rx='2.5'/><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M151.5 21l-5 5 5 5' stroke-width='1.8'/><rect x='173.75' y='4.75' width='75.5' height='42.5' rx='5.25'/><path d='M271.5 21l5 5-5 5' stroke-width='1.8'/></g><g opacity='.85'><rect x='184' y='21' width='34' height='10' rx='5'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.85'><path d='M232 24l4 4 4-4' stroke-width='1.6'/></g></svg>");
  --sk-bar-left-xs: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='230' height='52' viewBox='0 0 230 52'><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M74.5 21l-5 5 5 5' stroke-width='1.8'/><rect x='96.75' y='4.75' width='75.5' height='42.5' rx='5.25'/><path d='M194.5 21l5 5-5 5' stroke-width='1.8'/></g><g opacity='.85'><rect x='107' y='21' width='34' height='10' rx='5'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.85'><path d='M155 24l4 4 4-4' stroke-width='1.6'/></g></svg>");
  --sk-bar-right-d: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='560' height='52' viewBox='0 0 560 52'><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='64.75' y='12.75' width='133.5' height='26.5' rx='13.25'/><rect x='277.75' y='10.75' width='82.5' height='30.5' rx='5.25'/></g><circle cx='78' cy='26' r='4'/><rect x='367' y='10' width='145' height='32' rx='6'/><circle cx='528' cy='26' r='2'/><circle cx='534' cy='26' r='2'/><circle cx='540' cy='26' r='2'/><g opacity='.85'><rect x='89' y='21' width='95' height='10' rx='5'/><rect x='288' y='20' width='12' height='12' rx='3'/><rect x='311' y='21' width='36' height='10' rx='5'/></g><g opacity='.8'><rect x='212' y='17' width='18' height='18' rx='5'/><rect x='246' y='17' width='18' height='18' rx='5'/></g></svg>");
  --sk-bar-right-t: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='560' height='52' viewBox='0 0 560 52'><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='28.75' y='10.75' width='133.5' height='30.5' rx='15.25'/><rect x='265.75' y='4.75' width='82.5' height='42.5' rx='5.25'/></g><circle cx='42' cy='26' r='4'/><rect x='355' y='4' width='145' height='44' rx='6'/><circle cx='522' cy='26' r='2'/><circle cx='528' cy='26' r='2'/><circle cx='534' cy='26' r='2'/><g opacity='.85'><rect x='53' y='21' width='95' height='10' rx='5'/><rect x='276' y='20' width='12' height='12' rx='3'/><rect x='299' y='21' width='36' height='10' rx='5'/></g><g opacity='.8'><rect x='182' y='17' width='18' height='18' rx='5'/><rect x='228' y='17' width='18' height='18' rx='5'/></g></svg>");
  --sk-bar-right-sc: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='560' height='52' viewBox='0 0 560 52'><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='124.75' y='10.75' width='133.5' height='30.5' rx='15.25'/><rect x='265.75' y='4.75' width='82.5' height='42.5' rx='5.25'/></g><circle cx='138' cy='26' r='4'/><rect x='355' y='4' width='145' height='44' rx='6'/><circle cx='522' cy='26' r='2'/><circle cx='528' cy='26' r='2'/><circle cx='534' cy='26' r='2'/><g opacity='.85'><rect x='149' y='21' width='95' height='10' rx='5'/><rect x='276' y='20' width='12' height='12' rx='3'/><rect x='299' y='21' width='36' height='10' rx='5'/></g></svg>");
  --sk-bar-right-sf: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='560' height='52' viewBox='0 0 560 52'><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='256.75' y='12.75' width='66.5' height='26.5' rx='13.25'/><rect x='329.75' y='10.75' width='30.5' height='30.5' rx='5.25'/></g><circle cx='270' cy='26' r='4'/><rect x='367' y='10' width='145' height='32' rx='6'/><circle cx='528' cy='26' r='2'/><circle cx='534' cy='26' r='2'/><circle cx='540' cy='26' r='2'/><g opacity='.85'><rect x='281' y='21' width='31' height='10' rx='5'/><rect x='339' y='20' width='12' height='12' rx='3'/></g></svg>");
  --sk-bar-right-xs: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='560' height='52' viewBox='0 0 560 52'><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='397.75' y='10.75' width='66.5' height='30.5' rx='15.25'/></g><circle cx='411' cy='26' r='4'/><rect x='479' y='17' width='18' height='18' rx='5'/><circle cx='528' cy='26' r='2'/><circle cx='534' cy='26' r='2'/><circle cx='540' cy='26' r='2'/><g opacity='.85'><rect x='422' y='21' width='31' height='10' rx='5'/></g></svg>");
  --sk-bar-right-xxs: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='560' height='52' viewBox='0 0 560 52'><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='432.75' y='10.75' width='30.5' height='30.5' rx='15.25'/></g><circle cx='448' cy='26' r='4'/><rect x='479' y='17' width='18' height='18' rx='5'/><circle cx='526' cy='26' r='2'/><circle cx='532' cy='26' r='2'/><circle cx='538' cy='26' r='2'/></svg>");
  --sk-pal-select-full: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='196' height='48' viewBox='0 0 196 48'><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.55'><rect x='15.75' y='7.75' width='171.5' height='32.5' rx='7.25'/></g><rect x='19' y='11' width='82' height='26' rx='6'/><g opacity='.4'><rect x='102' y='11' width='82' height='26' rx='6'/></g></svg>");
  --sk-pal-select-compact: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='98' height='48' viewBox='0 0 98 48'><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.55'><rect x='15.75' y='7.75' width='74.5' height='32.5' rx='7.25'/></g><rect x='19' y='11' width='34' height='26' rx='6'/><g opacity='.4'><rect x='53' y='11' width='34' height='26' rx='6'/></g></svg>");
  --sk-pal-tools: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='994' height='48' viewBox='0 0 994 48' preserveAspectRatio='xMinYMid slice'><g opacity='.55'><rect x='0' y='12' width='1' height='24'/><rect x='348' y='12' width='1' height='24'/><rect x='466' y='12' width='1' height='24'/><rect x='689' y='12' width='1' height='24'/><rect x='793' y='12' width='1' height='24'/></g><rect x='17' y='15' width='18' height='18' rx='5'/><rect x='57' y='15' width='18' height='18' rx='5'/><rect x='97' y='15' width='18' height='18' rx='5'/><rect x='137' y='15' width='18' height='18' rx='5'/><rect x='177' y='15' width='18' height='18' rx='5'/><rect x='217' y='15' width='18' height='18' rx='5'/><rect x='257' y='15' width='18' height='18' rx='5'/><rect x='297' y='15' width='10' height='18' rx='3'/><rect x='364' y='15' width='18' height='18' rx='5'/><rect x='400' y='15' width='18' height='18' rx='5'/><rect x='436' y='15' width='18' height='18' rx='5'/><rect x='481' y='15' width='18' height='18' rx='5'/><rect x='515' y='15' width='18' height='18' rx='5'/><rect x='549' y='15' width='18' height='18' rx='5'/><rect x='583' y='15' width='18' height='18' rx='5'/><rect x='617' y='15' width='18' height='18' rx='5'/><rect x='651' y='15' width='18' height='18' rx='5'/><circle cx='815' cy='24' r='3'/><circle cx='862' cy='24' r='3'/><circle cx='909' cy='24' r='3'/><circle cx='956' cy='24' r='3'/><g opacity='.85'><rect x='313' y='19' width='26' height='10' rx='5'/><rect x='724' y='19' width='36' height='10' rx='5'/><rect x='822' y='19' width='12' height='10' rx='5'/><rect x='869' y='19' width='12' height='10' rx='5'/><rect x='916' y='19' width='12' height='10' rx='5'/><rect x='963' y='19' width='12' height='10' rx='5'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='697.75' y='10.75' width='86.5' height='26.5' rx='5.25'/><rect x='849.75' y='10.75' width='41.5' height='26.5' rx='13.25'/><rect x='896.75' y='10.75' width='41.5' height='26.5' rx='13.25'/><rect x='943.75' y='10.75' width='41.5' height='26.5' rx='13.25'/></g><g opacity='.9'><rect x='802' y='10' width='43' height='28' rx='14'/></g></svg>");
  --sk-pal-tools-narrow: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='805' height='48' viewBox='0 0 805 48' preserveAspectRatio='xMinYMid slice'><g opacity='.55'><rect x='0' y='12' width='1' height='24'/><rect x='348' y='12' width='1' height='24'/><rect x='466' y='12' width='1' height='24'/><rect x='621' y='12' width='1' height='24'/><rect x='725' y='12' width='1' height='24'/></g><rect x='17' y='15' width='18' height='18' rx='5'/><rect x='57' y='15' width='18' height='18' rx='5'/><rect x='97' y='15' width='18' height='18' rx='5'/><rect x='137' y='15' width='18' height='18' rx='5'/><rect x='177' y='15' width='18' height='18' rx='5'/><rect x='217' y='15' width='18' height='18' rx='5'/><rect x='257' y='15' width='18' height='18' rx='5'/><rect x='297' y='15' width='10' height='18' rx='3'/><rect x='364' y='15' width='18' height='18' rx='5'/><rect x='400' y='15' width='18' height='18' rx='5'/><rect x='436' y='15' width='18' height='18' rx='5'/><rect x='481' y='15' width='18' height='18' rx='5'/><rect x='515' y='15' width='18' height='18' rx='5'/><rect x='549' y='15' width='18' height='18' rx='5'/><rect x='583' y='15' width='18' height='18' rx='5'/><circle cx='747' cy='24' r='3'/><g opacity='.85'><rect x='313' y='19' width='26' height='10' rx='5'/><rect x='656' y='19' width='36' height='10' rx='5'/><rect x='754' y='19' width='12' height='10' rx='5'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='629.75' y='10.75' width='86.5' height='26.5' rx='5.25'/></g><g opacity='.9'><rect x='734' y='10' width='43' height='28' rx='14'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.85'><path d='M783 22l4 4 4-4' stroke-width='1.6'/></g></svg>");
  --sk-pal-tools-tiny: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='415' height='48' viewBox='0 0 415 48' preserveAspectRatio='xMinYMid slice'><g opacity='.55'><rect x='0' y='12' width='1' height='24'/><rect x='72' y='12' width='1' height='24'/><rect x='144' y='12' width='1' height='24'/><rect x='231' y='12' width='1' height='24'/><rect x='335' y='12' width='1' height='24'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='8.75' y='10.75' width='54.5' height='26.5' rx='5.25'/><rect x='80.75' y='10.75' width='54.5' height='26.5' rx='5.25'/><rect x='239.75' y='10.75' width='86.5' height='26.5' rx='5.25'/></g><rect x='18' y='17' width='14' height='14' rx='4'/><rect x='90' y='17' width='14' height='14' rx='4'/><rect x='159' y='15' width='18' height='18' rx='5'/><rect x='193' y='15' width='18' height='18' rx='5'/><circle cx='357' cy='24' r='3'/><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.85'><path d='M44 22l4 4 4-4' stroke-width='1.6'/><path d='M116 22l4 4 4-4' stroke-width='1.6'/><path d='M393 22l4 4 4-4' stroke-width='1.6'/></g><g opacity='.85'><rect x='266' y='19' width='36' height='10' rx='5'/><rect x='364' y='19' width='12' height='10' rx='5'/></g><g opacity='.9'><rect x='344' y='10' width='43' height='28' rx='14'/></g></svg>");
  --sk-pal-transport-full: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='48' viewBox='0 0 160 48'><path d='M14 14.5l13 9.5-13 9.5z'/><rect x='132' y='15' width='18' height='18' rx='5'/><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='46.75' y='10.75' width='70.5' height='26.5' rx='5.25'/></g><g opacity='.85'><rect x='56' y='16' width='8' height='16' rx='3'/><rect x='70' y='19' width='38' height='10' rx='5'/></g></svg>");
  --sk-pal-transport-compact: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='88' height='48' viewBox='0 0 88 48'><path d='M14 14.5l13 9.5-13 9.5z'/><rect x='50' y='15' width='18' height='18' rx='5'/></svg>");
  --sk-nav-head: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='44' viewBox='0 0 80 44'><g opacity='.8'><rect x='14' y='18' width='40' height='8' rx='4'/></g></svg>");
  --sk-nav-icons: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='54' height='18' viewBox='0 0 54 18'><g opacity='.8'><rect x='0' y='0' width='18' height='18' rx='5'/><rect x='36' y='0' width='18' height='18' rx='5'/></g></svg>");
  --sk-nav-page: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='311' viewBox='-20 0 220 311'><g opacity='.45'><rect x='0' y='0' width='200' height='311' rx='3'/></g><g opacity='.75'><rect x='10' y='18' width='180' height='46' rx='2'/><rect x='10' y='75' width='180' height='46' rx='2'/><rect x='10' y='132' width='180' height='46' rx='2'/><rect x='10' y='189' width='180' height='46' rx='2'/><rect x='10' y='246' width='180' height='46' rx='2'/></g><rect x='-20' y='18' width='16' height='16' rx='4'/><g opacity='.6'><rect x='-20' y='75' width='16' height='16' rx='4'/><rect x='-20' y='132' width='16' height='16' rx='4'/><rect x='-20' y='189' width='16' height='16' rx='4'/><rect x='-20' y='246' width='16' height='16' rx='4'/></g></svg>");
  --sk-nav-rows: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='250' viewBox='0 0 150 250'><g opacity='.8'><rect x='2' y='0' width='58' height='8' rx='4'/></g><rect x='9' y='30' width='24' height='24' rx='6'/><rect x='42' y='30' width='62' height='11' rx='5.5'/><rect x='42' y='76' width='62' height='11' rx='5.5'/><rect x='42' y='122' width='62' height='11' rx='5.5'/><rect x='42' y='168' width='62' height='11' rx='5.5'/><rect x='42' y='214' width='62' height='11' rx='5.5'/><g opacity='.7'><rect x='42' y='47' width='96' height='8' rx='4'/><rect x='42' y='93' width='96' height='8' rx='4'/><rect x='42' y='139' width='96' height='8' rx='4'/><rect x='42' y='185' width='96' height='8' rx='4'/><rect x='42' y='231' width='96' height='8' rx='4'/></g><g opacity='.75'><rect x='9' y='76' width='24' height='24' rx='6'/><rect x='9' y='122' width='24' height='24' rx='6'/><rect x='9' y='168' width='24' height='24' rx='6'/><rect x='9' y='214' width='24' height='24' rx='6'/></g></svg>");
  --sk-nav-rings: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='250' viewBox='0 0 20 250'><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.9'><circle cx='10' cy='42' r='7.25'/><circle cx='10' cy='88' r='7.25'/><circle cx='10' cy='134' r='7.25'/><circle cx='10' cy='180' r='7.25'/><circle cx='10' cy='226' r='7.25'/></g></svg>");
  --sk-rail: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='320' viewBox='0 0 60 320'><g opacity='.8'><rect x='21' y='15' width='18' height='18' rx='5'/><rect x='21' y='297' width='18' height='18' rx='5'/></g><g opacity='.45'><rect x='10' y='48' width='40' height='62' rx='3'/></g><g opacity='.75'><rect x='14' y='54' width='32' height='12' rx='1.5'/><rect x='14' y='72' width='32' height='12' rx='1.5'/><rect x='14' y='90' width='32' height='12' rx='1.5'/><rect x='16' y='166' width='28' height='28' rx='7'/><rect x='16' y='204' width='28' height='28' rx='7'/><rect x='16' y='242' width='28' height='28' rx='7'/></g><rect x='16' y='128' width='28' height='28' rx='7'/></svg>");
  --sk-insp-art: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='304' height='704' viewBox='0 0 304 704'><g opacity='.75'><rect x='36' y='13' width='16' height='16' rx='4'/><rect x='108' y='13' width='16' height='16' rx='4'/><rect x='253' y='13' width='16' height='16' rx='4'/><rect x='78' y='135' width='92' height='8' rx='4'/><rect x='78' y='173' width='124' height='9' rx='4.5'/></g><g opacity='.7'><rect x='27' y='35' width='34' height='8' rx='4'/><rect x='99' y='35' width='34' height='8' rx='4'/><rect x='244' y='35' width='34' height='8' rx='4'/><rect x='48' y='248' width='128' height='8' rx='4'/><rect x='48' y='305' width='128' height='8' rx='4'/><rect x='48' y='362' width='128' height='8' rx='4'/><rect x='48' y='419' width='128' height='8' rx='4'/><rect x='48' y='476' width='128' height='8' rx='4'/></g><rect x='181' y='13' width='16' height='16' rx='4'/><rect x='172' y='35' width='34' height='8' rx='4'/><rect x='163' y='48' width='52' height='2' rx='1'/><rect x='78' y='149' width='110' height='16' rx='8'/><circle cx='26' cy='240' r='12'/><rect x='48' y='230' width='60' height='11' rx='5.5'/><rect x='48' y='287' width='60' height='11' rx='5.5'/><rect x='48' y='344' width='60' height='11' rx='5.5'/><circle cx='26' cy='411' r='12'/><rect x='48' y='401' width='60' height='11' rx='5.5'/><rect x='48' y='458' width='60' height='11' rx='5.5'/><circle cx='30' cy='546' r='3'/><rect x='84' y='541' width='58' height='10' rx='5'/><circle cx='30' cy='588' r='3'/><rect x='84' y='583' width='58' height='10' rx='5'/><circle cx='30' cy='630' r='3'/><rect x='84' y='625' width='58' height='10' rx='5'/><circle cx='30' cy='672' r='3'/><rect x='84' y='667' width='58' height='10' rx='5'/><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.7'><rect x='12.75' y='61.75' width='278.5' height='57.5' rx='7.25'/></g><g opacity='.8'><rect x='25' y='74' width='14' height='14' rx='4'/><rect x='47' y='75' width='200' height='9' rx='4.5'/><rect x='47' y='93' width='140' height='9' rx='4.5'/><rect x='14' y='206' width='66' height='8' rx='4'/><rect x='256' y='206' width='34' height='8' rx='4'/><rect x='14' y='512' width='42' height='8' rx='4'/><rect x='274' y='541' width='16' height='10' rx='5'/><rect x='274' y='583' width='16' height='10' rx='5'/><rect x='274' y='625' width='16' height='10' rx='5'/><rect x='274' y='667' width='16' height='10' rx='5'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='40' cy='158' r='23.5' stroke-width='3'/><circle cx='26' cy='297' r='11.25'/><rect x='230.75' y='285.75' width='58.5' height='26.5' rx='5.25'/><circle cx='26' cy='354' r='11.25'/><rect x='230.75' y='342.75' width='58.5' height='26.5' rx='5.25'/><circle cx='26' cy='468' r='11.25'/><rect x='230.75' y='456.75' width='58.5' height='26.5' rx='5.25'/><rect x='14.75' y='532.75' width='56.5' height='26.5' rx='13.25'/><rect x='14.75' y='574.75' width='56.5' height='26.5' rx='13.25'/><rect x='14.75' y='616.75' width='56.5' height='26.5' rx='13.25'/><rect x='14.75' y='658.75' width='56.5' height='26.5' rx='13.25'/></g><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='.8'><path d='M259 151l-5 5 5 5' stroke-width='1.8'/><path d='M281 151l5 5-5 5' stroke-width='1.8'/></g><g opacity='.45'><rect x='88' y='209.5' width='160' height='1'/></g><g opacity='.85'><rect x='38' y='541' width='13' height='10' rx='5'/><rect x='38' y='583' width='13' height='10' rx='5'/><rect x='38' y='625' width='13' height='10' rx='5'/><rect x='38' y='667' width='13' height='10' rx='5'/></g><g opacity='.5'><rect x='190' y='544' width='86' height='4' rx='2'/><rect x='190' y='586' width='86' height='4' rx='2'/><rect x='190' y='628' width='86' height='4' rx='2'/><rect x='190' y='670' width='86' height='4' rx='2'/></g></svg>");
  --sk-head-left-light: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='470' height='44' viewBox='0 0 470 44' preserveAspectRatio='xMinYMin slice' fill='%23e6e4de'><rect x='16' y='16' width='8' height='12' rx='2'/><rect x='34' y='16' width='74' height='12' rx='3'/><rect x='126' y='17' width='96' height='10' rx='3'/><rect x='240' y='17' width='98' height='10' rx='3'/><rect x='356' y='17' width='70' height='10' rx='3'/></svg>");
  --sk-head-right-light: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='44' viewBox='0 0 150 44' fill='%23e6e4de'><rect x='9.75' y='7.75' width='90.5' height='28.5' rx='3' fill='none' stroke='%23e6e4de' stroke-width='1.5'/><circle cx='25' cy='22' r='8'/><rect x='41' y='17' width='44' height='10' rx='3'/><circle cx='119' cy='22' r='2'/><circle cx='125' cy='22' r='2'/><circle cx='131' cy='22' r='2'/></svg>");
  --sk-head-left-dark: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='470' height='44' viewBox='0 0 470 44' preserveAspectRatio='xMinYMin slice' fill='%232e2d2a'><rect x='16' y='16' width='8' height='12' rx='2'/><rect x='34' y='16' width='74' height='12' rx='3'/><rect x='126' y='17' width='96' height='10' rx='3'/><rect x='240' y='17' width='98' height='10' rx='3'/><rect x='356' y='17' width='70' height='10' rx='3'/></svg>");
  --sk-head-right-dark: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='44' viewBox='0 0 150 44' fill='%232e2d2a'><rect x='9.75' y='7.75' width='90.5' height='28.5' rx='3' fill='none' stroke='%232e2d2a' stroke-width='1.5'/><circle cx='25' cy='22' r='8'/><rect x='41' y='17' width='44' height='10' rx='3'/><circle cx='119' cy='22' r='2'/><circle cx='125' cy='22' r='2'/><circle cx='131' cy='22' r='2'/></svg>");
  --sk-status-left: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='30' viewBox='0 0 400 30'><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='6.75' y='5.75' width='63.5' height='18.5' rx='4.25'/></g><g opacity='.85'><rect x='17' y='11' width='43' height='8' rx='4'/></g><g opacity='.8'><rect x='83' y='9' width='9' height='12' rx='3'/><rect x='98' y='11' width='44' height='8' rx='4'/><circle cx='160' cy='15' r='4'/><rect x='168' y='11' width='50' height='8' rx='4'/></g><g opacity='.7'><rect x='232' y='11' width='150' height='8' rx='4'/></g></svg>");
  --sk-status-right: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='30' viewBox='0 0 320 30'><g fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='17.75' y='3.75' width='141.5' height='22.5' rx='5.25'/></g><rect x='27' y='14.25' width='10' height='1.5' rx='.75'/><rect x='132' y='14.25' width='10' height='1.5' rx='.75'/><rect x='136.25' y='10' width='1.5' height='10' rx='.75'/><g opacity='.85'><rect x='48' y='11' width='68' height='8' rx='4'/></g><g opacity='.8'><rect x='178' y='8' width='14' height='14' rx='4'/><rect x='216' y='8' width='14' height='14' rx='4'/><rect x='254' y='8' width='14' height='14' rx='4'/><rect x='292' y='8' width='14' height='14' rx='4'/></g></svg>");
  --sk-dock-keys: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='2%' y='8' width='11%' height='44' rx='10'/><rect x='14%' y='8' width='11%' height='44' rx='10'/><rect x='26%' y='8' width='11%' height='44' rx='10'/><rect x='38%' y='8' width='11%' height='44' rx='10'/><rect x='50%' y='8' width='11%' height='44' rx='10'/><rect x='62%' y='8' width='11%' height='44' rx='10'/><rect x='74%' y='8' width='11%' height='44' rx='10'/><rect x='86%' y='8' width='11%' height='44' rx='10'/></svg>");
  --sk-dock-keys-input: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='2%' y='8' width='11%' height='44' rx='10'/><rect x='14%' y='8' width='11%' height='44' rx='10'/><rect x='26%' y='8' width='11%' height='44' rx='10'/><rect x='38%' y='8' width='11%' height='44' rx='10'/><rect x='50%' y='8' width='11%' height='44' rx='10'/><rect x='62%' y='8' width='11%' height='44' rx='10'/><rect x='74%' y='8' width='11%' height='44' rx='10'/><rect x='86%' y='8' width='11%' height='44' rx='10'/><rect x='2%' y='57' width='11%' height='44' rx='10'/><rect x='14%' y='57' width='11%' height='44' rx='10'/><rect x='26%' y='57' width='11%' height='44' rx='10'/><rect x='38%' y='57' width='11%' height='44' rx='10'/><rect x='50%' y='57' width='11%' height='44' rx='10'/><rect x='62%' y='57' width='11%' height='44' rx='10'/><rect x='74%' y='57' width='11%' height='44' rx='10'/><rect x='86%' y='57' width='11%' height='44' rx='10'/><rect x='2%' y='106' width='11%' height='44' rx='10'/><rect x='14%' y='106' width='11%' height='44' rx='10'/><rect x='26%' y='106' width='11%' height='44' rx='10'/><rect x='38%' y='106' width='11%' height='44' rx='10'/><rect x='50%' y='106' width='11%' height='44' rx='10'/><rect x='62%' y='106' width='11%' height='44' rx='10'/><rect x='74%' y='106' width='11%' height='44' rx='10'/><rect x='86%' y='106' width='11%' height='44' rx='10'/></svg>");
  --sk-brand-light: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='24' viewBox='0 0 32 32'><path fill='%23181715' d='M3 4.5h3.25v23H3z M3 4.5c3.6 0 6.4-.85 8.7-2.85l.8.9C10.1 5.2 7.35 6.6 6.25 6.85z M3 27.5c3.6 0 6.4.85 8.7 2.85l.8-.9c-2.4-2.65-5.15-4.05-6.25-4.3z M8.25 7.25h13.5v1.5H8.25z M8.25 15.25h13.5v1.5H8.25z M8.25 23.25h13.5v1.5H8.25z'/><ellipse cx='23.1' cy='12' rx='6.1' ry='4.3' transform='rotate(-20 23.1 12)' fill='%23a62a1b'/></svg>");
  --sk-brand-dark: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='24' viewBox='0 0 32 32'><path fill='%23ecebe6' d='M3 4.5h3.25v23H3z M3 4.5c3.6 0 6.4-.85 8.7-2.85l.8.9C10.1 5.2 7.35 6.6 6.25 6.85z M3 27.5c3.6 0 6.4.85 8.7 2.85l.8-.9c-2.4-2.65-5.15-4.05-6.25-4.3z M8.25 7.25h13.5v1.5H8.25z M8.25 15.25h13.5v1.5H8.25z M8.25 23.25h13.5v1.5H8.25z'/><ellipse cx='23.1' cy='12' rx='6.1' ry='4.3' transform='rotate(-20 23.1 12)' fill='%23f59e88'/></svg>");
}

/* the page on its way, for assistive tech (renderScanTranscribe) */
html.fr-studio .route-loading .sr-only {
  font-size: 1rem;
}

/* A page turn that takes a moment (stageWaits): skeleton cards over the
   stage, where its cards sit (the stage's padding is copied onto it, and it
   keeps the same scrollbar gutter), the words over the first card; the
   stage stays underneath as it was. What still shows the page being left
   fades - the navigator, the inspector, the banners, the status bar - and
   the title goes; the app bar's pager already names the page on its way.
   Over the stage's sticky card heads (5), under the snackbar (20). */
html.fr-studio .scan-turn {
  position: relative;
  z-index: 8;
  grid-row: 2;
  grid-column: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  scrollbar-gutter: stable;
  background: var(--st-canvas);
  cursor: progress;
  animation: scan-turn-in 160ms var(--st-ease) both;
}

/* (on phones the stage shows its active card alone: the skeleton shows both) */
html.fr-studio .scan-turn .wb-card-skel {
  display: block;
}

/* (the stage is placed in the same cell, never pushed into a column of its own) */
html.fr-studio .wb.scan-turning .wb-main > .wb-stage {
  grid-column: 1;
}

@keyframes scan-turn-in {
  from { opacity: 0; }
}

html.fr-studio .scan-turn-note {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 7px 14px 7px 9px;
  border: 1px solid var(--st-line);
  border-radius: var(--st-r-md);
  background: var(--st-panel);
  box-shadow: var(--st-sh-2);
  color: var(--st-ink-2);
  font: 600 13px/18px var(--st-sans);
  white-space: nowrap;
  translate: -50% -50%;
}

html.fr-studio .scan-turn-note .loader {
  flex: none;
  width: 18px;
  height: 18px;
  border-width: 2px;
  border-color: var(--st-line-2);
  border-top-color: var(--st-accent);
}

html.fr-studio .scan-turn-words {
  overflow: hidden;
  text-overflow: ellipsis;
}

html.fr-studio .wb.scan-turning :is(.wb-nav, .wb-inspector, .wb-banners, .wb-statusbar) {
  opacity: 0.5;
  transition: opacity 160ms var(--st-ease);
}

html.fr-studio .wb.scan-turning .wb-title {
  opacity: 0;
  transition: opacity 160ms var(--st-ease);
}

/* The page left for another transcribe page, held over the app's loading
   state until the next page is in (holdStill): where it was, as it was.
   Under the site's progress line (60). */
html.fr-studio .scan-studio-still {
  position: fixed;
  z-index: 55;
  inset: 0;
  overflow: hidden;
}

/* Flow (the page at 400%, a landscape phone with its keyboard up): nothing is
   fixed and the document scrolls, as the workbench's own flow rule expects. */
@media (max-height: 420px) and (max-width: 600px), (max-height: 320px) {
  html.fr-studio body {
    overflow: auto;
  }

  html.fr-studio #main-content,
  html.fr-studio .transcribe-page,
  html.fr-studio .route-loading {
    height: auto;
    min-height: 100dvh;
  }
}

/* -- the studio app bar's Folk Register nodes (inside .wb: --st-* tokens) -- */
.scan-studio-brand {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--st-r-sm, 6px);
  color: var(--st-accent);
  text-decoration: none;
  transition: background-color 120ms ease;
}

.scan-studio-brand:hover {
  background: var(--st-panel-2);
}

/* the site mark (index.html #fr-mark): ink bracket and staff, rubric note */
.scan-studio-mark {
  --mark-note: var(--accent, #a62a1b);
  width: 28px;
  height: 24px;
}

.scan-studio-sep {
  flex: none;
  width: 1px;
  height: 22px;
  margin: 0 3px 0 1px;
  background: var(--st-line);
}

.scan-studio-scans {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  line-height: 18px;
}

.scan-studio-scans a {
  padding: 3px 2px;
  border-radius: 4px;
  color: var(--st-ink-2);
  text-decoration: none;
}

.scan-studio-scans a:hover {
  color: var(--st-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* the crumb's "/" is drawn here, with no text for assistive tech (as the
   site's breadcrumbs draw theirs), in the pager's quiet "of 166" ink:
   legible (5.8:1 light, 6.1:1 dark) and still quieter than the link */
.scan-studio-slash {
  color: var(--st-muted);
}

.scan-studio-slash::before {
  content: "/";
  content: "/" / "";
}

.scan-studio-book {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 32px;
  margin-left: -3px;
  padding: 0 7px 0 5px;
  border-radius: var(--st-r-sm, 6px);
  color: var(--st-ink);
  font: 600 14px/1.2 var(--st-sans);
  text-decoration: none;
  transition: background-color 120ms ease;
}

.scan-studio-book:hover {
  background: var(--st-panel-2);
}

/* never cut to a fixed width: the bar's fitting (studioBarStart) hides
   "Scans /" and the page title first, then cuts a long name between words */
.scan-studio-bookname {
  white-space: nowrap;
}

/* the book's cloth spine was shelf skeuomorphism (visual-design-system.md
   §10): the crumb is the book's name, and the compact crumb an arrow */
.scan-studio-spine {
  display: none;
}

.scan-studio-back {
  display: none;
  place-items: center;
}

/* compact: an arrow, "Back to Gospel Pearls" */
.scan-studio-book.is-compact {
  justify-content: center;
  gap: 4px;
  min-width: 40px;
  margin: 0 4px 0 0;
  padding: 0 8px 0 7px;
  border: 1px solid var(--st-field-line);
  color: var(--st-ink-2);
}

.scan-studio-book.is-compact:hover {
  border-color: var(--st-ink);
  color: var(--st-ink);
}

.scan-studio-book.is-compact .scan-studio-bookname {
  display: none;
}

.scan-studio-book.is-compact .scan-studio-back {
  display: grid;
  order: -1;
}

.scan-studio-brand.is-gone,
.scan-studio-sep.is-gone,
.scan-studio-scans.is-gone,
.scan-studio-book.is-gone {
  display: none;
}

@media (pointer: coarse) {
  .scan-studio-brand {
    width: 44px;
    height: 44px;
  }

  .scan-studio-book {
    height: 44px;
  }

  .scan-studio-book.is-compact {
    min-width: 48px;
  }
}

/* -- problems a save refused, listed in the banner (every one, each with Go) -- */
.scan-studio-problems {
  display: grid;
  gap: 4px;
  max-height: min(40vh, 18rem);
  margin: 8px 0 2px;
  padding: 0;
  overflow: auto;
  counter-reset: scan-problem;
  list-style: none;
}

.scan-studio-problems li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 4px 6px 4px 8px;
  border-radius: var(--st-r-sm, 6px);
  background: color-mix(in srgb, var(--st-panel) 70%, transparent);
  counter-increment: scan-problem;
}

.scan-studio-problems li::before {
  display: grid;
  flex: none;
  place-items: center;
  min-width: 14px;
  height: 20px;
  color: var(--st-danger);
  font: 600 13px/1 var(--st-sans);
  font-variant-numeric: tabular-nums lining-nums;
  content: counter(scan-problem);
}

.scan-studio-problems li > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.scan-studio-problems .wb-btn {
  flex: none;
}

.scan-studio-confirm .wb-dialog-body {
  padding-top: 0;
}

/* the studio's short questions (leave, mark done, no music) stay short on
   phones: a sheet as tall as its words, with full-width answers */
html.fr-studio .wb-dialog.is-sheet:is(.wb-leave, .scan-studio-confirm) {
  height: auto;
}

html.fr-studio .wb-dialog.is-sheet:is(.wb-leave, .scan-studio-confirm) .wb-dialog-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  gap: 8px;
}

html.fr-studio .wb-dialog.is-sheet:is(.wb-leave, .scan-studio-confirm) .wb-dialog-actions .wb-btn {
  justify-content: center;
  width: 100%;
}

/* ... and at short heights (the page at 400%, a landscape phone) the whole
   question is one scroller with its answers in it, side by side where they
   fit: no answer is cut off at the edge, and the words are never squeezed
   into a scroller of their own a few pixels tall */
@media (max-height: 420px) {
  html.fr-studio .wb-dialog:is(.wb-leave, .scan-studio-confirm) {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  html.fr-studio .wb-dialog:is(.wb-leave, .scan-studio-confirm) > * {
    flex: none;
  }

  html.fr-studio .wb-dialog:is(.wb-leave, .scan-studio-confirm) .wb-dialog-body {
    min-height: auto;
    overflow: visible;
  }

  html.fr-studio .wb-dialog.is-sheet:is(.wb-leave, .scan-studio-confirm) .wb-dialog-actions {
    display: flex;
    flex-wrap: wrap;
  }

  html.fr-studio .wb-dialog.is-sheet:is(.wb-leave, .scan-studio-confirm) .wb-dialog-actions .wb-btn {
    flex: 1 1 auto;
    width: auto;
  }
}

/* -- the history drawer: every saved revision, newest first ------------------ */
.scan-history.wb-drawer {
  width: min(400px, 94vw);
}

.scan-history .wb-sheet-body,
.scan-history.wb-bsheet .wb-sheet-body {
  padding: 8px 20px 20px;
}

.scan-revs {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scan-rev {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 20px;
}

/* the timeline: a rule from each dot to the next */
.scan-rev:not(:last-child)::before {
  position: absolute;
  top: 26px;
  bottom: 4px;
  left: 10px;
  width: 2px;
  border-radius: 1px;
  background: var(--st-line);
  content: "";
}

.scan-rev-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--st-line-2);
  border-radius: 50%;
  background: var(--st-panel);
  color: var(--st-panel);
}

.scan-rev[data-status="done"] .scan-rev-dot {
  border-color: var(--st-ok);
  background: var(--st-ok);
}

.scan-rev[aria-current="true"] .scan-rev-dot {
  box-shadow: 0 0 0 4px var(--st-accent-soft);
}

.scan-rev[aria-current="true"]:not([data-status="done"]) .scan-rev-dot {
  border-color: var(--st-accent);
}

.scan-rev.is-draft .scan-rev-dot {
  border-style: dashed;
  border-color: var(--st-warn);
}

.scan-rev-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  min-width: 0;
}

.scan-rev-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  color: var(--st-ink);
  font: 600 14px/22px var(--st-sans);
}

.scan-rev.is-draft .scan-rev-head {
  color: var(--st-warn);
}

/* a revision's state: a status badge, sentence case */
.scan-rev-chip {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--st-r-xs);
  background: var(--st-panel-2);
  color: var(--st-ink-2);
  font: 600 12px/1 var(--st-sans);
}

.scan-rev-chip[data-tone="ok"] {
  background: var(--st-ok-soft);
  color: var(--st-ok);
}

.scan-rev-chip[data-tone="latest"] {
  background: var(--st-accent-soft);
  color: var(--st-accent-2);
}

.scan-rev-meta {
  margin: 0;
  color: var(--st-muted);
  font-size: 12.5px;
  line-height: 18px;
}

.scan-rev-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.scan-rev-files .wb-btn {
  min-width: 0;
  max-width: 100%;
  gap: 6px;
  overflow: hidden;
  text-decoration: none;
}

.scan-rev-files .wb-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* another revision's files on their way (read as its row comes into view):
   a quiet chip the size of one file's button */
.scan-rev-file-wait {
  display: block;
  width: 132px;
  max-width: 100%;
  height: 26px;
  border-radius: var(--st-r-sm);
  background: linear-gradient(90deg, var(--st-sunken) 30%, var(--st-panel-2) 50%, var(--st-sunken) 70%) 0 0 / 300% 100%;
  animation: scan-studio-shimmer 1.2s linear infinite;
}

.scan-rev-chip[data-tone="open"] {
  background: var(--st-warn-soft);
  color: var(--st-warn);
}

/* Open (read-only) and Compare: the revision's own actions, before its files */
.scan-rev-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.scan-rev-actions .wb-btn {
  gap: 6px;
}

.scan-rev-actions + .scan-rev-files {
  margin-top: 6px;
}

/* a finger's target: the drawer's buttons, and a refused save's Go, are
   44 px tall on a coarse pointer (the workbench lifts its small buttons to
   36 px only) */
@media (pointer: coarse) {
  .scan-rev-actions .wb-btn,
  .scan-rev-files .wb-btn,
  .scan-rev-file-wait,
  .scan-rev-file-err .wb-btn,
  .scan-studio-problems .wb-btn {
    height: 44px;
  }
}

.scan-rev-actions .wb-btn.is-busy,
.scan-rev-files .wb-btn.is-busy {
  cursor: progress;
}

.scan-rev-actions .wb-btn.is-busy svg,
.scan-rev-files .wb-btn.is-busy svg {
  animation: scan-rev-busy 0.9s ease-in-out infinite alternate;
}

/* a file the server refused (exportFile): under the row's files, in its
   words, with the way on (Try again, or Sign in) */
.scan-rev-file-err {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--st-danger) 45%, transparent);
  border-radius: var(--st-r-sm);
  background: var(--st-danger-soft);
  color: var(--st-ink);
  font-size: 12.5px;
  line-height: 18px;
}

.scan-rev-file-err svg {
  flex: none;
  color: var(--st-danger);
}

.scan-rev-file-err span {
  flex: 1 1 180px;
  min-width: 0;
  overflow-wrap: anywhere;
}

@keyframes scan-rev-busy {
  to { opacity: 0.3; }
}

.scan-history-foot {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--st-line);
  color: var(--st-muted);
  font-size: 12px;
  line-height: 17px;
}

.scan-history-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 36px 12px;
  color: var(--st-ink-2);
  text-align: center;
}

.scan-history-empty svg {
  margin-bottom: 6px;
  color: var(--st-muted);
}

.scan-history-empty p {
  margin: 0;
}

.scan-history-empty .wb-btn {
  margin-top: 10px;
}

.scan-history-wait {
  display: grid;
  gap: 18px;
  padding-top: 4px;
}

.scan-history-wait span {
  height: 58px;
  border-radius: var(--st-r-md, 10px);
  background: linear-gradient(90deg, var(--st-sunken) 30%, var(--st-panel-2) 50%, var(--st-sunken) 70%) 0 0 / 300% 100%;
  animation: scan-studio-shimmer 1.2s linear infinite;
}

@keyframes scan-studio-shimmer {
  to { background-position: -150% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .scan-history-wait span,
  .scan-rev-file-wait,
  .scan-rev-actions .wb-btn.is-busy svg,
  .scan-rev-files .wb-btn.is-busy svg {
    animation: none;
  }

  .scan-studio-brand,
  .scan-studio-book {
    transition: none;
  }
}

@media (forced-colors: active) {
  .scan-rev-dot,
  .scan-studio-problems li::before {
    border: 1px solid CanvasText;
  }

  .scan-rev-file-wait {
    border: 1px dashed GrayText;
  }

  .scan-rev-file-err {
    border-color: CanvasText;
  }

  .scan-cover-window {
    outline: 1px solid CanvasText;
  }
}
/* ---- public scan review (/community/scans) ----------------------------------
   Independent of the staff transcription workspace. Machine readings beside
   the pages they were read from (visual-design-system.md §8): index rows for
   the list; for one reading, the untouched scan (sticky from 64rem) on the
   left and the reading, its provenance and the correction form on the right.
   The scan is never filtered; its system boxes are a fixed selection blue on
   the page's own paper in both themes. */
.public-scan-review {
  --review-box: #1a5fd0; /* = studio --op-select: white on it is 6.1:1 */
}

.scan-review-head {
  margin-bottom: var(--space-5);
}

.page-heading.scan-review-head > p.scan-review-terms {
  max-width: var(--measure);
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.5 var(--sans);
}

.scan-review-tabs {
  margin-bottom: var(--space-6);
}

.scan-review-scope {
  margin-bottom: var(--space-3);
}

/* the list: one hairline row per reading, the whole row its link */
.scan-review-rows {
  margin: 0;
  border-top: 1px solid var(--ink);
  padding: 0;
  list-style: none;
}

.scan-review-row {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto 1.25rem;
  align-items: center;
  gap: var(--space-4);
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) var(--space-2);
  transition: background-color var(--ease);
}

.scan-review-row:hover {
  background: var(--paper-deep);
}

.scan-review-thumb {
  display: block;
  width: 2.75rem;
  height: 3.625rem;
  overflow: hidden;
  border: 1px solid var(--sheet-edge);
  background: var(--sheet-paper);
}

:root[data-theme="dark"] .scan-review-thumb {
  border-color: var(--line-strong);
}

.scan-review-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.scan-review-thumb.is-missing img {
  visibility: hidden;
}

.scan-review-row-main {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.scan-review-row-title {
  color: var(--ink);
  font: 600 var(--step-1)/1.3 var(--serif);
  text-decoration: none;
}

.scan-review-row-title::after {
  content: "";
  position: absolute;
  inset: 0;
}

.scan-review-row-title:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.scan-review-row-title cite {
  font-style: italic;
}

.scan-review-model {
  color: var(--muted);
  font-size: var(--step--2);
}

.scan-review-chevron {
  color: var(--muted);
}

.scan-review-row:hover .scan-review-chevron {
  color: var(--accent);
}

/* one reading: the head, then the scan and the work side by side */
.scan-review-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-4);
}

.scan-review-detail-head h1 {
  margin: 0;
  font-size: var(--step-4);
  line-height: 1.15;
}

.scan-review-where {
  color: var(--muted);
  font-weight: 400;
}

.scan-review-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
}

.scan-review-compare {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: start;
  gap: var(--space-6) var(--space-7);
}

.scan-review-scan {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.scan-review-toggle {
  justify-self: start;
}

.scan-review-frame {
  position: relative;
  border: 1px solid var(--sheet-edge);
  background: var(--sheet-paper);
  line-height: 0;
}

:root[data-theme="dark"] .scan-review-frame {
  border-color: var(--line-strong);
}

.scan-review-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.scan-review-frame.is-missing {
  min-height: 20rem;
  background: var(--surface-soft);
}

.scan-review-frame.is-missing img,
.scan-review-frame.is-missing .scan-review-boxes {
  visibility: hidden;
}

.scan-review-boxes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.scan-review-frame.is-bare .scan-review-boxes,
.scan-review-box:not(.is-current) {
  display: none;
}

.scan-review-box-area {
  fill: rgb(26 95 208 / 7%);
  stroke: var(--review-box);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}

.scan-review-box-tag {
  fill: var(--review-box);
}

.scan-review-box-num {
  fill: #ffffff;
  font-family: var(--sans);
  font-weight: 600;
}

.scan-review-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  color: var(--muted);
  font: 400 var(--step--1)/1.45 var(--sans);
}

.scan-review-caption a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--ink-soft);
}

.scan-review-image-error {
  margin: 0;
  color: var(--danger);
  font: 500 var(--step--1)/1.45 var(--sans);
}

.scan-review-work,
.scan-review-contribute {
  display: grid;
  gap: var(--space-6);
  min-width: 0;
}

.scan-review-candidate {
  min-width: 0;
}

.scan-review-candidate-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-2);
}

.scan-review-candidate-head .label {
  margin: 0;
}

/* the reading, engraved on sheet paper at the frame's width; the music is
   ink on paper in both themes */
.scan-review-score {
  overflow-x: auto;
  border: 1px solid var(--sheet-edge);
  background: var(--sheet-paper);
  padding: var(--space-5) var(--space-4) var(--space-4);
  color: #1b1917;
}

.scan-review-score svg {
  display: block;
  width: 100%;
  height: auto;
}

.scan-review-score .wb-score text {
  font-family: var(--serif);
}

.scan-review-score .wb-measure-number {
  fill: #5c5850;
  font-style: italic;
}

.scan-review-score:focus-visible {
  outline-offset: 3px;
}

.scan-review-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.scan-review-steps .button {
  padding-inline: var(--space-2);
}

.scan-review-steps .num {
  color: var(--muted);
  font-size: var(--step--1);
}

.scan-review-note {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font: 400 var(--step--1)/1.45 var(--sans);
}

.scan-review-layout {
  width: 100%;
  max-width: 24rem;
  border-collapse: collapse;
  font-variant-numeric: lining-nums tabular-nums;
}

.scan-review-layout thead th {
  border-bottom: 1px solid var(--ink);
  padding: 0 var(--space-3) var(--space-2) 0;
  color: var(--muted);
  font: 600 var(--step-0)/1.3 var(--serif);
  font-variant-caps: all-small-caps;
  font-synthesis-small-caps: none;
  letter-spacing: 0.05em;
  text-align: left;
}

.scan-review-layout tbody :is(th, td) {
  border-bottom: 1px solid var(--line);
  padding: var(--space-2) var(--space-3) var(--space-2) 0;
  color: var(--ink-soft);
  font: 400 var(--step-0)/1.4 var(--serif);
  text-align: left;
}

.scan-review-layout tbody th {
  color: var(--ink);
  font-weight: 600;
}

/* "How this reading was made" and "Withdraw this reading": quiet
   disclosures with a turning chevron */
.scan-review-provenance,
.scan-review-withdraw {
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
}

.scan-review-provenance summary,
.scan-review-withdraw summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  color: var(--ink-soft);
  font: 500 var(--ui)/1.2 var(--sans);
  list-style: none;
  cursor: pointer;
}

.scan-review-provenance summary::-webkit-details-marker,
.scan-review-withdraw summary::-webkit-details-marker {
  display: none;
}

.scan-review-provenance summary:hover,
.scan-review-withdraw summary:hover {
  color: var(--accent);
}

.scan-review-disclose {
  transition: transform var(--ease);
}

details[open] > summary .scan-review-disclose {
  transform: rotate(90deg);
}

.scan-review-provenance .definition-list {
  margin-top: var(--space-2);
}

.scan-review-provenance code {
  color: var(--ink-soft);
  font-size: var(--step--2);
  overflow-wrap: anywhere;
}

/* the correction form, opened by an ink rule */
.scan-review-form,
.scan-review-signin {
  display: grid;
  gap: var(--space-4);
  border-top: 1px solid var(--ink);
  padding-top: var(--space-4);
}

.scan-review-form h2,
.scan-review-signin h2,
.scan-review-contributions h2 {
  margin: 0;
  font-size: var(--step-2);
}

.scan-review-form-intro,
.scan-review-signin p {
  margin: 0;
  color: var(--ink-soft);
  font: 400 var(--step-0)/1.5 var(--serif);
}

.scan-review-category select {
  max-width: 22rem;
}

.scan-review-staff-line {
  margin-top: calc(-1 * var(--space-2));
}

.scan-review-status {
  margin: 0;
  color: var(--ink-soft);
  font: 500 var(--step--1)/1.45 var(--sans);
}

.scan-review-status:empty {
  display: none;
}

.scan-review-contributions {
  display: grid;
  gap: var(--space-3);
}

/* contributions: hairline rows, the member's words in the book face */
.scan-review-section-title {
  margin: 0 0 var(--space-3);
  font-size: var(--step-2);
}

.scan-review-feedback {
  max-width: 48rem;
  margin: 0;
  border-top: 1px solid var(--ink);
  padding: 0;
  list-style: none;
}

.scan-review-contributions .scan-review-feedback {
  border-top-color: var(--line);
}

.scan-review-feedback-item {
  display: grid;
  gap: var(--space-2);
  border-bottom: 1px solid var(--line);
  padding: var(--space-4) 0;
}

.scan-review-feedback-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-4);
}

.scan-review-feedback-category {
  margin: 0;
  color: var(--ink);
  font: 600 var(--step-0)/1.3 var(--serif);
}

.scan-review-feedback-head .status {
  align-self: center;
}

.scan-review-body {
  margin: 0;
  max-width: var(--measure);
  color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--serif);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.scan-review-response {
  max-width: var(--measure);
  margin: 0;
  color: var(--ink-soft);
  font: 400 var(--step--1)/1.5 var(--sans);
}

.scan-review-response .label {
  display: inline;
  margin-right: var(--space-2);
  font-size: var(--step--1);
}

.scan-review-open {
  margin: 0;
  font: 500 var(--step--1)/1.4 var(--sans);
}

.scan-review-open a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.scan-review-decision {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  align-items: start;
  gap: var(--space-3);
  margin-top: var(--space-2);
  border-top: 1px dashed var(--line-strong);
  padding-top: var(--space-3);
}

.scan-review-decision .button-row {
  grid-column: 1 / -1;
}

.scan-review-decision textarea {
  min-height: var(--control-h);
  font-size: var(--step-0);
}

.scan-review-withdraw-form {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
  max-width: 30rem;
  margin-top: var(--space-2);
}

.scan-review-withdraw-form .field {
  justify-self: stretch;
}

.scan-review-pager {
  justify-content: space-between;
}

.scan-review-pager a {
  gap: var(--space-1);
}

.scan-review-error {
  margin-top: var(--space-2);
}

/* The scan stays put beside the candidate only when all of it fits on the
   screen: a stuck figure taller than the viewport would hide its own lower
   systems, caption and "Open full page" link from scrolling (WCAG 2.4.7). */
@media (min-width: 64rem) and (min-height: 62rem) {
  .scan-review-scan {
    position: sticky;
    top: calc(var(--header-height) + var(--space-4));
  }
}

@media (max-width: 64rem) {
  .scan-review-compare {
    grid-template-columns: minmax(0, 1fr);
  }

  .scan-review-scan {
    max-width: 34rem;
  }
}

@media (max-width: 48rem) {
  .scan-review-row {
    grid-template-columns: 2.75rem minmax(0, 1fr) 1.25rem;
    gap: var(--space-1) var(--space-3);
    padding-inline: 0;
  }

  .scan-review-thumb {
    grid-row: span 2;
  }

  .scan-review-row-main {
    grid-column: 2;
  }

  .scan-review-row > .status {
    grid-column: 2;
    grid-row: 2;
  }

  .scan-review-chevron {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .scan-review-score svg {
    width: 40rem;
    max-width: none;
  }

  .scan-review-decision {
    grid-template-columns: minmax(0, 1fr);
  }

  .scan-review-provenance .definition-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .scan-review-provenance .definition-list dd {
    border-top: 0;
    padding-top: 0;
  }
}

@media print {
  .scan-review-tabs,
  .scan-review-toggle,
  .scan-review-contribute,
  .scan-review-withdraw {
    display: none;
  }
}

@media (forced-colors: active) {
  .scan-review-box-area {
    stroke: Highlight;
  }

  .scan-review-box-tag {
    fill: Highlight;
  }

  .scan-review-box-num {
    fill: HighlightText;
  }
}

/* -- small text links on phones (§5 targets) --------------------------------------------
   Breadcrumbs, the sheet's downloads and sources line, and the scan review's
   page links are 44px tall on phones without changing how they read. */
@media (max-width: 48rem) {
  .breadcrumbs ol {
    row-gap: 0;
  }

  .breadcrumbs a,
  .sheet-foot a,
  .scan-review-caption a,
  .scan-review-open a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
  }
}

/* -- search fields: the shared clear button, never the browser's own -------------------- */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  min-height: 0;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  padding: 0;
  color: var(--muted);
  transform: translateY(-50%);
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease);
}

.search-clear:hover {
  background: var(--paper-deep);
  color: var(--ink);
}

.search-field:has(.search-clear:not([hidden])) input[type="search"] {
  padding-right: 2.5rem;
}

@media (max-width: 48rem) {
  .search-clear {
    width: 2.75rem;
    height: 2.75rem;
    right: 0;
  }

  .search-field:has(.search-clear:not([hidden])) input[type="search"] {
    padding-right: 3rem;
  }
}
