:root {
  --sv-vellum: #fbf9f4;
  --sv-champagne: #f5f1e6;
  --sv-gilt: #c5a059;
  --sv-ink: #23140d;
  --sv-primary-container: #3a2820;
  --sv-secondary: #665046;
  --sv-on-surface: #2b1a12;
  --sv-on-surface-variant: #4f4540;
  --sv-outline: #817470;
  --sv-outline-variant: #d3c3be;
  --sv-surface-low: #f5f3ee;
  --sv-white: #ffffff;
  --sv-error: #93000a;
  --sv-shadow: rgba(58, 40, 32, 0.14);
  --sv-focus-shadow: rgba(197, 160, 89, 0.28);
  --sv-serif: "Crimson Pro", serif;
  --sv-sans: "Source Sans 3", sans-serif;
  --title-size: 34px;
  --composer-size: 17px;
  --credit-size: 13px;
  --lyric-size: 21px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

html {
  background: var(--sv-vellum);
  overflow: hidden;
}

body {
  --reader-header-block-size: calc(72px + env(safe-area-inset-top));
  --reader-bottom-chrome-inset: 0px;
  --companion-banner-block-size: 0px;
  min-width: 320px;
  height: 100dvh;
  overflow: hidden;
  color: var(--sv-ink);
  background:
    linear-gradient(180deg, var(--sv-vellum) 0%, var(--sv-vellum) 70%, var(--sv-champagne) 100%);
  font-family: var(--sv-sans);
  -webkit-font-smoothing: antialiased;
}

body[data-size="M"] {
  --title-size: 36px;
  --composer-size: 18px;
  --credit-size: 14px;
  --lyric-size: 26px;
}

body[data-size="L"] {
  --title-size: 38px;
  --composer-size: 19px;
  --credit-size: 15px;
  --lyric-size: 30px;
}

body[data-size="S"] {
  --title-size: 35px;
  --composer-size: 17.5px;
  --credit-size: 13.5px;
  --lyric-size: 23px;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--sv-gilt);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--sv-focus-shadow);
}

.reader-header {
  position: relative;
  z-index: 20;
  height: var(--reader-header-block-size);
  padding: env(safe-area-inset-top) 12px 0;
  display: grid;
  grid-template-columns: 78px minmax(132px, 1fr) 78px;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--sv-outline-variant);
  background: rgba(251, 249, 244, 0.97);
  box-shadow: 0 7px 22px -19px var(--sv-shadow);
}

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--sv-outline-variant);
  border-radius: 50%;
  background: var(--sv-vellum);
  cursor: pointer;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.header-context {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.header-part-row {
  min-width: 0;
  max-width: 100%;
}

.header-part-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--sv-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.part-nav-button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: none;
  place-items: center;
  border: 1px solid var(--sv-gilt);
  border-radius: 50%;
  color: var(--sv-primary-container);
  background: rgba(251, 249, 244, 0.97);
  box-shadow: 0 9px 24px -16px var(--sv-shadow);
  cursor: pointer;
}

.part-nav-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.part-nav-button:active:not(:disabled) {
  background: rgba(245, 241, 230, 0.38);
}

.part-nav-button:disabled {
  border-color: var(--sv-outline-variant);
  color: var(--sv-outline);
  background: rgba(245, 243, 238, 0.72);
  box-shadow: none;
  cursor: default;
  opacity: 0.5;
}

.part-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.indicator-button {
  width: 14px;
  height: 14px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.indicator-button::after {
  width: 5px;
  height: 5px;
  border: 1px solid var(--sv-outline);
  border-radius: 50%;
  background: transparent;
  content: "";
}

.indicator-button[aria-current="true"]::after {
  width: 7px;
  height: 7px;
  border-color: var(--sv-gilt);
  background: rgba(245, 241, 230, 0.04);
  box-shadow: inset 0 0 0 1px var(--sv-gilt);
}

.preview-chip {
  min-height: 30px;
  padding: 5px 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(197, 160, 89, 0.72);
  border-radius: 999px;
  color: var(--sv-primary-container);
  background: rgba(245, 241, 230, 0.72);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.05;
}

.preview-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sv-gilt);
}

