/* Storyteller: one stylesheet, system fonts only, light / dark / match the device. */

:root {
  color-scheme: light;
  --bg: #fffdf8;
  --fg: #1f1d1a;
  --muted: #5d574e;
  --line: #e2dacb;
  --card: #ffffff;
  --tint: #f6efe2;
  --accent: #8a4b12;
  --accent-fg: #ffffff;
  --warn: #9a3412;
  --ok: #166534;
  --mark: #ffe08a;
  --mark-fg: #1f1d1a;
  --focus: #1a5fb4;
  --author: #767676;
  --serif:
    "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, "Bitstream Charter", Georgia,
    "Noto Serif", "DejaVu Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17171c;
    --fg: #e9e5dc;
    --muted: #b0a99d;
    --line: #34343c;
    --card: #1e1e24;
    --tint: #26252b;
    --accent: #f0b46a;
    --accent-fg: #1a1408;
    --warn: #fdba74;
    --ok: #86efac;
    --mark: #6b5a17;
    --mark-fg: #fff8dc;
    --focus: #8ab4f8;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17171c;
  --fg: #e9e5dc;
  --muted: #b0a99d;
  --line: #34343c;
  --card: #1e1e24;
  --tint: #26252b;
  --accent: #f0b46a;
  --accent-fg: #1a1408;
  --warn: #fdba74;
  --ok: #86efac;
  --mark: #6b5a17;
  --mark-fg: #fff8dc;
  --focus: #8ab4f8;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1rem / 1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

main:focus {
  outline: none;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 1.5em 0 0.5em;
}

h1 {
  font-size: 1.9rem;
  margin-top: 0.5rem;
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.05rem;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

mark {
  background: var(--mark);
  color: var(--mark-fg);
  border-radius: 2px;
  padding: 0 0.1em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--card);
  color: var(--fg);
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--focus);
  z-index: 10;
}

.skip:focus {
  top: 0.5rem;
}

.js-only {
  display: none !important;
}

.js .js-only {
  display: inline-flex !important;
}

.js .no-js-only {
  display: none;
}

.small {
  font-size: 0.875rem;
  color: var(--muted);
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 0;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

/* ── Header and footer ── */

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.brand {
  font: 600 1.1rem var(--serif);
  color: var(--fg);
  text-decoration: none;
}

header.site nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

header.site nav a {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
}

header.site nav a:hover {
  background: var(--tint);
}

header.site nav a[aria-current="page"] {
  background: var(--tint);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

form.search {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
}

form.search input {
  width: 12rem;
  max-width: 50vw;
}

footer.site {
  border-top: 1px solid var(--line);
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

footer.site p {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
}

.theme-picker {
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--muted);
}

form.search + .theme-picker {
  margin-left: 0;
}

/* ── Home: the main actions ── */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  align-items: center;
  margin: 1.25rem 0 1.75rem;
}

.contents .own-page {
  font: 0.85rem var(--sans);
  color: var(--muted);
}

.suggest-toggle {
  margin: 0.5rem 0 0;
}

/* ── Forms ── */

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

input[type="text"],
input[type="search"],
input[type="number"],
input:not([type]),
select {
  background: var(--card);
  border: 1px solid var(--muted);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  min-height: 2.5rem;
}

input[type="number"] {
  width: 6rem;
}

input[type="color"] {
  width: 3.5rem;
  height: 2.5rem;
  padding: 0.15rem;
  border: 1px solid var(--muted);
  border-radius: 6px;
  background: var(--card);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--muted);
  border-radius: 6px;
  background: var(--card);
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}

button:hover,
.button:hover {
  background: var(--tint);
}

button.primary,
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}

button.primary:hover,
.button.primary:hover {
  filter: brightness(1.08);
  background: var(--accent);
}

button.link {
  border: 0;
  background: none;
  padding: 0;
  min-height: 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

form.inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 1rem;
}

legend {
  font-weight: 600;
  padding: 0 0.35rem;
}

label.choice {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.3rem 0;
}

label.choice input {
  margin: 0;
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  transform: translateY(0.15rem);
}

.indent {
  margin-left: 1.6rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0;
}

.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  background: var(--card);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  margin: 1rem 0;
}

.notice p {
  margin: 0 0 0.5rem;
}

.notice.error {
  border-left-color: var(--warn);
}

.note.warn,
.status.error {
  color: var(--warn);
}

