/* ==========================================================================
   StevensED · Editions
   Scores, parts and rehearsal recordings, in the StevensED suite chrome
   (tokens from the suite kit: navy #2F3E68, red #C13F44, cream #F7F5F1,
   Cormorant Garamond + Inter).
   ========================================================================== */

:root {
  --ink: #2F3E68;
  --ink-2: #3e5183;
  --mute: #525d7a;
  --mute-2: #8a91a8;
  --blue: #2F3E68;
  --blue-2: #3e5183;
  --red: #C13F44;
  --red-2: #9a2d33;
  --rule: #e0dcd0;
  --rule-2: #efebe3;
  --bg: #FFFFFF;
  --paper: #f7f5f1;
  --surface: #f7f5f1;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  --content-w: 880px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(47, 62, 104, 0.15); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -40px; left: 16px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus { top: 12px; }

/* ---------- Container ---------- */
.wrap {
  width: min(var(--content-w), calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- Suite header ----------
   Same header and footer as files.stevensed.org (FileShare worker/public/assets/suite.css). */
main { flex: 1 0 auto; }
.suite-header .wrap, .suite-footer .wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: clamp(16px, 4vw, 32px); padding-right: clamp(16px, 4vw, 32px); box-sizing: border-box; }
.suite-header { background: #fff; border-bottom: 1px solid #e0dcd0; }
.suite-header__inner { display: flex; align-items: center; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.suite-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #2F3E68; margin-right: auto; }
.suite-brand:hover { text-decoration: none; color: #2F3E68; }
.suite-brand img { width: 44px; height: auto; display: block; }
.suite-brand__name { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; letter-spacing: .01em; }
.suite-brand__app { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #525d7a; border-left: 1px solid #e0dcd0; padding-left: 10px; }
.suite-nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; font-size: .9rem; line-height: 1.6; }
.suite-nav a { text-decoration: none; color: #3e5183; font-weight: 500; }
.suite-nav a:hover { color: #C13F44; text-decoration: none; }
.suite-nav form { margin: 0; }
.suite-nav [hidden] { display: none !important; }
.suite-user { font-size: .85rem; color: #525d7a; }
.suite-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: .45rem .85rem; border-radius: 999px; border: 1px solid transparent; background: #C13F44; font: 600 .72rem/1 var(--sans); letter-spacing: .05em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.suite-nav a.suite-btn, .suite-nav a.suite-btn:hover, .suite-btn { color: #fff; }
.suite-btn:hover { background: #9a2d33; }
.suite-btn--ghost, .suite-btn--ghost:hover { background: transparent; color: #2F3E68; border-color: #e0dcd0; }
.suite-btn--ghost:hover { background: #efebe3; }
@media (max-width: 640px) {
  .suite-brand__app, .hide-sm { display: none; }
  .suite-header__inner { padding-top: 8px; padding-bottom: 8px; }
}

/* ---------- Eyebrow + call to action ---------- */
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--red); margin: 0 0 10px; }
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: .75rem 1.35rem; border-radius: 999px; border: 1px solid transparent;
  background: var(--red); color: #fff; font: 600 13px/1 var(--sans); letter-spacing: .05em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
}
.cta:hover { background: var(--red-2); color: #fff; text-decoration: none; }
.cta--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.cta--ghost:hover { background: var(--rule-2); color: var(--ink); }

/* ---------- Links ---------- */
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  color: var(--blue-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:focus-visible,
button:focus-visible,
audio:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Landing (home) ---------- */
.landing { padding: 56px 0 8px; }
.landing h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(44px, 7vw, 64px);
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 0 0 18px;
  color: var(--ink);
}
.landing .lede { margin: 0; }
.works { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.works a { display: block; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg); color: var(--ink); text-decoration: none; }
.works a:hover { border-color: var(--blue); text-decoration: none; }
.works .work-title { display: block; font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.2; }
.works .work-sub { display: block; margin-top: 2px; font-size: 13px; color: var(--mute); }
.client-note { border: 1px solid var(--rule); border-left: 3px solid var(--red); border-radius: var(--radius); background: var(--bg); padding: 18px 20px; display: grid; gap: 12px; justify-items: start; }
.client-note p { margin: 0; font-size: 14px; color: var(--ink-2); max-width: 62ch; }

/* ---------- Not found ---------- */
.not-found { padding: 72px 0 24px; text-align: center; }
.not-found h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(40px, 7vw, 60px); line-height: 1; margin: 0 0 14px; color: var(--ink); }
.not-found p { margin: 0 auto 20px; color: var(--mute); font-size: 14px; }

/* ---------- Gate, messages and admin (rendered by the Worker) ---------- */
.gate { max-width: 560px; margin: 56px auto 0; background: var(--bg); border: 1px solid var(--rule); border-radius: 14px; padding: 32px 28px; text-align: center; }
.gate h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(28px, 5vw, 36px); line-height: 1.1; margin: 0 0 12px; color: var(--ink); }
.gate p { margin: 0 auto 12px; max-width: 46ch; color: var(--ink-2); font-size: 15px; }
.gate .gate-hint { color: var(--mute); font-size: 14px; }
.gate-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 20px 0 8px; }
.gate-actions form { margin: 0; }
.gate .gate-help { margin-top: 16px; font-size: 13px; color: var(--mute); }
.admin h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; color: var(--ink); margin: 0 0 12px; }
.admin section { padding: 28px 0 0; }
.admin .page-head { padding-top: 40px; }
.admin table { width: 100%; border-collapse: collapse; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius); font-size: 14px; }
.admin th, .admin td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.admin th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.chip { display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px; border-radius: 999px; background: var(--rule-2); font-size: 12px; color: var(--ink-2); }
.muted { color: var(--mute); }
.small { font-size: 12px; }
.admin-form { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; }
.admin-form .field { display: grid; gap: 6px; flex: 1 1 200px; }
.admin-form .field--days { flex: 0 1 120px; }
.admin-form label { font-size: 13px; font-weight: 500; color: var(--ink); }
.admin-form input, .admin-form select, .copy-row input { font: inherit; font-size: 14px; padding: .6rem .75rem; border: 1px solid #cfc9bb; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
.admin-created { margin-top: 24px; padding: 20px !important; background: #eaf3ec; border: 1px solid #c6dfcc; border-radius: var(--radius); }
.admin-created p { margin: 0 0 12px; font-size: 14px; }
.copy-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.copy-row input { flex: 1 1 320px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--rule-2); padding: 1px 4px; border-radius: 4px; }

/* ---------- Page header ---------- */
.page-head {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--rule);
}
.page-head h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 36px;
  line-height: 1.1;
  margin: 0 0 6px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.page-head .meta {
  margin: 0;
  font-size: 13px;
  color: var(--mute);
  letter-spacing: 0.02em;
}

/* ---------- Section group ---------- */
.group {
  padding: 28px 0 4px;
}
.group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
}
.group-label h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0;
}
.group-label .count {
  font-size: 11px;
  color: var(--mute-2);
  font-variant-numeric: tabular-nums;
}

/* ---------- Resource cards ---------- */
.resources {
  display: grid;
  gap: 8px;
}
.resource {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 14px 16px;
  transition: border-color 120ms ease, background 120ms ease;
}
.resource:hover {
  border-color: #CBD5E1;
}
.resource-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}
.resource-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.resource-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.resource-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--mute);
}
.resource-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.resource-audio {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule-2);
}
.resource.is-pending {
  background: var(--surface);
  border-style: dashed;
  border-color: #D1D5DB;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #fff;
  text-decoration: none;
}
.btn .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--mute);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
}