.reader-scroll {
  height: calc(
    100dvh -
    var(--reader-header-block-size) -
    var(--reader-bottom-chrome-inset)
  );
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-behavior: auto;
  scrollbar-color: var(--sv-outline-variant) transparent;
  touch-action: pan-y;
}

.part-shell {
  width: min(100%, 520px);
  min-height: 100%;
  margin: 0 auto;
  padding: 42px 18px calc(126px + env(safe-area-inset-bottom));
  padding-bottom: max(
    calc(126px + env(safe-area-inset-bottom)),
    var(--reader-bottom-chrome-inset)
  );
  will-change: auto;
}

.part-heading {
  margin-bottom: 31px;
  text-align: center;
}

.section-label,
.toc-kicker {
  margin: 0 0 9px;
  color: var(--sv-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1.25;
  text-transform: uppercase;
}

.song-title {
  margin: 0;
  font-family: var(--sv-serif);
  font-size: var(--title-size);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.02;
}

.composer-line {
  margin: 8px 0 0;
  color: var(--sv-secondary);
  font-family: var(--sv-serif);
  font-size: var(--composer-size);
  font-style: italic;
  line-height: 1.25;
}

.setting-subtitle {
  margin: 7px 0 0;
  color: var(--sv-secondary);
  font-family: var(--sv-serif);
  font-size: calc(var(--composer-size) * 0.86);
  font-style: italic;
  line-height: 1.2;
}

.setting-subtitle + .composer-line {
  margin-top: 4px;
}

.score-frame {
  min-height: 170px;
  position: relative;
}

.score {
  color: var(--sv-ink);
  opacity: 1;
  filter: blur(0);
  transition: opacity 105ms ease-out, filter 105ms ease-out;
}

.score.ink-settle {
  opacity: 0.92;
  filter: blur(0.5px);
}

.pew-layout-probe {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  left: 0;
  visibility: hidden;
  pointer-events: none;
}

.score svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  color: var(--sv-ink) !important;
  fill: var(--sv-ink);
}

.score svg .pew-verse-number {
  fill: var(--sv-secondary);
  font-weight: 600;
}

.composite-score {
  display: grid;
  gap: 0;
}

.composite-song-heading {
  margin: 0 0 22px;
  text-align: center;
}