.badge {
  display: inline-block;
  font: 600 0.75rem / 1.4 var(--sans);
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--muted);
  color: var(--muted);
  vertical-align: 0.1em;
  white-space: nowrap;
}

.badge.warn {
  border-color: var(--warn);
  color: var(--warn);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 1.25rem 1.25rem;
  margin: 1.25rem 0;
}

/* The full archive: its own kind of download, set apart from the book. */
.archive-card {
  background: var(--tint);
  border-left: 4px solid var(--accent);
}

.message {
  max-width: 36rem;
  margin: 3rem auto;
}

.signin .button {
  font-size: 1.1rem;
  padding: 0.6rem 1.2rem;
}

.prose {
  max-width: 65ch;
  margin: 0 auto;
}

.prose li {
  margin: 0.4rem 0;
}

.tool.narrow {
  max-width: 48rem;
  margin: 0 auto;
}

/* ── Home ── */

.home {
  max-width: 48rem;
  margin: 0 auto;
}

.book-head h1 {
  font: 600 2.4rem / 1.15 var(--serif);
  margin: 1rem 0 0.25rem;
}

.legend {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
}

.swatch {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 3px;
  background: var(--author);
  border: 1px solid var(--line);
  vertical-align: -0.15em;
  flex: none;
}

.swatch.preset-0-0 {
  background: #0072b2;
}
.swatch.preset-0-1 {
  background: #d55e00;
}
.swatch.preset-1-0 {
  background: #009e73;
}
.swatch.preset-1-1 {
  background: #cc79a7;
}
.swatch.preset-2-0 {
  background: #4477aa;
}
.swatch.preset-2-1 {
  background: #ee6677;
}

.initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 2px solid var(--author);
  border-radius: 50%;
  font: 700 0.8rem / 1 var(--sans);
  color: var(--fg);
  flex: none;
}

.contents {
  padding-left: 0;
  list-style: none;
  font-family: var(--serif);
  font-size: 1.1rem;
}

.contents li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

.contents .words {
  margin-left: auto;
  font: 0.875rem var(--sans);
  color: var(--muted);
}

/* ── Reader ── */

main.reader {
  max-width: none;
  /* Nothing in the margins ever makes the page scroll sideways. */
  overflow-x: clip;
}

/*
 * The text column is --measure wide. Each passage's text sits inside a
 * coloured line (border + padding = --gutter), so headings and scene breaks
 * are centred on the text itself: they start --gutter in. Pictures go in the
 * right margin on wide screens without narrowing the text.
 */
.chapter {
  --measure: 74ch;
  --gutter: calc(3px + 0.85rem);
  max-width: var(--measure);
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.6;
}

.chapter-head {
  text-align: center;
  margin: 2rem 0 2.5rem;
  padding-left: var(--gutter);
}

