body.bible {
  font-size: calc(1.25rem * var(--reader-scale, 1));
}

.chapter-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  list-style: none;
  padding: 0;
}

.flash {
  color: var(--accent);
}

mark {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: inherit;
}

.chapter form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-family: var(--sans);
}

.chapter form input,
.chapter form button {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
}

.install-banner:not([hidden]) {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  background: var(--ink);
  color: var(--paper);
}

.install-banner button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  padding: 0.2rem 0.5rem;
}

.reader-chrome {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8125rem;
}

.reader-chrome.is-hidden {
  transform: translateY(-100%);
  transition: transform 160ms ease;
}

.reader-chrome select,
.reader-chrome button {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.3rem 0.5rem;
}

.chapter {
  position: relative;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
}

.chapter .verse {
  display: inline;
  /* Keep #vN jumps clear of the sticky reader chrome. */
  scroll-margin-top: 5rem;
}

.chapter .vn {
  font-family: var(--sans);
  font-size: 0.7em;
  font-weight: 500;
  color: var(--muted);
  margin-right: 0.3em;
  vertical-align: super;
}

.chapter .vn.has-note a {
  color: var(--accent);
  cursor: help;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.chapter .vn.has-note a[aria-expanded="true"] {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 2px;
}

.chapter .p {
  margin: 0 0 0.9em;
}

.chapter .q,
.chapter .q1 {
  margin: 0 0 0.15em 1.5em;
}

.chapter .q2 {
  margin: 0 0 0.15em 2.5em;
}

.chapter .q3,
.chapter .q4 {
  margin: 0 0 0.15em 3.5em;
}

.chapter .s {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 2rem 0 0.8rem;
}

.chapter .sp,
.chapter .d {
  font-style: italic;
  color: var(--muted);
}

.chapter .b {
  height: 0.8em;
}

.chapter .note-ref {
  font-family: var(--serif);
  font-size: 0.75em;
  font-style: italic;
  font-weight: 400;
}

.chapter .note-ref a {
  cursor: help;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.chapter .note-ref a[aria-expanded="true"] {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 2px;
}

.chapter .notes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--muted);
}

.chapter .notes ol {
  list-style: none;
  padding-left: 0;
}

.chapter .notes li + li {
  margin-top: 0.35em;
}

.chapter .notes .marker {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  margin-right: 0.35em;
}

.chapter .notes .c-fr,
.chapter .notes .c-xo,
.chapter .notes .c-xop {
  display: none;
}

.note-popover {
  position: absolute;
  z-index: 5;
  width: max-content;
  max-width: min(22em, calc(100% - 1.5rem));
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 0.35rem 1.1rem color-mix(in srgb, var(--ink) 16%, transparent);
  font-size: 0.88em;
  line-height: 1.45;
}

.note-popover-body {
  max-height: min(40vh, 16rem);
  overflow: auto;
  padding: 0.65rem 0.85rem;
}

.note-chunk + .note-chunk {
  margin-top: 0.55em;
  padding-top: 0.55em;
  border-top: 1px solid var(--rule);
}

.note-popover .marker,
.note-popover .c-fr,
.note-popover .c-xo,
.note-popover .c-xop {
  display: none;
}

.note-popover .c-xt,
.note-popover .c-ft {
  display: contents;
}

.note-popover::after {
  content: "";
  position: absolute;
  left: var(--caret-left, 50%);
  width: 0.45rem;
  height: 0.45rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  transform: translateX(-50%) rotate(45deg);
}

.note-popover[data-placement="below"]::after {
  top: -5px;
  border-right: none;
  border-bottom: none;
}

.note-popover[data-placement="above"]::after {
  bottom: -5px;
  border-left: none;
  border-top: none;
}

@keyframes note-in-below {
  from { opacity: 0; transform: translateY(-0.2rem); }
  to { opacity: 1; transform: none; }
}

@keyframes note-in-above {
  from { opacity: 0; transform: translateY(0.2rem); }
  to { opacity: 1; transform: none; }
}

.note-popover[data-placement="below"] {
  animation: note-in-below 140ms ease-out;
}

.note-popover[data-placement="above"] {
  animation: note-in-above 140ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .note-popover {
    animation: none;
  }
}

.chapter .c-nd {
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

.unlock {
  max-width: 22em;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.unlock input,
.unlock button {
  display: block;
  width: 100%;
  font: inherit;
  margin-top: 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}

.unlock button {
  margin-top: 1rem;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

.quick-nav dialog {
  width: min(28rem, calc(100vw - 2rem));
  margin: 12vh auto auto;
  padding: 0;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.quick-nav dialog::backdrop {
  background: color-mix(in srgb, var(--ink) 25%, transparent);
}

.quick-nav input {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  padding: 0.75rem 1rem;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  outline: none;
}

.quick-nav [role="listbox"] {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
}

.quick-nav [role="listbox"]:empty {
  display: none;
}

.quick-nav [role="option"] {
  padding: 0.45rem 1rem;
  cursor: pointer;
}

.quick-nav [role="option"][aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.quick-nav-empty {
  margin: 0;
  padding: 0.6rem 1rem;
  color: var(--muted);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.icon-button svg {
  width: 1.25em;
  height: 1.25em;
}

.reader-chrome .icon-button {
  box-sizing: border-box;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 4%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 6px;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 10%, transparent);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 60ms ease;
}

.reader-chrome .icon-button:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 9%, var(--paper));
  border-color: color-mix(in srgb, var(--ink) 30%, transparent);
}

.reader-chrome .icon-button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.reader-chrome .icon-button svg {
  width: 1.15rem;
  height: 1.15rem;
}