.composite-song-section {
  margin: 0 0 7px;
  color: var(--sv-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.composite-song-title {
  margin: 0;
  font-family: var(--sv-serif);
  font-size: calc(var(--title-size) * 0.76);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.06;
}

.composite-song-composer {
  margin: 7px 0 0;
  color: var(--sv-secondary);
  font-family: var(--sv-serif);
  font-size: var(--composer-size);
  font-style: italic;
}

.composite-attribution {
  margin-top: 23px;
  text-align: center;
}

.composite-attribution p {
  margin: 0;
  color: var(--sv-on-surface-variant);
  font-size: var(--credit-size);
  font-style: italic;
  line-height: 1.48;
}

.composite-attribution p + p {
  margin-top: 5px;
}

.composite-song-divider {
  margin: 38px 0 42px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--sv-gilt);
}

.composite-song-divider span {
  height: 1px;
  background: var(--sv-outline-variant);
}

.composite-song-divider i {
  font-size: 10px;
  font-style: normal;
}

.missal-page {
  display: grid;
}

.missal-refrain-label {
  margin: 0 0 7px;
  color: var(--sv-secondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.missal-refrain {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--sv-outline-variant);
}

.missal-verses {
  margin: 19px 0 0;
  padding: 0;
  display: grid;
  gap: 17px;
  counter-reset: cantor-verse;
  list-style: none;
  font-family: var(--sv-serif);
}

.missal-verses li {
  min-width: 0;
  position: relative;
  padding-left: 27px;
  display: grid;
  gap: 1px;
  counter-increment: cantor-verse;
  font-size: var(--text-verse-size, calc(var(--lyric-size) * 0.58));
  line-height: 1.24;
}

.missal-verses.single-text-verse li {
  padding-left: 54px;
}

.missal-verses.single-text-verse li::before {
  content: attr(data-label);
  font-size: 10px;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.12em;
}

.missal-verses li::before {
  position: absolute;
  top: 0;
  left: 0;
  content: counter(cantor-verse) ".";
  color: var(--sv-secondary);
  font-family: var(--sv-sans);
  font-size: 0.72em;
  font-weight: 700;
}

.missal-verses span {
  display: block;
}

body[data-part-kind="missal"] .part-shell {
  padding-top: 26px;
}

body[data-part-kind="missal"] .part-heading {
  margin-bottom: 18px;
}

body[data-part-kind="missal"] .attribution {
  margin-top: 22px;
  padding-top: 13px;
}

.score-frame.lyrics-mode {
  min-height: 0;
}

.score-frame.reading-mode {
  min-height: 0;
}

.reading-reader {
  font-family: var(--sv-serif);
}

.reading-page {
  min-height: 390px;
  padding: 34px 16px 38px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-block: 1px solid var(--sv-gilt);
  background:
    radial-gradient(ellipse 74% 52% at 50% 40%, rgba(245, 241, 230, 0.66), transparent 72%);
  text-align: center;
}

.reading-page::before,
.reading-page::after {
  width: 52px;
  height: 1px;
  position: absolute;
  left: 50%;
  content: "";
  background: var(--sv-gilt);
  transform: translateX(-50%);
}

.reading-page::before {
  top: -1px;
}

.reading-page::after {
  bottom: -1px;
}

.reading-day {
  margin: 0;
  color: var(--sv-secondary);
  font-family: var(--sv-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.115em;
  line-height: 1.45;
  text-transform: uppercase;
}

.reading-day-segment {
  display: block;
  white-space: nowrap;
}

.reading-ornament {
  width: min(220px, 72%);
  margin: 23px 0 25px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--sv-gilt);
}

.reading-ornament span {
  height: 1px;
  background: var(--sv-outline-variant);
}

.reading-ornament i {
  font-size: 11px;
  font-style: normal;
}

.reading-synopsis-label {
  margin: 0 0 12px;
  color: var(--sv-secondary);
  font-family: var(--sv-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.reading-synopsis,
.reading-pointer {
  max-width: 440px;
  margin: 0;
  color: var(--sv-on-surface);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.48;
  text-wrap: pretty;
}

.reading-pointer {
  max-width: 400px;
  padding: 20px 18px;
  border-inline: 1px solid var(--sv-outline-variant);
  font-size: 22px;
  font-style: italic;
  line-height: 1.45;
}

.reading-link {
  margin-top: 31px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--sv-gilt);
  color: var(--sv-secondary);
  font-family: var(--sv-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.reading-link:focus-visible {
  outline: 2px solid var(--sv-gilt);
  outline-offset: 4px;
}

body[data-part-kind="reading"] .size-control,
body[data-part-kind="reading"] .attribution {
  display: none;
}

body[data-part-kind="reading"] .part-shell {
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.lyrics-reader {
  font-family: var(--sv-serif);
}

.pew-lyrics-ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 25px;
  color: var(--sv-secondary);
  font-family: var(--sv-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pew-lyrics-ornament::before,
.pew-lyrics-ornament::after {
  height: 1px;
  flex: 1;
  content: "";
  background: var(--sv-outline-variant);
}

.pew-lyrics-stanzas {
  display: grid;
  gap: 24px;
}

.pew-performed-flow {
  display: grid;
  gap: 24px;
}

.pew-part-notation {
  min-width: 0;
}

.pew-lyrics-stanza {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
}

.pew-lyrics-numeral {
  padding-top: 0.16em;
  color: var(--sv-secondary);
  font-size: calc(var(--lyric-size) * 0.7);
  font-weight: 600;
}

.pew-lyrics-stanza p,
.pew-lyrics-refrain p {
  margin: 0;
  font-size: var(--lyric-size);
  line-height: 1.48;
}

.pew-lyrics-refrain {
  position: relative;
  margin-top: 28px;
  padding: 18px 18px 18px 45px;
  border-block: 1px solid var(--sv-outline-variant);
  background: rgba(245, 241, 230, 0.26);
  font-style: italic;
}

.pew-lyrics-refrain::before {
  position: absolute;
  top: 19px;
  left: 18px;
  content: "R";
  color: var(--sv-secondary);
  font-size: calc(var(--lyric-size) * 0.72);
  font-style: normal;
  font-weight: 600;
}

.pew-refrain-cue {
  margin: -5px 0 0 34px;
  color: var(--sv-on-surface-variant);
  font-family: var(--sv-serif);
  font-size: var(--lyric-size);
  font-style: italic;
  line-height: 1.4;
}

.pew-performed-flow .pew-lyrics-refrain,
.pew-lyrics-stanzas .pew-lyrics-refrain {
  margin-top: 0;
}

.score-status {
  min-height: 18px;
  margin: 14px 0 0;
  color: var(--sv-on-surface-variant);
  font-size: 12px;
  font-style: italic;
  line-height: 1.4;
  text-align: center;
}

.score-status:empty {
  min-height: 0;
  margin: 0;
}

.score-status.error {
  color: var(--sv-error);
  font-style: normal;
  font-weight: 700;
}

.attribution {
  margin-top: 35px;
  padding-top: 18px;
  border-top: 1px solid var(--sv-outline-variant);
  text-align: center;
}

.attribution p {
  margin: 0;
  color: var(--sv-on-surface-variant);
  font-size: var(--credit-size);
  font-style: italic;
  line-height: 1.5;
}

.attribution p + p {
  margin-top: 5px;
}

.size-control {
  position: fixed;
  z-index: 30;
  right: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(238px, calc(100vw - 104px));
  min-height: 58px;
  padding: 6px;
  display: flex;
  align-items: center;
  border: 1px solid var(--sv-outline-variant);
  border-radius: 30px;
  background: rgba(251, 249, 244, 0.97);
  box-shadow: 0 12px 32px -12px var(--sv-shadow);
  transform: translateX(50%);
}

.size-control[hidden],
body[data-device-family="tablet"] .size-control {
  display: none;
}

.device-demo-chip {
  position: fixed;
  z-index: 32;
  top: calc(80px + env(safe-area-inset-top));
  left: 8px;
  min-height: 28px;
  padding: 3px 5px 3px 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--sv-outline-variant);
  border-radius: 15px;
  color: var(--sv-on-surface-variant);
  background: rgba(251, 249, 244, 0.92);
  box-shadow: 0 8px 22px -18px var(--sv-shadow);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.device-demo-chip select {
  max-width: 68px;
  height: 20px;
  padding: 0 15px 0 3px;
  border: 0;
  border-radius: 10px;
  color: var(--sv-secondary);
  background: transparent;
  font-family: var(--sv-sans);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.device-demo-chip select:focus-visible {
  outline: 2px solid var(--sv-gilt);
  outline-offset: 1px;
}

.size-label {
  width: 43px;
  color: var(--sv-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
}

.size-buttons {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.size-buttons button {
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 22px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.size-buttons button:active {
  transform: translateY(1px);
}

.size-buttons button[aria-pressed="true"] {
  border-color: var(--sv-gilt);
  background: rgba(245, 241, 230, 0.04);
  box-shadow: inset 0 0 0 1px var(--sv-gilt);
  color: var(--sv-ink);
}

.companion-partnership-banner {
  position: fixed;
  z-index: 28;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--companion-banner-block-size);
  padding-bottom: env(safe-area-inset-bottom);
  overflow: hidden;
  display: none;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(197, 160, 89, 0.7);
  background:
    radial-gradient(ellipse 52% 180% at 55% 7%, rgba(255, 246, 218, 0.38), transparent 68%),
    radial-gradient(ellipse 35% 160% at 78% 100%, rgba(143, 77, 34, 0.34), transparent 73%),
    linear-gradient(
      102deg,
      #f5f1e6 0%,
      #f4ecda 24%,
      #ddbf83 46%,
      #a56536 66%,
      #6a3c26 82%,
      #4a2b1d 100%
    );
  box-shadow: 0 -14px 30px -28px rgba(58, 40, 32, 0.7);
  isolation: isolate;
}

body[data-companion="true"] .companion-partnership-banner {
  display: flex;
}

body[data-companion="true"] {
  --companion-banner-block-size:
    calc(68px + env(safe-area-inset-bottom));
  --reader-bottom-chrome-inset: var(--companion-banner-block-size);
}

body[data-device-family="phone"]:not([data-part-kind="reading"]) {
  --reader-bottom-chrome-inset:
    calc(72px + env(safe-area-inset-bottom));
}

body[data-companion="true"][data-device-family="phone"]:not([data-part-kind="reading"]) {
  --reader-bottom-chrome-inset:
    calc(136px + env(safe-area-inset-bottom));
}

.banner-light {
  position: absolute;
  z-index: -1;
  top: -70%;
  left: -8%;
  width: 62%;
  height: 240%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 248, 222, 0.38), rgba(241, 204, 132, 0.12) 42%, transparent 72%);
  opacity: 0.44;
  transform: translate3d(-2%, 0, 0) scale(0.96);
  animation: banner-breathe 8s ease-in-out infinite;
  will-change: opacity, transform;
}

@keyframes banner-breathe {
  0%,
  100% {
    opacity: 0.4;
    transform: translate3d(-2%, 0, 0) scale(0.96);
  }

  50% {
    opacity: 0.78;
    transform: translate3d(3%, -1%, 0) scale(1.05);
  }
}

.dust-field {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.dust-field i {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #ffe9b8;
  box-shadow: 0 0 4px rgba(255, 233, 184, 0.62);
  opacity: 0.16;
  transform: translate3d(0, 0, 0);
  animation: dust-drift var(--duration) ease-in-out var(--delay) infinite;
  will-change: opacity, transform;
}

.dust-field i:nth-child(3n + 1) {
  width: 1.5px;
  height: 1.5px;
}

.dust-field i:nth-child(3n + 2) {
  width: 2.5px;
  height: 2.5px;
}

@keyframes dust-drift {
  0%,
  100% {
    opacity: 0.1;
    transform: translate3d(0, 4px, 0) scale(0.84);
  }

  38% {
    opacity: 0.48;
  }

  72% {
    opacity: 0.24;
    transform: translate3d(var(--dx), var(--dy), 0) scale(1.08);
  }
}

.partnership-lockup {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  white-space: nowrap;
}

.companion-ocp-clearspace {
  position: absolute;
  top: 50%;
  left: 0;
  width: 72px;
  height: 64px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
}

.companion-ocp-clearspace img {
  width: 39px;
  height: 39px;
  display: block;
}

.companion-powered-stack {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.companion-powered-by {
  color: var(--sv-white);
  opacity: 0.85;
  font-family: var(--sv-serif);
  font-size: 11px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 6px rgba(58, 40, 32, 0.28);
  text-align: right;
}

.partnership-wordmark {
  display: flex;
  align-items: baseline;
  color: var(--sv-white);
  font-family: var(--sv-serif);
  font-size: 17px;
  letter-spacing: 0.14em;
  line-height: 1;
  text-shadow: 0 1px 6px rgba(58, 40, 32, 0.28);
}

.partnership-parish {
  font-style: normal;
  font-weight: 600;
}

.partnership-glow {
  font-style: italic;
  font-weight: 400;
}

.partnership-tm {
  margin-left: 1px;
  font-size: 8px;
  letter-spacing: 0;
  vertical-align: top;
}

body[data-companion="true"] .device-demo-chip {
  display: none;
}

body[data-companion="true"] .score,
body[data-companion="true"] .score.ink-settle {
  opacity: 1;
  filter: none;
  transition: none;
}

body[data-companion="true"] .size-control {
  bottom: calc(78px + env(safe-area-inset-bottom));
}

body[data-companion="true"] .back-to-top {
  bottom: calc(146px + env(safe-area-inset-bottom));
}

.back-to-top {
  position: fixed;
  z-index: 31;
  right: 15px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: 48px;
  height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--sv-gilt);
  border-radius: 50%;
  background: rgba(251, 249, 244, 0.97);
  box-shadow: 0 10px 26px -13px var(--sv-shadow);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease-out, transform 160ms ease-out;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--sv-secondary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.toc-dialog {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: calc(31px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));
  border: 0;
  color: var(--sv-ink);
  background:
    linear-gradient(180deg, var(--sv-vellum) 0%, var(--sv-vellum) 64%, var(--sv-champagne) 100%);
  font-family: var(--sv-sans);
  opacity: 0;
  transition: opacity 150ms ease-out, display 150ms allow-discrete, overlay 150ms allow-discrete;
}

.toc-dialog[open] {
  opacity: 1;
}

@starting-style {
  .toc-dialog[open] {
    opacity: 0;
  }
}

.toc-dialog::backdrop {
  background: rgba(35, 20, 13, 0.14);
}

.toc-scrim,
.toc-panel {
  display: none;
}

.toc-header {
  width: min(100%, 520px);
  margin: 0 auto;
  padding-bottom: 21px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--sv-gilt);
}

.toc-kicker {
  margin-bottom: 5px;
}

.toc-header h2 {
  margin: 0;
  font-family: var(--sv-serif);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.05;
}

.toc-close {
  flex: 0 0 auto;
}

.toc-list {
  width: min(100%, 520px);
  margin: 32px auto 0;
  display: grid;
  gap: 11px;
}

.toc-item {
  width: 100%;
  min-height: 104px;
  padding: 16px 17px;
  display: grid;
  grid-template-columns: 32px 1fr 20px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--sv-outline-variant);
  border-radius: 2px;
  background: rgba(245, 241, 230, 0.04);
  cursor: pointer;
  text-align: left;
}

.toc-item[aria-current="true"] {
  border-color: var(--sv-gilt);
  background: rgba(245, 241, 230, 0.04);
  box-shadow: inset 0 0 0 1px var(--sv-gilt);
}

.toc-number {
  color: var(--sv-secondary);
  font-family: var(--sv-serif);
  font-size: 19px;
  font-style: italic;
}

.toc-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.toc-section {
  color: var(--sv-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.25;
  text-transform: uppercase;
}

.toc-song {
  margin-top: 3px;
  font-family: var(--sv-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.05;
}

.toc-composer {
  margin-top: 4px;
  color: var(--sv-on-surface-variant);
  font-family: var(--sv-serif);
  font-size: 15px;
  font-style: italic;
  line-height: 1.2;
}

.toc-arrow {
  color: var(--sv-secondary);
  font-family: var(--sv-serif);
  font-size: 24px;
  font-weight: 400;
}

.toc-footnote {
  width: min(100%, 520px);
  margin: 27px auto 0;
  color: var(--sv-on-surface-variant);
  font-family: var(--sv-serif);
  font-size: 15px;
  font-style: italic;
  text-align: center;
}

.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;
}

body[data-device-family="phone"] .reader-header {
  padding-right: max(12px, calc((100vw - 520px) / 2));
  padding-left: max(12px, calc((100vw - 520px) / 2));
}

body[data-device-family="phone"] .header-part-row {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(68px, 1fr) 32px;
  align-items: center;
  gap: 4px;
}

body[data-device-family="phone"] .part-nav-button {
  width: 32px;
  height: 32px;
  display: grid;
}

body[data-device-family="phone"] .part-nav-button svg {
  width: 18px;
  height: 18px;
}

body[data-device-family="tablet"] {
  --title-size: 38px;
  --composer-size: 19px;
  --credit-size: 14px;
}

body[data-device-family="tablet"] .reader-header {
  padding-right: max(20px, calc((100vw - 760px) / 2));
  padding-left: max(20px, calc((100vw - 760px) / 2));
  grid-template-columns: 100px minmax(250px, 1fr) 100px;
  gap: 12px;
}

body[data-device-family="tablet"] .header-part-row {
  width: min(100%, 298px);
  display: grid;
  grid-template-columns: 44px minmax(100px, 1fr) 44px;
  align-items: center;
  gap: 12px;
}

body[data-device-family="tablet"] .part-nav-button {
  width: 44px;
  height: 44px;
  display: grid;
}

body[data-device-family="tablet"] .part-shell {
  width: min(100%, 760px);
  padding: 46px 28px calc(132px + env(safe-area-inset-bottom));
  padding-bottom: max(
    calc(132px + env(safe-area-inset-bottom)),
    var(--reader-bottom-chrome-inset)
  );
}

body[data-device-family="tablet"] .part-heading {
  margin-bottom: 36px;
}

body[data-device-family="tablet"] .reading-page {
  min-height: 430px;
  padding: 46px 42px 50px;
}

body[data-device-family="tablet"] .reading-synopsis {
  font-size: 28px;
}

body[data-device-family="tablet"] .toc-panel {
  width: 320px;
  position: fixed;
  z-index: 45;
  top: calc(72px + env(safe-area-inset-top));
  bottom: 0;
  left: 0;
  padding: 25px 16px calc(24px + env(safe-area-inset-bottom));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sv-gilt);
  color: var(--sv-ink);
  background:
    linear-gradient(180deg, var(--sv-vellum) 0%, var(--sv-champagne) 100%);
  box-shadow: 18px 0 44px -32px rgba(58, 40, 32, 0.72);
  transform: translateX(-104%);
  transition: transform 180ms ease-out;
}

body[data-device-family="tablet"] .toc-panel-header {
  padding: 0 4px 17px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--sv-gilt);
}

body[data-device-family="tablet"] .toc-panel-header h2 {
  margin: 0;
  font-family: var(--sv-serif);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.05;
}

body[data-device-family="tablet"] .toc-panel-list {
  width: 100%;
  min-height: 0;
  margin-top: 17px;
  gap: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body[data-device-family="tablet"] .toc-panel-list .toc-item {
  min-height: 70px;
  padding: 10px 11px;
  grid-template-columns: 24px 1fr 14px;
  gap: 8px;
  border-color: transparent;
}

body[data-device-family="tablet"] .toc-panel-list .toc-item[aria-current="true"] {
  border-color: rgba(197, 160, 89, 0.88);
  background: rgba(245, 241, 230, 0.92);
  box-shadow: inset 2px 0 0 var(--sv-gilt);
}

body[data-device-family="tablet"] .toc-panel-list .toc-number {
  font-size: 15px;
}

body[data-device-family="tablet"] .toc-panel-list .toc-section {
  font-size: 9px;
}

body[data-device-family="tablet"] .toc-panel-list .toc-song {
  font-size: 17px;
}

body[data-device-family="tablet"] .toc-panel-list .toc-composer {
  margin-top: 2px;
  font-size: 12px;
}

body[data-device-family="tablet"][data-toc-open="true"] .toc-panel {
  transform: translateX(0);
}

body[data-device-family="tablet"] .toc-scrim {
  position: fixed;
  z-index: 44;
  inset: calc(72px + env(safe-area-inset-top)) 0 0;
  display: block;
  border: 0;
  background: rgba(35, 20, 13, 0.18);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}

body[data-device-family="tablet"][data-toc-open="true"]:not([data-toc-pinned="true"]) .toc-scrim {
  opacity: 1;
  pointer-events: auto;
}

body[data-device-family="tablet"][data-toc-pinned="true"][data-toc-open="true"] .reader-header,
body[data-device-family="tablet"][data-toc-pinned="true"][data-toc-open="true"] .reader-scroll {
  width: calc(100% - 320px);
  margin-left: 320px;
}

body[data-device-family="tablet"][data-toc-pinned="true"] .toc-panel {
  box-shadow: none;
}

body[data-device-family="tablet"][data-toc-pinned="true"] .toc-scrim {
  display: none;
}

body[data-companion="true"][data-device-family="tablet"] .toc-panel {
  bottom: var(--companion-banner-block-size);
}

body[data-companion="true"][data-device-family="tablet"] .toc-scrim {
  bottom: var(--companion-banner-block-size);
}

@media (orientation: landscape) {
  body[data-device-family="tablet"] .toc-panel {
    padding: 20px 16px 16px;
  }

  body[data-device-family="tablet"] .toc-panel-header {
    flex: 0 0 auto;
    padding-bottom: 12px;
  }

  body[data-device-family="tablet"] .toc-panel-list {
    flex: 1 1 auto;
    margin-top: 10px;
    gap: 2px;
  }

  body[data-device-family="tablet"] .toc-panel-list .toc-item {
    min-height: 52px;
    padding: 5px 8px;
  }

  body[data-device-family="tablet"] .toc-panel-list .toc-section {
    font-size: 8px;
    line-height: 1.1;
  }

  body[data-device-family="tablet"] .toc-panel-list .toc-song {
    font-size: 15px;
    line-height: 1.08;
  }

  body[data-device-family="tablet"] .toc-panel-list .toc-composer {
    margin-top: 1px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  body[data-device-family="phone"] {
    --reader-header-block-size:
      calc(52px + env(safe-area-inset-top));
  }

  body[data-device-family="phone"]:not([data-part-kind="reading"]) {
    --reader-bottom-chrome-inset:
      calc(90px + env(safe-area-inset-bottom));
  }

  body[data-companion="true"][data-device-family="phone"] {
    --companion-banner-block-size:
      calc(44px + env(safe-area-inset-bottom));
  }

  body[data-companion="true"][data-device-family="phone"][data-part-kind="reading"] {
    --reader-bottom-chrome-inset: var(--companion-banner-block-size);
  }

  body[data-companion="true"][data-device-family="phone"]:not([data-part-kind="reading"]) {
    --reader-bottom-chrome-inset:
      calc(88px + env(safe-area-inset-bottom));
  }

  body[data-device-family="phone"] .reader-header {
    height: var(--reader-header-block-size);
    grid-template-columns: 56px minmax(128px, 1fr) 56px;
  }

  body[data-device-family="phone"] .reader-scroll {
    height: calc(
      100dvh -
      var(--reader-header-block-size) -
      var(--reader-bottom-chrome-inset)
    );
  }

  body[data-device-family="phone"] .icon-button {
    width: 36px;
    height: 36px;
  }

  body[data-device-family="phone"] .preview-chip {
    min-height: 24px;
    padding: 3px 5px;
    font-size: 7px;
  }

  body[data-device-family="phone"] .part-shell {
    width: min(100%, 760px);
    padding: 20px 18px calc(76px + env(safe-area-inset-bottom));
    padding-bottom: max(
      calc(76px + env(safe-area-inset-bottom)),
      var(--reader-bottom-chrome-inset)
    );
  }

  body[data-device-family="phone"] .part-heading {
    margin-bottom: 16px;
  }

  body[data-device-family="phone"] .size-control {
    right: 10px;
    bottom: calc(50px + env(safe-area-inset-bottom));
    width: 144px;
    min-height: 38px;
    padding: 3px;
    transform: none;
  }

  body[data-device-family="phone"] .size-label {
    display: none;
  }

  body[data-device-family="phone"] .size-buttons button {
    height: 32px;
  }

  body[data-companion="true"][data-device-family="phone"] .companion-partnership-banner {
    height: var(--companion-banner-block-size);
  }

  body[data-companion="true"][data-device-family="phone"] .size-control {
    bottom: calc(48px + env(safe-area-inset-bottom));
  }
}

@media (hover: hover) {
  .part-nav-button:hover:not(:disabled),
  .icon-button:hover {
    border-color: var(--sv-gilt);
    background: rgba(245, 241, 230, 0.42);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }

  .score.ink-settle {
    opacity: 1;
    filter: none;
  }

  .back-to-top {
    transform: none;
  }

  .banner-light,
  .dust-field i {
    animation: none !important;
  }

  .banner-light {
    opacity: 0.58;
    transform: none;
  }

  .dust-field i {
    opacity: 0.22;
    transform: none;
  }
}