/* ---------- Audio ---------- */
audio {
  width: 100%;
  height: 36px;
  display: block;
}

/* ---------- Catalogue facts ---------- */
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  margin: 0;
}
.facts dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--mute);
  padding-top: 1px;
}
.facts dd {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- Inline score viewer ---------- */
.score-viewer {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.viewer-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewer-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.score-frame {
  width: 100%;
  height: min(78vh, 900px);
  border: 0;
  display: block;
  background: var(--surface);
}
.viewer-fallback {
  display: none;
  padding: 28px 18px;
  text-align: center;
  font-size: 13px;
  color: var(--mute);
}
@media (max-width: 640px) {
  /* Inline PDF rendering is unreliable on mobile browsers; show the actions instead. */
  .score-frame { height: 62vh; }
}

/* ---------- Prose / rights notes ---------- */
.prose p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--ink-2);
  max-width: 68ch;
}
.prose p:last-child { margin-bottom: 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.notice {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 18px;
}
.notice p { color: var(--ink-2); }
.notice .prose-lead {
  font-weight: 600;
  color: var(--ink);
}
.pd-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(47, 62, 104, 0.06);
  border: 1px solid rgba(47, 62, 104, 0.18);
  border-radius: 999px;
}

/* ---------- Fine print (subtle rights / source) ---------- */
.fine-print {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-2);
}
.fine-print p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--mute-2);
  max-width: 72ch;
}
.fine-print a {
  color: var(--mute);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.fine-print a:hover { color: var(--blue); }
.fine-print .sep { padding: 0 6px; color: var(--rule); }
details.rights {
  margin-top: 8px;
}
details.rights > summary {
  font-size: 12px;
  color: var(--mute-2);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}
details.rights > summary::-webkit-details-marker { display: none; }
details.rights > summary::before {
  content: "";
  width: 5px; height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}
details.rights[open] > summary::before { transform: rotate(45deg); }
details.rights > summary:hover { color: var(--blue); }
details.rights .rights-body {
  margin-top: 10px;
}
details.rights .rights-body p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--mute);
  max-width: 72ch;
}
details.rights .rights-body p:last-child { margin-bottom: 0; }