.chapter-head .kicker {
  font: 0.85rem var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.chapter-head h1 {
  font: 600 2rem / 1.2 var(--serif);
  margin: 0.5rem 0;
}

.chapter-n {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.chapter-head .meta,
.chapter-head .tools,
.part-head .meta {
  font: 0.9rem var(--sans);
  color: var(--muted);
  margin: 0.25rem 0;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font: 0.9rem var(--sans);
  padding: 0.75rem 0 0.75rem var(--gutter);
}

.chapter-nav.bottom {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
}

/* The whole story: contents, then each chapter as a section. */
.toc {
  margin: 0 0 2rem var(--gutter);
  font: 0.95rem var(--sans);
}

.toc summary {
  cursor: pointer;
  color: var(--accent);
}

.toc .contents {
  font-size: 1rem;
}

.part + .part {
  margin-top: 3.5rem;
}

.part-head {
  text-align: center;
  margin: 0 0 2rem;
  padding-left: var(--gutter);
  scroll-margin-top: 1rem;
}

.part[id] {
  scroll-margin-top: 1rem;
}

.part-head h2 {
  font: 600 1.6rem / 1.25 var(--serif);
  margin: 0 0 0.25rem;
}

/*
 * Chunks of about 1,200 words, drawn only near the screen. Their size class
 * (cv-1 to cv-8, about 250 words a step) holds roughly the right room until
 * then; once drawn, the browser remembers the real height.
 */
.chunk {
  --cv-unit: 1100px;
  content-visibility: auto;
  contain-intrinsic-block-size: auto calc(var(--cv, 5) * var(--cv-unit));
}

.cv-1 {
  --cv: 1;
}
.cv-2 {
  --cv: 2;
}
.cv-3 {
  --cv: 3;
}
.cv-4 {
  --cv: 4;
}
.cv-5 {
  --cv: 5;
}
.cv-6 {
  --cv: 6;
}
.cv-7 {
  --cv: 7;
}
.cv-8 {
  --cv: 8;
}

.passage {
  position: relative;
  margin-top: 0.3em;
}

.passage .text {
  border-left: 3px solid var(--author);
  padding-left: calc(var(--gutter) - 3px);
  position: relative;
}

.passage p {
  margin: 0;
  text-indent: 1.5em;
  hyphens: auto;
  overflow-wrap: break-word;
}

.passage.opening .text p:first-of-type,
hr.scene + .passage .text p:first-of-type {
  text-indent: 0;
}

.passage .initial {
  display: none;
}

.show-initials .passage .initial,
.initials-on .passage .initial {
  display: inline-flex;
  float: left;
  margin: 0.15rem 0.5rem 0 0;
}

/* A scene break: mostly space, with a small quiet mark centred on the text. */
hr.scene {
  border: 0;
  height: 1em;
  margin: 0.45em 0 0.45em var(--gutter);
  padding: 0;
  text-align: center;
  overflow: visible;
  color: var(--muted);
  line-height: 1;
}

hr.scene::after {
  content: "* * *";
  font: 0.85rem / 1 var(--sans);
  letter-spacing: 0.35em;
}

.notes {
  margin: 0.6rem 0 0.9rem 1rem;
  display: grid;
  gap: 0.5rem;
}

.note {
  margin: 0;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font: 0.875rem / 1.4 var(--sans);
  color: var(--muted);
}

.note .pic {
  flex: none;
  display: block;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.note img {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
}

@media (min-width: 40rem) {
  .chunk {
    --cv-unit: 620px;
  }
}

/*
 * Breaks from the reader: a quiet "+" on each paragraph that starts a post,
 * shown on hover, focus or tap (app.js marks a tapped paragraph). On narrow
 * screens it sits at the end of the paragraph; on wide ones in the margin.
 */
.add-break {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0 0.4em;
  text-indent: 0;
  font: 600 0.8rem / 1.4 var(--sans);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.passage p:hover > .add-break,
.passage p.show-break > .add-break,
.add-break:focus {
  opacity: 1;
  pointer-events: auto;
}

.add-break:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.break-form {
  display: grid;
  gap: 0.5rem;
  margin: 0.6rem 0;
  padding: 0.75rem 0.9rem;
  font: 0.95rem / 1.4 var(--sans);
  text-indent: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.break-form[hidden] {
  display: none;
}

.break-form .small {
  margin: 0;
}

/* Rename / remove a chapter's break: beside its heading, shown on hover or focus. */
.heading-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.25rem 1rem;
  min-height: 1.75rem;
  font: 0.85rem var(--sans);
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s;
}

.part-head:hover .heading-tools,
.chapter-head:hover .heading-tools,
.heading-tools:focus-within,
.heading-tools:has(details[open]) {
  opacity: 1;
}

.heading-tools summary {
  cursor: pointer;
  color: var(--accent);
}

.heading-tools button.link {
  font-size: inherit;
}

/* Touch screens have no hover: the heading tools stay faintly visible (chapters are few). */
@media (hover: none) {
  .heading-tools {
    opacity: 0.75;
  }
}

/* Initials beside the line, outside the text (from 56rem, where there's room). A chunk clips what's outside it, so it reaches out to hold them. */
@media (min-width: 56rem) {
  .passage p {
    position: relative;
  }

  /* In the margin: hovering there shows it. */
  .add-break {
    position: absolute;
    top: 0.2em;
    left: calc(-1 * var(--gutter) - 1.8rem);
    margin: 0;
    pointer-events: auto;
  }

  .show-initials .add-break.with-initial,
  .initials-on .add-break.with-initial {
    top: 2.1rem;
  }

  .show-initials .passage .initial,
  .initials-on .passage .initial {
    position: absolute;
    left: -2.4rem;
    top: 0.1rem;
    float: none;
    margin: 0;
  }

  .chunk {
    margin-left: -3rem;
    padding-left: 3rem;
  }
}

/* Wide screens: pictures in the right margin; the text keeps its width. */
@media (min-width: 68rem) {
  .chapter {
    /* Centred, unless that leaves too little room on the right for the pictures. */
    margin-left: max(0px, min(calc((100% - var(--measure)) / 2), calc(100% - var(--measure) - 17rem)));
    margin-right: auto;
  }

  .chunk {
    --cv-unit: 480px;
    margin-right: -17rem;
    padding-right: 17rem;
  }

  .passage.has-notes {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 15rem;
    column-gap: 2rem;
    margin-right: -17rem;
  }

  .passage.has-notes .text {
    grid-column: 1;
    grid-row: 1;
  }

  .notes {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    margin: 0.3rem 0 0;
  }

  .note {
    display: block;
  }

  .note .pic {
    margin-bottom: 0.3rem;
  }

  .note img {
    width: 100%;
    height: auto;
    max-height: 22rem;
    object-fit: contain;
    background: var(--tint);
  }
}

@media (max-width: 40rem) {
  main {
    padding: 1rem 0.75rem 2.5rem;
  }

  .chapter {
    --gutter: calc(3px + 0.65rem);
    font-size: 1.08rem;
  }

  form.search {
    margin-left: 0;
    width: 100%;
  }

  form.search input {
    flex: 1;
    width: auto;
    max-width: none;
  }
}

/* ── Tools ── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  margin: 1rem 0;
}

.views {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.views a {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--fg);
}

.views a[aria-current="page"] {
  background: var(--tint);
  border-color: var(--accent);
  font-weight: 600;
}

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

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

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

.post {
  border-left: 4px solid var(--author);
  margin: 0 0 0.4rem;
  scroll-margin-top: 4rem;
}

.post-body {
  padding: 0.4rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
}

.post.left-out .post-body {
  opacity: 0.75;
  background: repeating-linear-gradient(135deg, var(--card), var(--card) 8px, var(--tint) 8px, var(--tint) 16px);
}

.post.suggested .post-body {
  border-color: var(--accent);
}

.post:target .post-body {
  box-shadow: 0 0 0 3px var(--focus);
}

.post-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: baseline;
}

.post-meta .who {
  font-weight: 600;
  color: var(--fg);
}

.read-link {
  margin-left: auto;
}

.excerpt {
  margin: 0.2rem 0;
  font-family: var(--serif);
  overflow-wrap: anywhere;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0.4rem -4px;
  font-weight: 700;
  color: var(--accent);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-top: 2px solid var(--accent);
}

.divider.scene {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.divider.scene::before,
.divider.scene::after {
  border-top: 1px dashed var(--muted);
}

.suggestion {
  margin: 0.4rem 0;
  padding: 0.5rem 0.75rem;
  background: var(--tint);
  border-radius: 6px;
}

.suggestion p {
  margin: 0 0 0.4rem;
}

.post-actions summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--accent);
  padding: 0.25rem 0;
  width: max-content;
}

.post-actions form {
  padding: 0.25rem 0 0.5rem;
}

.post-actions fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: center;
  margin: 0.5rem 0 0;
}

.post-actions label.choice {
  padding: 0;
}

.results {
  padding: 0;
  list-style: none;
}

.results li {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}

.results .links {
  margin: 0;
  font-size: 0.9rem;
}

.search-big {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.search-big input {
  flex: 1;
  min-width: 12rem;
}

.pictures {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}

.picture {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  scroll-margin-top: 4rem;
}

.picture.is-hidden .thumb img {
  opacity: 0.4;
}

.thumb {
  display: block;
  background: var(--tint);
}

.thumb img {
  display: block;
  width: 100%;
  height: 12rem;
  object-fit: contain;
}

.picture-body {
  padding: 0.6rem 0.9rem 0.9rem;
}

.picture-body input:not([type="hidden"]) {
  width: 100%;
}

.picture-body label {
  display: block;
  font-weight: 600;
  margin-top: 0.5rem;
}

.author fieldset {
  margin: 1rem 0;
}

.author legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author .row label {
  min-width: 6rem;
}

.presets {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.book-form fieldset {
  background: var(--bg);
}

.builds {
  list-style: none;
  padding: 0;
}

.build {
  border-top: 1px solid var(--line);
  padding: 0.5rem 0;
}

.build p {
  margin: 0.25rem 0;
}

progress {
  vertical-align: middle;
  width: 6rem;
}

@media print {
  header.site,
  footer.site,
  .chapter-nav,
  .chapter-head .tools,
  .skip,
  .toc,
  .part-head .meta,
  .add-break,
  .heading-tools,
  .break-form {
    display: none !important;
  }

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

  .chapter {
    max-width: none;
  }

  .chunk {
    content-visibility: visible;
    margin: 0;
    padding: 0;
  }
}

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