/* ---------- Suite footer ---------- */
.suite-footer { margin-top: 48px; background: #2F3E68; color: #dfe3ee; font-size: .85rem; line-height: 1.6; }
.suite-footer__inner { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 24px; padding-bottom: 24px; align-items: center; }
.suite-footer a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.suite-footer a:hover { color: #fff; }
/* the copyright line reads as plain text; it quietly links home */
.suite-footer a.suite-footer__home, .suite-footer a.suite-footer__home:hover { color: inherit; text-decoration: none; }
.suite-footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-left: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .page-head { padding: 28px 0 18px; }
  .page-head h1 { font-size: 28px; }
  .resource-row { gap: 10px; }
}

/* ---------- Print ---------- */
@media print {
  .suite-header, .suite-footer, audio, .resource-actions, .resource-audio {
    display: none !important;
  }
  body { color: #000; background: #fff; }
  .resource { border: 0; padding: 6px 0; }
  a { color: #000; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Rehearsal player (assets/js/player.js) ---------- */
.xp {
  --xp-wave: #CBD5E1;
  --xp-played: var(--blue);
  --xp-band: rgba(47, 62, 104, 0.08);
  display: grid;
  gap: 10px;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
}
.xp:focus-visible { outline: 2px solid var(--blue); outline-offset: 6px; border-radius: 4px; }
.xp-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.xp-btn.xp-play {
  width: 40px; height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.xp-btn.xp-play:hover { background: var(--blue-2); color: #fff; }
.xp-btn.xp-play svg { width: 18px; height: 18px; }
.xp-time { font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.xp-time b { font-weight: 600; color: var(--ink); }
.xp-status { font-size: 12px; color: var(--mute); }
.xp-head { justify-content: space-between; }
.xp-clock { display: inline-flex; align-items: baseline; gap: 10px; margin-left: auto; }
.xp-modes { display: inline-flex; gap: 14px; }
.xp-transport { gap: 4px; }
.xp-transport .xp-play { margin-right: 6px; }
.xp-mode {
  border: 0;
  background: none;
  padding: 4px 0;
  font: 500 13px/1.2 var(--sans);
  color: var(--mute);
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
}
.xp-mode:hover { color: var(--ink); }
.xp-mode.is-on { color: var(--ink); border-bottom-color: var(--blue); }

.xp-wave {
  position: relative;
  height: 56px;
  cursor: pointer;
  touch-action: none;
}
.xp-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.xp-tip {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  font: 500 11px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 3px 5px;
  border-radius: 3px;
  pointer-events: none;
}
.xp-pin {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 0;
  border-left: 1px solid var(--blue);
  pointer-events: none;
  font: 600 10px/1 var(--sans);
  color: var(--blue);
  text-indent: 3px;
}

.xp-tools { justify-content: space-between; gap: 8px 18px; }
.xp-set { display: inline-flex; align-items: center; gap: 2px; }
.xp-end { gap: 6px; }
.xp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-2);
  font: 500 13px/1 var(--sans);
  cursor: pointer;
}
.xp-btn svg { width: 18px; height: 18px; }
.xp-btn:hover:not(:disabled) { background: var(--rule-2); color: var(--blue); }
.xp-btn:disabled { color: var(--mute-2); cursor: default; }
.xp-btn[hidden] { display: none; }
.xp-word { padding: 0 8px; }
.xp-btn.is-set { color: var(--blue); font-weight: 600; }
.xp-btn.is-on { background: var(--blue); color: #fff; }
.xp-btn.is-on:hover { background: var(--blue-2); color: #fff; }
.xp-quiet { color: var(--mute); }
.xp-speed {
  height: 32px;
  padding: 0 24px 0 8px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%2364748B' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 7px center / 10px;
  font: 500 12px/1 var(--sans);
  color: var(--ink-2);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.xp-speed.is-set { color: var(--blue); border-color: var(--blue); }
.xp-vol {
  --fill: 100%;
  width: 96px;
  height: 32px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(to right, var(--ink-2) var(--fill), var(--rule) var(--fill)) no-repeat center / 100% 3px;
  cursor: pointer;
  touch-action: pan-y;
}
.xp-vol[hidden] { display: none; }
.xp-vol::-webkit-slider-runnable-track { height: 32px; background: transparent; }
.xp-vol::-moz-range-track { height: 3px; background: transparent; }
.xp-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: 9px; border-radius: 50%; background: var(--ink-2); }
.xp-vol::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--ink-2); }
@media (pointer: coarse) {
  .xp-vol::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: 5px; }
  .xp-vol::-moz-range-thumb { width: 22px; height: 22px; }
  .xp-btn { min-width: 40px; height: 40px; }
  .xp-speed { height: 40px; }
}

/* ---------- Hymn list ---------- */
.lede {
  margin: 20px 0 0;
  max-width: 62ch;
  font-size: 15px;
  color: var(--ink-2);
}
.hymns { list-style: none; margin: 28px 0 0; padding: 0; }
.hymn { padding: 26px 0 28px; border-top: 1px solid var(--rule); }
.hymn:last-child { border-bottom: 1px solid var(--rule); }
.hymn-line {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto;
  align-items: baseline;
  gap: 0 12px;
  margin-bottom: 16px;
}
.hymn-num {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  color: var(--blue);
  font-variant-numeric: lining-nums;
}
.hymn-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
}
.hymn-credit { margin: 4px 0 0; font-size: 13px; color: var(--mute); }
.hymn-spec {
  margin: 0;
  font-size: 13px;
  color: var(--mute);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hymn .xp { margin-left: calc(3.2rem + 12px); }
.nojs { font-size: 13px; color: var(--mute); }

@media (max-width: 640px) {
  .hymn-line { grid-template-columns: 2.4rem 1fr; }
  .hymn-spec { grid-column: 2; margin-top: 6px; white-space: normal; }
  .hymn .xp { margin-left: 0; }
  .hymn-num { font-size: 24px; }
  .hymn-title { font-size: 21px; }
  .xp-end { width: 100%; }
  .xp-vol { flex: 1; width: auto; }
}
@media print { .xp { display: none !important; } }

/* ---------- Music symbols (SMuFL, subset of Bravura Text — see assets/fonts/OFL.txt) ---------- */
@font-face {
  font-family: "Editions Music Text";
  src: url("../fonts/editions-music-text.woff2") format("woff2");
  font-display: block;
  unicode-range: U+E260-E262, U+ECA3, U+ECA5, U+ECA7, U+ECB7;
}
.mus {
  font-family: "Editions Music Text", serif;
  font-style: normal;
  font-weight: normal;
  line-height: 1;
}
.mus-acc { font-size: 1.3em; margin-left: 0.03em; position: relative; top: 0.08em; }
.mus-note { font-size: 1.45em; margin-right: 0.28em; position: relative; top: 0.06em; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Soprano practice (assets/js/practice.js) ---------- */
.pr-open { margin: 16px 0 0 calc(3.2rem + 12px); cursor: pointer; }
.pr-open[aria-expanded="true"] { border-color: var(--blue); color: var(--blue); }
.pr { margin: 16px 0 0 calc(3.2rem + 12px); display: grid; gap: 12px; }
.pr[hidden] { display: none; }
.pr-score { position: relative; z-index: 0; max-height: 440px; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--rule); border-radius: 8px; padding: 8px 4px; background: #fff; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pr-score > div, .pr-score svg { background: transparent !important; }
.pr-wait { margin: 16px; font-size: 13px; color: var(--mute); }
.pr-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.pr-go {
  height: 38px; padding: 0 18px; border: 0; border-radius: 19px;
  background: var(--blue); color: #fff; font: 500 14px/1 var(--sans); cursor: pointer;
}
.pr-go:hover { background: var(--blue-2); }
.pr-go.is-on { background: #9B2C2C; }
.pr-field, .pr-check { font-size: 13px; color: var(--mute); display: inline-flex; align-items: center; gap: 6px; }
.pr-field select {
  height: 34px; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg);
  font: 500 13px/1 var(--sans); color: var(--ink-2); padding: 0 6px; max-width: 100%;
}
.pr-check input { accent-color: var(--blue); width: 16px; height: 16px; }
.pr-note { margin: -4px 0 0; font-size: 12px; color: var(--mute-2); }
.pr-live { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 14px; color: var(--ink-2); min-height: 24px; }
.pr-live[hidden] { display: none; }
.pr-target b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.pr-you { font-variant-numeric: tabular-nums; color: var(--mute); min-width: 7ch; }
.pr-meter { position: relative; width: 160px; height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--rule) 0 30%, #D7EBDF 30% 70%, var(--rule) 70%); }
.pr-meter i { position: absolute; top: -5px; width: 3px; height: 16px; margin-left: -1px; border-radius: 1px; background: var(--mute-2); left: 50%; transition: left 60ms linear; }
.pr-meter.ok i { background: #1F8A55; }
.pr-meter.close i { background: #B7791F; }
.pr-meter.off i { background: #C0392B; }
.pr-status { font-size: 13px; color: var(--mute); }
.pr-result { display: grid; gap: 10px; }
.pr-result[hidden] { display: none; }
.pr-scores { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.pr-scores p { margin: 0; display: grid; }
.pr-scores span { font-size: 12px; color: var(--mute); }
.pr-scores b { font-family: var(--serif); font-size: 30px; font-weight: 500; color: var(--ink); line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.pr-tend { margin: 0; font-size: 14px; color: var(--ink-2); }
.pr-lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.pr-lines th { text-align: left; font-weight: 500; color: var(--mute); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--rule); }
.pr-lines td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--rule-2); vertical-align: top; font-variant-numeric: tabular-nums; }
.pr-lines td:first-child { color: var(--mute); width: 2.5em; }
.pr-lines td:nth-child(3), .pr-lines td:nth-child(4) { width: 4.5em; }
.pr-words { color: var(--ink-2); }
.pr-dots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pr-dots i, .pr-key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.pr-key { margin: 0; font-size: 12px; color: var(--mute); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.pr-key i { margin-right: -6px; }
i.ok { background: #1F8A55; } i.close { background: #D9A441; } i.off { background: #C0392B; } i.miss { background: #E2E8F0; box-shadow: inset 0 0 0 1px #9AA5B1; }
.pr-take { display: flex; flex-wrap: wrap; gap: 8px; }
.pr-take .btn { cursor: pointer; min-height: 36px; }
@media (max-width: 640px) {
  .pr-open, .pr { margin-left: 0; }
  .pr-open { width: 100%; justify-content: center; min-height: 42px; font-size: 14px; }
  .pr-score { max-height: 58vh; padding: 4px 0; }
  .pr-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .pr-go { grid-column: 1 / -1; height: 46px; border-radius: 23px; font-size: 16px; }
  .pr-field { flex-direction: column; align-items: stretch; gap: 4px; }
  .pr-field select { height: 42px; width: 100%; font-size: 14px; }
  .pr-check { min-height: 36px; font-size: 14px; }
  .pr-check input { width: 20px; height: 20px; }
  .pr-live { font-size: 15px; gap: 6px 14px; }
  .pr-meter { width: 100%; order: 3; }
  .pr-lines th:first-child, .pr-lines td:first-child { display: none; }
  .pr-lines td:nth-child(3), .pr-lines td:nth-child(4) { width: 3.6em; }
  .pr-scores b { font-size: 26px; }
  .pr-take .btn { flex: 1 1 100%; justify-content: center; min-height: 44px; }
  .pr-dots i { width: 12px; height: 12px; }
}
@media print { .pr, .pr-open { display: none !important; } }
.pr-detail { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pr-dots i { cursor: pointer; }
